Skip to content
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

[CI]: Add Prisma resolutions to tutorial-e2e test project #6773

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions tasks/run-e2e
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,24 @@ const createRedwoodJSApp = ({ yarn1 }) => {
stdio: 'inherit',
}
)

// Add prisma resolutions
const packageJSONPath = path.join(REDWOOD_PROJECT_DIRECTORY, 'package.json')
const packageJSON = fs.readJSONSync(packageJSONPath)

const getVersionFrmRwPkg = (dep, pkg) => {
return fs.readJSONSync(
path.join(REDWOODJS_FRAMEWORK_PATH, 'packages', pkg, 'package.json')
).dependencies[dep]
}

packageJSON.resolutions = {
prisma: getVersionFrmRwPkg('prisma', 'cli'),
'@prisma/client': getVersionFrmRwPkg('@prisma/client', 'api'),
'@prisma/internals': getVersionFrmRwPkg('@prisma/internals', 'cli'),
}

fs.writeFileSync(packageJSONPath, JSON.stringify(packageJSON, null, 2))
} catch (e) {
console.error('Error: Could not create Redwood Project')
console.error(e)
Expand Down