feat(native): add prebuilt Node-API flock support

This commit is contained in:
imccyu
2026-09-08 20:49:10 +08:00
parent 7264906f99
commit d927cbff99
93 changed files with 1904 additions and 551 deletions
+4 -1
View File
@@ -16,7 +16,10 @@ import path from 'node:path';
const packageDir = process.cwd();
const manifest = JSON.parse(fs.readFileSync(path.join(packageDir, 'package.json'), 'utf8'));
for (const file of ['lib/index.js', 'lib/index.d.ts']) {
const exportedFiles = Object.values(manifest.exports)
.flatMap((entry) => typeof entry === 'string' ? [entry] : Object.values(entry))
.filter((file) => typeof file === 'string' && file.startsWith('./lib/'));
for (const file of exportedFiles) {
if (!fs.existsSync(path.join(packageDir, file))) {
console.error(`verify-entry-lib: ${manifest.name} has no ${file} — run \`pnpm build:ts\` before packing.`);
process.exit(1);