Skip to content

feat(init): recognize nub package manager#1360

Merged
danielroe merged 4 commits into
nuxt:mainfrom
colinhacks:feat/detect-nub
Jul 13, 2026
Merged

feat(init): recognize nub package manager#1360
danielroe merged 4 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: a04d82b

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: 1a3d4933-c99b-4d01-a1b2-21610650c101

📥 Commits

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

⛔ 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 as they are similar to previous changes (2)
  • packages/nuxi/package.json
  • 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 init.
Description check ✅ Passed The description is directly related to the changes and explains the nub support update in nuxi init.
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 (a04d82b) with main (df7b72b)

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

socket-security Bot commented Jul 2, 2026

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.810010010089100

View full report

@danielroe danielroe changed the title feat(nuxi): recognize nub package manager feat(init): recognize nub package manager Jul 13, 2026
@danielroe danielroe changed the title feat(init): recognize nub package manager feat(init): recognize nub package manager Jul 13, 2026
@codecov-commenter

codecov-commenter commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@df7b72b). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1360   +/-   ##
=======================================
  Coverage        ?   46.36%           
=======================================
  Files           ?       52           
  Lines           ?     1719           
  Branches        ?      500           
=======================================
  Hits            ?      797           
  Misses          ?      739           
  Partials        ?      183           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@danielroe danielroe merged commit d462685 into nuxt:main Jul 13, 2026
19 of 20 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 13, 2026
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.

4 participants