fix(angular): handle different workspace version and format when falling back to the angular cli (#8993)
This commit is contained in:
parent
a86f5d8b1c
commit
1cae869ff0
@ -103,6 +103,7 @@ export function initLocal(workspace: Workspace) {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
require('@nrwl/tao/src/compat/compat');
|
||||||
loadCli(workspace, '@angular/cli/lib/init.js');
|
loadCli(workspace, '@angular/cli/lib/init.js');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,12 +58,12 @@ if (!patched) {
|
|||||||
`@angular-devkit/core/src/workspace/json/reader`,
|
`@angular-devkit/core/src/workspace/json/reader`,
|
||||||
]);
|
]);
|
||||||
const originalReadJsonWorkspace = readJsonUtils.readJsonWorkspace;
|
const originalReadJsonWorkspace = readJsonUtils.readJsonWorkspace;
|
||||||
readJsonUtils.readJsonWorkspace = (
|
readJsonUtils.readJsonWorkspace = async (
|
||||||
path,
|
path,
|
||||||
host: { readFile: (p) => Promise<string> }
|
host: { readFile: (p) => Promise<string> }
|
||||||
) => {
|
) => {
|
||||||
try {
|
try {
|
||||||
return originalReadJsonWorkspace(path, host);
|
return await originalReadJsonWorkspace(path, host);
|
||||||
} catch {
|
} catch {
|
||||||
logger.debug(
|
logger.debug(
|
||||||
'[NX] Angular devkit readJsonWorkspace fell back to Nx workspaces logic'
|
'[NX] Angular devkit readJsonWorkspace fell back to Nx workspaces logic'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user