Skip to content

feat: add nub package manager detection#7124

Open
colinhacks wants to merge 2 commits into
netlify:mainfrom
colinhacks:add-nub-detection
Open

feat: add nub package manager detection#7124
colinhacks wants to merge 2 commits into
netlify:mainfrom
colinhacks:add-nub-detection

Conversation

@colinhacks

Copy link
Copy Markdown

Adds detection for nub, a package manager whose native lockfile is nub.lock (pnpm-v9-compatible lockfile format).

What changed

  • Registers a nub entry in AVAILABLE_PACKAGE_MANAGERS (@netlify/build-info), mirroring the existing bun entry: installCommand: 'nub install', runCommand: 'nub run', localPackageCommand/remotePackageCommand: 'nubx', lockFiles: ['nub.lock'].
  • Adds NUB to the PkgManager enum and a nub branch to sniffUserAgent.
  • Tests: a nub.lock root-detection case plus the nub user-agent variant in the existing parametrized suite.

Purely additive — no existing package manager's entry or behavior changes.

Verified with npm run build and vitest run in packages/build-info (all green); oxfmt --check and eslint clean on the touched files.

@colinhacks
colinhacks requested a review from a team as a code owner July 8, 2026 03:28
Copilot AI review requested due to automatic review settings July 8, 2026 03:28

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This change adds support for a new package manager called "nub" to the package manager detection utility. It introduces a NUB enum member, adds a corresponding configuration entry with install/run/local/remote commands and lock file mapping, updates user-agent sniffing logic to recognize "nub", and adds test coverage for both user-agent-based and lock-file-based detection.

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

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant detectPackageManager
  participant sniffUserAgent
  participant AVAILABLE_PACKAGE_MANAGERS

  Caller->>detectPackageManager: request package manager detection
  detectPackageManager->>detectPackageManager: check nub.lock file existence
  alt nub.lock found
    detectPackageManager->>AVAILABLE_PACKAGE_MANAGERS: lookup NUB config
    AVAILABLE_PACKAGE_MANAGERS-->>detectPackageManager: return nub config
  else lock file not found
    detectPackageManager->>sniffUserAgent: check npm_config_user_agent
    sniffUserAgent-->>detectPackageManager: return PkgManager.NUB if "nub" present
  end
  detectPackageManager-->>Caller: return nub package manager config
Loading

Related issues: None specified.

Related PRs: None specified.

Suggested labels: enhancement, package-managers

Suggested reviewers: None specified.

🐰 A tiny hop, a lock file found,
"nub" now joins the pack-managed ground,
Enums and configs, snug in a row,
Sniffing agents where npm scripts go,
Another manager for builds to embrace!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely states the main change: adding nub package manager detection.
Description check ✅ Passed The description covers the summary, implementation, tests, and verification; only the issue reference and template extras are missing.
✨ 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.

colinhacks added a commit to colinhacks/workers-sdk that referenced this pull request Jul 15, 2026
…view

- packages/cli/packages.ts: drop the duplicate `case "nub"` left by merging
  main; the file now matches main's version from cloudflare#14499, resolving the
  no-duplicate-case lint error.
- autoconfig: move the nub.lock check into convertDetectedPackageManager,
  with a TODO to remove it once netlify/build#7124 (nub in
  @netlify/build-info) is merged and released.
- changeset: bump the affected packages minor instead of patch.
- tests: cover nub.lock absent and malformed lock file cases in
  workers-utils, and nub detection via detectFramework in autoconfig.
@serhalp serhalp changed the title Add nub package manager detection feat: add nub package manager detection Jul 16, 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.

3 participants