Repository navigation
Publish compiled dist with type declarations - #35
Open
dominikmlynarczyk wants to merge 1 commit into
Open
dominikmlynarczyk wants to merge 1 commit into
dominikmlynarczyk wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 342d91a 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 |
This branch has not been deployed
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.
The latest version of effect-orpc (
1.0.0) resolves to its TypeScript source:exportspoints at./src/index.ts, and thepublishConfig.exportsmeant to switch todistat publish time is never applied.npm and Bun only honor a few
publishConfigfields, sochangeset publishships the devexportsand the builtdist/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
exactOptionalPropertyTypesornoImplicitReturns) get type errors insideeffect-orpc, andskipLibCheckdoesn't help because the files aren't declarations.This PR makes
exportsitself point at the build and keeps local development onsrc:exportsgains asourcecondition forsrc, and defaults todist/*.jswithdist/*.d.tstypes; the unusedpublishConfigis removeddts: true)tsconfig.jsonsetscustomConditions: ["source"], so type-checking in the monorepo still readssrcwithout a buildbun --conditions=source; its tests now run after^build, against the built packageThanks 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.