@@ -58,7 +58,7 @@ function install_package {
5858
5959 # Install `dependencies`
6060 cd node_modules/$pkg /
61- npm install --only= production
61+ yarn -- production
6262 # Remove our packages to ensure side-by-side versions are used (which we link)
6363 rm -rf node_modules/{babel-preset-react-app,eslint-config-react-app,react-dev-utils,react-error-overlay,react-scripts}
6464 cd ../..
@@ -84,42 +84,17 @@ set -x
8484cd ..
8585root_path=$PWD
8686
87- # Clear cache to avoid issues with incorrect packages being used
88- if hash yarnpkg 2> /dev/null
89- then
90- # AppVeyor uses an old version of yarn.
91- # Once updated to 0.24.3 or above, the workaround can be removed
92- # and replaced with `yarnpkg cache clean`
93- # Issues:
94- # https://github.com/yarnpkg/yarn/issues/2591
95- # https://github.com/appveyor/ci/issues/1576
96- # https://github.com/facebookincubator/create-react-app/pull/2400
97- # When removing workaround, you may run into
98- # https://github.com/facebookincubator/create-react-app/issues/2030
99- case " $( uname -s) " in
100- * CYGWIN* |MSYS* |MINGW* ) yarn=yarn.cmd;;
101- * ) yarn=yarnpkg;;
102- esac
103- $yarn cache clean
104- fi
105-
106- if hash npm 2> /dev/null
107- then
108- npm i -g npm@latest
109- npm cache clean || npm cache verify
110- fi
111-
11287# Prevent bootstrap, we only want top-level dependencies
11388cp package.json package.json.bak
11489grep -v " postinstall" package.json > temp && mv temp package.json
115- npm install
90+ yarn
11691mv package.json.bak package.json
11792
11893# We removed the postinstall, so do it manually
11994node bootstrap.js
12095
12196cd packages/react-error-overlay/
122- npm run build:prod
97+ yarn build:prod
12398cd ../..
12499
125100# ******************************************************************************
@@ -153,15 +128,15 @@ mv package.json.orig package.json
153128
154129# Install the CLI in a temporary location
155130cd " $temp_cli_path "
156- npm install " $cli_path "
131+ yarn add " $cli_path "
157132
158133# Install the app in a temporary location
159134cd $temp_app_path
160135create_react_app --scripts-version=" $scripts_path " --internal-testing-template=" $root_path " /packages/react-scripts/fixtures/kitchensink test-kitchensink
161136
162137# Install the test module
163138cd " $temp_module_path "
164- npm install test-integrity@^2.0.1
139+ yarn add test-integrity@^2.0.1
165140
166141# ******************************************************************************
167142# Now that we used create-react-app to create an app depending on react-scripts,
@@ -184,7 +159,7 @@ install_package "$temp_module_path/node_modules/test-integrity"
184159REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
185160 NODE_PATH=src \
186161 PUBLIC_URL=http://www.example.org/spa/ \
187- npm run build
162+ yarn build
188163
189164# Check for expected output
190165exists build/* .html
@@ -195,14 +170,14 @@ REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
195170 CI=true \
196171 NODE_PATH=src \
197172 NODE_ENV=test \
198- npm test -- --no-cache --testPathPattern=src
173+ yarn test --no-cache --testPathPattern=src
199174
200175# Test "development" environment
201176tmp_server_log=` mktemp`
202177PORT=3001 \
203178 REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
204179 NODE_PATH=src \
205- nohup npm start & > $tmp_server_log &
180+ nohup yarn start & > $tmp_server_log &
206181grep -q ' You can now view' <( tail -f $tmp_server_log )
207182E2E_URL=" http://localhost:3001" \
208183 REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
@@ -225,14 +200,6 @@ E2E_FILE=./build/index.html \
225200# Eject...
226201echo yes | npm run eject
227202
228- # Ensure Yarn is ran after eject; at the time of this commit, we don't run Yarn
229- # after ejecting. Soon, we may only skip Yarn on Windows. Let's try to remove
230- # this in the near future.
231- if hash yarnpkg 2> /dev/null
232- then
233- yarn install --check-files
234- fi
235-
236203# ...but still link to the local packages
237204install_package " $root_path " /packages/babel-preset-react-app
238205install_package " $root_path " /packages/eslint-config-react-app
@@ -246,7 +213,7 @@ install_package "$temp_module_path/node_modules/test-integrity"
246213REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
247214 NODE_PATH=src \
248215 PUBLIC_URL=http://www.example.org/spa/ \
249- npm run build
216+ yarn build
250217
251218# Check for expected output
252219exists build/* .html
@@ -257,14 +224,14 @@ REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
257224 CI=true \
258225 NODE_PATH=src \
259226 NODE_ENV=test \
260- npm test -- --no-cache --testPathPattern=src
227+ yarn test --no-cache --testPathPattern=src
261228
262229# Test "development" environment
263230tmp_server_log=` mktemp`
264231PORT=3002 \
265232 REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
266233 NODE_PATH=src \
267- nohup npm start & > $tmp_server_log &
234+ nohup yarn start & > $tmp_server_log &
268235grep -q ' You can now view' <( tail -f $tmp_server_log )
269236E2E_URL=" http://localhost:3002" \
270237 REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
0 commit comments