-
-
Notifications
You must be signed in to change notification settings - Fork 501
refactor: virtuals and constants naming consistency #3707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: virtuals and constants naming consistency #3707
Conversation
WalkthroughThis change standardizes module and import paths by replacing dots with hyphens in i18n-related filenames and updates all references accordingly. Several composable constant names are shortened and unified. The logger module and related aliases are removed. No logic or control flow is altered, only naming and import path conventions. Changes
Sequence Diagram(s)sequenceDiagram
participant SourceFile
participant Constants
participant BuildModule
participant InternalModule
SourceFile->>Constants: Import new composable constant (e.g., DEFINE_I18N_ROUTE_FN)
SourceFile->>BuildModule: Import from '#build/i18n-options.mjs'
BuildModule->>InternalModule: Resource replacement '#build/<resource>' → '#internal/<resource>'
Suggested labels
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/runtime/server/utils/messages.ts (1)
1-15
: Guard against missing locale loaders
localeLoaders[locale]
may beundefined
for a mis-configured or dynamic locale; passing that intogetLocaleMessagesMerged
will crash. Add a check before the call:- return { [locale]: await getLocaleMessagesMerged(locale, localeLoaders[locale]) } + const loader = localeLoaders[locale] + if (!loader) { + throw new Error(`No message loader registered for locale "${locale}"`) + } + return { [locale]: await getLocaleMessagesMerged(locale, loader) }src/runtime/shared/vue-i18n.ts (1)
2-3
: Drop leading underscore on aliased importThe underscore convention signals “unused”, yet the variable is used below. Import it without the underscore for clarity:
-import { vueI18nConfigs, localeCodes as _localeCodes } from '#build/i18n-options.mjs' +import { vueI18nConfigs, localeCodes } from '#build/i18n-options.mjs' ... - for (const locale of _localeCodes) { + for (const locale of localeCodes) {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (22)
internals.d.ts
(3 hunks)src/constants.ts
(1 hunks)src/nitro.ts
(5 hunks)src/pages.ts
(3 hunks)src/prepare/auto-imports.ts
(2 hunks)src/prepare/runtime.ts
(1 hunks)src/runtime/context.ts
(1 hunks)src/runtime/plugins/dev.ts
(1 hunks)src/runtime/plugins/i18n.ts
(1 hunks)src/runtime/plugins/preload.ts
(1 hunks)src/runtime/server/plugin.ts
(1 hunks)src/runtime/server/type-generation.ts
(1 hunks)src/runtime/server/utils/locale-detector.ts
(1 hunks)src/runtime/server/utils/messages.ts
(1 hunks)src/runtime/shared/detection.ts
(1 hunks)src/runtime/shared/domain.ts
(1 hunks)src/runtime/shared/locales.ts
(1 hunks)src/runtime/shared/vue-i18n.ts
(1 hunks)src/transform/heist.ts
(2 hunks)src/transform/macros.ts
(1 hunks)src/transform/resource.ts
(2 hunks)vitest.config.test.ts
(1 hunks)
🧰 Additional context used
🧠 Learnings (17)
src/runtime/shared/detection.ts (4)
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
src/runtime/plugins/dev.ts (5)
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3584
File: src/runtime/server/context.ts:1-4
Timestamp: 2025-05-04T11:52:41.396Z
Learning: In Nuxt applications, `$fetch` is globally available and doesn't need to be explicitly imported.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
src/prepare/runtime.ts (4)
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
src/runtime/plugins/preload.ts (5)
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3584
File: src/runtime/server/context.ts:1-4
Timestamp: 2025-05-04T11:52:41.396Z
Learning: In Nuxt applications, `$fetch` is globally available and doesn't need to be explicitly imported.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
src/runtime/shared/locales.ts (4)
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
src/transform/macros.ts (2)
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
src/runtime/shared/vue-i18n.ts (4)
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
src/runtime/server/plugin.ts (3)
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3584
File: src/runtime/server/context.ts:1-4
Timestamp: 2025-05-04T11:52:41.396Z
Learning: In Nuxt applications, `$fetch` is globally available and doesn't need to be explicitly imported.
src/runtime/plugins/i18n.ts (5)
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3584
File: src/runtime/server/context.ts:1-4
Timestamp: 2025-05-04T11:52:41.396Z
Learning: In Nuxt applications, `$fetch` is globally available and doesn't need to be explicitly imported.
src/runtime/server/utils/locale-detector.ts (3)
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3584
File: src/runtime/server/context.ts:1-4
Timestamp: 2025-05-04T11:52:41.396Z
Learning: In Nuxt applications, `$fetch` is globally available and doesn't need to be explicitly imported.
src/transform/resource.ts (4)
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
src/prepare/auto-imports.ts (5)
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3584
File: src/runtime/server/context.ts:1-4
Timestamp: 2025-05-04T11:52:41.396Z
Learning: In Nuxt applications, `$fetch` is globally available and doesn't need to be explicitly imported.
src/runtime/context.ts (3)
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3584
File: src/runtime/server/context.ts:1-4
Timestamp: 2025-05-04T11:52:41.396Z
Learning: In Nuxt applications, `$fetch` is globally available and doesn't need to be explicitly imported.
src/pages.ts (4)
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
src/nitro.ts (5)
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3584
File: src/runtime/server/context.ts:1-4
Timestamp: 2025-05-04T11:52:41.396Z
Learning: In Nuxt applications, `$fetch` is globally available and doesn't need to be explicitly imported.
src/constants.ts (4)
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
internals.d.ts (4)
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In the nuxt-modules/i18n package, `_nuxtI18nCtx.setLocale` is a synchronous function that accepts a string locale parameter and returns void. It doesn't need to be awaited when called.
Learnt from: BobbieGoede
PR: nuxt-modules/i18n#3587
File: src/runtime/plugins/route-locale-detect.ts:24-31
Timestamp: 2025-05-05T20:42:02.900Z
Learning: In nuxt-modules/i18n's route detection, the `detectLocale` function returns a string representing the locale code, not an object. This string can be passed directly to `ctx.setLocale`.
🧬 Code Graph Analysis (5)
src/transform/macros.ts (1)
src/constants.ts (1)
DEFINE_I18N_ROUTE_FN
(89-89)
src/transform/resource.ts (1)
src/constants.ts (2)
DEFINE_I18N_LOCALE_FN
(90-90)DEFINE_I18N_CONFIG_FN
(91-91)
src/prepare/auto-imports.ts (1)
src/constants.ts (3)
DEFINE_I18N_ROUTE_FN
(89-89)DEFINE_I18N_LOCALE_FN
(90-90)DEFINE_I18N_CONFIG_FN
(91-91)
src/pages.ts (1)
src/constants.ts (1)
DEFINE_I18N_ROUTE_FN
(89-89)
src/nitro.ts (1)
src/constants.ts (3)
DEFINE_I18N_LOCALE_FN
(90-90)DEFINE_I18N_CONFIG_FN
(91-91)DEFINE_LOCALE_DETECTOR_FN
(92-92)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: test (lts/*, ubuntu-latest)
- GitHub Check: test (lts/*, windows-latest)
🔇 Additional comments (22)
src/runtime/plugins/dev.ts (1)
1-1
: Confirm new virtual-module alias is wired up
#build/i18n-options.mjs
will only resolve if the build step now emits that file/alias. Run a quick build‐prepare to ensure the rename was propagated; otherwise the module resolver will throw at runtime.pnpm dev:prepare && rg -n "#build/i18n-options.mjs" . # expect hits in .nuxt/distsrc/runtime/shared/detection.ts (1)
3-3
: Make sure the renamed virtual file is emitted for both client & server
normalizedLocales
is referenced in browser-only branches (navigator
detector). Verify that the build pipeline outputs the virtual module to both bundles:rg -n "normalizedLocales" .nuxt # should return at least one client-side filesrc/runtime/context.ts (1)
4-4
: Compilation sanity-check for the new#build/i18n-options.mjs
pathRun a full build or
nuxi prepare
to ensure the alias change doesn’t break module resolution here as well.src/runtime/shared/locales.ts (1)
1-1
: LGTM: Consistent naming convention applied.The import path update from
#build/i18n.options.mjs
to#build/i18n-options.mjs
follows the standardized naming pattern established in this refactoring.src/runtime/shared/domain.ts (1)
2-2
: LGTM: Import path standardization applied consistently.The import path update maintains consistency with the naming convention changes across the codebase.
src/runtime/server/type-generation.ts (1)
2-2
: LGTM: Internal module path standardization.The import path update from
#internal/i18n/options.mjs
to#internal/i18n-options.mjs
correctly applies the hyphenated naming convention to internal modules.vitest.config.test.ts (1)
12-12
: LGTM: Test configuration updated to match new module names.The alias configuration correctly reflects the renamed module path, ensuring tests can resolve the updated import paths.
src/runtime/server/plugin.ts (1)
12-12
: ```shell
#!/bin/bashDescription: Re-check for any remaining old module path references without relying on rg’s built-in types
echo "Verifying no remaining old module path references..."
Search across TS, JS, and Vue files for old build and internal module paths
rg -g '.{ts,js,vue}' '#build/i18n.options.mjs'
rg -g '.{ts,js,vue}' '#internal/i18n/options.mjs'
rg -g '*.{ts,js,vue}' '#internal/i18n/locale.detector.mjs'echo "Verification complete. Any results above indicate outdated imports that need updating."
</details> <details> <summary>src/runtime/plugins/preload.ts (1)</summary> `4-4`: **LGTM! Import path updated consistently with refactoring.** The import path change from `#build/i18n.options.mjs` to `#build/i18n-options.mjs` aligns with the standardization of module paths using hyphens instead of dots. </details> <details> <summary>src/runtime/plugins/i18n.ts (1)</summary> `4-4`: **LGTM! Import path updated consistently with refactoring.** The import path change from `#build/i18n.options.mjs` to `#build/i18n-options.mjs` maintains consistency with the module path standardization across the codebase. </details> <details> <summary>src/prepare/runtime.ts (1)</summary> `47-47`: **LGTM! Filename updated to use hardcoded string after constant removal.** The change from using `NUXT_I18N_TEMPLATE_OPTIONS_KEY` to the hardcoded string `'i18n-options.mjs'` is consistent with the constant removal and the new hyphenated naming convention. </details> <details> <summary>src/runtime/server/utils/locale-detector.ts (2)</summary> `3-3`: **LGTM! Internal module path updated consistently.** The import path change from `#internal/i18n/locale.detector.mjs` to `#internal/i18n-locale-detector.mjs` follows the standardized naming convention. --- `7-7`: **LGTM! Internal module path updated consistently.** The import path change from `#internal/i18n/options.mjs` to `#internal/i18n-options.mjs` aligns with the module path standardization across the codebase. </details> <details> <summary>src/transform/macros.ts (2)</summary> `13-13`: **LGTM! Constant import updated with shortened name.** The import change from `NUXT_I18N_COMPOSABLE_DEFINE_ROUTE` to `DEFINE_I18N_ROUTE_FN` follows the pattern of shortening composable constant names while maintaining the same functionality. --- `17-17`: **LGTM! Regular expression updated to use new constant.** The regex now correctly uses the new constant `DEFINE_I18N_ROUTE_FN`, maintaining the same functionality with the renamed constant. </details> <details> <summary>src/transform/resource.ts (1)</summary> `4-4`: **LGTM! Consistent constant renaming applied correctly.** The refactoring from `NUXT_I18N_COMPOSABLE_*` to `DEFINE_I18N_*_FN` naming pattern improves readability and consistency. The import and usage are correctly updated. Also applies to: 21-21 </details> <details> <summary>src/prepare/auto-imports.ts (1)</summary> `1-1`: **LGTM! Auto-imports updated with consistent constant naming.** The constant renaming is properly applied throughout the auto-imports configuration, maintaining functionality while improving consistency. Also applies to: 30-32 </details> <details> <summary>src/pages.ts (1)</summary> `10-10`: **LGTM! Consistent constant renaming in page analysis logic.** The `DEFINE_I18N_ROUTE_FN` constant is properly imported and used throughout the component parsing logic. The refactoring maintains all functionality while improving naming consistency. Also applies to: 389-389, 402-402 </details> <details> <summary>src/transform/heist.ts (1)</summary> `20-20`: **Excellent refactoring! Improved maintainability and path consistency.** The changes accomplish two improvements: 1. **Path normalization**: Updates from dotted (`i18n.options.mjs`) to hyphenated (`i18n-options.mjs`) naming for consistency 2. **Code maintainability**: Replaces individual `replaceAll` calls with a maintainable loop approach This makes future resource additions easier and ensures consistent path handling. Also applies to: 43-45 </details> <details> <summary>src/nitro.ts (1)</summary> `14-16`: ```shell #!/bin/bash # Verify the constant definition and its usages across the codebase # Show the definition in src/constants.ts rg -n "DEFINE_I18N_CONFIG_FN" -C2 src/constants.ts # Search for literal occurrences of both casings in strings rg -n "'defineI18NConfig'" . rg -n "'defineI18nConfig'" . # Search for usage in code (unquoted) rg -n defineI18NConfig . rg -n defineI18nConfig .
internals.d.ts (1)
1-1
: LGTM! Consistent module naming standardization.The module path changes from dots to hyphens create better naming consistency across internal modules. The standardized naming convention improves readability and maintainability.
Also applies to: 13-13, 23-23
src/constants.ts (1)
89-92
: LGTM! Improved constant naming consistency.The shortened constant names with consistent
_FN
suffix are more concise and clearly indicate these represent function names. The removal of the redundantNUXT_I18N_COMPOSABLE_
prefix improves readability while maintaining clarity.
🔗 Linked issue
📚 Description
Summary by CodeRabbit