forked from redwoodjs/redwood
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add yarn 3 to create redwood app template (redwoodjs#4761)
* add files to crwa for yarn 3 * optionally re-enable yarn1 for crwa * set build:test-project to use Yarn 3 * update test project to default to yarn 3 * improve descriptions * only use --silent if yarn1 * enable lock file creation in ci * make dm invocations consistent * Revert "make dm invocations consistent" This reverts commit 2ba009b. * try moving the generate step * Revert "try moving the generate step" This reverts commit 59b8965. * mv dm to run after generate this'll still probably fail but going to see * try migrate reset * try running dm up before install * remove yarn engine max version Co-authored-by: David Price <[email protected]>
- Loading branch information
1 parent
1d2e0eb
commit 1521edb
Showing
13 changed files
with
1,667 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
785 changes: 785 additions & 0 deletions
785
__fixtures__/test-project/.yarn/releases/yarn-3.2.0.cjs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
compressionLevel: 0 | ||
|
||
enableGlobalCache: true | ||
|
||
nmMode: hardlinks-local | ||
|
||
nodeLinker: node-modules | ||
|
||
yarnPath: .yarn/releases/yarn-3.2.0.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,12 +20,13 @@ | |
}, | ||
"engines": { | ||
"node": ">=14.19 <=16.x", | ||
"yarn": ">=1.15 <2" | ||
"yarn": ">=1.15" | ||
}, | ||
"prisma": { | ||
"seed": "yarn rw exec seed" | ||
}, | ||
"scripts": { | ||
"postinstall": "" | ||
} | ||
} | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
785 changes: 785 additions & 0 deletions
785
packages/create-redwood-app/template/.yarn/releases/yarn-3.2.0.cjs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
compressionLevel: 0 | ||
|
||
enableGlobalCache: true | ||
|
||
nmMode: hardlinks-local | ||
|
||
nodeLinker: node-modules | ||
|
||
yarnPath: .yarn/releases/yarn-3.2.0.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,9 +16,10 @@ | |
}, | ||
"engines": { | ||
"node": ">=14.19 <=16.x", | ||
"yarn": ">=1.15 <2" | ||
"yarn": ">=1.15" | ||
}, | ||
"prisma": { | ||
"seed": "yarn rw exec seed" | ||
} | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,11 @@ const args = yargs | |
describe: | ||
'Upgrade project to latest canary version. NOT compatible with --link.', | ||
}) | ||
.option('yarn1', { | ||
default: false, | ||
type: 'boolean', | ||
describe: 'Use yarn 1 instead of yarn 3', | ||
}) | ||
.help() | ||
.strict().argv | ||
|
||
|
@@ -75,6 +80,7 @@ const { | |
clean, | ||
copyFromFixture, | ||
rebuildFixture, | ||
yarn1, | ||
} = args | ||
|
||
// Do not use demandCommand becuase rebuildFixture doesn't require <project directory> | ||
|
@@ -216,33 +222,23 @@ const globalTasks = () => | |
enabled: () => link && !rebuildFixture, | ||
}, | ||
{ | ||
title: 'Set yarn v1 version in test-project directory', | ||
title: 'Setting yarn version to 1', | ||
task: async () => { | ||
await execa( | ||
'yarn set version classic', | ||
[], | ||
getExecaOptions(OUTPUT_PROJECT_PATH) | ||
) | ||
|
||
// remove "packageManager": "[email protected]" from package.json | ||
const packageJsonPath = path.join(OUTPUT_PROJECT_PATH, 'package.json') | ||
const packageJson = JSON.parse( | ||
fs.readFileSync(packageJsonPath, 'utf-8') | ||
) | ||
delete packageJson.packageManager | ||
fs.writeFileSync( | ||
packageJsonPath, | ||
JSON.stringify(packageJson, undefined, 2) | ||
) | ||
}, | ||
skip: () => !copyFromFixture && rebuildFixture, | ||
enabled: () => yarn1, | ||
}, | ||
{ | ||
title: 'Installing node_modules', | ||
task: async () => { | ||
return execa( | ||
'yarn install', | ||
['--non-interactive', !verbose && '--silent'].filter(Boolean), | ||
yarn1 && | ||
['--non-interactive', !verbose && '--silent'].filter(Boolean), // pass flags if using Yarn v1 | ||
getExecaOptions(OUTPUT_PROJECT_PATH) | ||
) | ||
}, | ||
|
@@ -326,8 +322,8 @@ const globalTasks = () => | |
title: 'Generate dbAuth Secret', | ||
task: async () => { | ||
const { stdout: dbAuthSecret } = await execa( | ||
`yarn --silent rw g secret --raw`, | ||
[], | ||
'yarn', | ||
[yarn1 && '--silent', 'rw', 'g', 'secret', '--raw'].filter(Boolean), | ||
{ | ||
...getExecaOptions(OUTPUT_PROJECT_PATH), | ||
stdio: 'pipe', | ||
|