paperlint 18.6.0 → 18.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +11 -0
- package/.claude-plugin/plugin.json +7 -0
- package/CLAUDE.md +3 -3
- package/CONTRIBUTING.md +5 -2
- package/README.md +6 -6
- package/dist/adapters/clack/index.d.ts +3 -0
- package/dist/adapters/clack/index.d.ts.map +1 -0
- package/dist/adapters/clack/index.js +3 -0
- package/dist/adapters/clack/index.js.map +1 -0
- package/dist/adapters/clack/prompts.io.d.ts +8 -0
- package/dist/adapters/clack/prompts.io.d.ts.map +1 -0
- package/dist/adapters/clack/prompts.io.js +20 -0
- package/dist/adapters/clack/prompts.io.js.map +1 -0
- package/dist/adapters/claude-code/claude.io.d.ts +13 -0
- package/dist/adapters/claude-code/claude.io.d.ts.map +1 -0
- package/dist/adapters/claude-code/claude.io.js +68 -0
- package/dist/adapters/claude-code/claude.io.js.map +1 -0
- package/dist/adapters/claude-code/index.d.ts +4 -0
- package/dist/adapters/claude-code/index.d.ts.map +1 -0
- package/dist/adapters/claude-code/index.js +4 -0
- package/dist/adapters/claude-code/index.js.map +1 -0
- package/dist/adapters/claude-code/plugin.d.ts +19 -0
- package/dist/adapters/claude-code/plugin.d.ts.map +1 -0
- package/dist/adapters/claude-code/plugin.js +66 -0
- package/dist/adapters/claude-code/plugin.js.map +1 -0
- package/dist/adapters/package-manager/index.d.ts +4 -0
- package/dist/adapters/package-manager/index.d.ts.map +1 -0
- package/dist/adapters/package-manager/index.js +4 -0
- package/dist/adapters/package-manager/index.js.map +1 -0
- package/dist/adapters/package-manager/install.io.d.ts +3 -0
- package/dist/adapters/package-manager/install.io.d.ts.map +1 -0
- package/dist/adapters/package-manager/install.io.js +23 -0
- package/dist/adapters/package-manager/install.io.js.map +1 -0
- package/dist/adapters/package-manager/manager.d.ts +13 -0
- package/dist/adapters/package-manager/manager.d.ts.map +1 -0
- package/dist/adapters/package-manager/manager.js +22 -0
- package/dist/adapters/package-manager/manager.js.map +1 -0
- package/dist/adapters/study-registry/index.d.ts +2 -2
- package/dist/cli.d.ts +9 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +73 -13
- package/dist/cli.js.map +1 -1
- package/dist/doctor-plugin.d.ts +23 -0
- package/dist/doctor-plugin.d.ts.map +1 -0
- package/dist/doctor-plugin.js +56 -0
- package/dist/doctor-plugin.js.map +1 -0
- package/dist/doctor.d.ts +6 -1
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +69 -26
- package/dist/doctor.js.map +1 -1
- package/dist/hooks-settings.d.ts +18 -0
- package/dist/hooks-settings.d.ts.map +1 -1
- package/dist/hooks-settings.js +25 -0
- package/dist/hooks-settings.js.map +1 -1
- package/dist/init.d.ts +47 -16
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +231 -86
- package/dist/init.js.map +1 -1
- package/dist/link-skills.d.ts +15 -0
- package/dist/link-skills.d.ts.map +1 -1
- package/dist/link-skills.js +18 -1
- package/dist/link-skills.js.map +1 -1
- package/dist/plugin-offer.d.ts +73 -0
- package/dist/plugin-offer.d.ts.map +1 -0
- package/dist/plugin-offer.js +96 -0
- package/dist/plugin-offer.js.map +1 -0
- package/dist/ports/claude-code.d.ts +31 -0
- package/dist/ports/claude-code.d.ts.map +1 -0
- package/dist/ports/claude-code.js +2 -0
- package/dist/ports/claude-code.js.map +1 -0
- package/dist/ports/project-install.d.ts +19 -0
- package/dist/ports/project-install.d.ts.map +1 -0
- package/dist/ports/project-install.js +2 -0
- package/dist/ports/project-install.js.map +1 -0
- package/dist/ports/prompts.d.ts +31 -0
- package/dist/ports/prompts.d.ts.map +1 -0
- package/dist/ports/prompts.js +2 -0
- package/dist/ports/prompts.js.map +1 -0
- package/dist/self-install.d.ts +65 -0
- package/dist/self-install.d.ts.map +1 -0
- package/dist/self-install.js +145 -0
- package/dist/self-install.js.map +1 -0
- package/dist/skill-chunks/chunk-65X5HVIJ.js +26462 -0
- package/dist/skill-chunks/chunk-6NU6CXUS.js +258 -0
- package/dist/skill-chunks/chunk-GRSXIWYF.js +352 -0
- package/dist/skill-chunks/chunk-IREAROCV.js +84 -0
- package/dist/skill-chunks/chunk-KWK6RT4T.js +24267 -0
- package/dist/skill-chunks/chunk-NPQVDEE4.js +19681 -0
- package/dist/skill-chunks/chunk-PJ4KNV4J.js +45 -0
- package/dist/skill-chunks/dist-UPCJMLBM.js +385 -0
- package/dist/skill-chunks/pdfjs-LUMEFOH2.js +39518 -0
- package/dist/types.d.ts +4 -0
- package/dist/types.d.ts.map +1 -1
- package/docs/e2e.md +10 -0
- package/docs/install.md +88 -29
- package/docs/prior-art/README.md +2 -0
- package/docs/prior-art/one-command-install.md +33 -0
- package/docs/prior-art/prompt-libraries.md +32 -0
- package/eslint.config.mjs +1 -0
- package/hooks/CLAUDE.md +2 -2
- package/hooks/CLAUDE.md.spec.ts +1 -1
- package/lib/skill-checks.mjs +13 -6
- package/lib/skill-checks.test.mjs +28 -15
- package/lib/skill-corpus.mjs +5 -2
- package/package.json +8 -3
- package/plugin/CLAUDE.md +22 -14
- package/plugin/CLAUDE.md.spec.ts +20 -12
- package/scripts/bundle-skills.test.ts +226 -0
- package/scripts/bundle-skills.ts +304 -0
- package/scripts/plugin-version.test.ts +80 -0
- package/scripts/plugin-version.ts +58 -0
- package/skills/CLAUDE.md +2 -2
- package/skills/CLAUDE.md.spec.ts +1 -1
- package/skills/argument-arc/SKILL.md +2 -2
- package/skills/argument-arc/SKILL.md.spec.ts +1 -1
- package/skills/argument-arc/scripts/headings.js +57 -13
- package/skills/build-label-page/scripts/label-page.js +2005 -93
- package/skills/cold-read-diff/scripts/cold-read.js +221 -14
- package/skills/label-agent-runs/scripts/labels.js +272 -348
- package/skills/paper-pipeline/references/anonymization.md +4 -3
- package/skills/paper-pipeline/scripts/extract-ref-facts.js +304 -0
- package/skills/pc-panel-review/scripts/prior-reviews.js +7244 -12
- package/skills/run-agent-grid/scripts/grid-guard.js +562 -627
- package/skills/submit-paper/SKILL.md +5 -4
- package/skills/submit-paper/SKILL.md.spec.ts +4 -3
- package/skills/submit-paper/check-deanon.sh +17 -2
- package/skills/submit-paper/check-deanon.test.ts +141 -0
- package/skills/verify-citations/SKILL.md +9 -9
- package/skills/verify-citations/SKILL.md.spec.ts +8 -8
- package/skills/verify-citations/scripts/bib-authors.js +228 -0
- package/skills/verify-citations/scripts/verify-cites.js +816 -0
- package/src/adapters/clack/index.ts +2 -0
- package/src/adapters/clack/prompts.io.ts +35 -0
- package/src/adapters/clack/prompts.test.ts +58 -0
- package/src/adapters/claude-code/claude.io.ts +103 -0
- package/src/adapters/claude-code/index.test.ts +233 -0
- package/src/adapters/claude-code/index.ts +11 -0
- package/src/adapters/claude-code/plugin.ts +82 -0
- package/src/adapters/package-manager/index.test.ts +67 -0
- package/src/adapters/package-manager/index.ts +3 -0
- package/src/adapters/package-manager/install.io.ts +27 -0
- package/src/adapters/package-manager/manager.ts +33 -0
- package/src/cli.harness.mjs +47 -26
- package/src/cli.test.ts +179 -2
- package/src/cli.ts +130 -10
- package/src/doctor-plugin.test.ts +103 -0
- package/src/doctor-plugin.ts +83 -0
- package/src/doctor.test.ts +111 -2
- package/src/doctor.ts +83 -32
- package/src/hooks-notice.test.ts +82 -0
- package/src/hooks-settings.ts +49 -0
- package/src/init-plugin.test.ts +178 -0
- package/src/init.test.ts +138 -27
- package/src/init.ts +341 -124
- package/src/link-skills.test.ts +34 -1
- package/src/link-skills.ts +34 -0
- package/src/parse-args.test.ts +2 -0
- package/src/plugin-offer.test.ts +276 -0
- package/src/plugin-offer.ts +160 -0
- package/src/ports/claude-code.ts +30 -0
- package/src/ports/project-install.ts +18 -0
- package/src/ports/prompts.ts +27 -0
- package/src/self-install.test.ts +267 -0
- package/src/self-install.ts +224 -0
- package/src/types.ts +4 -0
package/plugin/CLAUDE.md.spec.ts
CHANGED
|
@@ -3,20 +3,28 @@ import { file, instructionFile, prose } from "vigiles/spec";
|
|
|
3
3
|
|
|
4
4
|
export default instructionFile({
|
|
5
5
|
sections: {
|
|
6
|
-
"`plugin/`": prose
|
|
7
|
-
|
|
6
|
+
"`plugin/`": prose`${file("plugin/hooks/hooks.json")} is the one hook wiring. The Claude Code plugin
|
|
7
|
+
(${file(".claude-plugin/plugin.json")}) ships it as its hooks, and \`paperlint init --no-plugin\` merges the
|
|
8
|
+
same file into the consumer's \`.claude/settings.json\`. Every command in it runs the project's installed
|
|
9
|
+
\`node_modules/paperlint/bin/paperlint.mjs\`: the plugin carries the skills and the hooks, the npm package
|
|
10
|
+
carries the code, and \`paperlint lint\` works without the plugin.`,
|
|
8
11
|
|
|
9
|
-
"Why
|
|
10
|
-
(
|
|
11
|
-
"Why it is shaped this way"):
|
|
12
|
+
"Why the plugin came back": prose`The plugin was removed after 1.0.0 (#82) on three objections. Each now has a measured answer
|
|
13
|
+
(2026-11-22); bring none of them back as a reason without measuring again:
|
|
12
14
|
|
|
13
|
-
- **A plugin cannot carry the code
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
- **The skills need the npm package anyway
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
- **"A plugin cannot carry the code."** It does not have to. The skill scripts are bundled
|
|
16
|
+
(\`scripts/bundle-skills.ts\`, #624) and run from a copy of the package with no \`node_modules\`; the
|
|
17
|
+
hooks call the project's installed paperlint. Installing the plugin from the marketplace took 16.7 s.
|
|
18
|
+
- **"The skills need the npm package anyway."** Only the hooks do, and they find it in the project.
|
|
19
|
+
- **"Its manifests carried versions nothing updated."** The marketplace installs from the npm package,
|
|
20
|
+
and \`npm pack\` stamps the package's version into the packed \`plugin.json\`
|
|
21
|
+
(${file("scripts/plugin-version.ts")}); the tracked file keeps the placeholder. Without a version there,
|
|
22
|
+
Claude Code lists the plugin's version as "unknown".
|
|
23
|
+
|
|
24
|
+
Turning it on is \`claude\`'s own two commands (\`src/adapters/claude-code/claude.io.ts\`): writing
|
|
25
|
+
\`enabledPlugins\` and \`extraKnownMarketplaces\` by hand left \`claude plugin list\` empty. Repository
|
|
26
|
+
settings alone download nothing in a cloud session either: the user adds the marketplace once in
|
|
27
|
+
their claude.ai settings.`,
|
|
20
28
|
},
|
|
21
29
|
rules: {},
|
|
22
30
|
});
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bundle step (`scripts/bundle-skills.ts`) on fixture trees of its own: it writes every bundle
|
|
3
|
+
* and nothing else, the bundles keep each module's own `import.meta`, and it refuses before writing
|
|
4
|
+
* anything when a run would overwrite a tracked file or break an entry. Then the real step on this
|
|
5
|
+
* checkout, as `npm run build` runs it.
|
|
6
|
+
*/
|
|
7
|
+
import { execFileSync } from "node:child_process";
|
|
8
|
+
import { readdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
9
|
+
import { dirname, join, relative } from "node:path";
|
|
10
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
11
|
+
import { describe, expect, it } from "vitest";
|
|
12
|
+
import { runNode, useTempDir, writeTree } from "../test/support.ts";
|
|
13
|
+
import {
|
|
14
|
+
bundleSkills,
|
|
15
|
+
CHUNK_DIR,
|
|
16
|
+
gitTracked,
|
|
17
|
+
SKILL_ENTRIES,
|
|
18
|
+
type BundlePlan,
|
|
19
|
+
} from "./bundle-skills.ts";
|
|
20
|
+
|
|
21
|
+
const ROOT = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
22
|
+
|
|
23
|
+
/** Every file under `root`, relative, with its contents. */
|
|
24
|
+
function snapshot(root: string): Readonly<Record<string, string>> {
|
|
25
|
+
const walk = (dir: string): readonly string[] =>
|
|
26
|
+
readdirSync(dir).flatMap((name) => {
|
|
27
|
+
const p = join(dir, name);
|
|
28
|
+
return statSync(p).isDirectory() ? walk(p) : [p];
|
|
29
|
+
});
|
|
30
|
+
return Object.fromEntries(
|
|
31
|
+
walk(root).map((p) => [relative(root, p), readFileSync(p, "utf8")]),
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** What changed between two snapshots. */
|
|
36
|
+
function delta(
|
|
37
|
+
before: Readonly<Record<string, string>>,
|
|
38
|
+
after: Readonly<Record<string, string>>,
|
|
39
|
+
): { added: string[]; removed: string[]; changed: string[] } {
|
|
40
|
+
const keys = (o: object): string[] => Object.keys(o).sort();
|
|
41
|
+
return {
|
|
42
|
+
added: keys(after).filter((k) => !(k in before)),
|
|
43
|
+
removed: keys(before).filter((k) => !(k in after)),
|
|
44
|
+
changed: keys(after).filter((k) => k in before && before[k] !== after[k]),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** A module that reports where it thinks it is. */
|
|
49
|
+
const WHERE = `export const where = { url: import.meta.url, dirname: import.meta.dirname, filename: import.meta.filename };\n`;
|
|
50
|
+
|
|
51
|
+
/** A module with a main guard of its own, the shape of `isMain(import.meta.url)`. */
|
|
52
|
+
const GUARDED = `import { pathToFileURL } from "node:url";
|
|
53
|
+
if (import.meta.url === pathToFileURL(process.argv[1]).href) console.log("guarded main ran");
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
/** Two entries sharing `lib/where.mjs`; the first also imports a guarded module. */
|
|
57
|
+
function fixture(extra: Readonly<Record<string, string>> = {}): string {
|
|
58
|
+
return writeTree(useTempDir("paperlint-bundle-"), {
|
|
59
|
+
"package.json": `{ "type": "module" }\n`,
|
|
60
|
+
"app/one/main.ts": `import { where } from "../../lib/where.mjs";\nimport "../../lib/guarded.mjs";\nconst n: string = "one";\nconsole.log(JSON.stringify({ entry: n, ...where }));\n`,
|
|
61
|
+
"app/two/main.mjs": `import { where } from "../../lib/where.mjs";\nconsole.log(JSON.stringify({ entry: "two", ...where }));\n`,
|
|
62
|
+
"lib/where.mjs": WHERE,
|
|
63
|
+
"lib/guarded.mjs": GUARDED,
|
|
64
|
+
"out/chunks/stale.js": "stale\n",
|
|
65
|
+
...extra,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const plan = (root: string, over: Partial<BundlePlan> = {}): BundlePlan => ({
|
|
70
|
+
root,
|
|
71
|
+
entries: ["app/one/main.ts", "app/two/main.mjs"],
|
|
72
|
+
chunkDir: "out/chunks",
|
|
73
|
+
tracked: () => [],
|
|
74
|
+
...over,
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
/** What `lib/where.mjs` must report about itself, wherever its code was bundled. */
|
|
78
|
+
const whereOf = (root: string, entry: string): Record<string, string> => ({
|
|
79
|
+
entry,
|
|
80
|
+
url: pathToFileURL(join(root, "lib", "where.mjs")).href,
|
|
81
|
+
dirname: join(root, "lib"),
|
|
82
|
+
filename: join(root, "lib", "where.mjs"),
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
describe("bundleSkills writes", () => {
|
|
86
|
+
it("writes every entry's bundle beside its source and the shared chunks, and nothing else", async () => {
|
|
87
|
+
const root = fixture();
|
|
88
|
+
const before = snapshot(root);
|
|
89
|
+
const written = await bundleSkills(plan(root));
|
|
90
|
+
// Guards: the run's own report and the disk agree, the stale chunk is gone, no file was edited.
|
|
91
|
+
expect(delta(before, snapshot(root))).toEqual({
|
|
92
|
+
added: written,
|
|
93
|
+
removed: ["out/chunks/stale.js"],
|
|
94
|
+
changed: [],
|
|
95
|
+
});
|
|
96
|
+
// Guards: each entry's bundle sits beside its source as `.js`; every other output is a chunk.
|
|
97
|
+
expect({
|
|
98
|
+
entries: written.filter((p) => !p.startsWith("out/chunks/")),
|
|
99
|
+
chunks: written.filter((p) => p.startsWith("out/chunks/")).length > 0,
|
|
100
|
+
}).toEqual({
|
|
101
|
+
entries: ["app/one/main.js", "app/two/main.js"],
|
|
102
|
+
chunks: true,
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
it("runs only the entry's own main, and each module keeps its own location", async () => {
|
|
107
|
+
const root = fixture();
|
|
108
|
+
await bundleSkills(plan(root));
|
|
109
|
+
const run = (entry: string) =>
|
|
110
|
+
runNode(join(root, entry), [], { cwd: root });
|
|
111
|
+
// Guards: the guarded module's main did not run, and `where` names its own source, not the bundle.
|
|
112
|
+
expect([run("app/one/main.js"), run("app/two/main.js")]).toEqual([
|
|
113
|
+
{
|
|
114
|
+
status: 0,
|
|
115
|
+
stdout: `${JSON.stringify(whereOf(root, "one"))}\n`,
|
|
116
|
+
stderr: "",
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
status: 0,
|
|
120
|
+
stdout: `${JSON.stringify(whereOf(root, "two"))}\n`,
|
|
121
|
+
stderr: "",
|
|
122
|
+
},
|
|
123
|
+
]);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it("keeps a module's location in a bundle written at the root itself", async () => {
|
|
127
|
+
const root = fixture({
|
|
128
|
+
"top.mjs": `import { where } from "./lib/where.mjs";\nconsole.log(JSON.stringify({ entry: "top", ...where }));\n`,
|
|
129
|
+
});
|
|
130
|
+
await bundleSkills(plan(root, { entries: ["top.mjs"] }));
|
|
131
|
+
// Guards: from a bundle in the root folder, `where` still names lib/where.mjs.
|
|
132
|
+
expect(runNode(join(root, "top.js"), [], { cwd: root })).toEqual({
|
|
133
|
+
status: 0,
|
|
134
|
+
stdout: `${JSON.stringify(whereOf(root, "top"))}\n`,
|
|
135
|
+
stderr: "",
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
describe("bundleSkills refuses", () => {
|
|
141
|
+
it("writing nothing, when an output is a tracked file", async () => {
|
|
142
|
+
const root = fixture();
|
|
143
|
+
const before = snapshot(root);
|
|
144
|
+
const tracked = (_: string, paths: readonly string[]): readonly string[] =>
|
|
145
|
+
paths.filter((p) => p === "app/one/main.js");
|
|
146
|
+
// Guards: the refusal names the tracked path, and the tree is byte-identical afterwards.
|
|
147
|
+
await expect(bundleSkills(plan(root, { tracked }))).rejects.toThrow(
|
|
148
|
+
"bundle-skills: refused\n app/one/main.js is tracked by git: a bundle must not overwrite it",
|
|
149
|
+
);
|
|
150
|
+
expect(snapshot(root)).toEqual(before);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it("an entry that another bundled module imports", async () => {
|
|
154
|
+
const root = fixture();
|
|
155
|
+
// Guards: an entry whose code would move into a chunk is named, not bundled.
|
|
156
|
+
await expect(
|
|
157
|
+
bundleSkills(
|
|
158
|
+
plan(root, { entries: ["app/one/main.ts", "lib/where.mjs"] }),
|
|
159
|
+
),
|
|
160
|
+
).rejects.toThrow(
|
|
161
|
+
"bundle-skills: refused\n lib/where.mjs is an entry and is imported by another bundled module: its code would leave its own file",
|
|
162
|
+
);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
it.each([
|
|
166
|
+
[
|
|
167
|
+
"import.meta.resolve",
|
|
168
|
+
`export const where = { r: import.meta.resolve("./x.mjs") };\n`,
|
|
169
|
+
"import.meta.resolve",
|
|
170
|
+
],
|
|
171
|
+
[
|
|
172
|
+
"a bare import.meta",
|
|
173
|
+
`export const where = { m: import.meta };\n`,
|
|
174
|
+
"import.meta",
|
|
175
|
+
],
|
|
176
|
+
])("%s in a module that is not the entry", async (_, source, named) => {
|
|
177
|
+
const root = fixture({ "lib/where.mjs": source });
|
|
178
|
+
// Guards: a use of import.meta the step cannot keep correct is refused with the module's path.
|
|
179
|
+
await expect(bundleSkills(plan(root))).rejects.toThrow(
|
|
180
|
+
`lib/where.mjs: ${named} cannot be kept correct inside a bundle`,
|
|
181
|
+
);
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
describe("gitTracked", () => {
|
|
186
|
+
it("names the tracked paths of those asked, and none outside a checkout", () => {
|
|
187
|
+
// Guards: a tracked file is reported, an absent one is not.
|
|
188
|
+
expect(gitTracked(ROOT, ["package.json", "no-such-file.js"])).toEqual([
|
|
189
|
+
"package.json",
|
|
190
|
+
]);
|
|
191
|
+
// Guards: a source archive or a git-dependency install has no `.git`, and npm runs
|
|
192
|
+
// `prepare` there; with no checkout no output can overwrite a tracked file.
|
|
193
|
+
const bare = useTempDir("paperlint-nogit-");
|
|
194
|
+
writeFileSync(join(bare, "x"), "");
|
|
195
|
+
expect(gitTracked(bare, ["x"])).toEqual([]);
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
describe("npm run build's bundle step, on this checkout", () => {
|
|
200
|
+
it("writes every skill entry's bundle and touches no tracked file", () => {
|
|
201
|
+
const status = (): string =>
|
|
202
|
+
execFileSync("git", ["status", "--porcelain", "--untracked-files=no"], {
|
|
203
|
+
cwd: ROOT,
|
|
204
|
+
encoding: "utf8",
|
|
205
|
+
});
|
|
206
|
+
const before = status();
|
|
207
|
+
const r = runNode(join(ROOT, "scripts", "bundle-skills.ts"));
|
|
208
|
+
const listed = r.stderr
|
|
209
|
+
.split("\n")
|
|
210
|
+
.slice(1)
|
|
211
|
+
.map((l) => l.trim())
|
|
212
|
+
.filter(Boolean);
|
|
213
|
+
const bundles = SKILL_ENTRIES.map((e) => e.replace(/\.(ts|mjs)$/, ".js"));
|
|
214
|
+
// Guards: the step succeeded, kept stdout empty (npm pack --json), and wrote every entry's bundle.
|
|
215
|
+
expect({
|
|
216
|
+
status: r.status,
|
|
217
|
+
stdout: r.stdout,
|
|
218
|
+
bundles: bundles.filter((b) => listed.includes(b)),
|
|
219
|
+
others: listed.filter(
|
|
220
|
+
(p) => !bundles.includes(p) && !p.startsWith(`${CHUNK_DIR}/`),
|
|
221
|
+
),
|
|
222
|
+
}).toEqual({ status: 0, stdout: "", bundles, others: [] });
|
|
223
|
+
// Guards: no tracked file changed.
|
|
224
|
+
expect(status()).toBe(before);
|
|
225
|
+
});
|
|
226
|
+
});
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* `npm run build`'s second step: bundle every script a skill runs, so it runs with no
|
|
4
|
+
* `node_modules` at all — a Claude Code plugin copy is the tarball unpacked without its
|
|
5
|
+
* dependencies, and there a script that imports `zod` or `#src/…` dies with `ERR_MODULE_NOT_FOUND`
|
|
6
|
+
* before it reads its arguments (test/e2e/install/skill-scripts.e2e.ts measures it).
|
|
7
|
+
*
|
|
8
|
+
* ── LAYOUT ──────────────────────────────────────────────────────────────────────────────────
|
|
9
|
+
* Each entry's bundle is written BESIDE its source as `<name>.js` — the path the skill already
|
|
10
|
+
* runs: `headings.ts` → `headings.js` (replacing tsc's output of the same name), `verify-cites.mjs`
|
|
11
|
+
* → `verify-cites.js`. Code two entries share goes to one chunk folder, `dist/skill-chunks/`, which
|
|
12
|
+
* every entry imports by a relative path. The checkout, a consumer's `node_modules` and a plugin
|
|
13
|
+
* copy all hold the same tree, so the same `node ${CLAUDE_SKILL_DIR}/scripts/<name>.js` runs in all
|
|
14
|
+
* three. Every output is a build output: gitignored, shipped by `files`, never a tracked file — the
|
|
15
|
+
* step refuses before writing anything if one would be.
|
|
16
|
+
*
|
|
17
|
+
* ── `import.meta` IN A MODULE THAT IS NOT THE ENTRY ─────────────────────────────────────────
|
|
18
|
+
* Inside one bundle every module's `import.meta.url` is the bundle's. Two things break: a main
|
|
19
|
+
* guard (`isMain(import.meta.url)`) is true for EVERY module, so a bundle would run a second
|
|
20
|
+
* module's `main()`; and a module that finds the package's data from its own location
|
|
21
|
+
* (`src/package-dirs.ts`) looks beside the bundle instead. So in every module of this repository
|
|
22
|
+
* other than the entry, `import.meta.url`, `.dirname` and `.filename` are rewritten to the module's
|
|
23
|
+
* own source location, relative to the output file it lands in (the source tree ships too). The
|
|
24
|
+
* entry keeps its own: its bundle sits where its source does. Any other use of `import.meta` is
|
|
25
|
+
* refused, and so is an entry that another bundled module imports (its code would leave its file).
|
|
26
|
+
*/
|
|
27
|
+
import { execFileSync, spawnSync } from "node:child_process";
|
|
28
|
+
import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
29
|
+
import { dirname, join, relative, sep } from "node:path";
|
|
30
|
+
import { fileURLToPath } from "node:url";
|
|
31
|
+
import {
|
|
32
|
+
build,
|
|
33
|
+
type BuildOptions,
|
|
34
|
+
type Metafile,
|
|
35
|
+
type OutputFile,
|
|
36
|
+
type Plugin,
|
|
37
|
+
} from "esbuild";
|
|
38
|
+
import ts from "typescript";
|
|
39
|
+
import { isMain } from "../skills/paper-pipeline/scripts/consumer.mjs";
|
|
40
|
+
|
|
41
|
+
const ROOT = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
42
|
+
|
|
43
|
+
/** The scripts the skills run (`node ${CLAUDE_SKILL_DIR}/…` in a SKILL.md), as their sources. */
|
|
44
|
+
export const SKILL_ENTRIES: readonly string[] = [
|
|
45
|
+
"skills/argument-arc/scripts/headings.ts",
|
|
46
|
+
"skills/build-label-page/scripts/label-page.ts",
|
|
47
|
+
"skills/cold-read-diff/scripts/cold-read.ts",
|
|
48
|
+
"skills/label-agent-runs/scripts/labels.ts",
|
|
49
|
+
"skills/paper-pipeline/scripts/extract-ref-facts.mjs",
|
|
50
|
+
"skills/pc-panel-review/scripts/prior-reviews.ts",
|
|
51
|
+
"skills/run-agent-grid/scripts/grid-guard.ts",
|
|
52
|
+
"skills/verify-citations/scripts/bib-authors.mjs",
|
|
53
|
+
"skills/verify-citations/scripts/verify-cites.mjs",
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
/** Where the code shared by two or more entries goes, below the package root. */
|
|
57
|
+
export const CHUNK_DIR = "dist/skill-chunks";
|
|
58
|
+
|
|
59
|
+
/** What one run bundles, and the one effect it asks the world: which paths git tracks. */
|
|
60
|
+
export interface BundlePlan {
|
|
61
|
+
readonly root: string;
|
|
62
|
+
/** Entry sources, relative to `root`. */
|
|
63
|
+
readonly entries: readonly string[];
|
|
64
|
+
/** The chunk folder, relative to `root`; emptied and refilled by every run. */
|
|
65
|
+
readonly chunkDir: string;
|
|
66
|
+
/** Of `paths` (relative to `root`), the ones git tracks. */
|
|
67
|
+
readonly tracked: (
|
|
68
|
+
root: string,
|
|
69
|
+
paths: readonly string[],
|
|
70
|
+
) => readonly string[];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* CommonJS dependencies call `require` and read `__dirname`; an ES module has neither, so each
|
|
75
|
+
* output file defines them first.
|
|
76
|
+
*/
|
|
77
|
+
const BANNER = [
|
|
78
|
+
`import { createRequire as __plCreateRequire } from "node:module";`,
|
|
79
|
+
`import { fileURLToPath as __plFileURLToPath } from "node:url";`,
|
|
80
|
+
`import { dirname as __plDirname } from "node:path";`,
|
|
81
|
+
`const require = __plCreateRequire(import.meta.url);`,
|
|
82
|
+
`const __filename = __plFileURLToPath(import.meta.url);`,
|
|
83
|
+
`const __dirname = __plDirname(__filename);`,
|
|
84
|
+
].join("\n");
|
|
85
|
+
|
|
86
|
+
/** `path` relative to `root`, with forward slashes. */
|
|
87
|
+
const posix = (root: string, path: string): string =>
|
|
88
|
+
relative(root, path).split(sep).join("/");
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Stands for "the package root, relative to this output file" in a rewritten module, until the
|
|
92
|
+
* file the module lands in (an entry's bundle or a chunk) is known; replaced in every output.
|
|
93
|
+
*/
|
|
94
|
+
const ROOT_TOKEN = "__PAPERLINT_BUNDLE_ROOT__";
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* What each kept `import.meta` property becomes, given the expression for the module's own URL.
|
|
98
|
+
* `__plFileURLToPath` and `__plDirname` are the BANNER's imports, at the top of every output file.
|
|
99
|
+
*/
|
|
100
|
+
const KEPT: Readonly<Record<string, (url: string) => string>> = {
|
|
101
|
+
url: (url) => url,
|
|
102
|
+
filename: (url) => `__plFileURLToPath(${url})`,
|
|
103
|
+
dirname: (url) => `__plDirname(__plFileURLToPath(${url}))`,
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/** One `import.meta` in a module: its span, and the property read (`""` for a bare `import.meta`). */
|
|
107
|
+
interface MetaUse {
|
|
108
|
+
readonly start: number;
|
|
109
|
+
readonly end: number;
|
|
110
|
+
readonly property: string;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** Every `import.meta` in `code`, found by the TypeScript parser: a comment that quotes one is not one. */
|
|
114
|
+
function metaUses(code: string, file: string): readonly MetaUse[] {
|
|
115
|
+
const kind = file.endsWith("ts") ? ts.ScriptKind.TS : ts.ScriptKind.JS;
|
|
116
|
+
const source = ts.createSourceFile(
|
|
117
|
+
file,
|
|
118
|
+
code,
|
|
119
|
+
ts.ScriptTarget.Latest,
|
|
120
|
+
true,
|
|
121
|
+
kind,
|
|
122
|
+
);
|
|
123
|
+
const visit = (node: ts.Node): readonly MetaUse[] => {
|
|
124
|
+
if (
|
|
125
|
+
!ts.isMetaProperty(node) ||
|
|
126
|
+
node.keywordToken !== ts.SyntaxKind.ImportKeyword
|
|
127
|
+
)
|
|
128
|
+
return node.getChildren(source).flatMap(visit);
|
|
129
|
+
const parent = node.parent;
|
|
130
|
+
const read =
|
|
131
|
+
ts.isPropertyAccessExpression(parent) && parent.expression === node;
|
|
132
|
+
const span = read ? parent : node;
|
|
133
|
+
return [
|
|
134
|
+
{
|
|
135
|
+
start: span.getStart(source),
|
|
136
|
+
end: span.end,
|
|
137
|
+
property: read ? parent.name.text : "",
|
|
138
|
+
},
|
|
139
|
+
];
|
|
140
|
+
};
|
|
141
|
+
return visit(source);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** `code` of the module at `file`, its `import.meta` rewritten to the module's own source location. */
|
|
145
|
+
function keptLocation(code: string, file: string, root: string): string {
|
|
146
|
+
const rel = posix(root, file);
|
|
147
|
+
const url = `new URL(${JSON.stringify(`${ROOT_TOKEN}/${rel}`)}, import.meta.url).href`;
|
|
148
|
+
const uses = metaUses(code, file).map((u) => ({
|
|
149
|
+
...u,
|
|
150
|
+
as: KEPT[u.property],
|
|
151
|
+
}));
|
|
152
|
+
const kept = uses.filter(
|
|
153
|
+
(u): u is MetaUse & { as: (url: string) => string } => u.as !== undefined,
|
|
154
|
+
);
|
|
155
|
+
const lost = uses.filter((u) => u.as === undefined);
|
|
156
|
+
if (lost.length > 0)
|
|
157
|
+
throw new Error(
|
|
158
|
+
lost
|
|
159
|
+
.map(
|
|
160
|
+
(u) =>
|
|
161
|
+
`${rel}: ${u.property ? `import.meta.${u.property}` : "import.meta"} cannot be kept correct inside a bundle`,
|
|
162
|
+
)
|
|
163
|
+
.join("\n"),
|
|
164
|
+
);
|
|
165
|
+
return kept.reduceRight(
|
|
166
|
+
(text, u) => text.slice(0, u.start) + u.as(url) + text.slice(u.end),
|
|
167
|
+
code,
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** The esbuild plugin that applies `keptLocation` to every module of this tree but the entries. */
|
|
172
|
+
const keepOwnLocation = (
|
|
173
|
+
root: string,
|
|
174
|
+
entries: ReadonlySet<string>,
|
|
175
|
+
): Plugin => ({
|
|
176
|
+
name: "keep-own-location",
|
|
177
|
+
setup(b) {
|
|
178
|
+
b.onLoad({ filter: /\.[cm]?[jt]s$/ }, (args) => {
|
|
179
|
+
const foreign = args.path.split(sep).includes("node_modules");
|
|
180
|
+
if (foreign || entries.has(args.path)) return undefined;
|
|
181
|
+
const code = readFileSync(args.path, "utf8");
|
|
182
|
+
if (!code.includes("import.meta")) return undefined;
|
|
183
|
+
const loader = args.path.endsWith("ts") ? "ts" : "js";
|
|
184
|
+
return { contents: keptLocation(code, args.path, root), loader };
|
|
185
|
+
});
|
|
186
|
+
},
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
/** An output file's text with `ROOT_TOKEN` replaced by the way from its folder to the root. */
|
|
190
|
+
const located = (root: string, f: OutputFile): string =>
|
|
191
|
+
f.text.replaceAll(ROOT_TOKEN, posix(dirname(f.path), root) || ".");
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* The paths of `paths` that git tracks in `root`. Outside a checkout (a source archive, or a
|
|
195
|
+
* git-dependency install, where npm runs `prepare` with no `.git`) nothing is tracked, so none.
|
|
196
|
+
*/
|
|
197
|
+
export function gitTracked(
|
|
198
|
+
root: string,
|
|
199
|
+
paths: readonly string[],
|
|
200
|
+
): readonly string[] {
|
|
201
|
+
const inCheckout =
|
|
202
|
+
spawnSync("git", ["rev-parse", "--is-inside-work-tree"], {
|
|
203
|
+
cwd: root,
|
|
204
|
+
stdio: "ignore",
|
|
205
|
+
}).status === 0;
|
|
206
|
+
if (!inCheckout) return [];
|
|
207
|
+
const out = execFileSync("git", ["ls-files", "-z", "--", ...paths], {
|
|
208
|
+
cwd: root,
|
|
209
|
+
encoding: "utf8",
|
|
210
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
211
|
+
});
|
|
212
|
+
return out.split("\0").filter((p) => p !== "");
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/** The entries some other bundled module imports, from esbuild's metafile. */
|
|
216
|
+
const importedEntries = (
|
|
217
|
+
meta: Metafile,
|
|
218
|
+
entries: readonly string[],
|
|
219
|
+
): readonly string[] =>
|
|
220
|
+
entries.filter((e) =>
|
|
221
|
+
Object.values(meta.inputs).some((input) =>
|
|
222
|
+
input.imports.some((i) => i.path === e),
|
|
223
|
+
),
|
|
224
|
+
);
|
|
225
|
+
|
|
226
|
+
/** Refuse a plan whose run would break an entry or overwrite a tracked file. */
|
|
227
|
+
function refusals(
|
|
228
|
+
plan: BundlePlan,
|
|
229
|
+
meta: Metafile,
|
|
230
|
+
outputs: readonly string[],
|
|
231
|
+
): readonly string[] {
|
|
232
|
+
const tracked = plan.tracked(plan.root, outputs);
|
|
233
|
+
return [
|
|
234
|
+
...tracked.map(
|
|
235
|
+
(p) => `${p} is tracked by git: a bundle must not overwrite it`,
|
|
236
|
+
),
|
|
237
|
+
...importedEntries(meta, plan.entries).map(
|
|
238
|
+
(e) =>
|
|
239
|
+
`${e} is an entry and is imported by another bundled module: its code would leave its own file`,
|
|
240
|
+
),
|
|
241
|
+
];
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* esbuild's options for `plan`: one ES module per entry beside its source, shared code split into
|
|
246
|
+
* `plan.chunkDir`, `#src/…` resolved to the sources, nothing written yet.
|
|
247
|
+
*/
|
|
248
|
+
const options = (
|
|
249
|
+
plan: BundlePlan,
|
|
250
|
+
): BuildOptions & { readonly write: false; readonly metafile: true } => ({
|
|
251
|
+
absWorkingDir: plan.root,
|
|
252
|
+
entryPoints: plan.entries.map((e) => join(plan.root, e)),
|
|
253
|
+
outdir: plan.root,
|
|
254
|
+
outbase: plan.root,
|
|
255
|
+
entryNames: "[dir]/[name]",
|
|
256
|
+
chunkNames: `${plan.chunkDir}/[name]-[hash]`,
|
|
257
|
+
bundle: true,
|
|
258
|
+
splitting: true,
|
|
259
|
+
platform: "node",
|
|
260
|
+
format: "esm",
|
|
261
|
+
target: "node22",
|
|
262
|
+
conditions: ["paperlint-source"],
|
|
263
|
+
banner: { js: BANNER },
|
|
264
|
+
plugins: [
|
|
265
|
+
keepOwnLocation(
|
|
266
|
+
plan.root,
|
|
267
|
+
new Set(plan.entries.map((e) => join(plan.root, e))),
|
|
268
|
+
),
|
|
269
|
+
],
|
|
270
|
+
write: false,
|
|
271
|
+
metafile: true,
|
|
272
|
+
logLevel: "silent",
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
/** Bundle `plan.entries`; returns the files written, relative to `plan.root`, sorted. */
|
|
276
|
+
export async function bundleSkills(
|
|
277
|
+
plan: BundlePlan,
|
|
278
|
+
): Promise<readonly string[]> {
|
|
279
|
+
const result = await build(options(plan));
|
|
280
|
+
const files = result.outputFiles;
|
|
281
|
+
const outputs = files.map((f) => posix(plan.root, f.path)).sort();
|
|
282
|
+
const refused = refusals(plan, result.metafile, outputs);
|
|
283
|
+
if (refused.length > 0)
|
|
284
|
+
throw new Error(`bundle-skills: refused\n ${refused.join("\n ")}`);
|
|
285
|
+
rmSync(join(plan.root, plan.chunkDir), { recursive: true, force: true });
|
|
286
|
+
files.forEach((f) => {
|
|
287
|
+
mkdirSync(dirname(f.path), { recursive: true });
|
|
288
|
+
writeFileSync(f.path, located(plan.root, f));
|
|
289
|
+
});
|
|
290
|
+
return outputs;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
if (isMain(import.meta.url)) {
|
|
294
|
+
const written = await bundleSkills({
|
|
295
|
+
root: ROOT,
|
|
296
|
+
entries: SKILL_ENTRIES,
|
|
297
|
+
chunkDir: CHUNK_DIR,
|
|
298
|
+
tracked: gitTracked,
|
|
299
|
+
});
|
|
300
|
+
// stderr: `npm pack --json` runs this as `prepare`, and its stdout must stay the JSON.
|
|
301
|
+
process.stderr.write(
|
|
302
|
+
`bundle-skills: wrote ${String(written.length)} files\n ${written.join("\n ")}\n`,
|
|
303
|
+
);
|
|
304
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { describe, expect, it } from "vitest";
|
|
6
|
+
import { useTempDir, writeTree } from "../test/support.ts";
|
|
7
|
+
import { main, PLACEHOLDER, withVersion } from "./plugin-version.ts";
|
|
8
|
+
|
|
9
|
+
const dir = useTempDir("paperlint-plugin-version-");
|
|
10
|
+
const MANIFEST = {
|
|
11
|
+
name: "paperlint",
|
|
12
|
+
version: PLACEHOLDER,
|
|
13
|
+
skills: "./skills/",
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const packageAt = (name: string, pkg: object): string => {
|
|
17
|
+
const root = join(dir, name);
|
|
18
|
+
writeTree(root, {
|
|
19
|
+
"package.json": JSON.stringify(pkg),
|
|
20
|
+
".claude-plugin/plugin.json": JSON.stringify(MANIFEST),
|
|
21
|
+
});
|
|
22
|
+
return root;
|
|
23
|
+
};
|
|
24
|
+
const manifestOf = (root: string): unknown =>
|
|
25
|
+
JSON.parse(readFileSync(join(root, ".claude-plugin", "plugin.json"), "utf8"));
|
|
26
|
+
|
|
27
|
+
describe("plugin-version", () => {
|
|
28
|
+
it("stamp writes the package's version, restore puts the placeholder back, the rest kept", () => {
|
|
29
|
+
const root = packageAt("release", { version: "1.2.3" });
|
|
30
|
+
const stamped = [main("stamp", root), manifestOf(root)];
|
|
31
|
+
const restored = [main("restore", root), manifestOf(root)];
|
|
32
|
+
expect([stamped, restored]).toEqual([
|
|
33
|
+
[0, { ...MANIFEST, version: "1.2.3" }],
|
|
34
|
+
[0, MANIFEST],
|
|
35
|
+
]);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it("a package.json without a version stamps the placeholder; an unknown verb writes nothing", () => {
|
|
39
|
+
const root = packageAt("bare", { name: "x" });
|
|
40
|
+
expect([
|
|
41
|
+
main("stamp", root),
|
|
42
|
+
main("publish", root),
|
|
43
|
+
main(undefined, root),
|
|
44
|
+
manifestOf(root),
|
|
45
|
+
]).toEqual([0, 2, 2, MANIFEST]);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it("withVersion: the two-space form with a final newline; a manifest that is not an object is refused", () => {
|
|
49
|
+
expect(withVersion('{"name":"p"}', "9.9.9")).toBe(
|
|
50
|
+
'{\n "name": "p",\n "version": "9.9.9"\n}\n',
|
|
51
|
+
);
|
|
52
|
+
expect(() => withVersion("[1]", "9.9.9")).toThrow(
|
|
53
|
+
"plugin.json is not a JSON object",
|
|
54
|
+
);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("run as npm runs it: a verb it does not know exits 2 and names the usage", () => {
|
|
58
|
+
const r = spawnSync(
|
|
59
|
+
process.execPath,
|
|
60
|
+
[fileURLToPath(new URL("plugin-version.ts", import.meta.url)), "pack"],
|
|
61
|
+
{ encoding: "utf8" },
|
|
62
|
+
);
|
|
63
|
+
expect([r.status, r.stderr]).toEqual([
|
|
64
|
+
2,
|
|
65
|
+
"usage: node scripts/plugin-version.ts stamp|restore\n",
|
|
66
|
+
]);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("the tracked manifest carries the placeholder, as the tracked package.json does", () => {
|
|
70
|
+
const tracked = (file: string): unknown =>
|
|
71
|
+
JSON.parse(readFileSync(new URL(`../${file}`, import.meta.url), "utf8"));
|
|
72
|
+
expect([
|
|
73
|
+
tracked(".claude-plugin/plugin.json"),
|
|
74
|
+
tracked("package.json"),
|
|
75
|
+
]).toEqual([
|
|
76
|
+
expect.objectContaining({ version: PLACEHOLDER }),
|
|
77
|
+
expect.objectContaining({ version: PLACEHOLDER }),
|
|
78
|
+
]);
|
|
79
|
+
});
|
|
80
|
+
});
|