mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
Merge pull request #34850 from overleaf/acf-ar-yarn-pnp-redux
[monorepo] yarn pnp redux GitOrigin-RevId: fb04cab879b04ead2665b5e985a44053ceea33f3
This commit is contained in:
+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(' ')
|
||||
|
||||
@@ -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