mirror of
https://github.com/openclaw/openclaw.git
synced 2026-10-03 09:39:25 +00:00
fix(packaging): include Kysely generator import closure
#162288 added a guarded generator import to the packaged prepare hook but omitted it from package.json files. The docker-seed-e2e package integrity check therefore rejected the tarball before any image build. Include the generator and its sole relative dependency, lib/direct-run.mjs, and guard the packaged script inventory with the existing runtime closure checker. Source-less Docker dependency stages already skip generation and need no copy-list changes. The exact CI package command fails before with the missing-generator error and passes after. The functional Linux Docker image builds and runs the packaged prepare hook and CLI. All 17 import-closure tests, both restricted Docker lifecycle tests, scoped changed checks and independent review pass. The new closure assertion costs 144ms; existing wrapper/bootstrap tests dominate the full file's runtime. Test cost: node scripts/run-vitest.mjs test/scripts/eager-import-closure.test.ts --maxWorkers=1: 90.56s wall.
This commit is contained in:
parent
3f7689e64a
commit
98421de805
2 changed files with 16 additions and 0 deletions
|
|
@ -408,6 +408,8 @@
|
|||
"custodian-skills/",
|
||||
"scripts/check-install-dependency-ownership.mjs",
|
||||
"scripts/freebsd-service-inspect.mjs",
|
||||
"scripts/generate-kysely-types.mts",
|
||||
"scripts/lib/direct-run.mjs",
|
||||
"scripts/lib/freebsd-service-discovery.d.mts",
|
||||
"scripts/lib/freebsd-service-discovery.mjs",
|
||||
"scripts/lib/fs-safe-prebuild.mjs",
|
||||
|
|
|
|||
|
|
@ -26,6 +26,20 @@ const inventoryCheck =
|
|||
const wrapperFailure = (output: string) =>
|
||||
`${output}\nCheck the inventory first: ${inventoryCheck}`;
|
||||
|
||||
it("keeps packaged scripts closed over runtime imports", () => {
|
||||
const files: string[] = JSON.parse(readFileSync("package.json", "utf8")).files;
|
||||
const scripts = files.filter(
|
||||
(file) => file.startsWith("scripts/") && !/\.d\.[cm]?ts$/.test(file),
|
||||
);
|
||||
const closure = collectRuntimeImportClosure(process.cwd(), scripts, {
|
||||
includeDynamicImports: true,
|
||||
});
|
||||
expect(
|
||||
closure.filter((file) => !files.includes(file)),
|
||||
"Package lifecycle scripts must ship their guarded imports and transitive dependencies.",
|
||||
).toEqual([]);
|
||||
});
|
||||
|
||||
it("keeps the PR wrapper inventory closed over runtime imports", () => {
|
||||
const components = readFileSync(wrapperInventory, "utf8").trim().split("\n");
|
||||
const stale = components.filter((file) => !existsSync(file)).toSorted();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue