fix: unbundle DTS and expose dist/* for portable types - #14
Merged
Conversation
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>
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.
Summary
unbundle: truein vp pack so dist mirrors source structure — no more hashed DTS chunks (schema-CJBGJWJn.d.mts)"./dist/*": "./dist/*"wildcard export so TypeScript can resolve all internal.d.mtsfilesexports: truefrom pack config to prevent vp from overwriting the manually managed exports mapFixes TS2742 ("inferred type cannot be named without a reference to internal chunk") for consumers.
Test plan
vp checkpassesvp packbuilds with no hashed DTS chunksvp packdoes not overwrite package.json exports🤖 Generated with Claude Code