Skip to content

Commit 243cb40

Browse files
clydindgp1130
authored andcommitted
fix(@angular/pwa): remove @schematics/angular utility deep import usage
Workspace helper utilties are now exported from `@schematics/angular/utility`. The previously used deep imports are not considered part of the public API and may change in any version.
1 parent b07ccfb commit 243cb40

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/angular/pwa/pwa/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
template,
1919
url,
2020
} from '@angular-devkit/schematics';
21-
import { getWorkspace, updateWorkspace } from '@schematics/angular/utility/workspace';
21+
import { readWorkspace, writeWorkspace } from '@schematics/angular/utility';
2222
import { posix } from 'path';
2323
import { Readable, Writable } from 'stream';
2424
import { Schema as PwaOptions } from './schema';
@@ -87,7 +87,7 @@ export default function (options: PwaOptions): Rule {
8787
options.title = options.project;
8888
}
8989

90-
const workspace = await getWorkspace(host);
90+
const workspace = await readWorkspace(host);
9191

9292
if (!options.project) {
9393
throw new SchematicsException('Option "project" is required.');
@@ -158,8 +158,9 @@ export default function (options: PwaOptions): Rule {
158158
// Setup service worker schematic options
159159
const { title, ...swOptions } = options;
160160

161+
await writeWorkspace(host, workspace);
162+
161163
return chain([
162-
updateWorkspace(workspace),
163164
externalSchematic('@schematics/angular', 'service-worker', swOptions),
164165
mergeWith(apply(url('./files/root'), [template({ ...options }), move(sourcePath)])),
165166
mergeWith(

0 commit comments

Comments
 (0)