feat: expose bin/update script via a JSR/npm exports subpath - #242
Merged
Conversation
Adds a "./update" exports entry in both package.json and jsr.json so JSR consumers (who don't get npm-style bin entries) can also run the public-suffix-list update script, and documents usage for both npm and Deno/JSR in the README. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
commit: |
|
🎉 This PR is included in version 8.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
There was a problem hiding this comment.
Pull request overview
This PR makes the public-suffix-list update script reachable via an explicit ./update subpath export for both npm and JSR consumers, and documents how JSR/Deno users can install and invoke the updater given Deno’s nodeModulesDir behavior.
Changes:
- Add
./updatesubpath export topackage.jsonpointing at the built CLI entry (dist/bin/update.js). - Add
./updatesubpath export tojsr.jsonpointing at the source updater (src/bin/update.ts). - Document JSR installation and Deno invocation guidance (including
nodeModulesDir) inREADME.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| README.md | Documents JSR install and how to run the updater from a local node_modules checkout under Deno. |
| package.json | Exposes the updater script via an npm exports subpath (./update). |
| jsr.json | Exposes the updater script via a JSR exports subpath (./update). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| 💡 **Please note:** [publicsuffix.org](https://publicsuffix.org/) is updated several times per month. This package comes with a prebuilt list that has been downloaded at the time of `npm publish`. In order to get an up-to-date list, you should run `npx parse-domain-update` everytime you start or build your application. This will download the latest list from `https://publicsuffix.org/list/public_suffix_list.dat`. | ||
|
|
||
| JSR packages don't support npm-style `bin` entries, so the script is published under the `./update` export instead. The script writes to a path relative to its own location, so it only works once the package has been resolved into a local `node_modules` directory (e.g. by enabling [`nodeModulesDir`](https://docs.deno.com/runtime/fundamentals/configuration/#node-modules-dir) in `deno.json`) — running it directly off a `jsr:` specifier fails because Deno doesn't expose a local path for remote-cached modules: |
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.
Summary
./updateexports entry in bothpackage.jsonandjsr.jsonso the public-suffix-list update script is reachable from JSR/Deno consumers, who don't get npm-stylebinentries.nodeModulesDircaveat needed for the script's relative path resolution to work.Test plan
npm test(format, lint, types, unit tests, JSR dry-run publish) passesnpm run test:jsrdry-run includessrc/bin/update.tsunder the new export