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
checks if babel is installed globally and displays correct cli message #5258
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0ee810c
checks if babel is installed globally and displays correct cli messag…
xtina-starr 827c953
recommend local installation and fix lint errors
xtina-starr e40d780
uses babel-cli vs babel
xtina-starr 2f2f843
switch back to babel
xtina-starr 7866235
use process.cwd() to determine if globally executed
xtina-starr 03a021b
checks for /node_module/.bin/babel
xtina-starr 3e27ebd
compare execPath and module execution path to determine global or loc…
xtina-starr b6dc36f
Move the babel/cli.js into a 'src' so the 'const's are compiled Node …
loganfsmyth File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
#!/usr/bin/env node | ||
const isGlobal = require("is-global"); | ||
|
||
const globalMessage = isGlobal() ? " -g" : ""; | ||
|
||
console.error("You have mistakenly installed the `babel` package, which is a no-op in Babel 6.\n" + | ||
"Babel's CLI commands have been moved from the `babel` package to the `babel-cli` package.\n" + | ||
"\n" + | ||
" npm uninstall babel\n" + | ||
" npm install babel-cli\n" + | ||
" npm uninstall" + globalMessage + " babel-cli\n" + | ||
" npm install --save-dev babel-cli\n" + | ||
"\n" + | ||
"See http://babeljs.io/docs/usage/cli/ for setup instructions."); | ||
process.exit(1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think there was a miscommunication, having this be
babel
and notbabel-cli
is on purpose, becausebabel
is the package that contains the script that prints this warning, and we want to tell people to remove it.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.
Ah, I see. Other than changing
babel-cli
back tobabel
is there any other feedback for this PR? Also is it okay just to add another commit to make this change or do you prefer I rebase to keep the commit history clean?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.
For PRs with a few work-in-progress commits like this, we'll probably github's squash-and-merge behavior, so you are free to push another commit and it'll all get squashed in the end.
I don't have any other comments, looks solid :)
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.
Sweet, thx!