Skip to content

fix(core): move @cfworker/json-schema out of main barrel into /validators/cf-worker subpath#1897

Draft
felixweinberger wants to merge 1 commit intomainfrom
fweinberger/v2-bc-cfworker-lazy
Draft

fix(core): move @cfworker/json-schema out of main barrel into /validators/cf-worker subpath#1897
felixweinberger wants to merge 1 commit intomainfrom
fweinberger/v2-bc-cfworker-lazy

Conversation

@felixweinberger
Copy link
Copy Markdown
Contributor

Part of the v2 backwards-compatibility series — see reviewer guide.

The CF-Worker validator was statically imported into the main barrel, crashing Node/browser/bun consumers without the optional @cfworker/json-schema dep. This moves it to a dedicated subpath so tsdown code-splits it.

Motivation and Context

The CF-Worker validator was statically imported into the main barrel, crashing Node/browser/bun consumers without the optional @cfworker/json-schema dep. This moves it to a dedicated subpath so tsdown code-splits it.

v1 vs v2 pattern & evidence

v1 pattern:

n/a  validator pluggability is v2

v2-native:

Same

Evidence: Verified packages/{server,client}/dist/index.mjs have 0 @cfworker/json-schema references after this change.

How Has This Been Tested?

  • Existing integration tests (422/422)
  • Integration: validated bump-only against 5 OSS repos via the v2-bc-integration validation branch
  • pnpm typecheck:all && pnpm lint:all && pnpm test:all green

Breaking Changes

None — additive @deprecated shim. Removed in v3.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added or updated documentation as needed

Additional context

Stacks on: none

CfWorkerJsonSchemaValidator was re-exported from the core internal barrel,
pulling the optional-peer @cfworker/json-schema static import into every Node
consumer's bundle. Move it to a dedicated core/validators/cfWorker subpath;
the workerd/browser _shims and the public /validators/cf-worker subpath import
from there instead. Main index.mjs no longer references the package.
@felixweinberger felixweinberger added the v2-bc v2 backwards-compatibility series label Apr 15, 2026
@felixweinberger felixweinberger added this to the v2.0.0-bc milestone Apr 15, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 15, 2026

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/@modelcontextprotocol/client@1897

@modelcontextprotocol/server

npm i https://pkg.pr.new/@modelcontextprotocol/server@1897

@modelcontextprotocol/express

npm i https://pkg.pr.new/@modelcontextprotocol/express@1897

@modelcontextprotocol/fastify

npm i https://pkg.pr.new/@modelcontextprotocol/fastify@1897

@modelcontextprotocol/hono

npm i https://pkg.pr.new/@modelcontextprotocol/hono@1897

@modelcontextprotocol/node

npm i https://pkg.pr.new/@modelcontextprotocol/node@1897

commit: 3b174f7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2-bc v2 backwards-compatibility series

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant