chore(build): point tsdown aliases at real src dirs#431
Merged
Conversation
The @/#v0 (packages/0) and #v0/#paper (packages/paper) tsdown bundler aliases resolved to non-existent directories (../src → packages/src; ../../0/src → 0/src). The build stayed green only because the keys didn't match real imports — a latent footgun: a future `@/...` import would resolve to a nonexistent dir and fail confusingly. Correct the path consts to the real locations (matching vitest.config.ts and packages/genesis). Kept the aliases (corrected) rather than deleting them, since paper consumes #v0 and a corrected alias is zero-risk; maintainer can delete later if confirmed fully unused. Verified: build:0 and build:paper both green. Closes #403 #403
|
commit: |
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 bundler-alias path consts in
packages/0/tsdown.config.mtsandpackages/paper/tsdown.config.mtsresolved to non-existent directories:packages/0:at = ../src→packages/src✗,v0 = ../../0/src→0/src✗packages/paper:v0 = ../../0/src→0/src✗,paper = ../src→packages/src✗The build was green only because the keys never matched real imports (
@is unused;#v0/#paperresolve via package.jsonimports/ tsconfig paths). It's a latent footgun — a future@/…import would resolve to a nonexistent dir and fail confusingly.Fix: correct the path consts to the real
srcdirs (matchingpackages/0/vitest.config.tsandpackages/genesis/tsdown.config.mts):packages/0: bothatandv0→new URL('src', …)(=packages/0/src)packages/paper:v0→new URL('../0/src', …)(=packages/0/src),paper→new URL('src', …)(=packages/paper/src)I kept the aliases (corrected) rather than deleting them (the issue's other option): paper genuinely consumes
#v0, and a correctly-pointed alias is zero-risk, whereas deletion risks removing something load-bearing. A maintainer can delete them later if confirmed fully unused.Bug-family: both
packages/0andpackages/paperfixed in one pass. Verified locally:pnpm build:0andpnpm build:paperboth complete green.Closes #403