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

Initial monorepo configuration #419

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ node_js:
- 6
cache:
directories:
- global-cli/node_modules
- node_modules
- packages/react-scripts/node_modules
- packages/react-create-app/node_modules
script: tasks/e2e.sh
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Please also provide a **test plan**, i.e. specify how you verified what you adde

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 **and** the `create-react-app/global-cli` folder
2. Run `npm install` in `packages/create-react-app` folder **and** the `packages/react-scripts` folder

Once it is done, you can modify any file locally and run `npm start` or `npm run build` just like in a generated project.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions config/paths.js → packages/react-scripts/config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ function resolveApp(relativePath) {
}

if (isInCreateReactAppSource) {
// create-react-app development: we're in ./config/
// create-react-app development: we're in ./config/packages/react-scripts
module.exports = {
appBuild: resolveOwn('../build'),
appBuild: resolveOwn('../../../build'),
appHtml: resolveOwn('../template/index.html'),
appPackageJson: resolveOwn('../package.json'),
appSrc: resolveOwn('../template/src'),
Expand Down
File renamed without changes.
5 changes: 2 additions & 3 deletions package.json → packages/react-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@
},
"scripts": {
"build": "node scripts/build.js --debug-template",
"create-react-app": "node global-cli/index.js --scripts-version \"$PWD/`npm pack`\"",
"e2e": "tasks/e2e.sh",
"create-react-app": "node ../create-react-app/index.js --scripts-version \"$PWD/`npm pack`\"",
"e2e": "../../tasks/e2e.sh",
"start": "node scripts/start.js --debug-template",
"test": "node scripts/test.js --debug-template"
},
"files": [
"PATENTS",
"bin",
"config",
"scripts",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
15 changes: 11 additions & 4 deletions tasks/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cd "$(dirname "$0")"
function cleanup {
echo 'Cleaning up.'
cd $initial_path
rm ../template/src/__tests__/__snapshots__/App-test.js.snap
rm ../packages/react-scripts/template/src/__tests__/__snapshots__/App-test.js.snap
rm -rf $temp_cli_path $temp_app_path
}

Expand Down Expand Up @@ -41,7 +41,8 @@ set -x
# npm pack the two directories to make sure they are valid npm modules
initial_path=$PWD

cd ..
# Switch to the packages/react-scripts directory
cd ../packages/react-scripts

# A hacky way to avoid bundling dependencies.
# Packing with them enabled takes too much memory, and Travis crashes.
Expand All @@ -62,19 +63,25 @@ npm start -- --smoke-test
# Test local build command
npm run build

# Jump to the root directory
cd ../..

# Check for expected output
test -e build/*.html
test -e build/static/js/*.js
test -e build/static/css/*.css
test -e build/static/media/*.svg
test -e build/favicon.ico

# Jump to the packages/react-scripts dir to run tests
cd packages/react-scripts

# Run tests
npm run test
test -e template/src/__tests__/__snapshots__/App-test.js.snap

# Pack CLI
cd global-cli
# Pack CLI, in packages/create-react-app
cd ../create-react-app
npm install
cli_path=$PWD/`npm pack`

Expand Down
4 changes: 2 additions & 2 deletions tasks/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ set -e
# Echo every command being executed
set -x

# Go to root
cd ..
# Go to packages/react-scripts
cd ../packages/react-scripts

# You can only release with npm >= 3
if [ $(npm -v | head -c 1) -lt 3 ]; then
Expand Down