From 594b02a560c2f3832672a731fb5d9410e8e323f3 Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sat, 28 Oct 2017 16:08:45 -0400 Subject: [PATCH 01/28] Try a custom function --- tasks/e2e-kitchensink.sh | 39 +++++++++++++++++++++++++-------------- tasks/e2e-simple.sh | 24 ++++++++++++++++++++---- 2 files changed, 45 insertions(+), 18 deletions(-) diff --git a/tasks/e2e-kitchensink.sh b/tasks/e2e-kitchensink.sh index 3d29e8a6f3c..828f33e9fd9 100755 --- a/tasks/e2e-kitchensink.sh +++ b/tasks/e2e-kitchensink.sh @@ -44,6 +44,22 @@ function create_react_app { node "$temp_cli_path"/node_modules/create-react-app/index.js "$@" } +function install_package { + rsync -a ${1%/} node_modules/ --exclude node_modules + + $restore_location = $(pwd) + + cd node_modules/$(basename $1)/ + if [ "$USE_YARN" = "yes" ] + then + yarn install --production + else + npm install --only=production + fi + + cd $restore_location +} + # Check for the existence of one or more files. function exists { for f in $*; do @@ -162,13 +178,13 @@ npm install test-integrity@^2.0.1 cd "$temp_app_path/test-kitchensink" # Link to our preset -npm link "$root_path"/packages/babel-preset-react-app +install_package "$root_path"/packages/babel-preset-react-app # Link to error overlay package because now it's a dependency # of react-dev-utils and not react-scripts -npm link "$root_path"/packages/react-error-overlay +install_package "$root_path"/packages/react-error-overlay # Link to test module -npm link "$temp_module_path/node_modules/test-integrity" +install_package "$temp_module_path/node_modules/test-integrity" # Test the build REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \ @@ -219,23 +235,18 @@ E2E_FILE=./build/index.html \ # Finally, let's check that everything still works after ejecting. # ****************************************************************************** -# Unlink our preset -npm unlink "$root_path"/packages/babel-preset-react-app -# Unlink error overlay -npm unlink "$root_path"/packages/react-error-overlay - # Eject... echo yes | npm run eject # ...but still link to the local packages -npm link "$root_path"/packages/babel-preset-react-app -npm link "$root_path"/packages/eslint-config-react-app -npm link "$root_path"/packages/react-error-overlay -npm link "$root_path"/packages/react-dev-utils -npm link "$root_path"/packages/react-scripts +install_package "$root_path"/packages/babel-preset-react-app +install_package "$root_path"/packages/eslint-config-react-app +install_package "$root_path"/packages/react-error-overlay +install_package "$root_path"/packages/react-dev-utils +install_package "$root_path"/packages/react-scripts # Link to test module -npm link "$temp_module_path/node_modules/test-integrity" +install_package "$temp_module_path/node_modules/test-integrity" # Test the build REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \ diff --git a/tasks/e2e-simple.sh b/tasks/e2e-simple.sh index 2c9709546a0..3ced7cd1b81 100755 --- a/tasks/e2e-simple.sh +++ b/tasks/e2e-simple.sh @@ -43,6 +43,22 @@ function create_react_app { node "$temp_cli_path"/node_modules/create-react-app/index.js "$@" } +function install_package { + rsync -a ${1%/} node_modules/ --exclude node_modules + + $restore_location = $(pwd) + + cd node_modules/$(basename $1)/ + if [ "$USE_YARN" = "yes" ] + then + yarn install --production + else + npm install --only=production + fi + + cd $restore_location +} + # Check for the existence of one or more files. function exists { for f in $*; do @@ -307,10 +323,10 @@ verify_module_scope echo yes | npm run eject # ...but still link to the local packages -npm link "$root_path"/packages/babel-preset-react-app -npm link "$root_path"/packages/eslint-config-react-app -npm link "$root_path"/packages/react-dev-utils -npm link "$root_path"/packages/react-scripts +install_package "$root_path"/packages/babel-preset-react-app +install_package "$root_path"/packages/eslint-config-react-app +install_package "$root_path"/packages/react-dev-utils +install_package "$root_path"/packages/react-scripts # Test the build npm run build From 85a1992497699071061123a343b435be27b9b4ff Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sat, 28 Oct 2017 16:18:58 -0400 Subject: [PATCH 02/28] fix path --- tasks/e2e-kitchensink.sh | 5 +---- tasks/e2e-simple.sh | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/tasks/e2e-kitchensink.sh b/tasks/e2e-kitchensink.sh index 828f33e9fd9..1e6a4c47bc5 100755 --- a/tasks/e2e-kitchensink.sh +++ b/tasks/e2e-kitchensink.sh @@ -47,8 +47,6 @@ function create_react_app { function install_package { rsync -a ${1%/} node_modules/ --exclude node_modules - $restore_location = $(pwd) - cd node_modules/$(basename $1)/ if [ "$USE_YARN" = "yes" ] then @@ -56,8 +54,7 @@ function install_package { else npm install --only=production fi - - cd $restore_location + cd ../.. } # Check for the existence of one or more files. diff --git a/tasks/e2e-simple.sh b/tasks/e2e-simple.sh index 3ced7cd1b81..f538ea0faea 100755 --- a/tasks/e2e-simple.sh +++ b/tasks/e2e-simple.sh @@ -46,8 +46,6 @@ function create_react_app { function install_package { rsync -a ${1%/} node_modules/ --exclude node_modules - $restore_location = $(pwd) - cd node_modules/$(basename $1)/ if [ "$USE_YARN" = "yes" ] then @@ -55,8 +53,7 @@ function install_package { else npm install --only=production fi - - cd $restore_location + cd ../.. } # Check for the existence of one or more files. From 0c623869d0a909bee0614976a90f6533cdbdc181 Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sat, 28 Oct 2017 16:26:56 -0400 Subject: [PATCH 03/28] install rsync --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index e00da39436c..7178857b101 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,6 +31,7 @@ install: # TODO: Remove after https://github.com/appveyor/ci/issues/1426 is fixed - set PATH=C:\Program Files\Git\mingw64\bin;%PATH% - ps: Install-Product node $env:nodejs_version $env:platform + - choco install -y rsync build: off From e6a696d8763f99d8f082db94db06b82c6e8a4b3d Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sat, 28 Oct 2017 16:31:17 -0400 Subject: [PATCH 04/28] Test with node 8 --- appveyor.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 7178857b101..e3a169988c8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,11 +2,11 @@ image: Visual Studio 2017 environment: matrix: - - nodejs_version: 7 + - nodejs_version: 8 test_suite: "simple" - - nodejs_version: 7 + - nodejs_version: 8 test_suite: "installs" - - nodejs_version: 7 + - nodejs_version: 8 test_suite: "kitchensink" - nodejs_version: 6 test_suite: "simple" From 05d060fd07952718aa685c0c2cc9fc1e07e6cc2f Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sat, 28 Oct 2017 16:35:06 -0400 Subject: [PATCH 05/28] Ensure package is removed from the tree --- tasks/e2e-kitchensink.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tasks/e2e-kitchensink.sh b/tasks/e2e-kitchensink.sh index 1e6a4c47bc5..2cb84033eaa 100755 --- a/tasks/e2e-kitchensink.sh +++ b/tasks/e2e-kitchensink.sh @@ -45,8 +45,14 @@ function create_react_app { } function install_package { + # Clean target + rm -rf node_modules/$(basename $1)/ + rm -rf node_modules/**/$(basename $1)/ + + # Copy package into node_modules/ rsync -a ${1%/} node_modules/ --exclude node_modules + # Install `dependencies` cd node_modules/$(basename $1)/ if [ "$USE_YARN" = "yes" ] then From b6e6f1ce137ef0bb2d67208f141dcb82997bf57c Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sat, 28 Oct 2017 16:56:12 -0400 Subject: [PATCH 06/28] Remove ours --- tasks/e2e-kitchensink.sh | 2 ++ tasks/e2e-simple.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tasks/e2e-kitchensink.sh b/tasks/e2e-kitchensink.sh index 2cb84033eaa..33ea42e13f3 100755 --- a/tasks/e2e-kitchensink.sh +++ b/tasks/e2e-kitchensink.sh @@ -60,6 +60,8 @@ function install_package { else npm install --only=production fi + # Remove our packages + rm -rf node_modules/{babel-preset-react-app,eslint-config-react-app,react-dev-utils,react-error-overlay,react-scripts} cd ../.. } diff --git a/tasks/e2e-simple.sh b/tasks/e2e-simple.sh index f538ea0faea..494d74594ab 100755 --- a/tasks/e2e-simple.sh +++ b/tasks/e2e-simple.sh @@ -53,6 +53,8 @@ function install_package { else npm install --only=production fi + # Remove our packages + rm -rf node_modules/{babel-preset-react-app,eslint-config-react-app,react-dev-utils,react-error-overlay,react-scripts} cd ../.. } From c567509b42baf3a0e913b3b7417f68773ec8914b Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sat, 28 Oct 2017 16:57:34 -0400 Subject: [PATCH 07/28] matching functions --- tasks/e2e-simple.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tasks/e2e-simple.sh b/tasks/e2e-simple.sh index 494d74594ab..75b366fb36f 100755 --- a/tasks/e2e-simple.sh +++ b/tasks/e2e-simple.sh @@ -44,8 +44,14 @@ function create_react_app { } function install_package { + # Clean target + rm -rf node_modules/$(basename $1)/ + rm -rf node_modules/**/$(basename $1)/ + + # Copy package into node_modules/ rsync -a ${1%/} node_modules/ --exclude node_modules + # Install `dependencies` cd node_modules/$(basename $1)/ if [ "$USE_YARN" = "yes" ] then From a736e39c9334a9de9a5467692eacd71156057acf Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sat, 28 Oct 2017 17:19:57 -0400 Subject: [PATCH 08/28] try cygwin --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index e3a169988c8..630fc4da504 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,7 +31,7 @@ install: # TODO: Remove after https://github.com/appveyor/ci/issues/1426 is fixed - set PATH=C:\Program Files\Git\mingw64\bin;%PATH% - ps: Install-Product node $env:nodejs_version $env:platform - - choco install -y rsync + - choco install -y cygwin build: off From d9e2b34d1ffb37539eb78a3a73f6a4cde5d05a8f Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sat, 28 Oct 2017 17:32:34 -0400 Subject: [PATCH 09/28] try c:/ --- appveyor.yml | 2 +- tasks/e2e-kitchensink.sh | 3 ++- tasks/e2e-simple.sh | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 630fc4da504..e3a169988c8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,7 +31,7 @@ install: # TODO: Remove after https://github.com/appveyor/ci/issues/1426 is fixed - set PATH=C:\Program Files\Git\mingw64\bin;%PATH% - ps: Install-Product node $env:nodejs_version $env:platform - - choco install -y cygwin + - choco install -y rsync build: off diff --git a/tasks/e2e-kitchensink.sh b/tasks/e2e-kitchensink.sh index 33ea42e13f3..088e7ae85d7 100755 --- a/tasks/e2e-kitchensink.sh +++ b/tasks/e2e-kitchensink.sh @@ -50,7 +50,8 @@ function install_package { rm -rf node_modules/**/$(basename $1)/ # Copy package into node_modules/ - rsync -a ${1%/} node_modules/ --exclude node_modules + copyfrom=${1%/} + rsync -a ${copyfrom/\/c\//c:\/} node_modules/ --exclude node_modules # Install `dependencies` cd node_modules/$(basename $1)/ diff --git a/tasks/e2e-simple.sh b/tasks/e2e-simple.sh index 75b366fb36f..0452b3c866a 100755 --- a/tasks/e2e-simple.sh +++ b/tasks/e2e-simple.sh @@ -49,7 +49,8 @@ function install_package { rm -rf node_modules/**/$(basename $1)/ # Copy package into node_modules/ - rsync -a ${1%/} node_modules/ --exclude node_modules + copyfrom=${1%/} + rsync -a ${copyfrom/\/c\//c:\/} node_modules/ --exclude node_modules # Install `dependencies` cd node_modules/$(basename $1)/ From 2fe0106d08ae960558d099a3ee7150cfd06a9f20 Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sat, 28 Oct 2017 17:38:36 -0400 Subject: [PATCH 10/28] sigh --- tasks/e2e-kitchensink.sh | 3 +-- tasks/e2e-simple.sh | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tasks/e2e-kitchensink.sh b/tasks/e2e-kitchensink.sh index 088e7ae85d7..33ea42e13f3 100755 --- a/tasks/e2e-kitchensink.sh +++ b/tasks/e2e-kitchensink.sh @@ -50,8 +50,7 @@ function install_package { rm -rf node_modules/**/$(basename $1)/ # Copy package into node_modules/ - copyfrom=${1%/} - rsync -a ${copyfrom/\/c\//c:\/} node_modules/ --exclude node_modules + rsync -a ${1%/} node_modules/ --exclude node_modules # Install `dependencies` cd node_modules/$(basename $1)/ diff --git a/tasks/e2e-simple.sh b/tasks/e2e-simple.sh index 0452b3c866a..75b366fb36f 100755 --- a/tasks/e2e-simple.sh +++ b/tasks/e2e-simple.sh @@ -49,8 +49,7 @@ function install_package { rm -rf node_modules/**/$(basename $1)/ # Copy package into node_modules/ - copyfrom=${1%/} - rsync -a ${copyfrom/\/c\//c:\/} node_modules/ --exclude node_modules + rsync -a ${1%/} node_modules/ --exclude node_modules # Install `dependencies` cd node_modules/$(basename $1)/ From 4a19ea978593a2a5b9ec4b126b4d6f3338c0dcef Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Sun, 29 Oct 2017 12:54:49 +0000 Subject: [PATCH 11/28] Try /cygdrive/ --- tasks/e2e-kitchensink.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/e2e-kitchensink.sh b/tasks/e2e-kitchensink.sh index 33ea42e13f3..bc71e7e66f4 100755 --- a/tasks/e2e-kitchensink.sh +++ b/tasks/e2e-kitchensink.sh @@ -50,7 +50,7 @@ function install_package { rm -rf node_modules/**/$(basename $1)/ # Copy package into node_modules/ - rsync -a ${1%/} node_modules/ --exclude node_modules + rsync -a /cygdrive${1%/} node_modules/ --exclude node_modules # Install `dependencies` cd node_modules/$(basename $1)/ From 2f5ffafd30b6d7ec0e0a00c9cdc02d7d1ef1a246 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Sun, 29 Oct 2017 12:55:04 +0000 Subject: [PATCH 12/28] Try /cygdrive/ --- tasks/e2e-simple.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/e2e-simple.sh b/tasks/e2e-simple.sh index 75b366fb36f..1ee688a6eff 100755 --- a/tasks/e2e-simple.sh +++ b/tasks/e2e-simple.sh @@ -49,7 +49,7 @@ function install_package { rm -rf node_modules/**/$(basename $1)/ # Copy package into node_modules/ - rsync -a ${1%/} node_modules/ --exclude node_modules + rsync -a /cygdrive${1%/} node_modules/ --exclude node_modules # Install `dependencies` cd node_modules/$(basename $1)/ From e5df78bd83cc848bdfb614f82793d936bc12f6b5 Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sun, 29 Oct 2017 12:52:52 -0400 Subject: [PATCH 13/28] Revert "Try /cygdrive/" This reverts commit ab1ed779456d39bedbdb128a7aec3bb88b8eeb1c. --- tasks/e2e-kitchensink.sh | 2 +- tasks/e2e-simple.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/e2e-kitchensink.sh b/tasks/e2e-kitchensink.sh index bc71e7e66f4..33ea42e13f3 100755 --- a/tasks/e2e-kitchensink.sh +++ b/tasks/e2e-kitchensink.sh @@ -50,7 +50,7 @@ function install_package { rm -rf node_modules/**/$(basename $1)/ # Copy package into node_modules/ - rsync -a /cygdrive${1%/} node_modules/ --exclude node_modules + rsync -a ${1%/} node_modules/ --exclude node_modules # Install `dependencies` cd node_modules/$(basename $1)/ diff --git a/tasks/e2e-simple.sh b/tasks/e2e-simple.sh index 1ee688a6eff..75b366fb36f 100755 --- a/tasks/e2e-simple.sh +++ b/tasks/e2e-simple.sh @@ -49,7 +49,7 @@ function install_package { rm -rf node_modules/**/$(basename $1)/ # Copy package into node_modules/ - rsync -a /cygdrive${1%/} node_modules/ --exclude node_modules + rsync -a ${1%/} node_modules/ --exclude node_modules # Install `dependencies` cd node_modules/$(basename $1)/ From 7f6a4e00e974d96c26543fabf287254dcda84e69 Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sun, 29 Oct 2017 13:02:18 -0400 Subject: [PATCH 14/28] Use sub-optimal copy --- tasks/e2e-kitchensink.sh | 18 +++++++++++------- tasks/e2e-simple.sh | 18 +++++++++++------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/tasks/e2e-kitchensink.sh b/tasks/e2e-kitchensink.sh index 33ea42e13f3..7e2f7dfce1b 100755 --- a/tasks/e2e-kitchensink.sh +++ b/tasks/e2e-kitchensink.sh @@ -45,22 +45,26 @@ function create_react_app { } function install_package { - # Clean target - rm -rf node_modules/$(basename $1)/ - rm -rf node_modules/**/$(basename $1)/ + pkg = $(basename $1) - # Copy package into node_modules/ - rsync -a ${1%/} node_modules/ --exclude node_modules + # Clean target (for safety) + rm -rf node_modules/$pkg/ + rm -rf node_modules/**/$pkg/ + + # Copy package into node_modules/ ignoring installed deps + # rsync -a ${1%/} node_modules/ --exclude node_modules + cp -r ${1%/} node_modules/ + rm -rf node_modules/$pkg/node_modules/ # Install `dependencies` - cd node_modules/$(basename $1)/ + cd node_modules/$pkg/ if [ "$USE_YARN" = "yes" ] then yarn install --production else npm install --only=production fi - # Remove our packages + # Remove our packages to ensure side-by-side versions are used (which we link) rm -rf node_modules/{babel-preset-react-app,eslint-config-react-app,react-dev-utils,react-error-overlay,react-scripts} cd ../.. } diff --git a/tasks/e2e-simple.sh b/tasks/e2e-simple.sh index 75b366fb36f..cb7300561a9 100755 --- a/tasks/e2e-simple.sh +++ b/tasks/e2e-simple.sh @@ -44,22 +44,26 @@ function create_react_app { } function install_package { - # Clean target - rm -rf node_modules/$(basename $1)/ - rm -rf node_modules/**/$(basename $1)/ + pkg = $(basename $1) - # Copy package into node_modules/ - rsync -a ${1%/} node_modules/ --exclude node_modules + # Clean target (for safety) + rm -rf node_modules/$pkg/ + rm -rf node_modules/**/$pkg/ + + # Copy package into node_modules/ ignoring installed deps + # rsync -a ${1%/} node_modules/ --exclude node_modules + cp -r ${1%/} node_modules/ + rm -rf node_modules/$pkg/node_modules/ # Install `dependencies` - cd node_modules/$(basename $1)/ + cd node_modules/$pkg/ if [ "$USE_YARN" = "yes" ] then yarn install --production else npm install --only=production fi - # Remove our packages + # Remove our packages to ensure side-by-side versions are used (which we link) rm -rf node_modules/{babel-preset-react-app,eslint-config-react-app,react-dev-utils,react-error-overlay,react-scripts} cd ../.. } From 4f1f59892a6a07981a73f440d3f78a6ee34110bf Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sun, 29 Oct 2017 13:03:41 -0400 Subject: [PATCH 15/28] Remove rsync install --- appveyor.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index e3a169988c8..ffe48fc8585 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,7 +31,6 @@ install: # TODO: Remove after https://github.com/appveyor/ci/issues/1426 is fixed - set PATH=C:\Program Files\Git\mingw64\bin;%PATH% - ps: Install-Product node $env:nodejs_version $env:platform - - choco install -y rsync build: off From b926eba32beebfe5491415950ba091186e0d122f Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sun, 29 Oct 2017 13:08:46 -0400 Subject: [PATCH 16/28] Fix variable --- tasks/e2e-kitchensink.sh | 2 +- tasks/e2e-simple.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/e2e-kitchensink.sh b/tasks/e2e-kitchensink.sh index 7e2f7dfce1b..2cd775e1edc 100755 --- a/tasks/e2e-kitchensink.sh +++ b/tasks/e2e-kitchensink.sh @@ -45,7 +45,7 @@ function create_react_app { } function install_package { - pkg = $(basename $1) + local pkg=$(basename $1) # Clean target (for safety) rm -rf node_modules/$pkg/ diff --git a/tasks/e2e-simple.sh b/tasks/e2e-simple.sh index cb7300561a9..07b29e3ec14 100755 --- a/tasks/e2e-simple.sh +++ b/tasks/e2e-simple.sh @@ -44,7 +44,7 @@ function create_react_app { } function install_package { - pkg = $(basename $1) + local pkg=$(basename $1) # Clean target (for safety) rm -rf node_modules/$pkg/ From 6e3c2a79b191c816e3ae5978314aa1f5e6f57b24 Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sun, 29 Oct 2017 13:20:03 -0400 Subject: [PATCH 17/28] Continue on err --- tasks/e2e-kitchensink.sh | 2 +- tasks/e2e-simple.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/e2e-kitchensink.sh b/tasks/e2e-kitchensink.sh index 2cd775e1edc..44f1574cb31 100755 --- a/tasks/e2e-kitchensink.sh +++ b/tasks/e2e-kitchensink.sh @@ -53,7 +53,7 @@ function install_package { # Copy package into node_modules/ ignoring installed deps # rsync -a ${1%/} node_modules/ --exclude node_modules - cp -r ${1%/} node_modules/ + cp -R ${1%/} node_modules/ rm -rf node_modules/$pkg/node_modules/ # Install `dependencies` diff --git a/tasks/e2e-simple.sh b/tasks/e2e-simple.sh index 07b29e3ec14..a80492f6246 100755 --- a/tasks/e2e-simple.sh +++ b/tasks/e2e-simple.sh @@ -52,7 +52,7 @@ function install_package { # Copy package into node_modules/ ignoring installed deps # rsync -a ${1%/} node_modules/ --exclude node_modules - cp -r ${1%/} node_modules/ + cp -R ${1%/} node_modules/ rm -rf node_modules/$pkg/node_modules/ # Install `dependencies` From 810c80686018c416c88117aba91aefd5d4594549 Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sun, 29 Oct 2017 13:36:22 -0400 Subject: [PATCH 18/28] Don't link react-scripts, lol --- tasks/e2e-kitchensink.sh | 3 +-- tasks/e2e-simple.sh | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tasks/e2e-kitchensink.sh b/tasks/e2e-kitchensink.sh index 44f1574cb31..158837141c6 100755 --- a/tasks/e2e-kitchensink.sh +++ b/tasks/e2e-kitchensink.sh @@ -23,7 +23,7 @@ function cleanup { ps -ef | grep 'react-scripts' | grep -v grep | awk '{print $2}' | xargs kill -9 cd "$root_path" # TODO: fix "Device or resource busy" and remove ``|| $CI` - rm -rf "$temp_cli_path" "$temp_app_path" "$temp_module_path" || $CI + # rm -rf "$temp_cli_path" "$temp_app_path" "$temp_module_path" || $CI } # Error messages are redirected to stderr @@ -252,7 +252,6 @@ install_package "$root_path"/packages/babel-preset-react-app install_package "$root_path"/packages/eslint-config-react-app install_package "$root_path"/packages/react-error-overlay install_package "$root_path"/packages/react-dev-utils -install_package "$root_path"/packages/react-scripts # Link to test module install_package "$temp_module_path/node_modules/test-integrity" diff --git a/tasks/e2e-simple.sh b/tasks/e2e-simple.sh index a80492f6246..30c5121a5c1 100755 --- a/tasks/e2e-simple.sh +++ b/tasks/e2e-simple.sh @@ -22,7 +22,7 @@ function cleanup { cd "$root_path" # Uncomment when snapshot testing is enabled by default: # rm ./packages/react-scripts/template/src/__snapshots__/App.test.js.snap - rm -rf "$temp_cli_path" $temp_app_path + # rm -rf "$temp_cli_path" $temp_app_path } # Error messages are redirected to stderr @@ -335,7 +335,6 @@ echo yes | npm run eject install_package "$root_path"/packages/babel-preset-react-app install_package "$root_path"/packages/eslint-config-react-app install_package "$root_path"/packages/react-dev-utils -install_package "$root_path"/packages/react-scripts # Test the build npm run build From c2c9db0673605a9902360e5258c9c075ff870b96 Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sun, 29 Oct 2017 13:48:51 -0400 Subject: [PATCH 19/28] run yarn after eject --- packages/react-scripts/scripts/eject.js | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/packages/react-scripts/scripts/eject.js b/packages/react-scripts/scripts/eject.js index 2b859694fce..901745d2213 100644 --- a/packages/react-scripts/scripts/eject.js +++ b/packages/react-scripts/scripts/eject.js @@ -230,21 +230,8 @@ inquirer } if (fs.existsSync(paths.yarnLockFile)) { - // TODO: this is disabled for three reasons. - // - // 1. It produces garbage warnings on Windows on some systems: - // https://github.com/facebookincubator/create-react-app/issues/2030 - // - // 2. For the above reason, it breaks Windows CI: - // https://github.com/facebookincubator/create-react-app/issues/2624 - // - // 3. It is wrong anyway: re-running yarn will respect the lockfile - // rather than package.json we just updated. Instead we should have - // updated the lockfile. So we might as well not do it while it's broken. - // https://github.com/facebookincubator/create-react-app/issues/2627 - // - // console.log(cyan('Running yarn...')); - // spawnSync('yarnpkg', [], { stdio: 'inherit' }); + console.log(cyan('Running yarn...')); + spawnSync('yarnpkg', [], { stdio: 'inherit' }); } else { console.log(cyan('Running npm install...')); spawnSync('npm', ['install', '--loglevel', 'error'], { From 3a2130eac70836b66fbc5b28b045824df818aad2 Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sun, 29 Oct 2017 13:54:57 -0400 Subject: [PATCH 20/28] re-enable cleanup --- tasks/e2e-kitchensink.sh | 2 +- tasks/e2e-simple.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/e2e-kitchensink.sh b/tasks/e2e-kitchensink.sh index 158837141c6..5828450bb5e 100755 --- a/tasks/e2e-kitchensink.sh +++ b/tasks/e2e-kitchensink.sh @@ -23,7 +23,7 @@ function cleanup { ps -ef | grep 'react-scripts' | grep -v grep | awk '{print $2}' | xargs kill -9 cd "$root_path" # TODO: fix "Device or resource busy" and remove ``|| $CI` - # rm -rf "$temp_cli_path" "$temp_app_path" "$temp_module_path" || $CI + rm -rf "$temp_cli_path" "$temp_app_path" "$temp_module_path" || $CI } # Error messages are redirected to stderr diff --git a/tasks/e2e-simple.sh b/tasks/e2e-simple.sh index 30c5121a5c1..7e840324c8f 100755 --- a/tasks/e2e-simple.sh +++ b/tasks/e2e-simple.sh @@ -22,7 +22,7 @@ function cleanup { cd "$root_path" # Uncomment when snapshot testing is enabled by default: # rm ./packages/react-scripts/template/src/__snapshots__/App.test.js.snap - # rm -rf "$temp_cli_path" $temp_app_path + rm -rf "$temp_cli_path" $temp_app_path } # Error messages are redirected to stderr From e14903ea2a0c33c9a9e400f58a40137713f4c9c6 Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sun, 29 Oct 2017 14:15:29 -0400 Subject: [PATCH 21/28] uninstall yarn --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index ffe48fc8585..26321447fe2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,6 +31,7 @@ install: # TODO: Remove after https://github.com/appveyor/ci/issues/1426 is fixed - set PATH=C:\Program Files\Git\mingw64\bin;%PATH% - ps: Install-Product node $env:nodejs_version $env:platform + - choco uninstall yarn build: off From 47c056ad6f275ad56b718418f8a9328768e66fa8 Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sun, 29 Oct 2017 14:26:04 -0400 Subject: [PATCH 22/28] try with force --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 26321447fe2..0e11d20a662 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,7 +31,7 @@ install: # TODO: Remove after https://github.com/appveyor/ci/issues/1426 is fixed - set PATH=C:\Program Files\Git\mingw64\bin;%PATH% - ps: Install-Product node $env:nodejs_version $env:platform - - choco uninstall yarn + - choco uninstall yarn --force build: off From 2758cab55542b025b920eca7b8e98760f65f1b9c Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sun, 29 Oct 2017 14:30:25 -0400 Subject: [PATCH 23/28] appveyor ... seriously? --- appveyor.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 0e11d20a662..ffe48fc8585 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,7 +31,6 @@ install: # TODO: Remove after https://github.com/appveyor/ci/issues/1426 is fixed - set PATH=C:\Program Files\Git\mingw64\bin;%PATH% - ps: Install-Product node $env:nodejs_version $env:platform - - choco uninstall yarn --force build: off From ce0c223ffdfe62db9b0685107eff1779bf28e7f4 Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sun, 29 Oct 2017 14:32:58 -0400 Subject: [PATCH 24/28] swallow bad eject --- tasks/e2e-simple.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/e2e-simple.sh b/tasks/e2e-simple.sh index 7e840324c8f..b9de58e5f3d 100755 --- a/tasks/e2e-simple.sh +++ b/tasks/e2e-simple.sh @@ -329,7 +329,7 @@ verify_module_scope # ****************************************************************************** # Eject... -echo yes | npm run eject +echo yes | npm run eject || echo # ...but still link to the local packages install_package "$root_path"/packages/babel-preset-react-app From 6c7cdeb27be5975533bbca6a33c47bfc02405680 Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sun, 29 Oct 2017 14:39:09 -0400 Subject: [PATCH 25/28] remove eject error swallow --- tasks/e2e-simple.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/e2e-simple.sh b/tasks/e2e-simple.sh index b9de58e5f3d..7e840324c8f 100755 --- a/tasks/e2e-simple.sh +++ b/tasks/e2e-simple.sh @@ -329,7 +329,7 @@ verify_module_scope # ****************************************************************************** # Eject... -echo yes | npm run eject || echo +echo yes | npm run eject # ...but still link to the local packages install_package "$root_path"/packages/babel-preset-react-app From 2ca4c84e5c9d2dcfb096cb5458e4d883fa602d0e Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sun, 29 Oct 2017 14:48:38 -0400 Subject: [PATCH 26/28] Revert "run yarn after eject" This reverts commit eebf1dbc19aeb6e1f66d5ec27bda2d076bea0956. --- packages/react-scripts/scripts/eject.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/react-scripts/scripts/eject.js b/packages/react-scripts/scripts/eject.js index 901745d2213..2b859694fce 100644 --- a/packages/react-scripts/scripts/eject.js +++ b/packages/react-scripts/scripts/eject.js @@ -230,8 +230,21 @@ inquirer } if (fs.existsSync(paths.yarnLockFile)) { - console.log(cyan('Running yarn...')); - spawnSync('yarnpkg', [], { stdio: 'inherit' }); + // TODO: this is disabled for three reasons. + // + // 1. It produces garbage warnings on Windows on some systems: + // https://github.com/facebookincubator/create-react-app/issues/2030 + // + // 2. For the above reason, it breaks Windows CI: + // https://github.com/facebookincubator/create-react-app/issues/2624 + // + // 3. It is wrong anyway: re-running yarn will respect the lockfile + // rather than package.json we just updated. Instead we should have + // updated the lockfile. So we might as well not do it while it's broken. + // https://github.com/facebookincubator/create-react-app/issues/2627 + // + // console.log(cyan('Running yarn...')); + // spawnSync('yarnpkg', [], { stdio: 'inherit' }); } else { console.log(cyan('Running npm install...')); spawnSync('npm', ['install', '--loglevel', 'error'], { From dea7cd77e12335525ba8df692724292d248388ad Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sun, 29 Oct 2017 14:49:46 -0400 Subject: [PATCH 27/28] Run yarn after eject --- tasks/e2e-kitchensink.sh | 5 +++++ tasks/e2e-simple.sh | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/tasks/e2e-kitchensink.sh b/tasks/e2e-kitchensink.sh index 5828450bb5e..30eaa0a96a6 100755 --- a/tasks/e2e-kitchensink.sh +++ b/tasks/e2e-kitchensink.sh @@ -247,6 +247,11 @@ E2E_FILE=./build/index.html \ # Eject... echo yes | npm run eject +if hash yarnpkg 2>/dev/null +then + yarn install --check-files +fi + # ...but still link to the local packages install_package "$root_path"/packages/babel-preset-react-app install_package "$root_path"/packages/eslint-config-react-app diff --git a/tasks/e2e-simple.sh b/tasks/e2e-simple.sh index 7e840324c8f..7eb026ddb2c 100755 --- a/tasks/e2e-simple.sh +++ b/tasks/e2e-simple.sh @@ -331,6 +331,11 @@ verify_module_scope # Eject... echo yes | npm run eject +if hash yarnpkg 2>/dev/null +then + yarn install --check-files +fi + # ...but still link to the local packages install_package "$root_path"/packages/babel-preset-react-app install_package "$root_path"/packages/eslint-config-react-app From e05bbbe741a63acfe852ff798183bfe60abc7cce Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sun, 29 Oct 2017 15:40:41 -0400 Subject: [PATCH 28/28] add a comment --- tasks/e2e-kitchensink.sh | 3 +++ tasks/e2e-simple.sh | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tasks/e2e-kitchensink.sh b/tasks/e2e-kitchensink.sh index 30eaa0a96a6..c1167c1dedf 100755 --- a/tasks/e2e-kitchensink.sh +++ b/tasks/e2e-kitchensink.sh @@ -247,6 +247,9 @@ E2E_FILE=./build/index.html \ # Eject... echo yes | npm run eject +# Ensure Yarn is ran after eject; at the time of this commit, we don't run Yarn +# after ejecting. Soon, we may only skip Yarn on Windows. Let's try to remove +# this in the near future. if hash yarnpkg 2>/dev/null then yarn install --check-files diff --git a/tasks/e2e-simple.sh b/tasks/e2e-simple.sh index 7eb026ddb2c..867b6dc9503 100755 --- a/tasks/e2e-simple.sh +++ b/tasks/e2e-simple.sh @@ -331,9 +331,12 @@ verify_module_scope # Eject... echo yes | npm run eject +# Ensure Yarn is ran after eject; at the time of this commit, we don't run Yarn +# after ejecting. Soon, we may only skip Yarn on Windows. Let's try to remove +# this in the near future. if hash yarnpkg 2>/dev/null then - yarn install --check-files + yarnpkg install --check-files fi # ...but still link to the local packages