Repository navigation
Include index.js in the published package and lint it with publint - #107
Merged
Merged
Conversation
Removing the `main` field in #85 also dropped `index.js` from the tarball, as `files` only lists `dist` and `index.d.ts`. The plugin leaves the `ecij` import in place, so builds still resolve it, and `vite build` of react-data-grid fails with: Rolldown failed to resolve import "ecij" Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Snapshot the files `npm pack` would publish, so a missing entry point fails the tests, which the release workflow runs before publishing. npm 12 keys the `--json` output by package name while earlier versions return an array, so read it with `Object.values()`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Replace the `npm pack` snapshot test with a script that CI and the release workflow run after the build: it checks that `npm pack` includes every file referenced by `exports`, so there is no file list to keep up to date, and the test suite no longer needs `dist`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The runner images include jq, so the workflow step can compare the `exports` of package.json with the `npm pack` file list directly. `shell: bash` enables pipefail, so a failing `npm pack` fails the step instead of feeding jq empty input. Co-Authored-By: Claude Opus 5.5 <[email protected]>
publint checks every file referenced by package.json against the files `npm pack` would publish, whatever the shape of `exports`, and reads the output of every npm version itself. `node --run lint:package` runs it with `--strict` after the build, in CI and before releases. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Removing the
mainfield in #85 also droppedindex.jsfrom the tarball, asfilesonly listsdistandindex.d.ts. The plugin leaves theecijimport in place, so builds still resolve it. Packingmainand installing it in react-data-grid breaksvp build:This adds
index.jstofilesand adds publint asnode --run lint:package(publint --strict), which checks every file referenced bypackage.jsonagainst the filesnpm packwould publish. CI and the release workflow run it after the build, so a missing entry point now fails CI and stops a release.Verification
npm pack --dry-runlistsindex.jsagain (7 files).fileschange, publint fails withpkg.exports["."].default is ./index.js but the file is not published. Is it specified in pkg.files?, with both npm 11 and npm 12. With it, publint reportsAll good!.f7d4e272),vp packandvp buildpass, and all of its tests pass (544 passed, 3 skipped).inlineConst#87 in the unminifiedlib/index.js, which minifiers fold back into strings.🤖 Generated with Claude Code