fix(migration): BLOCKER 94b83ad — nested external source-object per official CC schema
60-rewrite-marketplace.mjs:87 emitted a flat { source: 'url', url, ref }
shape. The official Claude Code marketplace schema (verified at
code.claude.com/docs/en/plugin-marketplaces) and brief §6 both require the
nested form { source: { source: 'url', url, ref } } — a flat shape would not
resolve at install, breaking SC1/SC3/SC8 for every externalised entry.
- l.87: emit nested source-object
- validate(): branch on object (external) vs string (local ./plugins/) source
- 60-rewrite-marketplace.test.mjs: assert nested voyage.source.source / .url / .ref
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3065930fc2
commit
86208dab6c
2 changed files with 19 additions and 14 deletions
|
|
@ -29,9 +29,9 @@ test('--only voyage flips just voyage to external https+ref:v5.1.1, leaves 9 loc
|
|||
assert.equal(r.status, 0, `expected exit 0:\n${r.stdout}\n${r.stderr}`);
|
||||
const mp = readJson(out);
|
||||
const voyage = mp.plugins.find((p) => p.name === 'voyage');
|
||||
assert.equal(voyage.source, 'url');
|
||||
assert.ok(voyage.url.startsWith('https://git.fromaitochitta.com/open/'), `voyage url: ${voyage.url}`);
|
||||
assert.equal(voyage.ref, 'v5.1.1');
|
||||
assert.equal(voyage.source.source, 'url', 'nested source-object discriminator must be url');
|
||||
assert.ok(voyage.source.url.startsWith('https://git.fromaitochitta.com/open/'), `voyage url: ${voyage.source.url}`);
|
||||
assert.equal(voyage.source.ref, 'v5.1.1');
|
||||
const local = mp.plugins.filter((p) => typeof p.source === 'string' && p.source.startsWith('./plugins/'));
|
||||
assert.equal(local.length, 9, 'exactly 9 entries must stay local (mixed-source proven)');
|
||||
assert.ok(!JSON.stringify(mp).includes('ssh://'), 'no ssh:// anywhere');
|
||||
|
|
@ -50,9 +50,9 @@ test('--all leaves zero ./plugins/ sources; every entry external https+ref', ()
|
|||
const local = mp.plugins.filter((p) => typeof p.source === 'string' && p.source.startsWith('./plugins/'));
|
||||
assert.equal(local.length, 0, '--all must leave zero local sources');
|
||||
for (const p of mp.plugins) {
|
||||
assert.equal(p.source, 'url', `${p.name} should be external`);
|
||||
assert.ok(p.url.startsWith('https://'), `${p.name} url must be https: ${p.url}`);
|
||||
assert.ok(typeof p.ref === 'string' && p.ref.length > 0, `${p.name} must have a ref`);
|
||||
assert.equal(p.source.source, 'url', `${p.name} should be external (nested source-object)`);
|
||||
assert.ok(p.source.url.startsWith('https://'), `${p.name} url must be https: ${p.source.url}`);
|
||||
assert.ok(typeof p.source.ref === 'string' && p.source.ref.length > 0, `${p.name} must have a ref`);
|
||||
assert.ok(typeof p.description === 'string' && p.description.length > 0, `${p.name} must keep its description`);
|
||||
}
|
||||
} finally {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue