Skip to content

feat: detect nub package manager - #124

Open
colinhacks wants to merge 1 commit into
honojs:mainfrom
colinhacks:feat/detect-nub
Open

feat: detect nub package manager#124
colinhacks wants to merge 1 commit into
honojs:mainfrom
colinhacks:feat/detect-nub

Conversation

@colinhacks

Copy link
Copy Markdown

When invoked through nub, create-hono defaults to npm. It reads the invoking package manager from npm_config_user_agent in getCurrentPackageManager and falls back to npm; nub advertises nub/<version>, so it isn't matched.

nub is a Rust CLI with a pnpm-compatible command grammar. This adds nub to the PackageManager type, the knownPackageManagers map (nub install), and the user-agent detection.

Copilot AI review requested due to automatic review settings July 1, 2026 01:51

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

This PR updates create-hono’s package-manager detection so that when the tool is invoked via nub, it recognizes the npm_config_user_agent prefix (nub/<version>) and defaults dependency installation commands accordingly.

Changes:

  • Extend the PackageManager union type to include nub.
  • Add nub install to the known package manager command map.
  • Detect nub from npm_config_user_agent in getCurrentPackageManager().

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

Comment thread src/hooks/dependencies.ts
type PackageManager = 'npm' | 'bun' | 'deno' | 'pnpm' | 'yarn'
type PackageManager = 'npm' | 'bun' | 'deno' | 'pnpm' | 'yarn' | 'nub'

const knownPackageManagers: { [key: string]: string } = {
Comment thread src/hooks/dependencies.ts
Comment on lines +151 to +153
if (agent.startsWith('nub')) {
return 'nub'
}
@colinhacks

Copy link
Copy Markdown
Author

CI is green on this one — happy to make changes if needed, otherwise flagging it for a look.

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