chore(npm): stop shipping dev/build/test tooling in the published package - #630
Closed
scotmatson wants to merge 1 commit into
Closed
chore(npm): stop shipping dev/build/test tooling in the published package#630scotmatson wants to merge 1 commit into
scotmatson wants to merge 1 commit into
Conversation
…kage Extends .npmignore so the npm tarball contains only shipped runtime code (dist/, src/) and docs. Removes dev/build/test tooling that was leaking into the published package, including a local test server and build configs a consumer's scanner would otherwise flag. Verified with `npm pack --dry-run` (122 -> 108 files). Removed, all dev-only: .babelrc, .eslintignore, .eslintrc.json, .github/*, .vscode/launch.json, .claude/settings.local.json, build.sh, rollup.config.mjs, tsconfig.base.json, testServer.js Added: none. All runtime files preserved (dist 38, src 52, doc, packages, bower.json, logo.svg, CHANGELOG.md); main/module/types entry points confirmed present. Build tooling remains in the repo working tree, so prepublishOnly is unaffected. Removes the published-surface source of CodeQL alerts #153, #154 (js/exposure-of-private-files, testServer.js) and #166 (js/incomplete-sanitization, rollup.config.mjs) for anyone scanning the tarball. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
|
Moving this to the private repo at Jakub's request — superseded by mixpanel/mixpanel-js-private#485 (identical diff; private and public master are the same commit). Closing to avoid duplicate review. |
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.
What
Extends
.npmignoreso the npm tarball contains only shipped runtime code (dist/,src/) and docs — removing dev/build/test tooling that was leaking into the published package.Why
mixpanel-browserhas nofilesallowlist, so a lot of dev-only files ship to consumers, including a local test server (testServer.js) and build configs (rollup.config.mjs,build.sh,tsconfig.base.json), plus editor/CI/lint configs and even.claude/settings.local.json. A consumer who scans the downloaded tarball sees these — they're the published-surface source of CodeQL #153/#154 (js/exposure-of-private-files,testServer.js) and #166 (js/incomplete-sanitization,rollup.config.mjs).Verification (nothing runtime dropped)
npm pack --dry-rundiff, 122 → 108 files.Removed (all dev-only):
Added: none.
Preserved:
dist/(38),src/(52),doc/(3),packages/(9),bower.json,logo.svg,CHANGELOG.md.main(dist/mixpanel.cjs.js),module(dist/mixpanel.module.js), andtypes(src/index.d.ts) all confirmed present.Build tooling stays in the repo working tree — only excluded from the tarball — so
prepublishOnly(which runs the build at publish time) is unaffected.Note (out of scope here)
packages/openfeature-web-provider/(9 files) is a separately-published package (@mixpanel/openfeature-web-provider) that also ships inside this tarball. Left untouched to keep this change focused; worth a follow-up if we want it excluded too.🤖 Generated with Claude Code