Skip to content

Commit

Permalink
Merge pull request #30372 from zhyd1997/fix/sandbox-yadong-issue-3030…
Browse files Browse the repository at this point in the history
…2-1737722980988

Build: Added additional react resolutions for next 15 or above sandboxes.
  • Loading branch information
valentinpalkovic authored Jan 29, 2025
2 parents c4ff1b4 + cd66ed5 commit db633c6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/utils/yarn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const installYarn2 = async ({ cwd, dryRun, debug }: YarnOptions) => {
export const addWorkaroundResolutions = async ({
cwd,
dryRun,
key,
}: YarnOptions & { key?: TemplateKey }) => {
logger.info(`🔢 Adding resolutions for workarounds`);

Expand All @@ -79,8 +80,17 @@ export const addWorkaroundResolutions = async ({

const packageJsonPath = join(cwd, 'package.json');
const packageJson = await readJSON(packageJsonPath);

const additionalReact19Resolutions = ['nextjs/default-ts', 'nextjs/prerelease'].includes(key)
? {
react: '^19.0.0',
'react-dom': '^19.0.0',
}
: {};

packageJson.resolutions = {
...packageJson.resolutions,
...additionalReact19Resolutions,
'@testing-library/dom': '^9.3.4',
'@testing-library/jest-dom': '^6.5.0',
'@testing-library/user-event': '^14.5.2',
Expand Down

0 comments on commit db633c6

Please # to comment.