diff --git a/docs/generated/packages/angular/generators/change-storybook-targets.json b/docs/generated/packages/angular/generators/change-storybook-targets.json deleted file mode 100644 index 350d7e84aa..0000000000 --- a/docs/generated/packages/angular/generators/change-storybook-targets.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "change-storybook-targets", - "factory": "./src/generators/change-storybook-targets/change-storybook-targets", - "schema": { - "$schema": "http://json-schema.org/schema", - "$id": "NxAngularChangeStorybookTargetsGenerator", - "title": "Change Storybook targets", - "description": "Change the Storybook target executors.", - "type": "object", - "cli": "nx", - "properties": { - "skipFormat": { - "description": "Skip formatting files.", - "type": "boolean", - "default": false, - "x-priority": "internal" - } - }, - "additionalProperties": false, - "required": [], - "examplesFile": "This generator will change the `storybook` and `build-storybook` targets in all your Angular projects that are configured to use Storybook. The new target configuration will use the native Storybook builders (`@storybook/angular:build-storybook` and `@storybook/angular:start-storybook`) instead of the Nx Storybook builders (`@nrwl/storybook:build-storybook` and `@nrwl/storybook:storybook`).\n\nThis generator is usually invoked through a migrator, when you are using `nx migrate` to upgrade your workspace to Nx `14.1.8` or later.\n\nIf you are on Nx `14.1.8` or later and you did not use `nx migrate`, you can run this generator manually by running the following command:\n\n```bash\nnx g @nrwl/angular:change-storybook-targets\n```\n\nYou can read more about how this generator works, and why we are changing the Storybook targets, in the [Angular Storybook targets documentation page](/packages/storybook/documents/angular-storybook-targets).\n", - "presets": [] - }, - "description": "Change storybook targets for Angular projects to use @storybook/angular executors", - "implementation": "/packages/angular/src/generators/change-storybook-targets/change-storybook-targets.ts", - "aliases": [], - "hidden": false, - "path": "/packages/angular/src/generators/change-storybook-targets/schema.json", - "type": "generator" -} diff --git a/docs/generated/packages/cypress/documents/v10-migration-guide.md b/docs/generated/packages/cypress/documents/v10-migration-guide.md deleted file mode 100644 index f6f7c6e105..0000000000 --- a/docs/generated/packages/cypress/documents/v10-migration-guide.md +++ /dev/null @@ -1,29 +0,0 @@ -# Migrating to Cypress V10 - -Cypress v10 introduce new features, like component testing, along with some breaking changes. - -Before continuing, make sure you have all your changes committed and have a clean working tree. - -You can migrate an E2E project to v10 by running the following command: - -```shell -nx g @nrwl/cypress:migrate-to-cypress-10 -``` - -In general, these are the steps taken to migrate your project: - -1. Migrates your existing `cypress.json` configuration to a new `cypress.config.ts` configuration file. - - The `pluginsFile` option has been replaced for `setupNodeEvents`. We will import the file and add it to - the `setupNodeEvents` config option. Double-check your plugins are working correctly. -2. Rename all test files from `.spec.ts` to `.cy.ts` -3. Rename the `support/index.ts` to `support/e2e.ts` and update any associated imports -4. Rename the `integrations` folder to the `e2e` folder - -{% callout type="caution" title="Root cypress.json" %} -Keeping a root `cypress.json` file, will cause issues with [Cypress trying to load the project](https://github.com/nrwl/nx/issues/11512). -Instead, you can create a [root ts file and import it into each project's cypress config file](https://github.com/nrwl/nx/issues/11512#issuecomment-1213420638) to share values across projects. -{% /callout %} - -We take the best effort to make this migration seamless, but there can be edge cases we didn't anticipate. So feel free to [open an issue](https://github.com/nrwl/nx/issues/new?assignees=&labels=type%3A+bug&template=1-bug.md) if you come across any problems. - -You can also consult the [official Cypress migration guide](https://docs.cypress.io/guides/references/migration-guide#Migrating-to-Cypress-version-10-0) if you get stuck and want to manually migrate your projects. diff --git a/docs/generated/packages/cypress/generators/migrate-to-cypress-10.json b/docs/generated/packages/cypress/generators/migrate-to-cypress-10.json deleted file mode 100644 index a1394d696c..0000000000 --- a/docs/generated/packages/cypress/generators/migrate-to-cypress-10.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "migrate-to-cypress-10", - "factory": "./src/generators/migrate-to-cypress-ten/migrate-to-cypress-ten#migrateCypressProject", - "schema": { - "$schema": "http://json-schema.org/schema", - "$id": "NxCypressMigrateToTen", - "cli": "nx", - "title": "Migrate e2e project to Cypress 10", - "description": "Migrate Cypress e2e project from v8/v9 to Cypress v10.", - "type": "object", - "examples": [ - { - "command": "nx g @nrwl/cypress:migrate-to-cypress-10", - "description": "Migrate existing cypress projects to Cypress v10" - } - ], - "properties": {}, - "presets": [] - }, - "description": "Migrate existing Cypress e2e projects to Cypress v10", - "hidden": true, - "implementation": "/packages/cypress/src/generators/migrate-to-cypress-ten/migrate-to-cypress-ten#migrateCypressProject.ts", - "aliases": [], - "path": "/packages/cypress/src/generators/migrate-to-cypress-ten/schema.json", - "type": "generator" -} diff --git a/docs/generated/packages/devkit.json b/docs/generated/packages/devkit.json deleted file mode 100644 index 7205b690d5..0000000000 --- a/docs/generated/packages/devkit.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "githubRoot": "https://github.com/nrwl/nx/blob/master", - "name": "devkit", - "packageName": "@nrwl/devkit", - "description": "The Nx Devkit is used to customize Nx for different technologies and use cases. It contains many utility functions for reading and writing files, updating configuration, working with Abstract Syntax Trees(ASTs), and more.", - "root": "/packages/devkit", - "source": "/packages/devkit/src", - "documentation": [ - { - "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### Executors Functions\n\n- [parseTargetString](../../devkit/index#parsetargetstring)\n\n### Other 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- [createLockFile](../../devkit/index#createlockfile)\n- [createPackageJson](../../devkit/index#createpackagejson)\n- [createProjectGraphAsync](../../devkit/index#createprojectgraphasync)\n- [defaultTasksRunner](../../devkit/index#defaulttasksrunner)\n- [detectPackageManager](../../devkit/index#detectpackagemanager)\n- [detectWorkspaceScope](../../devkit/index#detectworkspacescope)\n- [ensurePackage](../../devkit/index#ensurepackage)\n- [extractLayoutDirectory](../../devkit/index#extractlayoutdirectory)\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- [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## Executors Functions\n\n### parseTargetString\n\n▸ **parseTargetString**(`targetString`): [`Target`](../../devkit/index#target)\n\n**`deprecated(v17)`** A project graph should be passed to parseTargetString for best accuracy.\n\n#### Parameters\n\n| Name | Type |\n| :------------- | :------- |\n| `targetString` | `string` |\n\n#### Returns\n\n[`Target`](../../devkit/index#target)\n\n▸ **parseTargetString**(`targetString`, `projectGraph`): [`Target`](../../devkit/index#target)\n\nParses a target string into {project, target, configuration}\n\nExamples:\n\n```typescript\nparseTargetString('proj:test', graph); // returns { project: \"proj\", target: \"test\" }\nparseTargetString('proj:test:production', graph); // returns { project: \"proj\", target: \"test\", configuration: \"production\" }\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| :------------- | :-------------------------------------------------------- | :--------------- |\n| `targetString` | `string` | target reference |\n| `projectGraph` | [`ProjectGraph`](../../devkit/index#projectgraph)<`any`\\> | - |\n\n#### Returns\n\n[`Target`](../../devkit/index#target)\n\n---\n\n## Other 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### createLockFile\n\n▸ **createLockFile**(`packageJson`, `packageManager?`): `string`\n\nCreate lock file based on the root level lock file and (pruned) package.json\n\n#### Parameters\n\n| Name | Type |\n| :--------------- | :---------------------------------------------------- |\n| `packageJson` | `PackageJson` |\n| `packageManager` | [`PackageManager`](../../devkit/index#packagemanager) |\n\n#### Returns\n\n`string`\n\n---\n\n### createPackageJson\n\n▸ **createPackageJson**(`projectName`, `graph`, `options?`): `PackageJson`\n\nCreates a package.json in the output directory for support to install dependencies within containers.\n\nIf a package.json exists in the project, it will reuse that.\nIf isProduction flag is set, it wil remove devDependencies and optional peerDependencies\n\n#### Parameters\n\n| Name | Type |\n| :---------------------- | :-------------------------------------------------------- |\n| `projectName` | `string` |\n| `graph` | [`ProjectGraph`](../../devkit/index#projectgraph)<`any`\\> |\n| `options` | `Object` |\n| `options.isProduction?` | `boolean` |\n| `options.root?` | `string` |\n\n#### Returns\n\n`PackageJson`\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### ensurePackage\n\n▸ **ensurePackage**(`tree`, `pkg`, `requiredVersion`, `options?`): `Promise`<`void`\\>\n\nEnsure that dependencies and devDependencies from package.json are installed at the required versions.\n\nFor example:\n\n```typescript\nensurePackage(tree, {}, { '@nrwl/jest': nxVersion });\n```\n\nThis will check that @nrwl/jest@ exists in devDependencies.\nIf it exists then function returns, otherwise it will install the package before continuing.\nWhen running with --dryRun, the function will throw when dependencies are missing.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------------------------ | :-------------------------------- | :----------------------------------------------------------------- |\n| `tree` | [`Tree`](../../devkit/index#tree) | the file system tree |\n| `pkg` | `string` | the package to check (e.g. @nrwl/jest) |\n| `requiredVersion` | `string` | the version or semver range to check (e.g. ~1.0.0, >=1.0.0 <2.0.0) |\n| `options` | `Object` | |\n| `options.dev?` | `boolean` | - |\n| `options.throwOnMissing?` | `boolean` | - |\n\n#### Returns\n\n`Promise`<`void`\\>\n\n---\n\n### extractLayoutDirectory\n\n▸ **extractLayoutDirectory**(`directory`): `Object`\n\nExperimental\n\n#### Parameters\n\n| Name | Type |\n| :---------- | :------- |\n| `directory` | `string` |\n\n#### Returns\n\n`Object`\n\n| Name | Type |\n| :----------------- | :------- |\n| `layoutDirectory` | `string` |\n| `projectDirectory` | `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### 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" - }, - { - "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" - } - ], - "generators": [], - "executors": [] -} diff --git a/docs/generated/packages/devkit/documents/index.md b/docs/generated/packages/devkit/documents/index.md deleted file mode 100644 index 1f81d44d0f..0000000000 --- a/docs/generated/packages/devkit/documents/index.md +++ /dev/null @@ -1,2426 +0,0 @@ -# Module: @nrwl/devkit - -The Nx Devkit is the underlying technology used to customize Nx to support -different technologies and custom use-cases. It contains many utility -functions for reading and writing files, updating configuration, -working with Abstract Syntax Trees(ASTs), and more. - -As with most things in Nx, the core of Nx Devkit is very simple. -It only uses language primitives and immutable objects -(the tree being the only exception). - -## Table of contents - -### Project Graph Enumerations - -- [DependencyType](../../devkit/documents/nrwl_devkit#dependencytype) - -### Utils Enumerations - -- [ChangeType](../../devkit/documents/nrwl_devkit#changetype) - -### Project Graph Classes - -- [ProjectGraphBuilder](../../devkit/documents/nrwl_devkit#projectgraphbuilder) - -### Utils Classes - -- [Hasher](../../devkit/documents/nrwl_devkit#hasher) - -### Workspace Classes - -- [Workspaces](../../devkit/documents/nrwl_devkit#workspaces) - -### Commands Interfaces - -- [Target](../../devkit/documents/nrwl_devkit#target) - -### Other Interfaces - -- [NxPlugin](../../devkit/documents/nrwl_devkit#nxplugin) - -### Project Graph Interfaces - -- [FileData](../../devkit/documents/nrwl_devkit#filedata) -- [ProjectFileMap](../../devkit/documents/nrwl_devkit#projectfilemap) -- [ProjectGraph](../../devkit/documents/nrwl_devkit#projectgraph) -- [ProjectGraphDependency](../../devkit/documents/nrwl_devkit#projectgraphdependency) -- [ProjectGraphExternalNode](../../devkit/documents/nrwl_devkit#projectgraphexternalnode) -- [ProjectGraphProcessorContext](../../devkit/documents/nrwl_devkit#projectgraphprocessorcontext) -- [ProjectGraphProjectNode](../../devkit/documents/nrwl_devkit#projectgraphprojectnode) - -### Tree Interfaces - -- [FileChange](../../devkit/documents/nrwl_devkit#filechange) -- [Tree](../../devkit/documents/nrwl_devkit#tree) - -### Utils Interfaces - -- [DefaultTasksRunnerOptions](../../devkit/documents/nrwl_devkit#defaulttasksrunneroptions) -- [Hash](../../devkit/documents/nrwl_devkit#hash) -- [JsonParseOptions](../../devkit/documents/nrwl_devkit#jsonparseoptions) -- [JsonSerializeOptions](../../devkit/documents/nrwl_devkit#jsonserializeoptions) -- [ModuleFederationConfig](../../devkit/documents/nrwl_devkit#modulefederationconfig) -- [RemoteCache](../../devkit/documents/nrwl_devkit#remotecache) -- [SharedLibraryConfig](../../devkit/documents/nrwl_devkit#sharedlibraryconfig) -- [StringDeletion](../../devkit/documents/nrwl_devkit#stringdeletion) -- [StringInsertion](../../devkit/documents/nrwl_devkit#stringinsertion) - -### Workspace Interfaces - -- [ExecutorContext](../../devkit/documents/nrwl_devkit#executorcontext) -- [ExecutorsJson](../../devkit/documents/nrwl_devkit#executorsjson) -- [GeneratorsJson](../../devkit/documents/nrwl_devkit#generatorsjson) -- [HasherContext](../../devkit/documents/nrwl_devkit#hashercontext) -- [ImplicitJsonSubsetDependency](../../devkit/documents/nrwl_devkit#implicitjsonsubsetdependency) -- [MigrationsJson](../../devkit/documents/nrwl_devkit#migrationsjson) -- [NxAffectedConfig](../../devkit/documents/nrwl_devkit#nxaffectedconfig) -- [NxJsonConfiguration](../../devkit/documents/nrwl_devkit#nxjsonconfiguration) -- [ProjectConfiguration](../../devkit/documents/nrwl_devkit#projectconfiguration) -- [ProjectsConfigurations](../../devkit/documents/nrwl_devkit#projectsconfigurations) -- [TargetConfiguration](../../devkit/documents/nrwl_devkit#targetconfiguration) -- [TargetDependencyConfig](../../devkit/documents/nrwl_devkit#targetdependencyconfig) -- [Task](../../devkit/documents/nrwl_devkit#task) -- [TaskGraph](../../devkit/documents/nrwl_devkit#taskgraph) -- [Workspace](../../devkit/documents/nrwl_devkit#workspace) - -### Generators Type aliases - -- [WorkspaceConfiguration](../../devkit/documents/nrwl_devkit#workspaceconfiguration) - -### Other Type aliases - -- [ProjectTargetConfigurator](../../devkit/documents/nrwl_devkit#projecttargetconfigurator) - -### Package Manager Type aliases - -- [PackageManager](../../devkit/documents/nrwl_devkit#packagemanager) - -### Project Graph Type aliases - -- [ProjectGraphNode](../../devkit/documents/nrwl_devkit#projectgraphnode) - -### Utils Type aliases - -- [AdditionalSharedConfig](../../devkit/documents/nrwl_devkit#additionalsharedconfig) -- [ModuleFederationLibrary](../../devkit/documents/nrwl_devkit#modulefederationlibrary) -- [Remotes](../../devkit/documents/nrwl_devkit#remotes) -- [SharedFunction](../../devkit/documents/nrwl_devkit#sharedfunction) -- [SharedWorkspaceLibraryConfig](../../devkit/documents/nrwl_devkit#sharedworkspacelibraryconfig) -- [StringChange](../../devkit/documents/nrwl_devkit#stringchange) -- [WorkspaceLibrary](../../devkit/documents/nrwl_devkit#workspacelibrary) -- [WorkspaceLibrarySecondaryEntryPoint](../../devkit/documents/nrwl_devkit#workspacelibrarysecondaryentrypoint) - -### Workspace Type aliases - -- [CustomHasher](../../devkit/documents/nrwl_devkit#customhasher) -- [Executor](../../devkit/documents/nrwl_devkit#executor) -- [Generator](../../devkit/documents/nrwl_devkit#generator) -- [GeneratorCallback](../../devkit/documents/nrwl_devkit#generatorcallback) -- [ImplicitDependencyEntry](../../devkit/documents/nrwl_devkit#implicitdependencyentry) -- [ProjectType](../../devkit/documents/nrwl_devkit#projecttype) -- [TaskGraphExecutor](../../devkit/documents/nrwl_devkit#taskgraphexecutor) -- [WorkspaceJsonConfiguration](../../devkit/documents/nrwl_devkit#workspacejsonconfiguration) - -### Logger Variables - -- [logger](../../devkit/documents/nrwl_devkit#logger) - -### Utils Variables - -- [appRootPath](../../devkit/documents/nrwl_devkit#approotpath) -- [cacheDir](../../devkit/documents/nrwl_devkit#cachedir) -- [output](../../devkit/documents/nrwl_devkit#output) -- [workspaceRoot](../../devkit/documents/nrwl_devkit#workspaceroot) - -### Functions - -- [addDependenciesToPackageJson](../../devkit/documents/nrwl_devkit#adddependenciestopackagejson) -- [addProjectConfiguration](../../devkit/documents/nrwl_devkit#addprojectconfiguration) -- [applyAdditionalShared](../../devkit/documents/nrwl_devkit#applyadditionalshared) -- [applyChangesToString](../../devkit/documents/nrwl_devkit#applychangestostring) -- [applySharedFunction](../../devkit/documents/nrwl_devkit#applysharedfunction) -- [convertNxExecutor](../../devkit/documents/nrwl_devkit#convertnxexecutor) -- [convertNxGenerator](../../devkit/documents/nrwl_devkit#convertnxgenerator) -- [createLockFile](../../devkit/documents/nrwl_devkit#createlockfile) -- [createPackageJson](../../devkit/documents/nrwl_devkit#createpackagejson) -- [createProjectGraphAsync](../../devkit/documents/nrwl_devkit#createprojectgraphasync) -- [defaultTasksRunner](../../devkit/documents/nrwl_devkit#defaulttasksrunner) -- [detectPackageManager](../../devkit/documents/nrwl_devkit#detectpackagemanager) -- [detectWorkspaceScope](../../devkit/documents/nrwl_devkit#detectworkspacescope) -- [ensurePackage](../../devkit/documents/nrwl_devkit#ensurepackage) -- [extractLayoutDirectory](../../devkit/documents/nrwl_devkit#extractlayoutdirectory) -- [formatFiles](../../devkit/documents/nrwl_devkit#formatfiles) -- [generateFiles](../../devkit/documents/nrwl_devkit#generatefiles) -- [getDependentPackagesForProject](../../devkit/documents/nrwl_devkit#getdependentpackagesforproject) -- [getImportPath](../../devkit/documents/nrwl_devkit#getimportpath) -- [getNpmPackageSharedConfig](../../devkit/documents/nrwl_devkit#getnpmpackagesharedconfig) -- [getOutputsForTargetAndConfiguration](../../devkit/documents/nrwl_devkit#getoutputsfortargetandconfiguration) -- [getPackageManagerCommand](../../devkit/documents/nrwl_devkit#getpackagemanagercommand) -- [getPackageManagerVersion](../../devkit/documents/nrwl_devkit#getpackagemanagerversion) -- [getProjects](../../devkit/documents/nrwl_devkit#getprojects) -- [getWorkspaceLayout](../../devkit/documents/nrwl_devkit#getworkspacelayout) -- [getWorkspacePath](../../devkit/documents/nrwl_devkit#getworkspacepath) -- [installPackagesTask](../../devkit/documents/nrwl_devkit#installpackagestask) -- [isStandaloneProject](../../devkit/documents/nrwl_devkit#isstandaloneproject) -- [joinPathFragments](../../devkit/documents/nrwl_devkit#joinpathfragments) -- [mapRemotes](../../devkit/documents/nrwl_devkit#mapremotes) -- [mapRemotesForSSR](../../devkit/documents/nrwl_devkit#mapremotesforssr) -- [moveFilesToNewDirectory](../../devkit/documents/nrwl_devkit#movefilestonewdirectory) -- [names](../../devkit/documents/nrwl_devkit#names) -- [normalizePath](../../devkit/documents/nrwl_devkit#normalizepath) -- [offsetFromRoot](../../devkit/documents/nrwl_devkit#offsetfromroot) -- [parseJson](../../devkit/documents/nrwl_devkit#parsejson) -- [parseTargetString](../../devkit/documents/nrwl_devkit#parsetargetstring) -- [readAllWorkspaceConfiguration](../../devkit/documents/nrwl_devkit#readallworkspaceconfiguration) -- [readCachedProjectGraph](../../devkit/documents/nrwl_devkit#readcachedprojectgraph) -- [readJson](../../devkit/documents/nrwl_devkit#readjson) -- [readJsonFile](../../devkit/documents/nrwl_devkit#readjsonfile) -- [readNxJson](../../devkit/documents/nrwl_devkit#readnxjson) -- [readProjectConfiguration](../../devkit/documents/nrwl_devkit#readprojectconfiguration) -- [readRootPackageJson](../../devkit/documents/nrwl_devkit#readrootpackagejson) -- [readTargetOptions](../../devkit/documents/nrwl_devkit#readtargetoptions) -- [readWorkspaceConfiguration](../../devkit/documents/nrwl_devkit#readworkspaceconfiguration) -- [removeDependenciesFromPackageJson](../../devkit/documents/nrwl_devkit#removedependenciesfrompackagejson) -- [removeProjectConfiguration](../../devkit/documents/nrwl_devkit#removeprojectconfiguration) -- [reverse](../../devkit/documents/nrwl_devkit#reverse) -- [runExecutor](../../devkit/documents/nrwl_devkit#runexecutor) -- [serializeJson](../../devkit/documents/nrwl_devkit#serializejson) -- [sharePackages](../../devkit/documents/nrwl_devkit#sharepackages) -- [shareWorkspaceLibraries](../../devkit/documents/nrwl_devkit#shareworkspacelibraries) -- [stripIndents](../../devkit/documents/nrwl_devkit#stripindents) -- [stripJsonComments](../../devkit/documents/nrwl_devkit#stripjsoncomments) -- [targetToTargetString](../../devkit/documents/nrwl_devkit#targettotargetstring) -- [toJS](../../devkit/documents/nrwl_devkit#tojs) -- [updateJson](../../devkit/documents/nrwl_devkit#updatejson) -- [updateNxJson](../../devkit/documents/nrwl_devkit#updatenxjson) -- [updateProjectConfiguration](../../devkit/documents/nrwl_devkit#updateprojectconfiguration) -- [updateTsConfigsToJs](../../devkit/documents/nrwl_devkit#updatetsconfigstojs) -- [updateWorkspaceConfiguration](../../devkit/documents/nrwl_devkit#updateworkspaceconfiguration) -- [visitNotIgnoredFiles](../../devkit/documents/nrwl_devkit#visitnotignoredfiles) -- [workspaceLayout](../../devkit/documents/nrwl_devkit#workspacelayout) -- [writeJson](../../devkit/documents/nrwl_devkit#writejson) -- [writeJsonFile](../../devkit/documents/nrwl_devkit#writejsonfile) - -## Project Graph Enumerations - -### DependencyType - -• **DependencyType**: `Object` - ---- - -## Utils Enumerations - -### ChangeType - -• **ChangeType**: `Object` - -## Project Graph Classes - -### ProjectGraphBuilder - -• **ProjectGraphBuilder**: `Object` - ---- - -## Utils Classes - -### Hasher - -• **Hasher**: `Object` - ---- - -## Workspace Classes - -### Workspaces - -• **Workspaces**: `Object` - -## Commands Interfaces - -### Target - -• **Target**: `Object` - ---- - -## Other Interfaces - -### NxPlugin - -• **NxPlugin**: `Object` - -A plugin for Nx - ---- - -## Project Graph Interfaces - -### FileData - -• **FileData**: `Object` - ---- - -### ProjectFileMap - -• **ProjectFileMap**: `Object` - ---- - -### ProjectGraph - -• **ProjectGraph**: `Object` - ---- - -### ProjectGraphDependency - -• **ProjectGraphDependency**: `Object` - ---- - -### ProjectGraphExternalNode - -• **ProjectGraphExternalNode**: `Object` - ---- - -### ProjectGraphProcessorContext - -• **ProjectGraphProcessorContext**: `Object` - ---- - -### ProjectGraphProjectNode - -• **ProjectGraphProjectNode**: `Object` - ---- - -## Tree Interfaces - -### FileChange - -• **FileChange**: `Object` - ---- - -### Tree - -• **Tree**: `Object` - ---- - -## Utils Interfaces - -### DefaultTasksRunnerOptions - -• **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 - -### ExecutorContext - -• **ExecutorContext**: `Object` - ---- - -### ExecutorsJson - -• **ExecutorsJson**: `Object` - ---- - -### GeneratorsJson - -• **GeneratorsJson**: `Object` - ---- - -### HasherContext - -• **HasherContext**: `Object` - ---- - -### ImplicitJsonSubsetDependency - -• **ImplicitJsonSubsetDependency**<`T`\>: `Object` - -#### Type parameters - -| Name | Type | -| :--- | :------------------ | -| `T` | `"*"` \| `string`[] | - ---- - -### MigrationsJson - -• **MigrationsJson**: `Object` - ---- - -### NxAffectedConfig - -• **NxAffectedConfig**: `Object` - ---- - -### NxJsonConfiguration - -• **NxJsonConfiguration**<`T`\>: `Object` - -#### Type parameters - -| Name | Type | -| :--- | :------------------ | -| `T` | `"*"` \| `string`[] | - ---- - -### ProjectConfiguration - -• **ProjectConfiguration**: `Object` - ---- - -### ProjectsConfigurations - -• **ProjectsConfigurations**: `Object` - ---- - -### TargetConfiguration - -• **TargetConfiguration**<`T`\>: `Object` - -#### Type parameters - -| Name | Type | -| :--- | :---- | -| `T` | `any` | - ---- - -### TargetDependencyConfig - -• **TargetDependencyConfig**: `Object` - ---- - -### Task - -• **Task**: `Object` - ---- - -### TaskGraph - -• **TaskGraph**: `Object` - ---- - -### Workspace - -• **Workspace**: `Object` - -## Generators Type aliases - -### WorkspaceConfiguration - -Ƭ **WorkspaceConfiguration**: `Omit`<[`ProjectsConfigurations`](../../devkit/documents/nrwl_devkit#projectsconfigurations), `"projects"`\> & `Partial`<[`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration)\> - ---- - -## Other Type aliases - -### ProjectTargetConfigurator - -Ƭ **ProjectTargetConfigurator**: (`file`: `string`) => `Record`<`string`, [`TargetConfiguration`](../../devkit/documents/nrwl_devkit#targetconfiguration)\> - -#### Type declaration - -▸ (`file`): `Record`<`string`, [`TargetConfiguration`](../../devkit/documents/nrwl_devkit#targetconfiguration)\> - -##### Parameters - -| Name | Type | -| :----- | :------- | -| `file` | `string` | - -##### Returns - -`Record`<`string`, [`TargetConfiguration`](../../devkit/documents/nrwl_devkit#targetconfiguration)\> - ---- - -## Package Manager Type aliases - -### PackageManager - -Ƭ **PackageManager**: `"yarn"` \| `"pnpm"` \| `"npm"` - ---- - -## Project Graph Type aliases - -### ProjectGraphNode - -Ƭ **ProjectGraphNode**: [`ProjectGraphProjectNode`](../../devkit/documents/nrwl_devkit#projectgraphprojectnode) \| [`ProjectGraphExternalNode`](../../devkit/documents/nrwl_devkit#projectgraphexternalnode) - ---- - -## Utils Type aliases - -### AdditionalSharedConfig - -Ƭ **AdditionalSharedConfig**: (`string` \| [libraryName: string, sharedConfig: SharedLibraryConfig] \| { `libraryName`: `string` ; `sharedConfig`: [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig) })[] - ---- - -### ModuleFederationLibrary - -Ƭ **ModuleFederationLibrary**: `Object` - -#### Type declaration - -| Name | Type | -| :----- | :------- | -| `name` | `string` | -| `type` | `string` | - ---- - -### Remotes - -Ƭ **Remotes**: `string`[] \| [remoteName: string, remoteUrl: string][] - ---- - -### SharedFunction - -Ƭ **SharedFunction**: (`libraryName`: `string`, `sharedConfig`: [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig)) => `undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig) - -#### Type declaration - -▸ (`libraryName`, `sharedConfig`): `undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig) - -##### Parameters - -| Name | Type | -| :------------- | :------------------------------------------------------------------------------ | -| `libraryName` | `string` | -| `sharedConfig` | [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig) | - -##### Returns - -`undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig) - ---- - -### SharedWorkspaceLibraryConfig - -Ƭ **SharedWorkspaceLibraryConfig**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------- | :---------------------------------------------------------------------------------------------------------------------------- | -| `getAliases` | () => `Record`<`string`, `string`\> | -| `getLibraries` | (`eager?`: `boolean`) => `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig)\> | -| `getReplacementPlugin` | () => `NormalModuleReplacementPlugin` | - ---- - -### StringChange - -Ƭ **StringChange**: [`StringInsertion`](../../devkit/documents/nrwl_devkit#stringinsertion) \| [`StringDeletion`](../../devkit/documents/nrwl_devkit#stringdeletion) - ---- - -### WorkspaceLibrary - -Ƭ **WorkspaceLibrary**: `Object` - -#### Type declaration - -| Name | Type | -| :---------- | :---------------------- | -| `importKey` | `string` \| `undefined` | -| `name` | `string` | -| `root` | `string` | - ---- - -### WorkspaceLibrarySecondaryEntryPoint - -Ƭ **WorkspaceLibrarySecondaryEntryPoint**: `Object` - -#### Type declaration - -| Name | Type | -| :----- | :------- | -| `name` | `string` | -| `path` | `string` | - ---- - -## Workspace Type aliases - -### CustomHasher - -Ƭ **CustomHasher**: (`task`: [`Task`](../../devkit/documents/nrwl_devkit#task), `context`: [`HasherContext`](../../devkit/documents/nrwl_devkit#hashercontext)) => `Promise`<[`Hash`](../../devkit/documents/nrwl_devkit#hash)\> - -#### Type declaration - -▸ (`task`, `context`): `Promise`<[`Hash`](../../devkit/documents/nrwl_devkit#hash)\> - -##### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------ | -| `task` | [`Task`](../../devkit/documents/nrwl_devkit#task) | -| `context` | [`HasherContext`](../../devkit/documents/nrwl_devkit#hashercontext) | - -##### Returns - -`Promise`<[`Hash`](../../devkit/documents/nrwl_devkit#hash)\> - ---- - -### Executor - -Ƭ **Executor**<`T`\>: (`options`: `T`, `context`: [`ExecutorContext`](../../devkit/documents/nrwl_devkit#executorcontext)) => `Promise`<`Object`\> \| `AsyncIterableIterator`<`Object`\> - -#### Type parameters - -| Name | Type | -| :--- | :---- | -| `T` | `any` | - -#### Type declaration - -▸ (`options`, `context`): `Promise`<`Object`\> \| `AsyncIterableIterator`<`Object`\> - -Implementation of a target of a project - -##### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------------- | -| `options` | `T` | -| `context` | [`ExecutorContext`](../../devkit/documents/nrwl_devkit#executorcontext) | - -##### Returns - -`Promise`<`Object`\> \| `AsyncIterableIterator`<`Object`\> - ---- - -### Generator - -Ƭ **Generator**<`T`\>: (`tree`: `any`, `schema`: `T`) => `void` \| [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback)\> - -#### Type parameters - -| Name | Type | -| :--- | :-------- | -| `T` | `unknown` | - -#### Type declaration - -▸ (`tree`, `schema`): `void` \| [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback)\> - -A function that schedules updates to the filesystem to be done atomically - -##### Parameters - -| Name | Type | -| :------- | :---- | -| `tree` | `any` | -| `schema` | `T` | - -##### Returns - -`void` \| [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback)\> - ---- - -### GeneratorCallback - -Ƭ **GeneratorCallback**: () => `void` \| `Promise`<`void`\> - -#### Type declaration - -▸ (): `void` \| `Promise`<`void`\> - -A callback function that is executed after changes are made to the file system - -##### Returns - -`void` \| `Promise`<`void`\> - ---- - -### ImplicitDependencyEntry - -Ƭ **ImplicitDependencyEntry**<`T`\>: `Object` - -#### Type parameters - -| Name | Type | -| :--- | :------------------ | -| `T` | `"*"` \| `string`[] | - -#### Index signature - -▪ [key: `string`]: `T` \| [`ImplicitJsonSubsetDependency`](../../devkit/documents/nrwl_devkit#implicitjsonsubsetdependency)<`T`\> - ---- - -### ProjectType - -Ƭ **ProjectType**: `"library"` \| `"application"` - ---- - -### TaskGraphExecutor - -Ƭ **TaskGraphExecutor**<`T`\>: (`taskGraph`: [`TaskGraph`](../../devkit/documents/nrwl_devkit#taskgraph), `options`: `Record`<`string`, `T`\>, `overrides`: `T`, `context`: [`ExecutorContext`](../../devkit/documents/nrwl_devkit#executorcontext)) => `Promise`<`Record`<`string`, `Object`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---- | -| `T` | `any` | - -#### Type declaration - -▸ (`taskGraph`, `options`, `overrides`, `context`): `Promise`<`Record`<`string`, `Object`\>\> - -Implementation of a target of a project that handles multiple projects to be batched - -##### Parameters - -| Name | Type | -| :---------- | :---------------------------------------------------------------------- | -| `taskGraph` | [`TaskGraph`](../../devkit/documents/nrwl_devkit#taskgraph) | -| `options` | `Record`<`string`, `T`\> | -| `overrides` | `T` | -| `context` | [`ExecutorContext`](../../devkit/documents/nrwl_devkit#executorcontext) | - -##### Returns - -`Promise`<`Record`<`string`, `Object`\>\> - ---- - -### WorkspaceJsonConfiguration - -Ƭ **WorkspaceJsonConfiguration**: [`ProjectsConfigurations`](../../devkit/documents/nrwl_devkit#projectsconfigurations) - -## Logger Variables - -### logger - -• **logger**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :-------------------------- | -| `debug` | (...`s`: `any`[]) => `void` | -| `error` | (`s`: `any`) => `void` | -| `fatal` | (...`s`: `any`[]) => `void` | -| `info` | (`s`: `any`) => `void` | -| `log` | (...`s`: `any`[]) => `void` | -| `warn` | (`s`: `any`) => `void` | - ---- - -## Utils Variables - -### appRootPath - -• **appRootPath**: `string` = `workspaceRoot` - ---- - -### cacheDir - -• **cacheDir**: `string` - ---- - -### output - -• **output**: `CLIOutput` - ---- - -### workspaceRoot - -• **workspaceRoot**: `string` - -## Functions - -### addDependenciesToPackageJson - -▸ **addDependenciesToPackageJson**(`tree`, `dependencies`, `devDependencies`, `packageJsonPath?`): [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) - -Add Dependencies and Dev Dependencies to package.json - -For example: - -```typescript -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/documents/nrwl_devkit#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 - -[`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) - -Callback to install dependencies only if necessary, no-op otherwise - ---- - -### addProjectConfiguration - -▸ **addProjectConfiguration**(`tree`, `projectName`, `projectConfiguration`, `standalone?`): `void` - -Adds project configuration to the Nx workspace. - -#### Parameters - -| Name | Type | Default value | Description | -| :--------------------- | :-------------------------------------------------------------------------------- | :------------ | :---------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | `undefined` | the file system tree | -| `projectName` | `string` | `undefined` | unique name. Often directories are part of the name (e.g., mydir-mylib) | -| `projectConfiguration` | [`ProjectConfiguration`](../../devkit/documents/nrwl_devkit#projectconfiguration) | `undefined` | project configuration | -| `standalone` | `boolean` | `true` | whether the project is configured in workspace.json or not | - -#### Returns - -`void` - ---- - -### applyAdditionalShared - -▸ **applyAdditionalShared**(`sharedConfig`, `additionalShared`, `projectGraph`): `void` - -Add additional dependencies to the shared package that may not have been -discovered by the project graph. - -This can be useful for applications that use a Dependency Injection system -that expects certain Singleton values to be present in the shared injection -hierarchy. - -#### Parameters - -| Name | Type | Description | -| :----------------- | :--------------------------------------------------------------------------------------------------- | :--------------------------------- | -| `sharedConfig` | `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig)\> | The original Shared Config | -| `additionalShared` | [`AdditionalSharedConfig`](../../devkit/documents/nrwl_devkit#additionalsharedconfig) | The additional dependencies to add | -| `projectGraph` | [`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) | The Nx project graph | - -#### Returns - -`void` - ---- - -### applyChangesToString - -▸ **applyChangesToString**(`text`, `changes`): `string` - -Applies a list of changes to a string's original value. - -This is useful when working with ASTs. - -For Example, to rename a property in a method's options: - -```typescript -const code = `bootstrap({ - target: document.querySelector('#app') -})`; - -const indexOfPropertyName = 13; // Usually determined by analyzing an AST. -const updatedCode = applyChangesToString(code, [ - { - type: ChangeType.Insert, - index: indexOfPropertyName, - text: 'element', - }, - { - type: ChangeType.Delete, - start: indexOfPropertyName, - length: 6, - }, -]); - -bootstrap({ - element: document.querySelector('#app'), -}); -``` - -#### Parameters - -| Name | Type | -| :-------- | :------------------------------------------------------------------ | -| `text` | `string` | -| `changes` | [`StringChange`](../../devkit/documents/nrwl_devkit#stringchange)[] | - -#### Returns - -`string` - ---- - -### applySharedFunction - -▸ **applySharedFunction**(`sharedConfig`, `sharedFn`): `void` - -Apply a custom function provided by the user that will modify the Shared Config -of the dependencies for the Module Federation build. - -#### Parameters - -| Name | Type | Description | -| :------------- | :--------------------------------------------------------------------------------------------------- | :---------------------------------------- | -| `sharedConfig` | `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig)\> | The original Shared Config to be modified | -| `sharedFn` | [`SharedFunction`](../../devkit/documents/nrwl_devkit#sharedfunction) | The custom function to run | - -#### Returns - -`void` - ---- - -### convertNxExecutor - -▸ **convertNxExecutor**(`executor`): `any` - -Convert an Nx Executor into an Angular Devkit Builder - -Use this to expose a compatible Angular Builder - -#### Parameters - -| Name | Type | -| :--------- | :---------------------------------------------------------------- | -| `executor` | [`Executor`](../../devkit/documents/nrwl_devkit#executor)<`any`\> | - -#### Returns - -`any` - ---- - -### convertNxGenerator - -▸ **convertNxGenerator**<`T`\>(`generator`, `skipWritingConfigInOldFormat?`): (`generatorOptions`: `T`) => (`tree`: `any`, `context`: `any`) => `Promise`<`any`\> - -Convert an Nx Generator into an Angular Devkit Schematic. - -#### Type parameters - -| Name | Type | -| :--- | :---- | -| `T` | `any` | - -#### Parameters - -| Name | Type | Default value | Description | -| :----------------------------- | :---------------------------------------------------------------- | :------------ | :---------------------------------------------------------- | -| `generator` | [`Generator`](../../devkit/documents/nrwl_devkit#generator)<`T`\> | `undefined` | The Nx generator to convert to an Angular Devkit Schematic. | -| `skipWritingConfigInOldFormat` | `boolean` | `false` | - | - -#### Returns - -`fn` - -▸ (`generatorOptions`): (`tree`: `any`, `context`: `any`) => `Promise`<`any`\> - -##### Parameters - -| Name | Type | -| :----------------- | :--- | -| `generatorOptions` | `T` | - -##### Returns - -`fn` - -▸ (`tree`, `context`): `Promise`<`any`\> - -##### Parameters - -| Name | Type | -| :-------- | :---- | -| `tree` | `any` | -| `context` | `any` | - -##### Returns - -`Promise`<`any`\> - ---- - -### createLockFile - -▸ `Const` **createLockFile**(`packageJson`, `packageManager?`): `string` - -**`deprecated`** Import this from @nrwl/js instead - -#### Parameters - -| Name | Type | -| :--------------- | :-------------------------------------------------------------------- | -| `packageJson` | `PackageJson` | -| `packageManager` | [`PackageManager`](../../devkit/documents/nrwl_devkit#packagemanager) | - -#### Returns - -`string` - ---- - -### createPackageJson - -▸ `Const` **createPackageJson**(`projectName`, `graph`, `options?`): `PackageJson` - -**`deprecated`** Import this from @nrwl/js instead - -#### Parameters - -| Name | Type | -| :---------------------- | :---------------------------------------------------------------- | -| `projectName` | `string` | -| `graph` | [`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) | -| `options` | `Object` | -| `options.isProduction?` | `boolean` | -| `options.root?` | `string` | - -#### Returns - -`PackageJson` - ---- - -### createProjectGraphAsync - -▸ **createProjectGraphAsync**(`opts?`): `Promise`<[`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph)\> - -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` - -`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. - -Tip: If you want to debug project graph creation, run your command with NX_DAEMON=false. - -Nx uses two layers of caching: the information about explicit dependencies stored on the disk and the information -stored in the daemon process. To reset both run: `nx reset`. - -#### Parameters - -| Name | Type | -| :------------------------ | :-------- | -| `opts` | `Object` | -| `opts.exitOnError` | `boolean` | -| `opts.resetDaemonClient?` | `boolean` | - -#### Returns - -`Promise`<[`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph)\> - ---- - -### defaultTasksRunner - -▸ `Const` **defaultTasksRunner**(`tasks`, `options`, `context?`): `any` - -#### Parameters - -| Name | Type | -| :--------------------------- | :---------------------------------------------------------------------------------------------------- | -| `tasks` | [`Task`](../../devkit/documents/nrwl_devkit#task)[] | -| `options` | [`DefaultTasksRunnerOptions`](../../devkit/documents/nrwl_devkit#defaulttasksrunneroptions) | -| `context?` | `Object` | -| `context.daemon?` | `DaemonClient` | -| `context.hasher?` | [`Hasher`](../../devkit/documents/nrwl_devkit#hasher) | -| `context.initiatingProject?` | `string` | -| `context.nxArgs` | `NxArgs` | -| `context.nxJson` | [`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration)<`string`[] \| `"*"`\> | -| `context.projectGraph` | [`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) | -| `context.target?` | `string` | -| `context.taskGraph?` | [`TaskGraph`](../../devkit/documents/nrwl_devkit#taskgraph) | - -#### Returns - -`any` - ---- - -### detectPackageManager - -▸ **detectPackageManager**(`dir?`): [`PackageManager`](../../devkit/documents/nrwl_devkit#packagemanager) - -Detects which package manager is used in the workspace based on the lock file. - -#### Parameters - -| Name | Type | Default value | -| :---- | :------- | :------------ | -| `dir` | `string` | `''` | - -#### Returns - -[`PackageManager`](../../devkit/documents/nrwl_devkit#packagemanager) - ---- - -### detectWorkspaceScope - -▸ **detectWorkspaceScope**(`packageName`): `string` - -Detect workspace scope from the package.json name - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `packageName` | `string` | - -#### Returns - -`string` - ---- - -### ensurePackage - -▸ **ensurePackage**(`tree`, `pkg`, `requiredVersion`, `options?`): `void` - -Ensure that dependencies and devDependencies from package.json are installed at the required versions. - -For example: - -```typescript -ensurePackage(tree, '@nrwl/jest', nxVersion); -``` - -This will check that @nrwl/jest@ exists in devDependencies. -If it exists then function returns, otherwise it will install the package before continuing. -When running with --dryRun, the function will throw when dependencies are missing. - -#### Parameters - -| Name | Type | Description | -| :------------------------ | :------------------------------------------------ | :----------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | the file system tree | -| `pkg` | `string` | the package to check (e.g. @nrwl/jest) | -| `requiredVersion` | `string` | the version or semver range to check (e.g. ~1.0.0, >=1.0.0 <2.0.0) | -| `options` | `Object` | | -| `options.dev?` | `boolean` | - | -| `options.throwOnMissing?` | `boolean` | - | - -#### Returns - -`void` - ---- - -### extractLayoutDirectory - -▸ **extractLayoutDirectory**(`directory`): `Object` - -Experimental - -#### Parameters - -| Name | Type | -| :---------- | :------- | -| `directory` | `string` | - -#### Returns - -`Object` - -| Name | Type | -| :----------------- | :------- | -| `layoutDirectory` | `string` | -| `projectDirectory` | `string` | - ---- - -### formatFiles - -▸ **formatFiles**(`tree`): `Promise`<`void`\> - -Formats all the created or updated files using Prettier - -#### Parameters - -| Name | Type | Description | -| :----- | :------------------------------------------------ | :------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | the file system tree | - -#### Returns - -`Promise`<`void`\> - ---- - -### generateFiles - -▸ **generateFiles**(`tree`, `srcFolder`, `target`, `substitutions`): `void` - -Generates a folder of files based on provided templates. - -While doing so it performs two substitutions: - -- 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', -}); -``` - -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. -`tmpl: ''` is a common pattern. With it you can name files like this: `index.ts__tmpl__`, so your editor -doesn't get confused about incorrect TypeScript files. - -#### Parameters - -| Name | Type | Description | -| :-------------- | :------------------------------------------------ | :-------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#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 - -▸ **getDependentPackagesForProject**(`projectGraph`, `name`): `Object` - -#### Parameters - -| Name | Type | -| :------------- | :---------------------------------------------------------------- | -| `projectGraph` | [`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) | -| `name` | `string` | - -#### Returns - -`Object` - -| Name | Type | -| :------------------- | :-------------------------------------------------------------------------- | -| `npmPackages` | `string`[] | -| `workspaceLibraries` | [`WorkspaceLibrary`](../../devkit/documents/nrwl_devkit#workspacelibrary)[] | - ---- - -### getImportPath - -▸ **getImportPath**(`npmScope`, `projectDirectory`): `string` - -Prefixes project name with npm scope - -#### Parameters - -| Name | Type | -| :----------------- | :------- | -| `npmScope` | `string` | -| `projectDirectory` | `string` | - -#### Returns - -`string` - ---- - -### getNpmPackageSharedConfig - -▸ **getNpmPackageSharedConfig**(`pkgName`, `version`): [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig) \| `undefined` - -Build the Module Federation Share Config for a specific package and the -specified version of that package. - -#### Parameters - -| 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/documents/nrwl_devkit#sharedlibraryconfig) \| `undefined` - ---- - -### getOutputsForTargetAndConfiguration - -▸ **getOutputsForTargetAndConfiguration**(`task`, `node`): `string`[] - -Returns the list of outputs that will be cached. - -#### Parameters - -| Name | Type | Description | -| :----- | :-------------------------------------------------------------------------------------- | :-------------------------------------------------------- | -| `task` | `Pick`<[`Task`](../../devkit/documents/nrwl_devkit#task), `"overrides"` \| `"target"`\> | target + overrides | -| `node` | [`ProjectGraphProjectNode`](../../devkit/documents/nrwl_devkit#projectgraphprojectnode) | ProjectGraphProjectNode object that the task runs against | - -#### Returns - -`string`[] - ---- - -### getPackageManagerCommand - -▸ **getPackageManagerCommand**(`packageManager?`): `PackageManagerCommands` - -Returns commands for the package manager used in the workspace. -By default, the package manager is derived based on the lock file, -but it can also be passed in explicitly. - -Example: - -```javascript -execSync(`${getPackageManagerCommand().addDev} my-dev-package`); -``` - -#### Parameters - -| Name | Type | -| :--------------- | :-------------------------------------------------------------------- | -| `packageManager` | [`PackageManager`](../../devkit/documents/nrwl_devkit#packagemanager) | - -#### Returns - -`PackageManagerCommands` - ---- - -### getPackageManagerVersion - -▸ **getPackageManagerVersion**(`packageManager?`): `string` - -Returns the version of the package manager used in the workspace. -By default, the package manager is derived based on the lock file, -but it can also be passed in explicitly. - -#### Parameters - -| Name | Type | -| :--------------- | :-------------------------------------------------------------------- | -| `packageManager` | [`PackageManager`](../../devkit/documents/nrwl_devkit#packagemanager) | - -#### Returns - -`string` - ---- - -### getProjects - -▸ **getProjects**(`tree`): `Map`<`string`, [`ProjectConfiguration`](../../devkit/documents/nrwl_devkit#projectconfiguration)\> - -Get a map of all projects in a workspace. - -Use [readProjectConfiguration](../../devkit/documents/nrwl_devkit#readprojectconfiguration) if only one project is needed. - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | - -#### Returns - -`Map`<`string`, [`ProjectConfiguration`](../../devkit/documents/nrwl_devkit#projectconfiguration)\> - ---- - -### getWorkspaceLayout - -▸ **getWorkspaceLayout**(`tree`): `Object` - -Returns workspace defaults. It includes defaults folders for apps and libs, -and the default scope. - -Example: - -```typescript -{ appsDir: 'apps', libsDir: 'libs', npmScope: 'myorg' } -``` - -#### Parameters - -| Name | Type | Description | -| :----- | :------------------------------------------------ | :--------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | file system tree | - -#### Returns - -`Object` - -| Name | Type | -| :-------------------- | :-------- | -| `appsDir` | `string` | -| `libsDir` | `string` | -| `npmScope` | `string` | -| `standaloneAsDefault` | `boolean` | - ---- - -### getWorkspacePath - -▸ **getWorkspacePath**(`tree`): `"angular.json"` \| `"workspace.json"` - -**`deprecated`** all projects are configured using project.json - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | - -#### Returns - -`"angular.json"` \| `"workspace.json"` - ---- - -### installPackagesTask - -▸ **installPackagesTask**(`tree`, `alwaysRun?`, `cwd?`, `packageManager?`): `void` - -Runs `npm install` or `yarn install`. It will skip running the install if -`package.json` hasn't changed at all or it hasn't changed since the last invocation. - -#### Parameters - -| Name | Type | Default value | Description | -| :--------------- | :-------------------------------------------------------------------- | :------------ | :------------------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#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/documents/nrwl_devkit#packagemanager) | `undefined` | - | - -#### Returns - -`void` - ---- - -### isStandaloneProject - -▸ **isStandaloneProject**(`tree`, `project`): `boolean` - -Returns if a project has a standalone configuration (project.json). - -**`deprecated`** non-standalone projects were deprecated - -#### Parameters - -| Name | Type | Description | -| :-------- | :------------------------------------------------ | :------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | the file system tree | -| `project` | `string` | the project name | - -#### Returns - -`boolean` - ---- - -### joinPathFragments - -▸ **joinPathFragments**(...`fragments`): `string` - -Normalized path fragments and joins them - -#### Parameters - -| Name | Type | -| :------------- | :--------- | -| `...fragments` | `string`[] | - -#### Returns - -`string` - ---- - -### mapRemotes - -▸ **mapRemotes**(`remotes`, `remoteEntryExt`, `determineRemoteUrl`): `Record`<`string`, `string`\> - -Map remote names to a format that can be understood and used by Module -Federation. - -#### Parameters - -| Name | Type | Description | -| :------------------- | :------------------------------------------------------ | :------------------------------------------------------- | -| `remotes` | [`Remotes`](../../devkit/documents/nrwl_devkit#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 - -▸ **mapRemotesForSSR**(`remotes`, `remoteEntryExt`, `determineRemoteUrl`): `Record`<`string`, `string`\> - -Map remote names to a format that can be understood and used by Module -Federation. - -#### Parameters - -| Name | Type | Description | -| :------------------- | :------------------------------------------------------ | :------------------------------------------------------- | -| `remotes` | [`Remotes`](../../devkit/documents/nrwl_devkit#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 - -▸ **moveFilesToNewDirectory**(`tree`, `oldDir`, `newDir`): `void` - -Analogous to cp -r oldDir newDir - -#### Parameters - -| Name | Type | -| :------- | :------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | -| `oldDir` | `string` | -| `newDir` | `string` | - -#### Returns - -`void` - ---- - -### names - -▸ **names**(`name`): `Object` - -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'} -``` - -#### Parameters - -| Name | Type | -| :----- | :------- | -| `name` | `string` | - -#### Returns - -`Object` - -| Name | Type | -| :------------- | :------- | -| `className` | `string` | -| `constantName` | `string` | -| `fileName` | `string` | -| `name` | `string` | -| `propertyName` | `string` | - ---- - -### normalizePath - -▸ **normalizePath**(`osSpecificPath`): `string` - -Coverts an os specific path to a unix style path - -#### Parameters - -| Name | Type | -| :--------------- | :------- | -| `osSpecificPath` | `string` | - -#### Returns - -`string` - ---- - -### offsetFromRoot - -▸ **offsetFromRoot**(`fullPathToDir`): `string` - -Calculates an offset from the root of the workspace, which is useful for -constructing relative URLs. - -Examples: - -```typescript -offsetFromRoot('apps/mydir/myapp/'); // returns "../../../" -``` - -#### Parameters - -| Name | Type | Description | -| :-------------- | :------- | :------------- | -| `fullPathToDir` | `string` | directory path | - -#### Returns - -`string` - ---- - -### parseJson - -▸ **parseJson**<`T`\>(`input`, `options?`): `T` - -Parses the given JSON string and returns the object the JSON content represents. -By default javascript-style comments and trailing commas are allowed. - -#### Type parameters - -| Name | Type | -| :--- | :----------------------- | -| `T` | extends `object` = `any` | - -#### Parameters - -| Name | Type | Description | -| :--------- | :------------------------------------------------------------------------ | :--------------------- | -| `input` | `string` | JSON content as string | -| `options?` | [`JsonParseOptions`](../../devkit/documents/nrwl_devkit#jsonparseoptions) | JSON parse options | - -#### Returns - -`T` - -Object the JSON content represents - ---- - -### parseTargetString - -▸ **parseTargetString**(`targetString`): [`Target`](../../devkit/documents/nrwl_devkit#target) - -**`deprecated(v17)`** A project graph should be passed to parseTargetString for best accuracy. - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `targetString` | `string` | - -#### Returns - -[`Target`](../../devkit/documents/nrwl_devkit#target) - -▸ **parseTargetString**(`targetString`, `projectGraph`): [`Target`](../../devkit/documents/nrwl_devkit#target) - -Parses a target string into {project, target, configuration} - -Examples: - -```typescript -parseTargetString('proj:test', graph); // returns { project: "proj", target: "test" } -parseTargetString('proj:test:production', graph); // returns { project: "proj", target: "test", configuration: "production" } -``` - -#### Parameters - -| Name | Type | Description | -| :------------- | :---------------------------------------------------------------- | :--------------- | -| `targetString` | `string` | target reference | -| `projectGraph` | [`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) | - | - -#### Returns - -[`Target`](../../devkit/documents/nrwl_devkit#target) - ---- - -### readAllWorkspaceConfiguration - -▸ **readAllWorkspaceConfiguration**(): [`ProjectsConfigurations`](../../devkit/documents/nrwl_devkit#projectsconfigurations) & [`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration) - -TODO(vsavkin): Remove after Nx 16 is out - -**`deprecated`** Use readProjectsConfigurationFromProjectGraph(await createProjectGraphAsync()) - -#### Returns - -[`ProjectsConfigurations`](../../devkit/documents/nrwl_devkit#projectsconfigurations) & [`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration) - ---- - -### readCachedProjectGraph - -▸ **readCachedProjectGraph**(): [`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) - -Synchronously reads the latest cached copy of the workspace's ProjectGraph. - -**`throws`** {Error} if there is no cached ProjectGraph to read from - -#### Returns - -[`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) - ---- - -### readJson - -▸ **readJson**<`T`\>(`tree`, `path`, `options?`): `T` - -Reads a json file, removes all comments and parses JSON. - -#### Type parameters - -| Name | Type | -| :--- | :----------------------- | -| `T` | extends `object` = `any` | - -#### Parameters - -| Name | Type | Description | -| :--------- | :------------------------------------------------------------------------ | :-------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | file system tree | -| `path` | `string` | file path | -| `options?` | [`JsonParseOptions`](../../devkit/documents/nrwl_devkit#jsonparseoptions) | Optional JSON Parse Options | - -#### Returns - -`T` - ---- - -### readJsonFile - -▸ **readJsonFile**<`T`\>(`path`, `options?`): `T` - -Reads a JSON file and returns the object the JSON content represents. - -#### Type parameters - -| Name | Type | -| :--- | :----------------------- | -| `T` | extends `object` = `any` | - -#### Parameters - -| Name | Type | Description | -| :--------- | :---------------- | :----------------- | -| `path` | `string` | A path to a file. | -| `options?` | `JsonReadOptions` | JSON parse options | - -#### Returns - -`T` - -Object the JSON content of the file represents - ---- - -### readNxJson - -▸ **readNxJson**(): [`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration) \| `null` - -Reads nx.json - -**`deprecated`** You must pass a [Tree](../../devkit/documents/nrwl_devkit#tree) - -#### Returns - -[`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration) \| `null` - -▸ **readNxJson**(`tree`): [`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration) \| `null` - -Reads nx.json - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | - -#### Returns - -[`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration) \| `null` - ---- - -### readProjectConfiguration - -▸ **readProjectConfiguration**(`tree`, `projectName`): [`ProjectConfiguration`](../../devkit/documents/nrwl_devkit#projectconfiguration) - -Reads a project configuration. - -**`throws`** If supplied projectName cannot be found - -#### Parameters - -| Name | Type | Description | -| :------------ | :------------------------------------------------ | :---------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | the file system tree | -| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | - -#### Returns - -[`ProjectConfiguration`](../../devkit/documents/nrwl_devkit#projectconfiguration) - ---- - -### readRootPackageJson - -▸ **readRootPackageJson**(): `Object` - -#### Returns - -`Object` - -| Name | Type | -| :----------------- | :------- | -| `dependencies?` | `Object` | -| `devDependencies?` | `Object` | - ---- - -### readTargetOptions - -▸ **readTargetOptions**<`T`\>(`__namedParameters`, `context`): `T` - -Reads and combines options for a given target. - -Works as if you invoked the target yourself without passing any command lint overrides. - -#### Type parameters - -| Name | Type | -| :--- | :---- | -| `T` | `any` | - -#### Parameters - -| Name | Type | -| :------------------ | :---------------------------------------------------------------------- | -| `__namedParameters` | [`Target`](../../devkit/documents/nrwl_devkit#target) | -| `context` | [`ExecutorContext`](../../devkit/documents/nrwl_devkit#executorcontext) | - -#### Returns - -`T` - ---- - -### readWorkspaceConfiguration - -▸ **readWorkspaceConfiguration**(`tree`): [`WorkspaceConfiguration`](../../devkit/documents/nrwl_devkit#workspaceconfiguration) - -Read general workspace configuration such as the default project or cli settings - -This does _not_ provide projects configuration, use [readProjectConfiguration](../../devkit/documents/nrwl_devkit#readprojectconfiguration) instead. - -**`deprecated`** use readNxJson - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | - -#### Returns - -[`WorkspaceConfiguration`](../../devkit/documents/nrwl_devkit#workspaceconfiguration) - ---- - -### removeDependenciesFromPackageJson - -▸ **removeDependenciesFromPackageJson**(`tree`, `dependencies`, `devDependencies`, `packageJsonPath?`): [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) - -Remove Dependencies and Dev Dependencies from package.json - -For example: - -```typescript -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/documents/nrwl_devkit#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 - -[`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) - -Callback to uninstall dependencies only if necessary. undefined is returned if changes are not necessary. - ---- - -### removeProjectConfiguration - -▸ **removeProjectConfiguration**(`tree`, `projectName`): `void` - -Removes the configuration of an existing project. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------------------------------------------------ | :---------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | the file system tree | -| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | - -#### Returns - -`void` - ---- - -### reverse - -▸ **reverse**(`graph`): [`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) - -Returns a new project graph where all the edges are reversed. - -For instance, if project A depends on B, in the reversed graph -B will depend on A. - -#### Parameters - -| Name | Type | -| :------ | :---------------------------------------------------------------- | -| `graph` | [`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) | - -#### Returns - -[`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) - ---- - -### runExecutor - -▸ **runExecutor**<`T`\>(`targetDescription`, `overrides`, `context`): `Promise`<`AsyncIterableIterator`<`T`\>\> - -Loads and invokes executor. - -This is analogous to invoking executor from the terminal, with the exception -that the params aren't parsed from the string, but instead provided parsed already. - -Apart from that, it works the same way: - -- it will load the workspace configuration -- it will resolve the target -- it will load the executor and the schema -- it will load the options for the appropriate configuration -- it will run the validations and will set the default -- and, of course, it will invoke the executor - -Example: - -```typescript -for await (const s of await runExecutor( - { project: 'myproj', target: 'serve' }, - { watch: true }, - context -)) { - // s.success -} -``` - -Note that the return value is a promise of an iterator, so you need to await before iterating over it. - -#### Type parameters - -| Name | Type | -| :--- | :--------------- | -| `T` | extends `Object` | - -#### Parameters - -| Name | Type | -| :--------------------------------- | :---------------------------------------------------------------------- | -| `targetDescription` | `Object` | -| `targetDescription.configuration?` | `string` | -| `targetDescription.project` | `string` | -| `targetDescription.target` | `string` | -| `overrides` | `Object` | -| `context` | [`ExecutorContext`](../../devkit/documents/nrwl_devkit#executorcontext) | - -#### Returns - -`Promise`<`AsyncIterableIterator`<`T`\>\> - ---- - -### serializeJson - -▸ **serializeJson**<`T`\>(`input`, `options?`): `string` - -Serializes the given data to a JSON string. -By default the JSON string is formatted with a 2 space indentation to be easy readable. - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------- | -| `T` | extends `object` = `object` | - -#### Parameters - -| Name | Type | Description | -| :--------- | :-------------------------------------------------------------------------------- | :---------------------------------------- | -| `input` | `T` | Object which should be serialized to JSON | -| `options?` | [`JsonSerializeOptions`](../../devkit/documents/nrwl_devkit#jsonserializeoptions) | JSON serialize options | - -#### Returns - -`string` - -the formatted JSON representation of the object - ---- - -### sharePackages - -▸ **sharePackages**(`packages`): `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig)\> - -Create a dictionary of packages and their Module Federation Shared Config -from an array of package names. - -Lookup the versions of the packages from the root package.json file in the -workspace. - -#### Parameters - -| Name | Type | Description | -| :--------- | :--------- | :-------------------------------- | -| `packages` | `string`[] | Array of package names as strings | - -#### Returns - -`Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig)\> - ---- - -### shareWorkspaceLibraries - -▸ **shareWorkspaceLibraries**(`libraries`, `tsConfigPath?`): [`SharedWorkspaceLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedworkspacelibraryconfig) - -Build an object of functions to be used with the ModuleFederationPlugin to -share Nx Workspace Libraries between Hosts and Remotes. - -#### Parameters - -| Name | Type | Description | -| :------------- | :-------------------------------------------------------------------------- | :--------------------------------------------------------------------------- | -| `libraries` | [`WorkspaceLibrary`](../../devkit/documents/nrwl_devkit#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/documents/nrwl_devkit#sharedworkspacelibraryconfig) - ---- - -### stripIndents - -▸ **stripIndents**(`strings`, ...`values`): `string` - -Removes indents, which is useful for printing warning and messages. - -Example: - -```typescript -stripIndents` - Options: - - option1 - - option2 -`; -``` - -#### Parameters - -| Name | Type | -| :---------- | :--------------------- | -| `strings` | `TemplateStringsArray` | -| `...values` | `any`[] | - -#### Returns - -`string` - ---- - -### stripJsonComments - -▸ `Const` **stripJsonComments**(`text`, `replaceCh?`): `string` - -Takes JSON with JavaScript-style comments and remove -them. Optionally replaces every none-newline character -of comments with a replaceCharacter - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `text` | `string` | -| `replaceCh?` | `string` | - -#### Returns - -`string` - ---- - -### targetToTargetString - -▸ **targetToTargetString**(`target`): `string` - -Returns a string in the format "project:target[:configuration]" for the target - -#### Parameters - -| Name | Type | Description | -| :------- | :---------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `target` | [`Target`](../../devkit/documents/nrwl_devkit#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 - -▸ **toJS**(`tree`): `void` - -Rename and transpile any new typescript files created to javascript files - -#### Parameters - -| Name | Type | -| :----- | :------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | - -#### Returns - -`void` - ---- - -### updateJson - -▸ **updateJson**<`T`, `U`\>(`tree`, `path`, `updater`, `options?`): `void` - -Updates a JSON value to the file system tree - -#### Type parameters - -| Name | Type | -| :--- | :----------------------- | -| `T` | extends `object` = `any` | -| `U` | extends `object` = `T` | - -#### Parameters - -| Name | Type | Description | -| :--------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------ | :--------------------------------------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#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/documents/nrwl_devkit#jsonparseoptions) & [`JsonSerializeOptions`](../../devkit/documents/nrwl_devkit#jsonserializeoptions) | Optional JSON Parse and Serialize Options | - -#### Returns - -`void` - ---- - -### updateNxJson - -▸ **updateNxJson**(`tree`, `nxJson`): `void` - -Update nx.json - -#### Parameters - -| Name | Type | -| :------- | :---------------------------------------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | -| `nxJson` | [`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration)<`string`[] \| `"*"`\> | - -#### Returns - -`void` - ---- - -### updateProjectConfiguration - -▸ **updateProjectConfiguration**(`tree`, `projectName`, `projectConfiguration`): `void` - -Updates the configuration of an existing project. - -#### Parameters - -| Name | Type | Description | -| :--------------------- | :-------------------------------------------------------------------------------- | :---------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | the file system tree | -| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | -| `projectConfiguration` | [`ProjectConfiguration`](../../devkit/documents/nrwl_devkit#projectconfiguration) | project configuration | - -#### Returns - -`void` - ---- - -### updateTsConfigsToJs - -▸ **updateTsConfigsToJs**(`tree`, `options`): `void` - -#### Parameters - -| Name | Type | -| :-------------------- | :------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | -| `options` | `Object` | -| `options.projectRoot` | `string` | - -#### Returns - -`void` - ---- - -### updateWorkspaceConfiguration - -▸ **updateWorkspaceConfiguration**(`tree`, `workspaceConfig`): `void` - -Update general workspace configuration such as the default project or cli settings. - -This does _not_ update projects configuration, use [updateProjectConfiguration](../../devkit/documents/nrwl_devkit#updateprojectconfiguration) or [addProjectConfiguration](../../devkit/documents/nrwl_devkit#addprojectconfiguration) instead. - -**`deprecated`** use updateNxJson - -#### Parameters - -| Name | Type | -| :---------------- | :------------------------------------------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | -| `workspaceConfig` | [`WorkspaceConfiguration`](../../devkit/documents/nrwl_devkit#workspaceconfiguration) | - -#### Returns - -`void` - ---- - -### visitNotIgnoredFiles - -▸ **visitNotIgnoredFiles**(`tree`, `dirPath?`, `visitor`): `void` - -Utility to act on all files in a tree that are not ignored by git. - -#### Parameters - -| Name | Type | Default value | -| :-------- | :------------------------------------------------ | :------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | `undefined` | -| `dirPath` | `string` | `tree.root` | -| `visitor` | (`path`: `string`) => `void` | `undefined` | - -#### Returns - -`void` - ---- - -### workspaceLayout - -▸ **workspaceLayout**(): `Object` - -Returns information about where apps and libs will be created. - -#### Returns - -`Object` - -| Name | Type | -| :-------- | :------- | -| `appsDir` | `string` | -| `libsDir` | `string` | - ---- - -### writeJson - -▸ **writeJson**<`T`\>(`tree`, `path`, `value`, `options?`): `void` - -Writes a JSON value to the file system tree - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------- | -| `T` | extends `object` = `object` | - -#### Parameters - -| Name | Type | Description | -| :--------- | :-------------------------------------------------------------------------------- | :------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | File system tree | -| `path` | `string` | Path of JSON file in the Tree | -| `value` | `T` | Serializable value to write | -| `options?` | [`JsonSerializeOptions`](../../devkit/documents/nrwl_devkit#jsonserializeoptions) | Optional JSON Serialize Options | - -#### Returns - -`void` - ---- - -### writeJsonFile - -▸ **writeJsonFile**<`T`\>(`path`, `data`, `options?`): `void` - -Serializes the given data to JSON and writes it to a file. - -#### Type parameters - -| 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 | - -#### Returns - -`void` diff --git a/docs/generated/packages/storybook/generators/change-storybook-targets.json b/docs/generated/packages/storybook/generators/change-storybook-targets.json deleted file mode 100644 index bd5069c9a6..0000000000 --- a/docs/generated/packages/storybook/generators/change-storybook-targets.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "change-storybook-targets", - "factory": "./src/generators/change-storybook-targets/change-storybook-targets", - "schema": { - "$schema": "http://json-schema.org/schema", - "cli": "nx", - "$id": "change-storybook-targets", - "title": "Change Storybook targets", - "description": "Change the Storybook target executors of Angular projects to use the native Storybook for Angular executor schema.", - "type": "object", - "properties": {}, - "required": [], - "examplesFile": "---\ntitle: Change Storybook targets generator examples\ndescription: This page contains examples for the @nrwl/storybook:change-storybook-targets generator, targeted to Angular projects set up with Storybook.\n---\n\nThis generator will change the `storybook` and `build-storybook` targets in all your Angular projects that are configured to use Storybook. The new target configuration will use the native Storybook builders (`@storybook/angular:build-storybook` and `@storybook/angular:start-storybook`) instead of the Nx Storybook builders (`@nrwl/storybook:build-storybook` and `@nrwl/storybook:storybook`).\n\nThis generator is usually invoked through a migrator, when you are using `nx migrate` to upgrade your workspace to Nx `14.1.8` or later.\n\nIf you are on Nx `14.1.8` or later and you did not use `nx migrate`, you can run this generator manually by running the following command:\n\n```bash\nnx g @nrwl/storybook:change-storybook-targets\n```\n\nYou can read more about how this generator works, and why we are changing the Storybook targets, in the [Angular Storybook targets documentation page](/packages/storybook/documents/angular-storybook-targets).\n", - "presets": [] - }, - "description": "Change storybook targets for Angular projects to use @storybook/angular executors", - "hidden": false, - "implementation": "/packages/storybook/src/generators/change-storybook-targets/change-storybook-targets.ts", - "aliases": [], - "path": "/packages/storybook/src/generators/change-storybook-targets/schema.json", - "type": "generator" -} diff --git a/docs/generated/packages/webpack/documents/customize-webpack.md b/docs/generated/packages/webpack/documents/customize-webpack.md deleted file mode 100644 index 189dca8718..0000000000 --- a/docs/generated/packages/webpack/documents/customize-webpack.md +++ /dev/null @@ -1,113 +0,0 @@ -# Customize your Webpack Config - -{% callout type="note" title="Webpack Config Setup" %} -This guide helps you customize your webpack config - add extra functionality and support for other frameworks or features. To see how you can set up a basic webpack config for Nx, read the [Nx Webpack configuration guide](/packages/webpack/documents/webpack-config-setup). -{% /callout %} - -For most apps, the default configuration of webpack is sufficient, but sometimes you need to tweak a setting in your webpack config. This guide explains how to make a small change without taking on the maintenance burden of the entire webpack config. - -## React projects - -React projects use the `@nrwl/react` package to build their apps. This package provides a `withReact` plugin that adds the necessary configuration for React to work with webpack. You can use this plugin to add the necessary configuration to your webpack config. - -```js {% fileName="apps/my-app/webpack.config.js" %} -const { composePlugins, withNx } = require('@nrwl/webpack'); -const { withReact } = require('@nrwl/react'); - -// Nx plugins for webpack. -module.exports = composePlugins( - withNx(), - withReact(), - (config, { options, context }) => { - // Update the webpack config as needed here. - // e.g. config.plugins.push(new MyPlugin()) - return config; - } -); -``` - -## Add a Loader - -To add the `css-loader` to your config, install it and add the rule. - -{% tabs %} -{% tab label="yarn" %} - -```shell -yarn add -D css-loader -``` - -{% /tab %} -{% tab label="npm" %} - -```shell -npm install -D css-loader -``` - -{% /tab %} -{% /tabs %} - -```js {% fileName="apps/my-app/webpack.config.js" %} -const { composePlugins, withNx } = require('@nrwl/webpack'); -const { merge } = require('webpack-merge'); - -module.exports = composePlugins(withNx(), (config, { options, context }) => { - return merge(config, { - module: { - rules: [ - { - test: /\.css$/i, - use: ['style-loader', 'css-loader'], - }, - ], - }, - }); -}); -``` - -## Module Federation - -If you use the [Module Federation](/recipes/module-federation/faster-builds) support from `@nrwl/angular` or `@nrwl/react` then -you can customize your webpack configuration as follows. - -```js {% fileName="apps/my-app/webpack.config.js" %} -const { composePlugins, withNx } = require('@nrwl/webpack'); -const { merge } = require('webpack-merge'); -const withModuleFederation = require('@nrwl/react/module-federation'); -// or `const withModuleFederation = require('@nrwl/angular/module-federation');` - -module.exports = composePlugins(withNx(), (config, { options, context }) => { - const federatedModules = await withModuleFederation({ - // your options here - }); - - return merge(federatedModules(config, context), { - // overwrite values here - }); -}); -``` - -Reference the [webpack documentation](https://webpack.js.org/configuration/) for details on the structure of the webpack -config object. - -## Next.js Applications - -Next.js supports webpack customization in the `next.config.js` file. - -```js {% fileName="next.config.js" %} -const { withNx } = require('@nrwl/next/plugins/with-nx'); - -const nextConfig = { - webpack: ( - config, - { buildId, dev, isServer, defaultLoaders, nextRuntime, webpack } - ) => { - // Important: return the modified config - return config; - }, -}; - -return withNx(nextConfig); -``` - -Read the [official documentation](https://nextjs.org/docs/api-reference/next.config.js/custom-webpack-config) for more details. diff --git a/docs/generated/packages/workspace/generators/convert-to-nx-project.json b/docs/generated/packages/workspace/generators/convert-to-nx-project.json deleted file mode 100644 index f01cce8fea..0000000000 --- a/docs/generated/packages/workspace/generators/convert-to-nx-project.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "convert-to-nx-project", - "factory": "./src/generators/convert-to-nx-project/convert-to-nx-project#convertToNxProjectGenerator", - "schema": { - "$schema": "http://json-schema.org/schema", - "$id": "SchematicsConvertToNxProject", - "title": "Create a custom target to run any command", - "description": "Create a custom target to run any command.", - "type": "object", - "cli": "nx", - "examples": [ - { - "command": "nx g @nrwl/workspace:convert-to-nx-project --project my-feature-lib", - "description": "Convert the `my-feature-lib` project to use `project.json` file instead of `workspace.json`" - }, - { - "command": "nx g @nrwl/workspace:convert-to-nx-project --all", - "description": "Convert all projects in `workspace.json` to separate `project.json` files" - } - ], - "properties": { - "project": { "description": "Project name", "type": "string" }, - "all": { - "description": "Should every project be converted?", - "type": "boolean" - }, - "skipFormat": { - "description": "Skip formatting files", - "type": "boolean", - "default": false, - "x-priority": "internal" - } - }, - "presets": [] - }, - "description": "Moves a project's configuration outside of `workspace.json`.", - "implementation": "/packages/workspace/src/generators/convert-to-nx-project/convert-to-nx-project#convertToNxProjectGenerator.ts", - "aliases": [], - "hidden": false, - "path": "/packages/workspace/src/generators/convert-to-nx-project/schema.json", - "type": "generator" -}