-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(test-project): Fix test-project generation script, and regenera…
…te fixture (#9779)
- Loading branch information
Showing
10 changed files
with
81 additions
and
35 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
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
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
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 |
---|---|---|
|
@@ -387,9 +387,9 @@ async function webTasks(outputPath, { linkWithLatestFwBuild }) { | |
async function addModel(schema) { | ||
const path = `${OUTPUT_PATH}/api/db/schema.prisma` | ||
|
||
const current = fs.readFileSync(path) | ||
const current = fs.readFileSync(path, 'utf-8') | ||
|
||
fs.writeFileSync(path, `${current}\n\n${schema}`) | ||
fs.writeFileSync(path, `${current.trim()}\n\n${schema}\n`) | ||
} | ||
|
||
async function apiTasks(outputPath, { linkWithLatestFwBuild }) { | ||
|
@@ -406,20 +406,39 @@ async function apiTasks(outputPath, { linkWithLatestFwBuild }) { | |
}, | ||
}) | ||
|
||
// At an earlier step we run `yarn rwfw project:copy` which gives us | ||
// [email protected] currently. We need that version to be a canary | ||
// version for auth-dbauth-api and auth-dbauth-web package installations | ||
// to work. So we update the package.json to make the setup use the latest | ||
// canary version for the api and web sides | ||
|
||
const { stdout } = await exec( | ||
`yarn npm info @redwoodjs/auth-dbauth-setup --fields versions --json`, | ||
[], | ||
execaOptions | ||
) | ||
|
||
const latestCanaryVersion = JSON.parse(stdout) | ||
.versions.filter((version) => version.includes('canary')) | ||
.at(-1) | ||
|
||
const dbAuthSetupPath = path.join( | ||
outputPath, | ||
'node_modules', | ||
'@redwoodjs', | ||
'auth-dbauth-setup' | ||
) | ||
|
||
// At an earlier step we run `yarn rwfw project:copy` which gives us | ||
// [email protected] currently. We need that version to be a canary | ||
// version for auth-dbauth-api and auth-dbauth-web package installations | ||
// to work. So we remove the current version and add a canary version | ||
// instead. | ||
const dbAuthSetupPackageJson = JSON.parse( | ||
fs.readFileSync(path.join(dbAuthSetupPath, 'package.json'), 'utf-8') | ||
) | ||
|
||
dbAuthSetupPackageJson.version = latestCanaryVersion | ||
|
||
fs.rmSync(dbAuthSetupPath, { recursive: true, force: true }) | ||
fs.writeFileSync( | ||
path.join(dbAuthSetupPath, 'package.json'), | ||
JSON.stringify(dbAuthSetupPackageJson, null, 2) | ||
) | ||
|
||
await exec( | ||
'yarn rw setup auth dbAuth --force --no-webauthn', | ||
|
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