Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
@@ -49,6 +49,12 @@ export function verifyProductionSeedArtifact(rootDir = process.cwd()) {
|
||||
} else {
|
||||
failures.push(`${PRODUCTION_SEED_SOURCE_PATH}: production seed must disconnect the shared Prisma client in a finally block`);
|
||||
}
|
||||
|
||||
if (/closeSharedStores\s*\(/.test(source) && /finally\s*\{[\s\S]*closeSharedStores\s*\(/.test(source)) {
|
||||
passes.push(`${PRODUCTION_SEED_SOURCE_PATH}: closes shared-store connections in a finally block`);
|
||||
} else {
|
||||
failures.push(`${PRODUCTION_SEED_SOURCE_PATH}: production seed must close shared-store connections in a finally block`);
|
||||
}
|
||||
}
|
||||
|
||||
if (!productionSeedBuild) {
|
||||
@@ -62,6 +68,12 @@ export function verifyProductionSeedArtifact(rootDir = process.cwd()) {
|
||||
passes.push(`${DB_MANIFEST_PATH}: production seed build bundles workspace packages`);
|
||||
}
|
||||
|
||||
if (/--banner:js=[^&]*createRequire\(import\.meta\.url\)/.test(productionSeedBuild)) {
|
||||
passes.push(`${DB_MANIFEST_PATH}: production seed build bridges bundled CommonJS requires in ESM`);
|
||||
} else {
|
||||
failures.push(`${DB_MANIFEST_PATH}: production seed build must define a createRequire(import.meta.url) banner for bundled CommonJS dependencies`);
|
||||
}
|
||||
|
||||
for (const dependency of REQUIRED_EXTERNALS) {
|
||||
if (new RegExp(`--external:${dependency.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(?:\\s|$)`).test(productionSeedBuild)) {
|
||||
passes.push(`${DB_MANIFEST_PATH}: production seed build keeps ${dependency} runtime external`);
|
||||
@@ -78,6 +90,12 @@ export function verifyProductionSeedArtifact(rootDir = process.cwd()) {
|
||||
}
|
||||
|
||||
const artifact = readText(rootDir, PRODUCTION_SEED_ARTIFACT_PATH);
|
||||
if (/from\s+["']node:module["']/.test(artifact) && /createRequire\(import\.meta\.url\)/.test(artifact)) {
|
||||
passes.push(`${PRODUCTION_SEED_ARTIFACT_PATH}: initializes a Node createRequire bridge before bundled CommonJS dependencies`);
|
||||
} else {
|
||||
failures.push(`${PRODUCTION_SEED_ARTIFACT_PATH}: must initialize createRequire(import.meta.url) for bundled CommonJS dependencies`);
|
||||
}
|
||||
|
||||
if (/(?:from\s+["']|import\(\s*["'])@hivegrid\//.test(artifact)) {
|
||||
failures.push(`${PRODUCTION_SEED_ARTIFACT_PATH}: must not contain bare @hivegrid/* imports`);
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user