Skip to content

fix: use wildcard re-export for padrone/zod entry#19

Merged
gkurt merged 2 commits into
mainfrom
fix/zod-dts-build
Jun 30, 2026
Merged

fix: use wildcard re-export for padrone/zod entry#19
gkurt merged 2 commits into
mainfrom
fix/zod-dts-build

Conversation

@gkurt

@gkurt gkurt commented Jun 30, 2026

Copy link
Copy Markdown
Owner

Problem

The Release workflow failed at the publish step because bun run build errored during pack:

[plugin rolldown-plugin-dts:fake-js]
Error: Failed to parse generated code for chunk zod.d.mts.
SyntaxError: Export 'jsonCodec' is not defined. (3:9)

src/zod.ts was a named re-export barrel (export { jsonCodec, zodAsyncStream } from './schema/zod.ts'). In the multi-entry --unbundle build, rolldown-plugin-dts merges the zod.ts and schema/zod.ts declarations into one zod.d.mts chunk but drops the import binding, emitting an export { jsonCodec } with no matching declaration. Building zod.ts alone worked; adding any second entry triggered it — which is why CI never caught it (CI ran typecheck/lint/test but not the build).

Fix

  • Switch src/zod.ts to export * from './schema/zod.ts'. Generated dist/zod.d.mts is byte-identical to the working single-entry output — public API unchanged.
  • Add bun --filter=padrone build to CI so build breakages surface in PRs instead of only at release time.

Includes a padrone: patch changelog entry.

A named re-export in src/zod.ts triggered a rolldown-plugin-dts
chunk-merge bug in the multi-entry build, emitting a dts chunk with
an `export { jsonCodec }` that had no matching binding and failing
`npm publish`. Switching to `export *` produces identical output and
builds cleanly.

Also add `bun --filter=padrone build` to CI so build breakages are
caught in PRs instead of only at release time.
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Tegami

This repository uses Tegami to manage releases. When your changes affect published packages, add a changelog file under .tegami/ before merging.

Create a changelog → · Changelog format

Release preview

Package Bump Version
@padrone/root patch 2.0.02.0.1
@padrone/docs patch 2.0.02.0.1
padrone patch 2.0.02.0.1
@padrone/tasks-example patch 2.0.02.0.1
@padrone/deploy-example patch 2.0.02.0.1

Changelogs in this PR

Changelog Title
fix-zod-dts-build.md Fix build failure when generating type declarations for the padrone/zod entry

Run bun run tegami locally to create a changelog interactively.

Managed by Tegami.

@gkurt gkurt merged commit 638127e into main Jun 30, 2026
2 checks passed
@gkurt gkurt deleted the fix/zod-dts-build branch June 30, 2026 16:09
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