Created by: ryanyogan
monorepo"
This PR augments the directory structure to conform to a multi-package "Tree structure changes
create-react-app/
+-- .travis.yml
+-- CHANGELOG.md
+-- CONTRIBUTING.md
+-- LICENSE
+-- PATENTS
+-- README.md
+-- packages/
+-- create-react-app/ [originally global-cli]
| +-- index.js
| +-- package.json [maintaining independent packages]
+-- react-scripts/ [originally root directory]
| +-- bin/
| +-- config/
| +-- scripts/
| +-- template/ [originally in root directory]
| +-- .eslintrc.js
| +-- .gitignore
| +-- package.json [maintaining independent packages]
+-- tasks/
| +-- e2e.sh
| +-- release.sh
Status
Given this PR modifies a good portion of the application structure, it may go out of sync quickly.
This PR has been updated to reflect:
master: 7c912b5ffe48eda1c8b0b6f005a117d5764eb0a6
on August 15th, 2016 at 12:15PM PDT
Please ping @ryanyogan if you are reviewing and it is no longer in sync.
How to test
- From the root directory run
sh tasks/e2e.sh
orcd packages/react-scripts && npm run e2e
- Manual install of CLI
cd packages/create-react-app
-
npm uninstall create-react-app -g
we need to remove your official package temporarily -
npm i . -g
<-- this command will install from the local directory - Note:
npm uninstall create-react-app -g
when complete, you don't want this test to clash with the official package. Now you can go back to the officialnpm i create-react-app -g
- Further testing
-
cd packages/create-react-app && npm i
cd packages/react-scripts && npm i && npm run create-react-app test-app
- Test the build process:
npm run build
- You will now have a
build
folder in the root directory, don't forget to trash it.
- You will now have a
- Remember this will create an application named
test-app
in thepackages/react-scripts
directory, you will want to trash that once complete. You will also have anode_modules
folder in both thepackages/create-react-app
folder and thepackages/react-scripts
folder, you will want to delete them withrm -rf node_modules
in the respective directory.
-
Noteable changes / todo's
- I made changes that hop around directories in the
tasks/e2e.sh
file, I am not happy with them I think this file can be improved upon. - Splitting up the paths file into separate modules in addition to making it a tad smarter would help in the future.
- I started toying around with Lerna.js in "independant" mode per @hzoo's advice and I found it to be quite nice. Perhaps this would be a nice next step, however I see other issues that should be cleaned up first.