@@ -58,7 +58,7 @@ function install_package {
58
58
59
59
# Install `dependencies`
60
60
cd node_modules/$pkg /
61
- npm install --only= production
61
+ yarn -- production
62
62
# Remove our packages to ensure side-by-side versions are used (which we link)
63
63
rm -rf node_modules/{babel-preset-react-app,eslint-config-react-app,react-dev-utils,react-error-overlay,react-scripts}
64
64
cd ../..
@@ -84,42 +84,17 @@ set -x
84
84
cd ..
85
85
root_path=$PWD
86
86
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
-
112
87
# Prevent bootstrap, we only want top-level dependencies
113
88
cp package.json package.json.bak
114
89
grep -v " postinstall" package.json > temp && mv temp package.json
115
- npm install
90
+ yarn
116
91
mv package.json.bak package.json
117
92
118
93
# We removed the postinstall, so do it manually
119
94
node bootstrap.js
120
95
121
96
cd packages/react-error-overlay/
122
- npm run build:prod
97
+ yarn build:prod
123
98
cd ../..
124
99
125
100
# ******************************************************************************
@@ -153,15 +128,15 @@ mv package.json.orig package.json
153
128
154
129
# Install the CLI in a temporary location
155
130
cd " $temp_cli_path "
156
- npm install " $cli_path "
131
+ yarn add " $cli_path "
157
132
158
133
# Install the app in a temporary location
159
134
cd $temp_app_path
160
135
create_react_app --scripts-version=" $scripts_path " --internal-testing-template=" $root_path " /packages/react-scripts/fixtures/kitchensink test-kitchensink
161
136
162
137
# Install the test module
163
138
cd " $temp_module_path "
164
- npm install test-integrity@^2.0.1
139
+ yarn add test-integrity@^2.0.1
165
140
166
141
# ******************************************************************************
167
142
# 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"
184
159
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
185
160
NODE_PATH=src \
186
161
PUBLIC_URL=http://www.example.org/spa/ \
187
- npm run build
162
+ yarn build
188
163
189
164
# Check for expected output
190
165
exists build/* .html
@@ -195,14 +170,14 @@ REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
195
170
CI=true \
196
171
NODE_PATH=src \
197
172
NODE_ENV=test \
198
- npm test -- --no-cache --testPathPattern=src
173
+ yarn test --no-cache --testPathPattern=src
199
174
200
175
# Test "development" environment
201
176
tmp_server_log=` mktemp`
202
177
PORT=3001 \
203
178
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
204
179
NODE_PATH=src \
205
- nohup npm start & > $tmp_server_log &
180
+ nohup yarn start & > $tmp_server_log &
206
181
grep -q ' You can now view' <( tail -f $tmp_server_log )
207
182
E2E_URL=" http://localhost:3001" \
208
183
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
@@ -225,14 +200,6 @@ E2E_FILE=./build/index.html \
225
200
# Eject...
226
201
echo yes | npm run eject
227
202
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
-
236
203
# ...but still link to the local packages
237
204
install_package " $root_path " /packages/babel-preset-react-app
238
205
install_package " $root_path " /packages/eslint-config-react-app
@@ -246,7 +213,7 @@ install_package "$temp_module_path/node_modules/test-integrity"
246
213
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
247
214
NODE_PATH=src \
248
215
PUBLIC_URL=http://www.example.org/spa/ \
249
- npm run build
216
+ yarn build
250
217
251
218
# Check for expected output
252
219
exists build/* .html
@@ -257,14 +224,14 @@ REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
257
224
CI=true \
258
225
NODE_PATH=src \
259
226
NODE_ENV=test \
260
- npm test -- --no-cache --testPathPattern=src
227
+ yarn test --no-cache --testPathPattern=src
261
228
262
229
# Test "development" environment
263
230
tmp_server_log=` mktemp`
264
231
PORT=3002 \
265
232
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
266
233
NODE_PATH=src \
267
- nohup npm start & > $tmp_server_log &
234
+ nohup yarn start & > $tmp_server_log &
268
235
grep -q ' You can now view' <( tail -f $tmp_server_log )
269
236
E2E_URL=" http://localhost:3002" \
270
237
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
0 commit comments