Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(@angular/cli): include deprecated option in JSON help #19135

Merged
merged 1 commit into from Oct 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/angular/cli/models/interface.ts
Expand Up @@ -153,6 +153,12 @@ export interface Option {
* If this is falsey, do not report this option.
*/
userAnalytics?: number;

/**
* Deprecation. If this flag is not false a warning will be shown on the console. Either `true`
* or a string to show the user as a notice.
*/
deprecated?: boolean | string;
}

/**
Expand Down
6 changes: 6 additions & 0 deletions packages/angular/cli/utilities/json-schema.ts
Expand Up @@ -251,6 +251,11 @@ export async function parseJsonSchemaToOptions(
const xUserAnalytics = current['x-user-analytics'];
const userAnalytics = typeof xUserAnalytics == 'number' ? xUserAnalytics : undefined;

// Deprecated is set only if it's true or a string.
const xDeprecated = current['x-deprecated'];
const deprecated = (xDeprecated === true || typeof xDeprecated === 'string')
? xDeprecated : undefined;

const option: Option = {
name,
description: '' + (current.description === undefined ? '' : current.description),
Expand All @@ -262,6 +267,7 @@ export async function parseJsonSchemaToOptions(
...format !== undefined ? { format } : {},
hidden,
...userAnalytics ? { userAnalytics } : {},
...deprecated !== undefined ? { deprecated } : {},
...positional !== undefined ? { positional } : {},
};

Expand Down