Skip to content

fix(ci): ship src/data/*.json in published tarball#148

Merged
mscolnick merged 1 commit into
mainfrom
Light2Dark/fix-npm-missing-data-files
Jun 8, 2026
Merged

fix(ci): ship src/data/*.json in published tarball#148
mscolnick merged 1 commit into
mainfrom
Light2Dark/fix-npm-missing-data-files

Conversation

@Light2Dark

Copy link
Copy Markdown
Contributor

Since v0.2.5 the published npm tarball has been missing src/data/common-keywords.json and src/data/duckdb-keywords.json, leaving the ./data/* exports dead (404 / unresolved module for consumers). PR #128 split the release into separate build/publish jobs, but the build job's upload-artifact step omitted src/, so those files weren't on disk when the publish job ran pnpm publish — and npm silently drops files entries that don't exist. This adds src/data/ to the artifact path so the keyword JSON files reach the publish job. It also adds a vitest guard (src/__tests__/package-exports.test.ts) that runs npm pack and asserts every src/-based exports target is present in the tarball, so the regression can't recur silently.

Verified: npm pack --dry-run now lists both JSON files; the new test passes against the current package and fails if src/data/*.json is dropped from files.

🤖 Generated with Claude Code

PR #128 split the release into separate build/publish jobs; the build
job's upload-artifact step omitted src/, so src/data/*.json was absent
on disk when the publish job ran pnpm publish. npm silently drops files
entries that don't exist, leaving the ./data/* exports dead in 0.2.5+.

Add src/data/ to the artifact path so the keyword JSON files reach the
publish job. Add a vitest guard that runs npm pack and asserts every
src/-based exports target is in the tarball, so this can't recur silently.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 8, 2026 15:51
@Light2Dark Light2Dark requested a review from mscolnick June 8, 2026 15:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes the release workflow so src/data/*.json files referenced by package.json exports are actually present in the published npm tarball, restoring the ./data/* consumer exports that regressed after the release workflow was split in #128. Adds a Vitest regression test that validates the packed tarball includes every src/-based export target.

Changes:

  • Include src/data/ in the build job’s uploaded artifact so the publish job has those files on disk at publish time.
  • Add src/__tests__/package-exports.test.ts to run npm pack --dry-run --json and assert every src/ export target is present in the tarball.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/__tests__/package-exports.test.ts Adds a packaging regression test to ensure src/-based exports targets are included in the npm tarball.
.github/workflows/release.yml Uploads src/data/ as part of the build artifact so publish has the JSON keyword files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +30 to +31
// not the source tree. Regression guard for the `./data/*` exports that
// shipped dead in 0.2.5–0.2.7 because `src/data/` was missing at publish time.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
// not the source tree. Regression guard for the `./data/*` exports that
// shipped dead in 0.2.5–0.2.7 because `src/data/` was missing at publish time.
// not the source tree.

@mscolnick mscolnick merged commit 3a04472 into main Jun 8, 2026
5 checks passed
@mscolnick mscolnick deleted the Light2Dark/fix-npm-missing-data-files branch June 8, 2026 16:04
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.

3 participants