Skip to content

Leave test files out of the npm package - #2290

Open
lukasIO wants to merge 1 commit into
mainfrom
claude/npm-release-test-files-6c6da3
Open

lukasIO wants to merge 1 commit into
mainfrom
claude/npm-release-test-files-6c6da3

Conversation

@lukasIO

@lukasIO lukasIO commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

The package ships src so that go-to-definition in an IDE opens the TypeScript source. But "files": ["dist", "src"] also publishes every test file, snapshot and test helper under src: 77 of the 241 files in the tarball. No consumer uses them. If files is set, npm ignores the root .npmignore. So its test entry does not help.

Change

files in package.json now excludes:

  • src/**/*.test.ts
  • src/**/__snapshots__
  • src/test (mocks and test setup)
  • src/room/token-source/test-tokens.ts

Only test files import src/test and test-tokens.ts, and tsconfig.json already excludes them from the build. The rest of src stays in the package.

Verified

  • npm pack --dry-run and pnpm pack both list 164 files, down from 241. No path matches test or snap.
  • dist is not built in this checkout, so the check covers only the src part of the tarball.

🤖 Generated with Claude Code

The package ships src for go-to-definition, but `files: ["src"]` also
published 77 test files, snapshots and test helpers. The `test` entry in
.npmignore had no effect, because npm ignores the root .npmignore when
`files` is set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lukasIO lukasIO self-assigned this Nov 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR bumps

  • livekit-client: patch

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@lukasIO
lukasIO enabled auto-merge (squash) November 20, 2026 12:52
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
dist/livekit-client.esm.mjs 118.41 KB (0%)
dist/livekit-client.umd.js 127.94 KB (0%)
dist/core/core.mjs 79.82 KB (0%)

This branch has not been deployed

No deployments
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.

1 participant