chore: add better-sqlite3 dependency (#26168)

Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>
This commit is contained in:
Ryan Manuel
2023-03-23 17:01:13 +00:00
committed by GitHub
parent f790fb22da
commit bbe90abee7
49 changed files with 318 additions and 105 deletions
+1 -3
View File
@@ -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
+2 -1
View File
@@ -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
View File
@@ -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)