Skip to content

Commit

Permalink
refactor(@schematics/angular): remove usage of deprecated `defaultPro…
Browse files Browse the repository at this point in the history
…ject`

This option is deprecated in Angular CLI and will be removed in a future major version.
  • Loading branch information
alan-agius4 authored and dgp1130 committed Mar 21, 2022
1 parent 1376516 commit 4cbfb87
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 10 deletions.
4 changes: 0 additions & 4 deletions packages/schematics/angular/application/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,6 @@ function addAppToWorkspaceFile(
};

return updateWorkspace((workspace) => {
if (workspace.projects.size === 0) {
workspace.extensions.defaultProject = options.name;
}

workspace.projects.add({
name: options.name,
...project,
Expand Down
1 change: 0 additions & 1 deletion packages/schematics/angular/application/index_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ describe('Application Schematic', () => {
.toPromise();
const workspace = JSON.parse(tree.readContent('/angular.json'));
expect(workspace.projects.foo).toBeDefined();
expect(workspace.defaultProject).toBe('foo');
});

it('should set the prefix to app if none is set', async () => {
Expand Down
4 changes: 0 additions & 4 deletions packages/schematics/angular/library/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ function addLibToWorkspaceFile(
projectName: string,
): Rule {
return updateWorkspace((workspace) => {
if (workspace.projects.size === 0) {
workspace.extensions.defaultProject = projectName;
}

workspace.projects.add({
name: projectName,
root: projectRoot,
Expand Down
1 change: 0 additions & 1 deletion packages/schematics/angular/library/index_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ describe('Library Schematic', () => {

const workspace = getJsonFileContent(tree, '/angular.json');
expect(workspace.projects.foo).toBeDefined();
expect(workspace.defaultProject).toBe('foo');
});

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

0 comments on commit 4cbfb87

Please sign in to comment.