Skip to content

Commit 9c3bd1b

Browse files
alan-agius4devversion
authored andcommitted
refactor(localize): remove deprecated name option. (angular#58063)
BREAKING CHANGE: The `name` option in the `ng add @localize` schematic has been removed in favor of the `project` option. PR Close angular#58063
1 parent 681e1ec commit 9c3bd1b

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

packages/localize/schematics/ng-add/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ function addPolyfillToConfig(projectName: string): Rule {
4040
case AngularBuilder.Browser:
4141
case AngularBuilder.BrowserEsbuild:
4242
case AngularBuilder.Application:
43+
case AngularBuilder.BuildApplication:
4344
target.options ??= {};
4445
const value = target.options['polyfills'];
4546
if (typeof value === 'string') {
@@ -77,6 +78,7 @@ function addTypeScriptConfigTypes(projectName: string): Rule {
7778
case AngularBuilder.BrowserEsbuild:
7879
case AngularBuilder.Browser:
7980
case AngularBuilder.Application:
81+
case AngularBuilder.BuildApplication:
8082
const value = target.options?.['tsConfig'];
8183
if (typeof value === 'string') {
8284
tsConfigFiles.add(value);
@@ -147,9 +149,7 @@ function moveToDependencies(host: Tree): Rule | void {
147149
}
148150

149151
export default function (options: Schema): Rule {
150-
// We favor the name option because the project option has a
151-
// smart default which can be populated even when unspecified by the user.
152-
const projectName = options.name ?? options.project;
152+
const projectName = options.project;
153153

154154
if (!projectName) {
155155
throw new SchematicsException('Option "project" is required.');

packages/localize/schematics/ng-add/schema.d.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ export interface Schema {
1111
* The name of the project.
1212
*/
1313
project?: string;
14-
/**
15-
* The name of the project.
16-
* @deprecated use the `project` option instead.
17-
*/
18-
name?: string;
1914
/**
2015
* Will this project use $localize at runtime?
2116
*

packages/localize/schematics/ng-add/schema.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
"$source": "projectName"
1212
}
1313
},
14-
"name": {
15-
"type": "string",
16-
"description": "The name of the project.",
17-
"x-deprecated": "Use the \"project\" option instead."
18-
},
1914
"useAtRuntime": {
2015
"type": "boolean",
2116
"description": "If set then `@angular/localize` is included in the `dependencies` section of `package.json`, rather than `devDependencies`, which is the default.",

0 commit comments

Comments
 (0)