Skip to content

fix: unbundle DTS and expose dist/* for portable types - #14

Merged
priosshrsth merged 6 commits into
mainfrom
fix/unbundle-dts
Mar 27, 2026
Merged

fix: unbundle DTS and expose dist/* for portable types#14
priosshrsth merged 6 commits into
mainfrom
fix/unbundle-dts

Conversation

@priosshrsth

@priosshrsth priosshrsth commented Mar 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Enable unbundle: true in vp pack so dist mirrors source structure — no more hashed DTS chunks (schema-CJBGJWJn.d.mts)
  • Add "./dist/*": "./dist/*" wildcard export so TypeScript can resolve all internal .d.mts files
  • Remove exports: true from pack config to prevent vp from overwriting the manually managed exports map
  • Bump version to 2.0.3

Fixes TS2742 ("inferred type cannot be named without a reference to internal chunk") for consumers.

Test plan

  • vp check passes
  • vp pack builds with no hashed DTS chunks
  • vp pack does not overwrite package.json exports
  • Verify TS2742 is resolved in consumer projects

🤖 Generated with Claude Code

priosshrsth and others added 6 commits March 27, 2026 10:45
Replace customExports types hack with unbundle: true so dist mirrors
the source file structure. This eliminates hashed DTS chunks entirely,
making all types portable for consumer declaration emit (fixes TS2742).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add "./dist/*": "./dist/*" wildcard export so TypeScript can resolve
  all internal .d.mts files referenced by unbundled declarations
- Remove exports: true from pack config to prevent vp pack from
  overwriting the manually managed exports map

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ntry

The wildcard leaked internals as public API. With unbundle + schema
re-export from the main entry, TypeScript can express types through
import("@anitshrsth/assembly-kit").CompaniesResponse instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace customExports hack with unbundle: true + exports: true.
Unbundle preserves the source file structure in dist so all .d.mts
files use stable relative paths — no hashed chunks that break
TypeScript declaration portability (TS2742).

Verified with a symlinked test project: consumer declaration emit
correctly resolves to import("@anitshrsth/assembly-kit").CompaniesResponse.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Ensure react, zod, typescript, pino, pino-pretty all follow the same
pattern: devDependencies (local dev), peerDependencies (contract),
peerDependenciesMeta optional (no error if consumer omits them).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@priosshrsth
priosshrsth merged commit e72dfa6 into main Mar 27, 2026
6 checks passed
@priosshrsth
priosshrsth deleted the fix/unbundle-dts branch March 27, 2026 11:28
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