-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
/
e2e-babel-old-version.sh
executable file
路65 lines (50 loc) 路 2.23 KB
/
e2e-babel-old-version.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
#!/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
# Go to the root of the monorepo
cd ../..
#==============================================================================#
# TEST #
#==============================================================================#
startLocalRegistry "$PWD"/scripts/integration-tests/verdaccio-config.yml
node "$PWD"/scripts/integration-tests/utils/bump-babel-dependencies.js
(
yarn why @babel/core | grep -o "@babel/core@npm:.* (via npm:.*)";
yarn why @babel/helpers | grep -o "@babel/helpers@npm:.* (via npm:.*)";
yarn why @babel/traverse | grep -o "@babel/traverse@npm:.* (via npm:.*)"
) | uniq | node -e "
var pkg = require('./package.json');
var packages = fs.readFileSync(0, 'utf8').trim().split('\n');
pkg.devDependencies['@babel/core'] = '7.0.0';
packages.forEach(desc => {
const { name, specifier } = desc
.match(/(?<name>@babel\/[a-z]+).*\(via (?<specifier>npm:[^)]+)\)/)
.groups;
pkg.resolutions[name + '@' + specifier] = '7.0.0';
});
fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 2));
"
# Older @babel/core versions don't support "targets" and "assumptions"
# Let's just remove them when running this e2e test.
node -e "
var config = fs.readFileSync('./babel.config.js', 'utf8')
.replace(/assumptions,/, '')
.replace(/targets,/g, '')
.replace(/assumptions,/g, '')
.replace(/assumptions:[^,]*,/g, '');
fs.writeFileSync('./babel.config.js', config);
"
# https://github.com/babel/babel/pull/12331 - This test is fixed in @babel/traverse 7.12.7,
# so it will fail with older versions. We can disable it.
(cd packages/babel-plugin-transform-modules-systemjs/test/fixtures/regression/; mv issue-12329 .issue-12329)
# Update deps, build and test
rm yarn.lock
make -j test-ci
cleanup