fix: CSR-173 Portable defineNuxtPlugin imports; cover the module build with a test. - #220
Merged
Conversation
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.
Fixes the
nuxt-module-build buildfailure that blocks the 1.1.0 release (CSR-173):Fix
Import
defineNuxtPluginfrom the portablenuxt/appsubpath instead of the#importsalias in both runtime plugins. With the alias, the d.ts generator can only name the inferred default-export type through anode_modulespath; vianuxt/appthe type is nameable with a proper module specifier. All other auto-imports stay on#imports. Surfaced by the dependency bumps (nuxt 4.5, TS ~5.9, vue-tsc 3).Test coverage
CI runs lint + vitest + e2e but never the module build, so pack-time d.ts failures were invisible until release. New
test/module-build.test.tsexecutes the realnuxt-module-build buildand asserts exit 0, noerror TS*, nomkdist build failed— the builder'sfailOnWarnmakes warnings fail the test too.Verification
npx vitest run test/module-build.test.ts→ green with the fix (build clean, ~7 s).nuxt/app, TS can name the type portably program-wide — so the guard needs the test, not just one clean file.)test/cdn-fetch-paths.test.ts(16 tests) green; lint: 0 errors (5 pre-existing warnings untouched).Drafted with assistance from Claude Code in the loki dev VM.
🤖 Generated with Claude Code
https://claude.ai/code/session_0192LX8MPzDkawiq59dB2yMu