Skip to content

Commit 7518b40

Browse files
committed
fix(@angular-devkit/core): remove unimplemented prompt priority
Node.js versions prior to 11 used an unstable sort for arrays with a length greater than 10. This caused the prompt order of a schematic with more than 10 prompts to be inconsistent the the content of the file and the same schematic with several of the prompts removed. Since priorities were never fully implemented and property dependencies will most likely be used at a higher level instead, the underlying elements have been removed with this change. Fixes angular#14402
1 parent 816d23b commit 7518b40

File tree

3 files changed

+0
-5
lines changed

3 files changed

+0
-5
lines changed

etc/api/angular_devkit/core/src/_golden-api.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,6 @@ export interface PromptDefinition {
796796
}>;
797797
message: string;
798798
multiselect?: boolean;
799-
priority: number;
800799
raw?: string | JsonObject;
801800
type: string;
802801
validator?: (value: string) => boolean | string | Promise<boolean | string>;

packages/angular_devkit/core/src/json/schema/interface.ts

-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ export interface PromptDefinition {
100100
type: string;
101101
message: string;
102102
default?: string | string[] | number | boolean | null;
103-
priority: number;
104103
validator?: (value: string) => boolean | string | Promise<boolean | string>;
105104

106105
items?: Array<string | { value: JsonValue, label: string }>;

packages/angular_devkit/core/src/json/schema/registry.ts

-3
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,6 @@ export class CoreSchemaRegistry implements SchemaRegistry {
569569
id: path,
570570
type,
571571
message,
572-
priority: 0,
573572
raw: schema,
574573
items,
575574
multiselect: type === 'list' ? schema.multiselect : false,
@@ -625,8 +624,6 @@ export class CoreSchemaRegistry implements SchemaRegistry {
625624
return of(data);
626625
}
627626

628-
prompts.sort((a, b) => b.priority - a.priority);
629-
630627
return from(provider(prompts)).pipe(
631628
map(answers => {
632629
for (const path in answers) {

0 commit comments

Comments
 (0)