mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-24 07:59:12 -05:00
chore: add better-sqlite3 dependency (#26168)
Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>
This commit is contained in:
@@ -63,6 +63,7 @@ const getDependencyPathsToKeep = async (buildAppDir) => {
|
||||
'openbsd',
|
||||
'sunos',
|
||||
'win32'].map((platform) => path.join(unixBuildAppDir, `node_modules/default-gateway/${platform}.js`)),
|
||||
path.join(unixBuildAppDir, 'node_modules/vm2/lib/bridge.js'),
|
||||
])
|
||||
let esbuildResult
|
||||
let newEntryPointsFound = true
|
||||
@@ -132,12 +133,10 @@ const createServerEntryPointBundle = async (buildAppDir) => {
|
||||
],
|
||||
})
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`copying server entry point bundle from ${path.join(workingDir, 'index.js')} to ${path.join(buildAppDir, 'packages', 'server', 'index.js')}`)
|
||||
|
||||
await fs.copy(path.join(workingDir, 'index.js'), path.join(buildAppDir, 'packages', 'server', 'index.js'))
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`compiling server entry point bundle to ${path.join(buildAppDir, 'packages', 'server', 'index.jsc')}`)
|
||||
|
||||
// Use bytenode to compile the entry point bundle. This will save time on the v8 compile step and ensure the integrity of the entry point
|
||||
@@ -171,7 +170,6 @@ const buildEntryPointAndCleanup = async (buildAppDir) => {
|
||||
...serverEntryPointBundleDependencies,
|
||||
]
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`potentially removing ${potentiallyRemovedDependencies.length} dependencies`)
|
||||
|
||||
// 4. Remove all dependencies that are in the snapshot but not in the list of kept dependencies from the binary
|
||||
|
||||
@@ -121,7 +121,8 @@ export async function buildCypressApp (options: BuildCypressAppOpts) {
|
||||
fs.writeJsonSync(meta.distDir('package.json'), {
|
||||
...packageJsonContents,
|
||||
scripts: {
|
||||
postinstall: 'patch-package',
|
||||
// After the `yarn --production` install, we need to patch packages and trigger a server build to rebuild native bindings for `better-sqlite3`
|
||||
postinstall: 'patch-package && yarn workspace @packages/server build',
|
||||
},
|
||||
}, { spaces: 2 })
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-console */
|
||||
// store the cwd
|
||||
const cwd = process.cwd()
|
||||
|
||||
|
||||
@@ -22,11 +22,8 @@ const rewritePackageNames = (fileStr, buildRoot, filePath, onFound) => {
|
||||
|
||||
const replaceString = `${match[1]}${replaceWith}${afterPkg}`
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log()
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('resolve:', chalk.grey(pkgPath), '\nfrom:', chalk.grey(filePath))
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(chalk.yellow(`@packages/${pkg}`), '->', chalk.green(replaceWith))
|
||||
|
||||
onFound && onFound(replaceString)
|
||||
|
||||
Reference in New Issue
Block a user