Skip to content

Commit

Permalink
Merge branch 'canary' into upgrade-react-to-d6dcad6a8
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Sep 14, 2023
2 parents ecf600b + e23dac0 commit d4f5336
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
6 changes: 6 additions & 0 deletions test/e2e/app-dir/rsc-basic/rsc-basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ createNextDescribe(
'styled-components': 'latest',
'server-only': 'latest',
},
resolutions: {
'@babel/core': '7.22.18',
'@babel/parser': '7.22.16',
'@babel/types': '7.22.17',
'@babel/traverse': '7.22.18',
},
},
({ next, isNextDev, isNextStart, isTurbopack }) => {
if (isNextDev && !isTurbopack) {
Expand Down
8 changes: 7 additions & 1 deletion test/lib/create-next-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ async function setPnpmResolutionMode(cwd) {
async function createNextInstall({
parentSpan = null,
dependencies = null,
resolutions = null,
installCommand = null,
packageJson = {},
dirSuffix = '',
Expand Down Expand Up @@ -148,6 +149,8 @@ async function createNextInstall({
...packageJson,
dependencies: combinedDependencies,
private: true,
// Add resolutions if provided.
...(resolutions ? { resolutions } : {}),
},
null,
2
Expand All @@ -158,7 +161,10 @@ async function createNextInstall({
if (installCommand) {
const installString =
typeof installCommand === 'function'
? installCommand({ dependencies: combinedDependencies })
? installCommand({
dependencies: combinedDependencies,
resolutions,
})
: installCommand

console.log('running install command', installString)
Expand Down
4 changes: 4 additions & 0 deletions test/lib/next-modes/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export type PackageJson = {
export interface NextInstanceOpts {
files: FileRef | string | { [filename: string]: string | FileRef }
dependencies?: { [name: string]: string }
resolutions?: { [name: string]: string }
packageJson?: PackageJson
nextConfig?: NextConfig
installCommand?: InstallCommand
Expand Down Expand Up @@ -56,6 +57,7 @@ export class NextInstance {
protected buildCommand?: string
protected startCommand?: string
protected dependencies?: PackageJson['dependencies'] = {}
protected resolutions?: PackageJson['resolutions']
protected events: { [eventName: string]: Set<any> } = {}
public testDir: string
protected isStopping: boolean = false
Expand Down Expand Up @@ -168,6 +170,7 @@ export class NextInstance {
process.env.NEXT_TEST_VERSION ||
require('next/package.json').version,
},
...(this.resolutions ? { resolutions: this.resolutions } : {}),
scripts: {
// since we can't get the build id as a build artifact, make it
// available under the static files
Expand Down Expand Up @@ -196,6 +199,7 @@ export class NextInstance {
this.testDir = await createNextInstall({
parentSpan: rootSpan,
dependencies: finalDependencies,
resolutions: this.resolutions ?? null,
installCommand: this.installCommand,
packageJson: this.packageJson,
dirSuffix: this.dirSuffix,
Expand Down

0 comments on commit d4f5336

Please sign in to comment.