feat(nuxi): recognize nub package manager#1360
Conversation
commit: |
There was a problem hiding this comment.
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: undefinedto thepms: Record<PackageManagerName, undefined>map sopackageManagerOptionsincludesnub.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThis change adds a Estimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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.
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
📒 Files selected for processing (1)
packages/nuxi/src/commands/init.ts
| bun: undefined, | ||
| deno: undefined, | ||
| aube: undefined, | ||
| nub: undefined, |
There was a problem hiding this comment.
🎯 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/nullRepository: 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
doneRepository: 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' || trueRepository: 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/**' || trueRepository: 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.
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).
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
The
pmsmap innuxi initis typedRecord<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 inpackageManagerOptions(selection, validation, and the--packageManagerchoices). nypm already carries the nub definition, so install and script commands resolve tonub install/nub run.