mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-12-04 00:15:41 -08:00
Publish the slim install refs: drop the prepare script, carry LICENSE and NOTICE (v3.2.5)
AI Assisted
This commit is contained in:
1 parent
44434d5264
commit
a03b825951
15 files changed
+49
-21
No files matched your search
@@ -20,6 +20,7 @@ import { execFileSync, spawnSync } from "node:child_process";
|
||||
|
||||
import { ROOT, scrubbedEnv } from "./skill-script-helpers.mjs";
|
||||
import {
|
||||
GIT_DEP_LIFECYCLE,
|
||||
INSTALL_REF_MANIFEST,
|
||||
RUNTIME_PAYLOAD,
|
||||
runtimePayloadAllowlist,
|
||||
@@ -67,6 +68,8 @@ function runtimeTree(version) {
|
||||
"install.js": { content: INSTALL_JS },
|
||||
"package.json": { content: json({ name: "plan2code", version }) },
|
||||
"version.json": { content: json({ name: "Plan2Code", version, releaseDate: "2026-12-01" }) },
|
||||
"LICENSE": { content: "license\n" },
|
||||
"NOTICE": { content: "notice\n" },
|
||||
"src/launcher/plan2code.js": { content: `#!/usr/bin/env node\n// launcher ${version}\n`, mode: "100755" },
|
||||
"src/web-console/update-check.mjs": { content: `// update-check ${version}\n` },
|
||||
"src/web-console/console.mjs": { content: `// console ${version}\n` },
|
||||
@@ -196,7 +199,7 @@ const indexHash = (fx) => crypto.createHash("sha256").update(fs.readFileSync(pat
|
||||
test("allowlist: one constant-driven structure of explicit files and prefixes", () => {
|
||||
const allow = runtimePayloadAllowlist();
|
||||
assert.equal(allow, RUNTIME_PAYLOAD);
|
||||
assert.deepEqual([...allow.files], ["install.js", "package.json", "version.json"]);
|
||||
assert.deepEqual([...allow.files], ["install.js", "package.json", "version.json", "LICENSE", "NOTICE"]);
|
||||
assert.deepEqual([...allow.prefixes], ["src/"]);
|
||||
assert.ok(Object.isFrozen(allow) && Object.isFrozen(allow.files) && Object.isFrozen(allow.required));
|
||||
for (const ok of ["install.js", "src/launcher/plan2code.js", "src/web-console/public/activities/snake.js"]) assert.equal(isAllowedPayloadPath(ok), true, ok);
|
||||
@@ -237,6 +240,14 @@ test("arguments: unknown, missing and malformed arguments print the usage and ex
|
||||
}
|
||||
});
|
||||
|
||||
test("the real repository can be published: no lifecycle script npm would prepare a git package for, and every required file is here", () => {
|
||||
const root = ROOT;
|
||||
const pkg = JSON.parse(fs.readFileSync(path.join(root, "package.json"), "utf8"));
|
||||
assert.deepEqual(Object.keys(pkg.scripts || {}).filter((name) => GIT_DEP_LIFECYCLE.has(name)), [], "rename the script: the release run refuses it after the release is public");
|
||||
const required = [...RUNTIME_PAYLOAD.required, ...workflowSkillSources(fs.readFileSync(path.join(root, "install.js"), "utf8"))];
|
||||
assert.deepEqual(required.filter((rel) => !fs.existsSync(path.join(root, rel))), []);
|
||||
});
|
||||
|
||||
test("first publication: parents the legacy release tip, pushes one slim commit to both refs", (t) => {
|
||||
const fx = createSource();
|
||||
t.after(fx.cleanup);
|
||||
|
||||
Reference in new issue
Block a user