plumbbob 0.9.3 → 0.9.5
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/plugin.json +1 -1
- package/README.md +15 -13
- package/dist/cli-core.js +19 -2
- package/dist/lib/check.js +46 -13
- package/dist/lib/intent.js +1 -1
- package/dist/lib/latch.js +3 -3
- package/dist/lib/reentry.js +70 -0
- package/dist/verbs/agent.js +2 -2
- package/dist/verbs/doctor.js +4 -4
- package/dist/verbs/finish.js +1 -1
- package/dist/verbs/recover.js +297 -0
- package/dist/verbs/revert.js +2 -2
- package/dist/verbs/spike.js +8 -2
- package/hooks/post-edit.sh +4 -4
- package/hooks/pre-bash-commit.sh +3 -3
- package/node_modules/checkride/.claude-plugin/plugin.json +11 -0
- package/node_modules/checkride/CHANGELOG.md +1003 -0
- package/node_modules/checkride/LICENSE +201 -21
- package/node_modules/checkride/README.md +171 -30
- package/node_modules/checkride/dist/__tests__/fixtures/released-stanzas.d.ts +15 -0
- package/node_modules/checkride/dist/__tests__/fixtures/released-stanzas.d.ts.map +1 -0
- package/node_modules/checkride/dist/__tests__/fixtures/released-stanzas.js +17 -0
- package/node_modules/checkride/dist/__tests__/fixtures/released-stanzas.js.map +1 -0
- package/node_modules/checkride/dist/adapters.d.ts +18 -6
- package/node_modules/checkride/dist/adapters.d.ts.map +1 -1
- package/node_modules/checkride/dist/adapters.js +42 -23
- package/node_modules/checkride/dist/adapters.js.map +1 -1
- package/node_modules/checkride/dist/agent-setup/claude.d.ts +88 -0
- package/node_modules/checkride/dist/agent-setup/claude.d.ts.map +1 -0
- package/node_modules/checkride/dist/agent-setup/claude.js +305 -0
- package/node_modules/checkride/dist/agent-setup/claude.js.map +1 -0
- package/node_modules/checkride/dist/agent-setup/command.d.ts +43 -0
- package/node_modules/checkride/dist/agent-setup/command.d.ts.map +1 -0
- package/node_modules/checkride/dist/agent-setup/command.js +77 -0
- package/node_modules/checkride/dist/agent-setup/command.js.map +1 -0
- package/node_modules/checkride/dist/agent-setup/cursor.d.ts +61 -0
- package/node_modules/checkride/dist/agent-setup/cursor.d.ts.map +1 -0
- package/node_modules/checkride/dist/agent-setup/cursor.js +189 -0
- package/node_modules/checkride/dist/agent-setup/cursor.js.map +1 -0
- package/node_modules/checkride/dist/agent-setup/files.d.ts +50 -0
- package/node_modules/checkride/dist/agent-setup/files.d.ts.map +1 -0
- package/node_modules/checkride/dist/agent-setup/files.js +80 -0
- package/node_modules/checkride/dist/agent-setup/files.js.map +1 -0
- package/node_modules/checkride/dist/agent-setup/harness.d.ts +101 -0
- package/node_modules/checkride/dist/agent-setup/harness.d.ts.map +1 -0
- package/node_modules/checkride/dist/agent-setup/harness.js +84 -0
- package/node_modules/checkride/dist/agent-setup/harness.js.map +1 -0
- package/node_modules/checkride/dist/agent-setup/hook.d.ts +45 -52
- package/node_modules/checkride/dist/agent-setup/hook.d.ts.map +1 -1
- package/node_modules/checkride/dist/agent-setup/hook.js +64 -95
- package/node_modules/checkride/dist/agent-setup/hook.js.map +1 -1
- package/node_modules/checkride/dist/agent-setup/index.d.ts +10 -4
- package/node_modules/checkride/dist/agent-setup/index.d.ts.map +1 -1
- package/node_modules/checkride/dist/agent-setup/index.js +9 -4
- package/node_modules/checkride/dist/agent-setup/index.js.map +1 -1
- package/node_modules/checkride/dist/agent-setup/scripts.d.ts +58 -0
- package/node_modules/checkride/dist/agent-setup/scripts.d.ts.map +1 -0
- package/node_modules/checkride/dist/agent-setup/scripts.js +299 -0
- package/node_modules/checkride/dist/agent-setup/scripts.js.map +1 -0
- package/node_modules/checkride/dist/agent-setup/skills.d.ts +31 -0
- package/node_modules/checkride/dist/agent-setup/skills.d.ts.map +1 -0
- package/node_modules/checkride/dist/agent-setup/skills.js +56 -0
- package/node_modules/checkride/dist/agent-setup/skills.js.map +1 -0
- package/node_modules/checkride/dist/artifacts/configured.d.ts +30 -0
- package/node_modules/checkride/dist/artifacts/configured.d.ts.map +1 -0
- package/node_modules/checkride/dist/artifacts/configured.js +45 -0
- package/node_modules/checkride/dist/artifacts/configured.js.map +1 -0
- package/node_modules/checkride/dist/artifacts/format.d.ts +33 -0
- package/node_modules/checkride/dist/artifacts/format.d.ts.map +1 -0
- package/node_modules/checkride/dist/artifacts/format.js +56 -0
- package/node_modules/checkride/dist/artifacts/format.js.map +1 -0
- package/node_modules/checkride/dist/artifacts/freshness.d.ts +32 -0
- package/node_modules/checkride/dist/artifacts/freshness.d.ts.map +1 -0
- package/node_modules/checkride/dist/artifacts/freshness.js +37 -0
- package/node_modules/checkride/dist/artifacts/freshness.js.map +1 -0
- package/node_modules/checkride/dist/artifacts/index.d.ts +22 -0
- package/node_modules/checkride/dist/artifacts/index.d.ts.map +1 -0
- package/node_modules/checkride/dist/artifacts/index.js +19 -0
- package/node_modules/checkride/dist/artifacts/index.js.map +1 -0
- package/node_modules/checkride/dist/artifacts/json.d.ts +31 -0
- package/node_modules/checkride/dist/artifacts/json.d.ts.map +1 -0
- package/node_modules/checkride/dist/artifacts/json.js +47 -0
- package/node_modules/checkride/dist/artifacts/json.js.map +1 -0
- package/node_modules/checkride/dist/artifacts/raw.d.ts +60 -0
- package/node_modules/checkride/dist/artifacts/raw.d.ts.map +1 -0
- package/node_modules/checkride/dist/artifacts/raw.js +91 -0
- package/node_modules/checkride/dist/artifacts/raw.js.map +1 -0
- package/node_modules/checkride/dist/artifacts/summary.d.ts +69 -0
- package/node_modules/checkride/dist/artifacts/summary.d.ts.map +1 -0
- package/node_modules/checkride/dist/artifacts/summary.js +108 -0
- package/node_modules/checkride/dist/artifacts/summary.js.map +1 -0
- package/node_modules/checkride/dist/atomic.d.ts +16 -1
- package/node_modules/checkride/dist/atomic.d.ts.map +1 -1
- package/node_modules/checkride/dist/atomic.js +25 -3
- package/node_modules/checkride/dist/atomic.js.map +1 -1
- package/node_modules/checkride/dist/baseline/fallow.d.ts +9 -5
- package/node_modules/checkride/dist/baseline/fallow.d.ts.map +1 -1
- package/node_modules/checkride/dist/baseline/fallow.js +161 -58
- package/node_modules/checkride/dist/baseline/fallow.js.map +1 -1
- package/node_modules/checkride/dist/baseline/fingerprint.d.ts +7 -7
- package/node_modules/checkride/dist/baseline/fingerprint.d.ts.map +1 -1
- package/node_modules/checkride/dist/baseline/fingerprint.js +16 -19
- package/node_modules/checkride/dist/baseline/fingerprint.js.map +1 -1
- package/node_modules/checkride/dist/baseline/index.d.ts +4 -4
- package/node_modules/checkride/dist/baseline/index.d.ts.map +1 -1
- package/node_modules/checkride/dist/baseline/index.js +4 -4
- package/node_modules/checkride/dist/baseline/index.js.map +1 -1
- package/node_modules/checkride/dist/baseline/store.d.ts +12 -4
- package/node_modules/checkride/dist/baseline/store.d.ts.map +1 -1
- package/node_modules/checkride/dist/baseline/store.js +16 -9
- package/node_modules/checkride/dist/baseline/store.js.map +1 -1
- package/node_modules/checkride/dist/baseline-command.d.ts +5 -5
- package/node_modules/checkride/dist/baseline-command.js +7 -7
- package/node_modules/checkride/dist/baseline-command.js.map +1 -1
- package/node_modules/checkride/dist/cli.d.ts +17 -4
- package/node_modules/checkride/dist/cli.d.ts.map +1 -1
- package/node_modules/checkride/dist/cli.js +259 -18
- package/node_modules/checkride/dist/cli.js.map +1 -1
- package/node_modules/checkride/dist/config.d.ts +84 -8
- package/node_modules/checkride/dist/config.d.ts.map +1 -1
- package/node_modules/checkride/dist/config.js +122 -18
- package/node_modules/checkride/dist/config.js.map +1 -1
- package/node_modules/checkride/dist/digest/digest.d.ts +5 -5
- package/node_modules/checkride/dist/digest/digest.js +5 -5
- package/node_modules/checkride/dist/digest/index.d.ts +2 -2
- package/node_modules/checkride/dist/digest/index.js +2 -2
- package/node_modules/checkride/dist/doctor.d.ts +25 -6
- package/node_modules/checkride/dist/doctor.d.ts.map +1 -1
- package/node_modules/checkride/dist/doctor.js +193 -27
- package/node_modules/checkride/dist/doctor.js.map +1 -1
- package/node_modules/checkride/dist/gate.d.ts +135 -0
- package/node_modules/checkride/dist/gate.d.ts.map +1 -0
- package/node_modules/checkride/dist/gate.js +490 -0
- package/node_modules/checkride/dist/gate.js.map +1 -0
- package/node_modules/checkride/dist/init.d.ts +72 -12
- package/node_modules/checkride/dist/init.d.ts.map +1 -1
- package/node_modules/checkride/dist/init.js +324 -81
- package/node_modules/checkride/dist/init.js.map +1 -1
- package/node_modules/checkride/dist/json.d.ts +21 -0
- package/node_modules/checkride/dist/json.d.ts.map +1 -0
- package/node_modules/checkride/dist/json.js +21 -0
- package/node_modules/checkride/dist/json.js.map +1 -0
- package/node_modules/checkride/dist/links.d.ts +31 -5
- package/node_modules/checkride/dist/links.d.ts.map +1 -1
- package/node_modules/checkride/dist/links.js +141 -32
- package/node_modules/checkride/dist/links.js.map +1 -1
- package/node_modules/checkride/dist/node-pin.d.ts +129 -0
- package/node_modules/checkride/dist/node-pin.d.ts.map +1 -0
- package/node_modules/checkride/dist/node-pin.js +211 -0
- package/node_modules/checkride/dist/node-pin.js.map +1 -0
- package/node_modules/checkride/dist/orchestrator.d.ts +40 -10
- package/node_modules/checkride/dist/orchestrator.d.ts.map +1 -1
- package/node_modules/checkride/dist/orchestrator.js +196 -102
- package/node_modules/checkride/dist/orchestrator.js.map +1 -1
- package/node_modules/checkride/dist/pack.d.ts +8 -9
- package/node_modules/checkride/dist/pack.d.ts.map +1 -1
- package/node_modules/checkride/dist/pack.js +53 -17
- package/node_modules/checkride/dist/pack.js.map +1 -1
- package/node_modules/checkride/dist/pm/detect.d.ts +6 -1
- package/node_modules/checkride/dist/pm/detect.d.ts.map +1 -1
- package/node_modules/checkride/dist/pm/detect.js +6 -1
- package/node_modules/checkride/dist/pm/detect.js.map +1 -1
- package/node_modules/checkride/dist/pm/index.d.ts +6 -2
- package/node_modules/checkride/dist/pm/index.d.ts.map +1 -1
- package/node_modules/checkride/dist/pm/index.js +6 -2
- package/node_modules/checkride/dist/pm/index.js.map +1 -1
- package/node_modules/checkride/dist/pm/launch.d.ts +51 -0
- package/node_modules/checkride/dist/pm/launch.d.ts.map +1 -0
- package/node_modules/checkride/dist/pm/launch.js +92 -0
- package/node_modules/checkride/dist/pm/launch.js.map +1 -0
- package/node_modules/checkride/dist/pm/tools.d.ts +73 -0
- package/node_modules/checkride/dist/pm/tools.d.ts.map +1 -0
- package/node_modules/checkride/dist/pm/tools.js +124 -0
- package/node_modules/checkride/dist/pm/tools.js.map +1 -0
- package/node_modules/checkride/dist/pm/translate.d.ts +35 -9
- package/node_modules/checkride/dist/pm/translate.d.ts.map +1 -1
- package/node_modules/checkride/dist/pm/translate.js +78 -18
- package/node_modules/checkride/dist/pm/translate.js.map +1 -1
- package/node_modules/checkride/dist/proc.d.ts +30 -0
- package/node_modules/checkride/dist/proc.d.ts.map +1 -0
- package/node_modules/checkride/dist/proc.js +42 -0
- package/node_modules/checkride/dist/proc.js.map +1 -0
- package/node_modules/checkride/dist/qa/cli.d.ts +20 -0
- package/node_modules/checkride/dist/qa/cli.d.ts.map +1 -0
- package/node_modules/checkride/dist/qa/cli.js +24 -0
- package/node_modules/checkride/dist/qa/cli.js.map +1 -0
- package/node_modules/checkride/dist/qa/dead.d.ts +39 -0
- package/node_modules/checkride/dist/qa/dead.d.ts.map +1 -0
- package/node_modules/checkride/dist/qa/dead.js +88 -0
- package/node_modules/checkride/dist/qa/dead.js.map +1 -0
- package/node_modules/checkride/dist/qa/dupes.d.ts +45 -0
- package/node_modules/checkride/dist/qa/dupes.d.ts.map +1 -0
- package/node_modules/checkride/dist/qa/dupes.js +62 -0
- package/node_modules/checkride/dist/qa/dupes.js.map +1 -0
- package/node_modules/checkride/dist/qa/health.d.ts +85 -0
- package/node_modules/checkride/dist/qa/health.d.ts.map +1 -0
- package/node_modules/checkride/dist/qa/health.js +109 -0
- package/node_modules/checkride/dist/qa/health.js.map +1 -0
- package/node_modules/checkride/dist/qa/index.d.ts +23 -0
- package/node_modules/checkride/dist/qa/index.d.ts.map +1 -0
- package/node_modules/checkride/dist/qa/index.js +22 -0
- package/node_modules/checkride/dist/qa/index.js.map +1 -0
- package/node_modules/checkride/dist/qa/mutation.d.ts +80 -0
- package/node_modules/checkride/dist/qa/mutation.d.ts.map +1 -0
- package/node_modules/checkride/dist/qa/mutation.js +195 -0
- package/node_modules/checkride/dist/qa/mutation.js.map +1 -0
- package/node_modules/checkride/dist/qa/qa.d.ts +71 -0
- package/node_modules/checkride/dist/qa/qa.d.ts.map +1 -0
- package/node_modules/checkride/dist/qa/qa.js +158 -0
- package/node_modules/checkride/dist/qa/qa.js.map +1 -0
- package/node_modules/checkride/dist/qa/read.d.ts +40 -0
- package/node_modules/checkride/dist/qa/read.d.ts.map +1 -0
- package/node_modules/checkride/dist/qa/read.js +47 -0
- package/node_modules/checkride/dist/qa/read.js.map +1 -0
- package/node_modules/checkride/dist/qa/render.d.ts +26 -0
- package/node_modules/checkride/dist/qa/render.d.ts.map +1 -0
- package/node_modules/checkride/dist/qa/render.js +310 -0
- package/node_modules/checkride/dist/qa/render.js.map +1 -0
- package/node_modules/checkride/dist/security.d.ts +45 -0
- package/node_modules/checkride/dist/security.d.ts.map +1 -0
- package/node_modules/checkride/dist/security.js +86 -0
- package/node_modules/checkride/dist/security.js.map +1 -0
- package/node_modules/checkride/dist/smoke.d.ts +5 -5
- package/node_modules/checkride/dist/smoke.js +5 -5
- package/node_modules/checkride/dist/snippets.d.ts +26 -29
- package/node_modules/checkride/dist/snippets.d.ts.map +1 -1
- package/node_modules/checkride/dist/snippets.js +26 -30
- package/node_modules/checkride/dist/snippets.js.map +1 -1
- package/node_modules/checkride/dist/tool-json.d.ts +33 -0
- package/node_modules/checkride/dist/tool-json.d.ts.map +1 -0
- package/node_modules/checkride/dist/tool-json.js +58 -0
- package/node_modules/checkride/dist/tool-json.js.map +1 -0
- package/node_modules/checkride/dist/triage/cli.d.ts +21 -0
- package/node_modules/checkride/dist/triage/cli.d.ts.map +1 -0
- package/node_modules/checkride/dist/triage/cli.js +26 -0
- package/node_modules/checkride/dist/triage/cli.js.map +1 -0
- package/node_modules/checkride/dist/triage/doctor-fold.d.ts +51 -0
- package/node_modules/checkride/dist/triage/doctor-fold.d.ts.map +1 -0
- package/node_modules/checkride/dist/triage/doctor-fold.js +88 -0
- package/node_modules/checkride/dist/triage/doctor-fold.js.map +1 -0
- package/node_modules/checkride/dist/triage/env.d.ts +54 -0
- package/node_modules/checkride/dist/triage/env.d.ts.map +1 -0
- package/node_modules/checkride/dist/triage/env.js +81 -0
- package/node_modules/checkride/dist/triage/env.js.map +1 -0
- package/node_modules/checkride/dist/triage/gate.d.ts +61 -0
- package/node_modules/checkride/dist/triage/gate.d.ts.map +1 -0
- package/node_modules/checkride/dist/triage/gate.js +121 -0
- package/node_modules/checkride/dist/triage/gate.js.map +1 -0
- package/node_modules/checkride/dist/triage/index.d.ts +22 -0
- package/node_modules/checkride/dist/triage/index.d.ts.map +1 -0
- package/node_modules/checkride/dist/triage/index.js +20 -0
- package/node_modules/checkride/dist/triage/index.js.map +1 -0
- package/node_modules/checkride/dist/triage/render.d.ts +19 -0
- package/node_modules/checkride/dist/triage/render.d.ts.map +1 -0
- package/node_modules/checkride/dist/triage/render.js +419 -0
- package/node_modules/checkride/dist/triage/render.js.map +1 -0
- package/node_modules/checkride/dist/triage/triage.d.ts +83 -0
- package/node_modules/checkride/dist/triage/triage.d.ts.map +1 -0
- package/node_modules/checkride/dist/triage/triage.js +131 -0
- package/node_modules/checkride/dist/triage/triage.js.map +1 -0
- package/node_modules/checkride/package.json +17 -15
- package/node_modules/checkride/schema/checkride.config.schema.json +62 -5
- package/node_modules/checkride/schema/checkride.summary.schema.json +1 -1
- package/node_modules/checkride/skills/check/SKILL.md +257 -0
- package/node_modules/checkride/skills/qa/SKILL.md +231 -0
- package/node_modules/checkride/templates/shared/cspell.json +1 -0
- package/node_modules/checkride/templates/shared/oxlintrc.json +1 -1
- package/package.json +2 -2
- package/skills/build/SKILL.md +23 -19
- package/skills/finish/SKILL.md +3 -1
- package/skills/harvest/SKILL.md +2 -1
- package/skills/plan/SKILL.md +8 -7
- package/skills/recover/SKILL.md +28 -0
- package/skills/refine/SKILL.md +5 -4
- package/skills/spike/SKILL.md +1 -1
- package/skills/step/SKILL.md +4 -4
- package/skills/verify/SKILL.md +19 -14
- package/templates/intent.md +8 -7
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Built-in `pack` check
|
|
3
|
-
* pack arm).
|
|
2
|
+
* Built-in `pack` check.
|
|
4
3
|
*
|
|
5
4
|
* Runs the detected package manager's tarball dry-run (`<pm> pack --dry-run
|
|
6
5
|
* --json`, lifecycle scripts suppressed) and inspects the file list the way a
|
|
@@ -8,15 +7,15 @@
|
|
|
8
7
|
*
|
|
9
8
|
* - every path the manifest promises (`exports`/`main`/`types`/`bin` targets,
|
|
10
9
|
* plus `README.md`) must be present — a miss means the package resolves to a
|
|
11
|
-
* file the tarball never included
|
|
10
|
+
* file the tarball never included;
|
|
12
11
|
* - no path may match the fixed deny list (TypeScript source, tests, `src/`,
|
|
13
12
|
* `docs/`, `scripts/`, `.check/` and kin), with a carve-out for `dist`
|
|
14
13
|
* declaration files (`*.d.{ts,mts,cts}` and their maps) which are legitimate
|
|
15
|
-
* shipped artifacts
|
|
14
|
+
* shipped artifacts.
|
|
16
15
|
*
|
|
17
16
|
* The pack subprocess is spawned through the orchestrator's registering spawner
|
|
18
17
|
* (injected as `spawn`), so its child joins `liveChecks` and inherits the
|
|
19
|
-
* per-check timeout + SIGTERM→SIGKILL reaping like every other check
|
|
18
|
+
* per-check timeout + SIGTERM→SIGKILL reaping like every other check.
|
|
20
19
|
*
|
|
21
20
|
* Returns a result the orchestrator persists to `.check/pack.json`:
|
|
22
21
|
* stdout `{ ok: true, files: [...] }` on success (exit 0)
|
|
@@ -35,10 +34,10 @@ export type PackSpawn = (command: string, args: string[], cwd: string, timeoutSe
|
|
|
35
34
|
/**
|
|
36
35
|
* The pack invocation for `pm`, or `null` when the PM has no supported
|
|
37
36
|
* `pack --dry-run --json` form (yarn/bun — unavailable-until-adapter, mirroring
|
|
38
|
-
* the pnpm-only `security` slot
|
|
39
|
-
* `files[].path` shape
|
|
37
|
+
* the pnpm-only `security` slot). Both supported managers emit npm's
|
|
38
|
+
* `files[].path` shape, and both must have
|
|
40
39
|
* lifecycle scripts suppressed so a `"prepack": "<build>"` can't rewrite `dist/`
|
|
41
|
-
* mid-wave-20 under smoke/snippets-dist
|
|
40
|
+
* mid-wave-20 under smoke/snippets-dist — npm spells that `--ignore-scripts`,
|
|
42
41
|
* pnpm rejects that flag and spells it `--config.ignore-scripts=true`.
|
|
43
42
|
*/
|
|
44
43
|
export declare function packInvocation(pm: PackageManager): {
|
|
@@ -46,7 +45,7 @@ export declare function packInvocation(pm: PackageManager): {
|
|
|
46
45
|
args: string[];
|
|
47
46
|
} | null;
|
|
48
47
|
/**
|
|
49
|
-
* The set of paths the tarball must contain, derived from the manifest
|
|
48
|
+
* The set of paths the tarball must contain, derived from the manifest:
|
|
50
49
|
* resolved `exports` targets, `main`, `types`/`typings`, `bin` targets — plus
|
|
51
50
|
* `README.md`, which every publish is expected to ship.
|
|
52
51
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pack.d.ts","sourceRoot":"","sources":["../src/pack.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pack.d.ts","sourceRoot":"","sources":["../src/pack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGpD,gFAAgF;AAChF,KAAK,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnD,uFAAuF;AACvF,MAAM,MAAM,SAAS,GAAG,CACtB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,GAAG,EAAE,MAAM,EACX,UAAU,CAAC,EAAE,MAAM,KAChB,OAAO,CAAC,YAAY,CAAC,CAAC;AAE3B;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,cAAc,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,IAAI,CAK7F;AAiED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAa7E;AA2BD;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,GAC5B;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,SAAS,EAAE,SAAS,EAAE,CAAA;CAAE,CAY/C;AA6CD;;;;;GAKG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,cAAc,CAAC;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,YAAY,CAAC,CA8DxB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Built-in `pack` check
|
|
3
|
-
* pack arm).
|
|
2
|
+
* Built-in `pack` check.
|
|
4
3
|
*
|
|
5
4
|
* Runs the detected package manager's tarball dry-run (`<pm> pack --dry-run
|
|
6
5
|
* --json`, lifecycle scripts suppressed) and inspects the file list the way a
|
|
@@ -8,30 +7,32 @@
|
|
|
8
7
|
*
|
|
9
8
|
* - every path the manifest promises (`exports`/`main`/`types`/`bin` targets,
|
|
10
9
|
* plus `README.md`) must be present — a miss means the package resolves to a
|
|
11
|
-
* file the tarball never included
|
|
10
|
+
* file the tarball never included;
|
|
12
11
|
* - no path may match the fixed deny list (TypeScript source, tests, `src/`,
|
|
13
12
|
* `docs/`, `scripts/`, `.check/` and kin), with a carve-out for `dist`
|
|
14
13
|
* declaration files (`*.d.{ts,mts,cts}` and their maps) which are legitimate
|
|
15
|
-
* shipped artifacts
|
|
14
|
+
* shipped artifacts.
|
|
16
15
|
*
|
|
17
16
|
* The pack subprocess is spawned through the orchestrator's registering spawner
|
|
18
17
|
* (injected as `spawn`), so its child joins `liveChecks` and inherits the
|
|
19
|
-
* per-check timeout + SIGTERM→SIGKILL reaping like every other check
|
|
18
|
+
* per-check timeout + SIGTERM→SIGKILL reaping like every other check.
|
|
20
19
|
*
|
|
21
20
|
* Returns a result the orchestrator persists to `.check/pack.json`:
|
|
22
21
|
* stdout `{ ok: true, files: [...] }` on success (exit 0)
|
|
23
22
|
* stdout `{ ok: false, missing: [...], forbidden: [...] }` on a content miss (exit 1)
|
|
24
23
|
* stdout `{ ok: false, error, ... }` when pack itself failed or emitted malformed output (exit 1)
|
|
25
24
|
*/
|
|
26
|
-
import { readFile } from 'node:fs/promises';
|
|
25
|
+
import { mkdtemp, readFile, rm } from 'node:fs/promises';
|
|
26
|
+
import { tmpdir } from 'node:os';
|
|
27
27
|
import { join } from 'node:path';
|
|
28
|
+
import { parseToolJson } from './tool-json.js';
|
|
28
29
|
/**
|
|
29
30
|
* The pack invocation for `pm`, or `null` when the PM has no supported
|
|
30
31
|
* `pack --dry-run --json` form (yarn/bun — unavailable-until-adapter, mirroring
|
|
31
|
-
* the pnpm-only `security` slot
|
|
32
|
-
* `files[].path` shape
|
|
32
|
+
* the pnpm-only `security` slot). Both supported managers emit npm's
|
|
33
|
+
* `files[].path` shape, and both must have
|
|
33
34
|
* lifecycle scripts suppressed so a `"prepack": "<build>"` can't rewrite `dist/`
|
|
34
|
-
* mid-wave-20 under smoke/snippets-dist
|
|
35
|
+
* mid-wave-20 under smoke/snippets-dist — npm spells that `--ignore-scripts`,
|
|
35
36
|
* pnpm rejects that flag and spells it `--config.ignore-scripts=true`.
|
|
36
37
|
*/
|
|
37
38
|
export function packInvocation(pm) {
|
|
@@ -42,6 +43,32 @@ export function packInvocation(pm) {
|
|
|
42
43
|
return { command: 'pnpm', args: [...base, '--config.ignore-scripts=true'] };
|
|
43
44
|
return null;
|
|
44
45
|
}
|
|
46
|
+
/** True when the PM rejected the `--dry-run` flag itself, not the pack. */
|
|
47
|
+
function rejectedDryRun(outcome) {
|
|
48
|
+
const text = `${outcome.stdout}\n${outcome.stderr}`;
|
|
49
|
+
return text.includes('Unknown option') && text.includes('dry-run');
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The fallback for pnpm without `pack --dry-run` — the flag only landed in
|
|
53
|
+
* pnpm 10.26.0, and every earlier pnpm (all of 9.x, 10.x through 10.25)
|
|
54
|
+
* rejects it with `Unknown option: 'dry-run'`, which failed the slot hard on
|
|
55
|
+
* a manager checkride promises to support. A real pack into a temp
|
|
56
|
+
* destination emits the same npm-shaped `files[].path` JSON (verified back to
|
|
57
|
+
* 10.18.1) and honors the same lifecycle-script suppression; the destination
|
|
58
|
+
* lives outside the repo so a tarball can never land in the tree or another
|
|
59
|
+
* check's view, and it is removed with the temp dir afterward, success or
|
|
60
|
+
* not. Capability fallback by design: probing `pnpm --version` would trade
|
|
61
|
+
* one brittle coupling for another.
|
|
62
|
+
*/
|
|
63
|
+
async function spawnPackFallback(spawn, cwd, timeoutSec) {
|
|
64
|
+
const dest = await mkdtemp(join(tmpdir(), 'checkride-pack-'));
|
|
65
|
+
try {
|
|
66
|
+
return await spawn('pnpm', ['pack', '--json', '--pack-destination', dest, '--config.ignore-scripts=true'], cwd, timeoutSec);
|
|
67
|
+
}
|
|
68
|
+
finally {
|
|
69
|
+
await rm(dest, { recursive: true, force: true });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
45
72
|
/** Strip a leading `./` so manifest targets and pack paths compare on equal footing. */
|
|
46
73
|
function normalize(target) {
|
|
47
74
|
return target.startsWith('./') ? target.slice(2) : target;
|
|
@@ -70,7 +97,7 @@ function addField(value, acc) {
|
|
|
70
97
|
acc.add(normalize(value));
|
|
71
98
|
}
|
|
72
99
|
/**
|
|
73
|
-
* The set of paths the tarball must contain, derived from the manifest
|
|
100
|
+
* The set of paths the tarball must contain, derived from the manifest:
|
|
74
101
|
* resolved `exports` targets, `main`, `types`/`typings`, `bin` targets — plus
|
|
75
102
|
* `README.md`, which every publish is expected to ship.
|
|
76
103
|
*/
|
|
@@ -91,8 +118,8 @@ export function deriveRequired(manifest) {
|
|
|
91
118
|
return required;
|
|
92
119
|
}
|
|
93
120
|
/**
|
|
94
|
-
* Fixed deny list
|
|
95
|
-
* is exempt (`isDistDeclaration` — the
|
|
121
|
+
* Fixed deny list: paths that must never ship. A `dist` declaration file
|
|
122
|
+
* is exempt (`isDistDeclaration` — the carve-out is applied before these), so
|
|
96
123
|
* `\.ts$` here only ever bites real `.ts` source outside `dist`.
|
|
97
124
|
*/
|
|
98
125
|
const DENY = [
|
|
@@ -108,7 +135,7 @@ const DENY = [
|
|
|
108
135
|
/**
|
|
109
136
|
* A `dist` declaration artifact — `dist/**/*.d.{ts,mts,cts}` and their source
|
|
110
137
|
* maps. These legitimately ship, so they are exempt from the deny list even
|
|
111
|
-
* though `dist/index.d.ts` matches `\.ts
|
|
138
|
+
* though `dist/index.d.ts` matches `\.ts$`.
|
|
112
139
|
*/
|
|
113
140
|
function isDistDeclaration(path) {
|
|
114
141
|
return /^dist\/.*\.d\.(ts|mts|cts)(\.map)?$/.test(path);
|
|
@@ -140,9 +167,15 @@ function isRecord(value) {
|
|
|
140
167
|
function prop(value, key) {
|
|
141
168
|
return isRecord(value) ? value[key] : undefined;
|
|
142
169
|
}
|
|
143
|
-
/**
|
|
170
|
+
/**
|
|
171
|
+
* Parse the `files[].path` array out of a `pack --dry-run --json` payload.
|
|
172
|
+
* Tolerant of a launcher preamble ahead of the JSON — see `parseToolJson`.
|
|
173
|
+
*/
|
|
144
174
|
function parsePackFiles(stdout) {
|
|
145
|
-
const
|
|
175
|
+
const json = parseToolJson(stdout);
|
|
176
|
+
if (!json)
|
|
177
|
+
throw new Error('pack output was not JSON');
|
|
178
|
+
const parsed = json.value;
|
|
146
179
|
const entry = Array.isArray(parsed) ? parsed[0] : parsed;
|
|
147
180
|
const files = prop(entry, 'files');
|
|
148
181
|
if (!Array.isArray(files))
|
|
@@ -185,10 +218,13 @@ export async function checkPack(opts) {
|
|
|
185
218
|
return fail(`${JSON.stringify({ ok: false, error: `could not read package.json: ${read.message}` }, null, 2)}\n`, `check-pack: could not read package.json: ${read.message}\n`);
|
|
186
219
|
}
|
|
187
220
|
const manifest = read.manifest;
|
|
188
|
-
|
|
221
|
+
let outcome = await spawn(invocation.command, invocation.args, cwd, timeoutSec);
|
|
222
|
+
if (outcome.exit_code !== 0 && pm === 'pnpm' && rejectedDryRun(outcome)) {
|
|
223
|
+
outcome = await spawnPackFallback(spawn, cwd, timeoutSec);
|
|
224
|
+
}
|
|
189
225
|
if (outcome.exit_code !== 0) {
|
|
190
226
|
const detail = outcome.stderr.trim() || outcome.stdout.trim();
|
|
191
|
-
return fail(`${JSON.stringify({ ok: false, error: `${invocation.command} pack
|
|
227
|
+
return fail(`${JSON.stringify({ ok: false, error: `${invocation.command} pack exited ${outcome.exit_code}` }, null, 2)}\n`, `check-pack: ${invocation.command} pack exited ${outcome.exit_code}${detail ? `\n${detail}` : ''}\n`);
|
|
192
228
|
}
|
|
193
229
|
let filePaths;
|
|
194
230
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pack.js","sourceRoot":"","sources":["../src/pack.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pack.js","sourceRoot":"","sources":["../src/pack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,W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,GAAG,YAAY,CAAC,SAAS,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEjF,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnD,OAAO;YACL,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI;YACtE,MAAM,EAAE,eAAe,SAAS,CAAC,MAAM,2DAA2D;SACnG,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,IAAI,IAAI,OAAO;QAAE,KAAK,CAAC,IAAI,CAAC,sCAAsC,IAAI,EAAE,CAAC,CAAC;IACrF,KAAK,MAAM,CAAC,IAAI,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,IAAI,cAAc,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC;IACvG,OAAO,IAAI,CACT,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EACjE,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CACxB,CAAC;AACJ,CAAC"}
|
|
@@ -3,11 +3,16 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Resolves which package manager a repo uses so the orchestrator can translate
|
|
5
5
|
* each adapter's canonical `pnpm exec <tool>` invocation into that PM's form.
|
|
6
|
-
* Resolution order
|
|
6
|
+
* Resolution order: the declared `packageManager` field wins (it is the
|
|
7
7
|
* author's explicit intent), then a lockfile, then a `pnpm` default. Every fs
|
|
8
8
|
* touch is injectable so the logic is unit-testable without a real repo.
|
|
9
9
|
*/
|
|
10
10
|
export type PackageManager = 'pnpm' | 'npm' | 'yarn' | 'bun';
|
|
11
|
+
/**
|
|
12
|
+
* Every lockfile name, without its package manager — a lockfile is also what
|
|
13
|
+
* marks the top of a repository, which is where a tool search has to stop.
|
|
14
|
+
*/
|
|
15
|
+
export declare const LOCKFILE_NAMES: readonly string[];
|
|
11
16
|
/**
|
|
12
17
|
* Resolve the package manager for `cwd`: the declared `packageManager` field,
|
|
13
18
|
* else the first matching lockfile, else `pnpm`. `fileExists` and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../src/pm/detect.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../src/pm/detect.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC;AAkB7D;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAAiC,CAAC;AAmB9E;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,GAAE;IACL,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACvC,mBAAmB,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;CAC3C,GACL,cAAc,CAYhB"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Resolves which package manager a repo uses so the orchestrator can translate
|
|
5
5
|
* each adapter's canonical `pnpm exec <tool>` invocation into that PM's form.
|
|
6
|
-
* Resolution order
|
|
6
|
+
* Resolution order: the declared `packageManager` field wins (it is the
|
|
7
7
|
* author's explicit intent), then a lockfile, then a `pnpm` default. Every fs
|
|
8
8
|
* touch is injectable so the logic is unit-testable without a real repo.
|
|
9
9
|
*/
|
|
@@ -22,6 +22,11 @@ const LOCKFILES = [
|
|
|
22
22
|
{ file: 'yarn.lock', pm: 'yarn' },
|
|
23
23
|
{ file: 'package-lock.json', pm: 'npm' },
|
|
24
24
|
];
|
|
25
|
+
/**
|
|
26
|
+
* Every lockfile name, without its package manager — a lockfile is also what
|
|
27
|
+
* marks the top of a repository, which is where a tool search has to stop.
|
|
28
|
+
*/
|
|
29
|
+
export const LOCKFILE_NAMES = LOCKFILES.map((l) => l.file);
|
|
25
30
|
/** Parse the `packageManager` field value (`"yarn@3.6.1"` → `'yarn'`), if known. */
|
|
26
31
|
function parseField(value) {
|
|
27
32
|
if (!value)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect.js","sourceRoot":"","sources":["../../src/pm/detect.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC,MAAM,KAAK,GAAwB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;AAE3E,oDAAoD;AACpD,SAAS,gBAAgB,CAAC,IAAY;IACpC,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC;AAED,+EAA+E;AAC/E,MAAM,SAAS,GAAoD;IACjE,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,EAAE,MAAM,EAAE;IACtC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,KAAK,EAAE;IAC/B,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,KAAK,EAAE;IAChC,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE;IACjC,EAAE,IAAI,EAAE,mBA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I,EAAE,IAAI,EAAE,CAAC;IAC/C,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9C,CAAC;AAED,iFAAiF;AACjF,SAAS,uBAAuB,CAAC,GAAW;IAC1C,IAAI,CAAC;QACH,MAAM,GAAG,GAAgC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;QACrG,OAAO,GAAG,CAAC,cAAc,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAClC,QAII,EAAE;IAEN,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACvC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/E,MAAM,SAAS,GAAG,KAAK,CAAC,mBAAmB,IAAI,CAAC,GAAG,EAAE,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC,CAAC;IAEpF,MAAM,QAAQ,GAAG,UAAU,CAAC,SAAS,EAAE,CAAC,CAAC;IACzC,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAE9B,KAAK,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,SAAS,EAAE,CAAC;QACrC,IAAI,UAAU,CAAC,IAAI,CAAC;YAAE,OAAO,EAAE,CAAC;IAClC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
* Package-manager module — the public surface for detecting a repo's package
|
|
3
3
|
* manager and translating each adapter's canonical `pnpm exec <tool>` prefix
|
|
4
4
|
* into that PM's form. Detection lives in `detect.ts`, translation in
|
|
5
|
-
* `translate.ts
|
|
5
|
+
* `translate.ts`, where a slot's tool must resolve from in `tools.ts`, and the
|
|
6
|
+
* refusals that mean it never launched at all in `launch.ts`; siblings import
|
|
7
|
+
* only from here.
|
|
6
8
|
*/
|
|
7
9
|
export type { PackageManager } from './detect.js';
|
|
8
10
|
export { detectPackageManager } from './detect.js';
|
|
9
|
-
export {
|
|
11
|
+
export { launchRefusal, SPAWN_FAILED_MARKER } from './launch.js';
|
|
12
|
+
export { execTool, execUsesGlobalCache, installCommand, isPnPInstall, resolveSlotTool } from './tools.js';
|
|
13
|
+
export { execCommand, isAvailableUnder, runScript, translateExec } from './translate.js';
|
|
10
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pm/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pm/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,cAAc,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC1G,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
* Package-manager module — the public surface for detecting a repo's package
|
|
3
3
|
* manager and translating each adapter's canonical `pnpm exec <tool>` prefix
|
|
4
4
|
* into that PM's form. Detection lives in `detect.ts`, translation in
|
|
5
|
-
* `translate.ts
|
|
5
|
+
* `translate.ts`, where a slot's tool must resolve from in `tools.ts`, and the
|
|
6
|
+
* refusals that mean it never launched at all in `launch.ts`; siblings import
|
|
7
|
+
* only from here.
|
|
6
8
|
*/
|
|
7
9
|
export { detectPackageManager } from './detect.js';
|
|
8
|
-
export {
|
|
10
|
+
export { launchRefusal, SPAWN_FAILED_MARKER } from './launch.js';
|
|
11
|
+
export { execTool, execUsesGlobalCache, installCommand, isPnPInstall, resolveSlotTool } from './tools.js';
|
|
12
|
+
export { execCommand, isAvailableUnder, runScript, translateExec } from './translate.js';
|
|
9
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/pm/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/pm/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,cAAc,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC1G,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Launch refusals — the package manager declining to start the script at all.
|
|
3
|
+
*
|
|
4
|
+
* Every caller that runs the repo's `check` script reads a non-zero exit as
|
|
5
|
+
* "the pipeline is red". That reading is wrong for a whole class of exits,
|
|
6
|
+
* because a package manager refuses *before* the script runs and still exits
|
|
7
|
+
* non-zero: pnpm answers an `engines.node` mismatch with
|
|
8
|
+
* `ERR_PNPM_UNSUPPORTED_ENGINE` and exit 1, exactly as it answers a failing
|
|
9
|
+
* test. The difference is invisible in the status code and obvious in the
|
|
10
|
+
* output, so the output is what is read here.
|
|
11
|
+
*
|
|
12
|
+
* The distinction is not cosmetic. A pipeline red is cleared by fixing code and
|
|
13
|
+
* points at `.check/`; a launch refusal cannot be cleared by any code change and
|
|
14
|
+
* points at nothing, because nothing ran and no artifact was written. Reporting
|
|
15
|
+
* the second as the first sends the reader — human or agent — to an artifact
|
|
16
|
+
* that does not describe this run, which is the failure this table exists to
|
|
17
|
+
* prevent.
|
|
18
|
+
*
|
|
19
|
+
* **Every pattern here must be one a check's own output cannot contain.** A
|
|
20
|
+
* false positive is worse than the bug being fixed: it would tell someone their
|
|
21
|
+
* environment is broken while their code is what failed. The patterns are all
|
|
22
|
+
* package-manager error *codes*, and the one caller-supplied sentinel checkride
|
|
23
|
+
* writes itself; callers additionally gate on "this run wrote no summary", so a
|
|
24
|
+
* pipeline that demonstrably ran can never be reclassified by a tool that merely
|
|
25
|
+
* printed one of these strings.
|
|
26
|
+
*/
|
|
27
|
+
/** The sentinel a caller writes when the package-manager binary itself never started. */
|
|
28
|
+
export declare const SPAWN_FAILED_MARKER = "checkride: could not start";
|
|
29
|
+
/**
|
|
30
|
+
* A refusal checkride recognizes: the marker to look for, and the cause in the
|
|
31
|
+
* words a reader needs.
|
|
32
|
+
*
|
|
33
|
+
* `cause` completes the sentence "the gate could not run — …", so it names what
|
|
34
|
+
* refused and why, never what to do about it; the fix is the caller's to phrase,
|
|
35
|
+
* because it differs by command.
|
|
36
|
+
*/
|
|
37
|
+
export type LaunchRefusal = {
|
|
38
|
+
marker: string;
|
|
39
|
+
cause: string;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Classify `output` — whatever the child printed on either stream — as a launch
|
|
43
|
+
* refusal, or `null` when nothing in it says the script failed to start.
|
|
44
|
+
*
|
|
45
|
+
* `null` is the safe answer and the common one: an unrecognized refusal reads as
|
|
46
|
+
* a pipeline red, which is the behavior that predates this module. A new package
|
|
47
|
+
* manager or a reworded error therefore degrades to today's report rather than
|
|
48
|
+
* to a wrong one.
|
|
49
|
+
*/
|
|
50
|
+
export declare function launchRefusal(output: string): LaunchRefusal | null;
|
|
51
|
+
//# sourceMappingURL=launch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launch.d.ts","sourceRoot":"","sources":["../../src/pm/launch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,yFAAyF;AACzF,eAAO,MAAM,mBAAmB,+BAA+B,CAAC;AAEhE;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAsD9D;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAElE"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Launch refusals — the package manager declining to start the script at all.
|
|
3
|
+
*
|
|
4
|
+
* Every caller that runs the repo's `check` script reads a non-zero exit as
|
|
5
|
+
* "the pipeline is red". That reading is wrong for a whole class of exits,
|
|
6
|
+
* because a package manager refuses *before* the script runs and still exits
|
|
7
|
+
* non-zero: pnpm answers an `engines.node` mismatch with
|
|
8
|
+
* `ERR_PNPM_UNSUPPORTED_ENGINE` and exit 1, exactly as it answers a failing
|
|
9
|
+
* test. The difference is invisible in the status code and obvious in the
|
|
10
|
+
* output, so the output is what is read here.
|
|
11
|
+
*
|
|
12
|
+
* The distinction is not cosmetic. A pipeline red is cleared by fixing code and
|
|
13
|
+
* points at `.check/`; a launch refusal cannot be cleared by any code change and
|
|
14
|
+
* points at nothing, because nothing ran and no artifact was written. Reporting
|
|
15
|
+
* the second as the first sends the reader — human or agent — to an artifact
|
|
16
|
+
* that does not describe this run, which is the failure this table exists to
|
|
17
|
+
* prevent.
|
|
18
|
+
*
|
|
19
|
+
* **Every pattern here must be one a check's own output cannot contain.** A
|
|
20
|
+
* false positive is worse than the bug being fixed: it would tell someone their
|
|
21
|
+
* environment is broken while their code is what failed. The patterns are all
|
|
22
|
+
* package-manager error *codes*, and the one caller-supplied sentinel checkride
|
|
23
|
+
* writes itself; callers additionally gate on "this run wrote no summary", so a
|
|
24
|
+
* pipeline that demonstrably ran can never be reclassified by a tool that merely
|
|
25
|
+
* printed one of these strings.
|
|
26
|
+
*/
|
|
27
|
+
/** The sentinel a caller writes when the package-manager binary itself never started. */
|
|
28
|
+
export const SPAWN_FAILED_MARKER = 'checkride: could not start';
|
|
29
|
+
/**
|
|
30
|
+
* Markers that mean the script never started, most specific first.
|
|
31
|
+
*
|
|
32
|
+
* npm is the delicate one: it prints `EBADENGINE` as a *warning* on a version
|
|
33
|
+
* mismatch and runs the script anyway, and only `engine-strict` turns it into an
|
|
34
|
+
* error. Matching the bare code would reclassify a genuine red in any repo whose
|
|
35
|
+
* dependency tree carries one stale `engines` field — so the two error spellings
|
|
36
|
+
* npm has shipped are matched, and the warning is not.
|
|
37
|
+
*
|
|
38
|
+
* Only pnpm's and npm's spellings are listed, because those are the two the
|
|
39
|
+
* behavior above was verified against. Yarn's and bun's equivalents are
|
|
40
|
+
* deliberately absent rather than guessed: an unmatched refusal degrades to
|
|
41
|
+
* today's report (a red), while a wrong pattern degrades to a false diagnosis.
|
|
42
|
+
* Add one when a real output line is in hand, not before.
|
|
43
|
+
*/
|
|
44
|
+
const REFUSALS = [
|
|
45
|
+
{
|
|
46
|
+
marker: 'ERR_PNPM_UNSUPPORTED_ENGINE',
|
|
47
|
+
cause: "the repo's `engines` pin does not match the Node or pnpm running this process, and pnpm refuses to run a script under it",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
marker: 'npm error code EBADENGINE',
|
|
51
|
+
cause: "the repo's `engines` pin does not match the Node running this process, and npm is configured `engine-strict`",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
marker: 'npm ERR! code EBADENGINE',
|
|
55
|
+
cause: "the repo's `engines` pin does not match the Node running this process, and npm is configured `engine-strict`",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
marker: 'ERR_PNPM_NO_SCRIPT',
|
|
59
|
+
cause: 'this repo has no `check` script for the gate to run',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
marker: 'Missing script:',
|
|
63
|
+
cause: 'this repo has no `check` script for the gate to run',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
marker: 'ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND',
|
|
67
|
+
cause: 'there is no package.json here, so the package manager has nothing to run',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
// corepack verifying a `packageManager` field against its bundled signing
|
|
71
|
+
// keys. Common after a corepack upgrade, and total: nothing runs.
|
|
72
|
+
marker: 'Cannot find matching keyid',
|
|
73
|
+
cause: 'corepack could not verify the package manager named in `packageManager`, so it never launched',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
marker: SPAWN_FAILED_MARKER,
|
|
77
|
+
cause: 'the package-manager binary is not on this process’s PATH',
|
|
78
|
+
},
|
|
79
|
+
];
|
|
80
|
+
/**
|
|
81
|
+
* Classify `output` — whatever the child printed on either stream — as a launch
|
|
82
|
+
* refusal, or `null` when nothing in it says the script failed to start.
|
|
83
|
+
*
|
|
84
|
+
* `null` is the safe answer and the common one: an unrecognized refusal reads as
|
|
85
|
+
* a pipeline red, which is the behavior that predates this module. A new package
|
|
86
|
+
* manager or a reworded error therefore degrades to today's report rather than
|
|
87
|
+
* to a wrong one.
|
|
88
|
+
*/
|
|
89
|
+
export function launchRefusal(output) {
|
|
90
|
+
return REFUSALS.find((r) => output.includes(r.marker)) ?? null;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=launch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launch.js","sourceRoot":"","sources":["../../src/pm/launch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,yFAAyF;AACzF,MAAM,CAAC,MAAM,mBAAmB,GAAG,4BAA4B,CAAC;AAYhE;;;;;;;;;;;;;;GAcG;AACH,MAAM,QAAQ,GAA6B;IACzC;QACE,MAAM,EAAE,6BAA6B;QACrC,KAAK,EAAE,0HAA0H;KAClI;IACD;QACE,MAAM,EAAE,2BAA2B;QACnC,KAAK,EAAE,8GAA8G;KACtH;IACD;QACE,MAAM,EAAE,0BAA0B;QAClC,KAAK,EAAE,8GAA8G;KACtH;IACD;QACE,MAAM,EAAE,oBAAoB;QAC5B,KAAK,EAAE,qDAAqD;KAC7D;IACD;QACE,MAAM,EAAE,iBAAiB;QACzB,KAAK,EAAE,qDAAqD;KAC7D;IACD;QACE,MAAM,EAAE,qCAAqC;QAC7C,KAAK,EAAE,0EAA0E;KAClF;IACD;QACE,0EAA0E;QAC1E,kEAAkE;QAClE,MAAM,EAAE,4BAA4B;QACpC,KAAK,EAAE,+FAA+F;KACvG;IACD;QACE,MAAM,EAAE,mBAAmB;QAC3B,KAAK,EAAE,0DAA0D;KAClE;CACF,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,IAAI,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slot-tool resolution — where a check's tool has to be for the gate to run it,
|
|
3
|
+
* and how to install it when it isn't.
|
|
4
|
+
*
|
|
5
|
+
* `translate.ts` decides *how* a tool is spawned; this decides *whether it may
|
|
6
|
+
* be*. The two are deliberately separate. `--no-install` bounds the download
|
|
7
|
+
* but not the launcher's per-user cache, so the spawn alone cannot promise the
|
|
8
|
+
* tool came from this repo: a copy an unrelated `npx` left behind months ago
|
|
9
|
+
* satisfies the launcher just as well as a declared dependency. Resolving the
|
|
10
|
+
* binary in the local tree first is what makes a slot's verdict depend on the
|
|
11
|
+
* committed lockfile rather than on one machine's accumulated cache — the
|
|
12
|
+
* property that lets a green run mean the same thing locally and in CI.
|
|
13
|
+
*/
|
|
14
|
+
import type { PackageManager } from './detect.js';
|
|
15
|
+
/**
|
|
16
|
+
* The `<tool>` in a canonical `pnpm exec <tool> …` adapter invocation, or `null`
|
|
17
|
+
* for anything else — `pnpm audit`, `pnpm run <script>`, a built-in, or a config
|
|
18
|
+
* custom check's own command. Those either have no tool to resolve or resolve it
|
|
19
|
+
* themselves, so they are never pre-flighted.
|
|
20
|
+
*
|
|
21
|
+
* This is the same prefix test {@link translateExec} keys on, named once so the
|
|
22
|
+
* run path, the fix path and `doctor` cannot drift on what counts as a tool.
|
|
23
|
+
*/
|
|
24
|
+
export declare function execTool(command: string, args: readonly string[]): string | null;
|
|
25
|
+
/** The command that would declare `tool` as a dev dependency under `pm`. */
|
|
26
|
+
export declare function installCommand(pm: PackageManager, tool: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* Find `tool`'s binary in the local tree, walking `cwd` upward the way the
|
|
29
|
+
* package managers themselves do — and stopping at the repo root.
|
|
30
|
+
*
|
|
31
|
+
* The walk is what makes this correct in a workspace: pnpm and npm both hoist a
|
|
32
|
+
* shared tool's bin to the workspace root, so a check running in
|
|
33
|
+
* `packages/web` finds it two directories up and a root-only check finds it
|
|
34
|
+
* immediately. Checking `cwd` alone would report every hoisted tool missing in
|
|
35
|
+
* every monorepo — which is most of the repos with a workspace preset.
|
|
36
|
+
*
|
|
37
|
+
* The boundary matters as much as the walk. An unbounded search would accept a
|
|
38
|
+
* `node_modules/.bin/<tool>` sitting in some parent of the checkout — a stray
|
|
39
|
+
* install in a home or projects directory — and that is the same defect as
|
|
40
|
+
* trusting the launcher cache, reached by a different route: the slot passes for
|
|
41
|
+
* whoever happens to have that directory above their clone and fails on the
|
|
42
|
+
* clean checkout. Stopping at the root keeps the verdict a property of the repo.
|
|
43
|
+
* The root itself is searched before the walk ends; a tree with no marker at all
|
|
44
|
+
* (a synthetic one, or a directory outside any repo) walks to the filesystem
|
|
45
|
+
* root as before.
|
|
46
|
+
*
|
|
47
|
+
* `exists` is injected so the walk is testable against a synthetic tree.
|
|
48
|
+
*/
|
|
49
|
+
export declare function resolveSlotTool(cwd: string, tool: string, exists?: (p: string) => boolean): string | null;
|
|
50
|
+
/**
|
|
51
|
+
* Whether this project is installed under Yarn PnP, where there is no
|
|
52
|
+
* `node_modules/` tree at all.
|
|
53
|
+
*
|
|
54
|
+
* Every path-based test for "is it installed" is wrong here: a healthy PnP repo
|
|
55
|
+
* has no `node_modules/` and no `node_modules/.bin/<tool>`, so asserting either
|
|
56
|
+
* reports a correctly installed project as broken. Callers use this to pick a
|
|
57
|
+
* different question — the install artifact rather than the directory, and the
|
|
58
|
+
* package manager's own resolution rather than a path — instead of guessing.
|
|
59
|
+
*/
|
|
60
|
+
export declare function isPnPInstall(cwd: string, exists?: (p: string) => boolean): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Whether `pm`'s exec launcher can supply a tool this repo never declared.
|
|
63
|
+
*
|
|
64
|
+
* True for exactly the two launchers that keep a per-user package cache: `npx`
|
|
65
|
+
* and `bunx` will run a cached copy even under `--no-install`. `pnpm exec` and
|
|
66
|
+
* `yarn` resolve from the project tree only, so they already give the stronger
|
|
67
|
+
* guarantee and need no pre-flight — and Yarn PnP has no `node_modules/.bin`
|
|
68
|
+
* to resolve against at all, so pre-flighting it would report every tool
|
|
69
|
+
* missing. Kept in lockstep with `translate.ts`'s `EXEC` table by a test: any
|
|
70
|
+
* PM carrying `--no-install` must be listed here.
|
|
71
|
+
*/
|
|
72
|
+
export declare function execUsesGlobalCache(pm: PackageManager): boolean;
|
|
73
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/pm/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAGhF;AAaD,4EAA4E;AAC5E,wBAAgB,cAAc,CAAC,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvE;AAcD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAoB,GAAG,MAAM,GAAG,IAAI,CAUrH;AASD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,GAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAoB,GAAG,OAAO,CAE9F;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,cAAc,GAAG,OAAO,CAE/D"}
|