Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f513089

Browse files
feat(@angular/cli): remove direct support for cnpm
This change removes the direct support for cnpm within the Angular CLI. BREAKING CHANGE: The `ng` commands will no longer automatically detect and use `cnpm` as the package manager. As an alternative use the `.npmrc` file to ensure npm uses the cnpm registry.
1 parent e4631e4 commit f513089

File tree

10 files changed

+11
-17
lines changed

10 files changed

+11
-17
lines changed

‎packages/angular/cli/lib/config/workspace-schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"packageManager": {
4848
"description": "Specify which package manager tool to use.",
4949
"type": "string",
50-
"enum": ["npm", "cnpm", "yarn", "pnpm", "bun"]
50+
"enum": ["npm", "yarn", "pnpm", "bun"]
5151
},
5252
"warnings": {
5353
"description": "Control CLI specific console warnings",
@@ -101,7 +101,7 @@
101101
"packageManager": {
102102
"description": "Specify which package manager tool to use.",
103103
"type": "string",
104-
"enum": ["npm", "cnpm", "yarn", "pnpm", "bun"]
104+
"enum": ["npm", "yarn", "pnpm", "bun"]
105105
},
106106
"warnings": {
107107
"description": "Control CLI specific console warnings",

‎packages/angular/cli/src/commands/update/schematic/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"description": "The preferred package manager configuration files to use for registry settings.",
5858
"type": "string",
5959
"default": "npm",
60-
"enum": ["npm", "yarn", "cnpm", "pnpm", "bun"]
60+
"enum": ["npm", "yarn", "pnpm", "bun"]
6161
}
6262
},
6363
"required": []

‎packages/angular/create/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const hasPackageManagerArg = args.some((a) => a.startsWith('--package-manager'))
1717
if (!hasPackageManagerArg) {
1818
// Ex: yarn/1.22.18 npm/? node/v16.15.1 linux x64
1919
const packageManager = process.env['npm_config_user_agent']?.split('/')[0];
20-
if (packageManager && ['npm', 'pnpm', 'yarn', 'cnpm','bun'].includes(packageManager)) {
20+
if (packageManager && ['npm', 'pnpm', 'yarn', 'bun'].includes(packageManager)) {
2121
args.push('--package-manager', packageManager);
2222
}
2323
}

‎packages/angular_devkit/core/src/json/schema/registry_spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,15 @@ describe('CoreSchemaRegistry', () => {
118118

119119
const validator = await registry.compile({
120120
properties: {
121-
packageManager: { type: 'string', enum: ['npm', 'yarn', 'pnpm','cnpm'] },
121+
packageManager: { type: 'string', enum: ['npm', 'yarn', 'pnpm'] },
122122
},
123123
additionalProperties: false,
124124
});
125125

126126
const result = await validator(data);
127127
expect(result.success).toBe(false);
128128
expect(new SchemaValidationException(result.errors).message).toContain(
129-
`Data path "/packageManager" must be equal to one of the allowed values. Allowed values are: "npm", "yarn", "pnpm", "cnpm".`,
129+
`Data path "/packageManager" must be equal to one of the allowed values. Allowed values are: "npm", "yarn", "pnpm".`,
130130
);
131131
});
132132

‎packages/angular_devkit/schematics/tasks/package-manager/executor.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ const packageManagers: { [name: string]: PackageManagerProfile } = {
2727
installPackage: 'install',
2828
},
2929
},
30-
'cnpm': {
31-
commands: {
32-
installAll: 'install',
33-
installPackage: 'install',
34-
},
35-
},
3630
'yarn': {
3731
commands: {
3832
installAll: 'install',

‎packages/angular_devkit/schematics_cli/blank/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"packageManager": {
1616
"description": "The package manager used to install dependencies.",
1717
"type": "string",
18-
"enum": ["npm", "yarn", "pnpm", "cnpm", "bun"],
18+
"enum": ["npm", "yarn", "pnpm", "bun"],
1919
"default": "npm"
2020
},
2121
"author": {

‎packages/angular_devkit/schematics_cli/schematic/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"packageManager": {
1616
"description": "The package manager used to install dependencies.",
1717
"type": "string",
18-
"enum": ["npm", "yarn", "pnpm", "cnpm", "bun"],
18+
"enum": ["npm", "yarn", "pnpm", "bun"],
1919
"default": "npm"
2020
}
2121
},

‎packages/schematics/angular/ng-new/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
"packageManager": {
127127
"description": "The package manager used to install dependencies.",
128128
"type": "string",
129-
"enum": ["npm", "yarn", "pnpm", "cnpm", "bun"]
129+
"enum": ["npm", "yarn", "pnpm", "bun"]
130130
},
131131
"standalone": {
132132
"description": "Creates an application based upon the standalone API, without NgModules.",

‎packages/schematics/angular/workspace/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"packageManager": {
4141
"description": "The package manager to use for installing dependencies.",
4242
"type": "string",
43-
"enum": ["npm", "yarn", "pnpm", "cnpm", "bun"]
43+
"enum": ["npm", "yarn", "pnpm", "bun"]
4444
}
4545
},
4646
"required": ["name", "version"]

‎tests/angular_devkit/core/json/schema/serializers/schema_benchmark.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@
547547
},
548548
"packageManager": {
549549
"description": "Specify which package manager tool to use.",
550-
"enum": ["npm", "cnpm", "yarn", "default"],
550+
"enum": ["npm", "yarn", "default"],
551551
"default": "default",
552552
"type": "string"
553553
},

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /