From ffd40af446be5e5e5f7f086983a5701614ea43d6 Mon Sep 17 00:00:00 2001 From: Victor Savkin Date: Fri, 18 Nov 2022 11:19:58 -0500 Subject: [PATCH] chore(repo): use root-level scripts --- .circleci/config.yml | 14 +- .prettierignore | 2 + CONTRIBUTING.md | 2 +- docs/generated/devkit/index.md | 1001 ++++++++++++------------ docs/generated/devkit/ngcli_adapter.md | 53 +- docs/generated/packages/devkit.json | 4 +- nx.json | 13 +- package.json | 16 +- scripts/check-versions.ts | 196 ----- 9 files changed, 544 insertions(+), 757 deletions(-) delete mode 100644 scripts/check-versions.ts diff --git a/.circleci/config.yml b/.circleci/config.yml index d23c0e24ab44b..207ba2b94678c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -176,7 +176,7 @@ jobs: - run: npx nx-cloud start-ci-run --stop-agents-after="e2e" - run: name: Check Documentation - command: npx nx-cloud record yarn documentation + command: npx nx documentation --no-dte no_output_timeout: 20m - run: name: Run Checks/Lint/Test/Build @@ -184,12 +184,12 @@ jobs: command: | pids=() - (npx nx-cloud record yarn check-imports && - npx nx-cloud record yarn nx format:check --base=$NX_BASE --head=$NX_HEAD && - npx nx-cloud record yarn check-commit && - npx nx-cloud record yarn check-lock-files && - npx nx-cloud record yarn nx workspace-lint && - npx nx-cloud record yarn depcheck) & + (npx nx check-imports --no-dte && + npx nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD && + npx nx check-commit --no-dte && + npx nx check-lock-files --no-dte && + npx nx lint --no-dte && + npx nx depcheck --no-dte ) & pids+=($!) yarn nx affected --target=lint --base=$NX_BASE --head=$NX_HEAD --parallel=3 & diff --git a/.prettierignore b/.prettierignore index 362be4fe7bb56..1880e92cfbd3e 100644 --- a/.prettierignore +++ b/.prettierignore @@ -14,6 +14,8 @@ packages/react/src/schematics/**/files/**/*.json packages/jest/src/schematics/**/files/**/*.json packages/**/schematics/**/files/**/*.html packages/**/generators/**/files/**/*.html +nx-dev/nx-dev/.next/ +docs/generated/ /.vscode /.idea /.github diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3bee0e37ad18e..bc7086f008326 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -250,7 +250,7 @@ Please follow the following guidelines: - Debug with `node --inspect-brk ./node_modules/jest/bin/jest.js build/packages/angular/src/utils/ast-utils.spec.js` - Make sure e2e tests pass (this can take a while, so you can always let CI check those) (`nx affected --target=e2e`) - Target a specific e2e test with `nx e2e e2e-cypress` -- Make sure you run `yarn format` +- Make sure you run `nx format` - Update documentation with `yarn documentation`. For documentation, check for spelling and grammatical errors. - Update your commit message to follow the guidelines below (use `yarn commit` to automate compliance) - `yarn check-commit` will check to make sure your commit messages are formatted correctly diff --git a/docs/generated/devkit/index.md b/docs/generated/devkit/index.md index e3955dd9d3fff..86e69ce1064ae 100644 --- a/docs/generated/devkit/index.md +++ b/docs/generated/devkit/index.md @@ -204,7 +204,7 @@ It only uses language primitives and immutable objects • **DependencyType**: `Object` ---- +___ ## Utils Enumerations @@ -218,7 +218,7 @@ It only uses language primitives and immutable objects • **ProjectGraphBuilder**: `Object` ---- +___ ## Utils Classes @@ -226,7 +226,7 @@ It only uses language primitives and immutable objects • **Hasher**: `Object` ---- +___ ## Workspace Classes @@ -240,7 +240,7 @@ It only uses language primitives and immutable objects • **Target**: `Object` ---- +___ ## Other Interfaces @@ -250,7 +250,7 @@ It only uses language primitives and immutable objects A plugin for Nx ---- +___ ## Project Graph Interfaces @@ -258,13 +258,13 @@ A plugin for Nx • **FileData**: `Object` ---- +___ ### ProjectFileMap • **ProjectFileMap**: `Object` ---- +___ ### ProjectGraph @@ -272,29 +272,29 @@ A plugin for Nx #### Type parameters -| Name | Type | -| :--- | :---- | -| `T` | `any` | +| Name | Type | +| :------ | :------ | +| `T` | `any` | ---- +___ ### ProjectGraphDependency • **ProjectGraphDependency**: `Object` ---- +___ ### ProjectGraphExternalNode • **ProjectGraphExternalNode**: `Object` ---- +___ ### ProjectGraphProcessorContext • **ProjectGraphProcessorContext**: `Object` ---- +___ ### ProjectGraphProjectNode @@ -302,11 +302,11 @@ A plugin for Nx #### Type parameters -| Name | Type | -| :--- | :---- | -| `T` | `any` | +| Name | Type | +| :------ | :------ | +| `T` | `any` | ---- +___ ### ProjectGraphV4 @@ -314,11 +314,11 @@ A plugin for Nx #### Type parameters -| Name | Type | -| :--- | :---- | -| `T` | `any` | +| Name | Type | +| :------ | :------ | +| `T` | `any` | ---- +___ ## Tree Interfaces @@ -326,13 +326,13 @@ A plugin for Nx • **FileChange**: `Object` ---- +___ ### Tree • **Tree**: `Object` ---- +___ ## Utils Interfaces @@ -340,55 +340,55 @@ A plugin for Nx • **DefaultTasksRunnerOptions**: `Object` ---- +___ ### Hash • **Hash**: `Object` ---- +___ ### JsonParseOptions • **JsonParseOptions**: `Object` ---- +___ ### JsonSerializeOptions • **JsonSerializeOptions**: `Object` ---- +___ ### ModuleFederationConfig • **ModuleFederationConfig**: `Object` ---- +___ ### RemoteCache • **RemoteCache**: `Object` ---- +___ ### SharedLibraryConfig • **SharedLibraryConfig**: `Object` ---- +___ ### StringDeletion • **StringDeletion**: `Object` ---- +___ ### StringInsertion • **StringInsertion**: `Object` ---- +___ ## Workspace Interfaces @@ -396,25 +396,25 @@ A plugin for Nx • **ExecutorContext**: `Object` ---- +___ ### ExecutorsJson • **ExecutorsJson**: `Object` ---- +___ ### GeneratorsJson • **GeneratorsJson**: `Object` ---- +___ ### HasherContext • **HasherContext**: `Object` ---- +___ ### ImplicitJsonSubsetDependency @@ -422,23 +422,23 @@ A plugin for Nx #### Type parameters -| Name | Type | -| :--- | :------------------ | -| `T` | `"*"` \| `string`[] | +| Name | Type | +| :------ | :------ | +| `T` | ``"*"`` \| `string`[] | ---- +___ ### MigrationsJson • **MigrationsJson**: `Object` ---- +___ ### NxAffectedConfig • **NxAffectedConfig**: `Object` ---- +___ ### NxJsonConfiguration @@ -446,23 +446,23 @@ A plugin for Nx #### Type parameters -| Name | Type | -| :--- | :------------------ | -| `T` | `"*"` \| `string`[] | +| Name | Type | +| :------ | :------ | +| `T` | ``"*"`` \| `string`[] | ---- +___ ### ProjectConfiguration • **ProjectConfiguration**: `Object` ---- +___ ### ProjectsConfigurations • **ProjectsConfigurations**: `Object` ---- +___ ### TargetConfiguration @@ -470,29 +470,29 @@ A plugin for Nx #### Type parameters -| Name | Type | -| :--- | :---- | -| `T` | `any` | +| Name | Type | +| :------ | :------ | +| `T` | `any` | ---- +___ ### TargetDependencyConfig • **TargetDependencyConfig**: `Object` ---- +___ ### Task • **Task**: `Object` ---- +___ ### TaskGraph • **TaskGraph**: `Object` ---- +___ ### Workspace @@ -502,9 +502,9 @@ A plugin for Nx ### WorkspaceConfiguration -Ƭ **WorkspaceConfiguration**: `Omit`<[`ProjectsConfigurations`](../../devkit/index#projectsconfigurations), `"projects"`\> & `Partial`<[`NxJsonConfiguration`](../../devkit/index#nxjsonconfiguration)\> +Ƭ **WorkspaceConfiguration**: `Omit`<[`ProjectsConfigurations`](../../devkit/index#projectsconfigurations), ``"projects"``\> & `Partial`<[`NxJsonConfiguration`](../../devkit/index#nxjsonconfiguration)\> ---- +___ ## Other Type aliases @@ -518,23 +518,23 @@ A plugin for Nx ##### Parameters -| Name | Type | -| :----- | :------- | +| Name | Type | +| :------ | :------ | | `file` | `string` | ##### Returns `Record`<`string`, [`TargetConfiguration`](../../devkit/index#targetconfiguration)\> ---- +___ ## Package Manager Type aliases ### PackageManager -Ƭ **PackageManager**: `"yarn"` \| `"pnpm"` \| `"npm"` +Ƭ **PackageManager**: ``"yarn"`` \| ``"pnpm"`` \| ``"npm"`` ---- +___ ## Project Graph Type aliases @@ -544,19 +544,19 @@ A plugin for Nx #### Type parameters -| Name | Type | -| :--- | :---- | -| `T` | `any` | +| Name | Type | +| :------ | :------ | +| `T` | `any` | ---- +___ ## Utils Type aliases ### AdditionalSharedConfig -Ƭ **AdditionalSharedConfig**: (`string` \| [libraryName: string, sharedConfig: SharedLibraryConfig] \| { `libraryName`: `string` ; `sharedConfig`: [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig) })[] +Ƭ **AdditionalSharedConfig**: (`string` \| [libraryName: string, sharedConfig: SharedLibraryConfig] \| { `libraryName`: `string` ; `sharedConfig`: [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig) })[] ---- +___ ### ModuleFederationLibrary @@ -564,39 +564,39 @@ A plugin for Nx #### Type declaration -| Name | Type | -| :----- | :------- | +| Name | Type | +| :------ | :------ | | `name` | `string` | | `type` | `string` | ---- +___ ### Remotes Ƭ **Remotes**: `string`[] \| [remoteName: string, remoteUrl: string][] ---- +___ ### SharedFunction -Ƭ **SharedFunction**: (`libraryName`: `string`, `sharedConfig`: [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)) => `undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig) +Ƭ **SharedFunction**: (`libraryName`: `string`, `sharedConfig`: [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)) => `undefined` \| ``false`` \| [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig) #### Type declaration -▸ (`libraryName`, `sharedConfig`): `undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig) +▸ (`libraryName`, `sharedConfig`): `undefined` \| ``false`` \| [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig) ##### Parameters -| Name | Type | -| :------------- | :-------------------------------------------------------------- | -| `libraryName` | `string` | +| Name | Type | +| :------ | :------ | +| `libraryName` | `string` | | `sharedConfig` | [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig) | ##### Returns -`undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig) +`undefined` \| ``false`` \| [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig) ---- +___ ### SharedWorkspaceLibraryConfig @@ -604,19 +604,19 @@ A plugin for Nx #### Type declaration -| Name | Type | -| :--------------------- | :------------------------------------------------------------------------------------------------------------ | -| `getAliases` | () => `Record`<`string`, `string`\> | -| `getLibraries` | (`eager?`: `boolean`) => `Record`<`string`, [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)\> | -| `getReplacementPlugin` | () => `NormalModuleReplacementPlugin` | +| Name | Type | +| :------ | :------ | +| `getAliases` | () => `Record`<`string`, `string`\> | +| `getLibraries` | (`eager?`: `boolean`) => `Record`<`string`, [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)\> | +| `getReplacementPlugin` | () => `NormalModuleReplacementPlugin` | ---- +___ ### StringChange Ƭ **StringChange**: [`StringInsertion`](../../devkit/index#stringinsertion) \| [`StringDeletion`](../../devkit/index#stringdeletion) ---- +___ ### WorkspaceLibrary @@ -624,13 +624,13 @@ A plugin for Nx #### Type declaration -| Name | Type | -| :---------- | :---------------------- | +| Name | Type | +| :------ | :------ | | `importKey` | `string` \| `undefined` | -| `name` | `string` | -| `root` | `string` | +| `name` | `string` | +| `root` | `string` | ---- +___ ### WorkspaceLibrarySecondaryEntryPoint @@ -638,12 +638,12 @@ A plugin for Nx #### Type declaration -| Name | Type | -| :----- | :------- | +| Name | Type | +| :------ | :------ | | `name` | `string` | | `path` | `string` | ---- +___ ## Workspace Type aliases @@ -657,16 +657,16 @@ A plugin for Nx ##### Parameters -| Name | Type | -| :-------- | :-------------------------------------------------- | -| `task` | [`Task`](../../devkit/index#task) | +| Name | Type | +| :------ | :------ | +| `task` | [`Task`](../../devkit/index#task) | | `context` | [`HasherContext`](../../devkit/index#hashercontext) | ##### Returns `Promise`<[`Hash`](../../devkit/index#hash)\> ---- +___ ### Executor @@ -674,9 +674,9 @@ A plugin for Nx #### Type parameters -| Name | Type | -| :--- | :---- | -| `T` | `any` | +| Name | Type | +| :------ | :------ | +| `T` | `any` | #### Type declaration @@ -686,16 +686,16 @@ Implementation of a target of a project ##### Parameters -| Name | Type | -| :-------- | :------------------------------------------------------ | -| `options` | `T` | +| Name | Type | +| :------ | :------ | +| `options` | `T` | | `context` | [`ExecutorContext`](../../devkit/index#executorcontext) | ##### Returns `Promise`<`Object`\> \| `AsyncIterableIterator`<`Object`\> ---- +___ ### Generator @@ -703,9 +703,9 @@ Implementation of a target of a project #### Type parameters -| Name | Type | -| :--- | :-------- | -| `T` | `unknown` | +| Name | Type | +| :------ | :------ | +| `T` | `unknown` | #### Type declaration @@ -715,16 +715,16 @@ A function that schedules updates to the filesystem to be done atomically ##### Parameters -| Name | Type | -| :------- | :---- | -| `tree` | `any` | -| `schema` | `T` | +| Name | Type | +| :------ | :------ | +| `tree` | `any` | +| `schema` | `T` | ##### Returns `void` \| [`GeneratorCallback`](../../devkit/index#generatorcallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/index#generatorcallback)\> ---- +___ ### GeneratorCallback @@ -740,7 +740,7 @@ A callback function that is executed after changes are made to the file system `void` \| `Promise`<`void`\> ---- +___ ### ImplicitDependencyEntry @@ -748,21 +748,21 @@ A callback function that is executed after changes are made to the file system #### Type parameters -| Name | Type | -| :--- | :------------------ | -| `T` | `"*"` \| `string`[] | +| Name | Type | +| :------ | :------ | +| `T` | ``"*"`` \| `string`[] | #### Index signature ▪ [key: `string`]: `T` \| [`ImplicitJsonSubsetDependency`](../../devkit/index#implicitjsonsubsetdependency)<`T`\> ---- +___ ### ProjectType -Ƭ **ProjectType**: `"library"` \| `"application"` +Ƭ **ProjectType**: ``"library"`` \| ``"application"`` ---- +___ ### TaskGraphExecutor @@ -770,9 +770,9 @@ A callback function that is executed after changes are made to the file system #### Type parameters -| Name | Type | -| :--- | :---- | -| `T` | `any` | +| Name | Type | +| :------ | :------ | +| `T` | `any` | #### Type declaration @@ -782,18 +782,18 @@ Implementation of a target of a project that handles multiple projects to be bat ##### Parameters -| Name | Type | -| :---------- | :------------------------------------------------------ | -| `taskGraph` | [`TaskGraph`](../../devkit/index#taskgraph) | -| `options` | `Record`<`string`, `T`\> | -| `overrides` | `T` | -| `context` | [`ExecutorContext`](../../devkit/index#executorcontext) | +| Name | Type | +| :------ | :------ | +| `taskGraph` | [`TaskGraph`](../../devkit/index#taskgraph) | +| `options` | `Record`<`string`, `T`\> | +| `overrides` | `T` | +| `context` | [`ExecutorContext`](../../devkit/index#executorcontext) | ##### Returns `Promise`<`Record`<`string`, `Object`\>\> ---- +___ ### WorkspaceJsonConfiguration @@ -807,16 +807,16 @@ Implementation of a target of a project that handles multiple projects to be bat #### Type declaration -| Name | Type | -| :------ | :-------------------------- | +| Name | Type | +| :------ | :------ | | `debug` | (...`s`: `any`[]) => `void` | -| `error` | (`s`: `any`) => `void` | +| `error` | (`s`: `any`) => `void` | | `fatal` | (...`s`: `any`[]) => `void` | -| `info` | (`s`: `any`) => `void` | -| `log` | (...`s`: `any`[]) => `void` | -| `warn` | (`s`: `any`) => `void` | +| `info` | (`s`: `any`) => `void` | +| `log` | (...`s`: `any`[]) => `void` | +| `warn` | (`s`: `any`) => `void` | ---- +___ ## Utils Variables @@ -824,19 +824,19 @@ Implementation of a target of a project that handles multiple projects to be bat • **appRootPath**: `string` = `workspaceRoot` ---- +___ ### cacheDir • **cacheDir**: `string` ---- +___ ### output • **output**: `CLIOutput` ---- +___ ### workspaceRoot @@ -851,21 +851,19 @@ Implementation of a target of a project that handles multiple projects to be bat Add Dependencies and Dev Dependencies to package.json For example: - ```typescript -addDependenciesToPackageJson(tree, { react: 'latest' }, { jest: 'latest' }); +addDependenciesToPackageJson(tree, { react: 'latest' }, { jest: 'latest' }) ``` - This will **add** `react` and `jest` to the dependencies and devDependencies sections of package.json respectively. #### Parameters -| Name | Type | Default value | Description | -| :---------------- | :-------------------------------- | :--------------- | :---------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/index#tree) | `undefined` | Tree representing file system to modify | -| `dependencies` | `Record`<`string`, `string`\> | `undefined` | Dependencies to be added to the dependencies section of package.json | -| `devDependencies` | `Record`<`string`, `string`\> | `undefined` | Dependencies to be added to the devDependencies section of package.json | -| `packageJsonPath` | `string` | `'package.json'` | Path to package.json | +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `tree` | [`Tree`](../../devkit/index#tree) | `undefined` | Tree representing file system to modify | +| `dependencies` | `Record`<`string`, `string`\> | `undefined` | Dependencies to be added to the dependencies section of package.json | +| `devDependencies` | `Record`<`string`, `string`\> | `undefined` | Dependencies to be added to the devDependencies section of package.json | +| `packageJsonPath` | `string` | `'package.json'` | Path to package.json | #### Returns @@ -873,7 +871,7 @@ This will **add** `react` and `jest` to the dependencies and devDependencies sec Callback to install dependencies only if necessary, no-op otherwise ---- +___ ### addProjectConfiguration @@ -886,18 +884,18 @@ The utility will update either files. #### Parameters -| Name | Type | Description | -| :--------------------- | :---------------------------------------------------------------- | :----------------------------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/index#tree) | the file system tree | -| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | -| `projectConfiguration` | [`ProjectConfiguration`](../../devkit/index#projectconfiguration) | project configuration | -| `standalone?` | `boolean` | should the project use package.json? If false, the project config is inside workspace.json | +| Name | Type | Description | +| :------ | :------ | :------ | +| `tree` | [`Tree`](../../devkit/index#tree) | the file system tree | +| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | +| `projectConfiguration` | [`ProjectConfiguration`](../../devkit/index#projectconfiguration) | project configuration | +| `standalone?` | `boolean` | should the project use package.json? If false, the project config is inside workspace.json | #### Returns `void` ---- +___ ### applyAdditionalShared @@ -912,17 +910,17 @@ hierarchy. #### Parameters -| Name | Type | Description | -| :----------------- | :----------------------------------------------------------------------------------- | :--------------------------------- | -| `sharedConfig` | `Record`<`string`, [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)\> | The original Shared Config | -| `additionalShared` | [`AdditionalSharedConfig`](../../devkit/index#additionalsharedconfig) | The additional dependencies to add | -| `projectGraph` | [`ProjectGraph`](../../devkit/index#projectgraph)<`any`\> | The Nx project graph | +| Name | Type | Description | +| :------ | :------ | :------ | +| `sharedConfig` | `Record`<`string`, [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)\> | The original Shared Config | +| `additionalShared` | [`AdditionalSharedConfig`](../../devkit/index#additionalsharedconfig) | The additional dependencies to add | +| `projectGraph` | [`ProjectGraph`](../../devkit/index#projectgraph)<`any`\> | The Nx project graph | #### Returns `void` ---- +___ ### applyChangesToString @@ -944,32 +942,32 @@ const updatedCode = applyChangesToString(code, [ { type: ChangeType.Insert, index: indexOfPropertyName, - text: 'element', + text: 'element' }, { type: ChangeType.Delete, start: indexOfPropertyName, - length: 6, + length: 6 }, ]); bootstrap({ - element: document.querySelector('#app'), + element: document.querySelector('#app') }); ``` #### Parameters -| Name | Type | -| :-------- | :-------------------------------------------------- | -| `text` | `string` | +| Name | Type | +| :------ | :------ | +| `text` | `string` | | `changes` | [`StringChange`](../../devkit/index#stringchange)[] | #### Returns `string` ---- +___ ### applySharedFunction @@ -980,16 +978,16 @@ of the dependencies for the Module Federation build. #### Parameters -| Name | Type | Description | -| :------------- | :----------------------------------------------------------------------------------- | :---------------------------------------- | +| Name | Type | Description | +| :------ | :------ | :------ | | `sharedConfig` | `Record`<`string`, [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)\> | The original Shared Config to be modified | -| `sharedFn` | [`SharedFunction`](../../devkit/index#sharedfunction) | The custom function to run | +| `sharedFn` | [`SharedFunction`](../../devkit/index#sharedfunction) | The custom function to run | #### Returns `void` ---- +___ ### convertNxExecutor @@ -1001,15 +999,15 @@ Use this to expose a compatible Angular Builder #### Parameters -| Name | Type | -| :--------- | :------------------------------------------------ | +| Name | Type | +| :------ | :------ | | `executor` | [`Executor`](../../devkit/index#executor)<`any`\> | #### Returns `any` ---- +___ ### convertNxGenerator @@ -1019,16 +1017,16 @@ Convert an Nx Generator into an Angular Devkit Schematic. #### Type parameters -| Name | Type | -| :--- | :---- | -| `T` | `any` | +| Name | Type | +| :------ | :------ | +| `T` | `any` | #### Parameters -| Name | Type | Default value | Description | -| :----------------------------- | :------------------------------------------------ | :------------ | :------------------------------------------------------------------------------------------------ | -| `generator` | [`Generator`](../../devkit/index#generator)<`T`\> | `undefined` | The Nx generator to convert to an Angular Devkit Schematic. | -| `skipWritingConfigInOldFormat` | `boolean` | `false` | Whether to skip writing the configuration in the old format (the one used by the Angular DevKit). | +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `generator` | [`Generator`](../../devkit/index#generator)<`T`\> | `undefined` | The Nx generator to convert to an Angular Devkit Schematic. | +| `skipWritingConfigInOldFormat` | `boolean` | `false` | Whether to skip writing the configuration in the old format (the one used by the Angular DevKit). | #### Returns @@ -1038,9 +1036,9 @@ Convert an Nx Generator into an Angular Devkit Schematic. ##### Parameters -| Name | Type | -| :----------------- | :--- | -| `generatorOptions` | `T` | +| Name | Type | +| :------ | :------ | +| `generatorOptions` | `T` | ##### Returns @@ -1050,16 +1048,16 @@ Convert an Nx Generator into an Angular Devkit Schematic. ##### Parameters -| Name | Type | -| :-------- | :---- | -| `tree` | `any` | +| Name | Type | +| :------ | :------ | +| `tree` | `any` | | `context` | `any` | ##### Returns `Promise`<`any`\> ---- +___ ### createProjectGraphAsync @@ -1070,17 +1068,15 @@ Computes and returns a ProjectGraph. Nx will compute the graph either in a daemon process or in the current process. Nx will compute it in the current process if: - -- The process is running in CI (CI env variable is to true or other common variables used by CI providers are set). -- It is running in the docker container. -- The daemon process is disabled because of the previous error when starting the daemon. -- `NX_DAEMON` is set to `false`. -- `useDaemon` is set to false in `nx.json` +* The process is running in CI (CI env variable is to true or other common variables used by CI providers are set). +* It is running in the docker container. +* The daemon process is disabled because of the previous error when starting the daemon. +* `NX_DAEMON` is set to `false`. +* `useDaemon` is set to false in `nx.json` `NX_DAEMON` env variable takes precedence: - -- If it is set to true, the daemon will always be used. -- If it is set to false, the graph will always be computed in the current process. +* If it is set to true, the daemon will always be used. +* If it is set to false, the graph will always be computed in the current process. Tip: If you want to debug project graph creation, run your command with NX_DAEMON=false. @@ -1089,17 +1085,17 @@ stored in the daemon process. To reset both run: `nx reset`. #### Parameters -| Name | Type | -| :------------------------ | :-------- | -| `opts` | `Object` | -| `opts.exitOnError` | `boolean` | +| Name | Type | +| :------ | :------ | +| `opts` | `Object` | +| `opts.exitOnError` | `boolean` | | `opts.resetDaemonClient?` | `boolean` | #### Returns `Promise`<[`ProjectGraph`](../../devkit/index#projectgraph)\> ---- +___ ### defaultTasksRunner @@ -1107,25 +1103,25 @@ stored in the daemon process. To reset both run: `nx reset`. #### Parameters -| Name | Type | -| :--------------------------- | :------------------------------------------------------------------------------------ | -| `tasks` | [`Task`](../../devkit/index#task)[] | -| `options` | [`DefaultTasksRunnerOptions`](../../devkit/index#defaulttasksrunneroptions) | -| `context?` | `Object` | -| `context.daemon?` | `DaemonClient` | -| `context.hasher?` | [`Hasher`](../../devkit/index#hasher) | -| `context.initiatingProject?` | `string` | -| `context.nxArgs` | `NxArgs` | -| `context.nxJson` | [`NxJsonConfiguration`](../../devkit/index#nxjsonconfiguration)<`string`[] \| `"*"`\> | -| `context.projectGraph` | [`ProjectGraph`](../../devkit/index#projectgraph)<`any`\> | -| `context.target?` | `string` | -| `context.taskGraph?` | [`TaskGraph`](../../devkit/index#taskgraph) | +| Name | Type | +| :------ | :------ | +| `tasks` | [`Task`](../../devkit/index#task)[] | +| `options` | [`DefaultTasksRunnerOptions`](../../devkit/index#defaulttasksrunneroptions) | +| `context?` | `Object` | +| `context.daemon?` | `DaemonClient` | +| `context.hasher?` | [`Hasher`](../../devkit/index#hasher) | +| `context.initiatingProject?` | `string` | +| `context.nxArgs` | `NxArgs` | +| `context.nxJson` | [`NxJsonConfiguration`](../../devkit/index#nxjsonconfiguration)<`string`[] \| ``"*"``\> | +| `context.projectGraph` | [`ProjectGraph`](../../devkit/index#projectgraph)<`any`\> | +| `context.target?` | `string` | +| `context.taskGraph?` | [`TaskGraph`](../../devkit/index#taskgraph) | #### Returns `any` ---- +___ ### detectPackageManager @@ -1135,15 +1131,15 @@ Detects which package manager is used in the workspace based on the lock file. #### Parameters -| Name | Type | Default value | -| :---- | :------- | :------------ | -| `dir` | `string` | `''` | +| Name | Type | Default value | +| :------ | :------ | :------ | +| `dir` | `string` | `''` | #### Returns [`PackageManager`](../../devkit/index#packagemanager) ---- +___ ### detectWorkspaceScope @@ -1153,15 +1149,15 @@ Detect workspace scope from the package.json name #### Parameters -| Name | Type | -| :------------ | :------- | +| Name | Type | +| :------ | :------ | | `packageName` | `string` | #### Returns `string` ---- +___ ### formatFiles @@ -1171,15 +1167,15 @@ Formats all the created or updated files using Prettier #### Parameters -| Name | Type | Description | -| :----- | :-------------------------------- | :------------------- | +| Name | Type | Description | +| :------ | :------ | :------ | | `tree` | [`Tree`](../../devkit/index#tree) | the file system tree | #### Returns `Promise`<`void`\> ---- +___ ### generateFiles @@ -1188,19 +1184,13 @@ Formats all the created or updated files using Prettier Generates a folder of files based on provided templates. While doing so it performs two substitutions: - -- Substitutes segments of file names surrounded by \_\_ +- Substitutes segments of file names surrounded by __ - Uses ejs to substitute values in templates Examples: - ```typescript -generateFiles(tree, path.join(__dirname, 'files'), './tools/scripts', { - tmpl: '', - name: 'myscript', -}); +generateFiles(tree, path.join(__dirname , 'files'), './tools/scripts', {tmpl: '', name: 'myscript'}) ``` - This command will take all the files from the `files` directory next to the place where the command is invoked from. It will replace all `__tmpl__` with '' and all `__name__` with 'myscript' in the file names, and will replace all `<%= name %>` with `myscript` in the files themselves. @@ -1209,18 +1199,18 @@ doesn't get confused about incorrect TypeScript files. #### Parameters -| Name | Type | Description | -| :-------------- | :-------------------------------- | :-------------------------------------------- | -| `tree` | [`Tree`](../../devkit/index#tree) | the file system tree | -| `srcFolder` | `string` | the source folder of files (absolute path) | -| `target` | `string` | the target folder (relative to the tree root) | -| `substitutions` | `Object` | an object of key-value pairs | +| Name | Type | Description | +| :------ | :------ | :------ | +| `tree` | [`Tree`](../../devkit/index#tree) | the file system tree | +| `srcFolder` | `string` | the source folder of files (absolute path) | +| `target` | `string` | the target folder (relative to the tree root) | +| `substitutions` | `Object` | an object of key-value pairs | #### Returns `void` ---- +___ ### getDependentPackagesForProject @@ -1228,21 +1218,21 @@ doesn't get confused about incorrect TypeScript files. #### Parameters -| Name | Type | -| :------------- | :-------------------------------------------------------- | +| Name | Type | +| :------ | :------ | | `projectGraph` | [`ProjectGraph`](../../devkit/index#projectgraph)<`any`\> | -| `name` | `string` | +| `name` | `string` | #### Returns `Object` -| Name | Type | -| :------------------- | :---------------------------------------------------------- | -| `npmPackages` | `string`[] | +| Name | Type | +| :------ | :------ | +| `npmPackages` | `string`[] | | `workspaceLibraries` | [`WorkspaceLibrary`](../../devkit/index#workspacelibrary)[] | ---- +___ ### getImportPath @@ -1252,16 +1242,16 @@ Prefixes project name with npm scope #### Parameters -| Name | Type | -| :----------------- | :------- | -| `npmScope` | `string` | +| Name | Type | +| :------ | :------ | +| `npmScope` | `string` | | `projectDirectory` | `string` | #### Returns `string` ---- +___ ### getNpmPackageSharedConfig @@ -1272,16 +1262,16 @@ specified version of that package. #### Parameters -| Name | Type | Description | -| :-------- | :------- | :----------------------------------------------------------------------------- | -| `pkgName` | `string` | Name of the package to share | +| Name | Type | Description | +| :------ | :------ | :------ | +| `pkgName` | `string` | Name of the package to share | | `version` | `string` | Version of the package to require by other apps in the Module Federation setup | #### Returns [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig) \| `undefined` ---- +___ ### getOutputsForTargetAndConfiguration @@ -1291,16 +1281,16 @@ Returns the list of outputs that will be cached. #### Parameters -| Name | Type | Description | -| :----- | :------------------------------------------------------------------------------ | :-------------------------------------------------------- | -| `task` | `Pick`<[`Task`](../../devkit/index#task), `"overrides"` \| `"target"`\> | target + overrides | +| Name | Type | Description | +| :------ | :------ | :------ | +| `task` | `Pick`<[`Task`](../../devkit/index#task), ``"overrides"`` \| ``"target"``\> | target + overrides | | `node` | [`ProjectGraphProjectNode`](../../devkit/index#projectgraphprojectnode)<`any`\> | ProjectGraphProjectNode object that the task runs against | #### Returns `string`[] ---- +___ ### getPackageManagerCommand @@ -1318,15 +1308,15 @@ execSync(`${getPackageManagerCommand().addDev} my-dev-package`); #### Parameters -| Name | Type | -| :--------------- | :---------------------------------------------------- | +| Name | Type | +| :------ | :------ | | `packageManager` | [`PackageManager`](../../devkit/index#packagemanager) | #### Returns `PackageManagerCommands` ---- +___ ### getPackageManagerVersion @@ -1338,15 +1328,15 @@ but it can also be passed in explicitly. #### Parameters -| Name | Type | -| :--------------- | :---------------------------------------------------- | +| Name | Type | +| :------ | :------ | | `packageManager` | [`PackageManager`](../../devkit/index#packagemanager) | #### Returns `string` ---- +___ ### getProjects @@ -1358,15 +1348,15 @@ Use [readProjectConfiguration](../../devkit/index#readprojectconfiguration) if o #### Parameters -| Name | Type | -| :----- | :-------------------------------- | +| Name | Type | +| :------ | :------ | | `tree` | [`Tree`](../../devkit/index#tree) | #### Returns `Map`<`string`, [`ProjectConfiguration`](../../devkit/index#projectconfiguration)\> ---- +___ ### getWorkspaceLayout @@ -1383,38 +1373,38 @@ Example: #### Parameters -| Name | Type | Description | -| :----- | :-------------------------------- | :--------------- | +| Name | Type | Description | +| :------ | :------ | :------ | | `tree` | [`Tree`](../../devkit/index#tree) | file system tree | #### Returns `Object` -| Name | Type | -| :-------------------- | :-------- | -| `appsDir` | `string` | -| `libsDir` | `string` | -| `npmScope` | `string` | +| Name | Type | +| :------ | :------ | +| `appsDir` | `string` | +| `libsDir` | `string` | +| `npmScope` | `string` | | `standaloneAsDefault` | `boolean` | ---- +___ ### getWorkspacePath -▸ **getWorkspacePath**(`tree`): `"/angular.json"` \| `"/workspace.json"` \| `null` +▸ **getWorkspacePath**(`tree`): ``"/angular.json"`` \| ``"/workspace.json"`` \| ``null`` #### Parameters -| Name | Type | -| :----- | :-------------------------------- | +| Name | Type | +| :------ | :------ | | `tree` | [`Tree`](../../devkit/index#tree) | #### Returns -`"/angular.json"` \| `"/workspace.json"` \| `null` +``"/angular.json"`` \| ``"/workspace.json"`` \| ``null`` ---- +___ ### installPackagesTask @@ -1425,18 +1415,18 @@ Runs `npm install` or `yarn install`. It will skip running the install if #### Parameters -| Name | Type | Default value | Description | -| :--------------- | :---------------------------------------------------- | :------------ | :------------------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/index#tree) | `undefined` | the file system tree | -| `alwaysRun` | `boolean` | `false` | always run the command even if `package.json` hasn't changed. | -| `cwd` | `string` | `''` | - | -| `packageManager` | [`PackageManager`](../../devkit/index#packagemanager) | `undefined` | - | +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `tree` | [`Tree`](../../devkit/index#tree) | `undefined` | the file system tree | +| `alwaysRun` | `boolean` | `false` | always run the command even if `package.json` hasn't changed. | +| `cwd` | `string` | `''` | - | +| `packageManager` | [`PackageManager`](../../devkit/index#packagemanager) | `undefined` | - | #### Returns `void` ---- +___ ### isStandaloneProject @@ -1446,16 +1436,16 @@ Returns if a project has a standalone configuration (project.json). #### Parameters -| Name | Type | Description | -| :-------- | :-------------------------------- | :------------------- | -| `tree` | [`Tree`](../../devkit/index#tree) | the file system tree | -| `project` | `string` | the project name | +| Name | Type | Description | +| :------ | :------ | :------ | +| `tree` | [`Tree`](../../devkit/index#tree) | the file system tree | +| `project` | `string` | the project name | #### Returns `boolean` ---- +___ ### joinPathFragments @@ -1465,15 +1455,15 @@ Normalized path fragments and joins them #### Parameters -| Name | Type | -| :------------- | :--------- | +| Name | Type | +| :------ | :------ | | `...fragments` | `string`[] | #### Returns `string` ---- +___ ### mapRemotes @@ -1484,17 +1474,17 @@ Federation. #### Parameters -| Name | Type | Description | -| :------------------- | :-------------------------------------- | :------------------------------------------------------- | -| `remotes` | [`Remotes`](../../devkit/index#remotes) | The remotes to map | -| `remoteEntryExt` | `"js"` \| `"mjs"` | The file extension of the remoteEntry file | -| `determineRemoteUrl` | (`remote`: `string`) => `string` | The function used to lookup the URL of the served remote | +| Name | Type | Description | +| :------ | :------ | :------ | +| `remotes` | [`Remotes`](../../devkit/index#remotes) | The remotes to map | +| `remoteEntryExt` | ``"js"`` \| ``"mjs"`` | The file extension of the remoteEntry file | +| `determineRemoteUrl` | (`remote`: `string`) => `string` | The function used to lookup the URL of the served remote | #### Returns `Record`<`string`, `string`\> ---- +___ ### mapRemotesForSSR @@ -1505,17 +1495,17 @@ Federation. #### Parameters -| Name | Type | Description | -| :------------------- | :-------------------------------------- | :------------------------------------------------------- | -| `remotes` | [`Remotes`](../../devkit/index#remotes) | The remotes to map | -| `remoteEntryExt` | `"js"` \| `"mjs"` | The file extension of the remoteEntry file | -| `determineRemoteUrl` | (`remote`: `string`) => `string` | The function used to lookup the URL of the served remote | +| Name | Type | Description | +| :------ | :------ | :------ | +| `remotes` | [`Remotes`](../../devkit/index#remotes) | The remotes to map | +| `remoteEntryExt` | ``"js"`` \| ``"mjs"`` | The file extension of the remoteEntry file | +| `determineRemoteUrl` | (`remote`: `string`) => `string` | The function used to lookup the URL of the served remote | #### Returns `Record`<`string`, `string`\> ---- +___ ### moveFilesToNewDirectory @@ -1525,17 +1515,17 @@ Analogous to cp -r oldDir newDir #### Parameters -| Name | Type | -| :------- | :-------------------------------- | -| `tree` | [`Tree`](../../devkit/index#tree) | -| `oldDir` | `string` | -| `newDir` | `string` | +| Name | Type | +| :------ | :------ | +| `tree` | [`Tree`](../../devkit/index#tree) | +| `oldDir` | `string` | +| `newDir` | `string` | #### Returns `void` ---- +___ ### names @@ -1546,29 +1536,29 @@ Util function to generate different strings based off the provided name. Examples: ```typescript -names('my-name'); // {name: 'my-name', className: 'MyName', propertyName: 'myName', constantName: 'MY_NAME', fileName: 'my-name'} -names('myName'); // {name: 'myName', className: 'MyName', propertyName: 'myName', constantName: 'MY_NAME', fileName: 'my-name'} +names("my-name") // {name: 'my-name', className: 'MyName', propertyName: 'myName', constantName: 'MY_NAME', fileName: 'my-name'} +names("myName") // {name: 'myName', className: 'MyName', propertyName: 'myName', constantName: 'MY_NAME', fileName: 'my-name'} ``` #### Parameters -| Name | Type | -| :----- | :------- | +| Name | Type | +| :------ | :------ | | `name` | `string` | #### Returns `Object` -| Name | Type | -| :------------- | :------- | -| `className` | `string` | +| Name | Type | +| :------ | :------ | +| `className` | `string` | | `constantName` | `string` | -| `fileName` | `string` | -| `name` | `string` | +| `fileName` | `string` | +| `name` | `string` | | `propertyName` | `string` | ---- +___ ### normalizePath @@ -1578,15 +1568,15 @@ Coverts an os specific path to a unix style path #### Parameters -| Name | Type | -| :--------------- | :------- | +| Name | Type | +| :------ | :------ | | `osSpecificPath` | `string` | #### Returns `string` ---- +___ ### offsetFromRoot @@ -1598,20 +1588,20 @@ constructing relative URLs. Examples: ```typescript -offsetFromRoot('apps/mydir/myapp/'); // returns "../../../" +offsetFromRoot("apps/mydir/myapp/") // returns "../../../" ``` #### Parameters -| Name | Type | Description | -| :-------------- | :------- | :------------- | +| Name | Type | Description | +| :------ | :------ | :------ | | `fullPathToDir` | `string` | directory path | #### Returns `string` ---- +___ ### parseJson @@ -1622,16 +1612,16 @@ By default javascript-style comments are allowed. #### Type parameters -| Name | Type | -| :--- | :----------------------- | -| `T` | extends `object` = `any` | +| Name | Type | +| :------ | :------ | +| `T` | extends `object` = `any` | #### Parameters -| Name | Type | Description | -| :--------- | :-------------------------------------------------------- | :--------------------- | -| `input` | `string` | JSON content as string | -| `options?` | [`JsonParseOptions`](../../devkit/index#jsonparseoptions) | JSON parse options | +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `string` | JSON content as string | +| `options?` | [`JsonParseOptions`](../../devkit/index#jsonparseoptions) | JSON parse options | #### Returns @@ -1639,7 +1629,7 @@ By default javascript-style comments are allowed. Object the JSON content represents ---- +___ ### parseTargetString @@ -1648,23 +1638,22 @@ Object the JSON content represents Parses a target string into {project, target, configuration} Examples: - ```typescript -parseTargetString('proj:test'); // returns { project: "proj", target: "test" } -parseTargetString('proj:test:production'); // returns { project: "proj", target: "test", configuration: "production" } +parseTargetString("proj:test") // returns { project: "proj", target: "test" } +parseTargetString("proj:test:production") // returns { project: "proj", target: "test", configuration: "production" } ``` #### Parameters -| Name | Type | Description | -| :------------- | :------- | :--------------- | +| Name | Type | Description | +| :------ | :------ | :------ | | `targetString` | `string` | target reference | #### Returns [`Target`](../../devkit/index#target) ---- +___ ### readAllWorkspaceConfiguration @@ -1676,7 +1665,7 @@ parseTargetString('proj:test:production'); // returns { project: "proj", target: [`ProjectsConfigurations`](../../devkit/index#projectsconfigurations) & [`NxJsonConfiguration`](../../devkit/index#nxjsonconfiguration) ---- +___ ### readCachedProjectGraph @@ -1690,7 +1679,7 @@ Synchronously reads the latest cached copy of the workspace's ProjectGraph. [`ProjectGraph`](../../devkit/index#projectgraph)<[`ProjectConfiguration`](../../devkit/index#projectconfiguration)\> ---- +___ ### readJson @@ -1700,23 +1689,23 @@ Reads a json file, removes all comments and parses JSON. #### Type parameters -| Name | Type | -| :--- | :----------------------- | -| `T` | extends `object` = `any` | +| Name | Type | +| :------ | :------ | +| `T` | extends `object` = `any` | #### Parameters -| Name | Type | Description | -| :--------- | :-------------------------------------------------------- | :-------------------------- | -| `tree` | [`Tree`](../../devkit/index#tree) | file system tree | -| `path` | `string` | file path | +| Name | Type | Description | +| :------ | :------ | :------ | +| `tree` | [`Tree`](../../devkit/index#tree) | file system tree | +| `path` | `string` | file path | | `options?` | [`JsonParseOptions`](../../devkit/index#jsonparseoptions) | Optional JSON Parse Options | #### Returns `T` ---- +___ ### readJsonFile @@ -1726,15 +1715,15 @@ Reads a JSON file and returns the object the JSON content represents. #### Type parameters -| Name | Type | -| :--- | :----------------------- | -| `T` | extends `object` = `any` | +| Name | Type | +| :------ | :------ | +| `T` | extends `object` = `any` | #### Parameters -| Name | Type | Description | -| :--------- | :---------------- | :----------------- | -| `path` | `string` | A path to a file. | +| Name | Type | Description | +| :------ | :------ | :------ | +| `path` | `string` | A path to a file. | | `options?` | `JsonReadOptions` | JSON parse options | #### Returns @@ -1743,7 +1732,7 @@ Reads a JSON file and returns the object the JSON content represents. Object the JSON content of the file represents ---- +___ ### readNxJson @@ -1753,7 +1742,7 @@ Object the JSON content of the file represents [`NxJsonConfiguration`](../../devkit/index#nxjsonconfiguration) ---- +___ ### readProjectConfiguration @@ -1768,16 +1757,16 @@ The utility will read from either file. #### Parameters -| Name | Type | Description | -| :------------ | :-------------------------------- | :---------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/index#tree) | the file system tree | -| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | +| Name | Type | Description | +| :------ | :------ | :------ | +| `tree` | [`Tree`](../../devkit/index#tree) | the file system tree | +| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | #### Returns [`ProjectConfiguration`](../../devkit/index#projectconfiguration) ---- +___ ### readRootPackageJson @@ -1787,12 +1776,12 @@ The utility will read from either file. `Object` -| Name | Type | -| :----------------- | :------- | -| `dependencies?` | `Object` | +| Name | Type | +| :------ | :------ | +| `dependencies?` | `Object` | | `devDependencies?` | `Object` | ---- +___ ### readTargetOptions @@ -1804,22 +1793,22 @@ Works as if you invoked the target yourself without passing any command lint ove #### Type parameters -| Name | Type | -| :--- | :---- | -| `T` | `any` | +| Name | Type | +| :------ | :------ | +| `T` | `any` | #### Parameters -| Name | Type | -| :------------------ | :------------------------------------------------------ | -| `__namedParameters` | [`Target`](../../devkit/index#target) | -| `context` | [`ExecutorContext`](../../devkit/index#executorcontext) | +| Name | Type | +| :------ | :------ | +| `__namedParameters` | [`Target`](../../devkit/index#target) | +| `context` | [`ExecutorContext`](../../devkit/index#executorcontext) | #### Returns `T` ---- +___ ### readWorkspaceConfiguration @@ -1831,15 +1820,15 @@ This does _not_ provide projects configuration, use [readProjectConfiguration](. #### Parameters -| Name | Type | -| :----- | :-------------------------------- | +| Name | Type | +| :------ | :------ | | `tree` | [`Tree`](../../devkit/index#tree) | #### Returns [`WorkspaceConfiguration`](../../devkit/index#workspaceconfiguration) ---- +___ ### removeDependenciesFromPackageJson @@ -1848,21 +1837,19 @@ This does _not_ provide projects configuration, use [readProjectConfiguration](. Remove Dependencies and Dev Dependencies from package.json For example: - ```typescript -removeDependenciesFromPackageJson(tree, ['react'], ['jest']); +removeDependenciesFromPackageJson(tree, ['react'], ['jest']) ``` - This will **remove** `react` and `jest` from the dependencies and devDependencies sections of package.json respectively. #### Parameters -| Name | Type | Default value | Description | -| :---------------- | :-------------------------------- | :--------------- | :-------------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/index#tree) | `undefined` | - | -| `dependencies` | `string`[] | `undefined` | Dependencies to be removed from the dependencies section of package.json | -| `devDependencies` | `string`[] | `undefined` | Dependencies to be removed from the devDependencies section of package.json | -| `packageJsonPath` | `string` | `'package.json'` | - | +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `tree` | [`Tree`](../../devkit/index#tree) | `undefined` | - | +| `dependencies` | `string`[] | `undefined` | Dependencies to be removed from the dependencies section of package.json | +| `devDependencies` | `string`[] | `undefined` | Dependencies to be removed from the devDependencies section of package.json | +| `packageJsonPath` | `string` | `'package.json'` | - | #### Returns @@ -1870,7 +1857,7 @@ This will **remove** `react` and `jest` from the dependencies and devDependencie Callback to uninstall dependencies only if necessary. undefined is returned if changes are not necessary. ---- +___ ### removeProjectConfiguration @@ -1883,16 +1870,16 @@ The utility will update either file. #### Parameters -| Name | Type | -| :------------ | :-------------------------------- | -| `tree` | [`Tree`](../../devkit/index#tree) | -| `projectName` | `string` | +| Name | Type | +| :------ | :------ | +| `tree` | [`Tree`](../../devkit/index#tree) | +| `projectName` | `string` | #### Returns `void` ---- +___ ### reverse @@ -1905,15 +1892,15 @@ B will depend on A. #### Parameters -| Name | Type | -| :------ | :-------------------------------------------------------- | +| Name | Type | +| :------ | :------ | | `graph` | [`ProjectGraph`](../../devkit/index#projectgraph)<`any`\> | #### Returns [`ProjectGraph`](../../devkit/index#projectgraph) ---- +___ ### runExecutor @@ -1936,11 +1923,7 @@ Apart from that, it works the same way: Example: ```typescript -for await (const s of await runExecutor( - { project: 'myproj', target: 'serve' }, - { watch: true }, - context -)) { +for await (const s of await runExecutor({project: 'myproj', target: 'serve'}, {watch: true}, context)) { // s.success } ``` @@ -1949,26 +1932,26 @@ Note that the return value is a promise of an iterator, so you need to await bef #### Type parameters -| Name | Type | -| :--- | :--------------- | -| `T` | extends `Object` | +| Name | Type | +| :------ | :------ | +| `T` | extends `Object` | #### Parameters -| Name | Type | -| :--------------------------------- | :------------------------------------------------------ | -| `targetDescription` | `Object` | -| `targetDescription.configuration?` | `string` | -| `targetDescription.project` | `string` | -| `targetDescription.target` | `string` | -| `overrides` | `Object` | -| `context` | [`ExecutorContext`](../../devkit/index#executorcontext) | +| Name | Type | +| :------ | :------ | +| `targetDescription` | `Object` | +| `targetDescription.configuration?` | `string` | +| `targetDescription.project` | `string` | +| `targetDescription.target` | `string` | +| `overrides` | `Object` | +| `context` | [`ExecutorContext`](../../devkit/index#executorcontext) | #### Returns `Promise`<`AsyncIterableIterator`<`T`\>\> ---- +___ ### serializeJson @@ -1979,16 +1962,16 @@ By default the JSON string is formatted with a 2 space intendation to be easy re #### Type parameters -| Name | Type | -| :--- | :-------------------------- | -| `T` | extends `object` = `object` | +| Name | Type | +| :------ | :------ | +| `T` | extends `object` = `object` | #### Parameters -| Name | Type | Description | -| :--------- | :---------------------------------------------------------------- | :---------------------------------------- | -| `input` | `T` | Object which should be serialized to JSON | -| `options?` | [`JsonSerializeOptions`](../../devkit/index#jsonserializeoptions) | JSON serialize options | +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `T` | Object which should be serialized to JSON | +| `options?` | [`JsonSerializeOptions`](../../devkit/index#jsonserializeoptions) | JSON serialize options | #### Returns @@ -1996,7 +1979,7 @@ By default the JSON string is formatted with a 2 space intendation to be easy re the formatted JSON representation of the object ---- +___ ### sharePackages @@ -2010,15 +1993,15 @@ workspace. #### Parameters -| Name | Type | Description | -| :--------- | :--------- | :-------------------------------- | +| Name | Type | Description | +| :------ | :------ | :------ | | `packages` | `string`[] | Array of package names as strings | #### Returns `Record`<`string`, [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)\> ---- +___ ### shareWorkspaceLibraries @@ -2029,16 +2012,16 @@ share Nx Workspace Libraries between Hosts and Remotes. #### Parameters -| Name | Type | Description | -| :------------- | :---------------------------------------------------------- | :--------------------------------------------------------------------------- | -| `libraries` | [`WorkspaceLibrary`](../../devkit/index#workspacelibrary)[] | The Nx Workspace Libraries to share | -| `tsConfigPath` | `string` | The path to TS Config File that contains the Path Mappings for the Libraries | +| Name | Type | Description | +| :------ | :------ | :------ | +| `libraries` | [`WorkspaceLibrary`](../../devkit/index#workspacelibrary)[] | The Nx Workspace Libraries to share | +| `tsConfigPath` | `string` | The path to TS Config File that contains the Path Mappings for the Libraries | #### Returns [`SharedWorkspaceLibraryConfig`](../../devkit/index#sharedworkspacelibraryconfig) ---- +___ ### stripIndents @@ -2053,21 +2036,21 @@ stripIndents` Options: - option1 - option2 -`; +` ``` #### Parameters -| Name | Type | -| :---------- | :--------------------- | -| `strings` | `TemplateStringsArray` | -| `...values` | `any`[] | +| Name | Type | +| :------ | :------ | +| `strings` | `TemplateStringsArray` | +| `...values` | `any`[] | #### Returns `string` ---- +___ ### stripJsonComments @@ -2079,16 +2062,16 @@ of comments with a replaceCharacter #### Parameters -| Name | Type | -| :----------- | :------- | -| `text` | `string` | +| Name | Type | +| :------ | :------ | +| `text` | `string` | | `replaceCh?` | `string` | #### Returns `string` ---- +___ ### targetToTargetString @@ -2098,15 +2081,15 @@ Returns a string in the format "project:target[:configuration]" for the target #### Parameters -| Name | Type | Description | -| :------- | :------------------------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `target` | [`Target`](../../devkit/index#target) | target object Examples: `typescript targetToTargetString({ project: "proj", target: "test" }) // returns "proj:test" targetToTargetString({ project: "proj", target: "test", configuration: "production" }) // returns "proj:test:production" ` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `target` | [`Target`](../../devkit/index#target) | target object Examples: ```typescript targetToTargetString({ project: "proj", target: "test" }) // returns "proj:test" targetToTargetString({ project: "proj", target: "test", configuration: "production" }) // returns "proj:test:production" ``` | #### Returns `string` ---- +___ ### toJS @@ -2116,15 +2099,15 @@ Rename and transpile any new typescript files created to javascript files #### Parameters -| Name | Type | -| :----- | :-------------------------------- | +| Name | Type | +| :------ | :------ | | `tree` | [`Tree`](../../devkit/index#tree) | #### Returns `void` ---- +___ ### updateJson @@ -2134,25 +2117,25 @@ Updates a JSON value to the file system tree #### Type parameters -| Name | Type | -| :--- | :----------------------- | -| `T` | extends `object` = `any` | -| `U` | extends `object` = `T` | +| Name | Type | +| :------ | :------ | +| `T` | extends `object` = `any` | +| `U` | extends `object` = `T` | #### Parameters -| Name | Type | Description | -| :--------- | :---------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/index#tree) | File system tree | -| `path` | `string` | Path of JSON file in the Tree | -| `updater` | (`value`: `T`) => `U` | Function that maps the current value of a JSON document to a new value to be written to the document | -| `options?` | [`JsonParseOptions`](../../devkit/index#jsonparseoptions) & [`JsonSerializeOptions`](../../devkit/index#jsonserializeoptions) | Optional JSON Parse and Serialize Options | +| Name | Type | Description | +| :------ | :------ | :------ | +| `tree` | [`Tree`](../../devkit/index#tree) | File system tree | +| `path` | `string` | Path of JSON file in the Tree | +| `updater` | (`value`: `T`) => `U` | Function that maps the current value of a JSON document to a new value to be written to the document | +| `options?` | [`JsonParseOptions`](../../devkit/index#jsonparseoptions) & [`JsonSerializeOptions`](../../devkit/index#jsonserializeoptions) | Optional JSON Parse and Serialize Options | #### Returns `void` ---- +___ ### updateProjectConfiguration @@ -2165,17 +2148,17 @@ The utility will update either files. #### Parameters -| Name | Type | Description | -| :--------------------- | :---------------------------------------------------------------- | :---------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/index#tree) | the file system tree | -| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | -| `projectConfiguration` | [`ProjectConfiguration`](../../devkit/index#projectconfiguration) | project configuration | +| Name | Type | Description | +| :------ | :------ | :------ | +| `tree` | [`Tree`](../../devkit/index#tree) | the file system tree | +| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | +| `projectConfiguration` | [`ProjectConfiguration`](../../devkit/index#projectconfiguration) | project configuration | #### Returns `void` ---- +___ ### updateTsConfigsToJs @@ -2183,17 +2166,17 @@ The utility will update either files. #### Parameters -| Name | Type | -| :-------------------- | :-------------------------------- | -| `tree` | [`Tree`](../../devkit/index#tree) | -| `options` | `Object` | -| `options.projectRoot` | `string` | +| Name | Type | +| :------ | :------ | +| `tree` | [`Tree`](../../devkit/index#tree) | +| `options` | `Object` | +| `options.projectRoot` | `string` | #### Returns `void` ---- +___ ### updateWorkspaceConfiguration @@ -2205,16 +2188,16 @@ This does _not_ update projects configuration, use [updateProjectConfiguration]( #### Parameters -| Name | Type | -| :---------------- | :-------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/index#tree) | +| Name | Type | +| :------ | :------ | +| `tree` | [`Tree`](../../devkit/index#tree) | | `workspaceConfig` | [`WorkspaceConfiguration`](../../devkit/index#workspaceconfiguration) | #### Returns `void` ---- +___ ### visitNotIgnoredFiles @@ -2224,17 +2207,17 @@ Utility to act on all files in a tree that are not ignored by git. #### Parameters -| Name | Type | Default value | -| :-------- | :-------------------------------- | :------------ | -| `tree` | [`Tree`](../../devkit/index#tree) | `undefined` | -| `dirPath` | `string` | `tree.root` | -| `visitor` | (`path`: `string`) => `void` | `undefined` | +| Name | Type | Default value | +| :------ | :------ | :------ | +| `tree` | [`Tree`](../../devkit/index#tree) | `undefined` | +| `dirPath` | `string` | `tree.root` | +| `visitor` | (`path`: `string`) => `void` | `undefined` | #### Returns `void` ---- +___ ### workspaceLayout @@ -2246,12 +2229,12 @@ Returns information about where apps and libs will be created. `Object` -| Name | Type | -| :-------- | :------- | +| Name | Type | +| :------ | :------ | | `appsDir` | `string` | | `libsDir` | `string` | ---- +___ ### writeJson @@ -2261,24 +2244,24 @@ Writes a JSON value to the file system tree #### Type parameters -| Name | Type | -| :--- | :-------------------------- | -| `T` | extends `object` = `object` | +| Name | Type | +| :------ | :------ | +| `T` | extends `object` = `object` | #### Parameters -| Name | Type | Description | -| :--------- | :---------------------------------------------------------------- | :------------------------------ | -| `tree` | [`Tree`](../../devkit/index#tree) | File system tree | -| `path` | `string` | Path of JSON file in the Tree | -| `value` | `T` | Serializable value to write | +| Name | Type | Description | +| :------ | :------ | :------ | +| `tree` | [`Tree`](../../devkit/index#tree) | File system tree | +| `path` | `string` | Path of JSON file in the Tree | +| `value` | `T` | Serializable value to write | | `options?` | [`JsonSerializeOptions`](../../devkit/index#jsonserializeoptions) | Optional JSON Serialize Options | #### Returns `void` ---- +___ ### writeJsonFile @@ -2288,17 +2271,17 @@ Serializes the given data to JSON and writes it to a file. #### Type parameters -| Name | Type | -| :--- | :-------------------------- | -| `T` | extends `object` = `object` | +| Name | Type | +| :------ | :------ | +| `T` | extends `object` = `object` | #### Parameters -| Name | Type | Description | -| :--------- | :----------------- | :-------------------------------------------------------------- | -| `path` | `string` | A path to a file. | -| `data` | `T` | data which should be serialized to JSON and written to the file | -| `options?` | `JsonWriteOptions` | JSON serialize options | +| Name | Type | Description | +| :------ | :------ | :------ | +| `path` | `string` | A path to a file. | +| `data` | `T` | data which should be serialized to JSON and written to the file | +| `options?` | `JsonWriteOptions` | JSON serialize options | #### Returns diff --git a/docs/generated/devkit/ngcli_adapter.md b/docs/generated/devkit/ngcli_adapter.md index dd62a5fbc75c8..bfb07532c0746 100644 --- a/docs/generated/devkit/ngcli_adapter.md +++ b/docs/generated/devkit/ngcli_adapter.md @@ -35,24 +35,25 @@ In this case, you can mock it up. Example: ```typescript -mockSchematicsForTesting({ - 'mycollection:myschematic': (tree, params) => { - tree.write('README.md'); - }, -}); + mockSchematicsForTesting({ + 'mycollection:myschematic': (tree, params) => { + tree.write('README.md'); + } + }); + ``` #### Parameters -| Name | Type | -| :----------- | :------- | +| Name | Type | +| :------ | :------ | | `schematics` | `Object` | #### Returns `void` ---- +___ ### overrideCollectionResolutionForTesting @@ -67,38 +68,36 @@ This function can can be used to override the resolution behaviour. Example: ```typescript -overrideCollectionResolutionForTesting({ - '@nrwl/workspace': path.join( - __dirname, - '../../../../workspace/generators.json' - ), - '@nrwl/angular': path.join(__dirname, '../../../../angular/generators.json'), - '@nrwl/linter': path.join(__dirname, '../../../../linter/generators.json'), -}); + overrideCollectionResolutionForTesting({ + '@nrwl/workspace': path.join(__dirname, '../../../../workspace/generators.json'), + '@nrwl/angular': path.join(__dirname, '../../../../angular/generators.json'), + '@nrwl/linter': path.join(__dirname, '../../../../linter/generators.json') + }); + ``` #### Parameters -| Name | Type | -| :------------ | :------- | +| Name | Type | +| :------ | :------ | | `collections` | `Object` | #### Returns `void` ---- +___ ### wrapAngularDevkitSchematic -▸ **wrapAngularDevkitSchematic**(`collectionName`, `generatorName`): (`host`: [`Tree`](../../devkit/index#tree), `generatorOptions`: { [k: string]: `any`; }) => `Promise`<`any`\> +▸ **wrapAngularDevkitSchematic**(`collectionName`, `generatorName`): (`host`: [`Tree`](../../devkit/index#tree), `generatorOptions`: { [k: string]: `any`; }) => `Promise`<`any`\> #### Parameters -| Name | Type | -| :--------------- | :------- | +| Name | Type | +| :------ | :------ | | `collectionName` | `string` | -| `generatorName` | `string` | +| `generatorName` | `string` | #### Returns @@ -108,10 +107,10 @@ overrideCollectionResolutionForTesting({ ##### Parameters -| Name | Type | -| :----------------- | :-------------------------------- | -| `host` | [`Tree`](../../devkit/index#tree) | -| `generatorOptions` | `Object` | +| Name | Type | +| :------ | :------ | +| `host` | [`Tree`](../../devkit/index#tree) | +| `generatorOptions` | `Object` | ##### Returns diff --git a/docs/generated/packages/devkit.json b/docs/generated/packages/devkit.json index 8f1b72743183b..435627416044e 100644 --- a/docs/generated/packages/devkit.json +++ b/docs/generated/packages/devkit.json @@ -10,13 +10,13 @@ "id": "index", "name": "Overview", "file": "generated/devkit/index", - "content": "# Module: index\n\nThe Nx Devkit is the underlying technology used to customize Nx to support\ndifferent technologies and custom use-cases. It contains many utility\nfunctions for reading and writing files, updating configuration,\nworking with Abstract Syntax Trees(ASTs), and more.\n\nAs with most things in Nx, the core of Nx Devkit is very simple.\nIt only uses language primitives and immutable objects\n(the tree being the only exception).\n\n## Table of contents\n\n### Project Graph Enumerations\n\n- [DependencyType](../../devkit/index#dependencytype)\n\n### Utils Enumerations\n\n- [ChangeType](../../devkit/index#changetype)\n\n### Project Graph Classes\n\n- [ProjectGraphBuilder](../../devkit/index#projectgraphbuilder)\n\n### Utils Classes\n\n- [Hasher](../../devkit/index#hasher)\n\n### Workspace Classes\n\n- [Workspaces](../../devkit/index#workspaces)\n\n### Commands Interfaces\n\n- [Target](../../devkit/index#target)\n\n### Other Interfaces\n\n- [NxPlugin](../../devkit/index#nxplugin)\n\n### Project Graph Interfaces\n\n- [FileData](../../devkit/index#filedata)\n- [ProjectFileMap](../../devkit/index#projectfilemap)\n- [ProjectGraph](../../devkit/index#projectgraph)\n- [ProjectGraphDependency](../../devkit/index#projectgraphdependency)\n- [ProjectGraphExternalNode](../../devkit/index#projectgraphexternalnode)\n- [ProjectGraphProcessorContext](../../devkit/index#projectgraphprocessorcontext)\n- [ProjectGraphProjectNode](../../devkit/index#projectgraphprojectnode)\n- [ProjectGraphV4](../../devkit/index#projectgraphv4)\n\n### Tree Interfaces\n\n- [FileChange](../../devkit/index#filechange)\n- [Tree](../../devkit/index#tree)\n\n### Utils Interfaces\n\n- [DefaultTasksRunnerOptions](../../devkit/index#defaulttasksrunneroptions)\n- [Hash](../../devkit/index#hash)\n- [JsonParseOptions](../../devkit/index#jsonparseoptions)\n- [JsonSerializeOptions](../../devkit/index#jsonserializeoptions)\n- [ModuleFederationConfig](../../devkit/index#modulefederationconfig)\n- [RemoteCache](../../devkit/index#remotecache)\n- [SharedLibraryConfig](../../devkit/index#sharedlibraryconfig)\n- [StringDeletion](../../devkit/index#stringdeletion)\n- [StringInsertion](../../devkit/index#stringinsertion)\n\n### Workspace Interfaces\n\n- [ExecutorContext](../../devkit/index#executorcontext)\n- [ExecutorsJson](../../devkit/index#executorsjson)\n- [GeneratorsJson](../../devkit/index#generatorsjson)\n- [HasherContext](../../devkit/index#hashercontext)\n- [ImplicitJsonSubsetDependency](../../devkit/index#implicitjsonsubsetdependency)\n- [MigrationsJson](../../devkit/index#migrationsjson)\n- [NxAffectedConfig](../../devkit/index#nxaffectedconfig)\n- [NxJsonConfiguration](../../devkit/index#nxjsonconfiguration)\n- [ProjectConfiguration](../../devkit/index#projectconfiguration)\n- [ProjectsConfigurations](../../devkit/index#projectsconfigurations)\n- [TargetConfiguration](../../devkit/index#targetconfiguration)\n- [TargetDependencyConfig](../../devkit/index#targetdependencyconfig)\n- [Task](../../devkit/index#task)\n- [TaskGraph](../../devkit/index#taskgraph)\n- [Workspace](../../devkit/index#workspace)\n\n### Generators Type aliases\n\n- [WorkspaceConfiguration](../../devkit/index#workspaceconfiguration)\n\n### Other Type aliases\n\n- [ProjectTargetConfigurator](../../devkit/index#projecttargetconfigurator)\n\n### Package Manager Type aliases\n\n- [PackageManager](../../devkit/index#packagemanager)\n\n### Project Graph Type aliases\n\n- [ProjectGraphNode](../../devkit/index#projectgraphnode)\n\n### Utils Type aliases\n\n- [AdditionalSharedConfig](../../devkit/index#additionalsharedconfig)\n- [ModuleFederationLibrary](../../devkit/index#modulefederationlibrary)\n- [Remotes](../../devkit/index#remotes)\n- [SharedFunction](../../devkit/index#sharedfunction)\n- [SharedWorkspaceLibraryConfig](../../devkit/index#sharedworkspacelibraryconfig)\n- [StringChange](../../devkit/index#stringchange)\n- [WorkspaceLibrary](../../devkit/index#workspacelibrary)\n- [WorkspaceLibrarySecondaryEntryPoint](../../devkit/index#workspacelibrarysecondaryentrypoint)\n\n### Workspace Type aliases\n\n- [CustomHasher](../../devkit/index#customhasher)\n- [Executor](../../devkit/index#executor)\n- [Generator](../../devkit/index#generator)\n- [GeneratorCallback](../../devkit/index#generatorcallback)\n- [ImplicitDependencyEntry](../../devkit/index#implicitdependencyentry)\n- [ProjectType](../../devkit/index#projecttype)\n- [TaskGraphExecutor](../../devkit/index#taskgraphexecutor)\n- [WorkspaceJsonConfiguration](../../devkit/index#workspacejsonconfiguration)\n\n### Logger Variables\n\n- [logger](../../devkit/index#logger)\n\n### Utils Variables\n\n- [appRootPath](../../devkit/index#approotpath)\n- [cacheDir](../../devkit/index#cachedir)\n- [output](../../devkit/index#output)\n- [workspaceRoot](../../devkit/index#workspaceroot)\n\n### Functions\n\n- [addDependenciesToPackageJson](../../devkit/index#adddependenciestopackagejson)\n- [addProjectConfiguration](../../devkit/index#addprojectconfiguration)\n- [applyAdditionalShared](../../devkit/index#applyadditionalshared)\n- [applyChangesToString](../../devkit/index#applychangestostring)\n- [applySharedFunction](../../devkit/index#applysharedfunction)\n- [convertNxExecutor](../../devkit/index#convertnxexecutor)\n- [convertNxGenerator](../../devkit/index#convertnxgenerator)\n- [createProjectGraphAsync](../../devkit/index#createprojectgraphasync)\n- [defaultTasksRunner](../../devkit/index#defaulttasksrunner)\n- [detectPackageManager](../../devkit/index#detectpackagemanager)\n- [detectWorkspaceScope](../../devkit/index#detectworkspacescope)\n- [formatFiles](../../devkit/index#formatfiles)\n- [generateFiles](../../devkit/index#generatefiles)\n- [getDependentPackagesForProject](../../devkit/index#getdependentpackagesforproject)\n- [getImportPath](../../devkit/index#getimportpath)\n- [getNpmPackageSharedConfig](../../devkit/index#getnpmpackagesharedconfig)\n- [getOutputsForTargetAndConfiguration](../../devkit/index#getoutputsfortargetandconfiguration)\n- [getPackageManagerCommand](../../devkit/index#getpackagemanagercommand)\n- [getPackageManagerVersion](../../devkit/index#getpackagemanagerversion)\n- [getProjects](../../devkit/index#getprojects)\n- [getWorkspaceLayout](../../devkit/index#getworkspacelayout)\n- [getWorkspacePath](../../devkit/index#getworkspacepath)\n- [installPackagesTask](../../devkit/index#installpackagestask)\n- [isStandaloneProject](../../devkit/index#isstandaloneproject)\n- [joinPathFragments](../../devkit/index#joinpathfragments)\n- [mapRemotes](../../devkit/index#mapremotes)\n- [mapRemotesForSSR](../../devkit/index#mapremotesforssr)\n- [moveFilesToNewDirectory](../../devkit/index#movefilestonewdirectory)\n- [names](../../devkit/index#names)\n- [normalizePath](../../devkit/index#normalizepath)\n- [offsetFromRoot](../../devkit/index#offsetfromroot)\n- [parseJson](../../devkit/index#parsejson)\n- [parseTargetString](../../devkit/index#parsetargetstring)\n- [readAllWorkspaceConfiguration](../../devkit/index#readallworkspaceconfiguration)\n- [readCachedProjectGraph](../../devkit/index#readcachedprojectgraph)\n- [readJson](../../devkit/index#readjson)\n- [readJsonFile](../../devkit/index#readjsonfile)\n- [readNxJson](../../devkit/index#readnxjson)\n- [readProjectConfiguration](../../devkit/index#readprojectconfiguration)\n- [readRootPackageJson](../../devkit/index#readrootpackagejson)\n- [readTargetOptions](../../devkit/index#readtargetoptions)\n- [readWorkspaceConfiguration](../../devkit/index#readworkspaceconfiguration)\n- [removeDependenciesFromPackageJson](../../devkit/index#removedependenciesfrompackagejson)\n- [removeProjectConfiguration](../../devkit/index#removeprojectconfiguration)\n- [reverse](../../devkit/index#reverse)\n- [runExecutor](../../devkit/index#runexecutor)\n- [serializeJson](../../devkit/index#serializejson)\n- [sharePackages](../../devkit/index#sharepackages)\n- [shareWorkspaceLibraries](../../devkit/index#shareworkspacelibraries)\n- [stripIndents](../../devkit/index#stripindents)\n- [stripJsonComments](../../devkit/index#stripjsoncomments)\n- [targetToTargetString](../../devkit/index#targettotargetstring)\n- [toJS](../../devkit/index#tojs)\n- [updateJson](../../devkit/index#updatejson)\n- [updateProjectConfiguration](../../devkit/index#updateprojectconfiguration)\n- [updateTsConfigsToJs](../../devkit/index#updatetsconfigstojs)\n- [updateWorkspaceConfiguration](../../devkit/index#updateworkspaceconfiguration)\n- [visitNotIgnoredFiles](../../devkit/index#visitnotignoredfiles)\n- [workspaceLayout](../../devkit/index#workspacelayout)\n- [writeJson](../../devkit/index#writejson)\n- [writeJsonFile](../../devkit/index#writejsonfile)\n\n## Project Graph Enumerations\n\n### DependencyType\n\n• **DependencyType**: `Object`\n\n---\n\n## Utils Enumerations\n\n### ChangeType\n\n• **ChangeType**: `Object`\n\n## Project Graph Classes\n\n### ProjectGraphBuilder\n\n• **ProjectGraphBuilder**: `Object`\n\n---\n\n## Utils Classes\n\n### Hasher\n\n• **Hasher**: `Object`\n\n---\n\n## Workspace Classes\n\n### Workspaces\n\n• **Workspaces**: `Object`\n\n## Commands Interfaces\n\n### Target\n\n• **Target**: `Object`\n\n---\n\n## Other Interfaces\n\n### NxPlugin\n\n• **NxPlugin**: `Object`\n\nA plugin for Nx\n\n---\n\n## Project Graph Interfaces\n\n### FileData\n\n• **FileData**: `Object`\n\n---\n\n### ProjectFileMap\n\n• **ProjectFileMap**: `Object`\n\n---\n\n### ProjectGraph\n\n• **ProjectGraph**<`T`\\>: `Object`\n\n#### Type parameters\n\n| Name | Type |\n| :--- | :---- |\n| `T` | `any` |\n\n---\n\n### ProjectGraphDependency\n\n• **ProjectGraphDependency**: `Object`\n\n---\n\n### ProjectGraphExternalNode\n\n• **ProjectGraphExternalNode**: `Object`\n\n---\n\n### ProjectGraphProcessorContext\n\n• **ProjectGraphProcessorContext**: `Object`\n\n---\n\n### ProjectGraphProjectNode\n\n• **ProjectGraphProjectNode**<`T`\\>: `Object`\n\n#### Type parameters\n\n| Name | Type |\n| :--- | :---- |\n| `T` | `any` |\n\n---\n\n### ProjectGraphV4\n\n• **ProjectGraphV4**<`T`\\>: `Object`\n\n#### Type parameters\n\n| Name | Type |\n| :--- | :---- |\n| `T` | `any` |\n\n---\n\n## Tree Interfaces\n\n### FileChange\n\n• **FileChange**: `Object`\n\n---\n\n### Tree\n\n• **Tree**: `Object`\n\n---\n\n## Utils Interfaces\n\n### DefaultTasksRunnerOptions\n\n• **DefaultTasksRunnerOptions**: `Object`\n\n---\n\n### Hash\n\n• **Hash**: `Object`\n\n---\n\n### JsonParseOptions\n\n• **JsonParseOptions**: `Object`\n\n---\n\n### JsonSerializeOptions\n\n• **JsonSerializeOptions**: `Object`\n\n---\n\n### ModuleFederationConfig\n\n• **ModuleFederationConfig**: `Object`\n\n---\n\n### RemoteCache\n\n• **RemoteCache**: `Object`\n\n---\n\n### SharedLibraryConfig\n\n• **SharedLibraryConfig**: `Object`\n\n---\n\n### StringDeletion\n\n• **StringDeletion**: `Object`\n\n---\n\n### StringInsertion\n\n• **StringInsertion**: `Object`\n\n---\n\n## Workspace Interfaces\n\n### ExecutorContext\n\n• **ExecutorContext**: `Object`\n\n---\n\n### ExecutorsJson\n\n• **ExecutorsJson**: `Object`\n\n---\n\n### GeneratorsJson\n\n• **GeneratorsJson**: `Object`\n\n---\n\n### HasherContext\n\n• **HasherContext**: `Object`\n\n---\n\n### ImplicitJsonSubsetDependency\n\n• **ImplicitJsonSubsetDependency**<`T`\\>: `Object`\n\n#### Type parameters\n\n| Name | Type |\n| :--- | :------------------ |\n| `T` | `\"*\"` \\| `string`[] |\n\n---\n\n### MigrationsJson\n\n• **MigrationsJson**: `Object`\n\n---\n\n### NxAffectedConfig\n\n• **NxAffectedConfig**: `Object`\n\n---\n\n### NxJsonConfiguration\n\n• **NxJsonConfiguration**<`T`\\>: `Object`\n\n#### Type parameters\n\n| Name | Type |\n| :--- | :------------------ |\n| `T` | `\"*\"` \\| `string`[] |\n\n---\n\n### ProjectConfiguration\n\n• **ProjectConfiguration**: `Object`\n\n---\n\n### ProjectsConfigurations\n\n• **ProjectsConfigurations**: `Object`\n\n---\n\n### TargetConfiguration\n\n• **TargetConfiguration**<`T`\\>: `Object`\n\n#### Type parameters\n\n| Name | Type |\n| :--- | :---- |\n| `T` | `any` |\n\n---\n\n### TargetDependencyConfig\n\n• **TargetDependencyConfig**: `Object`\n\n---\n\n### Task\n\n• **Task**: `Object`\n\n---\n\n### TaskGraph\n\n• **TaskGraph**: `Object`\n\n---\n\n### Workspace\n\n• **Workspace**: `Object`\n\n## Generators Type aliases\n\n### WorkspaceConfiguration\n\nƬ **WorkspaceConfiguration**: `Omit`<[`ProjectsConfigurations`](../../devkit/index#projectsconfigurations), `\"projects\"`\\> & `Partial`<[`NxJsonConfiguration`](../../devkit/index#nxjsonconfiguration)\\>\n\n---\n\n## Other Type aliases\n\n### ProjectTargetConfigurator\n\nƬ **ProjectTargetConfigurator**: (`file`: `string`) => `Record`<`string`, [`TargetConfiguration`](../../devkit/index#targetconfiguration)\\>\n\n#### Type declaration\n\n▸ (`file`): `Record`<`string`, [`TargetConfiguration`](../../devkit/index#targetconfiguration)\\>\n\n##### Parameters\n\n| Name | Type |\n| :----- | :------- |\n| `file` | `string` |\n\n##### Returns\n\n`Record`<`string`, [`TargetConfiguration`](../../devkit/index#targetconfiguration)\\>\n\n---\n\n## Package Manager Type aliases\n\n### PackageManager\n\nƬ **PackageManager**: `\"yarn\"` \\| `\"pnpm\"` \\| `\"npm\"`\n\n---\n\n## Project Graph Type aliases\n\n### ProjectGraphNode\n\nƬ **ProjectGraphNode**<`T`\\>: [`ProjectGraphProjectNode`](../../devkit/index#projectgraphprojectnode)<`T`\\> \\| [`ProjectGraphExternalNode`](../../devkit/index#projectgraphexternalnode)\n\n#### Type parameters\n\n| Name | Type |\n| :--- | :---- |\n| `T` | `any` |\n\n---\n\n## Utils Type aliases\n\n### AdditionalSharedConfig\n\nƬ **AdditionalSharedConfig**: (`string` \\| [libraryName: string, sharedConfig: SharedLibraryConfig] \\| { `libraryName`: `string` ; `sharedConfig`: [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig) })[]\n\n---\n\n### ModuleFederationLibrary\n\nƬ **ModuleFederationLibrary**: `Object`\n\n#### Type declaration\n\n| Name | Type |\n| :----- | :------- |\n| `name` | `string` |\n| `type` | `string` |\n\n---\n\n### Remotes\n\nƬ **Remotes**: `string`[] \\| [remoteName: string, remoteUrl: string][]\n\n---\n\n### SharedFunction\n\nƬ **SharedFunction**: (`libraryName`: `string`, `sharedConfig`: [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)) => `undefined` \\| `false` \\| [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)\n\n#### Type declaration\n\n▸ (`libraryName`, `sharedConfig`): `undefined` \\| `false` \\| [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)\n\n##### Parameters\n\n| Name | Type |\n| :------------- | :-------------------------------------------------------------- |\n| `libraryName` | `string` |\n| `sharedConfig` | [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig) |\n\n##### Returns\n\n`undefined` \\| `false` \\| [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)\n\n---\n\n### SharedWorkspaceLibraryConfig\n\nƬ **SharedWorkspaceLibraryConfig**: `Object`\n\n#### Type declaration\n\n| Name | Type |\n| :--------------------- | :------------------------------------------------------------------------------------------------------------ |\n| `getAliases` | () => `Record`<`string`, `string`\\> |\n| `getLibraries` | (`eager?`: `boolean`) => `Record`<`string`, [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)\\> |\n| `getReplacementPlugin` | () => `NormalModuleReplacementPlugin` |\n\n---\n\n### StringChange\n\nƬ **StringChange**: [`StringInsertion`](../../devkit/index#stringinsertion) \\| [`StringDeletion`](../../devkit/index#stringdeletion)\n\n---\n\n### WorkspaceLibrary\n\nƬ **WorkspaceLibrary**: `Object`\n\n#### Type declaration\n\n| Name | Type |\n| :---------- | :---------------------- |\n| `importKey` | `string` \\| `undefined` |\n| `name` | `string` |\n| `root` | `string` |\n\n---\n\n### WorkspaceLibrarySecondaryEntryPoint\n\nƬ **WorkspaceLibrarySecondaryEntryPoint**: `Object`\n\n#### Type declaration\n\n| Name | Type |\n| :----- | :------- |\n| `name` | `string` |\n| `path` | `string` |\n\n---\n\n## Workspace Type aliases\n\n### CustomHasher\n\nƬ **CustomHasher**: (`task`: [`Task`](../../devkit/index#task), `context`: [`HasherContext`](../../devkit/index#hashercontext)) => `Promise`<[`Hash`](../../devkit/index#hash)\\>\n\n#### Type declaration\n\n▸ (`task`, `context`): `Promise`<[`Hash`](../../devkit/index#hash)\\>\n\n##### Parameters\n\n| Name | Type |\n| :-------- | :-------------------------------------------------- |\n| `task` | [`Task`](../../devkit/index#task) |\n| `context` | [`HasherContext`](../../devkit/index#hashercontext) |\n\n##### Returns\n\n`Promise`<[`Hash`](../../devkit/index#hash)\\>\n\n---\n\n### Executor\n\nƬ **Executor**<`T`\\>: (`options`: `T`, `context`: [`ExecutorContext`](../../devkit/index#executorcontext)) => `Promise`<`Object`\\> \\| `AsyncIterableIterator`<`Object`\\>\n\n#### Type parameters\n\n| Name | Type |\n| :--- | :---- |\n| `T` | `any` |\n\n#### Type declaration\n\n▸ (`options`, `context`): `Promise`<`Object`\\> \\| `AsyncIterableIterator`<`Object`\\>\n\nImplementation of a target of a project\n\n##### Parameters\n\n| Name | Type |\n| :-------- | :------------------------------------------------------ |\n| `options` | `T` |\n| `context` | [`ExecutorContext`](../../devkit/index#executorcontext) |\n\n##### Returns\n\n`Promise`<`Object`\\> \\| `AsyncIterableIterator`<`Object`\\>\n\n---\n\n### Generator\n\nƬ **Generator**<`T`\\>: (`tree`: `any`, `schema`: `T`) => `void` \\| [`GeneratorCallback`](../../devkit/index#generatorcallback) \\| `Promise`<`void` \\| [`GeneratorCallback`](../../devkit/index#generatorcallback)\\>\n\n#### Type parameters\n\n| Name | Type |\n| :--- | :-------- |\n| `T` | `unknown` |\n\n#### Type declaration\n\n▸ (`tree`, `schema`): `void` \\| [`GeneratorCallback`](../../devkit/index#generatorcallback) \\| `Promise`<`void` \\| [`GeneratorCallback`](../../devkit/index#generatorcallback)\\>\n\nA function that schedules updates to the filesystem to be done atomically\n\n##### Parameters\n\n| Name | Type |\n| :------- | :---- |\n| `tree` | `any` |\n| `schema` | `T` |\n\n##### Returns\n\n`void` \\| [`GeneratorCallback`](../../devkit/index#generatorcallback) \\| `Promise`<`void` \\| [`GeneratorCallback`](../../devkit/index#generatorcallback)\\>\n\n---\n\n### GeneratorCallback\n\nƬ **GeneratorCallback**: () => `void` \\| `Promise`<`void`\\>\n\n#### Type declaration\n\n▸ (): `void` \\| `Promise`<`void`\\>\n\nA callback function that is executed after changes are made to the file system\n\n##### Returns\n\n`void` \\| `Promise`<`void`\\>\n\n---\n\n### ImplicitDependencyEntry\n\nƬ **ImplicitDependencyEntry**<`T`\\>: `Object`\n\n#### Type parameters\n\n| Name | Type |\n| :--- | :------------------ |\n| `T` | `\"*\"` \\| `string`[] |\n\n#### Index signature\n\n▪ [key: `string`]: `T` \\| [`ImplicitJsonSubsetDependency`](../../devkit/index#implicitjsonsubsetdependency)<`T`\\>\n\n---\n\n### ProjectType\n\nƬ **ProjectType**: `\"library\"` \\| `\"application\"`\n\n---\n\n### TaskGraphExecutor\n\nƬ **TaskGraphExecutor**<`T`\\>: (`taskGraph`: [`TaskGraph`](../../devkit/index#taskgraph), `options`: `Record`<`string`, `T`\\>, `overrides`: `T`, `context`: [`ExecutorContext`](../../devkit/index#executorcontext)) => `Promise`<`Record`<`string`, `Object`\\>\\>\n\n#### Type parameters\n\n| Name | Type |\n| :--- | :---- |\n| `T` | `any` |\n\n#### Type declaration\n\n▸ (`taskGraph`, `options`, `overrides`, `context`): `Promise`<`Record`<`string`, `Object`\\>\\>\n\nImplementation of a target of a project that handles multiple projects to be batched\n\n##### Parameters\n\n| Name | Type |\n| :---------- | :------------------------------------------------------ |\n| `taskGraph` | [`TaskGraph`](../../devkit/index#taskgraph) |\n| `options` | `Record`<`string`, `T`\\> |\n| `overrides` | `T` |\n| `context` | [`ExecutorContext`](../../devkit/index#executorcontext) |\n\n##### Returns\n\n`Promise`<`Record`<`string`, `Object`\\>\\>\n\n---\n\n### WorkspaceJsonConfiguration\n\nƬ **WorkspaceJsonConfiguration**: [`ProjectsConfigurations`](../../devkit/index#projectsconfigurations)\n\n## Logger Variables\n\n### logger\n\n• **logger**: `Object`\n\n#### Type declaration\n\n| Name | Type |\n| :------ | :-------------------------- |\n| `debug` | (...`s`: `any`[]) => `void` |\n| `error` | (`s`: `any`) => `void` |\n| `fatal` | (...`s`: `any`[]) => `void` |\n| `info` | (`s`: `any`) => `void` |\n| `log` | (...`s`: `any`[]) => `void` |\n| `warn` | (`s`: `any`) => `void` |\n\n---\n\n## Utils Variables\n\n### appRootPath\n\n• **appRootPath**: `string` = `workspaceRoot`\n\n---\n\n### cacheDir\n\n• **cacheDir**: `string`\n\n---\n\n### output\n\n• **output**: `CLIOutput`\n\n---\n\n### workspaceRoot\n\n• **workspaceRoot**: `string`\n\n## Functions\n\n### addDependenciesToPackageJson\n\n▸ **addDependenciesToPackageJson**(`tree`, `dependencies`, `devDependencies`, `packageJsonPath?`): [`GeneratorCallback`](../../devkit/index#generatorcallback)\n\nAdd Dependencies and Dev Dependencies to package.json\n\nFor example:\n\n```typescript\naddDependenciesToPackageJson(tree, { react: 'latest' }, { jest: 'latest' });\n```\n\nThis will **add** `react` and `jest` to the dependencies and devDependencies sections of package.json respectively.\n\n#### Parameters\n\n| Name | Type | Default value | Description |\n| :---------------- | :-------------------------------- | :--------------- | :---------------------------------------------------------------------- |\n| `tree` | [`Tree`](../../devkit/index#tree) | `undefined` | Tree representing file system to modify |\n| `dependencies` | `Record`<`string`, `string`\\> | `undefined` | Dependencies to be added to the dependencies section of package.json |\n| `devDependencies` | `Record`<`string`, `string`\\> | `undefined` | Dependencies to be added to the devDependencies section of package.json |\n| `packageJsonPath` | `string` | `'package.json'` | Path to package.json |\n\n#### Returns\n\n[`GeneratorCallback`](../../devkit/index#generatorcallback)\n\nCallback to install dependencies only if necessary, no-op otherwise\n\n---\n\n### addProjectConfiguration\n\n▸ **addProjectConfiguration**(`tree`, `projectName`, `projectConfiguration`, `standalone?`): `void`\n\nAdds project configuration to the Nx workspace.\n\nThe project configuration is stored in workspace.json or the associated project.json file.\nThe utility will update either files.\n\n#### Parameters\n\n| Name | Type | Description |\n| :--------------------- | :---------------------------------------------------------------- | :----------------------------------------------------------------------------------------- |\n| `tree` | [`Tree`](../../devkit/index#tree) | the file system tree |\n| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) |\n| `projectConfiguration` | [`ProjectConfiguration`](../../devkit/index#projectconfiguration) | project configuration |\n| `standalone?` | `boolean` | should the project use package.json? If false, the project config is inside workspace.json |\n\n#### Returns\n\n`void`\n\n---\n\n### applyAdditionalShared\n\n▸ **applyAdditionalShared**(`sharedConfig`, `additionalShared`, `projectGraph`): `void`\n\nAdd additional dependencies to the shared package that may not have been\ndiscovered by the project graph.\n\nThis can be useful for applications that use a Dependency Injection system\nthat expects certain Singleton values to be present in the shared injection\nhierarchy.\n\n#### Parameters\n\n| Name | Type | Description |\n| :----------------- | :----------------------------------------------------------------------------------- | :--------------------------------- |\n| `sharedConfig` | `Record`<`string`, [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)\\> | The original Shared Config |\n| `additionalShared` | [`AdditionalSharedConfig`](../../devkit/index#additionalsharedconfig) | The additional dependencies to add |\n| `projectGraph` | [`ProjectGraph`](../../devkit/index#projectgraph)<`any`\\> | The Nx project graph |\n\n#### Returns\n\n`void`\n\n---\n\n### applyChangesToString\n\n▸ **applyChangesToString**(`text`, `changes`): `string`\n\nApplies a list of changes to a string's original value.\n\nThis is useful when working with ASTs.\n\nFor Example, to rename a property in a method's options:\n\n```typescript\nconst code = `bootstrap({\n target: document.querySelector('#app')\n})`;\n\nconst indexOfPropertyName = 13; // Usually determined by analyzing an AST.\nconst updatedCode = applyChangesToString(code, [\n {\n type: ChangeType.Insert,\n index: indexOfPropertyName,\n text: 'element',\n },\n {\n type: ChangeType.Delete,\n start: indexOfPropertyName,\n length: 6,\n },\n]);\n\nbootstrap({\n element: document.querySelector('#app'),\n});\n```\n\n#### Parameters\n\n| Name | Type |\n| :-------- | :-------------------------------------------------- |\n| `text` | `string` |\n| `changes` | [`StringChange`](../../devkit/index#stringchange)[] |\n\n#### Returns\n\n`string`\n\n---\n\n### applySharedFunction\n\n▸ **applySharedFunction**(`sharedConfig`, `sharedFn`): `void`\n\nApply a custom function provided by the user that will modify the Shared Config\nof the dependencies for the Module Federation build.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------------- | :----------------------------------------------------------------------------------- | :---------------------------------------- |\n| `sharedConfig` | `Record`<`string`, [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)\\> | The original Shared Config to be modified |\n| `sharedFn` | [`SharedFunction`](../../devkit/index#sharedfunction) | The custom function to run |\n\n#### Returns\n\n`void`\n\n---\n\n### convertNxExecutor\n\n▸ **convertNxExecutor**(`executor`): `any`\n\nConvert an Nx Executor into an Angular Devkit Builder\n\nUse this to expose a compatible Angular Builder\n\n#### Parameters\n\n| Name | Type |\n| :--------- | :------------------------------------------------ |\n| `executor` | [`Executor`](../../devkit/index#executor)<`any`\\> |\n\n#### Returns\n\n`any`\n\n---\n\n### convertNxGenerator\n\n▸ **convertNxGenerator**<`T`\\>(`generator`, `skipWritingConfigInOldFormat?`): (`generatorOptions`: `T`) => (`tree`: `any`, `context`: `any`) => `Promise`<`any`\\>\n\nConvert an Nx Generator into an Angular Devkit Schematic.\n\n#### Type parameters\n\n| Name | Type |\n| :--- | :---- |\n| `T` | `any` |\n\n#### Parameters\n\n| Name | Type | Default value | Description |\n| :----------------------------- | :------------------------------------------------ | :------------ | :------------------------------------------------------------------------------------------------ |\n| `generator` | [`Generator`](../../devkit/index#generator)<`T`\\> | `undefined` | The Nx generator to convert to an Angular Devkit Schematic. |\n| `skipWritingConfigInOldFormat` | `boolean` | `false` | Whether to skip writing the configuration in the old format (the one used by the Angular DevKit). |\n\n#### Returns\n\n`fn`\n\n▸ (`generatorOptions`): (`tree`: `any`, `context`: `any`) => `Promise`<`any`\\>\n\n##### Parameters\n\n| Name | Type |\n| :----------------- | :--- |\n| `generatorOptions` | `T` |\n\n##### Returns\n\n`fn`\n\n▸ (`tree`, `context`): `Promise`<`any`\\>\n\n##### Parameters\n\n| Name | Type |\n| :-------- | :---- |\n| `tree` | `any` |\n| `context` | `any` |\n\n##### Returns\n\n`Promise`<`any`\\>\n\n---\n\n### createProjectGraphAsync\n\n▸ **createProjectGraphAsync**(`opts?`): `Promise`<[`ProjectGraph`](../../devkit/index#projectgraph)\\>\n\nComputes and returns a ProjectGraph.\n\nNx will compute the graph either in a daemon process or in the current process.\n\nNx will compute it in the current process if:\n\n- The process is running in CI (CI env variable is to true or other common variables used by CI providers are set).\n- It is running in the docker container.\n- The daemon process is disabled because of the previous error when starting the daemon.\n- `NX_DAEMON` is set to `false`.\n- `useDaemon` is set to false in `nx.json`\n\n`NX_DAEMON` env variable takes precedence:\n\n- If it is set to true, the daemon will always be used.\n- If it is set to false, the graph will always be computed in the current process.\n\nTip: If you want to debug project graph creation, run your command with NX_DAEMON=false.\n\nNx uses two layers of caching: the information about explicit dependencies stored on the disk and the information\nstored in the daemon process. To reset both run: `nx reset`.\n\n#### Parameters\n\n| Name | Type |\n| :------------------------ | :-------- |\n| `opts` | `Object` |\n| `opts.exitOnError` | `boolean` |\n| `opts.resetDaemonClient?` | `boolean` |\n\n#### Returns\n\n`Promise`<[`ProjectGraph`](../../devkit/index#projectgraph)\\>\n\n---\n\n### defaultTasksRunner\n\n▸ `Const` **defaultTasksRunner**(`tasks`, `options`, `context?`): `any`\n\n#### Parameters\n\n| Name | Type |\n| :--------------------------- | :------------------------------------------------------------------------------------ |\n| `tasks` | [`Task`](../../devkit/index#task)[] |\n| `options` | [`DefaultTasksRunnerOptions`](../../devkit/index#defaulttasksrunneroptions) |\n| `context?` | `Object` |\n| `context.daemon?` | `DaemonClient` |\n| `context.hasher?` | [`Hasher`](../../devkit/index#hasher) |\n| `context.initiatingProject?` | `string` |\n| `context.nxArgs` | `NxArgs` |\n| `context.nxJson` | [`NxJsonConfiguration`](../../devkit/index#nxjsonconfiguration)<`string`[] \\| `\"*\"`\\> |\n| `context.projectGraph` | [`ProjectGraph`](../../devkit/index#projectgraph)<`any`\\> |\n| `context.target?` | `string` |\n| `context.taskGraph?` | [`TaskGraph`](../../devkit/index#taskgraph) |\n\n#### Returns\n\n`any`\n\n---\n\n### detectPackageManager\n\n▸ **detectPackageManager**(`dir?`): [`PackageManager`](../../devkit/index#packagemanager)\n\nDetects which package manager is used in the workspace based on the lock file.\n\n#### Parameters\n\n| Name | Type | Default value |\n| :---- | :------- | :------------ |\n| `dir` | `string` | `''` |\n\n#### Returns\n\n[`PackageManager`](../../devkit/index#packagemanager)\n\n---\n\n### detectWorkspaceScope\n\n▸ **detectWorkspaceScope**(`packageName`): `string`\n\nDetect workspace scope from the package.json name\n\n#### Parameters\n\n| Name | Type |\n| :------------ | :------- |\n| `packageName` | `string` |\n\n#### Returns\n\n`string`\n\n---\n\n### formatFiles\n\n▸ **formatFiles**(`tree`): `Promise`<`void`\\>\n\nFormats all the created or updated files using Prettier\n\n#### Parameters\n\n| Name | Type | Description |\n| :----- | :-------------------------------- | :------------------- |\n| `tree` | [`Tree`](../../devkit/index#tree) | the file system tree |\n\n#### Returns\n\n`Promise`<`void`\\>\n\n---\n\n### generateFiles\n\n▸ **generateFiles**(`tree`, `srcFolder`, `target`, `substitutions`): `void`\n\nGenerates a folder of files based on provided templates.\n\nWhile doing so it performs two substitutions:\n\n- Substitutes segments of file names surrounded by \\_\\_\n- Uses ejs to substitute values in templates\n\nExamples:\n\n```typescript\ngenerateFiles(tree, path.join(__dirname, 'files'), './tools/scripts', {\n tmpl: '',\n name: 'myscript',\n});\n```\n\nThis command will take all the files from the `files` directory next to the place where the command is invoked from.\nIt will replace all `__tmpl__` with '' and all `__name__` with 'myscript' in the file names, and will replace all\n`<%= name %>` with `myscript` in the files themselves.\n`tmpl: ''` is a common pattern. With it you can name files like this: `index.ts__tmpl__`, so your editor\ndoesn't get confused about incorrect TypeScript files.\n\n#### Parameters\n\n| Name | Type | Description |\n| :-------------- | :-------------------------------- | :-------------------------------------------- |\n| `tree` | [`Tree`](../../devkit/index#tree) | the file system tree |\n| `srcFolder` | `string` | the source folder of files (absolute path) |\n| `target` | `string` | the target folder (relative to the tree root) |\n| `substitutions` | `Object` | an object of key-value pairs |\n\n#### Returns\n\n`void`\n\n---\n\n### getDependentPackagesForProject\n\n▸ **getDependentPackagesForProject**(`projectGraph`, `name`): `Object`\n\n#### Parameters\n\n| Name | Type |\n| :------------- | :-------------------------------------------------------- |\n| `projectGraph` | [`ProjectGraph`](../../devkit/index#projectgraph)<`any`\\> |\n| `name` | `string` |\n\n#### Returns\n\n`Object`\n\n| Name | Type |\n| :------------------- | :---------------------------------------------------------- |\n| `npmPackages` | `string`[] |\n| `workspaceLibraries` | [`WorkspaceLibrary`](../../devkit/index#workspacelibrary)[] |\n\n---\n\n### getImportPath\n\n▸ **getImportPath**(`npmScope`, `projectDirectory`): `string`\n\nPrefixes project name with npm scope\n\n#### Parameters\n\n| Name | Type |\n| :----------------- | :------- |\n| `npmScope` | `string` |\n| `projectDirectory` | `string` |\n\n#### Returns\n\n`string`\n\n---\n\n### getNpmPackageSharedConfig\n\n▸ **getNpmPackageSharedConfig**(`pkgName`, `version`): [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig) \\| `undefined`\n\nBuild the Module Federation Share Config for a specific package and the\nspecified version of that package.\n\n#### Parameters\n\n| Name | Type | Description |\n| :-------- | :------- | :----------------------------------------------------------------------------- |\n| `pkgName` | `string` | Name of the package to share |\n| `version` | `string` | Version of the package to require by other apps in the Module Federation setup |\n\n#### Returns\n\n[`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig) \\| `undefined`\n\n---\n\n### getOutputsForTargetAndConfiguration\n\n▸ **getOutputsForTargetAndConfiguration**(`task`, `node`): `string`[]\n\nReturns the list of outputs that will be cached.\n\n#### Parameters\n\n| Name | Type | Description |\n| :----- | :------------------------------------------------------------------------------ | :-------------------------------------------------------- |\n| `task` | `Pick`<[`Task`](../../devkit/index#task), `\"overrides\"` \\| `\"target\"`\\> | target + overrides |\n| `node` | [`ProjectGraphProjectNode`](../../devkit/index#projectgraphprojectnode)<`any`\\> | ProjectGraphProjectNode object that the task runs against |\n\n#### Returns\n\n`string`[]\n\n---\n\n### getPackageManagerCommand\n\n▸ **getPackageManagerCommand**(`packageManager?`): `PackageManagerCommands`\n\nReturns commands for the package manager used in the workspace.\nBy default, the package manager is derived based on the lock file,\nbut it can also be passed in explicitly.\n\nExample:\n\n```javascript\nexecSync(`${getPackageManagerCommand().addDev} my-dev-package`);\n```\n\n#### Parameters\n\n| Name | Type |\n| :--------------- | :---------------------------------------------------- |\n| `packageManager` | [`PackageManager`](../../devkit/index#packagemanager) |\n\n#### Returns\n\n`PackageManagerCommands`\n\n---\n\n### getPackageManagerVersion\n\n▸ **getPackageManagerVersion**(`packageManager?`): `string`\n\nReturns the version of the package manager used in the workspace.\nBy default, the package manager is derived based on the lock file,\nbut it can also be passed in explicitly.\n\n#### Parameters\n\n| Name | Type |\n| :--------------- | :---------------------------------------------------- |\n| `packageManager` | [`PackageManager`](../../devkit/index#packagemanager) |\n\n#### Returns\n\n`string`\n\n---\n\n### getProjects\n\n▸ **getProjects**(`tree`): `Map`<`string`, [`ProjectConfiguration`](../../devkit/index#projectconfiguration)\\>\n\nGet a map of all projects in a workspace.\n\nUse [readProjectConfiguration](../../devkit/index#readprojectconfiguration) if only one project is needed.\n\n#### Parameters\n\n| Name | Type |\n| :----- | :-------------------------------- |\n| `tree` | [`Tree`](../../devkit/index#tree) |\n\n#### Returns\n\n`Map`<`string`, [`ProjectConfiguration`](../../devkit/index#projectconfiguration)\\>\n\n---\n\n### getWorkspaceLayout\n\n▸ **getWorkspaceLayout**(`tree`): `Object`\n\nReturns workspace defaults. It includes defaults folders for apps and libs,\nand the default scope.\n\nExample:\n\n```typescript\n{ appsDir: 'apps', libsDir: 'libs', npmScope: 'myorg' }\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| :----- | :-------------------------------- | :--------------- |\n| `tree` | [`Tree`](../../devkit/index#tree) | file system tree |\n\n#### Returns\n\n`Object`\n\n| Name | Type |\n| :-------------------- | :-------- |\n| `appsDir` | `string` |\n| `libsDir` | `string` |\n| `npmScope` | `string` |\n| `standaloneAsDefault` | `boolean` |\n\n---\n\n### getWorkspacePath\n\n▸ **getWorkspacePath**(`tree`): `\"/angular.json\"` \\| `\"/workspace.json\"` \\| `null`\n\n#### Parameters\n\n| Name | Type |\n| :----- | :-------------------------------- |\n| `tree` | [`Tree`](../../devkit/index#tree) |\n\n#### Returns\n\n`\"/angular.json\"` \\| `\"/workspace.json\"` \\| `null`\n\n---\n\n### installPackagesTask\n\n▸ **installPackagesTask**(`tree`, `alwaysRun?`, `cwd?`, `packageManager?`): `void`\n\nRuns `npm install` or `yarn install`. It will skip running the install if\n`package.json` hasn't changed at all or it hasn't changed since the last invocation.\n\n#### Parameters\n\n| Name | Type | Default value | Description |\n| :--------------- | :---------------------------------------------------- | :------------ | :------------------------------------------------------------ |\n| `tree` | [`Tree`](../../devkit/index#tree) | `undefined` | the file system tree |\n| `alwaysRun` | `boolean` | `false` | always run the command even if `package.json` hasn't changed. |\n| `cwd` | `string` | `''` | - |\n| `packageManager` | [`PackageManager`](../../devkit/index#packagemanager) | `undefined` | - |\n\n#### Returns\n\n`void`\n\n---\n\n### isStandaloneProject\n\n▸ **isStandaloneProject**(`tree`, `project`): `boolean`\n\nReturns if a project has a standalone configuration (project.json).\n\n#### Parameters\n\n| Name | Type | Description |\n| :-------- | :-------------------------------- | :------------------- |\n| `tree` | [`Tree`](../../devkit/index#tree) | the file system tree |\n| `project` | `string` | the project name |\n\n#### Returns\n\n`boolean`\n\n---\n\n### joinPathFragments\n\n▸ **joinPathFragments**(...`fragments`): `string`\n\nNormalized path fragments and joins them\n\n#### Parameters\n\n| Name | Type |\n| :------------- | :--------- |\n| `...fragments` | `string`[] |\n\n#### Returns\n\n`string`\n\n---\n\n### mapRemotes\n\n▸ **mapRemotes**(`remotes`, `remoteEntryExt`, `determineRemoteUrl`): `Record`<`string`, `string`\\>\n\nMap remote names to a format that can be understood and used by Module\nFederation.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------------------- | :-------------------------------------- | :------------------------------------------------------- |\n| `remotes` | [`Remotes`](../../devkit/index#remotes) | The remotes to map |\n| `remoteEntryExt` | `\"js\"` \\| `\"mjs\"` | The file extension of the remoteEntry file |\n| `determineRemoteUrl` | (`remote`: `string`) => `string` | The function used to lookup the URL of the served remote |\n\n#### Returns\n\n`Record`<`string`, `string`\\>\n\n---\n\n### mapRemotesForSSR\n\n▸ **mapRemotesForSSR**(`remotes`, `remoteEntryExt`, `determineRemoteUrl`): `Record`<`string`, `string`\\>\n\nMap remote names to a format that can be understood and used by Module\nFederation.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------------------- | :-------------------------------------- | :------------------------------------------------------- |\n| `remotes` | [`Remotes`](../../devkit/index#remotes) | The remotes to map |\n| `remoteEntryExt` | `\"js\"` \\| `\"mjs\"` | The file extension of the remoteEntry file |\n| `determineRemoteUrl` | (`remote`: `string`) => `string` | The function used to lookup the URL of the served remote |\n\n#### Returns\n\n`Record`<`string`, `string`\\>\n\n---\n\n### moveFilesToNewDirectory\n\n▸ **moveFilesToNewDirectory**(`tree`, `oldDir`, `newDir`): `void`\n\nAnalogous to cp -r oldDir newDir\n\n#### Parameters\n\n| Name | Type |\n| :------- | :-------------------------------- |\n| `tree` | [`Tree`](../../devkit/index#tree) |\n| `oldDir` | `string` |\n| `newDir` | `string` |\n\n#### Returns\n\n`void`\n\n---\n\n### names\n\n▸ **names**(`name`): `Object`\n\nUtil function to generate different strings based off the provided name.\n\nExamples:\n\n```typescript\nnames('my-name'); // {name: 'my-name', className: 'MyName', propertyName: 'myName', constantName: 'MY_NAME', fileName: 'my-name'}\nnames('myName'); // {name: 'myName', className: 'MyName', propertyName: 'myName', constantName: 'MY_NAME', fileName: 'my-name'}\n```\n\n#### Parameters\n\n| Name | Type |\n| :----- | :------- |\n| `name` | `string` |\n\n#### Returns\n\n`Object`\n\n| Name | Type |\n| :------------- | :------- |\n| `className` | `string` |\n| `constantName` | `string` |\n| `fileName` | `string` |\n| `name` | `string` |\n| `propertyName` | `string` |\n\n---\n\n### normalizePath\n\n▸ **normalizePath**(`osSpecificPath`): `string`\n\nCoverts an os specific path to a unix style path\n\n#### Parameters\n\n| Name | Type |\n| :--------------- | :------- |\n| `osSpecificPath` | `string` |\n\n#### Returns\n\n`string`\n\n---\n\n### offsetFromRoot\n\n▸ **offsetFromRoot**(`fullPathToDir`): `string`\n\nCalculates an offset from the root of the workspace, which is useful for\nconstructing relative URLs.\n\nExamples:\n\n```typescript\noffsetFromRoot('apps/mydir/myapp/'); // returns \"../../../\"\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| :-------------- | :------- | :------------- |\n| `fullPathToDir` | `string` | directory path |\n\n#### Returns\n\n`string`\n\n---\n\n### parseJson\n\n▸ **parseJson**<`T`\\>(`input`, `options?`): `T`\n\nParses the given JSON string and returns the object the JSON content represents.\nBy default javascript-style comments are allowed.\n\n#### Type parameters\n\n| Name | Type |\n| :--- | :----------------------- |\n| `T` | extends `object` = `any` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :--------- | :-------------------------------------------------------- | :--------------------- |\n| `input` | `string` | JSON content as string |\n| `options?` | [`JsonParseOptions`](../../devkit/index#jsonparseoptions) | JSON parse options |\n\n#### Returns\n\n`T`\n\nObject the JSON content represents\n\n---\n\n### parseTargetString\n\n▸ **parseTargetString**(`targetString`): [`Target`](../../devkit/index#target)\n\nParses a target string into {project, target, configuration}\n\nExamples:\n\n```typescript\nparseTargetString('proj:test'); // returns { project: \"proj\", target: \"test\" }\nparseTargetString('proj:test:production'); // returns { project: \"proj\", target: \"test\", configuration: \"production\" }\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| :------------- | :------- | :--------------- |\n| `targetString` | `string` | target reference |\n\n#### Returns\n\n[`Target`](../../devkit/index#target)\n\n---\n\n### readAllWorkspaceConfiguration\n\n▸ **readAllWorkspaceConfiguration**(): [`ProjectsConfigurations`](../../devkit/index#projectsconfigurations) & [`NxJsonConfiguration`](../../devkit/index#nxjsonconfiguration)\n\n**`deprecated`** Use readProjectsConfigurationFromProjectGraph(await createProjectGraphAsync())\n\n#### Returns\n\n[`ProjectsConfigurations`](../../devkit/index#projectsconfigurations) & [`NxJsonConfiguration`](../../devkit/index#nxjsonconfiguration)\n\n---\n\n### readCachedProjectGraph\n\n▸ **readCachedProjectGraph**(): [`ProjectGraph`](../../devkit/index#projectgraph)<[`ProjectConfiguration`](../../devkit/index#projectconfiguration)\\>\n\nSynchronously reads the latest cached copy of the workspace's ProjectGraph.\n\n**`throws`** {Error} if there is no cached ProjectGraph to read from\n\n#### Returns\n\n[`ProjectGraph`](../../devkit/index#projectgraph)<[`ProjectConfiguration`](../../devkit/index#projectconfiguration)\\>\n\n---\n\n### readJson\n\n▸ **readJson**<`T`\\>(`tree`, `path`, `options?`): `T`\n\nReads a json file, removes all comments and parses JSON.\n\n#### Type parameters\n\n| Name | Type |\n| :--- | :----------------------- |\n| `T` | extends `object` = `any` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :--------- | :-------------------------------------------------------- | :-------------------------- |\n| `tree` | [`Tree`](../../devkit/index#tree) | file system tree |\n| `path` | `string` | file path |\n| `options?` | [`JsonParseOptions`](../../devkit/index#jsonparseoptions) | Optional JSON Parse Options |\n\n#### Returns\n\n`T`\n\n---\n\n### readJsonFile\n\n▸ **readJsonFile**<`T`\\>(`path`, `options?`): `T`\n\nReads a JSON file and returns the object the JSON content represents.\n\n#### Type parameters\n\n| Name | Type |\n| :--- | :----------------------- |\n| `T` | extends `object` = `any` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :--------- | :---------------- | :----------------- |\n| `path` | `string` | A path to a file. |\n| `options?` | `JsonReadOptions` | JSON parse options |\n\n#### Returns\n\n`T`\n\nObject the JSON content of the file represents\n\n---\n\n### readNxJson\n\n▸ **readNxJson**(): [`NxJsonConfiguration`](../../devkit/index#nxjsonconfiguration)\n\n#### Returns\n\n[`NxJsonConfiguration`](../../devkit/index#nxjsonconfiguration)\n\n---\n\n### readProjectConfiguration\n\n▸ **readProjectConfiguration**(`tree`, `projectName`): [`ProjectConfiguration`](../../devkit/index#projectconfiguration)\n\nReads a project configuration.\n\nThe project configuration is stored in workspace.json or the associated project.json file.\nThe utility will read from either file.\n\n**`throws`** If supplied projectName cannot be found\n\n#### Parameters\n\n| Name | Type | Description |\n| :------------ | :-------------------------------- | :---------------------------------------------------------------------- |\n| `tree` | [`Tree`](../../devkit/index#tree) | the file system tree |\n| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) |\n\n#### Returns\n\n[`ProjectConfiguration`](../../devkit/index#projectconfiguration)\n\n---\n\n### readRootPackageJson\n\n▸ **readRootPackageJson**(): `Object`\n\n#### Returns\n\n`Object`\n\n| Name | Type |\n| :----------------- | :------- |\n| `dependencies?` | `Object` |\n| `devDependencies?` | `Object` |\n\n---\n\n### readTargetOptions\n\n▸ **readTargetOptions**<`T`\\>(`__namedParameters`, `context`): `T`\n\nReads and combines options for a given target.\n\nWorks as if you invoked the target yourself without passing any command lint overrides.\n\n#### Type parameters\n\n| Name | Type |\n| :--- | :---- |\n| `T` | `any` |\n\n#### Parameters\n\n| Name | Type |\n| :------------------ | :------------------------------------------------------ |\n| `__namedParameters` | [`Target`](../../devkit/index#target) |\n| `context` | [`ExecutorContext`](../../devkit/index#executorcontext) |\n\n#### Returns\n\n`T`\n\n---\n\n### readWorkspaceConfiguration\n\n▸ **readWorkspaceConfiguration**(`tree`): [`WorkspaceConfiguration`](../../devkit/index#workspaceconfiguration)\n\nRead general workspace configuration such as the default project or cli settings\n\nThis does _not_ provide projects configuration, use [readProjectConfiguration](../../devkit/index#readprojectconfiguration) instead.\n\n#### Parameters\n\n| Name | Type |\n| :----- | :-------------------------------- |\n| `tree` | [`Tree`](../../devkit/index#tree) |\n\n#### Returns\n\n[`WorkspaceConfiguration`](../../devkit/index#workspaceconfiguration)\n\n---\n\n### removeDependenciesFromPackageJson\n\n▸ **removeDependenciesFromPackageJson**(`tree`, `dependencies`, `devDependencies`, `packageJsonPath?`): [`GeneratorCallback`](../../devkit/index#generatorcallback)\n\nRemove Dependencies and Dev Dependencies from package.json\n\nFor example:\n\n```typescript\nremoveDependenciesFromPackageJson(tree, ['react'], ['jest']);\n```\n\nThis will **remove** `react` and `jest` from the dependencies and devDependencies sections of package.json respectively.\n\n#### Parameters\n\n| Name | Type | Default value | Description |\n| :---------------- | :-------------------------------- | :--------------- | :-------------------------------------------------------------------------- |\n| `tree` | [`Tree`](../../devkit/index#tree) | `undefined` | - |\n| `dependencies` | `string`[] | `undefined` | Dependencies to be removed from the dependencies section of package.json |\n| `devDependencies` | `string`[] | `undefined` | Dependencies to be removed from the devDependencies section of package.json |\n| `packageJsonPath` | `string` | `'package.json'` | - |\n\n#### Returns\n\n[`GeneratorCallback`](../../devkit/index#generatorcallback)\n\nCallback to uninstall dependencies only if necessary. undefined is returned if changes are not necessary.\n\n---\n\n### removeProjectConfiguration\n\n▸ **removeProjectConfiguration**(`tree`, `projectName`): `void`\n\nRemoves the configuration of an existing project.\n\nThe project configuration is stored in workspace.json or the associated project.json file.\nThe utility will update either file.\n\n#### Parameters\n\n| Name | Type |\n| :------------ | :-------------------------------- |\n| `tree` | [`Tree`](../../devkit/index#tree) |\n| `projectName` | `string` |\n\n#### Returns\n\n`void`\n\n---\n\n### reverse\n\n▸ **reverse**(`graph`): [`ProjectGraph`](../../devkit/index#projectgraph)\n\nReturns a new project graph where all the edges are reversed.\n\nFor instance, if project A depends on B, in the reversed graph\nB will depend on A.\n\n#### Parameters\n\n| Name | Type |\n| :------ | :-------------------------------------------------------- |\n| `graph` | [`ProjectGraph`](../../devkit/index#projectgraph)<`any`\\> |\n\n#### Returns\n\n[`ProjectGraph`](../../devkit/index#projectgraph)\n\n---\n\n### runExecutor\n\n▸ **runExecutor**<`T`\\>(`targetDescription`, `overrides`, `context`): `Promise`<`AsyncIterableIterator`<`T`\\>\\>\n\nLoads and invokes executor.\n\nThis is analogous to invoking executor from the terminal, with the exception\nthat the params aren't parsed from the string, but instead provided parsed already.\n\nApart from that, it works the same way:\n\n- it will load the workspace configuration\n- it will resolve the target\n- it will load the executor and the schema\n- it will load the options for the appropriate configuration\n- it will run the validations and will set the default\n- and, of course, it will invoke the executor\n\nExample:\n\n```typescript\nfor await (const s of await runExecutor(\n { project: 'myproj', target: 'serve' },\n { watch: true },\n context\n)) {\n // s.success\n}\n```\n\nNote that the return value is a promise of an iterator, so you need to await before iterating over it.\n\n#### Type parameters\n\n| Name | Type |\n| :--- | :--------------- |\n| `T` | extends `Object` |\n\n#### Parameters\n\n| Name | Type |\n| :--------------------------------- | :------------------------------------------------------ |\n| `targetDescription` | `Object` |\n| `targetDescription.configuration?` | `string` |\n| `targetDescription.project` | `string` |\n| `targetDescription.target` | `string` |\n| `overrides` | `Object` |\n| `context` | [`ExecutorContext`](../../devkit/index#executorcontext) |\n\n#### Returns\n\n`Promise`<`AsyncIterableIterator`<`T`\\>\\>\n\n---\n\n### serializeJson\n\n▸ **serializeJson**<`T`\\>(`input`, `options?`): `string`\n\nSerializes the given data to a JSON string.\nBy default the JSON string is formatted with a 2 space intendation to be easy readable.\n\n#### Type parameters\n\n| Name | Type |\n| :--- | :-------------------------- |\n| `T` | extends `object` = `object` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :--------- | :---------------------------------------------------------------- | :---------------------------------------- |\n| `input` | `T` | Object which should be serialized to JSON |\n| `options?` | [`JsonSerializeOptions`](../../devkit/index#jsonserializeoptions) | JSON serialize options |\n\n#### Returns\n\n`string`\n\nthe formatted JSON representation of the object\n\n---\n\n### sharePackages\n\n▸ **sharePackages**(`packages`): `Record`<`string`, [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)\\>\n\nCreate a dictionary of packages and their Module Federation Shared Config\nfrom an array of package names.\n\nLookup the versions of the packages from the root package.json file in the\nworkspace.\n\n#### Parameters\n\n| Name | Type | Description |\n| :--------- | :--------- | :-------------------------------- |\n| `packages` | `string`[] | Array of package names as strings |\n\n#### Returns\n\n`Record`<`string`, [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)\\>\n\n---\n\n### shareWorkspaceLibraries\n\n▸ **shareWorkspaceLibraries**(`libraries`, `tsConfigPath?`): [`SharedWorkspaceLibraryConfig`](../../devkit/index#sharedworkspacelibraryconfig)\n\nBuild an object of functions to be used with the ModuleFederationPlugin to\nshare Nx Workspace Libraries between Hosts and Remotes.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------------- | :---------------------------------------------------------- | :--------------------------------------------------------------------------- |\n| `libraries` | [`WorkspaceLibrary`](../../devkit/index#workspacelibrary)[] | The Nx Workspace Libraries to share |\n| `tsConfigPath` | `string` | The path to TS Config File that contains the Path Mappings for the Libraries |\n\n#### Returns\n\n[`SharedWorkspaceLibraryConfig`](../../devkit/index#sharedworkspacelibraryconfig)\n\n---\n\n### stripIndents\n\n▸ **stripIndents**(`strings`, ...`values`): `string`\n\nRemoves indents, which is useful for printing warning and messages.\n\nExample:\n\n```typescript\nstripIndents`\n Options:\n - option1\n - option2\n`;\n```\n\n#### Parameters\n\n| Name | Type |\n| :---------- | :--------------------- |\n| `strings` | `TemplateStringsArray` |\n| `...values` | `any`[] |\n\n#### Returns\n\n`string`\n\n---\n\n### stripJsonComments\n\n▸ `Const` **stripJsonComments**(`text`, `replaceCh?`): `string`\n\nTakes JSON with JavaScript-style comments and remove\nthem. Optionally replaces every none-newline character\nof comments with a replaceCharacter\n\n#### Parameters\n\n| Name | Type |\n| :----------- | :------- |\n| `text` | `string` |\n| `replaceCh?` | `string` |\n\n#### Returns\n\n`string`\n\n---\n\n### targetToTargetString\n\n▸ **targetToTargetString**(`target`): `string`\n\nReturns a string in the format \"project:target[:configuration]\" for the target\n\n#### Parameters\n\n| Name | Type | Description |\n| :------- | :------------------------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `target` | [`Target`](../../devkit/index#target) | target object Examples: `typescript targetToTargetString({ project: \"proj\", target: \"test\" }) // returns \"proj:test\" targetToTargetString({ project: \"proj\", target: \"test\", configuration: \"production\" }) // returns \"proj:test:production\" ` |\n\n#### Returns\n\n`string`\n\n---\n\n### toJS\n\n▸ **toJS**(`tree`): `void`\n\nRename and transpile any new typescript files created to javascript files\n\n#### Parameters\n\n| Name | Type |\n| :----- | :-------------------------------- |\n| `tree` | [`Tree`](../../devkit/index#tree) |\n\n#### Returns\n\n`void`\n\n---\n\n### updateJson\n\n▸ **updateJson**<`T`, `U`\\>(`tree`, `path`, `updater`, `options?`): `void`\n\nUpdates a JSON value to the file system tree\n\n#### Type parameters\n\n| Name | Type |\n| :--- | :----------------------- |\n| `T` | extends `object` = `any` |\n| `U` | extends `object` = `T` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :--------- | :---------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------- |\n| `tree` | [`Tree`](../../devkit/index#tree) | File system tree |\n| `path` | `string` | Path of JSON file in the Tree |\n| `updater` | (`value`: `T`) => `U` | Function that maps the current value of a JSON document to a new value to be written to the document |\n| `options?` | [`JsonParseOptions`](../../devkit/index#jsonparseoptions) & [`JsonSerializeOptions`](../../devkit/index#jsonserializeoptions) | Optional JSON Parse and Serialize Options |\n\n#### Returns\n\n`void`\n\n---\n\n### updateProjectConfiguration\n\n▸ **updateProjectConfiguration**(`tree`, `projectName`, `projectConfiguration`): `void`\n\nUpdates the configuration of an existing project.\n\nThe project configuration is stored in workspace.json or the associated project.json file.\nThe utility will update either files.\n\n#### Parameters\n\n| Name | Type | Description |\n| :--------------------- | :---------------------------------------------------------------- | :---------------------------------------------------------------------- |\n| `tree` | [`Tree`](../../devkit/index#tree) | the file system tree |\n| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) |\n| `projectConfiguration` | [`ProjectConfiguration`](../../devkit/index#projectconfiguration) | project configuration |\n\n#### Returns\n\n`void`\n\n---\n\n### updateTsConfigsToJs\n\n▸ **updateTsConfigsToJs**(`tree`, `options`): `void`\n\n#### Parameters\n\n| Name | Type |\n| :-------------------- | :-------------------------------- |\n| `tree` | [`Tree`](../../devkit/index#tree) |\n| `options` | `Object` |\n| `options.projectRoot` | `string` |\n\n#### Returns\n\n`void`\n\n---\n\n### updateWorkspaceConfiguration\n\n▸ **updateWorkspaceConfiguration**(`tree`, `workspaceConfig`): `void`\n\nUpdate general workspace configuration such as the default project or cli settings.\n\nThis does _not_ update projects configuration, use [updateProjectConfiguration](../../devkit/index#updateprojectconfiguration) or [addProjectConfiguration](../../devkit/index#addprojectconfiguration) instead.\n\n#### Parameters\n\n| Name | Type |\n| :---------------- | :-------------------------------------------------------------------- |\n| `tree` | [`Tree`](../../devkit/index#tree) |\n| `workspaceConfig` | [`WorkspaceConfiguration`](../../devkit/index#workspaceconfiguration) |\n\n#### Returns\n\n`void`\n\n---\n\n### visitNotIgnoredFiles\n\n▸ **visitNotIgnoredFiles**(`tree`, `dirPath?`, `visitor`): `void`\n\nUtility to act on all files in a tree that are not ignored by git.\n\n#### Parameters\n\n| Name | Type | Default value |\n| :-------- | :-------------------------------- | :------------ |\n| `tree` | [`Tree`](../../devkit/index#tree) | `undefined` |\n| `dirPath` | `string` | `tree.root` |\n| `visitor` | (`path`: `string`) => `void` | `undefined` |\n\n#### Returns\n\n`void`\n\n---\n\n### workspaceLayout\n\n▸ **workspaceLayout**(): `Object`\n\nReturns information about where apps and libs will be created.\n\n#### Returns\n\n`Object`\n\n| Name | Type |\n| :-------- | :------- |\n| `appsDir` | `string` |\n| `libsDir` | `string` |\n\n---\n\n### writeJson\n\n▸ **writeJson**<`T`\\>(`tree`, `path`, `value`, `options?`): `void`\n\nWrites a JSON value to the file system tree\n\n#### Type parameters\n\n| Name | Type |\n| :--- | :-------------------------- |\n| `T` | extends `object` = `object` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :--------- | :---------------------------------------------------------------- | :------------------------------ |\n| `tree` | [`Tree`](../../devkit/index#tree) | File system tree |\n| `path` | `string` | Path of JSON file in the Tree |\n| `value` | `T` | Serializable value to write |\n| `options?` | [`JsonSerializeOptions`](../../devkit/index#jsonserializeoptions) | Optional JSON Serialize Options |\n\n#### Returns\n\n`void`\n\n---\n\n### writeJsonFile\n\n▸ **writeJsonFile**<`T`\\>(`path`, `data`, `options?`): `void`\n\nSerializes the given data to JSON and writes it to a file.\n\n#### Type parameters\n\n| Name | Type |\n| :--- | :-------------------------- |\n| `T` | extends `object` = `object` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :--------- | :----------------- | :-------------------------------------------------------------- |\n| `path` | `string` | A path to a file. |\n| `data` | `T` | data which should be serialized to JSON and written to the file |\n| `options?` | `JsonWriteOptions` | JSON serialize options |\n\n#### Returns\n\n`void`\n" + "content": "# Module: index\n\nThe Nx Devkit is the underlying technology used to customize Nx to support\ndifferent technologies and custom use-cases. It contains many utility\nfunctions for reading and writing files, updating configuration,\nworking with Abstract Syntax Trees(ASTs), and more.\n\nAs with most things in Nx, the core of Nx Devkit is very simple.\nIt only uses language primitives and immutable objects\n(the tree being the only exception).\n\n## Table of contents\n\n### Project Graph Enumerations\n\n- [DependencyType](../../devkit/index#dependencytype)\n\n### Utils Enumerations\n\n- [ChangeType](../../devkit/index#changetype)\n\n### Project Graph Classes\n\n- [ProjectGraphBuilder](../../devkit/index#projectgraphbuilder)\n\n### Utils Classes\n\n- [Hasher](../../devkit/index#hasher)\n\n### Workspace Classes\n\n- [Workspaces](../../devkit/index#workspaces)\n\n### Commands Interfaces\n\n- [Target](../../devkit/index#target)\n\n### Other Interfaces\n\n- [NxPlugin](../../devkit/index#nxplugin)\n\n### Project Graph Interfaces\n\n- [FileData](../../devkit/index#filedata)\n- [ProjectFileMap](../../devkit/index#projectfilemap)\n- [ProjectGraph](../../devkit/index#projectgraph)\n- [ProjectGraphDependency](../../devkit/index#projectgraphdependency)\n- [ProjectGraphExternalNode](../../devkit/index#projectgraphexternalnode)\n- [ProjectGraphProcessorContext](../../devkit/index#projectgraphprocessorcontext)\n- [ProjectGraphProjectNode](../../devkit/index#projectgraphprojectnode)\n- [ProjectGraphV4](../../devkit/index#projectgraphv4)\n\n### Tree Interfaces\n\n- [FileChange](../../devkit/index#filechange)\n- [Tree](../../devkit/index#tree)\n\n### Utils Interfaces\n\n- [DefaultTasksRunnerOptions](../../devkit/index#defaulttasksrunneroptions)\n- [Hash](../../devkit/index#hash)\n- [JsonParseOptions](../../devkit/index#jsonparseoptions)\n- [JsonSerializeOptions](../../devkit/index#jsonserializeoptions)\n- [ModuleFederationConfig](../../devkit/index#modulefederationconfig)\n- [RemoteCache](../../devkit/index#remotecache)\n- [SharedLibraryConfig](../../devkit/index#sharedlibraryconfig)\n- [StringDeletion](../../devkit/index#stringdeletion)\n- [StringInsertion](../../devkit/index#stringinsertion)\n\n### Workspace Interfaces\n\n- [ExecutorContext](../../devkit/index#executorcontext)\n- [ExecutorsJson](../../devkit/index#executorsjson)\n- [GeneratorsJson](../../devkit/index#generatorsjson)\n- [HasherContext](../../devkit/index#hashercontext)\n- [ImplicitJsonSubsetDependency](../../devkit/index#implicitjsonsubsetdependency)\n- [MigrationsJson](../../devkit/index#migrationsjson)\n- [NxAffectedConfig](../../devkit/index#nxaffectedconfig)\n- [NxJsonConfiguration](../../devkit/index#nxjsonconfiguration)\n- [ProjectConfiguration](../../devkit/index#projectconfiguration)\n- [ProjectsConfigurations](../../devkit/index#projectsconfigurations)\n- [TargetConfiguration](../../devkit/index#targetconfiguration)\n- [TargetDependencyConfig](../../devkit/index#targetdependencyconfig)\n- [Task](../../devkit/index#task)\n- [TaskGraph](../../devkit/index#taskgraph)\n- [Workspace](../../devkit/index#workspace)\n\n### Generators Type aliases\n\n- [WorkspaceConfiguration](../../devkit/index#workspaceconfiguration)\n\n### Other Type aliases\n\n- [ProjectTargetConfigurator](../../devkit/index#projecttargetconfigurator)\n\n### Package Manager Type aliases\n\n- [PackageManager](../../devkit/index#packagemanager)\n\n### Project Graph Type aliases\n\n- [ProjectGraphNode](../../devkit/index#projectgraphnode)\n\n### Utils Type aliases\n\n- [AdditionalSharedConfig](../../devkit/index#additionalsharedconfig)\n- [ModuleFederationLibrary](../../devkit/index#modulefederationlibrary)\n- [Remotes](../../devkit/index#remotes)\n- [SharedFunction](../../devkit/index#sharedfunction)\n- [SharedWorkspaceLibraryConfig](../../devkit/index#sharedworkspacelibraryconfig)\n- [StringChange](../../devkit/index#stringchange)\n- [WorkspaceLibrary](../../devkit/index#workspacelibrary)\n- [WorkspaceLibrarySecondaryEntryPoint](../../devkit/index#workspacelibrarysecondaryentrypoint)\n\n### Workspace Type aliases\n\n- [CustomHasher](../../devkit/index#customhasher)\n- [Executor](../../devkit/index#executor)\n- [Generator](../../devkit/index#generator)\n- [GeneratorCallback](../../devkit/index#generatorcallback)\n- [ImplicitDependencyEntry](../../devkit/index#implicitdependencyentry)\n- [ProjectType](../../devkit/index#projecttype)\n- [TaskGraphExecutor](../../devkit/index#taskgraphexecutor)\n- [WorkspaceJsonConfiguration](../../devkit/index#workspacejsonconfiguration)\n\n### Logger Variables\n\n- [logger](../../devkit/index#logger)\n\n### Utils Variables\n\n- [appRootPath](../../devkit/index#approotpath)\n- [cacheDir](../../devkit/index#cachedir)\n- [output](../../devkit/index#output)\n- [workspaceRoot](../../devkit/index#workspaceroot)\n\n### Functions\n\n- [addDependenciesToPackageJson](../../devkit/index#adddependenciestopackagejson)\n- [addProjectConfiguration](../../devkit/index#addprojectconfiguration)\n- [applyAdditionalShared](../../devkit/index#applyadditionalshared)\n- [applyChangesToString](../../devkit/index#applychangestostring)\n- [applySharedFunction](../../devkit/index#applysharedfunction)\n- [convertNxExecutor](../../devkit/index#convertnxexecutor)\n- [convertNxGenerator](../../devkit/index#convertnxgenerator)\n- [createProjectGraphAsync](../../devkit/index#createprojectgraphasync)\n- [defaultTasksRunner](../../devkit/index#defaulttasksrunner)\n- [detectPackageManager](../../devkit/index#detectpackagemanager)\n- [detectWorkspaceScope](../../devkit/index#detectworkspacescope)\n- [formatFiles](../../devkit/index#formatfiles)\n- [generateFiles](../../devkit/index#generatefiles)\n- [getDependentPackagesForProject](../../devkit/index#getdependentpackagesforproject)\n- [getImportPath](../../devkit/index#getimportpath)\n- [getNpmPackageSharedConfig](../../devkit/index#getnpmpackagesharedconfig)\n- [getOutputsForTargetAndConfiguration](../../devkit/index#getoutputsfortargetandconfiguration)\n- [getPackageManagerCommand](../../devkit/index#getpackagemanagercommand)\n- [getPackageManagerVersion](../../devkit/index#getpackagemanagerversion)\n- [getProjects](../../devkit/index#getprojects)\n- [getWorkspaceLayout](../../devkit/index#getworkspacelayout)\n- [getWorkspacePath](../../devkit/index#getworkspacepath)\n- [installPackagesTask](../../devkit/index#installpackagestask)\n- [isStandaloneProject](../../devkit/index#isstandaloneproject)\n- [joinPathFragments](../../devkit/index#joinpathfragments)\n- [mapRemotes](../../devkit/index#mapremotes)\n- [mapRemotesForSSR](../../devkit/index#mapremotesforssr)\n- [moveFilesToNewDirectory](../../devkit/index#movefilestonewdirectory)\n- [names](../../devkit/index#names)\n- [normalizePath](../../devkit/index#normalizepath)\n- [offsetFromRoot](../../devkit/index#offsetfromroot)\n- [parseJson](../../devkit/index#parsejson)\n- [parseTargetString](../../devkit/index#parsetargetstring)\n- [readAllWorkspaceConfiguration](../../devkit/index#readallworkspaceconfiguration)\n- [readCachedProjectGraph](../../devkit/index#readcachedprojectgraph)\n- [readJson](../../devkit/index#readjson)\n- [readJsonFile](../../devkit/index#readjsonfile)\n- [readNxJson](../../devkit/index#readnxjson)\n- [readProjectConfiguration](../../devkit/index#readprojectconfiguration)\n- [readRootPackageJson](../../devkit/index#readrootpackagejson)\n- [readTargetOptions](../../devkit/index#readtargetoptions)\n- [readWorkspaceConfiguration](../../devkit/index#readworkspaceconfiguration)\n- [removeDependenciesFromPackageJson](../../devkit/index#removedependenciesfrompackagejson)\n- [removeProjectConfiguration](../../devkit/index#removeprojectconfiguration)\n- [reverse](../../devkit/index#reverse)\n- [runExecutor](../../devkit/index#runexecutor)\n- [serializeJson](../../devkit/index#serializejson)\n- [sharePackages](../../devkit/index#sharepackages)\n- [shareWorkspaceLibraries](../../devkit/index#shareworkspacelibraries)\n- [stripIndents](../../devkit/index#stripindents)\n- [stripJsonComments](../../devkit/index#stripjsoncomments)\n- [targetToTargetString](../../devkit/index#targettotargetstring)\n- [toJS](../../devkit/index#tojs)\n- [updateJson](../../devkit/index#updatejson)\n- [updateProjectConfiguration](../../devkit/index#updateprojectconfiguration)\n- [updateTsConfigsToJs](../../devkit/index#updatetsconfigstojs)\n- [updateWorkspaceConfiguration](../../devkit/index#updateworkspaceconfiguration)\n- [visitNotIgnoredFiles](../../devkit/index#visitnotignoredfiles)\n- [workspaceLayout](../../devkit/index#workspacelayout)\n- [writeJson](../../devkit/index#writejson)\n- [writeJsonFile](../../devkit/index#writejsonfile)\n\n## Project Graph Enumerations\n\n### DependencyType\n\n• **DependencyType**: `Object`\n\n___\n\n## Utils Enumerations\n\n### ChangeType\n\n• **ChangeType**: `Object`\n\n## Project Graph Classes\n\n### ProjectGraphBuilder\n\n• **ProjectGraphBuilder**: `Object`\n\n___\n\n## Utils Classes\n\n### Hasher\n\n• **Hasher**: `Object`\n\n___\n\n## Workspace Classes\n\n### Workspaces\n\n• **Workspaces**: `Object`\n\n## Commands Interfaces\n\n### Target\n\n• **Target**: `Object`\n\n___\n\n## Other Interfaces\n\n### NxPlugin\n\n• **NxPlugin**: `Object`\n\nA plugin for Nx\n\n___\n\n## Project Graph Interfaces\n\n### FileData\n\n• **FileData**: `Object`\n\n___\n\n### ProjectFileMap\n\n• **ProjectFileMap**: `Object`\n\n___\n\n### ProjectGraph\n\n• **ProjectGraph**<`T`\\>: `Object`\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | `any` |\n\n___\n\n### ProjectGraphDependency\n\n• **ProjectGraphDependency**: `Object`\n\n___\n\n### ProjectGraphExternalNode\n\n• **ProjectGraphExternalNode**: `Object`\n\n___\n\n### ProjectGraphProcessorContext\n\n• **ProjectGraphProcessorContext**: `Object`\n\n___\n\n### ProjectGraphProjectNode\n\n• **ProjectGraphProjectNode**<`T`\\>: `Object`\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | `any` |\n\n___\n\n### ProjectGraphV4\n\n• **ProjectGraphV4**<`T`\\>: `Object`\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | `any` |\n\n___\n\n## Tree Interfaces\n\n### FileChange\n\n• **FileChange**: `Object`\n\n___\n\n### Tree\n\n• **Tree**: `Object`\n\n___\n\n## Utils Interfaces\n\n### DefaultTasksRunnerOptions\n\n• **DefaultTasksRunnerOptions**: `Object`\n\n___\n\n### Hash\n\n• **Hash**: `Object`\n\n___\n\n### JsonParseOptions\n\n• **JsonParseOptions**: `Object`\n\n___\n\n### JsonSerializeOptions\n\n• **JsonSerializeOptions**: `Object`\n\n___\n\n### ModuleFederationConfig\n\n• **ModuleFederationConfig**: `Object`\n\n___\n\n### RemoteCache\n\n• **RemoteCache**: `Object`\n\n___\n\n### SharedLibraryConfig\n\n• **SharedLibraryConfig**: `Object`\n\n___\n\n### StringDeletion\n\n• **StringDeletion**: `Object`\n\n___\n\n### StringInsertion\n\n• **StringInsertion**: `Object`\n\n___\n\n## Workspace Interfaces\n\n### ExecutorContext\n\n• **ExecutorContext**: `Object`\n\n___\n\n### ExecutorsJson\n\n• **ExecutorsJson**: `Object`\n\n___\n\n### GeneratorsJson\n\n• **GeneratorsJson**: `Object`\n\n___\n\n### HasherContext\n\n• **HasherContext**: `Object`\n\n___\n\n### ImplicitJsonSubsetDependency\n\n• **ImplicitJsonSubsetDependency**<`T`\\>: `Object`\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | ``\"*\"`` \\| `string`[] |\n\n___\n\n### MigrationsJson\n\n• **MigrationsJson**: `Object`\n\n___\n\n### NxAffectedConfig\n\n• **NxAffectedConfig**: `Object`\n\n___\n\n### NxJsonConfiguration\n\n• **NxJsonConfiguration**<`T`\\>: `Object`\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | ``\"*\"`` \\| `string`[] |\n\n___\n\n### ProjectConfiguration\n\n• **ProjectConfiguration**: `Object`\n\n___\n\n### ProjectsConfigurations\n\n• **ProjectsConfigurations**: `Object`\n\n___\n\n### TargetConfiguration\n\n• **TargetConfiguration**<`T`\\>: `Object`\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | `any` |\n\n___\n\n### TargetDependencyConfig\n\n• **TargetDependencyConfig**: `Object`\n\n___\n\n### Task\n\n• **Task**: `Object`\n\n___\n\n### TaskGraph\n\n• **TaskGraph**: `Object`\n\n___\n\n### Workspace\n\n• **Workspace**: `Object`\n\n## Generators Type aliases\n\n### WorkspaceConfiguration\n\nƬ **WorkspaceConfiguration**: `Omit`<[`ProjectsConfigurations`](../../devkit/index#projectsconfigurations), ``\"projects\"``\\> & `Partial`<[`NxJsonConfiguration`](../../devkit/index#nxjsonconfiguration)\\>\n\n___\n\n## Other Type aliases\n\n### ProjectTargetConfigurator\n\nƬ **ProjectTargetConfigurator**: (`file`: `string`) => `Record`<`string`, [`TargetConfiguration`](../../devkit/index#targetconfiguration)\\>\n\n#### Type declaration\n\n▸ (`file`): `Record`<`string`, [`TargetConfiguration`](../../devkit/index#targetconfiguration)\\>\n\n##### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `file` | `string` |\n\n##### Returns\n\n`Record`<`string`, [`TargetConfiguration`](../../devkit/index#targetconfiguration)\\>\n\n___\n\n## Package Manager Type aliases\n\n### PackageManager\n\nƬ **PackageManager**: ``\"yarn\"`` \\| ``\"pnpm\"`` \\| ``\"npm\"``\n\n___\n\n## Project Graph Type aliases\n\n### ProjectGraphNode\n\nƬ **ProjectGraphNode**<`T`\\>: [`ProjectGraphProjectNode`](../../devkit/index#projectgraphprojectnode)<`T`\\> \\| [`ProjectGraphExternalNode`](../../devkit/index#projectgraphexternalnode)\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | `any` |\n\n___\n\n## Utils Type aliases\n\n### AdditionalSharedConfig\n\nƬ **AdditionalSharedConfig**: (`string` \\| [libraryName: string, sharedConfig: SharedLibraryConfig] \\| { `libraryName`: `string` ; `sharedConfig`: [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig) })[]\n\n___\n\n### ModuleFederationLibrary\n\nƬ **ModuleFederationLibrary**: `Object`\n\n#### Type declaration\n\n| Name | Type |\n| :------ | :------ |\n| `name` | `string` |\n| `type` | `string` |\n\n___\n\n### Remotes\n\nƬ **Remotes**: `string`[] \\| [remoteName: string, remoteUrl: string][]\n\n___\n\n### SharedFunction\n\nƬ **SharedFunction**: (`libraryName`: `string`, `sharedConfig`: [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)) => `undefined` \\| ``false`` \\| [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)\n\n#### Type declaration\n\n▸ (`libraryName`, `sharedConfig`): `undefined` \\| ``false`` \\| [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)\n\n##### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `libraryName` | `string` |\n| `sharedConfig` | [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig) |\n\n##### Returns\n\n`undefined` \\| ``false`` \\| [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)\n\n___\n\n### SharedWorkspaceLibraryConfig\n\nƬ **SharedWorkspaceLibraryConfig**: `Object`\n\n#### Type declaration\n\n| Name | Type |\n| :------ | :------ |\n| `getAliases` | () => `Record`<`string`, `string`\\> |\n| `getLibraries` | (`eager?`: `boolean`) => `Record`<`string`, [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)\\> |\n| `getReplacementPlugin` | () => `NormalModuleReplacementPlugin` |\n\n___\n\n### StringChange\n\nƬ **StringChange**: [`StringInsertion`](../../devkit/index#stringinsertion) \\| [`StringDeletion`](../../devkit/index#stringdeletion)\n\n___\n\n### WorkspaceLibrary\n\nƬ **WorkspaceLibrary**: `Object`\n\n#### Type declaration\n\n| Name | Type |\n| :------ | :------ |\n| `importKey` | `string` \\| `undefined` |\n| `name` | `string` |\n| `root` | `string` |\n\n___\n\n### WorkspaceLibrarySecondaryEntryPoint\n\nƬ **WorkspaceLibrarySecondaryEntryPoint**: `Object`\n\n#### Type declaration\n\n| Name | Type |\n| :------ | :------ |\n| `name` | `string` |\n| `path` | `string` |\n\n___\n\n## Workspace Type aliases\n\n### CustomHasher\n\nƬ **CustomHasher**: (`task`: [`Task`](../../devkit/index#task), `context`: [`HasherContext`](../../devkit/index#hashercontext)) => `Promise`<[`Hash`](../../devkit/index#hash)\\>\n\n#### Type declaration\n\n▸ (`task`, `context`): `Promise`<[`Hash`](../../devkit/index#hash)\\>\n\n##### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `task` | [`Task`](../../devkit/index#task) |\n| `context` | [`HasherContext`](../../devkit/index#hashercontext) |\n\n##### Returns\n\n`Promise`<[`Hash`](../../devkit/index#hash)\\>\n\n___\n\n### Executor\n\nƬ **Executor**<`T`\\>: (`options`: `T`, `context`: [`ExecutorContext`](../../devkit/index#executorcontext)) => `Promise`<`Object`\\> \\| `AsyncIterableIterator`<`Object`\\>\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | `any` |\n\n#### Type declaration\n\n▸ (`options`, `context`): `Promise`<`Object`\\> \\| `AsyncIterableIterator`<`Object`\\>\n\nImplementation of a target of a project\n\n##### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `options` | `T` |\n| `context` | [`ExecutorContext`](../../devkit/index#executorcontext) |\n\n##### Returns\n\n`Promise`<`Object`\\> \\| `AsyncIterableIterator`<`Object`\\>\n\n___\n\n### Generator\n\nƬ **Generator**<`T`\\>: (`tree`: `any`, `schema`: `T`) => `void` \\| [`GeneratorCallback`](../../devkit/index#generatorcallback) \\| `Promise`<`void` \\| [`GeneratorCallback`](../../devkit/index#generatorcallback)\\>\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | `unknown` |\n\n#### Type declaration\n\n▸ (`tree`, `schema`): `void` \\| [`GeneratorCallback`](../../devkit/index#generatorcallback) \\| `Promise`<`void` \\| [`GeneratorCallback`](../../devkit/index#generatorcallback)\\>\n\nA function that schedules updates to the filesystem to be done atomically\n\n##### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `tree` | `any` |\n| `schema` | `T` |\n\n##### Returns\n\n`void` \\| [`GeneratorCallback`](../../devkit/index#generatorcallback) \\| `Promise`<`void` \\| [`GeneratorCallback`](../../devkit/index#generatorcallback)\\>\n\n___\n\n### GeneratorCallback\n\nƬ **GeneratorCallback**: () => `void` \\| `Promise`<`void`\\>\n\n#### Type declaration\n\n▸ (): `void` \\| `Promise`<`void`\\>\n\nA callback function that is executed after changes are made to the file system\n\n##### Returns\n\n`void` \\| `Promise`<`void`\\>\n\n___\n\n### ImplicitDependencyEntry\n\nƬ **ImplicitDependencyEntry**<`T`\\>: `Object`\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | ``\"*\"`` \\| `string`[] |\n\n#### Index signature\n\n▪ [key: `string`]: `T` \\| [`ImplicitJsonSubsetDependency`](../../devkit/index#implicitjsonsubsetdependency)<`T`\\>\n\n___\n\n### ProjectType\n\nƬ **ProjectType**: ``\"library\"`` \\| ``\"application\"``\n\n___\n\n### TaskGraphExecutor\n\nƬ **TaskGraphExecutor**<`T`\\>: (`taskGraph`: [`TaskGraph`](../../devkit/index#taskgraph), `options`: `Record`<`string`, `T`\\>, `overrides`: `T`, `context`: [`ExecutorContext`](../../devkit/index#executorcontext)) => `Promise`<`Record`<`string`, `Object`\\>\\>\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | `any` |\n\n#### Type declaration\n\n▸ (`taskGraph`, `options`, `overrides`, `context`): `Promise`<`Record`<`string`, `Object`\\>\\>\n\nImplementation of a target of a project that handles multiple projects to be batched\n\n##### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `taskGraph` | [`TaskGraph`](../../devkit/index#taskgraph) |\n| `options` | `Record`<`string`, `T`\\> |\n| `overrides` | `T` |\n| `context` | [`ExecutorContext`](../../devkit/index#executorcontext) |\n\n##### Returns\n\n`Promise`<`Record`<`string`, `Object`\\>\\>\n\n___\n\n### WorkspaceJsonConfiguration\n\nƬ **WorkspaceJsonConfiguration**: [`ProjectsConfigurations`](../../devkit/index#projectsconfigurations)\n\n## Logger Variables\n\n### logger\n\n• **logger**: `Object`\n\n#### Type declaration\n\n| Name | Type |\n| :------ | :------ |\n| `debug` | (...`s`: `any`[]) => `void` |\n| `error` | (`s`: `any`) => `void` |\n| `fatal` | (...`s`: `any`[]) => `void` |\n| `info` | (`s`: `any`) => `void` |\n| `log` | (...`s`: `any`[]) => `void` |\n| `warn` | (`s`: `any`) => `void` |\n\n___\n\n## Utils Variables\n\n### appRootPath\n\n• **appRootPath**: `string` = `workspaceRoot`\n\n___\n\n### cacheDir\n\n• **cacheDir**: `string`\n\n___\n\n### output\n\n• **output**: `CLIOutput`\n\n___\n\n### workspaceRoot\n\n• **workspaceRoot**: `string`\n\n## Functions\n\n### addDependenciesToPackageJson\n\n▸ **addDependenciesToPackageJson**(`tree`, `dependencies`, `devDependencies`, `packageJsonPath?`): [`GeneratorCallback`](../../devkit/index#generatorcallback)\n\nAdd Dependencies and Dev Dependencies to package.json\n\nFor example:\n```typescript\naddDependenciesToPackageJson(tree, { react: 'latest' }, { jest: 'latest' })\n```\nThis will **add** `react` and `jest` to the dependencies and devDependencies sections of package.json respectively.\n\n#### Parameters\n\n| Name | Type | Default value | Description |\n| :------ | :------ | :------ | :------ |\n| `tree` | [`Tree`](../../devkit/index#tree) | `undefined` | Tree representing file system to modify |\n| `dependencies` | `Record`<`string`, `string`\\> | `undefined` | Dependencies to be added to the dependencies section of package.json |\n| `devDependencies` | `Record`<`string`, `string`\\> | `undefined` | Dependencies to be added to the devDependencies section of package.json |\n| `packageJsonPath` | `string` | `'package.json'` | Path to package.json |\n\n#### Returns\n\n[`GeneratorCallback`](../../devkit/index#generatorcallback)\n\nCallback to install dependencies only if necessary, no-op otherwise\n\n___\n\n### addProjectConfiguration\n\n▸ **addProjectConfiguration**(`tree`, `projectName`, `projectConfiguration`, `standalone?`): `void`\n\nAdds project configuration to the Nx workspace.\n\nThe project configuration is stored in workspace.json or the associated project.json file.\nThe utility will update either files.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `tree` | [`Tree`](../../devkit/index#tree) | the file system tree |\n| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) |\n| `projectConfiguration` | [`ProjectConfiguration`](../../devkit/index#projectconfiguration) | project configuration |\n| `standalone?` | `boolean` | should the project use package.json? If false, the project config is inside workspace.json |\n\n#### Returns\n\n`void`\n\n___\n\n### applyAdditionalShared\n\n▸ **applyAdditionalShared**(`sharedConfig`, `additionalShared`, `projectGraph`): `void`\n\nAdd additional dependencies to the shared package that may not have been\ndiscovered by the project graph.\n\nThis can be useful for applications that use a Dependency Injection system\nthat expects certain Singleton values to be present in the shared injection\nhierarchy.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `sharedConfig` | `Record`<`string`, [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)\\> | The original Shared Config |\n| `additionalShared` | [`AdditionalSharedConfig`](../../devkit/index#additionalsharedconfig) | The additional dependencies to add |\n| `projectGraph` | [`ProjectGraph`](../../devkit/index#projectgraph)<`any`\\> | The Nx project graph |\n\n#### Returns\n\n`void`\n\n___\n\n### applyChangesToString\n\n▸ **applyChangesToString**(`text`, `changes`): `string`\n\nApplies a list of changes to a string's original value.\n\nThis is useful when working with ASTs.\n\nFor Example, to rename a property in a method's options:\n\n```typescript\nconst code = `bootstrap({\n target: document.querySelector('#app')\n})`;\n\nconst indexOfPropertyName = 13; // Usually determined by analyzing an AST.\nconst updatedCode = applyChangesToString(code, [\n {\n type: ChangeType.Insert,\n index: indexOfPropertyName,\n text: 'element'\n },\n {\n type: ChangeType.Delete,\n start: indexOfPropertyName,\n length: 6\n },\n]);\n\nbootstrap({\n element: document.querySelector('#app')\n});\n```\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `text` | `string` |\n| `changes` | [`StringChange`](../../devkit/index#stringchange)[] |\n\n#### Returns\n\n`string`\n\n___\n\n### applySharedFunction\n\n▸ **applySharedFunction**(`sharedConfig`, `sharedFn`): `void`\n\nApply a custom function provided by the user that will modify the Shared Config\nof the dependencies for the Module Federation build.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `sharedConfig` | `Record`<`string`, [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)\\> | The original Shared Config to be modified |\n| `sharedFn` | [`SharedFunction`](../../devkit/index#sharedfunction) | The custom function to run |\n\n#### Returns\n\n`void`\n\n___\n\n### convertNxExecutor\n\n▸ **convertNxExecutor**(`executor`): `any`\n\nConvert an Nx Executor into an Angular Devkit Builder\n\nUse this to expose a compatible Angular Builder\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `executor` | [`Executor`](../../devkit/index#executor)<`any`\\> |\n\n#### Returns\n\n`any`\n\n___\n\n### convertNxGenerator\n\n▸ **convertNxGenerator**<`T`\\>(`generator`, `skipWritingConfigInOldFormat?`): (`generatorOptions`: `T`) => (`tree`: `any`, `context`: `any`) => `Promise`<`any`\\>\n\nConvert an Nx Generator into an Angular Devkit Schematic.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | `any` |\n\n#### Parameters\n\n| Name | Type | Default value | Description |\n| :------ | :------ | :------ | :------ |\n| `generator` | [`Generator`](../../devkit/index#generator)<`T`\\> | `undefined` | The Nx generator to convert to an Angular Devkit Schematic. |\n| `skipWritingConfigInOldFormat` | `boolean` | `false` | Whether to skip writing the configuration in the old format (the one used by the Angular DevKit). |\n\n#### Returns\n\n`fn`\n\n▸ (`generatorOptions`): (`tree`: `any`, `context`: `any`) => `Promise`<`any`\\>\n\n##### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `generatorOptions` | `T` |\n\n##### Returns\n\n`fn`\n\n▸ (`tree`, `context`): `Promise`<`any`\\>\n\n##### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `tree` | `any` |\n| `context` | `any` |\n\n##### Returns\n\n`Promise`<`any`\\>\n\n___\n\n### createProjectGraphAsync\n\n▸ **createProjectGraphAsync**(`opts?`): `Promise`<[`ProjectGraph`](../../devkit/index#projectgraph)\\>\n\nComputes and returns a ProjectGraph.\n\nNx will compute the graph either in a daemon process or in the current process.\n\nNx will compute it in the current process if:\n* The process is running in CI (CI env variable is to true or other common variables used by CI providers are set).\n* It is running in the docker container.\n* The daemon process is disabled because of the previous error when starting the daemon.\n* `NX_DAEMON` is set to `false`.\n* `useDaemon` is set to false in `nx.json`\n\n`NX_DAEMON` env variable takes precedence:\n* If it is set to true, the daemon will always be used.\n* If it is set to false, the graph will always be computed in the current process.\n\nTip: If you want to debug project graph creation, run your command with NX_DAEMON=false.\n\nNx uses two layers of caching: the information about explicit dependencies stored on the disk and the information\nstored in the daemon process. To reset both run: `nx reset`.\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `opts` | `Object` |\n| `opts.exitOnError` | `boolean` |\n| `opts.resetDaemonClient?` | `boolean` |\n\n#### Returns\n\n`Promise`<[`ProjectGraph`](../../devkit/index#projectgraph)\\>\n\n___\n\n### defaultTasksRunner\n\n▸ `Const` **defaultTasksRunner**(`tasks`, `options`, `context?`): `any`\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `tasks` | [`Task`](../../devkit/index#task)[] |\n| `options` | [`DefaultTasksRunnerOptions`](../../devkit/index#defaulttasksrunneroptions) |\n| `context?` | `Object` |\n| `context.daemon?` | `DaemonClient` |\n| `context.hasher?` | [`Hasher`](../../devkit/index#hasher) |\n| `context.initiatingProject?` | `string` |\n| `context.nxArgs` | `NxArgs` |\n| `context.nxJson` | [`NxJsonConfiguration`](../../devkit/index#nxjsonconfiguration)<`string`[] \\| ``\"*\"``\\> |\n| `context.projectGraph` | [`ProjectGraph`](../../devkit/index#projectgraph)<`any`\\> |\n| `context.target?` | `string` |\n| `context.taskGraph?` | [`TaskGraph`](../../devkit/index#taskgraph) |\n\n#### Returns\n\n`any`\n\n___\n\n### detectPackageManager\n\n▸ **detectPackageManager**(`dir?`): [`PackageManager`](../../devkit/index#packagemanager)\n\nDetects which package manager is used in the workspace based on the lock file.\n\n#### Parameters\n\n| Name | Type | Default value |\n| :------ | :------ | :------ |\n| `dir` | `string` | `''` |\n\n#### Returns\n\n[`PackageManager`](../../devkit/index#packagemanager)\n\n___\n\n### detectWorkspaceScope\n\n▸ **detectWorkspaceScope**(`packageName`): `string`\n\nDetect workspace scope from the package.json name\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `packageName` | `string` |\n\n#### Returns\n\n`string`\n\n___\n\n### formatFiles\n\n▸ **formatFiles**(`tree`): `Promise`<`void`\\>\n\nFormats all the created or updated files using Prettier\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `tree` | [`Tree`](../../devkit/index#tree) | the file system tree |\n\n#### Returns\n\n`Promise`<`void`\\>\n\n___\n\n### generateFiles\n\n▸ **generateFiles**(`tree`, `srcFolder`, `target`, `substitutions`): `void`\n\nGenerates a folder of files based on provided templates.\n\nWhile doing so it performs two substitutions:\n- Substitutes segments of file names surrounded by __\n- Uses ejs to substitute values in templates\n\nExamples:\n```typescript\ngenerateFiles(tree, path.join(__dirname , 'files'), './tools/scripts', {tmpl: '', name: 'myscript'})\n```\nThis command will take all the files from the `files` directory next to the place where the command is invoked from.\nIt will replace all `__tmpl__` with '' and all `__name__` with 'myscript' in the file names, and will replace all\n`<%= name %>` with `myscript` in the files themselves.\n`tmpl: ''` is a common pattern. With it you can name files like this: `index.ts__tmpl__`, so your editor\ndoesn't get confused about incorrect TypeScript files.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `tree` | [`Tree`](../../devkit/index#tree) | the file system tree |\n| `srcFolder` | `string` | the source folder of files (absolute path) |\n| `target` | `string` | the target folder (relative to the tree root) |\n| `substitutions` | `Object` | an object of key-value pairs |\n\n#### Returns\n\n`void`\n\n___\n\n### getDependentPackagesForProject\n\n▸ **getDependentPackagesForProject**(`projectGraph`, `name`): `Object`\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `projectGraph` | [`ProjectGraph`](../../devkit/index#projectgraph)<`any`\\> |\n| `name` | `string` |\n\n#### Returns\n\n`Object`\n\n| Name | Type |\n| :------ | :------ |\n| `npmPackages` | `string`[] |\n| `workspaceLibraries` | [`WorkspaceLibrary`](../../devkit/index#workspacelibrary)[] |\n\n___\n\n### getImportPath\n\n▸ **getImportPath**(`npmScope`, `projectDirectory`): `string`\n\nPrefixes project name with npm scope\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `npmScope` | `string` |\n| `projectDirectory` | `string` |\n\n#### Returns\n\n`string`\n\n___\n\n### getNpmPackageSharedConfig\n\n▸ **getNpmPackageSharedConfig**(`pkgName`, `version`): [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig) \\| `undefined`\n\nBuild the Module Federation Share Config for a specific package and the\nspecified version of that package.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `pkgName` | `string` | Name of the package to share |\n| `version` | `string` | Version of the package to require by other apps in the Module Federation setup |\n\n#### Returns\n\n[`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig) \\| `undefined`\n\n___\n\n### getOutputsForTargetAndConfiguration\n\n▸ **getOutputsForTargetAndConfiguration**(`task`, `node`): `string`[]\n\nReturns the list of outputs that will be cached.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `task` | `Pick`<[`Task`](../../devkit/index#task), ``\"overrides\"`` \\| ``\"target\"``\\> | target + overrides |\n| `node` | [`ProjectGraphProjectNode`](../../devkit/index#projectgraphprojectnode)<`any`\\> | ProjectGraphProjectNode object that the task runs against |\n\n#### Returns\n\n`string`[]\n\n___\n\n### getPackageManagerCommand\n\n▸ **getPackageManagerCommand**(`packageManager?`): `PackageManagerCommands`\n\nReturns commands for the package manager used in the workspace.\nBy default, the package manager is derived based on the lock file,\nbut it can also be passed in explicitly.\n\nExample:\n\n```javascript\nexecSync(`${getPackageManagerCommand().addDev} my-dev-package`);\n```\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `packageManager` | [`PackageManager`](../../devkit/index#packagemanager) |\n\n#### Returns\n\n`PackageManagerCommands`\n\n___\n\n### getPackageManagerVersion\n\n▸ **getPackageManagerVersion**(`packageManager?`): `string`\n\nReturns the version of the package manager used in the workspace.\nBy default, the package manager is derived based on the lock file,\nbut it can also be passed in explicitly.\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `packageManager` | [`PackageManager`](../../devkit/index#packagemanager) |\n\n#### Returns\n\n`string`\n\n___\n\n### getProjects\n\n▸ **getProjects**(`tree`): `Map`<`string`, [`ProjectConfiguration`](../../devkit/index#projectconfiguration)\\>\n\nGet a map of all projects in a workspace.\n\nUse [readProjectConfiguration](../../devkit/index#readprojectconfiguration) if only one project is needed.\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `tree` | [`Tree`](../../devkit/index#tree) |\n\n#### Returns\n\n`Map`<`string`, [`ProjectConfiguration`](../../devkit/index#projectconfiguration)\\>\n\n___\n\n### getWorkspaceLayout\n\n▸ **getWorkspaceLayout**(`tree`): `Object`\n\nReturns workspace defaults. It includes defaults folders for apps and libs,\nand the default scope.\n\nExample:\n\n```typescript\n{ appsDir: 'apps', libsDir: 'libs', npmScope: 'myorg' }\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `tree` | [`Tree`](../../devkit/index#tree) | file system tree |\n\n#### Returns\n\n`Object`\n\n| Name | Type |\n| :------ | :------ |\n| `appsDir` | `string` |\n| `libsDir` | `string` |\n| `npmScope` | `string` |\n| `standaloneAsDefault` | `boolean` |\n\n___\n\n### getWorkspacePath\n\n▸ **getWorkspacePath**(`tree`): ``\"/angular.json\"`` \\| ``\"/workspace.json\"`` \\| ``null``\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `tree` | [`Tree`](../../devkit/index#tree) |\n\n#### Returns\n\n``\"/angular.json\"`` \\| ``\"/workspace.json\"`` \\| ``null``\n\n___\n\n### installPackagesTask\n\n▸ **installPackagesTask**(`tree`, `alwaysRun?`, `cwd?`, `packageManager?`): `void`\n\nRuns `npm install` or `yarn install`. It will skip running the install if\n`package.json` hasn't changed at all or it hasn't changed since the last invocation.\n\n#### Parameters\n\n| Name | Type | Default value | Description |\n| :------ | :------ | :------ | :------ |\n| `tree` | [`Tree`](../../devkit/index#tree) | `undefined` | the file system tree |\n| `alwaysRun` | `boolean` | `false` | always run the command even if `package.json` hasn't changed. |\n| `cwd` | `string` | `''` | - |\n| `packageManager` | [`PackageManager`](../../devkit/index#packagemanager) | `undefined` | - |\n\n#### Returns\n\n`void`\n\n___\n\n### isStandaloneProject\n\n▸ **isStandaloneProject**(`tree`, `project`): `boolean`\n\nReturns if a project has a standalone configuration (project.json).\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `tree` | [`Tree`](../../devkit/index#tree) | the file system tree |\n| `project` | `string` | the project name |\n\n#### Returns\n\n`boolean`\n\n___\n\n### joinPathFragments\n\n▸ **joinPathFragments**(...`fragments`): `string`\n\nNormalized path fragments and joins them\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `...fragments` | `string`[] |\n\n#### Returns\n\n`string`\n\n___\n\n### mapRemotes\n\n▸ **mapRemotes**(`remotes`, `remoteEntryExt`, `determineRemoteUrl`): `Record`<`string`, `string`\\>\n\nMap remote names to a format that can be understood and used by Module\nFederation.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `remotes` | [`Remotes`](../../devkit/index#remotes) | The remotes to map |\n| `remoteEntryExt` | ``\"js\"`` \\| ``\"mjs\"`` | The file extension of the remoteEntry file |\n| `determineRemoteUrl` | (`remote`: `string`) => `string` | The function used to lookup the URL of the served remote |\n\n#### Returns\n\n`Record`<`string`, `string`\\>\n\n___\n\n### mapRemotesForSSR\n\n▸ **mapRemotesForSSR**(`remotes`, `remoteEntryExt`, `determineRemoteUrl`): `Record`<`string`, `string`\\>\n\nMap remote names to a format that can be understood and used by Module\nFederation.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `remotes` | [`Remotes`](../../devkit/index#remotes) | The remotes to map |\n| `remoteEntryExt` | ``\"js\"`` \\| ``\"mjs\"`` | The file extension of the remoteEntry file |\n| `determineRemoteUrl` | (`remote`: `string`) => `string` | The function used to lookup the URL of the served remote |\n\n#### Returns\n\n`Record`<`string`, `string`\\>\n\n___\n\n### moveFilesToNewDirectory\n\n▸ **moveFilesToNewDirectory**(`tree`, `oldDir`, `newDir`): `void`\n\nAnalogous to cp -r oldDir newDir\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `tree` | [`Tree`](../../devkit/index#tree) |\n| `oldDir` | `string` |\n| `newDir` | `string` |\n\n#### Returns\n\n`void`\n\n___\n\n### names\n\n▸ **names**(`name`): `Object`\n\nUtil function to generate different strings based off the provided name.\n\nExamples:\n\n```typescript\nnames(\"my-name\") // {name: 'my-name', className: 'MyName', propertyName: 'myName', constantName: 'MY_NAME', fileName: 'my-name'}\nnames(\"myName\") // {name: 'myName', className: 'MyName', propertyName: 'myName', constantName: 'MY_NAME', fileName: 'my-name'}\n```\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `name` | `string` |\n\n#### Returns\n\n`Object`\n\n| Name | Type |\n| :------ | :------ |\n| `className` | `string` |\n| `constantName` | `string` |\n| `fileName` | `string` |\n| `name` | `string` |\n| `propertyName` | `string` |\n\n___\n\n### normalizePath\n\n▸ **normalizePath**(`osSpecificPath`): `string`\n\nCoverts an os specific path to a unix style path\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `osSpecificPath` | `string` |\n\n#### Returns\n\n`string`\n\n___\n\n### offsetFromRoot\n\n▸ **offsetFromRoot**(`fullPathToDir`): `string`\n\nCalculates an offset from the root of the workspace, which is useful for\nconstructing relative URLs.\n\nExamples:\n\n```typescript\noffsetFromRoot(\"apps/mydir/myapp/\") // returns \"../../../\"\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `fullPathToDir` | `string` | directory path |\n\n#### Returns\n\n`string`\n\n___\n\n### parseJson\n\n▸ **parseJson**<`T`\\>(`input`, `options?`): `T`\n\nParses the given JSON string and returns the object the JSON content represents.\nBy default javascript-style comments are allowed.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | extends `object` = `any` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `input` | `string` | JSON content as string |\n| `options?` | [`JsonParseOptions`](../../devkit/index#jsonparseoptions) | JSON parse options |\n\n#### Returns\n\n`T`\n\nObject the JSON content represents\n\n___\n\n### parseTargetString\n\n▸ **parseTargetString**(`targetString`): [`Target`](../../devkit/index#target)\n\nParses a target string into {project, target, configuration}\n\nExamples:\n```typescript\nparseTargetString(\"proj:test\") // returns { project: \"proj\", target: \"test\" }\nparseTargetString(\"proj:test:production\") // returns { project: \"proj\", target: \"test\", configuration: \"production\" }\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `targetString` | `string` | target reference |\n\n#### Returns\n\n[`Target`](../../devkit/index#target)\n\n___\n\n### readAllWorkspaceConfiguration\n\n▸ **readAllWorkspaceConfiguration**(): [`ProjectsConfigurations`](../../devkit/index#projectsconfigurations) & [`NxJsonConfiguration`](../../devkit/index#nxjsonconfiguration)\n\n**`deprecated`** Use readProjectsConfigurationFromProjectGraph(await createProjectGraphAsync())\n\n#### Returns\n\n[`ProjectsConfigurations`](../../devkit/index#projectsconfigurations) & [`NxJsonConfiguration`](../../devkit/index#nxjsonconfiguration)\n\n___\n\n### readCachedProjectGraph\n\n▸ **readCachedProjectGraph**(): [`ProjectGraph`](../../devkit/index#projectgraph)<[`ProjectConfiguration`](../../devkit/index#projectconfiguration)\\>\n\nSynchronously reads the latest cached copy of the workspace's ProjectGraph.\n\n**`throws`** {Error} if there is no cached ProjectGraph to read from\n\n#### Returns\n\n[`ProjectGraph`](../../devkit/index#projectgraph)<[`ProjectConfiguration`](../../devkit/index#projectconfiguration)\\>\n\n___\n\n### readJson\n\n▸ **readJson**<`T`\\>(`tree`, `path`, `options?`): `T`\n\nReads a json file, removes all comments and parses JSON.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | extends `object` = `any` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `tree` | [`Tree`](../../devkit/index#tree) | file system tree |\n| `path` | `string` | file path |\n| `options?` | [`JsonParseOptions`](../../devkit/index#jsonparseoptions) | Optional JSON Parse Options |\n\n#### Returns\n\n`T`\n\n___\n\n### readJsonFile\n\n▸ **readJsonFile**<`T`\\>(`path`, `options?`): `T`\n\nReads a JSON file and returns the object the JSON content represents.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | extends `object` = `any` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `path` | `string` | A path to a file. |\n| `options?` | `JsonReadOptions` | JSON parse options |\n\n#### Returns\n\n`T`\n\nObject the JSON content of the file represents\n\n___\n\n### readNxJson\n\n▸ **readNxJson**(): [`NxJsonConfiguration`](../../devkit/index#nxjsonconfiguration)\n\n#### Returns\n\n[`NxJsonConfiguration`](../../devkit/index#nxjsonconfiguration)\n\n___\n\n### readProjectConfiguration\n\n▸ **readProjectConfiguration**(`tree`, `projectName`): [`ProjectConfiguration`](../../devkit/index#projectconfiguration)\n\nReads a project configuration.\n\nThe project configuration is stored in workspace.json or the associated project.json file.\nThe utility will read from either file.\n\n**`throws`** If supplied projectName cannot be found\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `tree` | [`Tree`](../../devkit/index#tree) | the file system tree |\n| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) |\n\n#### Returns\n\n[`ProjectConfiguration`](../../devkit/index#projectconfiguration)\n\n___\n\n### readRootPackageJson\n\n▸ **readRootPackageJson**(): `Object`\n\n#### Returns\n\n`Object`\n\n| Name | Type |\n| :------ | :------ |\n| `dependencies?` | `Object` |\n| `devDependencies?` | `Object` |\n\n___\n\n### readTargetOptions\n\n▸ **readTargetOptions**<`T`\\>(`__namedParameters`, `context`): `T`\n\nReads and combines options for a given target.\n\nWorks as if you invoked the target yourself without passing any command lint overrides.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | `any` |\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `__namedParameters` | [`Target`](../../devkit/index#target) |\n| `context` | [`ExecutorContext`](../../devkit/index#executorcontext) |\n\n#### Returns\n\n`T`\n\n___\n\n### readWorkspaceConfiguration\n\n▸ **readWorkspaceConfiguration**(`tree`): [`WorkspaceConfiguration`](../../devkit/index#workspaceconfiguration)\n\nRead general workspace configuration such as the default project or cli settings\n\nThis does _not_ provide projects configuration, use [readProjectConfiguration](../../devkit/index#readprojectconfiguration) instead.\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `tree` | [`Tree`](../../devkit/index#tree) |\n\n#### Returns\n\n[`WorkspaceConfiguration`](../../devkit/index#workspaceconfiguration)\n\n___\n\n### removeDependenciesFromPackageJson\n\n▸ **removeDependenciesFromPackageJson**(`tree`, `dependencies`, `devDependencies`, `packageJsonPath?`): [`GeneratorCallback`](../../devkit/index#generatorcallback)\n\nRemove Dependencies and Dev Dependencies from package.json\n\nFor example:\n```typescript\nremoveDependenciesFromPackageJson(tree, ['react'], ['jest'])\n```\nThis will **remove** `react` and `jest` from the dependencies and devDependencies sections of package.json respectively.\n\n#### Parameters\n\n| Name | Type | Default value | Description |\n| :------ | :------ | :------ | :------ |\n| `tree` | [`Tree`](../../devkit/index#tree) | `undefined` | - |\n| `dependencies` | `string`[] | `undefined` | Dependencies to be removed from the dependencies section of package.json |\n| `devDependencies` | `string`[] | `undefined` | Dependencies to be removed from the devDependencies section of package.json |\n| `packageJsonPath` | `string` | `'package.json'` | - |\n\n#### Returns\n\n[`GeneratorCallback`](../../devkit/index#generatorcallback)\n\nCallback to uninstall dependencies only if necessary. undefined is returned if changes are not necessary.\n\n___\n\n### removeProjectConfiguration\n\n▸ **removeProjectConfiguration**(`tree`, `projectName`): `void`\n\nRemoves the configuration of an existing project.\n\nThe project configuration is stored in workspace.json or the associated project.json file.\nThe utility will update either file.\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `tree` | [`Tree`](../../devkit/index#tree) |\n| `projectName` | `string` |\n\n#### Returns\n\n`void`\n\n___\n\n### reverse\n\n▸ **reverse**(`graph`): [`ProjectGraph`](../../devkit/index#projectgraph)\n\nReturns a new project graph where all the edges are reversed.\n\nFor instance, if project A depends on B, in the reversed graph\nB will depend on A.\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `graph` | [`ProjectGraph`](../../devkit/index#projectgraph)<`any`\\> |\n\n#### Returns\n\n[`ProjectGraph`](../../devkit/index#projectgraph)\n\n___\n\n### runExecutor\n\n▸ **runExecutor**<`T`\\>(`targetDescription`, `overrides`, `context`): `Promise`<`AsyncIterableIterator`<`T`\\>\\>\n\nLoads and invokes executor.\n\nThis is analogous to invoking executor from the terminal, with the exception\nthat the params aren't parsed from the string, but instead provided parsed already.\n\nApart from that, it works the same way:\n\n- it will load the workspace configuration\n- it will resolve the target\n- it will load the executor and the schema\n- it will load the options for the appropriate configuration\n- it will run the validations and will set the default\n- and, of course, it will invoke the executor\n\nExample:\n\n```typescript\nfor await (const s of await runExecutor({project: 'myproj', target: 'serve'}, {watch: true}, context)) {\n // s.success\n}\n```\n\nNote that the return value is a promise of an iterator, so you need to await before iterating over it.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | extends `Object` |\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `targetDescription` | `Object` |\n| `targetDescription.configuration?` | `string` |\n| `targetDescription.project` | `string` |\n| `targetDescription.target` | `string` |\n| `overrides` | `Object` |\n| `context` | [`ExecutorContext`](../../devkit/index#executorcontext) |\n\n#### Returns\n\n`Promise`<`AsyncIterableIterator`<`T`\\>\\>\n\n___\n\n### serializeJson\n\n▸ **serializeJson**<`T`\\>(`input`, `options?`): `string`\n\nSerializes the given data to a JSON string.\nBy default the JSON string is formatted with a 2 space intendation to be easy readable.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | extends `object` = `object` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `input` | `T` | Object which should be serialized to JSON |\n| `options?` | [`JsonSerializeOptions`](../../devkit/index#jsonserializeoptions) | JSON serialize options |\n\n#### Returns\n\n`string`\n\nthe formatted JSON representation of the object\n\n___\n\n### sharePackages\n\n▸ **sharePackages**(`packages`): `Record`<`string`, [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)\\>\n\nCreate a dictionary of packages and their Module Federation Shared Config\nfrom an array of package names.\n\nLookup the versions of the packages from the root package.json file in the\nworkspace.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `packages` | `string`[] | Array of package names as strings |\n\n#### Returns\n\n`Record`<`string`, [`SharedLibraryConfig`](../../devkit/index#sharedlibraryconfig)\\>\n\n___\n\n### shareWorkspaceLibraries\n\n▸ **shareWorkspaceLibraries**(`libraries`, `tsConfigPath?`): [`SharedWorkspaceLibraryConfig`](../../devkit/index#sharedworkspacelibraryconfig)\n\nBuild an object of functions to be used with the ModuleFederationPlugin to\nshare Nx Workspace Libraries between Hosts and Remotes.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `libraries` | [`WorkspaceLibrary`](../../devkit/index#workspacelibrary)[] | The Nx Workspace Libraries to share |\n| `tsConfigPath` | `string` | The path to TS Config File that contains the Path Mappings for the Libraries |\n\n#### Returns\n\n[`SharedWorkspaceLibraryConfig`](../../devkit/index#sharedworkspacelibraryconfig)\n\n___\n\n### stripIndents\n\n▸ **stripIndents**(`strings`, ...`values`): `string`\n\nRemoves indents, which is useful for printing warning and messages.\n\nExample:\n\n```typescript\nstripIndents`\n Options:\n - option1\n - option2\n`\n```\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `strings` | `TemplateStringsArray` |\n| `...values` | `any`[] |\n\n#### Returns\n\n`string`\n\n___\n\n### stripJsonComments\n\n▸ `Const` **stripJsonComments**(`text`, `replaceCh?`): `string`\n\nTakes JSON with JavaScript-style comments and remove\nthem. Optionally replaces every none-newline character\nof comments with a replaceCharacter\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `text` | `string` |\n| `replaceCh?` | `string` |\n\n#### Returns\n\n`string`\n\n___\n\n### targetToTargetString\n\n▸ **targetToTargetString**(`target`): `string`\n\nReturns a string in the format \"project:target[:configuration]\" for the target\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | [`Target`](../../devkit/index#target) | target object Examples: ```typescript targetToTargetString({ project: \"proj\", target: \"test\" }) // returns \"proj:test\" targetToTargetString({ project: \"proj\", target: \"test\", configuration: \"production\" }) // returns \"proj:test:production\" ``` |\n\n#### Returns\n\n`string`\n\n___\n\n### toJS\n\n▸ **toJS**(`tree`): `void`\n\nRename and transpile any new typescript files created to javascript files\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `tree` | [`Tree`](../../devkit/index#tree) |\n\n#### Returns\n\n`void`\n\n___\n\n### updateJson\n\n▸ **updateJson**<`T`, `U`\\>(`tree`, `path`, `updater`, `options?`): `void`\n\nUpdates a JSON value to the file system tree\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | extends `object` = `any` |\n| `U` | extends `object` = `T` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `tree` | [`Tree`](../../devkit/index#tree) | File system tree |\n| `path` | `string` | Path of JSON file in the Tree |\n| `updater` | (`value`: `T`) => `U` | Function that maps the current value of a JSON document to a new value to be written to the document |\n| `options?` | [`JsonParseOptions`](../../devkit/index#jsonparseoptions) & [`JsonSerializeOptions`](../../devkit/index#jsonserializeoptions) | Optional JSON Parse and Serialize Options |\n\n#### Returns\n\n`void`\n\n___\n\n### updateProjectConfiguration\n\n▸ **updateProjectConfiguration**(`tree`, `projectName`, `projectConfiguration`): `void`\n\nUpdates the configuration of an existing project.\n\nThe project configuration is stored in workspace.json or the associated project.json file.\nThe utility will update either files.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `tree` | [`Tree`](../../devkit/index#tree) | the file system tree |\n| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) |\n| `projectConfiguration` | [`ProjectConfiguration`](../../devkit/index#projectconfiguration) | project configuration |\n\n#### Returns\n\n`void`\n\n___\n\n### updateTsConfigsToJs\n\n▸ **updateTsConfigsToJs**(`tree`, `options`): `void`\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `tree` | [`Tree`](../../devkit/index#tree) |\n| `options` | `Object` |\n| `options.projectRoot` | `string` |\n\n#### Returns\n\n`void`\n\n___\n\n### updateWorkspaceConfiguration\n\n▸ **updateWorkspaceConfiguration**(`tree`, `workspaceConfig`): `void`\n\nUpdate general workspace configuration such as the default project or cli settings.\n\nThis does _not_ update projects configuration, use [updateProjectConfiguration](../../devkit/index#updateprojectconfiguration) or [addProjectConfiguration](../../devkit/index#addprojectconfiguration) instead.\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `tree` | [`Tree`](../../devkit/index#tree) |\n| `workspaceConfig` | [`WorkspaceConfiguration`](../../devkit/index#workspaceconfiguration) |\n\n#### Returns\n\n`void`\n\n___\n\n### visitNotIgnoredFiles\n\n▸ **visitNotIgnoredFiles**(`tree`, `dirPath?`, `visitor`): `void`\n\nUtility to act on all files in a tree that are not ignored by git.\n\n#### Parameters\n\n| Name | Type | Default value |\n| :------ | :------ | :------ |\n| `tree` | [`Tree`](../../devkit/index#tree) | `undefined` |\n| `dirPath` | `string` | `tree.root` |\n| `visitor` | (`path`: `string`) => `void` | `undefined` |\n\n#### Returns\n\n`void`\n\n___\n\n### workspaceLayout\n\n▸ **workspaceLayout**(): `Object`\n\nReturns information about where apps and libs will be created.\n\n#### Returns\n\n`Object`\n\n| Name | Type |\n| :------ | :------ |\n| `appsDir` | `string` |\n| `libsDir` | `string` |\n\n___\n\n### writeJson\n\n▸ **writeJson**<`T`\\>(`tree`, `path`, `value`, `options?`): `void`\n\nWrites a JSON value to the file system tree\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | extends `object` = `object` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `tree` | [`Tree`](../../devkit/index#tree) | File system tree |\n| `path` | `string` | Path of JSON file in the Tree |\n| `value` | `T` | Serializable value to write |\n| `options?` | [`JsonSerializeOptions`](../../devkit/index#jsonserializeoptions) | Optional JSON Serialize Options |\n\n#### Returns\n\n`void`\n\n___\n\n### writeJsonFile\n\n▸ **writeJsonFile**<`T`\\>(`path`, `data`, `options?`): `void`\n\nSerializes the given data to JSON and writes it to a file.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | extends `object` = `object` |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `path` | `string` | A path to a file. |\n| `data` | `T` | data which should be serialized to JSON and written to the file |\n| `options?` | `JsonWriteOptions` | JSON serialize options |\n\n#### Returns\n\n`void`\n" }, { "id": "ngcli_adapter", "name": "Ng CLI Adapter", "file": "generated/devkit/ngcli_adapter", - "content": "# Module: ngcli-adapter\n\n## Table of contents\n\n### Ng CLI Adapter Classes\n\n- [NxScopedHost](../../devkit/ngcli_adapter#nxscopedhost)\n\n### Functions\n\n- [mockSchematicsForTesting](../../devkit/ngcli_adapter#mockschematicsfortesting)\n- [overrideCollectionResolutionForTesting](../../devkit/ngcli_adapter#overridecollectionresolutionfortesting)\n- [wrapAngularDevkitSchematic](../../devkit/ngcli_adapter#wrapangulardevkitschematic)\n\n## Ng CLI Adapter Classes\n\n### NxScopedHost\n\n• **NxScopedHost**: `Object`\n\n## Functions\n\n### mockSchematicsForTesting\n\n▸ **mockSchematicsForTesting**(`schematics`): `void`\n\nIf you have an Nx Devkit generator invoking the wrapped Angular Devkit schematic,\nand you don't want the Angular Devkit schematic to run, you can mock it up using this function.\n\nUnfortunately, there are some edge cases in the Nx-Angular devkit integration that\ncan be seen in the unit tests context. This function is useful for handling that as well.\n\nIn this case, you can mock it up.\n\nExample:\n\n```typescript\nmockSchematicsForTesting({\n 'mycollection:myschematic': (tree, params) => {\n tree.write('README.md');\n },\n});\n```\n\n#### Parameters\n\n| Name | Type |\n| :----------- | :------- |\n| `schematics` | `Object` |\n\n#### Returns\n\n`void`\n\n---\n\n### overrideCollectionResolutionForTesting\n\n▸ **overrideCollectionResolutionForTesting**(`collections`): `void`\n\nBy default, Angular Devkit schematic collections will be resolved using the Node resolution.\nThis doesn't work if you are testing schematics that refer to other schematics in the\nsame repo.\n\nThis function can can be used to override the resolution behaviour.\n\nExample:\n\n```typescript\noverrideCollectionResolutionForTesting({\n '@nrwl/workspace': path.join(\n __dirname,\n '../../../../workspace/generators.json'\n ),\n '@nrwl/angular': path.join(__dirname, '../../../../angular/generators.json'),\n '@nrwl/linter': path.join(__dirname, '../../../../linter/generators.json'),\n});\n```\n\n#### Parameters\n\n| Name | Type |\n| :------------ | :------- |\n| `collections` | `Object` |\n\n#### Returns\n\n`void`\n\n---\n\n### wrapAngularDevkitSchematic\n\n▸ **wrapAngularDevkitSchematic**(`collectionName`, `generatorName`): (`host`: [`Tree`](../../devkit/index#tree), `generatorOptions`: { [k: string]: `any`; }) => `Promise`<`any`\\>\n\n#### Parameters\n\n| Name | Type |\n| :--------------- | :------- |\n| `collectionName` | `string` |\n| `generatorName` | `string` |\n\n#### Returns\n\n`fn`\n\n▸ (`host`, `generatorOptions`): `Promise`<`any`\\>\n\n##### Parameters\n\n| Name | Type |\n| :----------------- | :-------------------------------- |\n| `host` | [`Tree`](../../devkit/index#tree) |\n| `generatorOptions` | `Object` |\n\n##### Returns\n\n`Promise`<`any`\\>\n" + "content": "# Module: ngcli-adapter\n\n## Table of contents\n\n### Ng CLI Adapter Classes\n\n- [NxScopedHost](../../devkit/ngcli_adapter#nxscopedhost)\n\n### Functions\n\n- [mockSchematicsForTesting](../../devkit/ngcli_adapter#mockschematicsfortesting)\n- [overrideCollectionResolutionForTesting](../../devkit/ngcli_adapter#overridecollectionresolutionfortesting)\n- [wrapAngularDevkitSchematic](../../devkit/ngcli_adapter#wrapangulardevkitschematic)\n\n## Ng CLI Adapter Classes\n\n### NxScopedHost\n\n• **NxScopedHost**: `Object`\n\n## Functions\n\n### mockSchematicsForTesting\n\n▸ **mockSchematicsForTesting**(`schematics`): `void`\n\nIf you have an Nx Devkit generator invoking the wrapped Angular Devkit schematic,\nand you don't want the Angular Devkit schematic to run, you can mock it up using this function.\n\nUnfortunately, there are some edge cases in the Nx-Angular devkit integration that\ncan be seen in the unit tests context. This function is useful for handling that as well.\n\nIn this case, you can mock it up.\n\nExample:\n\n```typescript\n mockSchematicsForTesting({\n 'mycollection:myschematic': (tree, params) => {\n tree.write('README.md');\n }\n });\n\n```\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `schematics` | `Object` |\n\n#### Returns\n\n`void`\n\n___\n\n### overrideCollectionResolutionForTesting\n\n▸ **overrideCollectionResolutionForTesting**(`collections`): `void`\n\nBy default, Angular Devkit schematic collections will be resolved using the Node resolution.\nThis doesn't work if you are testing schematics that refer to other schematics in the\nsame repo.\n\nThis function can can be used to override the resolution behaviour.\n\nExample:\n\n```typescript\n overrideCollectionResolutionForTesting({\n '@nrwl/workspace': path.join(__dirname, '../../../../workspace/generators.json'),\n '@nrwl/angular': path.join(__dirname, '../../../../angular/generators.json'),\n '@nrwl/linter': path.join(__dirname, '../../../../linter/generators.json')\n });\n\n```\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `collections` | `Object` |\n\n#### Returns\n\n`void`\n\n___\n\n### wrapAngularDevkitSchematic\n\n▸ **wrapAngularDevkitSchematic**(`collectionName`, `generatorName`): (`host`: [`Tree`](../../devkit/index#tree), `generatorOptions`: { [k: string]: `any`; }) => `Promise`<`any`\\>\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `collectionName` | `string` |\n| `generatorName` | `string` |\n\n#### Returns\n\n`fn`\n\n▸ (`host`, `generatorOptions`): `Promise`<`any`\\>\n\n##### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `host` | [`Tree`](../../devkit/index#tree) |\n| `generatorOptions` | `Object` |\n\n##### Returns\n\n`Promise`<`any`\\>\n" } ], "generators": [], diff --git a/nx.json b/nx.json index 436b7d42200eb..e04ddca4f3b7b 100644 --- a/nx.json +++ b/nx.json @@ -3,7 +3,6 @@ "affected": { "defaultBase": "master" }, - "npmScope": "nrwl", "tasksRunnerOptions": { "default": { "runner": "@nrwl/nx-cloud", @@ -25,10 +24,6 @@ } } }, - "workspaceLayout": { - "libsDir": "", - "appsDir": "" - }, "namedInputs": { "default": ["{projectRoot}/**/*", "sharedGlobals"], "production": [ @@ -86,11 +81,5 @@ "inputs": ["default", "^production", "{workspaceRoot}/.storybook/**/*"] } }, - "generators": { - "@nrwl/react": { - "application": { - "babel": true - } - } - } + "defaultProject": "@nrwl/nx-source" } diff --git a/package.json b/package.json index 5ed9f50e11e2b..6375325457091 100644 --- a/package.json +++ b/package.json @@ -10,11 +10,9 @@ "check-format": "nx format:check --all", "check-imports": "node ./scripts/check-imports.js", "check-lock-files": "node ./scripts/check-lock-files.js", - "check-versions": "ts-node -P ./scripts/tsconfig.scripts.json ./scripts/check-versions.ts", "check-documentation-map": "ts-node -P ./scripts/tsconfig.scripts.json ./scripts/documentation/map-link-checker.ts", "e2e-start-local-registry": "node ./scripts/e2e-start-local-registry.js", "e2e-build-package-publish": "ts-node -P ./scripts/tsconfig.e2e.json ./scripts/e2e-build-package-publish.ts", - "format": "nx format", "nx-release": "ts-node -P ./scripts/tsconfig.scripts.json ./scripts/nx-release", "prepublishOnly": "node ./scripts/update-package-group.js", "version": "npx prettier lerna.json --write", @@ -23,7 +21,8 @@ "documentation": "ts-node -P scripts/tsconfig.scripts.json ./scripts/documentation/documentation.ts && yarn check-documentation-map", "submit-plugin": "node ./scripts/submit-plugin.js", "prepare": "is-ci || husky install", - "echo": "echo 123458" + "echo": "echo 123458", + "lint": "nx workspace-lint" }, "devDependencies": { "@angular-devkit/architect": "~0.1500.0", @@ -308,6 +307,17 @@ "**/xmlhttprequest-ssl": "~1.6.2", "minimist": "^1.2.6", "underscore": "^1.12.1" + }, + "nx": { + "includeScripts": [ + "echo", + "check-format", + "check-imports", + "check-lock-files", + "depcheck", + "documentation", + "lint" + ] } } diff --git a/scripts/check-versions.ts b/scripts/check-versions.ts deleted file mode 100644 index 4c67ccd8e98be..0000000000000 --- a/scripts/check-versions.ts +++ /dev/null @@ -1,196 +0,0 @@ -/* - * This script checks if new versions of node modules are available. - * It uses naming conventions to transform constants to matching node module name. - * - * Usage: - * yarn check-versions [file|package] - * - * Positional arg: - * - [file]: relative or absolute file path to the versions file. - * - * Example: - * yarn check-versions react - */ - -import { join, relative } from 'path'; -import { gt } from 'semver'; -import { readJsonSync, writeJsonSync } from 'fs-extra'; -import * as chalk from 'chalk'; -import { dasherize } from '../packages/workspace/src/utils/strings'; -import * as glob from 'glob'; -import { execSync } from 'child_process'; -import { readFileSync, writeFileSync } from 'fs'; - -const root = join(__dirname, '..'); -const excluded = ['nxVersion']; -const scoped = [ - 'babel', - 'emotion', - 'reduxjs', - 'swc', - 'testing-library', - 'types', -]; - -try { - const files = process.argv[2] - ? [normalize(process.argv[2])] - : glob.sync('packages/**/*/versions.ts').map((x) => relative(root, x)); - checkFiles(files); -} catch (e) { - console.log(chalk.red(e.message)); - process.exitCode = 1; -} - -function normalize(x: string) { - if (x.endsWith('.ts')) { - return x; - } else { - return join('packages', x, 'src/utils/versions.ts'); - } -} - -// ----------------------------------------------------------------------------- - -function checkFiles(files: string[]) { - console.log(chalk.blue(`Checking versions in the following files...\n`)); - console.log(` - ${files.join('\n - ')}\n`); - const maxFileNameLength = Math.max(...files.map((f) => f.length)); - - let hasError = false; - - files.forEach((f) => { - const projectRoot = f.split('/src/')[0]; - const migrationsPath = join(projectRoot, 'migrations.json'); - const migrationsJson = readJsonSync(migrationsPath); - let versionsContent = readFileSync(f).toString(); - const versions = getVersions(f); - const npmPackages = getPackages(versions); - const results = npmPackages.map(([p, v, o]) => getVersionData(p, v, o)); - const logContext = `${f.padEnd(maxFileNameLength)}`; - const packageUpdates = {}; - - results.forEach((r) => { - if (r.outdated) { - console.log( - `${logContext} ❗ ${chalk.bold( - r.package - )} has new version ${chalk.bold(r.latest)} (current: ${r.prev})` - ); - versionsContent = versionsContent.replace( - `${r.variable} = '${r.prev}'`, - `${r.variable} = '${r.latest}'` - ); - packageUpdates[r.package] = { - version: r.latest, - alwaysAddToPackageJson: false, - }; - } - if (r.invalid) { - hasError = true; - console.log( - `${logContext} ⚠️ ${chalk.bold(r.package)} has an invalid version (${ - r.prev - }) specified. Latest is ${r.latest}.` - ); - } - }); - - if (Object.keys(packageUpdates).length > 0) { - migrationsJson.packageJsonUpdates['x.y.z'] = { - version: 'x.y.z', - packages: packageUpdates, - }; - writeFileSync(f, versionsContent); - writeJsonSync(migrationsPath, migrationsJson, { spaces: 2 }); - } - }); - - if (hasError) { - throw new Error('Invalid versions of packages found (please see above).'); - } -} - -function getVersions(path: string) { - const versionsPath = - path.startsWith('.') || path.startsWith('packages') - ? join(__dirname, '..', path) - : path; - try { - return require(versionsPath); - } catch { - throw new Error(`Could not load ${path}. Please make sure it is valid.`); - } -} - -function getPackages(versions: Record): string[][] { - return Object.entries(versions).reduce((acc, [name, version]) => { - if (!excluded.includes(name)) { - const npmName = getNpmName(name); - acc.push([npmName, version, name]); - } - return acc; - }, [] as string[][]); -} - -function getNpmName(name: string): string { - const dashedName = dasherize(name.replace(/Version$/, '')); - const scope = scoped.find((s) => dashedName.startsWith(`${s}-`)); - - if (scope) { - const rest = dashedName.split(`${scope}-`)[1]; - return `@${scope}/${rest}`; - } else { - return dashedName; - } -} - -function getVersionData( - p: string, - v: string, - o: string -): { - variable: string; - package: string; - outdated: boolean; - invalid: boolean; - latest: string; - prev?: string; -} { - try { - const latest = JSON.parse( - execSync(`npm view ${p} version --json --silent`, { - stdio: ['ignore'], - }).toString('utf-8') - ); - if (gt(latest, v)) { - return { - variable: o, - package: p, - outdated: true, - invalid: false, - latest, - prev: v, - }; - } - if (gt(v, latest)) { - return { - variable: o, - package: p, - outdated: false, - invalid: true, - latest, - prev: v, - }; - } - } catch { - // ignored - } - return { - variable: o, - package: p, - outdated: false, - invalid: false, - latest: v, - }; -}