Skip to content

fix: fix #hints-config alias resolution#292

Merged
huang-julien merged 2 commits intomainfrom
fix/hintsconfigresolution
Mar 18, 2026
Merged

fix: fix #hints-config alias resolution#292
huang-julien merged 2 commits intomainfrom
fix/hintsconfigresolution

Conversation

@huang-julien
Copy link
Member

🔗 Linked issue

fix #290

📚 Description

Move #hints-config to #shared/hints-config alias and use valid filename for template

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 18, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/hints@292

commit: c310ba4

@coderabbitai
Copy link

coderabbitai bot commented Mar 18, 2026

📝 Walkthrough

Walkthrough

The 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)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: fixing the #hints-config alias resolution issue, which is the primary focus of all modifications across multiple files.
Description check ✅ Passed The description directly relates to the changeset by explaining the movement of the alias and the use of a valid filename, and references the linked issue #290.
Linked Issues check ✅ Passed The PR directly addresses issue #290 by updating the #hints-config alias to #shared/hints-config and using a valid template filename to resolve Windows path resolution failures.
Out of Scope Changes check ✅ Passed All code changes are directly related to resolving the alias issue: updating import paths in module.ts, features.ts, plugins, and test files to use the new #shared/hints-config alias.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/hintsconfigresolution
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 | 🟠 Major

Remove unused addServerTemplate import 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

📥 Commits

Reviewing files that changed from the base of the PR and between d97e097 and 19bb43b.

📒 Files selected for processing (5)
  • src/module.ts
  • src/runtime/core/features.ts
  • src/runtime/core/plugins/features.client.ts
  • test/unit/core/features.test.ts
  • test/unit/logger.test.ts

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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-config resolves 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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a389bc2f-13d5-4277-a9b5-b12a03fc8c1c

📥 Commits

Reviewing files that changed from the base of the PR and between 19bb43b and c310ba4.

📒 Files selected for processing (1)
  • src/module.ts

@huang-julien huang-julien merged commit 6d1f5c0 into main Mar 18, 2026
7 checks passed
@huang-julien huang-julien deleted the fix/hintsconfigresolution branch March 18, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

#hints-config fails to resolve on Windows

1 participant