test: close remaining quality verification gaps

This commit is contained in:
hectorzhao
2026-08-28 16:27:00 +08:00
parent 3834d67a30
commit 9ac41e9308
8 changed files with 602 additions and 1 deletions
+7 -1
View File
@@ -1,5 +1,5 @@
import { execFileSync } from 'node:child_process';
import { readFileSync } from 'node:fs';
import { existsSync, readFileSync } from 'node:fs';
import { resolve } from 'node:path';
const root = resolve(import.meta.dirname, '../..');
@@ -96,6 +96,12 @@ if (trackedAlternativeLocks) {
`${trackedAlternativeLocks.replace(/\r?\n/g, ', ')}: npm/package-lock.json is the only supported committed dependency lock`,
);
}
const presentAlternativeLocks = ['pnpm-lock.yaml', 'yarn.lock'].filter((file) => existsSync(resolve(root, file)));
if (presentAlternativeLocks.length) {
violations.push(
`${presentAlternativeLocks.join(', ')}: remove alternative lock files; npm/package-lock.json is the only supported dependency lock`,
);
}
if (packageJson.packageManager !== 'npm@10.9.4') {
violations.push('package.json: packageManager must pin the supported npm baseline');
}