@angular-devkit/schematics-cli 18.2.0 → 19.0.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/schematics.js CHANGED
@@ -37,6 +37,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.main = main;
38
38
  // symbol polyfill must go first
39
39
  require("symbol-observable");
40
+ const core_1 = require("@angular-devkit/core");
40
41
  const node_1 = require("@angular-devkit/core/node");
41
42
  const schematics_1 = require("@angular-devkit/schematics");
42
43
  const tools_1 = require("@angular-devkit/schematics/tools");
@@ -105,6 +106,12 @@ function _createPromptProvider() {
105
106
  answers[definition.id] = await (definition.multiselect ? prompts.checkbox : prompts.select)({
106
107
  message: definition.message,
107
108
  default: definition.default,
109
+ validate: (values) => {
110
+ if (!definition.validator) {
111
+ return true;
112
+ }
113
+ return definition.validator(Object.values(values).map(({ value }) => value));
114
+ },
108
115
  choices: definition.items.map((item) => typeof item == 'string'
109
116
  ? {
110
117
  name: item,
@@ -294,6 +301,7 @@ async function main({ args, stdout = process.stdout, stderr = process.stderr, })
294
301
  error = false;
295
302
  }
296
303
  });
304
+ workflow.registry.addPostTransform(core_1.schema.transforms.addUndefinedDefaults);
297
305
  // Show usage of deprecated options
298
306
  workflow.registry.useXDeprecatedProvider((msg) => logger.warn(msg));
299
307
  // Pass the rest of the arguments as the smart default "argv". Then delete it.
package/blank/factory.js CHANGED
@@ -66,7 +66,10 @@ function default_1(options) {
66
66
  (0, schematics_1.mergeWith)(source),
67
67
  (0, schematics_1.move)(options.name),
68
68
  ]);
69
- context.addTask(new tasks_1.NodePackageInstallTask(options.name));
69
+ context.addTask(new tasks_1.NodePackageInstallTask({
70
+ workingDirectory: options.name,
71
+ packageManager: options.packageManager,
72
+ }));
70
73
  }
71
74
  return (0, schematics_1.chain)([
72
75
  (0, schematics_1.mergeWith)(source),
package/blank/schema.d.ts CHANGED
@@ -7,5 +7,19 @@ export interface Schema {
7
7
  * The package name for the new schematic.
8
8
  */
9
9
  name?: string;
10
+ /**
11
+ * The package manager used to install dependencies.
12
+ */
13
+ packageManager?: PackageManager;
10
14
  [property: string]: any;
11
15
  }
16
+ /**
17
+ * The package manager used to install dependencies.
18
+ */
19
+ export declare enum PackageManager {
20
+ Bun = "bun",
21
+ Cnpm = "cnpm",
22
+ Npm = "npm",
23
+ Pnpm = "pnpm",
24
+ Yarn = "yarn"
25
+ }
package/blank/schema.js CHANGED
@@ -2,3 +2,15 @@
2
2
  // THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
3
3
  // CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.PackageManager = void 0;
6
+ /**
7
+ * The package manager used to install dependencies.
8
+ */
9
+ var PackageManager;
10
+ (function (PackageManager) {
11
+ PackageManager["Bun"] = "bun";
12
+ PackageManager["Cnpm"] = "cnpm";
13
+ PackageManager["Npm"] = "npm";
14
+ PackageManager["Pnpm"] = "pnpm";
15
+ PackageManager["Yarn"] = "yarn";
16
+ })(PackageManager || (exports.PackageManager = PackageManager = {}));
package/blank/schema.json CHANGED
@@ -12,6 +12,12 @@
12
12
  "index": 0
13
13
  }
14
14
  },
15
+ "packageManager": {
16
+ "description": "The package manager used to install dependencies.",
17
+ "type": "string",
18
+ "enum": ["npm", "yarn", "pnpm", "cnpm", "bun"],
19
+ "default": "npm"
20
+ },
15
21
  "author": {
16
22
  "type": "string",
17
23
  "description": "Author for the new schematic."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-devkit/schematics-cli",
3
- "version": "18.2.0",
3
+ "version": "19.0.0-next.0",
4
4
  "description": "Angular Schematics - CLI",
5
5
  "homepage": "https://github.com/angular/angular-cli",
6
6
  "bin": {
@@ -21,8 +21,8 @@
21
21
  ],
22
22
  "schematics": "./collection.json",
23
23
  "dependencies": {
24
- "@angular-devkit/core": "18.2.0",
25
- "@angular-devkit/schematics": "18.2.0",
24
+ "@angular-devkit/core": "19.0.0-next.0",
25
+ "@angular-devkit/schematics": "19.0.0-next.0",
26
26
  "@inquirer/prompts": "5.3.8",
27
27
  "ansi-colors": "4.1.3",
28
28
  "symbol-observable": "4.0.0",
@@ -15,7 +15,10 @@ function default_1(options) {
15
15
  const schematicsVersion = require('@angular-devkit/schematics/package.json').version;
16
16
  const coreVersion = require('@angular-devkit/core/package.json').version;
17
17
  return (_, context) => {
18
- context.addTask(new tasks_1.NodePackageInstallTask(options.name));
18
+ context.addTask(new tasks_1.NodePackageInstallTask({
19
+ workingDirectory: options.name,
20
+ packageManager: options.packageManager,
21
+ }));
19
22
  return (0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./files'), [
20
23
  // The `package.json` name is kept to allow renovate to update the dependency versions
21
24
  (0, schematics_1.move)('package.json', 'package.json.template'),
@@ -7,5 +7,19 @@ export interface Schema {
7
7
  * The package name for the new schematic.
8
8
  */
9
9
  name: string;
10
+ /**
11
+ * The package manager used to install dependencies.
12
+ */
13
+ packageManager?: PackageManager;
10
14
  [property: string]: any;
11
15
  }
16
+ /**
17
+ * The package manager used to install dependencies.
18
+ */
19
+ export declare enum PackageManager {
20
+ Bun = "bun",
21
+ Cnpm = "cnpm",
22
+ Npm = "npm",
23
+ Pnpm = "pnpm",
24
+ Yarn = "yarn"
25
+ }
@@ -2,3 +2,15 @@
2
2
  // THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
3
3
  // CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.PackageManager = void 0;
6
+ /**
7
+ * The package manager used to install dependencies.
8
+ */
9
+ var PackageManager;
10
+ (function (PackageManager) {
11
+ PackageManager["Bun"] = "bun";
12
+ PackageManager["Cnpm"] = "cnpm";
13
+ PackageManager["Npm"] = "npm";
14
+ PackageManager["Pnpm"] = "pnpm";
15
+ PackageManager["Yarn"] = "yarn";
16
+ })(PackageManager || (exports.PackageManager = PackageManager = {}));
@@ -11,6 +11,12 @@
11
11
  "author": {
12
12
  "type": "string",
13
13
  "description": "Author for the new schematic."
14
+ },
15
+ "packageManager": {
16
+ "description": "The package manager used to install dependencies.",
17
+ "type": "string",
18
+ "enum": ["npm", "yarn", "pnpm", "cnpm", "bun"],
19
+ "default": "npm"
14
20
  }
15
21
  },
16
22
  "required": ["name"]