Skip to content

feat(nuxi): recognize nub package manager#1360

Open
colinhacks wants to merge 2 commits into
nuxt:mainfrom
colinhacks:feat/detect-nub
Open

feat(nuxi): recognize nub package manager#1360
colinhacks wants to merge 2 commits into
nuxt:mainfrom
colinhacks:feat/detect-nub

Conversation

@colinhacks

Copy link
Copy Markdown
Contributor

The pms map in nuxi init is typed Record<PackageManagerName, undefined>, so it must list every package manager nypm knows about — the comment there notes it exists to force this file to stay in sync. nypm added nub in 0.6.7 (unjs/nypm#247), so the map is now missing that key.

This adds nub: undefined, which includes nub in packageManagerOptions (selection, validation, and the --packageManager choices). nypm already carries the nub definition, so install and script commands resolve to nub install / nub run.

@colinhacks colinhacks requested a review from danielroe as a code owner July 1, 2026 01:47
Copilot AI review requested due to automatic review settings July 1, 2026 01:47
@pkg-pr-new

pkg-pr-new Bot commented Jul 1, 2026

Copy link
Copy Markdown
  • nuxt-cli-playground

    npm i https://pkg.pr.new/create-nuxt@1360
    
    npm i https://pkg.pr.new/nuxi@1360
    
    npm i https://pkg.pr.new/@nuxt/cli@1360
    

commit: 778c515

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates nuxi init to stay in sync with nypm’s PackageManagerName by adding the newly supported nub package manager to the type-enforced pms map, ensuring it appears in --packageManager validation and interactive selection.

Changes:

  • Add nub: undefined to the pms: Record<PackageManagerName, undefined> map so packageManagerOptions includes nub.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d0b3f0c0-0017-4063-a327-2694f8ddc892

📥 Commits

Reviewing files that changed from the base of the PR and between fd60a74 and 778c515.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • packages/nuxi/package.json
  • packages/nuxt-cli/package.json
✅ Files skipped from review due to trivial changes (1)
  • packages/nuxt-cli/package.json

📝 Walkthrough

Walkthrough

This change adds a nub entry to the pms mapping in the nuxi init command, which changes the supported package manager options derived from that mapping. It also updates the nypm version constraints in packages/nuxi/package.json and packages/nuxt-cli/package.json.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding support for the nub package manager in nuxi.
Description check ✅ Passed The description is directly related to the changeset and explains the nub package manager update in detail.
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

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 `@packages/nuxi/src/commands/init.ts`:
- Line 45: The package manager option key is still using the old name, which
will make init generate an invalid package manager value. Update the
`packageManagerOptions` entry in `init.ts` from `nub` to `aube`, and ensure the
`Record<PackageManagerName, undefined>` keys and any related
`PackageManagerName` usage stay aligned with the new package manager name.
🪄 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: d989b68a-4f70-4e62-9092-1b7cbe744b19

📥 Commits

Reviewing files that changed from the base of the PR and between 49dd7f7 and fd60a74.

📒 Files selected for processing (1)
  • packages/nuxi/src/commands/init.ts

bun: undefined,
deno: undefined,
aube: undefined,
nub: undefined,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Inspect nypm's installed type declarations for the exact package manager literal
fd -HI 'nypm' -t d node_modules | head -5
fd -HI '.d.ts' node_modules/nypm 2>/dev/null | xargs -I{} grep -n "PackageManagerName\|nub\|aube" {} 2>/dev/null

Repository: nuxt/cli

Length of output: 226


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate nypm declaration files and inspect the relevant type definitions.
NPM_ROOT="node_modules/.pnpm/nypm@0.6.7/node_modules/nypm"

echo "== files =="
fd -H -t f . "$NPM_ROOT" | sed -n '1,120p'

echo
echo "== package-manager references =="
rg -n "PackageManagerName|nub|aube|PackageManager" "$NPM_ROOT" || true

echo
echo "== likely type declaration slices =="
for f in $(fd -H -t f '\.d\.ts$' "$NPM_ROOT"); do
  if rg -n "PackageManagerName|nub|aube" "$f" >/dev/null; then
    echo "--- $f ---"
    sed -n '1,220p' "$f"
  fi
done

Repository: nuxt/cli

Length of output: 827


🏁 Script executed:

#!/bin/bash
set -euo pipefail

PKG="node_modules/.pnpm/nypm@0.6.7/node_modules/nypm"

echo "== package.json =="
cat "$PKG/package.json"

echo
echo "== nearby nypm files =="
fd -H -t f 'nypm' node_modules/.pnpm | sed -n '1,200p'

echo
echo "== aube/nub references in the pnpm store =="
rg -n "PackageManagerName|nub|aube" node_modules/.pnpm/nypm@0.6.7 node_modules/.pnpm -g '!**/README.md' -g '!**/LICENSE' || true

Repository: nuxt/cli

Length of output: 1654


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== target file =="
cat -n packages/nuxi/src/commands/init.ts | sed -n '1,140p'

echo
echo "== package manager name definitions/usages =="
rg -n "type PackageManagerName|PackageManagerName|packageManagerOptions|nub: undefined|aube: undefined|packageManager" packages -g '!**/dist/**' || true

echo
echo "== nypm references =="
rg -n "\bnypm\b|\baube\b|\bnub\b" packages -g '!**/dist/**' || true

Repository: nuxt/cli

Length of output: 17743


Use aube here, not nub
nypm 0.6.7 lists the new package manager as aube; packageManagerOptions is derived from these keys, so nub will make --packageManager=nub invalid and can break the Record<PackageManagerName, undefined> check.

🤖 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 `@packages/nuxi/src/commands/init.ts` at line 45, The package manager option
key is still using the old name, which will make init generate an invalid
package manager value. Update the `packageManagerOptions` entry in `init.ts`
from `nub` to `aube`, and ensure the `Record<PackageManagerName, undefined>`
keys and any related `PackageManagerName` usage stay aligned with the new
package manager name.

@codspeed-hq

codspeed-hq Bot commented Jul 1, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing colinhacks:feat/detect-nub (778c515) with main (49dd7f7)

Open in CodSpeed

CI failed typecheck (TS2353) because nypm 0.6.7's PackageManagerName
union doesn't include "nub". nypm 0.6.8 adds it (unjs/nypm#247).
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednypm@​0.6.810010010091100

View full report

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.

2 participants