Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/angular/cli/lib/config/workspace-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"packageManager": {
"description": "Specify which package manager tool to use.",
"type": "string",
"enum": ["npm", "yarn", "pnpm", "bun"]
"enum": ["npm", "yarn", "pnpm", "bun", "nub"]
},
"warnings": {
"description": "Control CLI specific console warnings",
Expand Down Expand Up @@ -101,7 +101,7 @@
"packageManager": {
"description": "Specify which package manager tool to use.",
"type": "string",
"enum": ["npm", "yarn", "pnpm", "bun"]
"enum": ["npm", "yarn", "pnpm", "bun", "nub"]
},
"warnings": {
"description": "Control CLI specific console warnings",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,37 @@ export const SUPPORTED_PACKAGE_MANAGERS = {
},
isNotFound: isKnownNotFound,
},
nub: {
// nub is pnpm-CLI-compatible, so its descriptor mirrors pnpm's aside from
// the binary name and the pnpm-v9-format lockfile it writes (`nub.lock`).
binary: 'nub',
lockfiles: ['nub.lock'],
addCommand: 'add',
installCommand: ['install'],
forceFlag: '--force',
saveExactFlag: '--save-exact',
saveTildeFlag: '--save-tilde',
saveDevFlag: '--save-dev',
noLockfileFlag: '--no-lockfile',
ignoreScriptsFlag: '--ignore-scripts',
ignorePeerDependenciesFlag: '--strict-peer-dependencies=false',
configFiles: ['.npmrc'],
getRegistryOptions: (registry: string) => ({ args: ['--registry', registry] }),
versionCommand: ['--version'],
listDependenciesCommand: ['list', '--depth=0', '--json'],
getReleaseAgeConfigCommand: ['config', 'get', 'minimum-release-age'],
getPackageNameCommand: ['pkg', 'get', 'name'],
getManifestCommand: ['view', '--json'],
viewCommandFieldArgFormatter: (fields) => [...fields],
outputParsers: {
listDependencies: parseNpmLikeDependencies,
getRegistryManifest: parseNpmLikeManifest,
getRegistryMetadata: parseNpmLikeMetadata,
getError: parseNpmLikeError,
getReleaseAge: parsePnpmReleaseAge,
},
isNotFound: isKnownNotFound,
},
bun: {
binary: 'bun',
lockfiles: ['bun.lockb', 'bun.lock'],
Expand Down Expand Up @@ -346,6 +377,7 @@ export const SUPPORTED_PACKAGE_MANAGERS = {
*/
export const PACKAGE_MANAGER_PRECEDENCE: readonly PackageManagerName[] = [
'pnpm',
'nub',
'yarn',
'bun',
'npm',
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/create/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const hasPackageManagerArg = args.some((a) => a.startsWith('--package-manager'))
if (!hasPackageManagerArg) {
// Ex: yarn/1.22.18 npm/? node/v16.15.1 linux x64
const packageManager = process.env['npm_config_user_agent']?.split('/')[0];
if (packageManager && ['npm', 'pnpm', 'yarn', 'bun'].includes(packageManager)) {
if (packageManager && ['npm', 'pnpm', 'yarn', 'bun', 'nub'].includes(packageManager)) {
args.push('--package-manager', packageManager);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ const packageManagers: { [name: string]: PackageManagerProfile } = {
installPackage: 'install',
},
},
'nub': {
commands: {
installAll: 'install',
installPackage: 'add',
},
},
};

export class UnknownPackageManagerException extends BaseException {
Expand Down
2 changes: 1 addition & 1 deletion packages/angular_devkit/schematics_cli/blank/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"packageManager": {
"description": "The package manager used to install dependencies.",
"type": "string",
"enum": ["npm", "yarn", "pnpm", "bun"],
"enum": ["npm", "yarn", "pnpm", "bun", "nub"],
"default": "npm"
},
"author": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"packageManager": {
"description": "The package manager used to install dependencies.",
"type": "string",
"enum": ["npm", "yarn", "pnpm", "bun"],
"enum": ["npm", "yarn", "pnpm", "bun", "nub"],
"default": "npm"
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/schematics/angular/ng-new/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"packageManager": {
"description": "The package manager used to install dependencies.",
"type": "string",
"enum": ["npm", "yarn", "pnpm", "bun"]
"enum": ["npm", "yarn", "pnpm", "bun", "nub"]
},
"standalone": {
"description": "Creates an application based upon the standalone API, without NgModules.",
Expand Down
2 changes: 1 addition & 1 deletion packages/schematics/angular/workspace/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"packageManager": {
"description": "The package manager to use for installing dependencies.",
"type": "string",
"enum": ["npm", "yarn", "pnpm", "bun"],
"enum": ["npm", "yarn", "pnpm", "bun", "nub"],
"$default": {
"$source": "packageManager"
}
Expand Down
Loading