@angular-devkit/schematics-cli 18.2.0-next.0 → 18.2.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.
package/bin/schematics.js CHANGED
@@ -70,6 +70,9 @@ function parseSchematicName(str) {
70
70
  }
71
71
  return { collection, schematic };
72
72
  }
73
+ function removeLeadingSlash(value) {
74
+ return value[0] === '/' ? value.slice(1) : value;
75
+ }
73
76
  function _listSchematics(workflow, collectionName, logger) {
74
77
  try {
75
78
  const collection = workflow.engine.createCollection(collectionName);
@@ -99,8 +102,10 @@ function _createPromptProvider() {
99
102
  if (!definition.items?.length) {
100
103
  continue;
101
104
  }
102
- const choices = definition.items?.map((item) => {
103
- return typeof item == 'string'
105
+ answers[definition.id] = await (definition.multiselect ? prompts.checkbox : prompts.select)({
106
+ message: definition.message,
107
+ default: definition.default,
108
+ choices: definition.items.map((item) => typeof item == 'string'
104
109
  ? {
105
110
  name: item,
106
111
  value: item,
@@ -108,15 +113,10 @@ function _createPromptProvider() {
108
113
  : {
109
114
  name: item.label,
110
115
  value: item.value,
111
- };
112
- });
113
- answers[definition.id] = await (definition.multiselect ? prompts.checkbox : prompts.select)({
114
- message: definition.message,
115
- default: definition.default,
116
- choices,
116
+ }),
117
117
  });
118
118
  break;
119
- case 'input':
119
+ case 'input': {
120
120
  let finalValue;
121
121
  answers[definition.id] = await prompts.input({
122
122
  message: definition.message,
@@ -156,6 +156,7 @@ function _createPromptProvider() {
156
156
  answers[definition.id] = finalValue;
157
157
  }
158
158
  break;
159
+ }
159
160
  }
160
161
  }
161
162
  return answers;
@@ -260,12 +261,11 @@ async function main({ args, stdout = process.stdout, stderr = process.stderr, })
260
261
  workflow.reporter.subscribe((event) => {
261
262
  nothingDone = false;
262
263
  // Strip leading slash to prevent confusion.
263
- const eventPath = event.path.startsWith('/') ? event.path.slice(1) : event.path;
264
+ const eventPath = removeLeadingSlash(event.path);
264
265
  switch (event.kind) {
265
266
  case 'error':
266
267
  error = true;
267
- const desc = event.description == 'alreadyExist' ? 'already exists' : 'does not exist';
268
- logger.error(`ERROR! ${eventPath} ${desc}.`);
268
+ logger.error(`ERROR! ${eventPath} ${event.description == 'alreadyExist' ? 'already exists' : 'does not exist'}.`);
269
269
  break;
270
270
  case 'update':
271
271
  loggingQueue.push(`${colors.cyan('UPDATE')} ${eventPath} (${event.content.length} bytes)`);
@@ -277,8 +277,7 @@ async function main({ args, stdout = process.stdout, stderr = process.stderr, })
277
277
  loggingQueue.push(`${colors.yellow('DELETE')} ${eventPath}`);
278
278
  break;
279
279
  case 'rename':
280
- const eventToPath = event.to.startsWith('/') ? event.to.slice(1) : event.to;
281
- loggingQueue.push(`${colors.blue('RENAME')} ${eventPath} => ${eventToPath}`);
280
+ loggingQueue.push(`${colors.blue('RENAME')} ${eventPath} => ${removeLeadingSlash(event.to)}`);
282
281
  break;
283
282
  }
284
283
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-devkit/schematics-cli",
3
- "version": "18.2.0-next.0",
3
+ "version": "18.2.0-next.2",
4
4
  "description": "Angular Schematics - CLI",
5
5
  "homepage": "https://github.com/angular/angular-cli",
6
6
  "bin": {
@@ -21,14 +21,14 @@
21
21
  ],
22
22
  "schematics": "./collection.json",
23
23
  "dependencies": {
24
- "@angular-devkit/core": "18.2.0-next.0",
25
- "@angular-devkit/schematics": "18.2.0-next.0",
26
- "@inquirer/prompts": "5.1.2",
24
+ "@angular-devkit/core": "18.2.0-next.2",
25
+ "@angular-devkit/schematics": "18.2.0-next.2",
26
+ "@inquirer/prompts": "5.3.2",
27
27
  "ansi-colors": "4.1.3",
28
28
  "symbol-observable": "4.0.0",
29
29
  "yargs-parser": "21.1.1"
30
30
  },
31
- "packageManager": "yarn@4.3.0",
31
+ "packageManager": "yarn@4.3.1",
32
32
  "repository": {
33
33
  "type": "git",
34
34
  "url": "https://github.com/angular/angular-cli.git"
@@ -20,6 +20,6 @@
20
20
  "devDependencies": {
21
21
  "@types/node": "^18.18.0",
22
22
  "@types/jasmine": "~5.1.0",
23
- "jasmine": "~5.1.0"
23
+ "jasmine": "~5.2.0"
24
24
  }
25
25
  }