Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Satisfy new yarn peer behavior #6767

Merged
merged 13 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"packageManager": "[email protected]",
"scripts": {
"check-types": "tsc && tsc-strict",
"install-16": "yarn add react@^16.8.0 react-dom@^16.8.0 @testing-library/react@^12 @testing-library/react-hooks@^8 @testing-library/dom@^8 && node scripts/oldReactSupport.mjs",
"install-17": "yarn add react@^17 react-dom@^17 @testing-library/react@^12 @testing-library/react-hooks@^8 @testing-library/dom@^8 && node scripts/oldReactSupport.mjs",
"install-19": "node ./scripts/install-react-19.mjs && yarn add react@next react-dom@next",
"install-16": "node scripts/react-16-install-prep.mjs && yarn add react@^16.8.0 react-dom@^16.8.0 @testing-library/react@^12 @testing-library/react-hooks@^8 @testing-library/dom@^8 react-test-renderer@^16.9.0 && node scripts/oldReactSupport.mjs",
"install-17": "node scripts/react-17-install-prep.mjs && yarn add react@^17 react-dom@^17 @testing-library/react@^12 @testing-library/react-hooks@^8 @testing-library/dom@^8 react-test-renderer@^16.9.0 && node scripts/oldReactSupport.mjs",
"install-19": "node scripts/react-19-install-prep.mjs && yarn add react@next react-dom@next",
"start": "cross-env NODE_ENV=storybook storybook dev -p 9003 --ci -c '.storybook'",
"build:storybook": "storybook build -c .storybook -o dist/$(git rev-parse HEAD)/storybook",
"build:storybook-16": "storybook build -c .storybook -o dist/$(git rev-parse HEAD)/storybook-16",
Expand Down Expand Up @@ -112,10 +112,11 @@
"@storybook/react": "^7.6.19",
"@storybook/test-runner": "^0.16.0",
"@storybook/testing-library": "^0.2.2",
"@swc/core": "^1.3.36",
"@swc/jest": "^0.2.36",
"@testing-library/dom": "^10.1.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^15.0.0",
"@testing-library/react": "^15.0.7",
"@testing-library/user-event": "^14.5.2",
"@types/react": "npm:[email protected]",
"@types/react-dom": "npm:[email protected]",
Expand All @@ -142,9 +143,9 @@
"css-parse": "^2.0.0",
"delta-e": "^0.0.8",
"diff": "^5.1.0",
"eslint": "^8.38.0",
"eslint": "^8.56.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-jest": "^28.6.0",
"eslint-plugin-jsdoc": "^40.3.0",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-monorepo": "^0.3.2",
Expand All @@ -156,6 +157,7 @@
"framer-motion": "^11.3.0-alpha.0",
"fs-extra": "^10.0.0",
"full-icu": "^1.3.0",
"glob": "^8.0.3",
"glob-promise": "^6.0.5",
"identity-obj-proxy": "^3.0.0",
"ignore-styles": "^5.0.1",
Expand Down Expand Up @@ -184,7 +186,7 @@
"react-axe": "^3.0.2",
"react-dom": "^18.2.0",
"react-frame-component": "^5.0.0",
"react-test-renderer": "^16.9.0",
"react-test-renderer": "^18.3.1",
"recast": "^0.23",
"recursive-readdir": "^2.2.2",
"regenerator-runtime": "0.13.3",
Expand Down
3 changes: 2 additions & 1 deletion packages/@adobe/react-spectrum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
},
"devDependencies": {
"@babel/cli": "^7.12.10"
"@babel/cli": "^7.12.10",
"@babel/core": "^7.24.3"
}
}
4 changes: 2 additions & 2 deletions packages/@react-aria/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"@swc/helpers": "^0.5.0"
},
"peerDependencies": {
"@testing-library/react": "^13.0.0 || ^14.0.0",
"@testing-library/react": "^15.0.7",
"@testing-library/user-event": "^13.0.0 || ^14.0.0",
"jest": "^27.0.0",
"jest": "^29.5.0",
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
},
"publishConfig": {
Expand Down
3 changes: 2 additions & 1 deletion packages/@react-spectrum/button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
},
"devDependencies": {
"@adobe/spectrum-css-temp": "3.0.0-alpha.1",
"@react-spectrum/test-utils-internal": "3.0.0-alpha.1"
"@react-spectrum/test-utils-internal": "3.0.0-alpha.1",
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why only react-dom and not react?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

react is already in the peerDeps, so something else will supply it
nothing is 'technically' supplying react-dom, which the test-utils-internal are requesting, so had to add react-dom here just for dev work

},
"peerDependencies": {
"@react-spectrum/provider": "^3.0.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/@react-spectrum/checkbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
"react-aria-components": "^1.3.1"
},
"devDependencies": {
"@adobe/spectrum-css-temp": "3.0.0-alpha.1"
"@adobe/spectrum-css-temp": "3.0.0-alpha.1",
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
},
"peerDependencies": {
"@react-spectrum/provider": "^3.0.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/@react-spectrum/dropzone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
},
"devDependencies": {
"@adobe/spectrum-css-temp": "3.0.0-alpha.1",
"@react-spectrum/test-utils-internal": "3.0.0-alpha.1"
"@react-spectrum/test-utils-internal": "3.0.0-alpha.1",
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
},
"peerDependencies": {
"@react-spectrum/provider": "^3.0.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/@react-spectrum/filetrigger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"access": "public"
},
"devDependencies": {
"@adobe/spectrum-css-temp": "3.0.0-alpha.1"
"@adobe/spectrum-css-temp": "3.0.0-alpha.1",
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
}
}
4 changes: 2 additions & 2 deletions packages/@react-spectrum/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
"@swc/helpers": "^0.5.0"
},
"peerDependencies": {
"@testing-library/react": "^15.0.0",
"@testing-library/react": "^15.0.7",
"@testing-library/user-event": "^13.0.0 || ^14.0.0",
"jest": "^27.0.0",
"jest": "^29.5.0",
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
},
"publishConfig": {
Expand Down
3 changes: 2 additions & 1 deletion packages/@react-spectrum/text/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
"react-aria-components": "^1.3.1"
},
"devDependencies": {
"@adobe/spectrum-css-temp": "3.0.0-alpha.1"
"@adobe/spectrum-css-temp": "3.0.0-alpha.1",
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
},
"peerDependencies": {
"@react-spectrum/provider": "^3.0.0",
Expand Down
5 changes: 4 additions & 1 deletion packages/@react-spectrum/upgrade-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@babel/traverse": "^7.24.5",
"@babel/types": "^7.24.5",
"@react-types/shared": "^3.24.0",
"@types/node": "^20",
"boxen": "^5.1.2",
"build": "^0.1.4",
"chalk": "^4.0.0",
Expand All @@ -34,6 +35,8 @@
"uuid": "^9.0.1"
},
"devDependencies": {
"@types/jscodeshift": "^0.11.11"
"@types/jscodeshift": "^0.11.11",
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0",
"typescript": "^5.5.0"
}
}
3 changes: 2 additions & 1 deletion packages/@spectrum-icons/color/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"@swc/helpers": "^0.5.0"
},
"devDependencies": {
"@spectrum-icons/build-tools": "3.0.0-alpha.1"
"@spectrum-icons/build-tools": "3.0.0-alpha.1",
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
},
"peerDependencies": {
"@react-spectrum/provider": "^3.0.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/@spectrum-icons/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"@swc/helpers": "^0.5.0"
},
"devDependencies": {
"@spectrum-icons/build-tools": "3.0.0-alpha.1"
"@spectrum-icons/build-tools": "3.0.0-alpha.1",
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
},
"peerDependencies": {
"@react-spectrum/provider": "^3.0.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/@spectrum-icons/workflow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"@swc/helpers": "^0.5.0"
},
"devDependencies": {
"@spectrum-icons/build-tools": "3.0.0-alpha.1"
"@spectrum-icons/build-tools": "3.0.0-alpha.1",
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
},
"peerDependencies": {
"@react-spectrum/provider": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"globals-docs": "^2.4.1",
"highlight.js": "9.18.1",
"markdown-to-jsx": "^6.11.0",
"quicklink": "^2.0.0",
"quicklink": "^2.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-lowlight": "^2.0.0"
Expand Down
1 change: 1 addition & 0 deletions packages/dev/parcel-resolver-build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"parcel": "2.0.0-dev.1599"
},
"dependencies": {
"@parcel/core": "2.0.0-dev.1599",
"@parcel/node-resolver-core": "3.3.1-dev.3224",
"@parcel/plugin": "2.0.0-dev.1601"
}
Expand Down
1 change: 1 addition & 0 deletions packages/dev/parcel-resolver-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"parcel": "2.0.0-dev.1599"
},
"dependencies": {
"@parcel/core": "2.0.0-dev.1599",
"@parcel/node-resolver-core": "3.3.1-dev.3224",
"@parcel/plugin": "2.0.0-dev.1601"
}
Expand Down
2 changes: 2 additions & 0 deletions packages/dev/parcel-transformer-mdx-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
"dependencies": {
"@mdx-js/mdx": "next",
"@mdx-js/react": "next",
"@parcel/core": "2.0.0-dev.1599",
"@parcel/plugin": "2.0.0-dev.1601",
"dprint-node": "^1.0.7",
"js-yaml": "^3.13.1",
"mdast-util-toc": "^6.1.0",
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0",
"remark-frontmatter": "^4.0.1",
"remark-slug": "^7.0.1",
"tree-sitter-highlight": "^1.0.1",
Expand Down
3 changes: 2 additions & 1 deletion packages/dev/parcel-transformer-mdx-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
},
"dependencies": {
"@mdx-js/mdx": "next",
"@mdx-js/react": "next"
"@mdx-js/react": "next",
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
}
}
7 changes: 5 additions & 2 deletions packages/dev/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@
"@react-aria/ssr": "^3.0.0",
"@react-spectrum/test-utils": "1.0.0-alpha.1",
"@swc/helpers": "^0.5.0",
"@testing-library/dom": "^10.1.0",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^15.0.7",
"@testing-library/user-event": "^14.4.3",
"jest": "^29.5.0",
snowystinger marked this conversation as resolved.
Show resolved Hide resolved
"resolve": "^1.17.0"
},
"peerDependencies": {
"@testing-library/react": "^15.0.0",
"@testing-library/user-event": "^14.4.3",
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0",
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/react-aria/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
},
"devDependencies": {
"@babel/cli": "^7.24.1"
"@babel/cli": "^7.24.1",
"@babel/core": "^7.24.3"
},
"publishConfig": {
"access": "public"
Expand Down
3 changes: 2 additions & 1 deletion packages/react-stately/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
},
"devDependencies": {
"@babel/cli": "^7.24.1"
"@babel/cli": "^7.24.1",
"@babel/core": "^7.24.3"
},
"publishConfig": {
"access": "public"
Expand Down
40 changes: 40 additions & 0 deletions scripts/react-16-install-prep.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are all versions which can't be easily changed through the yarn cli like we do with react, react-dom at the root level, but it's just helping to tie down certain versions so we don't have duplicates installed and they are all versions which work with the react version we've installed

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';
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);
}
39 changes: 39 additions & 0 deletions scripts/react-17-install-prep.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

import fs from 'node:fs';

try {
let content = fs.readFileSync('./package.json', 'utf8');
let pkg = JSON.parse(content);
pkg.resolutions['react'] = '^17.0.2';
pkg.resolutions['react-dom'] = '^17.0.2';
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';
fs.writeFileSync('./packages/dev/test-utils/package.json', JSON.stringify(pkg, null, 2));
} catch (e) {
console.error('Error:', e);
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ let result = JSON.stringify(pkg, false, 2);
fs.writeFileSync('./packages/dev/docs/package.json', result);


let content = fs.readFileSync('./package.json', 'utf8');
let rootpkg = JSON.parse(content);
rootpkg.resolutions['react'] = version;
rootpkg.resolutions['react-dom'] = version;
fs.writeFileSync('./package.json', JSON.stringify(rootpkg, null, 2));


function run(cmd, args, opts) {
return new Promise((resolve, reject) => {
let child = spawn(cmd, args, opts);
Expand Down
Loading