Skip to content

Commit 57b1981

Browse files
author
Angular Builds
committed
75bf115 build: update angular
1 parent a5ebaf5 commit 57b1981

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed

bin/schematics.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ function parseSchematicName(str) {
7070
}
7171
return { collection, schematic };
7272
}
73+
function removeLeadingSlash(value) {
74+
return value[0] === '/' ? value.slice(1) : value;
75+
}
7376
function _listSchematics(workflow, collectionName, logger) {
7477
try {
7578
const collection = workflow.engine.createCollection(collectionName);
@@ -99,24 +102,21 @@ function _createPromptProvider() {
99102
if (!definition.items?.length) {
100103
continue;
101104
}
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'
104109
? {
105110
name: item,
106111
value: item,
107112
}
108113
: {
109114
name: item.label,
110115
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+
}),
117117
});
118118
break;
119-
case 'input':
119+
case 'input': {
120120
let finalValue;
121121
answers[definition.id] = await prompts.input({
122122
message: definition.message,
@@ -156,6 +156,7 @@ function _createPromptProvider() {
156156
answers[definition.id] = finalValue;
157157
}
158158
break;
159+
}
159160
}
160161
}
161162
return answers;
@@ -260,12 +261,11 @@ async function main({ args, stdout = process.stdout, stderr = process.stderr, })
260261
workflow.reporter.subscribe((event) => {
261262
nothingDone = false;
262263
// Strip leading slash to prevent confusion.
263-
const eventPath = event.path.startsWith('/') ? event.path.slice(1) : event.path;
264+
const eventPath = removeLeadingSlash(event.path);
264265
switch (event.kind) {
265266
case 'error':
266267
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'}.`);
269269
break;
270270
case 'update':
271271
loggingQueue.push(`${colors.cyan('UPDATE')} ${eventPath} (${event.content.length} bytes)`);
@@ -277,8 +277,7 @@ async function main({ args, stdout = process.stdout, stderr = process.stderr, })
277277
loggingQueue.push(`${colors.yellow('DELETE')} ${eventPath}`);
278278
break;
279279
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)}`);
282281
break;
283282
}
284283
});

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular-devkit/schematics-cli",
3-
"version": "18.2.0-next.0+sha-0f5af7a",
3+
"version": "18.2.0-next.0+sha-75bf115",
44
"description": "Angular Schematics - CLI",
55
"homepage": "https://github.com/angular/angular-cli",
66
"bin": {
@@ -21,8 +21,8 @@
2121
],
2222
"schematics": "./collection.json",
2323
"dependencies": {
24-
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#0f5af7a",
25-
"@angular-devkit/schematics": "github:angular/angular-devkit-schematics-builds#0f5af7a",
24+
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#75bf115",
25+
"@angular-devkit/schematics": "github:angular/angular-devkit-schematics-builds#75bf115",
2626
"@inquirer/prompts": "5.1.2",
2727
"ansi-colors": "4.1.3",
2828
"symbol-observable": "4.0.0",

uniqueId

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Wed Jul 10 2024 15:14:46 GMT+0000 (Coordinated Universal Time)
1+
Thu Jul 11 2024 06:25:19 GMT+0000 (Coordinated Universal Time)

0 commit comments

Comments
 (0)