-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CLI] Get rid of Yeoman #844
Comments
@bajtos I would like to help however I can on this issue. |
@raymondfeng Here are the issues I was experiencing in the old generator-loopback frequently:
@privateOmega thank you for chiming in! Right now, we are debating whether we actually want to drop Yeoman or whether it's perhaps not that bad. Once we reach consensus, I can show you pointers where to start. |
Another missing feature is inability to verify configuration of individual prompts. For example when using a choices question populated dynamically (e.g. the datasource prompt showing all datasources known by the app), we want to verify the list of choices offered. |
I feel like this is something that should be done ASAP before we pile on more features onto our CLI tool. I'm for replacing Yeoman if we can come up with a prototype that addresses the problems that Yeoman faces. |
I suggest that we don't rush into a conclusion. It's probably the best choice to have a time-boxed spike to:
|
+1 for starting with a spike. |
+1 for spike. Aside from verifying the pain points listed above and the plan outlined by @raymondfeng, are there any additional questions we want to answer in this spike? |
With the spike #1187 created, I'm not sure what's the best way to handle this issue. Keep it open? change it to be an epic? |
An issue that arose from #1578:
|
A module we could use for interactive prompts: https://github.com/terkelg/prompts I especially like |
https://oclif.io seems to be a popular library used e.g. by Heroku CLI. |
Looks very good. +1 for plugins @oclif/plugin-not-found (e.g. "did you mean?") @oclif/plugin-autocomplete (add bash autocomplete). |
Added another pain point:
|
Refactor the CLI package to use inquirer and ejs directly, get rid of the dependency on Yeoman.
This will allow us to use TypeScript too, we should migrate the CLI codebase to the standard TypeScript project as part of this task.
UPDATE 2020-02-11: Let's not limit ourselves to inquirer and ejs only. The ecosystem offers many more alternatives for building CLI tools, we should research the options and pick the best one. See the comments below for inspiration.
Related:
List of issues compiled from the discussion:
loopback-cli
, our "model" generator is invoking "property" generator in a loop. This is not supported by Yeoman anymore, we have a hacky workaround in place. As a result, upgrades to newer versions of Yeoman were usually painful, because the hacky workaround had to be updated to match the new internals of Yeoman.if (this.shouldExit()) return false;
as a horrible code smell. (See e.g. here and here and here). I was took a quick glance at other generators, not all actions start withshouldExit
check, so we may already have subtle bugs there!index.js
files, which makes navigation difficult to me. Instead ofapp/index.js
, I'd like to haveapp.generator.js
file.async
/await
, I prefer to write idiomatic JavaScript instead.stdin
has to use readline or complex workarounds, it's not possible to read entire input into a string using the usual streams API.We need to call(We found a solution for this.)process.chdir
in our tests, which makes it impossible to run the tests in parallel via worker threads. See run Mocha's tests concurrently mochajs/mocha#2839The text was updated successfully, but these errors were encountered: