Skip to content

Commit 4cbfb87

Browse files
alan-agius4dgp1130
authored andcommitted
refactor(@schematics/angular): remove usage of deprecated defaultProject
This option is deprecated in Angular CLI and will be removed in a future major version.
1 parent 1376516 commit 4cbfb87

File tree

4 files changed

+0
-10
lines changed

4 files changed

+0
-10
lines changed

packages/schematics/angular/application/index.ts

-4
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,6 @@ function addAppToWorkspaceFile(
231231
};
232232

233233
return updateWorkspace((workspace) => {
234-
if (workspace.projects.size === 0) {
235-
workspace.extensions.defaultProject = options.name;
236-
}
237-
238234
workspace.projects.add({
239235
name: options.name,
240236
...project,

packages/schematics/angular/application/index_spec.ts

-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ describe('Application Schematic', () => {
8080
.toPromise();
8181
const workspace = JSON.parse(tree.readContent('/angular.json'));
8282
expect(workspace.projects.foo).toBeDefined();
83-
expect(workspace.defaultProject).toBe('foo');
8483
});
8584

8685
it('should set the prefix to app if none is set', async () => {

packages/schematics/angular/library/index.ts

-4
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ function addLibToWorkspaceFile(
8282
projectName: string,
8383
): Rule {
8484
return updateWorkspace((workspace) => {
85-
if (workspace.projects.size === 0) {
86-
workspace.extensions.defaultProject = projectName;
87-
}
88-
8985
workspace.projects.add({
9086
name: projectName,
9187
root: projectRoot,

packages/schematics/angular/library/index_spec.ts

-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ describe('Library Schematic', () => {
131131

132132
const workspace = getJsonFileContent(tree, '/angular.json');
133133
expect(workspace.projects.foo).toBeDefined();
134-
expect(workspace.defaultProject).toBe('foo');
135134
});
136135

137136
it('should set the prefix to lib if none is set', async () => {

0 commit comments

Comments
 (0)