Skip to content
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

Fix eject command updating scripts output #2562

Merged

Conversation

paweljedrzejczyk
Copy link
Contributor

Hi :) I've a spotted a small bug in eject command output.
Steps to reproduce:

Given the package.json file:

"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"stylelint": "node ./node_modules/stylelint/bin/stylelint.js src/**/*.scss",
"eslint": "node ./node_modules/eslint/bin/eslint.js src/**/*.js"

As you can see there are two custom scripts that were added after the project was created.
The output of npm run eject is:

Replacing "react-scripts start" with "node scripts/start.js"
Replacing "react-scripts build" with "node scripts/build.js"
Replacing "react-scripts test" with "node scripts/test.js"
Replacing "react-scripts stylelint" with "node scripts/stylelint.js"
Replacing "react-scripts eslint" with "node scripts/eslint.js"

While the updated package.json looks like:

"start": "node scripts/start.js",
"build": "node scripts/build.js",
"test": "node scripts/test.js --env=jsdom",
"stylelint": "node ./node_modules/stylelint/bin/stylelint.js src/**/*.scss",
"eslint": "node ./node_modules/eslint/bin/eslint.js src/**/*.js"

so those two custom scripts were untouched and it's ok, because they are not related to the Create React App.

I have added a simple check to fix the misleading message. After the fix the output looks like:

Replacing "react-scripts start" with "node scripts/start.js"
Replacing "react-scripts build" with "node scripts/build.js"
Replacing "react-scripts test" with "node scripts/test.js"

Cheers,

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@gaearon gaearon added this to the 1.0.8 milestone Jun 27, 2017
@gaearon gaearon merged commit 0644e80 into facebook:master Jun 27, 2017
@gaearon
Copy link
Contributor

gaearon commented Jun 27, 2017

This looks good to me. Thanks!

@gaearon gaearon mentioned this pull request Jun 28, 2017
romaindso pushed a commit to romaindso/create-react-app that referenced this pull request Jul 10, 2017
wmonk referenced this pull request in wmonk/create-react-app-typescript Aug 7, 2017
morgs32 pushed a commit to BrickworkSoftware/create-react-app that referenced this pull request Sep 1, 2017
@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants