@angular/cli 18.1.0-next.1 → 18.1.0-next.2

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.
Files changed (130) hide show
  1. package/bin/bootstrap.js +1 -1
  2. package/bin/ng.js +1 -1
  3. package/lib/cli/index.d.ts +1 -1
  4. package/lib/cli/index.js +6 -6
  5. package/lib/config/schema.json +1 -1
  6. package/lib/config/workspace-schema.d.ts +1 -1
  7. package/lib/init.d.ts +1 -1
  8. package/lib/init.js +1 -1
  9. package/package.json +23 -14
  10. package/src/analytics/analytics-collector.d.ts +1 -1
  11. package/src/analytics/analytics-collector.js +1 -1
  12. package/src/analytics/analytics-parameters.d.ts +1 -1
  13. package/src/analytics/analytics-parameters.js +1 -1
  14. package/src/analytics/analytics.d.ts +1 -1
  15. package/src/analytics/analytics.js +1 -1
  16. package/src/command-builder/architect-base-command-module.d.ts +1 -1
  17. package/src/command-builder/architect-base-command-module.js +1 -1
  18. package/src/command-builder/architect-command-module.d.ts +1 -1
  19. package/src/command-builder/architect-command-module.js +1 -1
  20. package/src/command-builder/command-module.d.ts +1 -1
  21. package/src/command-builder/command-module.js +1 -1
  22. package/src/command-builder/command-runner.d.ts +1 -1
  23. package/src/command-builder/command-runner.js +1 -1
  24. package/src/command-builder/schematics-command-module.d.ts +1 -1
  25. package/src/command-builder/schematics-command-module.js +88 -51
  26. package/src/command-builder/utilities/command.d.ts +1 -1
  27. package/src/command-builder/utilities/command.js +1 -1
  28. package/src/command-builder/utilities/json-help.d.ts +1 -1
  29. package/src/command-builder/utilities/json-help.js +1 -1
  30. package/src/command-builder/utilities/json-schema.d.ts +1 -1
  31. package/src/command-builder/utilities/json-schema.js +1 -1
  32. package/src/command-builder/utilities/normalize-options-middleware.d.ts +1 -1
  33. package/src/command-builder/utilities/normalize-options-middleware.js +1 -1
  34. package/src/command-builder/utilities/schematic-engine-host.d.ts +1 -1
  35. package/src/command-builder/utilities/schematic-engine-host.js +1 -1
  36. package/src/command-builder/utilities/schematic-workflow.d.ts +1 -1
  37. package/src/command-builder/utilities/schematic-workflow.js +1 -1
  38. package/src/commands/add/cli.d.ts +1 -1
  39. package/src/commands/add/cli.js +1 -1
  40. package/src/commands/analytics/cli.d.ts +1 -1
  41. package/src/commands/analytics/cli.js +1 -1
  42. package/src/commands/analytics/info/cli.d.ts +1 -1
  43. package/src/commands/analytics/info/cli.js +1 -1
  44. package/src/commands/analytics/settings/cli.d.ts +1 -1
  45. package/src/commands/analytics/settings/cli.js +1 -1
  46. package/src/commands/build/cli.d.ts +1 -1
  47. package/src/commands/build/cli.js +1 -1
  48. package/src/commands/cache/clean/cli.d.ts +1 -1
  49. package/src/commands/cache/clean/cli.js +1 -1
  50. package/src/commands/cache/cli.d.ts +1 -1
  51. package/src/commands/cache/cli.js +1 -1
  52. package/src/commands/cache/info/cli.d.ts +1 -1
  53. package/src/commands/cache/info/cli.js +1 -1
  54. package/src/commands/cache/settings/cli.d.ts +1 -1
  55. package/src/commands/cache/settings/cli.js +1 -1
  56. package/src/commands/cache/utilities.d.ts +1 -1
  57. package/src/commands/cache/utilities.js +1 -1
  58. package/src/commands/command-config.d.ts +1 -1
  59. package/src/commands/command-config.js +1 -1
  60. package/src/commands/completion/cli.d.ts +1 -1
  61. package/src/commands/completion/cli.js +1 -1
  62. package/src/commands/config/cli.d.ts +1 -1
  63. package/src/commands/config/cli.js +1 -1
  64. package/src/commands/deploy/cli.d.ts +1 -1
  65. package/src/commands/deploy/cli.js +1 -1
  66. package/src/commands/e2e/cli.d.ts +1 -1
  67. package/src/commands/e2e/cli.js +1 -1
  68. package/src/commands/extract-i18n/cli.d.ts +1 -1
  69. package/src/commands/extract-i18n/cli.js +1 -1
  70. package/src/commands/generate/cli.d.ts +1 -1
  71. package/src/commands/generate/cli.js +1 -1
  72. package/src/commands/lint/cli.d.ts +1 -1
  73. package/src/commands/lint/cli.js +1 -1
  74. package/src/commands/make-this-awesome/cli.d.ts +1 -1
  75. package/src/commands/make-this-awesome/cli.js +1 -1
  76. package/src/commands/new/cli.d.ts +1 -1
  77. package/src/commands/new/cli.js +1 -1
  78. package/src/commands/run/cli.d.ts +1 -1
  79. package/src/commands/run/cli.js +1 -1
  80. package/src/commands/serve/cli.d.ts +1 -1
  81. package/src/commands/serve/cli.js +1 -1
  82. package/src/commands/test/cli.d.ts +1 -1
  83. package/src/commands/test/cli.js +1 -1
  84. package/src/commands/update/cli.d.ts +2 -1
  85. package/src/commands/update/cli.js +4 -3
  86. package/src/commands/update/schematic/index.d.ts +1 -1
  87. package/src/commands/update/schematic/index.js +1 -1
  88. package/src/commands/version/cli.d.ts +1 -1
  89. package/src/commands/version/cli.js +1 -1
  90. package/src/typings-bazel.d.ts +1 -1
  91. package/src/typings.d.ts +1 -1
  92. package/src/typings.js +1 -1
  93. package/src/utilities/color.d.ts +1 -2
  94. package/src/utilities/color.js +1 -7
  95. package/src/utilities/completion.d.ts +1 -1
  96. package/src/utilities/completion.js +1 -1
  97. package/src/utilities/config.d.ts +1 -1
  98. package/src/utilities/config.js +1 -1
  99. package/src/utilities/environment-options.d.ts +1 -1
  100. package/src/utilities/environment-options.js +1 -1
  101. package/src/utilities/eol.d.ts +1 -1
  102. package/src/utilities/eol.js +1 -1
  103. package/src/utilities/error.d.ts +1 -1
  104. package/src/utilities/error.js +1 -1
  105. package/src/utilities/find-up.d.ts +1 -1
  106. package/src/utilities/find-up.js +1 -1
  107. package/src/utilities/json-file.d.ts +1 -1
  108. package/src/utilities/json-file.js +1 -1
  109. package/src/utilities/load-esm.d.ts +1 -1
  110. package/src/utilities/load-esm.js +1 -1
  111. package/src/utilities/log-file.d.ts +1 -1
  112. package/src/utilities/log-file.js +1 -1
  113. package/src/utilities/memoize.d.ts +1 -1
  114. package/src/utilities/memoize.js +1 -1
  115. package/src/utilities/package-manager.d.ts +1 -1
  116. package/src/utilities/package-manager.js +1 -1
  117. package/src/utilities/package-metadata.d.ts +1 -1
  118. package/src/utilities/package-metadata.js +1 -1
  119. package/src/utilities/package-tree.d.ts +1 -1
  120. package/src/utilities/package-tree.js +1 -1
  121. package/src/utilities/project.d.ts +1 -1
  122. package/src/utilities/project.js +1 -1
  123. package/src/utilities/prompt.d.ts +9 -4
  124. package/src/utilities/prompt.js +45 -26
  125. package/src/utilities/spinner.d.ts +1 -1
  126. package/src/utilities/spinner.js +1 -1
  127. package/src/utilities/tty.d.ts +1 -1
  128. package/src/utilities/tty.js +1 -1
  129. package/src/utilities/version.d.ts +1 -1
  130. package/src/utilities/version.js +2 -2
package/bin/bootstrap.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
6
+ * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
 
9
9
  /**
package/bin/ng.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
7
+ * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
9
 
10
10
  /* eslint-disable no-console */
@@ -3,7 +3,7 @@
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
6
+ * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  export { VERSION } from '../../src/utilities/version';
9
9
  export default function (options: {
package/lib/cli/index.js CHANGED
@@ -4,13 +4,13 @@
4
4
  * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
7
+ * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.VERSION = void 0;
11
11
  exports.default = default_1;
12
12
  const core_1 = require("@angular-devkit/core");
13
- const util_1 = require("util");
13
+ const node_util_1 = require("node:util");
14
14
  const command_module_1 = require("../../src/command-builder/command-module");
15
15
  const command_runner_1 = require("../../src/command-builder/command-runner");
16
16
  const color_1 = require("../../src/utilities/color");
@@ -44,7 +44,7 @@ async function default_1(options) {
44
44
  if (!environment_options_1.ngDebug && entry.level === 'debug') {
45
45
  return;
46
46
  }
47
- const color = color_1.colors.enabled ? colorLevels[entry.level] : color_1.removeColor;
47
+ const color = color_1.colors.enabled ? colorLevels[entry.level] : node_util_1.stripVTControlCharacters;
48
48
  const message = color(entry.message);
49
49
  switch (entry.level) {
50
50
  case 'warn':
@@ -59,13 +59,13 @@ async function default_1(options) {
59
59
  });
60
60
  // Redirect console to logger
61
61
  console.info = console.log = function (...args) {
62
- logger.info((0, util_1.format)(...args));
62
+ logger.info((0, node_util_1.format)(...args));
63
63
  };
64
64
  console.warn = function (...args) {
65
- logger.warn((0, util_1.format)(...args));
65
+ logger.warn((0, node_util_1.format)(...args));
66
66
  };
67
67
  console.error = function (...args) {
68
- logger.error((0, util_1.format)(...args));
68
+ logger.error((0, node_util_1.format)(...args));
69
69
  };
70
70
  try {
71
71
  return await (0, command_runner_1.runCommand)(options.cliArgs, logger);
@@ -1628,7 +1628,7 @@
1628
1628
  "default": false
1629
1629
  },
1630
1630
  "strict": {
1631
- "description": "Creates a workspace with stricter type checking and stricter bundle budgets settings. This setting helps improve maintainability and catch bugs ahead of time. For more information, see https://angular.io/guide/strict-mode",
1631
+ "description": "Creates a workspace with stricter type checking and stricter bundle budgets settings. This setting helps improve maintainability and catch bugs ahead of time. For more information, see https://angular.dev/tools/cli/template-typecheck#strict-mode",
1632
1632
  "type": "boolean",
1633
1633
  "default": true
1634
1634
  },
@@ -599,7 +599,7 @@ export interface AngularNgNewOptionsSchema {
599
599
  /**
600
600
  * Creates a workspace with stricter type checking and stricter bundle budgets settings.
601
601
  * This setting helps improve maintainability and catch bugs ahead of time. For more
602
- * information, see https://angular.io/guide/strict-mode
602
+ * information, see https://angular.dev/tools/cli/template-typecheck#strict-mode
603
603
  */
604
604
  strict?: boolean;
605
605
  /**
package/lib/init.d.ts CHANGED
@@ -3,6 +3,6 @@
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
6
+ * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import 'symbol-observable';
package/lib/init.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
7
+ * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
10
  if (k2 === undefined) k2 = k;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/cli",
3
- "version": "18.1.0-next.1",
3
+ "version": "18.1.0-next.2",
4
4
  "description": "CLI tool for Angular",
5
5
  "main": "lib/cli/index.js",
6
6
  "bin": {
@@ -25,14 +25,14 @@
25
25
  },
26
26
  "homepage": "https://github.com/angular/angular-cli",
27
27
  "dependencies": {
28
- "@angular-devkit/architect": "0.1801.0-next.1",
29
- "@angular-devkit/core": "18.1.0-next.1",
30
- "@angular-devkit/schematics": "18.1.0-next.1",
31
- "@schematics/angular": "18.1.0-next.1",
28
+ "@angular-devkit/architect": "0.1801.0-next.2",
29
+ "@angular-devkit/core": "18.1.0-next.2",
30
+ "@angular-devkit/schematics": "18.1.0-next.2",
31
+ "@inquirer/prompts": "5.0.5",
32
+ "@schematics/angular": "18.1.0-next.2",
32
33
  "@yarnpkg/lockfile": "1.1.0",
33
34
  "ansi-colors": "4.1.3",
34
35
  "ini": "4.1.3",
35
- "inquirer": "9.2.23",
36
36
  "jsonc-parser": "3.2.1",
37
37
  "npm-package-arg": "11.0.2",
38
38
  "npm-pick-manifest": "9.0.1",
@@ -46,19 +46,28 @@
46
46
  "ng-update": {
47
47
  "migrations": "@schematics/angular/migrations/migration-collection.json",
48
48
  "packageGroup": {
49
- "@angular/cli": "18.1.0-next.1",
50
- "@angular/build": "18.1.0-next.1",
51
- "@angular/ssr": "18.1.0-next.1",
52
- "@angular-devkit/architect": "0.1801.0-next.1",
53
- "@angular-devkit/build-angular": "18.1.0-next.1",
54
- "@angular-devkit/build-webpack": "0.1801.0-next.1",
55
- "@angular-devkit/core": "18.1.0-next.1",
56
- "@angular-devkit/schematics": "18.1.0-next.1"
49
+ "@angular/cli": "18.1.0-next.2",
50
+ "@angular/build": "18.1.0-next.2",
51
+ "@angular/ssr": "18.1.0-next.2",
52
+ "@angular-devkit/architect": "0.1801.0-next.2",
53
+ "@angular-devkit/build-angular": "18.1.0-next.2",
54
+ "@angular-devkit/build-webpack": "0.1801.0-next.2",
55
+ "@angular-devkit/core": "18.1.0-next.2",
56
+ "@angular-devkit/schematics": "18.1.0-next.2"
57
57
  }
58
58
  },
59
+ "packageManager": "yarn@4.2.2",
59
60
  "engines": {
60
61
  "node": "^18.19.1 || ^20.11.1 || >=22.0.0",
61
62
  "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
62
63
  "yarn": ">= 1.13.0"
64
+ },
65
+ "dependenciesMeta": {
66
+ "esbuild": {
67
+ "built": true
68
+ },
69
+ "puppeteer": {
70
+ "built": true
71
+ }
63
72
  }
64
73
  }
@@ -3,7 +3,7 @@
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
6
+ * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import type { CommandContext } from '../command-builder/command-module';
9
9
  import { EventCustomDimension, EventCustomMetric, PrimitiveTypes } from './analytics-parameters';
@@ -4,7 +4,7 @@
4
4
  * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
7
+ * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
10
  if (k2 === undefined) k2 = k;
@@ -3,7 +3,7 @@
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
6
+ * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  /** Any changes in this file needs to be done in the mts version. */
9
9
  export type PrimitiveTypes = string | number | boolean;
@@ -4,7 +4,7 @@
4
4
  * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
7
+ * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.EventCustomMetric = exports.EventCustomDimension = exports.UserCustomDimension = exports.RequestParameter = void 0;
@@ -3,7 +3,7 @@
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
6
+ * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import type { CommandContext } from '../command-builder/command-module';
9
9
  /**
@@ -4,7 +4,7 @@
4
4
  * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
7
+ * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.analyticsPackageSafelist = void 0;
@@ -3,7 +3,7 @@
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
6
+ * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { Architect, Target } from '@angular-devkit/architect';
9
9
  import { WorkspaceNodeModulesArchitectHost } from '@angular-devkit/architect/node';
@@ -4,7 +4,7 @@
4
4
  * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
7
+ * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
10
  if (k2 === undefined) k2 = k;
@@ -3,7 +3,7 @@
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
6
+ * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { Argv } from 'yargs';
9
9
  import { ArchitectBaseCommandModule } from './architect-base-command-module';
@@ -4,7 +4,7 @@
4
4
  * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
7
+ * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
9
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
10
10
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -3,7 +3,7 @@
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
6
+ * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { logging } from '@angular-devkit/core';
9
9
  import { ArgumentsCamelCase, Argv, CamelCaseKey, CommandModule as YargsCommandModule } from 'yargs';
@@ -4,7 +4,7 @@
4
4
  * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
7
+ * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
10
  if (k2 === undefined) k2 = k;
@@ -3,7 +3,7 @@
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
6
+ * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { logging } from '@angular-devkit/core';
9
9
  export declare function runCommand(args: string[], logger: logging.Logger): Promise<number>;
@@ -4,7 +4,7 @@
4
4
  * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
7
+ * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
9
  var __importDefault = (this && this.__importDefault) || function (mod) {
10
10
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -3,7 +3,7 @@
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
6
+ * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { Collection } from '@angular-devkit/schematics';
9
9
  import { FileSystemCollectionDescription, FileSystemSchematicDescription, NodeWorkflow } from '@angular-devkit/schematics/tools';
@@ -4,14 +4,37 @@
4
4
  * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
7
+ * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
16
+ }) : (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ o[k2] = m[k];
19
+ }));
20
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
22
+ }) : function(o, v) {
23
+ o["default"] = v;
24
+ });
9
25
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
10
26
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
11
27
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
12
28
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
13
29
  return c > 3 && r && Object.defineProperty(target, key, r), r;
14
30
  };
31
+ var __importStar = (this && this.__importStar) || function (mod) {
32
+ if (mod && mod.__esModule) return mod;
33
+ var result = {};
34
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
35
+ __setModuleDefault(result, mod);
36
+ return result;
37
+ };
15
38
  var __metadata = (this && this.__metadata) || function (k, v) {
16
39
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
17
40
  };
@@ -25,7 +48,6 @@ const analytics_1 = require("../analytics/analytics");
25
48
  const analytics_parameters_1 = require("../analytics/analytics-parameters");
26
49
  const config_1 = require("../utilities/config");
27
50
  const error_1 = require("../utilities/error");
28
- const load_esm_1 = require("../utilities/load-esm");
29
51
  const memoize_1 = require("../utilities/memoize");
30
52
  const tty_1 = require("../utilities/tty");
31
53
  const command_module_1 = require("./command-module");
@@ -124,70 +146,85 @@ class SchematicsCommandModule extends command_module_1.CommandModule {
124
146
  });
125
147
  if (options.interactive !== false && (0, tty_1.isTTY)()) {
126
148
  workflow.registry.usePromptProvider(async (definitions) => {
127
- const questions = definitions
128
- .filter((definition) => !options.defaults || definition.default === undefined)
129
- .map((definition) => {
130
- const question = {
131
- name: definition.id,
132
- message: definition.message,
133
- default: definition.default,
134
- };
135
- const validator = definition.validator;
136
- if (validator) {
137
- question.validate = (input) => validator(input);
138
- // Filter allows transformation of the value prior to validation
139
- question.filter = async (input) => {
140
- for (const type of definition.propertyTypes) {
141
- let value;
142
- switch (type) {
143
- case 'string':
144
- value = String(input);
145
- break;
146
- case 'integer':
147
- case 'number':
148
- value = Number(input);
149
- break;
150
- default:
151
- value = input;
152
- break;
153
- }
154
- // Can be a string if validation fails
155
- const isValid = (await validator(value)) === true;
156
- if (isValid) {
157
- return value;
158
- }
159
- }
160
- return input;
161
- };
149
+ let prompts;
150
+ const answers = {};
151
+ for (const definition of definitions) {
152
+ if (options.defaults && definition.default !== undefined) {
153
+ continue;
162
154
  }
155
+ // Only load prompt package if needed
156
+ prompts ??= await Promise.resolve().then(() => __importStar(require('@inquirer/prompts')));
163
157
  switch (definition.type) {
164
158
  case 'confirmation':
165
- question.type = 'confirm';
159
+ answers[definition.id] = await prompts.confirm({
160
+ message: definition.message,
161
+ default: definition.default,
162
+ });
166
163
  break;
167
164
  case 'list':
168
- question.type = definition.multiselect ? 'checkbox' : 'list';
169
- question.choices = definition.items?.map((item) => {
165
+ if (!definition.items?.length) {
166
+ continue;
167
+ }
168
+ const choices = definition.items?.map((item) => {
170
169
  return typeof item == 'string'
171
- ? item
170
+ ? {
171
+ name: item,
172
+ value: item,
173
+ }
172
174
  : {
173
175
  name: item.label,
174
176
  value: item.value,
175
177
  };
176
178
  });
179
+ answers[definition.id] = await (definition.multiselect ? prompts.checkbox : prompts.select)({
180
+ message: definition.message,
181
+ default: definition.default,
182
+ choices,
183
+ });
177
184
  break;
178
- default:
179
- question.type = definition.type;
185
+ case 'input':
186
+ let finalValue;
187
+ answers[definition.id] = await prompts.input({
188
+ message: definition.message,
189
+ default: definition.default,
190
+ async validate(value) {
191
+ if (definition.validator === undefined) {
192
+ return true;
193
+ }
194
+ let lastValidation = false;
195
+ for (const type of definition.propertyTypes) {
196
+ let potential;
197
+ switch (type) {
198
+ case 'string':
199
+ potential = String(value);
200
+ break;
201
+ case 'integer':
202
+ case 'number':
203
+ potential = Number(value);
204
+ break;
205
+ default:
206
+ potential = value;
207
+ break;
208
+ }
209
+ lastValidation = await definition.validator(potential);
210
+ // Can be a string if validation fails
211
+ if (lastValidation === true) {
212
+ finalValue = potential;
213
+ return true;
214
+ }
215
+ }
216
+ return lastValidation;
217
+ },
218
+ });
219
+ // Use validated value if present.
220
+ // This ensures the correct type is inserted into the final schema options.
221
+ if (finalValue !== undefined) {
222
+ answers[definition.id] = finalValue;
223
+ }
180
224
  break;
181
225
  }
182
- return question;
183
- });
184
- if (questions.length) {
185
- const { default: inquirer } = await (0, load_esm_1.loadEsmModule)('inquirer');
186
- return inquirer.prompt(questions);
187
- }
188
- else {
189
- return {};
190
226
  }
227
+ return answers;
191
228
  });
192
229
  }
193
230
  return workflow;
@@ -3,7 +3,7 @@
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
6
+ * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { Argv } from 'yargs';
9
9
  import { CommandContext, CommandModule, CommandModuleImplementation } from '../command-module';
@@ -4,7 +4,7 @@
4
4
  * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
7
+ * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.demandCommandFailureMessage = void 0;
@@ -3,7 +3,7 @@
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
6
+ * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  interface JsonHelpOption {
9
9
  name: string;
@@ -4,7 +4,7 @@
4
4
  * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
7
+ * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
9
  var __importDefault = (this && this.__importDefault) || function (mod) {
10
10
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -3,7 +3,7 @@
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
6
+ * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { json } from '@angular-devkit/core';
9
9
  import yargs from 'yargs';
@@ -4,7 +4,7 @@
4
4
  * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
7
+ * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.parseJsonSchemaToOptions = parseJsonSchemaToOptions;
@@ -3,7 +3,7 @@
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
6
+ * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import * as yargs from 'yargs';
9
9
  /**
@@ -4,7 +4,7 @@
4
4
  * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
7
+ * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
10
  if (k2 === undefined) k2 = k;
@@ -3,7 +3,7 @@
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
6
+ * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { RuleFactory } from '@angular-devkit/schematics';
9
9
  import { FileSystemCollectionDesc, NodeModulesEngineHost } from '@angular-devkit/schematics/tools';
@@ -4,7 +4,7 @@
4
4
  * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
7
+ * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.SchematicEngineHost = void 0;
@@ -3,7 +3,7 @@
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
6
+ * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { logging } from '@angular-devkit/core';
9
9
  import { NodeWorkflow } from '@angular-devkit/schematics/tools';
@@ -4,7 +4,7 @@
4
4
  * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
7
+ * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.subscribeToWorkflow = subscribeToWorkflow;