fix: fix #hints-config alias resolution#292
Conversation
commit: |
📝 WalkthroughWalkthroughThe PR renames the hints config module and file references: "#hints-config" -> "#shared/hints-config" and the filename to "hints-config.mjs". The server-template registration via the old alias is removed (import of addServerTemplate removed) while the hints-config.mjs file is still created via addTemplate. All imports and test mocks referencing the former alias were updated accordingly. No runtime logic or public API signatures were changed. Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/module.ts (1)
1-1:⚠️ Potential issue | 🟠 MajorRemove unused
addServerTemplateimport to unblock CI.Line 1 still imports
addServerTemplate, but it is no longer used and currently triggers the reported lint failure.🧹 Proposed fix
-import { defineNuxtModule, addPlugin, createResolver, addBuildPlugin, addComponent, addServerPlugin, addServerHandler, addTemplate, addServerTemplate } from '@nuxt/kit' +import { defineNuxtModule, addPlugin, createResolver, addBuildPlugin, addComponent, addServerPlugin, addServerHandler, addTemplate } from '@nuxt/kit'🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/module.ts` at line 1, The import list at the top of the module includes an unused symbol addServerTemplate which triggers lint/CI; remove addServerTemplate from the named imports (the import that currently lists defineNuxtModule, addPlugin, createResolver, addBuildPlugin, addComponent, addServerPlugin, addServerHandler, addTemplate, addServerTemplate) so the code only imports the actually used helpers, and run the linter to confirm the unused-import error is resolved.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/module.ts`:
- Line 1: The import list at the top of the module includes an unused symbol
addServerTemplate which triggers lint/CI; remove addServerTemplate from the
named imports (the import that currently lists defineNuxtModule, addPlugin,
createResolver, addBuildPlugin, addComponent, addServerPlugin, addServerHandler,
addTemplate, addServerTemplate) so the code only imports the actually used
helpers, and run the linter to confirm the unused-import error is resolved.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 8b81063a-afaf-4260-98bb-f73ddae08986
📒 Files selected for processing (5)
src/module.tssrc/runtime/core/features.tssrc/runtime/core/plugins/features.client.tstest/unit/core/features.test.tstest/unit/logger.test.ts
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/module.ts (1)
43-47: Add a regression test for Windows alias import encoding.Please add a focused test that validates
#shared/hints-configresolves without malformed percent-encoded paths (especially backslash/#-related cases) so this issue doesn’t regress.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/module.ts` around lines 43 - 47, Add a regression test that boots the module and verifies the alias value nuxt.options.alias['#shared/hints-config'] (the value set from hintsConfig.dst for filename 'hints-config.mjs') resolves to a usable filesystem path without percent-encoding artifacts: assert the alias string does not contain '%' or encoded sequences like '%5C' or '%23', run decodeURIComponent(alias) and assert the decoded path exists (fs.existsSync) and points to the expected file, and ensure imports/resolution using '#shared/hints-config' succeed on Windows-like paths; this ensures the alias is not malformed by percent-encoding/backslash issues.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/module.ts`:
- Around line 43-47: Add a regression test that boots the module and verifies
the alias value nuxt.options.alias['#shared/hints-config'] (the value set from
hintsConfig.dst for filename 'hints-config.mjs') resolves to a usable filesystem
path without percent-encoding artifacts: assert the alias string does not
contain '%' or encoded sequences like '%5C' or '%23', run
decodeURIComponent(alias) and assert the decoded path exists (fs.existsSync) and
points to the expected file, and ensure imports/resolution using
'#shared/hints-config' succeed on Windows-like paths; this ensures the alias is
not malformed by percent-encoding/backslash issues.
🔗 Linked issue
fix #290
📚 Description
Move #hints-config to #shared/hints-config alias and use valid filename for template