-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathreact-16-install-prep.mjs
41 lines (36 loc) · 1.4 KB
/
react-16-install-prep.mjs
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
import fs from 'node:fs';
try {
let content = fs.readFileSync('./package.json', 'utf8');
let pkg = JSON.parse(content);
pkg.resolutions['react'] = '^16.8.0';
pkg.resolutions['react-dom'] = '^16.8.0';
pkg.resolutions['@testing-library/dom'] = '8.20.1';
fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 2));
} catch (e) {
console.error('Error:', e);
}
try {
let content = fs.readFileSync('./packages/@react-aria/test-utils/package.json', 'utf8');
let pkg = JSON.parse(content);
pkg.peerDependencies['@testing-library/react'] = '^12';
fs.writeFileSync('./packages/@react-aria/test-utils/package.json', JSON.stringify(pkg, null, 2));
} catch (e) {
console.error('Error:', e);
}
try {
let content = fs.readFileSync('./packages/@react-spectrum/test-utils/package.json', 'utf8');
let pkg = JSON.parse(content);
pkg.peerDependencies['@testing-library/react'] = '^12';
fs.writeFileSync('./packages/@react-spectrum/test-utils/package.json', JSON.stringify(pkg, null, 2));
} catch (e) {
console.error('Error:', e);
}
try {
let content = fs.readFileSync('./packages/dev/test-utils/package.json', 'utf8');
let pkg = JSON.parse(content);
pkg.dependencies['@testing-library/react'] = '^12';
pkg.dependencies['@testing-library/react-hooks'] = '^8';
fs.writeFileSync('./packages/dev/test-utils/package.json', JSON.stringify(pkg, null, 2));
} catch (e) {
console.error('Error:', e);
}