-
-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Switch to Yarn Workspaces #3755
Changes from 1 commit
2413af7
3ebc525
efc6da5
651e29e
c47bcaf
0a6d95e
de7cd49
3f852a5
194b12a
cf48276
f5a17bb
a5d7b90
ac267e7
7f24b2a
8f23335
aec37ac
4a0c86c
1075380
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,20 +75,18 @@ All functionality must be retained (and configuration given to the user) if they | |
|
||
1. Clone the repo with `git clone https://github.com/facebookincubator/create-react-app` | ||
|
||
2. Run `npm install` in the root `create-react-app` folder. | ||
2. Run `yarn --no-lockfile` in the root `create-react-app` folder. | ||
|
||
Once it is done, you can modify any file locally and run `npm start`, `npm test` or `npm run build` just like in a generated project. | ||
Once it is done, you can modify any file locally and run `yarn start`, `yarn test` or `yarn build` just like in a generated project. | ||
|
||
If you want to try out the end-to-end flow with the global CLI, you can do this too: | ||
|
||
``` | ||
npm run create-react-app my-app | ||
yarn run create-react-app my-app | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: drop the |
||
cd my-app | ||
``` | ||
|
||
and then run `npm start` or `npm run build`. | ||
|
||
*Note: if you are using yarn, we suggest that you use `yarn install --no-lockfile` instead of the bare `yarn` or `yarn install` because we [intentionally](https://github.com/facebookincubator/create-react-app/pull/2014#issuecomment-300811661) do not ignore or add yarn.lock to our repo.* | ||
and then run `yarn start` or `yarn build`. | ||
|
||
## Contributing to E2E (end to end) tests | ||
|
||
|
@@ -104,8 +102,8 @@ The scripts in tasks folder and other scripts in `package.json` will not work in | |
|
||
A good step by step guide can be found [here](https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/) | ||
|
||
### Install Node.js and npm | ||
Even if you have node and npm installed on your windows, it would not be accessible from the bash shell. You would have to install it again. Installing via [`nvm`](https://github.com/creationix/nvm#install-script) is recommended. | ||
### Install Node.js and yarn | ||
Even if you have node and yarn installed on your windows, it would not be accessible from the bash shell. You would have to install it again. Installing via [`nvm`](https://github.com/creationix/nvm#install-script) is recommended. | ||
|
||
### Line endings | ||
|
||
|
@@ -119,11 +117,11 @@ By default git would use `CRLF` line endings which would cause the scripts to fa | |
4. Note that files in `packages/create-react-app` should be modified with extreme caution. Since it’s a global CLI, any version of `create-react-app` (global CLI) including very old ones should work with the latest version of `react-scripts`. | ||
5. Create a change log entry for the release: | ||
* You'll need an [access token for the GitHub API](https://help.github.com/articles/creating-an-access-token-for-command-line-use/). Save it to this environment variable: `export GITHUB_AUTH="..."` | ||
* Run `npm run changelog`. The command will find all the labeled pull requests merged since the last release and group them by the label and affected packages, and create a change log entry with all the changes and links to PRs and their authors. Copy and paste it to `CHANGELOG.md`. | ||
* Run `yarn run changelog`. The command will find all the labeled pull requests merged since the last release and group them by the label and affected packages, and create a change log entry with all the changes and links to PRs and their authors. Copy and paste it to `CHANGELOG.md`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: drop the |
||
* Add a four-space indented paragraph after each non-trivial list item, explaining what changed and why. For each breaking change also write who it affects and instructions for migrating existing code. | ||
* Maybe add some newlines here and there. Preview the result on GitHub to get a feel for it. Changelog generator output is a bit too terse for my taste, so try to make it visually pleasing and well grouped. | ||
6. Make sure to include “Migrating from ...” instructions for the previous release. Often you can copy and paste them. | ||
7. **Do not run `npm publish`. Instead, run `npm run publish`.** | ||
7. **Do not run `yarn publish`. Instead, run `yarn run publish`.** | ||
8. Wait for a long time, and it will get published. Don’t worry that it’s stuck. In the end the publish script will prompt for versions before publishing the packages. | ||
9. After publishing, create a GitHub Release with the same text as the changelog entry. See previous Releases for inspiration. | ||
|
||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,26 @@ | ||
{ | ||
"private": true, | ||
"workspaces": [ | ||
"packages/*" | ||
], | ||
"scripts": { | ||
"build": "node packages/react-scripts/scripts/build.js", | ||
"build": "cd packages/react-scripts && node scripts/build.js", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did this change in this PR? Do workspaces have an issue with working directories? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't remember. I think it might not be related to YW but to Yarn in general (which sets cwd to the project you run the script in). |
||
"changelog": "lerna-changelog", | ||
"create-react-app": "node tasks/cra.js", | ||
"e2e": "tasks/e2e-simple.sh", | ||
"e2e:docker": "tasks/local-test.sh", | ||
"postinstall": "node bootstrap.js && cd packages/react-error-overlay/ && npm run build:prod", | ||
"publish": "tasks/release.sh", | ||
"start": "node packages/react-scripts/scripts/start.js", | ||
"postinstall": "cd packages/react-error-overlay/ && yarn build:prod", | ||
"publish": "lerna publish --independent", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd really like to see the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any ideas? I want to lose that file There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (git status --porcelain | grep -q ^ && echo "Your git status is not clean. Aborting." && exit 1 || exit 0) && lerna publish --independent |
||
"start": "cd packages/react-scripts && node scripts/start.js", | ||
"screencast": "svg-term --cast hItN7sl5yfCPTHxvFg5glhhfp --out screencast.svg --window", | ||
"test": "node packages/react-scripts/scripts/test.js --env=jsdom", | ||
"test": "cd packages/react-scripts && node scripts/test.js --env=jsdom", | ||
"format": "prettier --trailing-comma es5 --single-quote --write 'packages/*/*.js' 'packages/*/!(node_modules)/**/*.js'", | ||
"precommit": "lint-staged" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^4.4.1", | ||
"husky": "^0.13.2", | ||
"lerna": "^2.0.0", | ||
"lerna": "^2.6.0", | ||
"lerna-changelog": "^0.6.0", | ||
"lint-staged": "^3.3.1", | ||
"prettier": "1.6.1", | ||
|
This file was deleted.
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.
What if we made a
.yarnrc
with:This would keep things simple.
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.
With this file present we can now probably edit this command to be just
yarn
.