MCPcopy
hub / github.com/angular/angular-cli / updateWorkspace

Function updateWorkspace

packages/schematics/angular/utility/workspace.ts:58–70  ·  view source on GitHub ↗
(
  updater: (workspace: WorkspaceDefinition) => void | Rule | PromiseLike<void | Rule>,
)

Source from the content-addressed store, hash-verified

56 * workspace. A {@link WorkspaceDefinition} is provided as the first argument to the function.
57 */
58export function updateWorkspace(
59 updater: (workspace: WorkspaceDefinition) => void | Rule | PromiseLike<void | Rule>,
60): Rule {
61 return async (host: Tree) => {
62 const workspace = await getWorkspace(host);
63
64 const result = await updater(workspace);
65
66 await workspaces.writeWorkspace(workspace, new TreeWorkspaceHost(host));
67
68 return result || noop;
69 };
70}
71
72// TODO: This should be renamed `readWorkspace` once deep imports are restricted (already exported from `utility` with that name)
73/**

Callers 15

index.tsFile · 0.90
addLibToWorkspaceFileFunction · 0.90
index.tsFile · 0.90
workspace_spec.tsFile · 0.90
addTailwindStylesFunction · 0.90
addAppToWorkspaceFileFunction · 0.90
migration.tsFile · 0.90
updateProjectsFunction · 0.90
updateProjectsFunction · 0.90

Calls 1

getWorkspaceFunction · 0.70

Tested by

no test coverage detected