fix: 2.0.0-exp.0 fails to load on install (undeclared fast-decode-uri-component, removed elysia internals)#110
Open
thupi wants to merge 1 commit into
Open
fix: 2.0.0-exp.0 fails to load on install (undeclared fast-decode-uri-component, removed elysia internals)#110thupi wants to merge 1 commit into
thupi wants to merge 1 commit into
Conversation
…rop removed elysia internals The unbundled build externalizes fast-decode-uri-component by path (./node_modules/...) because it was only a devDependency, and the path is not shipped — both dist entries fail to load on a consumer install. Declaring it as a runtime dependency makes tsdown externalize it by bare specifier and consumers install it. Also replace the MethodMap import and app.history lookup (both removed in current 2.0 exp; peer range allows >= exp.23) with the app.routes declarations, which have the same shape across the supported range. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
This PR fixes two independent issues that make
@elysia/static@2.0.0-exp.0fail at import time on any consumer install:Reproducible in an empty project with
bun i elysia@2.0.0-exp.42 @elysia/static@2.0.0-exp.0— both the ESM and CJS entries fail the same way.1.
fast-decode-uri-componentis only a devDependencyThe
unbundle: truebuild externalizes it by relative path (./node_modules/fast-decode-uri-component/...) because it isn't a runtime dependency — that path isn't in the published tarball, and consumers never install the package (1.x wasn't affected because the old build inlined it). Moving it todependenciesmakes tsdown externalize it by bare specifier:2. Built against elysia internals removed during the exp series
With issue 1 shimmed away, the ESM entry still fails to link against current exp:
src/index.tsimportsMethodMapfromelysia/constantsand readsapp.history, both removed in current 2.0 exp, while the peer range allows>= 2.0.0-exp.23. Replaced with theapp.routesdeclarations, which have the same{ method, path }shape across the supported range (verified on exp.23 and exp.42):Validation
bun test: 141 pass / 0 fail on this branch (lockfile's exp.23)npm packof this branch installed into a clean project onelysia@2.0.0-exp.42: the plugin now loads and serves files, withfast-decode-uri-componentinstalled automatically as a regular dependency