Closed eahefnawy closed 4 years ago
@eahefnawy I like this idea. One quick question, since @medikoo has already added new user onboarding flow for CN commands when user type sls
in a non-serverless folder, it will onboard users using interactive CLI asking user choose a template and create the project from the template. It's kind of similar to serverless init
. Should we consider merging those two together?
@eahefnawy to me it looks that serverless init
is components version of onboarding we do with serverless
for v1.
So I take severless init
is simply a hack to enforce Components onboarding instead of v1 ?
Note that (as @hkbarton mentioned) for users in China we already enforce (tencent) components onboarding for serverless
command.
@hkbarton @medikoo @tinafangkunding that's correct. I'd love to integrate it to the root serverless
command though if the user won't be distracted by v1 stuff.
@hkbarton @medikoo @tinafangkunding that's correct. I'd love to integrate it to the root serverless command though if the user won't be distracted by v1 stuff.
We may integrate like that (and that'll be cleanest I think), but for that we need to add a question, to confirm if user wants to create a component or v1 project. Having an answer we will follow with chosen flow
This issue was closed in: https://github.com/serverless/components/pull/678
We have two onboarding issues:
Because of this, I'd like to introduce a new
serverless init
command that integrates with a new templating implementationthe
serverless init
commandJust like the framework's create command. This command downloads a template into the cwd, but with a much better experience. Because the framework does not have an init command, we could reserve it to components. Here's how it'd work:
In an empty directory, you'd run:
Because
init
would be a reserved command for components, the runtime would be routed to the components project. This command would list the available components, and asks the user to choose one to initializewhen a user makes their choice, the CLI fetches the component metadata from the platform, and use the
repo
property to check fortemplates
directory in that components repo. It'll then list the available templates in realtime in another list for the user to choose from:When the user makes their choice, the CLI would download the relevant directory from the components repo into the cwd.
With this in place, we can keep adding templates to each component without having to make a new CLI release, and the interactive experience would make it a lot easier to get started with components