fix: add files allowlist to package.json to slim published tarball#295
Open
spiderocious wants to merge 1 commit into
Open
fix: add files allowlist to package.json to slim published tarball#295spiderocious wants to merge 1 commit into
spiderocious wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #290.
The published
@notionhq/notion-mcp-servertarball currently includes ~40 files / 1.6 MB of repository contents that have no runtime purpose — including the entiresrc/TypeScript source, all__tests__/directories,tsconfig.json,Dockerfile,docker-compose.yml,.dockerignore,.github/,CLAUDE.md, and the fourdocs/images/*.pngscreenshots (1.3 MB combined). The original issue (#290) flaggedCLAUDE.md, but the underlying cause is thatpackage.jsonhas no"files"allowlist and no.npmignoreexists, so npm falls back to publishing nearly the entire working tree.This PR adds a tight
"files"allowlist topackage.jsonso only the files actually needed at runtime are published:bin/— containsbin/cli.mjs, the self-contained esbuild bundle thatpackage.json#binpoints to.scripts/notion-openapi.json— loaded at runtime bybin/cli.mjs(seescripts/start-server.ts:22→path.resolve(directory, '../scripts/notion-openapi.json')).README.mdandLICENSE— customary metadata.package.jsonis always included by npm automatically.Impact
Both
bin/cli.mjsandscripts/notion-openapi.jsonare preserved, so thenpx @notionhq/notion-mcp-serverworkflow is unaffected.How was this change tested?
Automated: existing test suite passes locally (
npm test→ 8 files, 80 tests passing).Manual:
npm run buildand confirmedbin/cli.mjsis produced.npm pack --dry-runagainst a clean checkout ofupstream/mainto capture the before state, then against this branch to capture after.bin/cli.mjs,scripts/notion-openapi.json,README.md,LICENSE, andpackage.json.bin/cli.mjsstill resolvesscripts/notion-openapi.jsonat runtime relative to its own location — both files are included in the allowlist.Screenshots
N/A — packaging-only change, no UI impact.