Repository navigation
fix: refactor exports structure in package.json - #117
Conversation
The exports map carried no `types` condition, and `index.d.cts` was excluded from the published files, so a CommonJS consumer on `moduleResolution: nodenext` resolved to `dist/index.cjs` with no declarations and fell back to `any` for the whole API. tsup already emits `dist/index.d.cts`, so this only needs the export conditions to point at it and the file to ship.
🦋 Changeset detectedLatest commit: 9095cac 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 |
|
Thanks for the quick turnaround — the split into Since the diff matches the "Proposed fix" section of #116, would you be open to adding a co-author trailer to the commit? It would look like this: It needs to be the last line of the commit message, separated by a blank line. Entirely up to you — happy either way, and thanks again for picking this up. |
Exclude declaration files from package distribution.
package.json
|
Contents of |
Closes #116.
dist/index.d.ctsis built by tsup on every release, but it never reachesconsumers:
filesexcluded it explicitly, and theexportsmap carried notypescondition at all. A CommonJS project onmoduleResolution: nodenexttherefore resolved to
dist/index.cjswith no declarations beside it andsilently typed the whole API as
any.The change is limited to
package.json:typesto both export conditions, listed first so it is matched beforethe runtime entry
import/requireso each points at itsown declaration file
"!dist/**/*.d.cts"fromfilesVerification
@arethetypeswrong/cli --pack ., the tool used in the issue:I also packed the tarball and installed it into a scratch CommonJS project
with
"module": "nodenext". Before the changetsc --noEmitreportedand after it exits 0, with
require('@litehex/node-vault')still resolving todist/index.cjsat runtime.pnpm testis 41/41 against a local dev Vault, andtypecheck,eslintandformat:checkare clean.