Skip to content

Add npmx module links#2290

Open
Norbiros wants to merge 3 commits into
nuxt:mainfrom
Norbiros:add-npmx-module-links
Open

Add npmx module links#2290
Norbiros wants to merge 3 commits into
nuxt:mainfrom
Norbiros:add-npmx-module-links

Conversation

@Norbiros

Copy link
Copy Markdown

🔗 Linked issue

📚 Description

Adds links to npmx.dev, a better package explorer for npm packages used by a lot of folks in the Nuxt community.

The new links are shown for modules in the module page sidebar and in the module card context menu. I also clarified the existing downloads link and added a separate direct link to npmjs.com.

I also added an npmx link in server/routes/raw/modules.md.get.ts, since npmx may eventually provide nicer package descriptions for LLMs: npmx-dev/npmx.dev#725

@Norbiros Norbiros requested a review from atinux as a code owner June 26, 2026 15:07
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

@Norbiros is attempting to deploy a commit to the Nuxt Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The module item context menu now splits npm-related actions into downloads, npm, and npmx links. The module page sidebar link now points to npmx.dev with a fixed npmx label. The raw module markdown route now includes an npmx link alongside the existing npm link.

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: adding npmx links for modules.
Description check ✅ Passed The description matches the changeset by describing npmx links in the sidebar, context menu, and raw markdown output.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/components/module/ModuleItem.vue`:
- Around line 89-104: The npm-related menu items in ModuleItem.vue are being
built unconditionally even though props.module.npm is optional, which can
produce broken undefined links. Update the menu construction in the ModuleItem
component so the “View downloads”, “View on npm”, and “View on npmx” entries are
only added when props.module.npm is present, matching the gating already used in
app/pages/modules/[slug].vue. Keep the rest of the action menu unchanged and
ensure the conditional logic is applied where the menu items array is assembled.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 52e218db-0529-4b68-8c53-cf3218ee9476

📥 Commits

Reviewing files that changed from the base of the PR and between af4a6db and b4a691a.

📒 Files selected for processing (3)
  • app/components/module/ModuleItem.vue
  • app/pages/modules/[slug].vue
  • server/routes/raw/modules.md.get.ts

Comment thread app/components/module/ModuleItem.vue Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/components/module/ModuleItem.vue`:
- Around line 88-107: The `props.module.npm ? [...] : []` expression in
`ModuleItem.vue` is formatted in a way that violates
`@stylistic/multiline-ternary`. Update the ternary inside the module actions
array so the `?` and `:` branches are split across separate lines, keeping the
same logic for the npm-related action items. Use the existing `props.module.npm`
conditional in the computed/actions block and preserve the three links (`View
downloads`, `View on npm`, `View on npmx`) while reformatting only.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b5a37872-4a66-453a-aa76-33de27d6ad4b

📥 Commits

Reviewing files that changed from the base of the PR and between b4a691a and a452745.

📒 Files selected for processing (1)
  • app/components/module/ModuleItem.vue

Comment on lines +88 to +107
...(props.module.npm ? [
{
label: 'View downloads',
icon: 'i-lucide-package',
to: `https://npm.chart.dev/${props.module.npm}`,
target: '_blank'
},
{
label: 'View on npm',
icon: 'i-simple-icons-npm',
to: `https://www.npmjs.com/package/${props.module.npm}`,
target: '_blank'
},
{
label: 'View on npmx',
icon: 'i-simple-icons-npm',
to: `https://npmx.dev/package/${props.module.npm}`,
target: '_blank'
}
] : [])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix the multiline ternary formatting.

This trips @stylistic/multiline-ternary, so the lint step will fail until the ? / : branches are split across lines.

Suggested fix
-    ...(props.module.npm ? [
+    ...(props.module.npm
+      ? [
       {
         label: 'View downloads',
         icon: 'i-lucide-package',
         to: `https://npm.chart.dev/${props.module.npm}`,
         target: '_blank'
@@
       {
         label: 'View on npmx',
         icon: 'i-simple-icons-npm',
         to: `https://npmx.dev/package/${props.module.npm}`,
         target: '_blank'
       }
-    ] : [])
+      ]
+      : [])
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
...(props.module.npm ? [
{
label: 'View downloads',
icon: 'i-lucide-package',
to: `https://npm.chart.dev/${props.module.npm}`,
target: '_blank'
},
{
label: 'View on npm',
icon: 'i-simple-icons-npm',
to: `https://www.npmjs.com/package/${props.module.npm}`,
target: '_blank'
},
{
label: 'View on npmx',
icon: 'i-simple-icons-npm',
to: `https://npmx.dev/package/${props.module.npm}`,
target: '_blank'
}
] : [])
...(props.module.npm
? [
{
label: 'View downloads',
icon: 'i-lucide-package',
to: `https://npm.chart.dev/${props.module.npm}`,
target: '_blank'
},
{
label: 'View on npm',
icon: 'i-simple-icons-npm',
to: `https://www.npmjs.com/package/${props.module.npm}`,
target: '_blank'
},
{
label: 'View on npmx',
icon: 'i-simple-icons-npm',
to: `https://npmx.dev/package/${props.module.npm}`,
target: '_blank'
}
]
: [])
🧰 Tools
🪛 ESLint

[error] 88-88: Expected newline between test and consequent of ternary expression.

(@stylistic/multiline-ternary)


[error] 88-107: Expected newline between consequent and alternate of ternary expression.

(@stylistic/multiline-ternary)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/components/module/ModuleItem.vue` around lines 88 - 107, The
`props.module.npm ? [...] : []` expression in `ModuleItem.vue` is formatted in a
way that violates `@stylistic/multiline-ternary`. Update the ternary inside the
module actions array so the `?` and `:` branches are split across separate
lines, keeping the same logic for the npm-related action items. Use the existing
`props.module.npm` conditional in the computed/actions block and preserve the
three links (`View downloads`, `View on npm`, `View on npmx`) while reformatting
only.

Source: Linters/SAST tools

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.

1 participant