-
Notifications
You must be signed in to change notification settings - Fork 86
fix: update cache handler to accommodate changes in next@canary #2572
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
Changes from 9 commits
d41873b
89ff228
3a42a1c
407759c
86eeae5
7da023f
885be4d
7b91eb9
8c2c040
868d8d8
312cd28
da3702b
678a182
783fac7
9f9b9d2
7e64957
d7b3492
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,14 +44,17 @@ const promises = fixtures.map((fixture) => | |
}) | ||
} | ||
|
||
// npm is the default | ||
let cmd = `npm install --no-audit --progress=false --prefer-offline --legacy-peer-deps` | ||
let cmd = `` | ||
const { packageManager } = JSON.parse(await readFile(join(cwd, 'package.json'), 'utf8')) | ||
if (packageManager?.startsWith('pnpm')) { | ||
// We disable frozen-lockfile because we may have changed the version of Next.js | ||
cmd = `pnpm install --frozen-lockfile=false ${ | ||
process.env.DEBUG || NEXT_VERSION !== 'latest' ? '' : '--reporter silent' | ||
}` | ||
} else { | ||
// npm is the default | ||
cmd = `npm install --no-audit --progress=false --prefer-offline --legacy-peer-deps` | ||
await rm(join(cwd, 'package-lock.json'), { force: true }) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is for local deving. Doesn't impact our CI runs, because lock files for fixtures are not commited |
||
} | ||
|
||
const addPrefix = new Transform({ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,12 +4,11 @@ import { readFile, writeFile } from 'node:fs/promises' | |
|
||
import fg from 'fast-glob' | ||
import { gte, satisfies, valid } from 'semver' | ||
import { execaCommand } from 'execa' | ||
|
||
const FUTURE_NEXT_PATCH_VERSION = '14.999.0' | ||
|
||
const NEXT_VERSION_REQUIRES_REACT_19 = '14.3.0-canary.45' | ||
// TODO: Update this when React 19 is released | ||
const REACT_19_VERSION = '19.0.0-rc.0' | ||
const REACT_18_VERSION = '18.2.0' | ||
|
||
/** | ||
|
@@ -97,8 +96,17 @@ export async function setNextVersionInFixture( | |
return | ||
} | ||
packageJson.dependencies.next = version | ||
|
||
const { stdout } = await execaCommand( | ||
`npm info next@${resolvedVersion} peerDependencies --json`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🙈 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm just curious why 🙈 on this one. I more than agree on all other cases of 🙈 ... "notes" :) But this one I think is reasonable way to solve the react(-dom) peerDeps problem with next@canary? Unless this is more about the need to do something like this than doing what I'm doing here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes it's about the need to do this at all, not about the solution you went with! :) |
||
{ cwd }, | ||
) | ||
|
||
const nextPeerDependencies = JSON.parse(stdout) | ||
Comment on lines
+100
to
+105
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
if (updateReact && nextVersionRequiresReact19(checkVersion)) { | ||
const reactVersion = operation === 'update' ? REACT_19_VERSION : REACT_18_VERSION | ||
const reactVersion = | ||
operation === 'update' ? nextPeerDependencies['react'] : REACT_18_VERSION | ||
packageJson.dependencies.react = reactVersion | ||
packageJson.dependencies['react-dom'] = reactVersion | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙈