mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Acf pnp migration master (#34040)
GitOrigin-RevId: 418eab9bc733f27a6e0f8f04a2a8e21c2f5a491f
This commit is contained in:
committed by
Copybot
parent
d44e862a0c
commit
8f07308342
+12
@@ -1,3 +1,15 @@
|
||||
// Register PnP ESM loader via module.register() for synchronous ESM resolution
|
||||
// (--experimental-loader from yarn only works for async resolution)
|
||||
const { register } = require('node:module')
|
||||
const { pathToFileURL } = require('node:url')
|
||||
const path = require('node:path')
|
||||
const pnpRegister = path.resolve(__dirname, '../../.pnp.register.mjs')
|
||||
try {
|
||||
register(pathToFileURL(pnpRegister), pathToFileURL(__filename))
|
||||
} catch {
|
||||
// .pnp.register.mjs may not exist in non-PnP environments
|
||||
}
|
||||
|
||||
const chai = require('chai')
|
||||
chai.should()
|
||||
chai.use(require('chai-as-promised'))
|
||||
|
||||
@@ -119,7 +119,8 @@ describe('DeleteOrphanedDocsOnlineCheck', function () {
|
||||
// Hide verbose log messages `calling destroy for project in docstore`
|
||||
'LOG_LEVEL=error',
|
||||
// Hide deprecation warnings for calling `db.collection.count`
|
||||
'NODE_OPTIONS=--no-deprecation',
|
||||
// Preserve existing NODE_OPTIONS (e.g. PnP hooks) while adding --no-deprecation
|
||||
`NODE_OPTIONS='${process.env.NODE_OPTIONS || ''} --no-deprecation'`,
|
||||
])
|
||||
.concat(['node', 'scripts/delete_orphaned_docs_online_check.mjs'])
|
||||
.join(' ')
|
||||
|
||||
@@ -22,7 +22,7 @@ export default {
|
||||
this.timeout(60_000)
|
||||
|
||||
await promisify(exec)(
|
||||
`cd ../../tools/migrations && npm run migrations -- migrate -t ${Settings.env || DEFAULT_ENV}`
|
||||
`cd ../../tools/migrations && yarn run migrations migrate -t ${Settings.env || DEFAULT_ENV}`
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
@@ -10,7 +10,9 @@ function clearSettingsCache() {
|
||||
const settingsDeps = Object.keys(require.cache).filter(
|
||||
x =>
|
||||
x.includes('/@overleaf/settings') ||
|
||||
x.includes('/@overleaf-settings-virtual') ||
|
||||
x.includes(`${monorepoPath}/libraries/settings`) ||
|
||||
x.includes('/libraries/settings/') ||
|
||||
x.includes(`${monorepoPath}/services/web/config`)
|
||||
)
|
||||
settingsDeps.forEach(dep => delete require.cache[dep])
|
||||
|
||||
Reference in New Issue
Block a user