forked from babel/babel
-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
e2e-create-react-app.sh
executable file
·70 lines (52 loc) · 2.07 KB
/
e2e-create-react-app.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
#==============================================================================#
# SETUP #
#==============================================================================#
# Start in scripts/integration-tests/ even if run from root directory
cd "$(dirname "$0")" || exit
source utils/local-registry.sh
source utils/cleanup.sh
# Echo every command being executed
set -x
# Clone create-react-app
git clone --depth=1 https://github.com/facebook/create-react-app.git tmp/create-react-app
cd tmp/create-react-app || exit
# CircleCI already has npm 7
if [ "$BABEL_8_BREAKING" != true ] ; then
npm i -g npm@7
fi
#==============================================================================#
# TEST #
#==============================================================================#
# !!! WARNING !!!
# create-react-app uses the useBuiltIns: true option of @babel/preset-react,
# removed in Babel 8.0.0. And it does not specify runtime option. The test will break on
# runtime: "automatic", default of Babel 8.
# This change replaces useBuiltIns: true with runtime: "classic"
sed -i 's/useBuiltIns: true/runtime: "classic"/' packages/babel-preset-react-app/create.js
bump_deps="$PWD/../../utils/bump-babel-dependencies.js"
node "$bump_deps"
for d in ./packages/*/
do
(cd "$d"; node "$bump_deps")
done
if [[ "$(node --version)" == v17.* ]]; then
# Remove this when https://github.com/webpack/webpack/issues/14532 is fixed
export NODE_OPTIONS=--openssl-legacy-provider
fi
# Remove this when https://github.com/facebook/jest/pull/12128 is fixed
node -e "
var pkg = require('./package.json');
pkg.resolutions = {
'jest-worker': '27.3.1'
};
fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 2));
"
startLocalRegistry "$PWD"/../../verdaccio-config.yml
# Remove these when https://github.com/facebook/jest/pull/12128 is fixed
npm install --ignore-scripts
npx npm-force-resolutions
npm install
# Test
CI=true npm run test
cleanup