Repository navigation
fix(multipublish): publish gitignored build output to jsr and fail on errors - #354
Conversation
… errors JSR publishes have been failing on every release with `excluded-module`: build output in `dist/` is gitignored, and deno only un-ignores files through negated globs in `publish.exclude`. multipublish wrote `defaultExclude` to the top-level `exclude`, where `!dist` is ignored. - add `!<dir>` to `publish.exclude` for every directory `exports` point into - write `defaultInclude` / `defaultExclude` to `publish.include` / `publish.exclude` - keep a user's `publish` block instead of stripping it in jsrSchema The failures went unnoticed because `chdir` caught and logged every error, so the CLI exited 0. It now rethrows; cleanup runs in `finally`; `run` attempts every platform and package, then throws a PublishError listing what failed, and the CLI exits 1. Publish errors no longer include the command, which contained the JSR token. An unscoped package with the `.npmrc` strategy now throws instead of returning silently. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ Deploy Preview for packages-node-modules ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
🦋 Changeset detectedLatest commit: 686b9ea The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
ℹ️ No critical issues. One ordering issue in the auto-added
!distglobs is worth a look.
Reviewed changes
I reviewed the whole PR: fixes to how the JSR config is generated, and failures that used to be swallowed now fail the CLI. I checked the negated-glob behavior against Deno's matcher source, and the 50 multipublish tests pass locally.
includeExportDirectories: adds!<dir>topublish.excludefor each directory an export points into. Root-level exports like./package.jsonare skipped.defaultInclude/defaultExclude: these now go topublish.include/publish.exclude, andjsrSchemakeeps a user'spublishblock.execPublish: publish failures now throw<platform> publish failed for <name> (exit code N). The command, and with it the--token, no longer appears in the error. Cleanup now runs infinally.chdir: callback errors are rethrown after switching back to the original directory.PublishErrorand the CLI:runstill tries every platform and package, then throwsPublishErrorwith the list of failures. The CLI prints that list and setsprocess.exitCode = 1.- Unscoped
.npmrcstrategy: this now throws instead of returning silently.
claude-opus-5-5 | 𝕏
@stephansama/ai-commit-msg
@stephansama/alfred-kaomoji
@stephansama/astro-iconify-svgmap
@stephansama/auto-readme
@stephansama/catppuccin-jsonresume-theme
@stephansama/catppuccin-opml
@stephansama/catppuccin-rss
@stephansama/catppuccin-typedoc
@stephansama/catppuccin-xsl
@stephansama/eslint-config
create-stephansama-example
@stephansama/find-floating-deps
@stephansama/find-makefile-targets
@stephansama/github-env
@stephansama/inline-image
@stephansama/monorule
@stephansama/multipublish
@stephansama/pnpm-hooks
@stephansama/prettier-plugin-handlebars
@stephansama/rehype-bluesky-embed
@stephansama/remark-asciinema
@stephansama/single-file
@stephansama/svelte-social-share-links
@stephansama/typed-env
@stephansama/typed-events
@stephansama/typed-nocodb-api
@stephansama/typed-templates
@stephansama/types-github-action-env
@stephansama/types-lhci
@stephansama/vite-devtools-tailwind-debug-screens
@stephansama/vite-iconify-svgmap
commit: |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…cludes jsr uses the last matching glob in `publish.exclude`, so appending `!dist` overrode narrower user excludes inside it like `dist/*.map`. Prepend the export directory globs instead, and leave a directory the user already listed where it is. Also cover the CLI exit codes and a publish error without an exit code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Addressed review feedback in 686b9ea:
|
There was a problem hiding this comment.
✅ No new issues found. The
!distordering issue from the last review is fixed.
Reviewed changes
Since the last review, includeExportDirectories now puts its globs first, and new tests were added. All 55 multipublish tests pass locally.
- Prepended export-directory globs: missing
!<dir>entries now go before the existingpublish.excludeentries. With JSR's last-match-wins rule, narrower excludes likedist/**/*.mapstill apply. If!<dir>is already in the list, it stays where the user put it. - Added
cli.test.ts: covers a clean exit, thePublishErrorsummary withprocess.exitCode = 1, and rethrowing errors that aren't publish failures. - Added a test for errors with no exit code: checks that
execPublishleaves out(exit code N)when the error has no numericstatus.
claude-opus-5-5 | 𝕏

Problem
JSR publishing has been failing on every release, and CI has stayed green. JSR has 2 versions of multipublish, ending at 1.0.10 (npm is on 1.0.15).
pnpm-hooks,auto-readmeandfind-floating-depshave never been published there. From the last release run (#353):Two bugs:
dist/is gitignored, and Deno only un-ignores files through negated globs inpublish.exclude. multipublish wrotedefaultExcludeto the top-levelexclude, where negations don't apply. So the README's owndefaultExclude: ["!dist"]example, and this repo's!config, never had any effect. The likely trigger for the recent failures is thatpnpm dlx jsrisn't pinned and now pulls a stricter Deno (v2.6.7), but I haven't confirmed that.utilities.chdircaught every error and only logged it, so the CLI exited 0.Fix
JSR config (
jsr.ts):includeExportDirectoriesadds!<dir>topublish.excludefor every directoryexportspoint into (!distfor./dist/index.mjs). JSR says an excluded export target fails at runtime anyway, so this is always safe.defaultInclude/defaultExcludenow go topublish.include/publish.exclude.jsrSchemakeeps a user'spublishblock instead of stripping it.Errors (
utilities.ts,publish.ts,index.ts,cli.ts):chdirrethrows, and the cleanup (jsr.json,package.json,.npmrc) runs infinally.runstill attempts every platform and package, so a JSR outage doesn't block GitHub Packages, then throws aPublishErrorlisting what failed. The CLI prints it and exits 1.jsr publish failed for <name> (exit code 1). The originalexecSyncerror repeated the whole command,--tokenincluded..npmrcstrategy now throws instead of returning silently.Verification
PublishErrorexport.GITHUB_TOKENunset so the npm step fails on purpose:The same dry run for
find-floating-depsalso succeeds on JSR. Before the fix, both failed withexcluded-module.Heads up
pnpm-hooks,auto-readmeandfind-floating-depsmay require creating each package on jsr.io. I haven't confirmed this.package.jsonafterexperimentalUpdateCatalogsrewrites it. Harmless in CI, but it leaves local runs dirty.pnpm dlx jsrisn't pinned.Checklist
mainhave been mergedmain🤖 Generated with Claude Code