From 70812f57fefcb8c1179a32e62607d0ec19a355bb Mon Sep 17 00:00:00 2001 From: Ryan Yogan Date: Mon, 8 Aug 2016 13:43:53 -0500 Subject: [PATCH 1/8] Created packages directory (#403) --- {global-cli => packages/create-react-app}/index.js | 0 {global-cli => packages/create-react-app}/package.json | 0 {bin => packages/react-scripts/bin}/react-scripts.js | 0 {config => packages/react-scripts/config}/babel.dev.js | 0 {config => packages/react-scripts/config}/babel.prod.js | 0 {config => packages/react-scripts/config}/env.js | 0 {config => packages/react-scripts/config}/eslint.js | 0 {config => packages/react-scripts/config}/flow/css.js.flow | 0 {config => packages/react-scripts/config}/flow/file.js.flow | 0 {config => packages/react-scripts/config}/jest/CSSStub.js | 0 {config => packages/react-scripts/config}/jest/FileStub.js | 0 {config => packages/react-scripts/config}/jest/environment.js | 0 {config => packages/react-scripts/config}/jest/transform.js | 0 {config => packages/react-scripts/config}/paths.js | 0 {config => packages/react-scripts/config}/polyfills.js | 0 {config => packages/react-scripts/config}/webpack.config.dev.js | 0 {config => packages/react-scripts/config}/webpack.config.prod.js | 0 {scripts => packages/react-scripts/scripts}/build.js | 0 {scripts => packages/react-scripts/scripts}/eject.js | 0 {scripts => packages/react-scripts/scripts}/init.js | 0 {scripts => packages/react-scripts/scripts}/start.js | 0 {scripts => packages/react-scripts/scripts}/test.js | 0 .../react-scripts/scripts}/utils/WatchMissingNodeModulesPlugin.js | 0 .../react-scripts/scripts}/utils/chrome.applescript | 0 .../react-scripts/scripts}/utils/createJestConfig.js | 0 {scripts => packages/react-scripts/scripts}/utils/prompt.js | 0 26 files changed, 0 insertions(+), 0 deletions(-) rename {global-cli => packages/create-react-app}/index.js (100%) rename {global-cli => packages/create-react-app}/package.json (100%) rename {bin => packages/react-scripts/bin}/react-scripts.js (100%) rename {config => packages/react-scripts/config}/babel.dev.js (100%) rename {config => packages/react-scripts/config}/babel.prod.js (100%) rename {config => packages/react-scripts/config}/env.js (100%) rename {config => packages/react-scripts/config}/eslint.js (100%) rename {config => packages/react-scripts/config}/flow/css.js.flow (100%) rename {config => packages/react-scripts/config}/flow/file.js.flow (100%) rename {config => packages/react-scripts/config}/jest/CSSStub.js (100%) rename {config => packages/react-scripts/config}/jest/FileStub.js (100%) rename {config => packages/react-scripts/config}/jest/environment.js (100%) rename {config => packages/react-scripts/config}/jest/transform.js (100%) rename {config => packages/react-scripts/config}/paths.js (100%) rename {config => packages/react-scripts/config}/polyfills.js (100%) rename {config => packages/react-scripts/config}/webpack.config.dev.js (100%) rename {config => packages/react-scripts/config}/webpack.config.prod.js (100%) rename {scripts => packages/react-scripts/scripts}/build.js (100%) rename {scripts => packages/react-scripts/scripts}/eject.js (100%) rename {scripts => packages/react-scripts/scripts}/init.js (100%) rename {scripts => packages/react-scripts/scripts}/start.js (100%) rename {scripts => packages/react-scripts/scripts}/test.js (100%) rename {scripts => packages/react-scripts/scripts}/utils/WatchMissingNodeModulesPlugin.js (100%) rename {scripts => packages/react-scripts/scripts}/utils/chrome.applescript (100%) rename {scripts => packages/react-scripts/scripts}/utils/createJestConfig.js (100%) rename {scripts => packages/react-scripts/scripts}/utils/prompt.js (100%) diff --git a/global-cli/index.js b/packages/create-react-app/index.js similarity index 100% rename from global-cli/index.js rename to packages/create-react-app/index.js diff --git a/global-cli/package.json b/packages/create-react-app/package.json similarity index 100% rename from global-cli/package.json rename to packages/create-react-app/package.json diff --git a/bin/react-scripts.js b/packages/react-scripts/bin/react-scripts.js similarity index 100% rename from bin/react-scripts.js rename to packages/react-scripts/bin/react-scripts.js diff --git a/config/babel.dev.js b/packages/react-scripts/config/babel.dev.js similarity index 100% rename from config/babel.dev.js rename to packages/react-scripts/config/babel.dev.js diff --git a/config/babel.prod.js b/packages/react-scripts/config/babel.prod.js similarity index 100% rename from config/babel.prod.js rename to packages/react-scripts/config/babel.prod.js diff --git a/config/env.js b/packages/react-scripts/config/env.js similarity index 100% rename from config/env.js rename to packages/react-scripts/config/env.js diff --git a/config/eslint.js b/packages/react-scripts/config/eslint.js similarity index 100% rename from config/eslint.js rename to packages/react-scripts/config/eslint.js diff --git a/config/flow/css.js.flow b/packages/react-scripts/config/flow/css.js.flow similarity index 100% rename from config/flow/css.js.flow rename to packages/react-scripts/config/flow/css.js.flow diff --git a/config/flow/file.js.flow b/packages/react-scripts/config/flow/file.js.flow similarity index 100% rename from config/flow/file.js.flow rename to packages/react-scripts/config/flow/file.js.flow diff --git a/config/jest/CSSStub.js b/packages/react-scripts/config/jest/CSSStub.js similarity index 100% rename from config/jest/CSSStub.js rename to packages/react-scripts/config/jest/CSSStub.js diff --git a/config/jest/FileStub.js b/packages/react-scripts/config/jest/FileStub.js similarity index 100% rename from config/jest/FileStub.js rename to packages/react-scripts/config/jest/FileStub.js diff --git a/config/jest/environment.js b/packages/react-scripts/config/jest/environment.js similarity index 100% rename from config/jest/environment.js rename to packages/react-scripts/config/jest/environment.js diff --git a/config/jest/transform.js b/packages/react-scripts/config/jest/transform.js similarity index 100% rename from config/jest/transform.js rename to packages/react-scripts/config/jest/transform.js diff --git a/config/paths.js b/packages/react-scripts/config/paths.js similarity index 100% rename from config/paths.js rename to packages/react-scripts/config/paths.js diff --git a/config/polyfills.js b/packages/react-scripts/config/polyfills.js similarity index 100% rename from config/polyfills.js rename to packages/react-scripts/config/polyfills.js diff --git a/config/webpack.config.dev.js b/packages/react-scripts/config/webpack.config.dev.js similarity index 100% rename from config/webpack.config.dev.js rename to packages/react-scripts/config/webpack.config.dev.js diff --git a/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js similarity index 100% rename from config/webpack.config.prod.js rename to packages/react-scripts/config/webpack.config.prod.js diff --git a/scripts/build.js b/packages/react-scripts/scripts/build.js similarity index 100% rename from scripts/build.js rename to packages/react-scripts/scripts/build.js diff --git a/scripts/eject.js b/packages/react-scripts/scripts/eject.js similarity index 100% rename from scripts/eject.js rename to packages/react-scripts/scripts/eject.js diff --git a/scripts/init.js b/packages/react-scripts/scripts/init.js similarity index 100% rename from scripts/init.js rename to packages/react-scripts/scripts/init.js diff --git a/scripts/start.js b/packages/react-scripts/scripts/start.js similarity index 100% rename from scripts/start.js rename to packages/react-scripts/scripts/start.js diff --git a/scripts/test.js b/packages/react-scripts/scripts/test.js similarity index 100% rename from scripts/test.js rename to packages/react-scripts/scripts/test.js diff --git a/scripts/utils/WatchMissingNodeModulesPlugin.js b/packages/react-scripts/scripts/utils/WatchMissingNodeModulesPlugin.js similarity index 100% rename from scripts/utils/WatchMissingNodeModulesPlugin.js rename to packages/react-scripts/scripts/utils/WatchMissingNodeModulesPlugin.js diff --git a/scripts/utils/chrome.applescript b/packages/react-scripts/scripts/utils/chrome.applescript similarity index 100% rename from scripts/utils/chrome.applescript rename to packages/react-scripts/scripts/utils/chrome.applescript diff --git a/scripts/utils/createJestConfig.js b/packages/react-scripts/scripts/utils/createJestConfig.js similarity index 100% rename from scripts/utils/createJestConfig.js rename to packages/react-scripts/scripts/utils/createJestConfig.js diff --git a/scripts/utils/prompt.js b/packages/react-scripts/scripts/utils/prompt.js similarity index 100% rename from scripts/utils/prompt.js rename to packages/react-scripts/scripts/utils/prompt.js From 44f6e413386852f7fe732ef005e6f526b48bbca0 Mon Sep 17 00:00:00 2001 From: Ryan Yogan Date: Mon, 8 Aug 2016 13:50:44 -0500 Subject: [PATCH 2/8] Updated package.json paths and travis cache directory (#403) --- .travis.yml | 2 +- package.json | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3ed7097635b..5e244b2b91a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,6 @@ node_js: - 6 cache: directories: - - global-cli/node_modules + - packages/create-react-app/node_modules - node_modules script: tasks/e2e.sh diff --git a/package.json b/package.json index 4b83b1343fd..441d773d864 100644 --- a/package.json +++ b/package.json @@ -11,11 +11,11 @@ "url": "https://github.com/facebookincubator/create-react-app/issues" }, "scripts": { - "build": "node scripts/build.js --debug-template", - "create-react-app": "node global-cli/index.js --scripts-version \"$PWD/`npm pack`\"", + "build": "node packages/react-scripts/scripts/build.js --debug-template", + "create-react-app": "node packages/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" + "start": "node packages/react-scripts/scripts/start.js --debug-template", + "test": "node packages/react-scripts/scripts/test.js --debug-template" }, "files": [ "PATENTS", @@ -25,7 +25,7 @@ "template" ], "bin": { - "react-scripts": "./bin/react-scripts.js" + "react-scripts": "./packages/react-scripts/bin/react-scripts.js" }, "dependencies": { "autoprefixer": "6.4.0", From 131090cac5f69fcef1d80b6c103f9c62a9fb90ce Mon Sep 17 00:00:00 2001 From: Ryan Yogan Date: Mon, 8 Aug 2016 14:34:21 -0500 Subject: [PATCH 3/8] Updated paths, moved package.json to react-scripts dir (#403) --- packages/react-scripts/config/paths.js | 9 +++++---- package.json => packages/react-scripts/package.json | 10 +++++----- 2 files changed, 10 insertions(+), 9 deletions(-) rename package.json => packages/react-scripts/package.json (85%) diff --git a/packages/react-scripts/config/paths.js b/packages/react-scripts/config/paths.js index 7645917fbc9..f3c310fc008 100644 --- a/packages/react-scripts/config/paths.js +++ b/packages/react-scripts/config/paths.js @@ -24,6 +24,7 @@ var isInCreateReactAppSource = ( ); function resolveOwn(relativePath) { + console.log(path.resolve(__dirname, relativePath)); return path.resolve(__dirname, relativePath); } @@ -34,11 +35,11 @@ function resolveApp(relativePath) { if (isInCreateReactAppSource) { // create-react-app development: we're in ./config/ module.exports = { - appBuild: resolveOwn('../build'), - appHtml: resolveOwn('../template/index.html'), - appFavicon: resolveOwn('../template/favicon.ico'), + appBuild: resolveOwn('../scripts/build'), + appHtml: resolveOwn('../../../template/index.html'), + appFavicon: resolveOwn('../../../template/favicon.ico'), appPackageJson: resolveOwn('../package.json'), - appSrc: resolveOwn('../template/src'), + appSrc: resolveOwn('../../../template/src'), appNodeModules: resolveOwn('../node_modules'), ownNodeModules: resolveOwn('../node_modules') }; diff --git a/package.json b/packages/react-scripts/package.json similarity index 85% rename from package.json rename to packages/react-scripts/package.json index 441d773d864..6ee817afcac 100644 --- a/package.json +++ b/packages/react-scripts/package.json @@ -11,11 +11,11 @@ "url": "https://github.com/facebookincubator/create-react-app/issues" }, "scripts": { - "build": "node packages/react-scripts/scripts/build.js --debug-template", - "create-react-app": "node packages/create-react-app/index.js --scripts-version \"$PWD/`npm pack`\"", + "build": "node scripts/build.js --debug-template", + "create-react-app": "node ../create-react-app/index.js --scripts-version \"$PWD/`npm pack`\"", "e2e": "tasks/e2e.sh", - "start": "node packages/react-scripts/scripts/start.js --debug-template", - "test": "node packages/react-scripts/scripts/test.js --debug-template" + "start": "node scripts/start.js --debug-template", + "test": "node scripts/test.js --debug-template" }, "files": [ "PATENTS", @@ -25,7 +25,7 @@ "template" ], "bin": { - "react-scripts": "./packages/react-scripts/bin/react-scripts.js" + "react-scripts": "./bin/react-scripts.js" }, "dependencies": { "autoprefixer": "6.4.0", From e7b23aa698b83f0c68a729b0e21c83e31519a124 Mon Sep 17 00:00:00 2001 From: Ryan Yogan Date: Mon, 8 Aug 2016 14:36:32 -0500 Subject: [PATCH 4/8] Updated eslint to point to proper path (#403) --- .eslintrc.js | 2 +- packages/react-scripts/config/paths.js | 1 - packages/react-scripts/package.json | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 0f8fb047066..1a0ff4648a0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,4 +1,4 @@ -const clientESLintConfig = require('./config/eslint'); +const clientESLintConfig = require('./packages/react-scripts/config/eslint'); module.exports = Object.assign({}, clientESLintConfig, { env: Object.assign({}, clientESLintConfig.env, { diff --git a/packages/react-scripts/config/paths.js b/packages/react-scripts/config/paths.js index f3c310fc008..850288ec4e1 100644 --- a/packages/react-scripts/config/paths.js +++ b/packages/react-scripts/config/paths.js @@ -24,7 +24,6 @@ var isInCreateReactAppSource = ( ); function resolveOwn(relativePath) { - console.log(path.resolve(__dirname, relativePath)); return path.resolve(__dirname, relativePath); } diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 6ee817afcac..e15ff29ec5b 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -13,7 +13,7 @@ "scripts": { "build": "node scripts/build.js --debug-template", "create-react-app": "node ../create-react-app/index.js --scripts-version \"$PWD/`npm pack`\"", - "e2e": "tasks/e2e.sh", + "e2e": "../../tasks/e2e.sh", "start": "node scripts/start.js --debug-template", "test": "node scripts/test.js --debug-template" }, From b43a0b612e57a15318aca9cadc42ac2397245ab0 Mon Sep 17 00:00:00 2001 From: Ryan Yogan Date: Mon, 8 Aug 2016 15:14:29 -0500 Subject: [PATCH 5/8] Updated contrib docs, fixed the pack directory pointing to `global-cli` (#403) --- CONTRIBUTING.md | 2 +- tasks/e2e.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 74d2eb8e97e..ee29b35b0a9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 the root `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. diff --git a/tasks/e2e.sh b/tasks/e2e.sh index a1566a85bdb..7375414bbce 100755 --- a/tasks/e2e.sh +++ b/tasks/e2e.sh @@ -73,7 +73,7 @@ npm run test test -e template/src/__tests__/__snapshots__/App-test.js.snap # Pack CLI -cd global-cli +cd packages/react-scripts npm install cli_path=$PWD/`npm pack` From c7f61023a0521fd91a87313f4402bd555179532b Mon Sep 17 00:00:00 2001 From: Ryan Yogan Date: Mon, 8 Aug 2016 15:52:56 -0500 Subject: [PATCH 6/8] Swapped CLI path for create-react-app (#403) --- tasks/e2e.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks/e2e.sh b/tasks/e2e.sh index 7375414bbce..3d0da15cea9 100755 --- a/tasks/e2e.sh +++ b/tasks/e2e.sh @@ -50,6 +50,7 @@ cd .. perl -i -p0e 's/bundledDependencies.*?]/bundledDependencies": []/s' package.json # Pack react-scripts +cd packages/react-scripts npm install scripts_path=$PWD/`npm pack` @@ -73,7 +74,7 @@ npm run test test -e template/src/__tests__/__snapshots__/App-test.js.snap # Pack CLI -cd packages/react-scripts +cd packages/create-react-app npm install cli_path=$PWD/`npm pack` From 4780b0be2a032d57fb6017a74da4439917252df4 Mon Sep 17 00:00:00 2001 From: Ryan Yogan Date: Mon, 8 Aug 2016 16:07:20 -0500 Subject: [PATCH 7/8] Added .gitignore to scripts directory (#403) --- packages/react-scripts/.gitignore | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 packages/react-scripts/.gitignore diff --git a/packages/react-scripts/.gitignore b/packages/react-scripts/.gitignore new file mode 100644 index 00000000000..f19abba4284 --- /dev/null +++ b/packages/react-scripts/.gitignore @@ -0,0 +1,6 @@ +node_modules/ +build +.DS_Store +*.tgz +my-app* +template/src/__tests__/__snapshots__/ From 541ff73e4df19577b3d896d956d02eb35dfacbeb Mon Sep 17 00:00:00 2001 From: Ryan Yogan Date: Wed, 10 Aug 2016 16:02:11 -0500 Subject: [PATCH 8/8] WIP: Testing e2e on Travis (#403) --- .travis.yml | 2 +- packages/react-scripts/config/paths.js | 8 ++++---- packages/react-scripts/package.json | 1 - .../react-scripts/template}/README.md | 0 .../react-scripts/template}/favicon.ico | Bin .../react-scripts/template}/gitignore | 0 .../react-scripts/template}/index.html | 0 .../react-scripts/template}/src/App.css | 0 .../react-scripts/template}/src/App.js | 0 .../template}/src/__tests__/App-test.js | 0 .../react-scripts/template}/src/index.css | 0 .../react-scripts/template}/src/index.js | 0 .../react-scripts/template}/src/logo.svg | 0 tasks/e2e.sh | 2 +- 14 files changed, 6 insertions(+), 7 deletions(-) rename {template => packages/react-scripts/template}/README.md (100%) rename {template => packages/react-scripts/template}/favicon.ico (100%) rename {template => packages/react-scripts/template}/gitignore (100%) rename {template => packages/react-scripts/template}/index.html (100%) rename {template => packages/react-scripts/template}/src/App.css (100%) rename {template => packages/react-scripts/template}/src/App.js (100%) rename {template => packages/react-scripts/template}/src/__tests__/App-test.js (100%) rename {template => packages/react-scripts/template}/src/index.css (100%) rename {template => packages/react-scripts/template}/src/index.js (100%) rename {template => packages/react-scripts/template}/src/logo.svg (100%) diff --git a/.travis.yml b/.travis.yml index 5e244b2b91a..f372d5ca18d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,5 +6,5 @@ node_js: cache: directories: - packages/create-react-app/node_modules - - node_modules + - packages/react-scripts/node_modules script: tasks/e2e.sh diff --git a/packages/react-scripts/config/paths.js b/packages/react-scripts/config/paths.js index 850288ec4e1..19dc117694d 100644 --- a/packages/react-scripts/config/paths.js +++ b/packages/react-scripts/config/paths.js @@ -32,13 +32,13 @@ function resolveApp(relativePath) { } if (isInCreateReactAppSource) { - // create-react-app development: we're in ./config/ + // create-react-app development: we're in ./packages/react-scripts/config module.exports = { appBuild: resolveOwn('../scripts/build'), - appHtml: resolveOwn('../../../template/index.html'), - appFavicon: resolveOwn('../../../template/favicon.ico'), + appHtml: resolveOwn('../template/index.html'), + appFavicon: resolveOwn('../template/favicon.ico'), appPackageJson: resolveOwn('../package.json'), - appSrc: resolveOwn('../../../template/src'), + appSrc: resolveOwn('../template/src'), appNodeModules: resolveOwn('../node_modules'), ownNodeModules: resolveOwn('../node_modules') }; diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index e15ff29ec5b..4968746510d 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -18,7 +18,6 @@ "test": "node scripts/test.js --debug-template" }, "files": [ - "PATENTS", "bin", "config", "scripts", diff --git a/template/README.md b/packages/react-scripts/template/README.md similarity index 100% rename from template/README.md rename to packages/react-scripts/template/README.md diff --git a/template/favicon.ico b/packages/react-scripts/template/favicon.ico similarity index 100% rename from template/favicon.ico rename to packages/react-scripts/template/favicon.ico diff --git a/template/gitignore b/packages/react-scripts/template/gitignore similarity index 100% rename from template/gitignore rename to packages/react-scripts/template/gitignore diff --git a/template/index.html b/packages/react-scripts/template/index.html similarity index 100% rename from template/index.html rename to packages/react-scripts/template/index.html diff --git a/template/src/App.css b/packages/react-scripts/template/src/App.css similarity index 100% rename from template/src/App.css rename to packages/react-scripts/template/src/App.css diff --git a/template/src/App.js b/packages/react-scripts/template/src/App.js similarity index 100% rename from template/src/App.js rename to packages/react-scripts/template/src/App.js diff --git a/template/src/__tests__/App-test.js b/packages/react-scripts/template/src/__tests__/App-test.js similarity index 100% rename from template/src/__tests__/App-test.js rename to packages/react-scripts/template/src/__tests__/App-test.js diff --git a/template/src/index.css b/packages/react-scripts/template/src/index.css similarity index 100% rename from template/src/index.css rename to packages/react-scripts/template/src/index.css diff --git a/template/src/index.js b/packages/react-scripts/template/src/index.js similarity index 100% rename from template/src/index.js rename to packages/react-scripts/template/src/index.js diff --git a/template/src/logo.svg b/packages/react-scripts/template/src/logo.svg similarity index 100% rename from template/src/logo.svg rename to packages/react-scripts/template/src/logo.svg diff --git a/tasks/e2e.sh b/tasks/e2e.sh index 3d0da15cea9..d26114dfa83 100755 --- a/tasks/e2e.sh +++ b/tasks/e2e.sh @@ -47,7 +47,7 @@ cd .. # Packing with them enabled takes too much memory, and Travis crashes. # End to end script is meant to run on Travis so it's not a big deal. # If you run it locally, you'll need to `git checkout -- package.json`. -perl -i -p0e 's/bundledDependencies.*?]/bundledDependencies": []/s' package.json +perl -i -p0e 's/bundledDependencies.*?]/bundledDependencies": []/s' packages/react-scripts/package.json # Pack react-scripts cd packages/react-scripts