feat(@angular/cli): add support for the nub package manager#33627
feat(@angular/cli): add support for the nub package manager#33627colinhacks wants to merge 1 commit into
Conversation
Recognize nub (https://nubjs.com) as a supported package manager. nub is pnpm-CLI-compatible and writes a pnpm-v9-format lockfile (nub.lock), so its handling mirrors pnpm throughout. - Add a `nub` descriptor to SUPPORTED_PACKAGE_MANAGERS (cloned from pnpm, with `binary: 'nub'` and `lockfiles: ['nub.lock']`) and to PACKAGE_MANAGER_PRECEDENCE. Lockfile discovery is data-driven off the descriptor, so `nub.lock` is now detected automatically. - Add a `nub` entry to the schematics package-manager executor map (installAll: install, installPackage: add), which previously threw UnknownPackageManagerException for nub. - Add `nub` to the packageManager enum in the workspace, ng-new, and schematics-CLI schemas, and to the user-agent allowlist in the `npm create @angular` shim.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request adds support for a new package manager named nub across the Angular CLI and schematics. The changes include updating various workspace and schematic schemas to include nub in the packageManager enum, defining its descriptor and precedence in the package manager configurations, and adding its execution commands. There are no review comments, so I have no feedback to provide.
PR Checklist
PR Type
What is the current behavior?
The CLI does not recognize nub as a package manager. It is rejected or silently defaulted to npm at every allowlist site: lockfile discovery ignores
nub.lock, the schematics executor throwsUnknownPackageManagerException, and thepackageManagerschema enums plus thenpm create @angularuser-agent allowlist exclude it.Issue Number: N/A
What is the new behavior?
nub is recognized wherever the other package managers are. nub is pnpm-CLI-compatible and writes a pnpm-v9-format lockfile (
nub.lock), so its handling mirrors pnpm throughout.packages/angular/cli/src/package-managers/package-manager-descriptor.ts— adds anubdescriptor toSUPPORTED_PACKAGE_MANAGERS, cloned from the pnpm descriptor withbinary: 'nub'andlockfiles: ['nub.lock'], and addsnubtoPACKAGE_MANAGER_PRECEDENCE. Lockfile discovery (discovery.ts) is data-driven off the descriptor'slockfiles, sonub.lockis now detected automatically — no separate change needed there.packages/angular_devkit/schematics/tasks/package-manager/executor.ts— adds anubentry to the executor map (installAll: 'install',installPackage: 'add'), which previously threwUnknownPackageManagerException.packageManagerschema enums — adds"nub"topackages/schematics/angular/ng-new/schema.json,packages/schematics/angular/workspace/schema.json,packages/angular/cli/lib/config/workspace-schema.json(both occurrences), andpackages/angular_devkit/schematics_cli/{schematic,blank}/schema.json.packages/angular/create/src/index.ts— adds'nub'to the user-agent allowlist in thenpm create @angularshim. nub's user agent isnub/<ver> …, which the shim parses asnubviasplit('/')[0].Does this PR introduce a breaking change?
Other information
The nub descriptor mirrors pnpm because nub implements the pnpm CLI grammar and lockfile format; no nub-specific parsing was required. A signed Google CLA is still pending on my side.