Skip to content

ci: use npm ci with caching, validate typedoc links, align Node versions#533

Merged
ochafik merged 1 commit intomainfrom
worktree-agent-a202a06e
Mar 6, 2026
Merged

ci: use npm ci with caching, validate typedoc links, align Node versions#533
ochafik merged 1 commit intomainfrom
worktree-agent-a202a06e

Conversation

@ochafik
Copy link
Contributor

@ochafik ochafik commented Mar 6, 2026

Summary

Four CI hygiene fixes identified in a workflow audit.

Changes

1. npm installnpm ci

npm install tolerates lockfile drift — a PR that works with drifted transitive deps can merge, then break for the next person running npm ci. Switched to npm ci which fails fast on mismatch.

  • ci.yml build matrix (was line 76)
  • ci.yml build-wsl (was line 156)
  • docs.yml deploy job

(npm-publish.yml and publish.yml already used npm ci.)

2. npm dependency caching

Added cache: npm to actions/setup-node steps. Previously every CI job installed from cold. Now all jobs with a package-lock.json available get caching:

  • ci.yml: prettier-fix, build, e2e
  • docs.yml: deploy
  • update-snapshots.yml: update-snapshots

Intentionally not added to:

  • ci.yml test-git-install — no repo checkout, so no lockfile to hash (cache: npm would fail)
  • ci.yml build-wsl — Node is installed manually inside WSL, no setup-node action to configure

3. TypeDoc link validation

CLAUDE.md documents npm exec typedoc -- --treatValidationWarningsAsErrors --emit none as the way to catch broken {@link} references, but it ran in zero CI workflows. A renamed export could break doc links and only surface at release time (docs.yml runs on release, not PR).

Added as a step in the build job after npm run build, gated to Linux x64 only (following the existing MCPB-pack pattern — doc validation is OS-agnostic).

Verified locally: passes on current main (exit 0, no broken links).

4. Node version alignment + engines field

Previously: CI validated on Node 20, but npm-publish.yml published from Node 22. A Node-22-only API in build tooling would pass publish but was never tested in CI.

  • Aligned all workflows on Node 22 (active LTS): ci.yml (5 places incl. WSL nodesource URL), docs.yml, update-snapshots.yml
  • Added "engines": { "node": ">=20" } to package.json — floor matches @types/node 20.x and gives users on Node 18 a warning

Validation

  • YAML syntax validated (python3 yaml.safe_load on all 5 workflow files)
  • prettier --check passes on all edited files
  • TypeDoc validation step runs clean on current main (exit 0)
  • npm ci already proven working in npm-publish.yml / publish.yml — lockfile is in sync

Not changed

  • package-lock.json — untouched
  • npm-publish.yml, publish.yml — already had Node 22 + cache + npm ci

- Switch npm install -> npm ci in ci.yml (build, build-wsl) and docs.yml
  to fail on lockfile drift rather than silently tolerating it
- Add cache: npm to all setup-node steps that have a lockfile to hash
  (skipped test-git-install which has no checkout, and WSL which has no
  setup-node action)
- Add TypeDoc link validation step after build (Linux x64 only, matching
  existing single-OS gate pattern for MCPB). Verified passing on main.
- Align all workflows on Node 22 (active LTS) — previously CI used 20
  but publish workflows used 22, so releases were tested on a different
  Node than PRs
- Add engines.node >=20 to package.json so consumers on Node 18 get a
  warning
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 6, 2026

Open in StackBlitz

@modelcontextprotocol/ext-apps

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

@modelcontextprotocol/server-basic-preact

npm i https://pkg.pr.new/@modelcontextprotocol/server-basic-preact@533

@modelcontextprotocol/server-basic-react

npm i https://pkg.pr.new/@modelcontextprotocol/server-basic-react@533

@modelcontextprotocol/server-basic-solid

npm i https://pkg.pr.new/@modelcontextprotocol/server-basic-solid@533

@modelcontextprotocol/server-basic-svelte

npm i https://pkg.pr.new/@modelcontextprotocol/server-basic-svelte@533

@modelcontextprotocol/server-basic-vanillajs

npm i https://pkg.pr.new/@modelcontextprotocol/server-basic-vanillajs@533

@modelcontextprotocol/server-basic-vue

npm i https://pkg.pr.new/@modelcontextprotocol/server-basic-vue@533

@modelcontextprotocol/server-budget-allocator

npm i https://pkg.pr.new/@modelcontextprotocol/server-budget-allocator@533

@modelcontextprotocol/server-cohort-heatmap

npm i https://pkg.pr.new/@modelcontextprotocol/server-cohort-heatmap@533

@modelcontextprotocol/server-customer-segmentation

npm i https://pkg.pr.new/@modelcontextprotocol/server-customer-segmentation@533

@modelcontextprotocol/server-debug

npm i https://pkg.pr.new/@modelcontextprotocol/server-debug@533

@modelcontextprotocol/server-map

npm i https://pkg.pr.new/@modelcontextprotocol/server-map@533

@modelcontextprotocol/server-pdf

npm i https://pkg.pr.new/@modelcontextprotocol/server-pdf@533

@modelcontextprotocol/server-scenario-modeler

npm i https://pkg.pr.new/@modelcontextprotocol/server-scenario-modeler@533

@modelcontextprotocol/server-shadertoy

npm i https://pkg.pr.new/@modelcontextprotocol/server-shadertoy@533

@modelcontextprotocol/server-sheet-music

npm i https://pkg.pr.new/@modelcontextprotocol/server-sheet-music@533

@modelcontextprotocol/server-system-monitor

npm i https://pkg.pr.new/@modelcontextprotocol/server-system-monitor@533

@modelcontextprotocol/server-threejs

npm i https://pkg.pr.new/@modelcontextprotocol/server-threejs@533

@modelcontextprotocol/server-transcript

npm i https://pkg.pr.new/@modelcontextprotocol/server-transcript@533

@modelcontextprotocol/server-video-resource

npm i https://pkg.pr.new/@modelcontextprotocol/server-video-resource@533

@modelcontextprotocol/server-wiki-explorer

npm i https://pkg.pr.new/@modelcontextprotocol/server-wiki-explorer@533

commit: fbc1c06

@ochafik ochafik marked this pull request as ready for review March 6, 2026 16:27
@ochafik ochafik requested a review from jonathanhefner March 6, 2026 16:27
@ochafik ochafik merged commit b093e39 into main Mar 6, 2026
20 checks passed
@ochafik ochafik deleted the worktree-agent-a202a06e branch March 6, 2026 17:14
ochafik added a commit that referenced this pull request Mar 10, 2026
Changes since 1.2.0:
- fix: bundle SDK+zod in react-with-deps (was byte-identical to ./react) (#539)
- fix(build): copy schema.json to dist and externalize zod (#534)
- fix: skip debug log for high-frequency tool-input-partial notifications (#546)
- fix(deps): drop @hono/node-server override to patch GHSA-wc8c-qw6v-h7f6 (#535)
- fix(readme): use picture element for theme-aware logo (#545)
- fix(ci): require maintainer association for /update-snapshots trigger (#532)
- fix: pre-commit stages only originally-staged files; add .npmrc (#538)
- ci: use npm ci with caching, validate typedoc links, align Node versions (#533)
- test: exclude screenshot-gen from default E2E run; wire pdf-server tests (#537)
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