Skip to content

Consume the fragment contract from @sphere-pub/node instead of vendoring it - #3

Open
marianoviola wants to merge 2 commits into
mainfrom
m1-contract-from-package
Open

marianoviola wants to merge 2 commits into
mainfrom
m1-contract-from-package

Conversation

@marianoviola

Copy link
Copy Markdown
Owner

M1, plugin side. Draft until @sphere-pub/node@1.1.0 is on npm (marianoviola/sphere-node#4): the dev dependency is declared as ^1.1.0, and CI/npm ci can't resolve it before that. Verified locally against the packed 1.1.0 tarball: typecheck, 31/31 tests, build (schema bundled into server/index.js from node_modules/@sphere-pub/node/spec/).

  • src/contract/ deleted; imports point at @sphere-pub/node/spec/fragment.schema.json and @sphere-pub/node/contract.
  • Build-time dependency only: nothing from the node runs inside the plugin, the .mcpb is unchanged in shape.
  • tests/contract.test.ts fails if a vendored copy reappears, and checks the bundled schema's $id.

To do after 1.1.0 is published: npm install to refresh package-lock.json, then un-draft.

🤖 Generated with Claude Code

marianoviola and others added 2 commits September 21, 2026 21:42
…ing it

src/contract/ (a copy of the schema and hand-written response types) is
gone. The schema is imported from @sphere-pub/node/spec/fragment.schema.json
and the types from @sphere-pub/node/contract, both bundled at build time;
the plugin still ships as a single self-contained server/index.js with no
runtime dependency on the node. A test guards against the vendored copy
coming back and checks the bundled schema is the package's.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@marianoviola
marianoviola marked this pull request as ready for review September 21, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant