Skip to content

ci: check what npm pack would publish - #338

Open
mattpodwysocki wants to merge 7 commits into
mainfrom
chore/check-pack
Open

mattpodwysocki wants to merge 7 commits into
mainfrom
chore/check-pack

Conversation

@mattpodwysocki

@mattpodwysocki mattpodwysocki commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

First step of the MCP monorepo move (AGI-1276, under AGI-1274). Moving the server into servers/mcp-server, and later bringing devkit and docs in, can quietly change what we publish: a missing dist file, an export that points nowhere, a file dropped from files. Today we'd only find out after the release. This checks it on every PR.

What it checks

npm run check:pack (after npm run build) runs npm pack --dry-run and:

  • Fails if an entry point isn't in the package: every exports target, bin, main and types.
  • Fails if a file in the latest published version is gone, compared with npm pack @mapbox/mcp-server@latest --dry-run. For a removal on purpose, such as dropping a tool, add the pack-files-removed label and the check passes but still lists the files.
  • Lists added files without failing.
  • Writes the result to the job summary.

It takes a package directory (node scripts/check-pack.cjs servers/mcp-server), so it carries over to each package in the monorepo and to devkit and docs as is. A package that has never been published (like a future @mapbox/mcp-core) gets only the entry point check.

It runs in its own workflow, pack.yml, which also reruns when labels change, so adding pack-files-removed takes effect without a new push.

Checked

  • Against the current build: 1368 files packed, same as published 0.18.0, passes.
  • Deleting dist/commonjs/tools/index.d.ts and a tool's .js: fails with the missing entry point and both removed files listed.
  • Same with PACK_ALLOW_REMOVED=true: passes for the removed tool file and still lists it.
  • 13 new tests for the pure check and the pack output parsing (no network). All tests and the typecheck pass.

🤖 Generated with Claude Code

Fails when an exports, bin, main or types target isn't in the package,
or when a file in the latest published version is gone. The
pack-files-removed PR label allows a deliberate removal. Guards the
publish while the MCP monorepo moves packages around (AGI-1276).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mattpodwysocki
mattpodwysocki requested a review from a team as a code owner November 16, 2026 14:56
@mattpodwysocki mattpodwysocki added the enhancement New feature or request label Nov 16, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread .github/workflows/pack.yml Fixed
mattpodwysocki and others added 3 commits November 16, 2026 10:00
npm 10 in CI prints "pre-commit script created." before the JSON.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ctufts
ctufts previously approved these changes Nov 17, 2026
ctufts
ctufts previously approved these changes Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants