Skip to content

Conversation

@ochafik
Copy link
Collaborator

@ochafik ochafik commented Dec 19, 2025

Note: This PR is rebased on #184 and should be merged after it.

Summary

  • Add preexamples:build hook to automatically run npm run build before examples:build
  • This ensures examples always type-check against the latest library code, catching breaking changes during development
  • Simplify build:all to just call examples:build (the pre-hook handles building the lib)
  • Add version consistency check to ensure examples reference the correct library version

Changes

  1. preexamples:build hook - ensures lib is built before examples
  2. Version check script (scripts/check-versions.mjs):
    • Validates examples use ^{root-version} or ../..
    • Runs in CI before npm install
    • Available locally via npm run check:versions
    • Shows fix command when versions mismatch

Test plan

  • npm run examples:build now runs npm run build first (via pre-hook)
  • npm run build:all still works as expected
  • npm run check:versions passes with correct versions
  • Version mismatch is caught by the check script
  • Breaking changes in the library are caught by TypeScript during example builds

🤖 Generated with Claude Code

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 19, 2025

Open in StackBlitz

@modelcontextprotocol/ext-apps

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/ext-apps@185

@modelcontextprotocol/server-basic-react

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-basic-react@185

@modelcontextprotocol/server-basic-vanillajs

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-basic-vanillajs@185

@modelcontextprotocol/server-budget-allocator

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-budget-allocator@185

@modelcontextprotocol/server-cohort-heatmap

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-cohort-heatmap@185

@modelcontextprotocol/server-customer-segmentation

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-customer-segmentation@185

@modelcontextprotocol/server-scenario-modeler

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-scenario-modeler@185

@modelcontextprotocol/server-system-monitor

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-system-monitor@185

@modelcontextprotocol/server-threejs

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-threejs@185

@modelcontextprotocol/server-wiki-explorer

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-wiki-explorer@185

commit: 21ff936

@ochafik ochafik force-pushed the ochafik/fix-examples-build-order branch 3 times, most recently from 9d8126c to 8bab9ef Compare December 19, 2025 12:28
@ochafik ochafik force-pushed the ochafik/fix-examples-build-order branch from aae2a86 to fff7a92 Compare January 9, 2026 00:53
ochafik and others added 3 commits January 9, 2026 01:28
Add preexamples:build hook to automatically run `npm run build` before
`examples:build`. This ensures examples always type-check against the
latest library code, catching breaking changes during development.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Add scripts/check-versions.mjs to verify that example package.json files
reference the correct version of @modelcontextprotocol/ext-apps.

- Allows "../.." (local dev) or "^{root-version}" as valid dependencies
- Runs in CI before npm install to catch mismatches early
- Available locally via `npm run check:versions`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@ochafik ochafik force-pushed the ochafik/fix-examples-build-order branch from fff7a92 to 21ff936 Compare January 9, 2026 01:29
@ochafik ochafik merged commit f8e31eb into main Jan 9, 2026
19 checks passed
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.

2 participants