Commit 6a96abb
refactor: delete legacy per-target emitters/validators now that all targets are migrated (#17)
* refactor: migrate cursor to the target registry (no behavior change)
Re-checking the originally planned Cursor "fixes" against the vendored
plugin.schema.json / marketplace.schema.json (this repo's own
conformance oracle, already passing against the current shape) showed
they were wrong:
- displayName/category/tags ARE valid plugin.json fields per the
schema (additionalProperties: false, and they're explicitly listed)
— not marketplace-entry-only fields as previously assumed.
- Marketplace `owner` is genuinely optional (required: ["name",
"plugins"] does not include it) — not required as previously
assumed. Moving category/tags to the marketplace entry would have
been actively wrong: entries only allow name/source/description
(additionalProperties: false).
None of that is changed here. What this commit actually does:
- Migrates cursor onto PluginTargetDefinition, preserving every
existing field and behavior (verified by the vendored-schema
conformance test staying green).
- Fixes one genuine, low-risk issue: the manifest builder's own
hardcoded default-components list could diverge from this target's
actual defaultComponents (components.ts). Replaced both with one
list of schema-valid pointer fields, checked directly against the
plugin's real resolved componentDirs — eliminates the divergence
risk with no observable behavior change (confirmed via a new test
exercising the one case that could have differed: an explicit
`components: [...]` override).
- Ports update-check's hook-injection into the new shared engine
(src/targets/engine.ts), which previously only existed in the
legacy emitCursor/emitClaude path — migrating cursor without this
would have silently dropped update-check support.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix: apply the per-plugin version override in cursor's manifest
buildPluginManifest used the target-level `version` param directly
instead of `pluginConfig.version ?? version`, silently dropping a
per-plugin version override — a real regression from the pre-migration
behavior, caught by porting the equivalent test from the claude
migration (no test previously covered this for cursor specifically).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* refactor: migrate claude to the target registry (no behavior change)
Ports emitClaude/validateClaude into src/targets/claude.ts as a
PluginTargetDefinition, verified directly against `claude plugin
validate --strict`: a minimal manifest with only `name` fails that
check, confirming the existing version/description/author.name
requirements already match the real CLI rather than over-constraining
it.
Applies the per-plugin version override in buildPluginManifest
(pluginConfig.version ?? version) up front, matching the identical fix
just made to cursor's copy of this pattern.
* fix: correct Codex plugin output for the target registry
Ports emitCodex/validateCodex into src/targets/codex.ts as a
PluginTargetDefinition, correcting the plugin format's real shape —
re-verified directly against developers.openai.com/codex/plugins/build
(fetched twice, independently, for consistency) since Codex has no
CLI validator or vendored schema to check against:
- plugin.json requires only "name"; version/description/author etc.
are optional. The previous validator wrongly required version and
description.
- Every marketplace entry needs policy.installation,
policy.authentication, and category — previously unvalidated, so an
incomplete entry shipped silently. pluginpack can't infer these, so
the base entry stays guess-free and validateOutput now errors
clearly when an author never supplies them via the per-plugin
`entry` passthrough (already how the existing conformance fixture
supplies them).
- A marketplace entry's source is a bare string only for local
plugins (the only shape pluginpack itself ever emits); url/git-subdir/npm
sources are structured objects with an inner "source" discriminator.
validateMarketplaceEntry now accepts either shape instead of the
previously shared, string-only validator.
- plugin.json now declares a `hooks` pointer when hooks/ is present,
matching skills/mcpServers (previously only skills/mcpServers were
declared, so hooks were emitted but never referenced).
Updates CONFORMANCE.md's Codex section, which had pinned a stale,
bare-string-only shape from an earlier doc retrieval.
* fix: restore deeper hooks.json validation dropped during target migration
Every migrated target's validateOutput calls validateHooksShape (added
in the registry scaffold), which only checked that hooks.json has a
"hooks" object — narrower than the legacy per-target validateHooks it
replaced, which also required each event's entries to be an array,
rejected empty "command" strings, and errored if a command referenced
the generated update-check script without that script actually being
present. None of that depth had a regression test, so the narrowing
was silent.
Ports the full check into validateHooksShape once, so every target
that already calls it (all 5, post-migration) regains it for free
instead of needing the fix repeated per target file.
* refactor: delete legacy per-target emitters/validators now that all targets are migrated
All 5 targets (copilot, antigravity, cursor, claude, codex) now have a
PluginTargetDefinition in src/targets/registry.ts, so the legacy
fallback path adapters.ts existed for is dead:
- Deletes src/targets.ts and src/validate.ts entirely (their only
consumer was adapters.ts's legacyAdapters map).
- Moves withRootFiles into src/targets/engine.ts, next to the artifact
helper it depends on.
- Tightens the registry's type from Partial<Record<TargetName, ...>>
to Record<TargetName, ...> now that every target has an entry — a
new TargetName won't build until it has a registry entry, the same
exhaustiveness guarantee the deleted legacyAdapters map used to
provide.
- Simplifies adapters.ts to a thin emitTarget/validateOutput wrapper
around the registry + engine, dropping the now-pointless
TargetAdapter/adapters indirection that existed only to switch
between legacy and registry per target.
- Removes targetDefaultComponents/resolveTargetComponents from
components.ts (superseded by each target's own defaultComponents).
- Updates CLAUDE.md's Architecture/Targets sections and a couple of
stale doc-comment references to match.
* docs: note the shared hooks validation depth in CONFORMANCE.md
Cross-references the validateHooksShape fix from the prior commit —
what it checks and where it's shared from, for the conformance doc's
own "what's actually verified and how" mandate.
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent 8eccdb1 commit 6a96abb
12 files changed
Lines changed: 206 additions & 1499 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
44 | 55 | | |
45 | 56 | | |
46 | 57 | | |
47 | 58 | | |
48 | 59 | | |
49 | 60 | | |
50 | | - | |
51 | 61 | | |
52 | 62 | | |
53 | 63 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
59 | 69 | | |
60 | 70 | | |
61 | 71 | | |
| |||
80 | 90 | | |
81 | 91 | | |
82 | 92 | | |
83 | | - | |
| 93 | + | |
| 94 | + | |
84 | 95 | | |
85 | 96 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
93 | 99 | | |
94 | 100 | | |
95 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
481 | 481 | | |
482 | 482 | | |
483 | 483 | | |
484 | | - | |
| 484 | + | |
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
509 | | - | |
| 509 | + | |
510 | 510 | | |
511 | 511 | | |
512 | 512 | | |
| |||
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
531 | | - | |
| 531 | + | |
532 | 532 | | |
533 | 533 | | |
534 | 534 | | |
| |||
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
553 | | - | |
| 553 | + | |
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
| |||
574 | 574 | | |
575 | 575 | | |
576 | 576 | | |
577 | | - | |
| 577 | + | |
578 | 578 | | |
579 | 579 | | |
580 | 580 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | 2 | | |
18 | 3 | | |
19 | 4 | | |
| 5 | + | |
20 | 6 | | |
21 | 7 | | |
22 | 8 | | |
23 | 9 | | |
24 | 10 | | |
25 | | - | |
26 | 11 | | |
27 | 12 | | |
28 | 13 | | |
29 | 14 | | |
30 | 15 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 16 | + | |
| 17 | + | |
95 | 18 | | |
96 | 19 | | |
97 | 20 | | |
| |||
107 | 30 | | |
108 | 31 | | |
109 | 32 | | |
110 | | - | |
| 33 | + | |
111 | 34 | | |
112 | 35 | | |
113 | 36 | | |
114 | 37 | | |
| 38 | + | |
115 | 39 | | |
116 | 40 | | |
117 | 41 | | |
| |||
123 | 47 | | |
124 | 48 | | |
125 | 49 | | |
126 | | - | |
| 50 | + | |
127 | 51 | | |
128 | 52 | | |
129 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
5 | 3 | | |
| |||
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | 17 | | |
37 | 18 | | |
38 | 19 | | |
| |||
0 commit comments