Bring the node-addon-landlock-run tree (tag v0.0.1, commit 614f7fd) into native/landlock-run as its source of record: launcher development happens here, next to the harness consumers, and the standalone repository becomes the release mirror the tree is exported to for packing and publishing (procedure in native/README.md). The subtree keeps its own pnpm workspace and lockfile and is NOT added to the harness workspace: harness installs, gates, and CI never touch it. The mirror's .github/ stays out of the subtree; a separate manually-dispatched workflow (.github/workflows/landlock-run.yml) runs the subtree's CI legs — the per-architecture native builds, real-kernel launcher proofs, and pack rehearsal — adapted with working-directory/cache paths. eslint ignores the subtree like vendor/; AGENTS.md gains the native/ layout line (+5 words on its budget ceiling).
26 lines
950 B
JavaScript
26 lines
950 B
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* Prepack gate for entry packages: refuse to pack a tarball whose built
|
|
* `lib/` is missing. Entry `files` lists use globs, and a glob matching
|
|
* nothing packs a silently JS-less tarball instead of failing — this gate
|
|
* turns that into a loud refusal on a checkout that never ran
|
|
* `pnpm build:ts`.
|
|
*
|
|
* Runs from each entry package's `prepack` hook (pnpm sets the script cwd
|
|
* to the package directory).
|
|
*/
|
|
|
|
import fs from 'node:fs';
|
|
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']) {
|
|
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);
|
|
}
|
|
}
|
|
console.log(`verify-entry-lib: ${manifest.name} built lib/ present.`);
|