-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Better handling of undetected project types #1647
Conversation
Any help with wording is welcome =) |
Do we need to check that project folder is empty and provide this options only in that case? |
Not really, as all the boilerplates create a new folder |
Codecov Report
@@ Coverage Diff @@
## release/3.3 #1647 +/- ##
==============================================
- Coverage 22.46% 21.06% -1.4%
==============================================
Files 321 252 -69
Lines 6276 5748 -528
Branches 787 685 -102
==============================================
- Hits 1410 1211 -199
+ Misses 4275 4015 -260
+ Partials 591 522 -69
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should really tell the users if we're going to install something. I think it might be helpful to go one more step and ask a [y/N] to see if the user wants to install the package if it's not currently installed too.
lib/cli/bin/generate.js
Outdated
|
||
default: | ||
paddedLog(`We couldn't detect your project type. (code: ${projectType})`); | ||
paddedLog('Check that you are at your project directory.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure you are running the 'getstorybook' command in your project's root directory.
maybe?
lib/cli/bin/generate.js
Outdated
paddedLog(`We couldn't detect your project type. (code: ${projectType})`); | ||
paddedLog('Check that you are at your project directory.'); | ||
paddedLog( | ||
'You can bootstrap a project using some of the options below, or follow one of the slow start guides: https://storybook.js.org/basics/slow-start-guide/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also start a project using ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create a project
maybe?
lib/cli/bin/generate.js
Outdated
{ | ||
type: 'list', | ||
name: 'type', | ||
message: 'Which kind of project would you like to bootstrap?', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which kind of project boilerplate would you like to install and start?
I think install
is pretty key here since we are going installing something into the user's system without their acknowledgement here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless it's yarn create
, in which case the installation will be temporary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we globally installing anything on the user's behalf at all? AFAIK we shouldn't be.
So what would you offer instead? Just print command-line instructions for those boilerplates? |
@Hypnosphi we definitely shouldn't be installing things globally on the user's behalf. I think we can either print out instructions or better yet direct them to a docs page where we offer some instructions. |
I can see how running create-react-app for the user if they have it installed is a potentially valid use case, but ideally I don't think we should be installing anything for the user either. Either they have it installed and we run it for them, or we give them instructions to install and have them rerun |
If the tool offers me an option to run some routine steps for me, and is explicit when it comes to global stuff (see latest commit), why is this something wrong? In my view it's far better UX when comparing to "copy and paste URL from terminal to browser, and then a bunch of commands back from browser to terminal" In fact we can even offer to uninstall those as soon as we're done, similar to what |
what do you think about |
I like the idea. If either |
we can have npx as a dependency of getstorybook right? so user don't need to have it ps sorry, don't need |
Why do we want to get into the business of creating projects for users? It's perfectly valid for |
But should we do this? On the other hand, we claim to be compatible with these generators (we currently are). So maybe we SHOULD do something like this to keep us alert and compatible. |
Replaced with #1825 @ndelangen's concern about compatibility with latest generators versions seem to be solved with #1767 |
Fixes #475
Currently, we are not really helpful when we can't detect project type. This PR adds a note about slow start guildes and offers options for bootstrapping a project