Skip to content

fix(pkg): ship all .d.ts files in npm package#258

Merged
robertsLando merged 1 commit into
mainfrom
fix/publish-type-declarations
Apr 21, 2026
Merged

fix(pkg): ship all .d.ts files in npm package#258
robertsLando merged 1 commit into
mainfrom
fix/publish-type-declarations

Conversation

@robertsLando

Copy link
Copy Markdown
Member

Summary

  • The files whitelist only included lib-es5/index.d.ts, but that file re-exports from ./types, so the compiled lib-es5/types.d.ts was excluded from the published tarball.
  • As a result, TypeScript consumers of the new typed exec(options) API added in feat(api): typed options object for exec() #253 hit an unresolved-module error when compiling against @yao-pkg/pkg@6.18.0.
  • Fix by widening the glob to lib-es5/*.d.ts so every generated declaration ships.

Context

Reported by @viceice in #253 (comment).

Verified against the published 6.18.0 tarball — lib-es5/types.d.ts is missing. npm pack --dry-run on this branch now lists all .d.ts files, including types.d.ts (4.0 kB).

Test plan

  • yarn lint clean
  • npm pack --dry-run lists lib-es5/types.d.ts and every other lib-es5/*.d.ts
  • After release, verify a TS consumer can import type { PkgExecOptions } from '@yao-pkg/pkg' without module-resolution errors

🤖 Generated with Claude Code

The `files` whitelist only shipped `lib-es5/index.d.ts`, but that file
imports from `./types`, so TypeScript consumers of the typed `exec()`
API introduced in #253 couldn't resolve the module. Switch to
`lib-es5/*.d.ts` so every generated declaration is published.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@robertsLando robertsLando merged commit 7e10ce2 into main Apr 21, 2026
26 checks passed
@robertsLando robertsLando deleted the fix/publish-type-declarations branch April 21, 2026 08:51
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