Skip to content

Publish compiled dist with type declarations - #35

Open
dominikmlynarczyk wants to merge 1 commit into
utopyin:mainfrom
dominikmlynarczyk:fix/publish-dist
Open

dominikmlynarczyk wants to merge 1 commit into
utopyin:mainfrom
dominikmlynarczyk:fix/publish-dist

Conversation

@dominikmlynarczyk

@dominikmlynarczyk dominikmlynarczyk commented Oct 20, 2026 •

Copy link
Copy Markdown

The latest version of effect-orpc (1.0.0) resolves to its TypeScript source: exports points at ./src/index.ts, and the publishConfig.exports meant to switch to dist at publish time is never applied.

npm and Bun only honor a few publishConfig fields, so changeset publish ships the dev exports and the built dist/ goes unused.

For consumers this means the TypeScript source is executed at runtime and type-checked with the consumer's own compiler options.
Projects with stricter flags than this repo (for example exactOptionalPropertyTypes or noImplicitReturns) get type errors inside effect-orpc, and skipLibCheck doesn't help because the files aren't declarations.

This PR makes exports itself point at the build and keeps local development on src:

  • exports gains a source condition for src, and defaults to dist/*.js with dist/*.d.ts types; the unused publishConfig is removed
  • tsup emits declarations (dts: true)
  • the root tsconfig.json sets customConditions: ["source"], so type-checking in the monorepo still reads src without a build
  • the Hono example starts with bun --conditions=source; its tests now run after ^build, against the built package

Thanks for your work on this library @utopyin 🙏, we use that commercially in one of our projects, but because of our strict TS setup, we needed to patch your library.

With those changes, we can finally drop the patch and it's objectively overall improvement for any consumer of this library.

@changeset-bot

changeset-bot Bot commented Oct 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 342d91a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
effect-orpc Patch

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

This branch has not been deployed

No deployments
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