diff --git a/docs/generated/devkit/AdditionalSharedConfig.md b/docs/generated/devkit/AdditionalSharedConfig.md new file mode 100644 index 0000000000000..1667118dd409e --- /dev/null +++ b/docs/generated/devkit/AdditionalSharedConfig.md @@ -0,0 +1,3 @@ +# Type alias: AdditionalSharedConfig + +Ƭ **AdditionalSharedConfig**: (`string` \| [libraryName: string, sharedConfig: SharedLibraryConfig] \| { `libraryName`: `string` ; `sharedConfig`: [`SharedLibraryConfig`](../../devkit/documents/SharedLibraryConfig) })[] diff --git a/docs/generated/devkit/ChangeType.md b/docs/generated/devkit/ChangeType.md new file mode 100644 index 0000000000000..012fdac00fbed --- /dev/null +++ b/docs/generated/devkit/ChangeType.md @@ -0,0 +1,20 @@ +# Enumeration: ChangeType + +## Table of contents + +### Enumeration Members + +- [Delete](../../devkit/documents/ChangeType#delete) +- [Insert](../../devkit/documents/ChangeType#insert) + +## Enumeration Members + +### Delete + +• **Delete** = `"Delete"` + +--- + +### Insert + +• **Insert** = `"Insert"` diff --git a/docs/generated/devkit/CustomHasher.md b/docs/generated/devkit/CustomHasher.md new file mode 100644 index 0000000000000..42916f95d9025 --- /dev/null +++ b/docs/generated/devkit/CustomHasher.md @@ -0,0 +1,18 @@ +# Type alias: CustomHasher + +Ƭ **CustomHasher**: (`task`: [`Task`](../../devkit/documents/Task), `context`: [`HasherContext`](../../devkit/documents/HasherContext)) => `Promise`<[`Hash`](../../devkit/documents/Hash)\> + +#### Type declaration + +▸ (`task`, `context`): `Promise`<[`Hash`](../../devkit/documents/Hash)\> + +##### Parameters + +| Name | Type | +| :-------- | :------------------------------------------------------ | +| `task` | [`Task`](../../devkit/documents/Task) | +| `context` | [`HasherContext`](../../devkit/documents/HasherContext) | + +##### Returns + +`Promise`<[`Hash`](../../devkit/documents/Hash)\> diff --git a/docs/generated/devkit/DefaultTasksRunnerOptions.md b/docs/generated/devkit/DefaultTasksRunnerOptions.md new file mode 100644 index 0000000000000..6e9582519f48b --- /dev/null +++ b/docs/generated/devkit/DefaultTasksRunnerOptions.md @@ -0,0 +1,69 @@ +# Interface: DefaultTasksRunnerOptions + +## Table of contents + +### Properties + +- [cacheDirectory](../../devkit/documents/DefaultTasksRunnerOptions#cachedirectory) +- [cacheableOperations](../../devkit/documents/DefaultTasksRunnerOptions#cacheableoperations) +- [cacheableTargets](../../devkit/documents/DefaultTasksRunnerOptions#cacheabletargets) +- [captureStderr](../../devkit/documents/DefaultTasksRunnerOptions#capturestderr) +- [lifeCycle](../../devkit/documents/DefaultTasksRunnerOptions#lifecycle) +- [parallel](../../devkit/documents/DefaultTasksRunnerOptions#parallel) +- [remoteCache](../../devkit/documents/DefaultTasksRunnerOptions#remotecache) +- [runtimeCacheInputs](../../devkit/documents/DefaultTasksRunnerOptions#runtimecacheinputs) +- [skipNxCache](../../devkit/documents/DefaultTasksRunnerOptions#skipnxcache) + +## Properties + +### cacheDirectory + +• `Optional` **cacheDirectory**: `string` + +--- + +### cacheableOperations + +• `Optional` **cacheableOperations**: `string`[] + +--- + +### cacheableTargets + +• `Optional` **cacheableTargets**: `string`[] + +--- + +### captureStderr + +• `Optional` **captureStderr**: `boolean` + +--- + +### lifeCycle + +• **lifeCycle**: `LifeCycle` + +--- + +### parallel + +• `Optional` **parallel**: `number` + +--- + +### remoteCache + +• `Optional` **remoteCache**: [`RemoteCache`](../../devkit/documents/RemoteCache) + +--- + +### runtimeCacheInputs + +• `Optional` **runtimeCacheInputs**: `string`[] + +--- + +### skipNxCache + +• `Optional` **skipNxCache**: `boolean` diff --git a/docs/generated/devkit/DependencyType.md b/docs/generated/devkit/DependencyType.md new file mode 100644 index 0000000000000..fda9b29d08abb --- /dev/null +++ b/docs/generated/devkit/DependencyType.md @@ -0,0 +1,35 @@ +# Enumeration: DependencyType + +Type of dependency between projects + +## Table of contents + +### Enumeration Members + +- [dynamic](../../devkit/documents/DependencyType#dynamic) +- [implicit](../../devkit/documents/DependencyType#implicit) +- [static](../../devkit/documents/DependencyType#static) + +## Enumeration Members + +### dynamic + +• **dynamic** = `"dynamic"` + +Dynamic dependencies are brought in by the module at run time + +--- + +### implicit + +• **implicit** = `"implicit"` + +Implicit dependencies are inferred + +--- + +### static + +• **static** = `"static"` + +Static dependencies are tied to the loading of the module diff --git a/docs/generated/devkit/Executor.md b/docs/generated/devkit/Executor.md new file mode 100644 index 0000000000000..62a5e0f45120a --- /dev/null +++ b/docs/generated/devkit/Executor.md @@ -0,0 +1,26 @@ +# Type alias: Executor + +Ƭ **Executor**<`T`\>: (`options`: `T`, `context`: [`ExecutorContext`](../../devkit/documents/ExecutorContext)) => `Promise`<{ `success`: `boolean` }\> \| `AsyncIterableIterator`<{ `success`: `boolean` }\> + +#### Type parameters + +| Name | Type | +| :--- | :---- | +| `T` | `any` | + +#### Type declaration + +▸ (`options`, `context`): `Promise`<{ `success`: `boolean` }\> \| `AsyncIterableIterator`<{ `success`: `boolean` }\> + +Implementation of a target of a project + +##### Parameters + +| Name | Type | +| :-------- | :---------------------------------------------------------- | +| `options` | `T` | +| `context` | [`ExecutorContext`](../../devkit/documents/ExecutorContext) | + +##### Returns + +`Promise`<{ `success`: `boolean` }\> \| `AsyncIterableIterator`<{ `success`: `boolean` }\> diff --git a/docs/generated/devkit/ExecutorContext.md b/docs/generated/devkit/ExecutorContext.md new file mode 100644 index 0000000000000..2886fe4e4d983 --- /dev/null +++ b/docs/generated/devkit/ExecutorContext.md @@ -0,0 +1,126 @@ +# Interface: ExecutorContext + +Context that is passed into an executor + +## Table of contents + +### Properties + +- [configurationName](../../devkit/documents/ExecutorContext#configurationname) +- [cwd](../../devkit/documents/ExecutorContext#cwd) +- [isVerbose](../../devkit/documents/ExecutorContext#isverbose) +- [nxJsonConfiguration](../../devkit/documents/ExecutorContext#nxjsonconfiguration) +- [projectGraph](../../devkit/documents/ExecutorContext#projectgraph) +- [projectName](../../devkit/documents/ExecutorContext#projectname) +- [projectsConfigurations](../../devkit/documents/ExecutorContext#projectsconfigurations) +- [root](../../devkit/documents/ExecutorContext#root) +- [target](../../devkit/documents/ExecutorContext#target) +- [targetName](../../devkit/documents/ExecutorContext#targetname) +- [taskGraph](../../devkit/documents/ExecutorContext#taskgraph) +- [workspace](../../devkit/documents/ExecutorContext#workspace) + +## Properties + +### configurationName + +• `Optional` **configurationName**: `string` + +The name of the configuration being executed + +--- + +### cwd + +• **cwd**: `string` + +The current working directory + +--- + +### isVerbose + +• **isVerbose**: `boolean` + +Enable verbose logging + +--- + +### nxJsonConfiguration + +• `Optional` **nxJsonConfiguration**: [`NxJsonConfiguration`](../../devkit/documents/NxJsonConfiguration)<`string`[] \| `"*"`\> + +The contents of nx.json. + +@todo(vsavkin): mark this as required for v17 + +--- + +### projectGraph + +• `Optional` **projectGraph**: [`ProjectGraph`](../../devkit/documents/ProjectGraph) + +A snapshot of the project graph as +it existed when the Nx command was kicked off + +@todo(vsavkin) mark this required for v17 + +--- + +### projectName + +• `Optional` **projectName**: `string` + +The name of the project being executed on + +--- + +### projectsConfigurations + +• `Optional` **projectsConfigurations**: [`ProjectsConfigurations`](../../devkit/documents/ProjectsConfigurations) + +Projects config + +@todo(vsavkin): mark this as required for v17 + +--- + +### root + +• **root**: `string` + +The root of the workspace + +--- + +### target + +• `Optional` **target**: [`TargetConfiguration`](../../devkit/documents/TargetConfiguration)<`any`\> + +The configuration of the target being executed + +--- + +### targetName + +• `Optional` **targetName**: `string` + +The name of the target being executed + +--- + +### taskGraph + +• `Optional` **taskGraph**: [`TaskGraph`](../../devkit/documents/TaskGraph) + +A snapshot of the task graph as +it existed when the Nx command was kicked off + +--- + +### workspace + +• `Optional` **workspace**: [`ProjectsConfigurations`](../../devkit/documents/ProjectsConfigurations) & [`NxJsonConfiguration`](../../devkit/documents/NxJsonConfiguration)<`string`[] \| `"*"`\> + +Deprecated. Use projectsConfigurations or nxJsonConfiguration +The full workspace configuration +@todo(vsavkin): remove after v17 diff --git a/docs/generated/devkit/ExecutorsJson.md b/docs/generated/devkit/ExecutorsJson.md new file mode 100644 index 0000000000000..cb28bb11943cd --- /dev/null +++ b/docs/generated/devkit/ExecutorsJson.md @@ -0,0 +1,20 @@ +# Interface: ExecutorsJson + +## Table of contents + +### Properties + +- [builders](../../devkit/documents/ExecutorsJson#builders) +- [executors](../../devkit/documents/ExecutorsJson#executors) + +## Properties + +### builders + +• `Optional` **builders**: `Record`<`string`, `ExecutorsJsonEntry`\> + +--- + +### executors + +• `Optional` **executors**: `Record`<`string`, `ExecutorsJsonEntry`\> diff --git a/docs/generated/devkit/FileChange.md b/docs/generated/devkit/FileChange.md new file mode 100644 index 0000000000000..e5524b7cfbfa9 --- /dev/null +++ b/docs/generated/devkit/FileChange.md @@ -0,0 +1,44 @@ +# Interface: FileChange + +Description of a file change in the Nx virtual file system/ + +## Table of contents + +### Properties + +- [content](../../devkit/documents/FileChange#content) +- [options](../../devkit/documents/FileChange#options) +- [path](../../devkit/documents/FileChange#path) +- [type](../../devkit/documents/FileChange#type) + +## Properties + +### content + +• **content**: `Buffer` + +The content of the file or null in case of delete. + +--- + +### options + +• `Optional` **options**: `TreeWriteOptions` + +Options to set on the file being created or updated. + +--- + +### path + +• **path**: `string` + +Path relative to the workspace root + +--- + +### type + +• **type**: `"CREATE"` \| `"DELETE"` \| `"UPDATE"` + +Type of change: 'CREATE' | 'DELETE' | 'UPDATE' diff --git a/docs/generated/devkit/FileData.md b/docs/generated/devkit/FileData.md new file mode 100644 index 0000000000000..93816cb0bdb6b --- /dev/null +++ b/docs/generated/devkit/FileData.md @@ -0,0 +1,29 @@ +# Interface: FileData + +Some metadata about a file + +## Table of contents + +### Properties + +- [deps](../../devkit/documents/FileData#deps) +- [file](../../devkit/documents/FileData#file) +- [hash](../../devkit/documents/FileData#hash) + +## Properties + +### deps + +• `Optional` **deps**: (`string` \| [`string`, `string`])[] + +--- + +### file + +• **file**: `string` + +--- + +### hash + +• **hash**: `string` diff --git a/docs/generated/devkit/Generator.md b/docs/generated/devkit/Generator.md new file mode 100644 index 0000000000000..5eac6a0fad581 --- /dev/null +++ b/docs/generated/devkit/Generator.md @@ -0,0 +1,26 @@ +# Type alias: Generator + +Ƭ **Generator**<`T`\>: (`tree`: `any`, `schema`: `T`) => `void` \| [`GeneratorCallback`](../../devkit/documents/GeneratorCallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/documents/GeneratorCallback)\> + +#### Type parameters + +| Name | Type | +| :--- | :-------- | +| `T` | `unknown` | + +#### Type declaration + +▸ (`tree`, `schema`): `void` \| [`GeneratorCallback`](../../devkit/documents/GeneratorCallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/documents/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/GeneratorCallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/documents/GeneratorCallback)\> diff --git a/docs/generated/devkit/GeneratorCallback.md b/docs/generated/devkit/GeneratorCallback.md new file mode 100644 index 0000000000000..077280ebe409d --- /dev/null +++ b/docs/generated/devkit/GeneratorCallback.md @@ -0,0 +1,13 @@ +# Type alias: 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`\> diff --git a/docs/generated/devkit/GeneratorsJson.md b/docs/generated/devkit/GeneratorsJson.md new file mode 100644 index 0000000000000..7378aff5dd33f --- /dev/null +++ b/docs/generated/devkit/GeneratorsJson.md @@ -0,0 +1,27 @@ +# Interface: GeneratorsJson + +## Table of contents + +### Properties + +- [extends](../../devkit/documents/GeneratorsJson#extends) +- [generators](../../devkit/documents/GeneratorsJson#generators) +- [schematics](../../devkit/documents/GeneratorsJson#schematics) + +## Properties + +### extends + +• `Optional` **extends**: `string` + +--- + +### generators + +• `Optional` **generators**: `Record`<`string`, `GeneratorsJsonEntry`\> + +--- + +### schematics + +• `Optional` **schematics**: `Record`<`string`, `GeneratorsJsonEntry`\> diff --git a/docs/generated/devkit/Hash.md b/docs/generated/devkit/Hash.md new file mode 100644 index 0000000000000..4a8898314ba18 --- /dev/null +++ b/docs/generated/devkit/Hash.md @@ -0,0 +1,31 @@ +# Interface: Hash + +A data structure returned by the default hasher. + +## Table of contents + +### Properties + +- [details](../../devkit/documents/Hash#details) +- [value](../../devkit/documents/Hash#value) + +## Properties + +### details + +• **details**: `Object` + +#### Type declaration + +| Name | Type | +| :-------------- | :---------------------------------- | +| `command` | `string` | +| `implicitDeps?` | { `[fileName: string]`: `string`; } | +| `nodes` | { `[name: string]`: `string`; } | +| `runtime?` | { `[input: string]`: `string`; } | + +--- + +### value + +• **value**: `string` diff --git a/docs/generated/devkit/Hasher.md b/docs/generated/devkit/Hasher.md new file mode 100644 index 0000000000000..b0db1d3a13207 --- /dev/null +++ b/docs/generated/devkit/Hasher.md @@ -0,0 +1,3 @@ +# Type alias: Hasher + +Ƭ **Hasher**: [`TaskHasher`](../../devkit/documents/TaskHasher) diff --git a/docs/generated/devkit/HasherContext.md b/docs/generated/devkit/HasherContext.md new file mode 100644 index 0000000000000..ba0624101af92 --- /dev/null +++ b/docs/generated/devkit/HasherContext.md @@ -0,0 +1,41 @@ +# Interface: HasherContext + +## Table of contents + +### Properties + +- [hasher](../../devkit/documents/HasherContext#hasher) +- [nxJsonConfiguration](../../devkit/documents/HasherContext#nxjsonconfiguration) +- [projectGraph](../../devkit/documents/HasherContext#projectgraph) +- [projectsConfigurations](../../devkit/documents/HasherContext#projectsconfigurations) +- [taskGraph](../../devkit/documents/HasherContext#taskgraph) + +## Properties + +### hasher + +• **hasher**: [`TaskHasher`](../../devkit/documents/TaskHasher) + +--- + +### nxJsonConfiguration + +• **nxJsonConfiguration**: [`NxJsonConfiguration`](../../devkit/documents/NxJsonConfiguration)<`string`[] \| `"*"`\> + +--- + +### projectGraph + +• **projectGraph**: [`ProjectGraph`](../../devkit/documents/ProjectGraph) + +--- + +### projectsConfigurations + +• **projectsConfigurations**: [`ProjectsConfigurations`](../../devkit/documents/ProjectsConfigurations) + +--- + +### taskGraph + +• **taskGraph**: [`TaskGraph`](../../devkit/documents/TaskGraph) diff --git a/docs/generated/devkit/ImplicitDependencyEntry.md b/docs/generated/devkit/ImplicitDependencyEntry.md new file mode 100644 index 0000000000000..face75275d0ab --- /dev/null +++ b/docs/generated/devkit/ImplicitDependencyEntry.md @@ -0,0 +1,13 @@ +# Type alias: ImplicitDependencyEntry + +Ƭ **ImplicitDependencyEntry**<`T`\>: `Object` + +#### Type parameters + +| Name | Type | +| :--- | :------------------ | +| `T` | `"*"` \| `string`[] | + +#### Index signature + +▪ [key: `string`]: `T` \| [`ImplicitJsonSubsetDependency`](../../devkit/documents/ImplicitJsonSubsetDependency)<`T`\> diff --git a/docs/generated/devkit/ImplicitJsonSubsetDependency.md b/docs/generated/devkit/ImplicitJsonSubsetDependency.md new file mode 100644 index 0000000000000..e461371ad2ba0 --- /dev/null +++ b/docs/generated/devkit/ImplicitJsonSubsetDependency.md @@ -0,0 +1,11 @@ +# Interface: ImplicitJsonSubsetDependency + +## Type parameters + +| Name | Type | +| :--- | :------------------ | +| `T` | `"*"` \| `string`[] | + +## Indexable + +▪ [key: `string`]: `T` \| [`ImplicitJsonSubsetDependency`](../../devkit/documents/ImplicitJsonSubsetDependency)<`T`\> diff --git a/docs/generated/devkit/JsonParseOptions.md b/docs/generated/devkit/JsonParseOptions.md new file mode 100644 index 0000000000000..72bee2474b070 --- /dev/null +++ b/docs/generated/devkit/JsonParseOptions.md @@ -0,0 +1,70 @@ +# Interface: JsonParseOptions + +## Hierarchy + +- `ParseOptions` + + ↳ **`JsonParseOptions`** + +## Table of contents + +### Properties + +- [allowEmptyContent](../../devkit/documents/JsonParseOptions#allowemptycontent) +- [allowTrailingComma](../../devkit/documents/JsonParseOptions#allowtrailingcomma) +- [disallowComments](../../devkit/documents/JsonParseOptions#disallowcomments) +- [expectComments](../../devkit/documents/JsonParseOptions#expectcomments) + +## Properties + +### allowEmptyContent + +• `Optional` **allowEmptyContent**: `boolean` + +#### Inherited from + +ParseOptions.allowEmptyContent + +--- + +### allowTrailingComma + +• `Optional` **allowTrailingComma**: `boolean` + +Allow trailing commas in the JSON content + +#### Overrides + +ParseOptions.allowTrailingComma + +--- + +### disallowComments + +• `Optional` **disallowComments**: `boolean` + +Disallow javascript-style + +**`Default`** + +```ts +false; +``` + +#### Overrides + +ParseOptions.disallowComments + +--- + +### expectComments + +• `Optional` **expectComments**: `boolean` + +Expect JSON with javascript-style + +**`Default`** + +```ts +false; +``` diff --git a/docs/generated/devkit/JsonSerializeOptions.md b/docs/generated/devkit/JsonSerializeOptions.md new file mode 100644 index 0000000000000..b40354f952c6e --- /dev/null +++ b/docs/generated/devkit/JsonSerializeOptions.md @@ -0,0 +1,21 @@ +# Interface: JsonSerializeOptions + +## Table of contents + +### Properties + +- [spaces](../../devkit/documents/JsonSerializeOptions#spaces) + +## Properties + +### spaces + +• `Optional` **spaces**: `number` + +the whitespaces to add as indentation to make the output more readable. + +**`Default`** + +```ts +2; +``` diff --git a/docs/generated/devkit/MigrationsJson.md b/docs/generated/devkit/MigrationsJson.md new file mode 100644 index 0000000000000..f5db15f375a42 --- /dev/null +++ b/docs/generated/devkit/MigrationsJson.md @@ -0,0 +1,56 @@ +# Interface: MigrationsJson + +## Table of contents + +### Properties + +- [collection](../../devkit/documents/MigrationsJson#collection) +- [generators](../../devkit/documents/MigrationsJson#generators) +- [name](../../devkit/documents/MigrationsJson#name) +- [packageJsonUpdates](../../devkit/documents/MigrationsJson#packagejsonupdates) +- [schematics](../../devkit/documents/MigrationsJson#schematics) +- [version](../../devkit/documents/MigrationsJson#version) + +## Properties + +### collection + +• `Optional` **collection**: `string` + +--- + +### generators + +• `Optional` **generators**: `Object` + +#### Index signature + +▪ [name: `string`]: `MigrationsJsonEntry` + +--- + +### name + +• `Optional` **name**: `string` + +--- + +### packageJsonUpdates + +• `Optional` **packageJsonUpdates**: `PackageJsonUpdates` + +--- + +### schematics + +• `Optional` **schematics**: `Object` + +#### Index signature + +▪ [name: `string`]: `MigrationsJsonEntry` + +--- + +### version + +• `Optional` **version**: `string` diff --git a/docs/generated/devkit/ModuleFederationConfig.md b/docs/generated/devkit/ModuleFederationConfig.md new file mode 100644 index 0000000000000..f68b315a4a2ae --- /dev/null +++ b/docs/generated/devkit/ModuleFederationConfig.md @@ -0,0 +1,48 @@ +# Interface: ModuleFederationConfig + +## Table of contents + +### Properties + +- [additionalShared](../../devkit/documents/ModuleFederationConfig#additionalshared) +- [exposes](../../devkit/documents/ModuleFederationConfig#exposes) +- [library](../../devkit/documents/ModuleFederationConfig#library) +- [name](../../devkit/documents/ModuleFederationConfig#name) +- [remotes](../../devkit/documents/ModuleFederationConfig#remotes) +- [shared](../../devkit/documents/ModuleFederationConfig#shared) + +## Properties + +### additionalShared + +• `Optional` **additionalShared**: [`AdditionalSharedConfig`](../../devkit/documents/AdditionalSharedConfig) + +--- + +### exposes + +• `Optional` **exposes**: `Record`<`string`, `string`\> + +--- + +### library + +• `Optional` **library**: [`ModuleFederationLibrary`](../../devkit/documents/ModuleFederationLibrary) + +--- + +### name + +• **name**: `string` + +--- + +### remotes + +• `Optional` **remotes**: [`Remotes`](../../devkit/documents/Remotes) + +--- + +### shared + +• `Optional` **shared**: [`SharedFunction`](../../devkit/documents/SharedFunction) diff --git a/docs/generated/devkit/ModuleFederationLibrary.md b/docs/generated/devkit/ModuleFederationLibrary.md new file mode 100644 index 0000000000000..d329d65cf927d --- /dev/null +++ b/docs/generated/devkit/ModuleFederationLibrary.md @@ -0,0 +1,10 @@ +# Type alias: ModuleFederationLibrary + +Ƭ **ModuleFederationLibrary**: `Object` + +#### Type declaration + +| Name | Type | +| :----- | :------- | +| `name` | `string` | +| `type` | `string` | diff --git a/docs/generated/devkit/NX_VERSION.md b/docs/generated/devkit/NX_VERSION.md new file mode 100644 index 0000000000000..832ba480a387a --- /dev/null +++ b/docs/generated/devkit/NX_VERSION.md @@ -0,0 +1,7 @@ +# Variable: NX_VERSION + +• `Const` **NX_VERSION**: `string` + +**`Description`** + +The version of Nx used by the workspace. Returns null if no version is found. diff --git a/docs/generated/devkit/NxAffectedConfig.md b/docs/generated/devkit/NxAffectedConfig.md new file mode 100644 index 0000000000000..d22f6d88c4d97 --- /dev/null +++ b/docs/generated/devkit/NxAffectedConfig.md @@ -0,0 +1,15 @@ +# Interface: NxAffectedConfig + +## Table of contents + +### Properties + +- [defaultBase](../../devkit/documents/NxAffectedConfig#defaultbase) + +## Properties + +### defaultBase + +• `Optional` **defaultBase**: `string` + +Default based branch used by affected commands. diff --git a/docs/generated/devkit/NxJsonConfiguration.md b/docs/generated/devkit/NxJsonConfiguration.md new file mode 100644 index 0000000000000..34c192edda59b --- /dev/null +++ b/docs/generated/devkit/NxJsonConfiguration.md @@ -0,0 +1,199 @@ +# Interface: NxJsonConfiguration + +Nx.json configuration + +@note: when adding properties here add them to `allowedWorkspaceExtensions` in adapter/compat.ts + +## Type parameters + +| Name | Type | +| :--- | :------------------ | +| `T` | `"*"` \| `string`[] | + +## Hierarchy + +- **`NxJsonConfiguration`** + + ↳ [`Workspace`](../../devkit/documents/Workspace) + +## Table of contents + +### Properties + +- [affected](../../devkit/documents/NxJsonConfiguration#affected) +- [cli](../../devkit/documents/NxJsonConfiguration#cli) +- [defaultProject](../../devkit/documents/NxJsonConfiguration#defaultproject) +- [extends](../../devkit/documents/NxJsonConfiguration#extends) +- [generators](../../devkit/documents/NxJsonConfiguration#generators) +- [implicitDependencies](../../devkit/documents/NxJsonConfiguration#implicitdependencies) +- [installation](../../devkit/documents/NxJsonConfiguration#installation) +- [namedInputs](../../devkit/documents/NxJsonConfiguration#namedinputs) +- [npmScope](../../devkit/documents/NxJsonConfiguration#npmscope) +- [plugins](../../devkit/documents/NxJsonConfiguration#plugins) +- [pluginsConfig](../../devkit/documents/NxJsonConfiguration#pluginsconfig) +- [targetDefaults](../../devkit/documents/NxJsonConfiguration#targetdefaults) +- [tasksRunnerOptions](../../devkit/documents/NxJsonConfiguration#tasksrunneroptions) +- [workspaceLayout](../../devkit/documents/NxJsonConfiguration#workspacelayout) + +## Properties + +### affected + +• `Optional` **affected**: [`NxAffectedConfig`](../../devkit/documents/NxAffectedConfig) + +Default options for `nx affected` + +--- + +### cli + +• `Optional` **cli**: `Object` + +Default generator collection. It is used when no collection is provided. + +#### Type declaration + +| Name | Type | Description | +| :-------------------- | :-------------------------------------------------------- | :--------------------------------------------------------------------- | +| `defaultCollection?` | `string` | **`Deprecated`** - defaultCollection is deprecated and will be removed | +| `defaultProjectName?` | `string` | - | +| `packageManager?` | [`PackageManager`](../../devkit/documents/PackageManager) | - | + +--- + +### defaultProject + +• `Optional` **defaultProject**: `string` + +Default project. When project isn't provided, the default project +will be used. Convenient for small workspaces with one main application. + +--- + +### extends + +• `Optional` **extends**: `string` + +Optional (additional) Nx.json configuration file which becomes a base for this one + +--- + +### generators + +• `Optional` **generators**: `Object` + +List of default values used by generators. + +These defaults are global. They are used when no other defaults are configured. + +Example: + +``` +{ + "@nx/react": { + "library": { + "style": "scss" + } + } +} +``` + +#### Index signature + +▪ [collectionName: `string`]: { `[generatorName: string]`: `any`; } + +--- + +### implicitDependencies + +• `Optional` **implicitDependencies**: [`ImplicitDependencyEntry`](../../devkit/documents/ImplicitDependencyEntry)<`T`\> + +Map of files to projects that implicitly depend on them + +**`Deprecated`** + +use [namedInputs](../../devkit/documents/Workspace#namedinputs) instead. For more information see https://nx.dev/deprecated/global-implicit-dependencies#global-implicit-dependencies + +--- + +### installation + +• `Optional` **installation**: `NxInstallationConfiguration` + +Configures the Nx installation for a repo. Useful for maintaining a separate +set of dependencies for Nx + Plugins compared to the base package.json, but also +useful for workspaces that don't have a root package.json + node_modules. + +--- + +### namedInputs + +• `Optional` **namedInputs**: `Object` + +Named inputs targets can refer to reduce duplication + +#### Index signature + +▪ [inputName: `string`]: (`string` \| `InputDefinition`)[] + +--- + +### npmScope + +• `Optional` **npmScope**: `string` + +**`Deprecated`** + +This is inferred from the package.json in the workspace root. Please use getNpmScope instead. +NPM Scope that the workspace uses + +--- + +### plugins + +• `Optional` **plugins**: `string`[] + +Plugins for extending the project graph + +--- + +### pluginsConfig + +• `Optional` **pluginsConfig**: `Record`<`string`, `unknown`\> + +Configuration for Nx Plugins + +--- + +### targetDefaults + +• `Optional` **targetDefaults**: `TargetDefaults` + +Dependencies between different target names across all projects + +--- + +### tasksRunnerOptions + +• `Optional` **tasksRunnerOptions**: `Object` + +Available Task Runners + +#### Index signature + +▪ [tasksRunnerName: `string`]: { `options?`: `any` ; `runner`: `string` } + +--- + +### workspaceLayout + +• `Optional` **workspaceLayout**: `Object` + +Where new apps + libs should be placed + +#### Type declaration + +| Name | Type | +| :-------- | :------- | +| `appsDir` | `string` | +| `libsDir` | `string` | diff --git a/docs/generated/devkit/NxPlugin.md b/docs/generated/devkit/NxPlugin.md new file mode 100644 index 0000000000000..51e06e9446ce3 --- /dev/null +++ b/docs/generated/devkit/NxPlugin.md @@ -0,0 +1,39 @@ +# Interface: NxPlugin + +A plugin for Nx + +## Table of contents + +### Properties + +- [name](../../devkit/documents/NxPlugin#name) +- [processProjectGraph](../../devkit/documents/NxPlugin#processprojectgraph) +- [projectFilePatterns](../../devkit/documents/NxPlugin#projectfilepatterns) +- [registerProjectTargets](../../devkit/documents/NxPlugin#registerprojecttargets) + +## Properties + +### name + +• **name**: `string` + +--- + +### processProjectGraph + +• `Optional` **processProjectGraph**: `ProjectGraphProcessor` + +--- + +### projectFilePatterns + +• `Optional` **projectFilePatterns**: `string`[] + +A glob pattern to search for non-standard project files. +@example: ["*.csproj", "pom.xml"] + +--- + +### registerProjectTargets + +• `Optional` **registerProjectTargets**: [`ProjectTargetConfigurator`](../../devkit/documents/ProjectTargetConfigurator) diff --git a/docs/generated/devkit/PackageManager.md b/docs/generated/devkit/PackageManager.md new file mode 100644 index 0000000000000..e633d8c96104f --- /dev/null +++ b/docs/generated/devkit/PackageManager.md @@ -0,0 +1,3 @@ +# Type alias: PackageManager + +Ƭ **PackageManager**: `"yarn"` \| `"pnpm"` \| `"npm"` diff --git a/docs/generated/devkit/ProjectConfiguration.md b/docs/generated/devkit/ProjectConfiguration.md new file mode 100644 index 0000000000000..d4548f8f6c77b --- /dev/null +++ b/docs/generated/devkit/ProjectConfiguration.md @@ -0,0 +1,117 @@ +# Interface: ProjectConfiguration + +Project configuration + +@note: when adding properties here add them to `allowedProjectExtensions` in adapter/compat.ts + +## Table of contents + +### Properties + +- [generators](../../devkit/documents/ProjectConfiguration#generators) +- [implicitDependencies](../../devkit/documents/ProjectConfiguration#implicitdependencies) +- [name](../../devkit/documents/ProjectConfiguration#name) +- [namedInputs](../../devkit/documents/ProjectConfiguration#namedinputs) +- [projectType](../../devkit/documents/ProjectConfiguration#projecttype) +- [root](../../devkit/documents/ProjectConfiguration#root) +- [sourceRoot](../../devkit/documents/ProjectConfiguration#sourceroot) +- [tags](../../devkit/documents/ProjectConfiguration#tags) +- [targets](../../devkit/documents/ProjectConfiguration#targets) + +## Properties + +### generators + +• `Optional` **generators**: `Object` + +List of default values used by generators. + +These defaults are project specific. + +Example: + +``` +{ + "@nx/react": { + "library": { + "style": "scss" + } + } +} +``` + +#### Index signature + +▪ [collectionName: `string`]: { `[generatorName: string]`: `any`; } + +--- + +### implicitDependencies + +• `Optional` **implicitDependencies**: `string`[] + +List of projects which are added as a dependency + +--- + +### name + +• `Optional` **name**: `string` + +Project's name. Optional if specified in workspace.json + +--- + +### namedInputs + +• `Optional` **namedInputs**: `Object` + +Named inputs targets can refer to reduce duplication + +#### Index signature + +▪ [inputName: `string`]: (`string` \| `InputDefinition`)[] + +--- + +### projectType + +• `Optional` **projectType**: [`ProjectType`](../../devkit/documents/ProjectType) + +Project type + +--- + +### root + +• **root**: `string` + +Project's location relative to the root of the workspace + +--- + +### sourceRoot + +• `Optional` **sourceRoot**: `string` + +The location of project's sources relative to the root of the workspace + +--- + +### tags + +• `Optional` **tags**: `string`[] + +List of tags used by enforce-module-boundaries / project graph + +--- + +### targets + +• `Optional` **targets**: `Object` + +Project's targets + +#### Index signature + +▪ [targetName: `string`]: [`TargetConfiguration`](../../devkit/documents/TargetConfiguration) diff --git a/docs/generated/devkit/ProjectFileMap.md b/docs/generated/devkit/ProjectFileMap.md new file mode 100644 index 0000000000000..86efa81a5fdb3 --- /dev/null +++ b/docs/generated/devkit/ProjectFileMap.md @@ -0,0 +1,7 @@ +# Interface: ProjectFileMap + +A list of files separated by the project they belong to + +## Indexable + +▪ [projectName: `string`]: [`FileData`](../../devkit/documents/FileData)[] diff --git a/docs/generated/devkit/ProjectGraph.md b/docs/generated/devkit/ProjectGraph.md new file mode 100644 index 0000000000000..0eb1fec4fc875 --- /dev/null +++ b/docs/generated/devkit/ProjectGraph.md @@ -0,0 +1,36 @@ +# Interface: ProjectGraph + +A Graph of projects in the workspace and dependencies between them + +## Table of contents + +### Properties + +- [dependencies](../../devkit/documents/ProjectGraph#dependencies) +- [externalNodes](../../devkit/documents/ProjectGraph#externalnodes) +- [nodes](../../devkit/documents/ProjectGraph#nodes) +- [version](../../devkit/documents/ProjectGraph#version) + +## Properties + +### dependencies + +• **dependencies**: `Record`<`string`, [`ProjectGraphDependency`](../../devkit/documents/ProjectGraphDependency)[]\> + +--- + +### externalNodes + +• `Optional` **externalNodes**: `Record`<`string`, [`ProjectGraphExternalNode`](../../devkit/documents/ProjectGraphExternalNode)\> + +--- + +### nodes + +• **nodes**: `Record`<`string`, [`ProjectGraphProjectNode`](../../devkit/documents/ProjectGraphProjectNode)\> + +--- + +### version + +• `Optional` **version**: `string` diff --git a/docs/generated/devkit/ProjectGraphBuilder.md b/docs/generated/devkit/ProjectGraphBuilder.md new file mode 100644 index 0000000000000..2d88afbbfad10 --- /dev/null +++ b/docs/generated/devkit/ProjectGraphBuilder.md @@ -0,0 +1,335 @@ +# Class: ProjectGraphBuilder + +## Table of contents + +### Constructors + +- [constructor](../../devkit/documents/ProjectGraphBuilder#constructor) + +### Properties + +- [fileMap](../../devkit/documents/ProjectGraphBuilder#filemap) +- [graph](../../devkit/documents/ProjectGraphBuilder#graph) +- [removedEdges](../../devkit/documents/ProjectGraphBuilder#removededges) + +### Methods + +- [addDependency](../../devkit/documents/ProjectGraphBuilder#adddependency) +- [addDynamicDependency](../../devkit/documents/ProjectGraphBuilder#adddynamicdependency) +- [addExplicitDependency](../../devkit/documents/ProjectGraphBuilder#addexplicitdependency) +- [addExternalNode](../../devkit/documents/ProjectGraphBuilder#addexternalnode) +- [addImplicitDependency](../../devkit/documents/ProjectGraphBuilder#addimplicitdependency) +- [addNode](../../devkit/documents/ProjectGraphBuilder#addnode) +- [addStaticDependency](../../devkit/documents/ProjectGraphBuilder#addstaticdependency) +- [calculateAlreadySetTargetDeps](../../devkit/documents/ProjectGraphBuilder#calculatealreadysettargetdeps) +- [calculateTargetDepsFromFiles](../../devkit/documents/ProjectGraphBuilder#calculatetargetdepsfromfiles) +- [getUpdatedProjectGraph](../../devkit/documents/ProjectGraphBuilder#getupdatedprojectgraph) +- [mergeProjectGraph](../../devkit/documents/ProjectGraphBuilder#mergeprojectgraph) +- [removeDependenciesWithNode](../../devkit/documents/ProjectGraphBuilder#removedependencieswithnode) +- [removeDependency](../../devkit/documents/ProjectGraphBuilder#removedependency) +- [removeNode](../../devkit/documents/ProjectGraphBuilder#removenode) +- [setVersion](../../devkit/documents/ProjectGraphBuilder#setversion) + +## Constructors + +### constructor + +• **new ProjectGraphBuilder**(`g?`, `fileMap?`) + +#### Parameters + +| Name | Type | +| :--------- | :-------------------------------------------------------- | +| `g?` | [`ProjectGraph`](../../devkit/documents/ProjectGraph) | +| `fileMap?` | [`ProjectFileMap`](../../devkit/documents/ProjectFileMap) | + +## Properties + +### fileMap + +• `Private` `Readonly` **fileMap**: [`ProjectFileMap`](../../devkit/documents/ProjectFileMap) + +--- + +### graph + +• `Readonly` **graph**: [`ProjectGraph`](../../devkit/documents/ProjectGraph) + +--- + +### removedEdges + +• `Readonly` **removedEdges**: `Object` = `{}` + +#### Index signature + +▪ [source: `string`]: `Set`<`string`\> + +## Methods + +### addDependency + +▸ `Private` **addDependency**(`sourceProjectName`, `targetProjectName`, `type`, `sourceProjectFile?`): `void` + +#### Parameters + +| Name | Type | +| :------------------- | :-------------------------------------------------------- | +| `sourceProjectName` | `string` | +| `targetProjectName` | `string` | +| `type` | [`DependencyType`](../../devkit/documents/DependencyType) | +| `sourceProjectFile?` | `string` | + +#### Returns + +`void` + +--- + +### addDynamicDependency + +▸ **addDynamicDependency**(`sourceProjectName`, `targetProjectName`, `sourceProjectFile`): `void` + +Adds dynamic dependency from source project to target project + +#### Parameters + +| Name | Type | +| :------------------ | :------- | +| `sourceProjectName` | `string` | +| `targetProjectName` | `string` | +| `sourceProjectFile` | `string` | + +#### Returns + +`void` + +--- + +### addExplicitDependency + +▸ **addExplicitDependency**(`sourceProjectName`, `sourceProjectFile`, `targetProjectName`): `void` + +Add an explicit dependency from a file in source project to target project + +**`Deprecated`** + +this method will be removed in v17. Use [addStaticDependency](../../devkit/documents/ProjectGraphBuilder#addstaticdependency) or [addDynamicDependency](../../devkit/documents/ProjectGraphBuilder#adddynamicdependency) instead + +#### Parameters + +| Name | Type | +| :------------------ | :------- | +| `sourceProjectName` | `string` | +| `sourceProjectFile` | `string` | +| `targetProjectName` | `string` | + +#### Returns + +`void` + +--- + +### addExternalNode + +▸ **addExternalNode**(`node`): `void` + +Adds a external node to the project graph + +#### Parameters + +| Name | Type | +| :----- | :---------------------------------------------------------------------------- | +| `node` | [`ProjectGraphExternalNode`](../../devkit/documents/ProjectGraphExternalNode) | + +#### Returns + +`void` + +--- + +### addImplicitDependency + +▸ **addImplicitDependency**(`sourceProjectName`, `targetProjectName`): `void` + +Adds implicit dependency from source project to target project + +#### Parameters + +| Name | Type | +| :------------------ | :------- | +| `sourceProjectName` | `string` | +| `targetProjectName` | `string` | + +#### Returns + +`void` + +--- + +### addNode + +▸ **addNode**(`node`): `void` + +Adds a project node to the project graph + +#### Parameters + +| Name | Type | +| :----- | :-------------------------------------------------------------------------- | +| `node` | [`ProjectGraphProjectNode`](../../devkit/documents/ProjectGraphProjectNode) | + +#### Returns + +`void` + +--- + +### addStaticDependency + +▸ **addStaticDependency**(`sourceProjectName`, `targetProjectName`, `sourceProjectFile?`): `void` + +Adds static dependency from source project to target project + +#### Parameters + +| Name | Type | +| :------------------- | :------- | +| `sourceProjectName` | `string` | +| `targetProjectName` | `string` | +| `sourceProjectFile?` | `string` | + +#### Returns + +`void` + +--- + +### calculateAlreadySetTargetDeps + +▸ `Private` **calculateAlreadySetTargetDeps**(`sourceProject`): `Map`<`string`, `Map`<`string`, [`ProjectGraphDependency`](../../devkit/documents/ProjectGraphDependency)\>\> + +#### Parameters + +| Name | Type | +| :-------------- | :------- | +| `sourceProject` | `string` | + +#### Returns + +`Map`<`string`, `Map`<`string`, [`ProjectGraphDependency`](../../devkit/documents/ProjectGraphDependency)\>\> + +--- + +### calculateTargetDepsFromFiles + +▸ `Private` **calculateTargetDepsFromFiles**(`sourceProject`): `Map`<`string`, `Set`<`string`\>\> + +#### Parameters + +| Name | Type | +| :-------------- | :------- | +| `sourceProject` | `string` | + +#### Returns + +`Map`<`string`, `Set`<`string`\>\> + +--- + +### getUpdatedProjectGraph + +▸ **getUpdatedProjectGraph**(): [`ProjectGraph`](../../devkit/documents/ProjectGraph) + +#### Returns + +[`ProjectGraph`](../../devkit/documents/ProjectGraph) + +--- + +### mergeProjectGraph + +▸ **mergeProjectGraph**(`p`): `void` + +Merges the nodes and dependencies of p into the built project graph. + +#### Parameters + +| Name | Type | +| :--- | :---------------------------------------------------- | +| `p` | [`ProjectGraph`](../../devkit/documents/ProjectGraph) | + +#### Returns + +`void` + +--- + +### removeDependenciesWithNode + +▸ `Private` **removeDependenciesWithNode**(`name`): `void` + +#### Parameters + +| Name | Type | +| :----- | :------- | +| `name` | `string` | + +#### Returns + +`void` + +--- + +### removeDependency + +▸ **removeDependency**(`sourceProjectName`, `targetProjectName`): `void` + +Removes a dependency from source project to target project + +#### Parameters + +| Name | Type | +| :------------------ | :------- | +| `sourceProjectName` | `string` | +| `targetProjectName` | `string` | + +#### Returns + +`void` + +--- + +### removeNode + +▸ **removeNode**(`name`): `void` + +Removes a node and all of its dependency edges from the graph + +#### Parameters + +| Name | Type | +| :----- | :------- | +| `name` | `string` | + +#### Returns + +`void` + +--- + +### setVersion + +▸ **setVersion**(`version`): `void` + +Set version of the project graph + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `version` | `string` | + +#### Returns + +`void` diff --git a/docs/generated/devkit/ProjectGraphDependency.md b/docs/generated/devkit/ProjectGraphDependency.md new file mode 100644 index 0000000000000..32a2ebe59712e --- /dev/null +++ b/docs/generated/devkit/ProjectGraphDependency.md @@ -0,0 +1,33 @@ +# Interface: ProjectGraphDependency + +A dependency between two projects + +## Table of contents + +### Properties + +- [source](../../devkit/documents/ProjectGraphDependency#source) +- [target](../../devkit/documents/ProjectGraphDependency#target) +- [type](../../devkit/documents/ProjectGraphDependency#type) + +## Properties + +### source + +• **source**: `string` + +The project importing the other + +--- + +### target + +• **target**: `string` + +The project being imported by the other + +--- + +### type + +• **type**: `string` diff --git a/docs/generated/devkit/ProjectGraphExternalNode.md b/docs/generated/devkit/ProjectGraphExternalNode.md new file mode 100644 index 0000000000000..b03dc869cad76 --- /dev/null +++ b/docs/generated/devkit/ProjectGraphExternalNode.md @@ -0,0 +1,44 @@ +# Interface: ProjectGraphExternalNode + +A node describing an external dependency +`name` has as form of: + +- `npm:packageName` for root dependencies or +- `npm:packageName@version` for nested transitive dependencies + +This is vital for our node discovery to always point to root dependencies, +while allowing tracking of the full tree of different nested versions + +## Table of contents + +### Properties + +- [data](../../devkit/documents/ProjectGraphExternalNode#data) +- [name](../../devkit/documents/ProjectGraphExternalNode#name) +- [type](../../devkit/documents/ProjectGraphExternalNode#type) + +## Properties + +### data + +• **data**: `Object` + +#### Type declaration + +| Name | Type | +| :------------ | :------- | +| `hash?` | `string` | +| `packageName` | `string` | +| `version` | `string` | + +--- + +### name + +• **name**: \`npm:${string}\` + +--- + +### type + +• **type**: `"npm"` diff --git a/docs/generated/devkit/ProjectGraphNode.md b/docs/generated/devkit/ProjectGraphNode.md new file mode 100644 index 0000000000000..bd335d0127a2c --- /dev/null +++ b/docs/generated/devkit/ProjectGraphNode.md @@ -0,0 +1,7 @@ +# Type alias: ProjectGraphNode + +Ƭ **ProjectGraphNode**: [`ProjectGraphProjectNode`](../../devkit/documents/ProjectGraphProjectNode) \| [`ProjectGraphExternalNode`](../../devkit/documents/ProjectGraphExternalNode) + +**`Deprecated`** + +this type will be removed in v16. Use [ProjectGraphProjectNode](../../devkit/documents/ProjectGraphProjectNode) or [ProjectGraphExternalNode](../../devkit/documents/ProjectGraphExternalNode) instead diff --git a/docs/generated/devkit/ProjectGraphProcessorContext.md b/docs/generated/devkit/ProjectGraphProcessorContext.md new file mode 100644 index 0000000000000..bd9bb6e604b5d --- /dev/null +++ b/docs/generated/devkit/ProjectGraphProcessorContext.md @@ -0,0 +1,53 @@ +# Interface: ProjectGraphProcessorContext + +Additional information to be used to process a project graph + +## Table of contents + +### Properties + +- [fileMap](../../devkit/documents/ProjectGraphProcessorContext#filemap) +- [filesToProcess](../../devkit/documents/ProjectGraphProcessorContext#filestoprocess) +- [nxJsonConfiguration](../../devkit/documents/ProjectGraphProcessorContext#nxjsonconfiguration) +- [projectsConfigurations](../../devkit/documents/ProjectGraphProcessorContext#projectsconfigurations) +- [workspace](../../devkit/documents/ProjectGraphProcessorContext#workspace) + +## Properties + +### fileMap + +• **fileMap**: [`ProjectFileMap`](../../devkit/documents/ProjectFileMap) + +All files in the workspace + +--- + +### filesToProcess + +• **filesToProcess**: [`ProjectFileMap`](../../devkit/documents/ProjectFileMap) + +Files changes since last invocation + +--- + +### nxJsonConfiguration + +• **nxJsonConfiguration**: [`NxJsonConfiguration`](../../devkit/documents/NxJsonConfiguration)<`string`[] \| `"*"`\> + +--- + +### projectsConfigurations + +• **projectsConfigurations**: [`ProjectsConfigurations`](../../devkit/documents/ProjectsConfigurations) + +--- + +### workspace + +• **workspace**: [`Workspace`](../../devkit/documents/Workspace) + +Workspace information such as projects and configuration + +**`Deprecated`** + +use [projectsConfigurations](../../devkit/documents/ProjectGraphProcessorContext#projectsconfigurations) or [nxJsonConfiguration](../../devkit/documents/ProjectGraphProcessorContext#nxjsonconfiguration) instead diff --git a/docs/generated/devkit/ProjectGraphProjectNode.md b/docs/generated/devkit/ProjectGraphProjectNode.md new file mode 100644 index 0000000000000..551e17fcefbb9 --- /dev/null +++ b/docs/generated/devkit/ProjectGraphProjectNode.md @@ -0,0 +1,31 @@ +# Interface: ProjectGraphProjectNode + +A node describing a project in a workspace + +## Table of contents + +### Properties + +- [data](../../devkit/documents/ProjectGraphProjectNode#data) +- [name](../../devkit/documents/ProjectGraphProjectNode#name) +- [type](../../devkit/documents/ProjectGraphProjectNode#type) + +## Properties + +### data + +• **data**: [`ProjectConfiguration`](../../devkit/documents/ProjectConfiguration) & { `description?`: `string` } + +Additional metadata about a project + +--- + +### name + +• **name**: `string` + +--- + +### type + +• **type**: `"app"` \| `"e2e"` \| `"lib"` diff --git a/docs/generated/devkit/ProjectTargetConfigurator.md b/docs/generated/devkit/ProjectTargetConfigurator.md new file mode 100644 index 0000000000000..5c2885427fe21 --- /dev/null +++ b/docs/generated/devkit/ProjectTargetConfigurator.md @@ -0,0 +1,17 @@ +# Type alias: ProjectTargetConfigurator + +Ƭ **ProjectTargetConfigurator**: (`file`: `string`) => `Record`<`string`, [`TargetConfiguration`](../../devkit/documents/TargetConfiguration)\> + +#### Type declaration + +▸ (`file`): `Record`<`string`, [`TargetConfiguration`](../../devkit/documents/TargetConfiguration)\> + +##### Parameters + +| Name | Type | +| :----- | :------- | +| `file` | `string` | + +##### Returns + +`Record`<`string`, [`TargetConfiguration`](../../devkit/documents/TargetConfiguration)\> diff --git a/docs/generated/devkit/ProjectType.md b/docs/generated/devkit/ProjectType.md new file mode 100644 index 0000000000000..237864da5e21c --- /dev/null +++ b/docs/generated/devkit/ProjectType.md @@ -0,0 +1,5 @@ +# Type alias: ProjectType + +Ƭ **ProjectType**: `"library"` \| `"application"` + +Type of project supported diff --git a/docs/generated/devkit/ProjectsConfigurations.md b/docs/generated/devkit/ProjectsConfigurations.md new file mode 100644 index 0000000000000..10fb04f370a27 --- /dev/null +++ b/docs/generated/devkit/ProjectsConfigurations.md @@ -0,0 +1,37 @@ +# Interface: ProjectsConfigurations + +Projects Configurations +@note: when adding properties here add them to `allowedWorkspaceExtensions` in adapter/compat.ts + +## Hierarchy + +- **`ProjectsConfigurations`** + + ↳ [`Workspace`](../../devkit/documents/Workspace) + +## Table of contents + +### Properties + +- [projects](../../devkit/documents/ProjectsConfigurations#projects) +- [version](../../devkit/documents/ProjectsConfigurations#version) + +## Properties + +### projects + +• **projects**: `Object` + +Projects' projects + +#### Index signature + +▪ [projectName: `string`]: [`ProjectConfiguration`](../../devkit/documents/ProjectConfiguration) + +--- + +### version + +• **version**: `number` + +Version of the configuration format diff --git a/docs/generated/devkit/README.md b/docs/generated/devkit/README.md new file mode 100644 index 0000000000000..9c7cdadc7cf50 --- /dev/null +++ b/docs/generated/devkit/README.md @@ -0,0 +1,162 @@ +# @nx/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 + +### Enumerations + +- [ChangeType](../../devkit/documents/ChangeType) +- [DependencyType](../../devkit/documents/DependencyType) + +### Classes + +- [ProjectGraphBuilder](../../devkit/documents/ProjectGraphBuilder) +- [Workspaces](../../devkit/documents/Workspaces) + +### Interfaces + +- [DefaultTasksRunnerOptions](../../devkit/documents/DefaultTasksRunnerOptions) +- [ExecutorContext](../../devkit/documents/ExecutorContext) +- [ExecutorsJson](../../devkit/documents/ExecutorsJson) +- [FileChange](../../devkit/documents/FileChange) +- [FileData](../../devkit/documents/FileData) +- [GeneratorsJson](../../devkit/documents/GeneratorsJson) +- [Hash](../../devkit/documents/Hash) +- [HasherContext](../../devkit/documents/HasherContext) +- [ImplicitJsonSubsetDependency](../../devkit/documents/ImplicitJsonSubsetDependency) +- [JsonParseOptions](../../devkit/documents/JsonParseOptions) +- [JsonSerializeOptions](../../devkit/documents/JsonSerializeOptions) +- [MigrationsJson](../../devkit/documents/MigrationsJson) +- [ModuleFederationConfig](../../devkit/documents/ModuleFederationConfig) +- [NxAffectedConfig](../../devkit/documents/NxAffectedConfig) +- [NxJsonConfiguration](../../devkit/documents/NxJsonConfiguration) +- [NxPlugin](../../devkit/documents/NxPlugin) +- [ProjectConfiguration](../../devkit/documents/ProjectConfiguration) +- [ProjectFileMap](../../devkit/documents/ProjectFileMap) +- [ProjectGraph](../../devkit/documents/ProjectGraph) +- [ProjectGraphDependency](../../devkit/documents/ProjectGraphDependency) +- [ProjectGraphExternalNode](../../devkit/documents/ProjectGraphExternalNode) +- [ProjectGraphProcessorContext](../../devkit/documents/ProjectGraphProcessorContext) +- [ProjectGraphProjectNode](../../devkit/documents/ProjectGraphProjectNode) +- [ProjectsConfigurations](../../devkit/documents/ProjectsConfigurations) +- [RemoteCache](../../devkit/documents/RemoteCache) +- [SharedLibraryConfig](../../devkit/documents/SharedLibraryConfig) +- [StringDeletion](../../devkit/documents/StringDeletion) +- [StringInsertion](../../devkit/documents/StringInsertion) +- [Target](../../devkit/documents/Target) +- [TargetConfiguration](../../devkit/documents/TargetConfiguration) +- [TargetDependencyConfig](../../devkit/documents/TargetDependencyConfig) +- [Task](../../devkit/documents/Task) +- [TaskGraph](../../devkit/documents/TaskGraph) +- [TaskHasher](../../devkit/documents/TaskHasher) +- [Tree](../../devkit/documents/Tree) +- [Workspace](../../devkit/documents/Workspace) + +### Type Aliases + +- [AdditionalSharedConfig](../../devkit/documents/AdditionalSharedConfig) +- [CustomHasher](../../devkit/documents/CustomHasher) +- [Executor](../../devkit/documents/Executor) +- [Generator](../../devkit/documents/Generator) +- [GeneratorCallback](../../devkit/documents/GeneratorCallback) +- [Hasher](../../devkit/documents/Hasher) +- [ImplicitDependencyEntry](../../devkit/documents/ImplicitDependencyEntry) +- [ModuleFederationLibrary](../../devkit/documents/ModuleFederationLibrary) +- [PackageManager](../../devkit/documents/PackageManager) +- [ProjectGraphNode](../../devkit/documents/ProjectGraphNode) +- [ProjectTargetConfigurator](../../devkit/documents/ProjectTargetConfigurator) +- [ProjectType](../../devkit/documents/ProjectType) +- [Remotes](../../devkit/documents/Remotes) +- [SharedFunction](../../devkit/documents/SharedFunction) +- [SharedWorkspaceLibraryConfig](../../devkit/documents/SharedWorkspaceLibraryConfig) +- [StringChange](../../devkit/documents/StringChange) +- [TaskGraphExecutor](../../devkit/documents/TaskGraphExecutor) +- [WorkspaceConfiguration](../../devkit/documents/WorkspaceConfiguration) +- [WorkspaceJsonConfiguration](../../devkit/documents/WorkspaceJsonConfiguration) +- [WorkspaceLibrary](../../devkit/documents/WorkspaceLibrary) +- [WorkspaceLibrarySecondaryEntryPoint](../../devkit/documents/WorkspaceLibrarySecondaryEntryPoint) + +### Variables + +- [NX_VERSION](../../devkit/documents/NX_VERSION) +- [appRootPath](../../devkit/documents/appRootPath) +- [cacheDir](../../devkit/documents/cacheDir) +- [logger](../../devkit/documents/logger) +- [output](../../devkit/documents/output) +- [workspaceRoot](../../devkit/documents/workspaceRoot) + +### Functions + +- [addDependenciesToPackageJson](../../devkit/documents/addDependenciesToPackageJson) +- [addProjectConfiguration](../../devkit/documents/addProjectConfiguration) +- [applyAdditionalShared](../../devkit/documents/applyAdditionalShared) +- [applyChangesToString](../../devkit/documents/applyChangesToString) +- [applySharedFunction](../../devkit/documents/applySharedFunction) +- [convertNxExecutor](../../devkit/documents/convertNxExecutor) +- [convertNxGenerator](../../devkit/documents/convertNxGenerator) +- [createProjectFileMapUsingProjectGraph](../../devkit/documents/createProjectFileMapUsingProjectGraph) +- [createProjectGraphAsync](../../devkit/documents/createProjectGraphAsync) +- [defaultTasksRunner](../../devkit/documents/defaultTasksRunner) +- [detectPackageManager](../../devkit/documents/detectPackageManager) +- [ensurePackage](../../devkit/documents/ensurePackage) +- [extractLayoutDirectory](../../devkit/documents/extractLayoutDirectory) +- [formatFiles](../../devkit/documents/formatFiles) +- [generateFiles](../../devkit/documents/generateFiles) +- [getDependentPackagesForProject](../../devkit/documents/getDependentPackagesForProject) +- [getNpmPackageSharedConfig](../../devkit/documents/getNpmPackageSharedConfig) +- [getOutputsForTargetAndConfiguration](../../devkit/documents/getOutputsForTargetAndConfiguration) +- [getPackageManagerCommand](../../devkit/documents/getPackageManagerCommand) +- [getPackageManagerVersion](../../devkit/documents/getPackageManagerVersion) +- [getProjects](../../devkit/documents/getProjects) +- [getWorkspaceLayout](../../devkit/documents/getWorkspaceLayout) +- [getWorkspacePath](../../devkit/documents/getWorkspacePath) +- [hashArray](../../devkit/documents/hashArray) +- [installPackagesTask](../../devkit/documents/installPackagesTask) +- [isStandaloneProject](../../devkit/documents/isStandaloneProject) +- [joinPathFragments](../../devkit/documents/joinPathFragments) +- [mapRemotes](../../devkit/documents/mapRemotes) +- [mapRemotesForSSR](../../devkit/documents/mapRemotesForSSR) +- [moveFilesToNewDirectory](../../devkit/documents/moveFilesToNewDirectory) +- [names](../../devkit/documents/names) +- [normalizePath](../../devkit/documents/normalizePath) +- [offsetFromRoot](../../devkit/documents/offsetFromRoot) +- [parseJson](../../devkit/documents/parseJson) +- [parseTargetString](../../devkit/documents/parseTargetString) +- [readAllWorkspaceConfiguration](../../devkit/documents/readAllWorkspaceConfiguration) +- [readCachedProjectGraph](../../devkit/documents/readCachedProjectGraph) +- [readJson](../../devkit/documents/readJson) +- [readJsonFile](../../devkit/documents/readJsonFile) +- [readNxJson](../../devkit/documents/readNxJson) +- [readProjectConfiguration](../../devkit/documents/readProjectConfiguration) +- [readRootPackageJson](../../devkit/documents/readRootPackageJson) +- [readTargetOptions](../../devkit/documents/readTargetOptions) +- [readWorkspaceConfiguration](../../devkit/documents/readWorkspaceConfiguration) +- [removeDependenciesFromPackageJson](../../devkit/documents/removeDependenciesFromPackageJson) +- [removeProjectConfiguration](../../devkit/documents/removeProjectConfiguration) +- [reverse](../../devkit/documents/reverse) +- [runExecutor](../../devkit/documents/runExecutor) +- [runTasksInSerial](../../devkit/documents/runTasksInSerial) +- [serializeJson](../../devkit/documents/serializeJson) +- [sharePackages](../../devkit/documents/sharePackages) +- [shareWorkspaceLibraries](../../devkit/documents/shareWorkspaceLibraries) +- [stripIndents](../../devkit/documents/stripIndents) +- [stripJsonComments](../../devkit/documents/stripJsonComments) +- [targetToTargetString](../../devkit/documents/targetToTargetString) +- [toJS](../../devkit/documents/toJS) +- [updateJson](../../devkit/documents/updateJson) +- [updateNxJson](../../devkit/documents/updateNxJson) +- [updateProjectConfiguration](../../devkit/documents/updateProjectConfiguration) +- [updateTsConfigsToJs](../../devkit/documents/updateTsConfigsToJs) +- [updateWorkspaceConfiguration](../../devkit/documents/updateWorkspaceConfiguration) +- [visitNotIgnoredFiles](../../devkit/documents/visitNotIgnoredFiles) +- [workspaceLayout](../../devkit/documents/workspaceLayout) +- [writeJson](../../devkit/documents/writeJson) +- [writeJsonFile](../../devkit/documents/writeJsonFile) diff --git a/docs/generated/devkit/RemoteCache.md b/docs/generated/devkit/RemoteCache.md new file mode 100644 index 0000000000000..eaa5e1621e95b --- /dev/null +++ b/docs/generated/devkit/RemoteCache.md @@ -0,0 +1,50 @@ +# Interface: RemoteCache + +## Table of contents + +### Properties + +- [retrieve](../../devkit/documents/RemoteCache#retrieve) +- [store](../../devkit/documents/RemoteCache#store) + +## Properties + +### retrieve + +• **retrieve**: (`hash`: `string`, `cacheDirectory`: `string`) => `Promise`<`boolean`\> + +#### Type declaration + +▸ (`hash`, `cacheDirectory`): `Promise`<`boolean`\> + +##### Parameters + +| Name | Type | +| :--------------- | :------- | +| `hash` | `string` | +| `cacheDirectory` | `string` | + +##### Returns + +`Promise`<`boolean`\> + +--- + +### store + +• **store**: (`hash`: `string`, `cacheDirectory`: `string`) => `Promise`<`boolean`\> + +#### Type declaration + +▸ (`hash`, `cacheDirectory`): `Promise`<`boolean`\> + +##### Parameters + +| Name | Type | +| :--------------- | :------- | +| `hash` | `string` | +| `cacheDirectory` | `string` | + +##### Returns + +`Promise`<`boolean`\> diff --git a/docs/generated/devkit/Remotes.md b/docs/generated/devkit/Remotes.md new file mode 100644 index 0000000000000..c7a8185e0552d --- /dev/null +++ b/docs/generated/devkit/Remotes.md @@ -0,0 +1,3 @@ +# Type alias: Remotes + +Ƭ **Remotes**: `string`[] \| [remoteName: string, remoteUrl: string][] diff --git a/docs/generated/devkit/SharedFunction.md b/docs/generated/devkit/SharedFunction.md new file mode 100644 index 0000000000000..559050d602f52 --- /dev/null +++ b/docs/generated/devkit/SharedFunction.md @@ -0,0 +1,18 @@ +# Type alias: SharedFunction + +Ƭ **SharedFunction**: (`libraryName`: `string`, `sharedConfig`: [`SharedLibraryConfig`](../../devkit/documents/SharedLibraryConfig)) => `undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/documents/SharedLibraryConfig) + +#### Type declaration + +▸ (`libraryName`, `sharedConfig`): `undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/documents/SharedLibraryConfig) + +##### Parameters + +| Name | Type | +| :------------- | :------------------------------------------------------------------ | +| `libraryName` | `string` | +| `sharedConfig` | [`SharedLibraryConfig`](../../devkit/documents/SharedLibraryConfig) | + +##### Returns + +`undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/documents/SharedLibraryConfig) diff --git a/docs/generated/devkit/SharedLibraryConfig.md b/docs/generated/devkit/SharedLibraryConfig.md new file mode 100644 index 0000000000000..662d91ae358b4 --- /dev/null +++ b/docs/generated/devkit/SharedLibraryConfig.md @@ -0,0 +1,34 @@ +# Interface: SharedLibraryConfig + +## Table of contents + +### Properties + +- [eager](../../devkit/documents/SharedLibraryConfig#eager) +- [requiredVersion](../../devkit/documents/SharedLibraryConfig#requiredversion) +- [singleton](../../devkit/documents/SharedLibraryConfig#singleton) +- [strictVersion](../../devkit/documents/SharedLibraryConfig#strictversion) + +## Properties + +### eager + +• `Optional` **eager**: `boolean` + +--- + +### requiredVersion + +• `Optional` **requiredVersion**: `string` \| `false` + +--- + +### singleton + +• `Optional` **singleton**: `boolean` + +--- + +### strictVersion + +• `Optional` **strictVersion**: `boolean` diff --git a/docs/generated/devkit/SharedWorkspaceLibraryConfig.md b/docs/generated/devkit/SharedWorkspaceLibraryConfig.md new file mode 100644 index 0000000000000..d9dd46e281640 --- /dev/null +++ b/docs/generated/devkit/SharedWorkspaceLibraryConfig.md @@ -0,0 +1,11 @@ +# Type alias: SharedWorkspaceLibraryConfig + +Ƭ **SharedWorkspaceLibraryConfig**: `Object` + +#### Type declaration + +| Name | Type | +| :--------------------- | :---------------------------------------------------------------------------------------------------------------- | +| `getAliases` | () => `Record`<`string`, `string`\> | +| `getLibraries` | (`eager?`: `boolean`) => `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/SharedLibraryConfig)\> | +| `getReplacementPlugin` | () => `NormalModuleReplacementPlugin` | diff --git a/docs/generated/devkit/StringChange.md b/docs/generated/devkit/StringChange.md new file mode 100644 index 0000000000000..06f9944a02673 --- /dev/null +++ b/docs/generated/devkit/StringChange.md @@ -0,0 +1,5 @@ +# Type alias: StringChange + +Ƭ **StringChange**: [`StringInsertion`](../../devkit/documents/StringInsertion) \| [`StringDeletion`](../../devkit/documents/StringDeletion) + +A change to be made to a string diff --git a/docs/generated/devkit/StringDeletion.md b/docs/generated/devkit/StringDeletion.md new file mode 100644 index 0000000000000..fe955b79f90f6 --- /dev/null +++ b/docs/generated/devkit/StringDeletion.md @@ -0,0 +1,31 @@ +# Interface: StringDeletion + +## Table of contents + +### Properties + +- [length](../../devkit/documents/StringDeletion#length) +- [start](../../devkit/documents/StringDeletion#start) +- [type](../../devkit/documents/StringDeletion#type) + +## Properties + +### length + +• **length**: `number` + +Number of characters to delete + +--- + +### start + +• **start**: `number` + +Place in the original text to start deleting characters + +--- + +### type + +• **type**: [`Delete`](../../devkit/documents/ChangeType#delete) diff --git a/docs/generated/devkit/StringInsertion.md b/docs/generated/devkit/StringInsertion.md new file mode 100644 index 0000000000000..f118852f03105 --- /dev/null +++ b/docs/generated/devkit/StringInsertion.md @@ -0,0 +1,31 @@ +# Interface: StringInsertion + +## Table of contents + +### Properties + +- [index](../../devkit/documents/StringInsertion#index) +- [text](../../devkit/documents/StringInsertion#text) +- [type](../../devkit/documents/StringInsertion#type) + +## Properties + +### index + +• **index**: `number` + +Place in the original text to insert new text + +--- + +### text + +• **text**: `string` + +Text to insert into the original text + +--- + +### type + +• **type**: [`Insert`](../../devkit/documents/ChangeType#insert) diff --git a/docs/generated/devkit/Target.md b/docs/generated/devkit/Target.md new file mode 100644 index 0000000000000..4709326d33313 --- /dev/null +++ b/docs/generated/devkit/Target.md @@ -0,0 +1,27 @@ +# Interface: Target + +## Table of contents + +### Properties + +- [configuration](../../devkit/documents/Target#configuration) +- [project](../../devkit/documents/Target#project) +- [target](../../devkit/documents/Target#target) + +## Properties + +### configuration + +• `Optional` **configuration**: `string` + +--- + +### project + +• **project**: `string` + +--- + +### target + +• **target**: `string` diff --git a/docs/generated/devkit/TargetConfiguration.md b/docs/generated/devkit/TargetConfiguration.md new file mode 100644 index 0000000000000..db2bbbb85b077 --- /dev/null +++ b/docs/generated/devkit/TargetConfiguration.md @@ -0,0 +1,93 @@ +# Interface: TargetConfiguration + +Target's configuration + +## Type parameters + +| Name | Type | +| :--- | :---- | +| `T` | `any` | + +## Table of contents + +### Properties + +- [command](../../devkit/documents/TargetConfiguration#command) +- [configurations](../../devkit/documents/TargetConfiguration#configurations) +- [defaultConfiguration](../../devkit/documents/TargetConfiguration#defaultconfiguration) +- [dependsOn](../../devkit/documents/TargetConfiguration#dependson) +- [executor](../../devkit/documents/TargetConfiguration#executor) +- [inputs](../../devkit/documents/TargetConfiguration#inputs) +- [options](../../devkit/documents/TargetConfiguration#options) +- [outputs](../../devkit/documents/TargetConfiguration#outputs) + +## Properties + +### command + +• `Optional` **command**: `string` + +Used as a shorthand for nx:run-commands, a command to run. + +--- + +### configurations + +• `Optional` **configurations**: `Object` + +Sets of options + +#### Index signature + +▪ [config: `string`]: `any` + +--- + +### defaultConfiguration + +• `Optional` **defaultConfiguration**: `string` + +A default named configuration to use when a target configuration is not provided. + +--- + +### dependsOn + +• `Optional` **dependsOn**: (`string` \| [`TargetDependencyConfig`](../../devkit/documents/TargetDependencyConfig))[] + +This describes other targets that a target depends on. + +--- + +### executor + +• `Optional` **executor**: `string` + +The executor/builder used to implement the target. + +Example: '@nx/rollup:rollup' + +--- + +### inputs + +• `Optional` **inputs**: (`string` \| `InputDefinition`)[] + +This describes filesets, runtime dependencies and other inputs that a target depends on. + +--- + +### options + +• `Optional` **options**: `T` + +Target's options. They are passed in to the executor. + +--- + +### outputs + +• `Optional` **outputs**: `string`[] + +List of the target's outputs. The outputs will be cached by the Nx computation +caching engine. diff --git a/docs/generated/devkit/TargetDependencyConfig.md b/docs/generated/devkit/TargetDependencyConfig.md new file mode 100644 index 0000000000000..7cbc21e06f113 --- /dev/null +++ b/docs/generated/devkit/TargetDependencyConfig.md @@ -0,0 +1,45 @@ +# Interface: TargetDependencyConfig + +## Table of contents + +### Properties + +- [dependencies](../../devkit/documents/TargetDependencyConfig#dependencies) +- [params](../../devkit/documents/TargetDependencyConfig#params) +- [projects](../../devkit/documents/TargetDependencyConfig#projects) +- [target](../../devkit/documents/TargetDependencyConfig#target) + +## Properties + +### dependencies + +• `Optional` **dependencies**: `boolean` + +If true, the target will be executed for each project that this project depends on. +Should not be specified together with `projects`. + +--- + +### params + +• `Optional` **params**: `"ignore"` \| `"forward"` + +Configuration for params handling. + +--- + +### projects + +• `Optional` **projects**: `string` \| `string`[] + +A list of projects that have `target`. +Should not be specified together with `dependencies`. + +--- + +### target + +• **target**: `string` + +The name of the target to run. If `projects` and `dependencies` are not specified, +the target will be executed for the same project the the current target is running on`. diff --git a/docs/generated/devkit/Task.md b/docs/generated/devkit/Task.md new file mode 100644 index 0000000000000..569e1c60bc2e6 --- /dev/null +++ b/docs/generated/devkit/Task.md @@ -0,0 +1,97 @@ +# Interface: Task + +A representation of the invocation of an Executor + +## Table of contents + +### Properties + +- [endTime](../../devkit/documents/Task#endtime) +- [hash](../../devkit/documents/Task#hash) +- [hashDetails](../../devkit/documents/Task#hashdetails) +- [id](../../devkit/documents/Task#id) +- [overrides](../../devkit/documents/Task#overrides) +- [projectRoot](../../devkit/documents/Task#projectroot) +- [startTime](../../devkit/documents/Task#starttime) +- [target](../../devkit/documents/Task#target) + +## Properties + +### endTime + +• `Optional` **endTime**: `number` + +Unix timestamp of when a Batch Task ends + +--- + +### hash + +• `Optional` **hash**: `string` + +Hash of the task which is used for caching. + +--- + +### hashDetails + +• `Optional` **hashDetails**: `Object` + +Details about the composition of the hash + +#### Type declaration + +| Name | Type | Description | +| :-------------- | :---------------------------------- | :------------------------------------------------------------- | +| `command` | `string` | Command of the task | +| `implicitDeps?` | { `[fileName: string]`: `string`; } | Hashes of implicit dependencies which are included in the hash | +| `nodes` | { `[name: string]`: `string`; } | Hashes of inputs used in the hash | +| `runtime?` | { `[input: string]`: `string`; } | Hash of the runtime environment which the task was executed | + +--- + +### id + +• **id**: `string` + +Unique ID + +--- + +### overrides + +• **overrides**: `any` + +Overrides for the configured options of the target + +--- + +### projectRoot + +• `Optional` **projectRoot**: `string` + +Root of the project the task belongs to + +--- + +### startTime + +• `Optional` **startTime**: `number` + +Unix timestamp of when a Batch Task starts + +--- + +### target + +• **target**: `Object` + +Details about which project, target, and configuration to run. + +#### Type declaration + +| Name | Type | Description | +| :--------------- | :------- | :----------------------------------------------------- | +| `configuration?` | `string` | The configuration of the target which the task invokes | +| `project` | `string` | The project for which the task belongs to | +| `target` | `string` | The target name which the task should invoke | diff --git a/docs/generated/devkit/TaskGraph.md b/docs/generated/devkit/TaskGraph.md new file mode 100644 index 0000000000000..257cf00fbccb4 --- /dev/null +++ b/docs/generated/devkit/TaskGraph.md @@ -0,0 +1,35 @@ +# Interface: TaskGraph + +Graph of Tasks to be executed + +## Table of contents + +### Properties + +- [dependencies](../../devkit/documents/TaskGraph#dependencies) +- [roots](../../devkit/documents/TaskGraph#roots) +- [tasks](../../devkit/documents/TaskGraph#tasks) + +## Properties + +### dependencies + +• **dependencies**: `Record`<`string`, `string`[]\> + +Map of Task IDs to IDs of tasks which the task depends on + +--- + +### roots + +• **roots**: `string`[] + +IDs of Tasks which do not have any dependencies and are thus ready to execute immediately + +--- + +### tasks + +• **tasks**: `Record`<`string`, [`Task`](../../devkit/documents/Task)\> + +Map of Task IDs to Tasks diff --git a/docs/generated/devkit/TaskGraphExecutor.md b/docs/generated/devkit/TaskGraphExecutor.md new file mode 100644 index 0000000000000..acf7367ab93a0 --- /dev/null +++ b/docs/generated/devkit/TaskGraphExecutor.md @@ -0,0 +1,28 @@ +# Type alias: TaskGraphExecutor + +Ƭ **TaskGraphExecutor**<`T`\>: (`taskGraph`: [`TaskGraph`](../../devkit/documents/TaskGraph), `options`: `Record`<`string`, `T`\>, `overrides`: `T`, `context`: [`ExecutorContext`](../../devkit/documents/ExecutorContext)) => `Promise`<`BatchExecutorResult` \| `AsyncIterableIterator`<`BatchExecutorTaskResult`\>\> + +#### Type parameters + +| Name | Type | +| :--- | :---- | +| `T` | `any` | + +#### Type declaration + +▸ (`taskGraph`, `options`, `overrides`, `context`): `Promise`<`BatchExecutorResult` \| `AsyncIterableIterator`<`BatchExecutorTaskResult`\>\> + +Implementation of a target of a project that handles multiple projects to be batched + +##### Parameters + +| Name | Type | +| :---------- | :---------------------------------------------------------- | +| `taskGraph` | [`TaskGraph`](../../devkit/documents/TaskGraph) | +| `options` | `Record`<`string`, `T`\> | +| `overrides` | `T` | +| `context` | [`ExecutorContext`](../../devkit/documents/ExecutorContext) | + +##### Returns + +`Promise`<`BatchExecutorResult` \| `AsyncIterableIterator`<`BatchExecutorTaskResult`\>\> diff --git a/docs/generated/devkit/TaskHasher.md b/docs/generated/devkit/TaskHasher.md new file mode 100644 index 0000000000000..7132bae2bb722 --- /dev/null +++ b/docs/generated/devkit/TaskHasher.md @@ -0,0 +1,74 @@ +# Interface: TaskHasher + +## Table of contents + +### Methods + +- [hashTask](../../devkit/documents/TaskHasher#hashtask) +- [hashTasks](../../devkit/documents/TaskHasher#hashtasks) + +## Methods + +### hashTask + +▸ **hashTask**(`task`): `Promise`<[`Hash`](../../devkit/documents/Hash)\> + +**`Deprecated`** + +use hashTask(task:Task, taskGraph: TaskGraph) + +#### Parameters + +| Name | Type | +| :----- | :------------------------------------ | +| `task` | [`Task`](../../devkit/documents/Task) | + +#### Returns + +`Promise`<[`Hash`](../../devkit/documents/Hash)\> + +▸ **hashTask**(`task`, `taskGraph`): `Promise`<[`Hash`](../../devkit/documents/Hash)\> + +#### Parameters + +| Name | Type | +| :---------- | :---------------------------------------------- | +| `task` | [`Task`](../../devkit/documents/Task) | +| `taskGraph` | [`TaskGraph`](../../devkit/documents/TaskGraph) | + +#### Returns + +`Promise`<[`Hash`](../../devkit/documents/Hash)\> + +--- + +### hashTasks + +▸ **hashTasks**(`tasks`): `Promise`<[`Hash`](../../devkit/documents/Hash)[]\> + +**`Deprecated`** + +use hashTasks(tasks:Task[], taskGraph: TaskGraph) + +#### Parameters + +| Name | Type | +| :------ | :-------------------------------------- | +| `tasks` | [`Task`](../../devkit/documents/Task)[] | + +#### Returns + +`Promise`<[`Hash`](../../devkit/documents/Hash)[]\> + +▸ **hashTasks**(`tasks`, `taskGraph`): `Promise`<[`Hash`](../../devkit/documents/Hash)[]\> + +#### Parameters + +| Name | Type | +| :---------- | :---------------------------------------------- | +| `tasks` | [`Task`](../../devkit/documents/Task)[] | +| `taskGraph` | [`TaskGraph`](../../devkit/documents/TaskGraph) | + +#### Returns + +`Promise`<[`Hash`](../../devkit/documents/Hash)[]\> diff --git a/docs/generated/devkit/Tree.md b/docs/generated/devkit/Tree.md new file mode 100644 index 0000000000000..dacb615162fac --- /dev/null +++ b/docs/generated/devkit/Tree.md @@ -0,0 +1,204 @@ +# Interface: Tree + +Virtual file system tree. + +## Table of contents + +### Properties + +- [root](../../devkit/documents/Tree#root) + +### Methods + +- [changePermissions](../../devkit/documents/Tree#changepermissions) +- [children](../../devkit/documents/Tree#children) +- [delete](../../devkit/documents/Tree#delete) +- [exists](../../devkit/documents/Tree#exists) +- [isFile](../../devkit/documents/Tree#isfile) +- [listChanges](../../devkit/documents/Tree#listchanges) +- [read](../../devkit/documents/Tree#read) +- [rename](../../devkit/documents/Tree#rename) +- [write](../../devkit/documents/Tree#write) + +## Properties + +### root + +• **root**: `string` + +Root of the workspace. All paths are relative to this. + +## Methods + +### changePermissions + +▸ **changePermissions**(`filePath`, `mode`): `void` + +Changes permissions of a file. + +#### Parameters + +| Name | Type | Description | +| :--------- | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `filePath` | `string` | A path to a file. | +| `mode` | `Mode` | The permission to be granted on the file, given as a string (e.g `755`) or octal integer (e.g `0o755`). See https://nodejs.org/api/fs.html#fs_file_modes. | + +#### Returns + +`void` + +--- + +### children + +▸ **children**(`dirPath`): `string`[] + +Returns the list of children of a folder. + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `dirPath` | `string` | + +#### Returns + +`string`[] + +--- + +### delete + +▸ **delete**(`filePath`): `void` + +Delete the file. + +#### Parameters + +| Name | Type | +| :--------- | :------- | +| `filePath` | `string` | + +#### Returns + +`void` + +--- + +### exists + +▸ **exists**(`filePath`): `boolean` + +Check if a file exists. + +#### Parameters + +| Name | Type | +| :--------- | :------- | +| `filePath` | `string` | + +#### Returns + +`boolean` + +--- + +### isFile + +▸ **isFile**(`filePath`): `boolean` + +Check if this is a file or not. + +#### Parameters + +| Name | Type | +| :--------- | :------- | +| `filePath` | `string` | + +#### Returns + +`boolean` + +--- + +### listChanges + +▸ **listChanges**(): [`FileChange`](../../devkit/documents/FileChange)[] + +Returns the list of currently recorded changes. + +#### Returns + +[`FileChange`](../../devkit/documents/FileChange)[] + +--- + +### read + +▸ **read**(`filePath`): `Buffer` + +Read the contents of a file. + +#### Parameters + +| Name | Type | Description | +| :--------- | :------- | :---------------- | +| `filePath` | `string` | A path to a file. | + +#### Returns + +`Buffer` + +▸ **read**(`filePath`, `encoding`): `string` + +Read the contents of a file as string. + +#### Parameters + +| Name | Type | Description | +| :--------- | :--------------- | :-------------------------- | +| `filePath` | `string` | A path to a file. | +| `encoding` | `BufferEncoding` | the encoding for the result | + +#### Returns + +`string` + +--- + +### rename + +▸ **rename**(`from`, `to`): `void` + +Rename the file or the folder. + +#### Parameters + +| Name | Type | +| :----- | :------- | +| `from` | `string` | +| `to` | `string` | + +#### Returns + +`void` + +--- + +### write + +▸ **write**(`filePath`, `content`, `options?`): `void` + +Update the contents of a file or create a new file. + +#### Parameters + +| Name | Type | +| :--------- | :------------------- | +| `filePath` | `string` | +| `content` | `string` \| `Buffer` | +| `options?` | `TreeWriteOptions` | + +#### Returns + +`void` diff --git a/docs/generated/devkit/Workspace.md b/docs/generated/devkit/Workspace.md new file mode 100644 index 0000000000000..657b0c76dff19 --- /dev/null +++ b/docs/generated/devkit/Workspace.md @@ -0,0 +1,277 @@ +# Interface: Workspace + +**`Deprecated`** + +use ProjectsConfigurations or NxJsonConfiguration + +## Hierarchy + +- [`ProjectsConfigurations`](../../devkit/documents/ProjectsConfigurations) + +- [`NxJsonConfiguration`](../../devkit/documents/NxJsonConfiguration) + + ↳ **`Workspace`** + +## Table of contents + +### Properties + +- [affected](../../devkit/documents/Workspace#affected) +- [cli](../../devkit/documents/Workspace#cli) +- [defaultProject](../../devkit/documents/Workspace#defaultproject) +- [extends](../../devkit/documents/Workspace#extends) +- [generators](../../devkit/documents/Workspace#generators) +- [implicitDependencies](../../devkit/documents/Workspace#implicitdependencies) +- [installation](../../devkit/documents/Workspace#installation) +- [namedInputs](../../devkit/documents/Workspace#namedinputs) +- [npmScope](../../devkit/documents/Workspace#npmscope) +- [plugins](../../devkit/documents/Workspace#plugins) +- [pluginsConfig](../../devkit/documents/Workspace#pluginsconfig) +- [projects](../../devkit/documents/Workspace#projects) +- [targetDefaults](../../devkit/documents/Workspace#targetdefaults) +- [tasksRunnerOptions](../../devkit/documents/Workspace#tasksrunneroptions) +- [version](../../devkit/documents/Workspace#version) +- [workspaceLayout](../../devkit/documents/Workspace#workspacelayout) + +## Properties + +### affected + +• `Optional` **affected**: [`NxAffectedConfig`](../../devkit/documents/NxAffectedConfig) + +Default options for `nx affected` + +#### Inherited from + +[NxJsonConfiguration](../../devkit/documents/NxJsonConfiguration).[affected](../../devkit/documents/NxJsonConfiguration#affected) + +--- + +### cli + +• `Optional` **cli**: `Object` + +Default generator collection. It is used when no collection is provided. + +#### Type declaration + +| Name | Type | Description | +| :-------------------- | :-------------------------------------------------------- | :--------------------------------------------------------------------- | +| `defaultCollection?` | `string` | **`Deprecated`** - defaultCollection is deprecated and will be removed | +| `defaultProjectName?` | `string` | - | +| `packageManager?` | [`PackageManager`](../../devkit/documents/PackageManager) | - | + +#### Inherited from + +[NxJsonConfiguration](../../devkit/documents/NxJsonConfiguration).[cli](../../devkit/documents/NxJsonConfiguration#cli) + +--- + +### defaultProject + +• `Optional` **defaultProject**: `string` + +Default project. When project isn't provided, the default project +will be used. Convenient for small workspaces with one main application. + +#### Inherited from + +[NxJsonConfiguration](../../devkit/documents/NxJsonConfiguration).[defaultProject](../../devkit/documents/NxJsonConfiguration#defaultproject) + +--- + +### extends + +• `Optional` **extends**: `string` + +Optional (additional) Nx.json configuration file which becomes a base for this one + +#### Inherited from + +[NxJsonConfiguration](../../devkit/documents/NxJsonConfiguration).[extends](../../devkit/documents/NxJsonConfiguration#extends) + +--- + +### generators + +• `Optional` **generators**: `Object` + +List of default values used by generators. + +These defaults are global. They are used when no other defaults are configured. + +Example: + +``` +{ + "@nx/react": { + "library": { + "style": "scss" + } + } +} +``` + +#### Index signature + +▪ [collectionName: `string`]: { `[generatorName: string]`: `any`; } + +#### Inherited from + +[NxJsonConfiguration](../../devkit/documents/NxJsonConfiguration).[generators](../../devkit/documents/NxJsonConfiguration#generators) + +--- + +### implicitDependencies + +• `Optional` **implicitDependencies**: [`ImplicitDependencyEntry`](../../devkit/documents/ImplicitDependencyEntry)<`string`[] \| `"*"`\> + +Map of files to projects that implicitly depend on them + +**`Deprecated`** + +use [namedInputs](../../devkit/documents/Workspace#namedinputs) instead. For more information see https://nx.dev/deprecated/global-implicit-dependencies#global-implicit-dependencies + +#### Inherited from + +[NxJsonConfiguration](../../devkit/documents/NxJsonConfiguration).[implicitDependencies](../../devkit/documents/NxJsonConfiguration#implicitdependencies) + +--- + +### installation + +• `Optional` **installation**: `NxInstallationConfiguration` + +Configures the Nx installation for a repo. Useful for maintaining a separate +set of dependencies for Nx + Plugins compared to the base package.json, but also +useful for workspaces that don't have a root package.json + node_modules. + +#### Inherited from + +[NxJsonConfiguration](../../devkit/documents/NxJsonConfiguration).[installation](../../devkit/documents/NxJsonConfiguration#installation) + +--- + +### namedInputs + +• `Optional` **namedInputs**: `Object` + +Named inputs targets can refer to reduce duplication + +#### Index signature + +▪ [inputName: `string`]: (`string` \| `InputDefinition`)[] + +#### Inherited from + +[NxJsonConfiguration](../../devkit/documents/NxJsonConfiguration).[namedInputs](../../devkit/documents/NxJsonConfiguration#namedinputs) + +--- + +### npmScope + +• `Optional` **npmScope**: `string` + +**`Deprecated`** + +This is inferred from the package.json in the workspace root. Please use getNpmScope instead. +NPM Scope that the workspace uses + +#### Inherited from + +[NxJsonConfiguration](../../devkit/documents/NxJsonConfiguration).[npmScope](../../devkit/documents/NxJsonConfiguration#npmscope) + +--- + +### plugins + +• `Optional` **plugins**: `string`[] + +Plugins for extending the project graph + +#### Inherited from + +[NxJsonConfiguration](../../devkit/documents/NxJsonConfiguration).[plugins](../../devkit/documents/NxJsonConfiguration#plugins) + +--- + +### pluginsConfig + +• `Optional` **pluginsConfig**: `Record`<`string`, `unknown`\> + +Configuration for Nx Plugins + +#### Inherited from + +[NxJsonConfiguration](../../devkit/documents/NxJsonConfiguration).[pluginsConfig](../../devkit/documents/NxJsonConfiguration#pluginsconfig) + +--- + +### projects + +• **projects**: `Record`<`string`, [`ProjectConfiguration`](../../devkit/documents/ProjectConfiguration)\> + +Projects' projects + +#### Overrides + +[ProjectsConfigurations](../../devkit/documents/ProjectsConfigurations).[projects](../../devkit/documents/ProjectsConfigurations#projects) + +--- + +### targetDefaults + +• `Optional` **targetDefaults**: `TargetDefaults` + +Dependencies between different target names across all projects + +#### Inherited from + +[NxJsonConfiguration](../../devkit/documents/NxJsonConfiguration).[targetDefaults](../../devkit/documents/NxJsonConfiguration#targetdefaults) + +--- + +### tasksRunnerOptions + +• `Optional` **tasksRunnerOptions**: `Object` + +Available Task Runners + +#### Index signature + +▪ [tasksRunnerName: `string`]: { `options?`: `any` ; `runner`: `string` } + +#### Inherited from + +[NxJsonConfiguration](../../devkit/documents/NxJsonConfiguration).[tasksRunnerOptions](../../devkit/documents/NxJsonConfiguration#tasksrunneroptions) + +--- + +### version + +• **version**: `number` + +Version of the configuration format + +#### Inherited from + +[ProjectsConfigurations](../../devkit/documents/ProjectsConfigurations).[version](../../devkit/documents/ProjectsConfigurations#version) + +--- + +### workspaceLayout + +• `Optional` **workspaceLayout**: `Object` + +Where new apps + libs should be placed + +#### Type declaration + +| Name | Type | +| :-------- | :------- | +| `appsDir` | `string` | +| `libsDir` | `string` | + +#### Inherited from + +[NxJsonConfiguration](../../devkit/documents/NxJsonConfiguration).[workspaceLayout](../../devkit/documents/NxJsonConfiguration#workspacelayout) diff --git a/docs/generated/devkit/WorkspaceConfiguration.md b/docs/generated/devkit/WorkspaceConfiguration.md new file mode 100644 index 0000000000000..7c006695f2544 --- /dev/null +++ b/docs/generated/devkit/WorkspaceConfiguration.md @@ -0,0 +1,7 @@ +# Type alias: WorkspaceConfiguration + +Ƭ **WorkspaceConfiguration**: `Omit`<[`ProjectsConfigurations`](../../devkit/documents/ProjectsConfigurations), `"projects"`\> & `Partial`<[`NxJsonConfiguration`](../../devkit/documents/NxJsonConfiguration)\> + +**`Deprecated`** + +using NxJsonConfiguration diff --git a/docs/generated/devkit/WorkspaceJsonConfiguration.md b/docs/generated/devkit/WorkspaceJsonConfiguration.md new file mode 100644 index 0000000000000..5bcec62b5c3d5 --- /dev/null +++ b/docs/generated/devkit/WorkspaceJsonConfiguration.md @@ -0,0 +1,7 @@ +# Type alias: WorkspaceJsonConfiguration + +Ƭ **WorkspaceJsonConfiguration**: [`ProjectsConfigurations`](../../devkit/documents/ProjectsConfigurations) + +**`Deprecated`** + +use ProjectsConfigurations diff --git a/docs/generated/devkit/WorkspaceLibrary.md b/docs/generated/devkit/WorkspaceLibrary.md new file mode 100644 index 0000000000000..26db2c8872823 --- /dev/null +++ b/docs/generated/devkit/WorkspaceLibrary.md @@ -0,0 +1,11 @@ +# Type alias: WorkspaceLibrary + +Ƭ **WorkspaceLibrary**: `Object` + +#### Type declaration + +| Name | Type | +| :---------- | :---------------------- | +| `importKey` | `string` \| `undefined` | +| `name` | `string` | +| `root` | `string` | diff --git a/docs/generated/devkit/WorkspaceLibrarySecondaryEntryPoint.md b/docs/generated/devkit/WorkspaceLibrarySecondaryEntryPoint.md new file mode 100644 index 0000000000000..94c70a49d4407 --- /dev/null +++ b/docs/generated/devkit/WorkspaceLibrarySecondaryEntryPoint.md @@ -0,0 +1,10 @@ +# Type alias: WorkspaceLibrarySecondaryEntryPoint + +Ƭ **WorkspaceLibrarySecondaryEntryPoint**: `Object` + +#### Type declaration + +| Name | Type | +| :----- | :------- | +| `name` | `string` | +| `path` | `string` | diff --git a/docs/generated/devkit/Workspaces.md b/docs/generated/devkit/Workspaces.md new file mode 100644 index 0000000000000..e05a7fb152f36 --- /dev/null +++ b/docs/generated/devkit/Workspaces.md @@ -0,0 +1,98 @@ +# Class: Workspaces + +## Table of contents + +### Constructors + +- [constructor](../../devkit/documents/Workspaces#constructor) + +### Properties + +- [cachedProjectsConfig](../../devkit/documents/Workspaces#cachedprojectsconfig) +- [root](../../devkit/documents/Workspaces#root) + +### Methods + +- [mergeTargetDefaultsIntoProjectDescriptions](../../devkit/documents/Workspaces#mergetargetdefaultsintoprojectdescriptions) +- [readProjectsConfigurations](../../devkit/documents/Workspaces#readprojectsconfigurations) +- [readWorkspaceConfiguration](../../devkit/documents/Workspaces#readworkspaceconfiguration) + +## Constructors + +### constructor + +• **new Workspaces**(`root`) + +#### Parameters + +| Name | Type | +| :----- | :------- | +| `root` | `string` | + +## Properties + +### cachedProjectsConfig + +• `Private` **cachedProjectsConfig**: [`ProjectsConfigurations`](../../devkit/documents/ProjectsConfigurations) + +--- + +### root + +• `Private` **root**: `string` + +## Methods + +### mergeTargetDefaultsIntoProjectDescriptions + +▸ `Private` **mergeTargetDefaultsIntoProjectDescriptions**(`projects`, `nxJson`): `Record`<`string`, [`ProjectConfiguration`](../../devkit/documents/ProjectConfiguration)\> + +#### Parameters + +| Name | Type | +| :--------- | :----------------------------------------------------------------------------------------- | +| `projects` | `Record`<`string`, [`ProjectConfiguration`](../../devkit/documents/ProjectConfiguration)\> | +| `nxJson` | [`NxJsonConfiguration`](../../devkit/documents/NxJsonConfiguration)<`string`[] \| `"*"`\> | + +#### Returns + +`Record`<`string`, [`ProjectConfiguration`](../../devkit/documents/ProjectConfiguration)\> + +--- + +### readProjectsConfigurations + +▸ **readProjectsConfigurations**(`opts?`): [`ProjectsConfigurations`](../../devkit/documents/ProjectsConfigurations) + +**`Deprecated`** + +#### Parameters + +| Name | Type | +| :-------------------------------------- | :-------- | +| `opts?` | `Object` | +| `opts._includeProjectsFromAngularJson?` | `boolean` | + +#### Returns + +[`ProjectsConfigurations`](../../devkit/documents/ProjectsConfigurations) + +--- + +### readWorkspaceConfiguration + +▸ **readWorkspaceConfiguration**(`opts?`): [`ProjectsConfigurations`](../../devkit/documents/ProjectsConfigurations) & [`NxJsonConfiguration`](../../devkit/documents/NxJsonConfiguration)<`string`[] \| `"*"`\> + +Deprecated. Use readProjectsConfigurations + +#### Parameters + +| Name | Type | +| :-------------------------------------- | :-------- | +| `opts?` | `Object` | +| `opts._ignorePluginInference?` | `boolean` | +| `opts._includeProjectsFromAngularJson?` | `boolean` | + +#### Returns + +[`ProjectsConfigurations`](../../devkit/documents/ProjectsConfigurations) & [`NxJsonConfiguration`](../../devkit/documents/NxJsonConfiguration)<`string`[] \| `"*"`\> diff --git a/docs/generated/devkit/addDependenciesToPackageJson.md b/docs/generated/devkit/addDependenciesToPackageJson.md new file mode 100644 index 0000000000000..372a90723f3c3 --- /dev/null +++ b/docs/generated/devkit/addDependenciesToPackageJson.md @@ -0,0 +1,28 @@ +# Function: addDependenciesToPackageJson + +▸ **addDependenciesToPackageJson**(`tree`, `dependencies`, `devDependencies`, `packageJsonPath?`): [`GeneratorCallback`](../../devkit/documents/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 | Description | +| :----------------- | :------------------------------------ | :---------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/Tree) | Tree representing file system to modify | +| `dependencies` | `Record`<`string`, `string`\> | Dependencies to be added to the dependencies section of package.json | +| `devDependencies` | `Record`<`string`, `string`\> | Dependencies to be added to the devDependencies section of package.json | +| `packageJsonPath?` | `string` | Path to package.json | + +#### Returns + +[`GeneratorCallback`](../../devkit/documents/GeneratorCallback) + +Callback to install dependencies only if necessary, no-op otherwise diff --git a/docs/generated/devkit/addProjectConfiguration.md b/docs/generated/devkit/addProjectConfiguration.md new file mode 100644 index 0000000000000..697d244cf5892 --- /dev/null +++ b/docs/generated/devkit/addProjectConfiguration.md @@ -0,0 +1,18 @@ +# Function: addProjectConfiguration + +▸ **addProjectConfiguration**(`tree`, `projectName`, `projectConfiguration`, `standalone?`): `void` + +Adds project configuration to the Nx workspace. + +#### Parameters + +| Name | Type | Default value | Description | +| :--------------------- | :-------------------------------------------------------------------- | :------------ | :---------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/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/ProjectConfiguration) | `undefined` | project configuration | +| `standalone` | `boolean` | `true` | whether the project is configured in workspace.json or not | + +#### Returns + +`void` diff --git a/docs/generated/devkit/appRootPath.md b/docs/generated/devkit/appRootPath.md new file mode 100644 index 0000000000000..2e3e481af37d3 --- /dev/null +++ b/docs/generated/devkit/appRootPath.md @@ -0,0 +1,9 @@ +# Variable: appRootPath + +• `Const` **appRootPath**: `string` = `workspaceRoot` + +The root of the workspace. + +**`Deprecated`** + +use workspaceRoot instead diff --git a/docs/generated/devkit/applyAdditionalShared.md b/docs/generated/devkit/applyAdditionalShared.md new file mode 100644 index 0000000000000..55340a7602d06 --- /dev/null +++ b/docs/generated/devkit/applyAdditionalShared.md @@ -0,0 +1,22 @@ +# Function: 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/SharedLibraryConfig)\> | The original Shared Config | +| `additionalShared` | [`AdditionalSharedConfig`](../../devkit/documents/AdditionalSharedConfig) | The additional dependencies to add | +| `projectGraph` | [`ProjectGraph`](../../devkit/documents/ProjectGraph) | The Nx project graph | + +#### Returns + +`void` diff --git a/docs/generated/devkit/applyChangesToString.md b/docs/generated/devkit/applyChangesToString.md new file mode 100644 index 0000000000000..23683760564d1 --- /dev/null +++ b/docs/generated/devkit/applyChangesToString.md @@ -0,0 +1,44 @@ +# Function: 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/StringChange)[] | + +#### Returns + +`string` diff --git a/docs/generated/devkit/applySharedFunction.md b/docs/generated/devkit/applySharedFunction.md new file mode 100644 index 0000000000000..55c9517277383 --- /dev/null +++ b/docs/generated/devkit/applySharedFunction.md @@ -0,0 +1,17 @@ +# Function: 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/SharedLibraryConfig)\> | The original Shared Config to be modified | +| `sharedFn` | [`SharedFunction`](../../devkit/documents/SharedFunction) | The custom function to run | + +#### Returns + +`void` diff --git a/docs/generated/devkit/cacheDir.md b/docs/generated/devkit/cacheDir.md new file mode 100644 index 0000000000000..36f053bd10e6e --- /dev/null +++ b/docs/generated/devkit/cacheDir.md @@ -0,0 +1,5 @@ +# Variable: cacheDir + +• `Const` **cacheDir**: `string` + +Path to the directory where Nx stores its cache and daemon-related files. diff --git a/docs/generated/devkit/convertNxExecutor.md b/docs/generated/devkit/convertNxExecutor.md new file mode 100644 index 0000000000000..9d3eb7b2429a9 --- /dev/null +++ b/docs/generated/devkit/convertNxExecutor.md @@ -0,0 +1,17 @@ +# Function: 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/Executor) | + +#### Returns + +`any` diff --git a/docs/generated/devkit/convertNxGenerator.md b/docs/generated/devkit/convertNxGenerator.md new file mode 100644 index 0000000000000..7a45674c386ac --- /dev/null +++ b/docs/generated/devkit/convertNxGenerator.md @@ -0,0 +1,47 @@ +# Function: 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 | Description | +| :------------------------------ | :---------------------------------------------------- | :---------------------------------------------------------- | +| `generator` | [`Generator`](../../devkit/documents/Generator)<`T`\> | The Nx generator to convert to an Angular Devkit Schematic. | +| `skipWritingConfigInOldFormat?` | `boolean` | - | + +#### 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`\> diff --git a/docs/generated/devkit/createProjectFileMapUsingProjectGraph.md b/docs/generated/devkit/createProjectFileMapUsingProjectGraph.md new file mode 100644 index 0000000000000..ac9c8661e6fd0 --- /dev/null +++ b/docs/generated/devkit/createProjectFileMapUsingProjectGraph.md @@ -0,0 +1,13 @@ +# Function: createProjectFileMapUsingProjectGraph + +▸ **createProjectFileMapUsingProjectGraph**(`graph`): `Promise`<[`ProjectFileMap`](../../devkit/documents/ProjectFileMap)\> + +#### Parameters + +| Name | Type | +| :------ | :---------------------------------------------------- | +| `graph` | [`ProjectGraph`](../../devkit/documents/ProjectGraph) | + +#### Returns + +`Promise`<[`ProjectFileMap`](../../devkit/documents/ProjectFileMap)\> diff --git a/docs/generated/devkit/createProjectGraphAsync.md b/docs/generated/devkit/createProjectGraphAsync.md new file mode 100644 index 0000000000000..146ec2cc7a552 --- /dev/null +++ b/docs/generated/devkit/createProjectGraphAsync.md @@ -0,0 +1,37 @@ +# Function: createProjectGraphAsync + +▸ **createProjectGraphAsync**(`opts?`): `Promise`<[`ProjectGraph`](../../devkit/documents/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/ProjectGraph)\> diff --git a/docs/generated/devkit/defaultTasksRunner.md b/docs/generated/devkit/defaultTasksRunner.md new file mode 100644 index 0000000000000..a09f1efaf8402 --- /dev/null +++ b/docs/generated/devkit/defaultTasksRunner.md @@ -0,0 +1,26 @@ +# Function: defaultTasksRunner + +▸ **defaultTasksRunner**(`tasks`, `options`, `context?`): `any` + +`any | Promise<{ [id: string]: TaskStatus }>` +will change to Promise<{ [id: string]: TaskStatus }> after Nx 15 is released. + +#### Parameters + +| Name | Type | +| :--------------------------- | :---------------------------------------------------------------------------------------- | +| `tasks` | [`Task`](../../devkit/documents/Task)[] | +| `options` | [`DefaultTasksRunnerOptions`](../../devkit/documents/DefaultTasksRunnerOptions) | +| `context?` | `Object` | +| `context.daemon?` | `DaemonClient` | +| `context.hasher?` | [`TaskHasher`](../../devkit/documents/TaskHasher) | +| `context.initiatingProject?` | `string` | +| `context.nxArgs` | `NxArgs` | +| `context.nxJson` | [`NxJsonConfiguration`](../../devkit/documents/NxJsonConfiguration)<`string`[] \| `"*"`\> | +| `context.projectGraph` | [`ProjectGraph`](../../devkit/documents/ProjectGraph) | +| `context.target?` | `string` | +| `context.taskGraph?` | [`TaskGraph`](../../devkit/documents/TaskGraph) | + +#### Returns + +`any` diff --git a/docs/generated/devkit/detectPackageManager.md b/docs/generated/devkit/detectPackageManager.md new file mode 100644 index 0000000000000..8d58dc6ddb9fa --- /dev/null +++ b/docs/generated/devkit/detectPackageManager.md @@ -0,0 +1,15 @@ +# Function: detectPackageManager + +▸ **detectPackageManager**(`dir?`): [`PackageManager`](../../devkit/documents/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/PackageManager) diff --git a/docs/generated/devkit/ensurePackage.md b/docs/generated/devkit/ensurePackage.md new file mode 100644 index 0000000000000..bd4c0f2e78d78 --- /dev/null +++ b/docs/generated/devkit/ensurePackage.md @@ -0,0 +1,62 @@ +# Function: ensurePackage + +▸ **ensurePackage**(`tree`, `pkg`, `requiredVersion`, `options?`): `void` + +**`Deprecated`** + +Use the other function signature without a Tree + +Use a package that has not been installed as a dependency. + +For example: + +```typescript +ensurePackage(tree, '@nx/jest', nxVersion); +``` + +This install the @nx/jest@ and return the module +When running with --dryRun, the function will throw when dependencies are missing. +Returns null for ESM dependencies. Import them with a dynamic import instead. + +#### Parameters + +| Name | Type | Description | +| :------------------------ | :------------------------------------ | :----------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/Tree) | the file system tree | +| `pkg` | `string` | the package to check (e.g. @nx/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` + +▸ **ensurePackage**<`T`\>(`pkg`, `version`): `T` + +Ensure that dependencies and devDependencies from package.json are installed at the required versions. +Returns null for ESM dependencies. Import them with a dynamic import instead. + +For example: + +```typescript +ensurePackage('@nx/jest', nxVersion); +``` + +#### Type parameters + +| Name | Type | +| :--- | :------------------------ | +| `T` | extends `unknown` = `any` | + +#### Parameters + +| Name | Type | Description | +| :-------- | :------- | :---------------------------------------------------------- | +| `pkg` | `string` | the package to install and require | +| `version` | `string` | the version to install if the package doesn't exist already | + +#### Returns + +`T` diff --git a/docs/generated/devkit/extractLayoutDirectory.md b/docs/generated/devkit/extractLayoutDirectory.md new file mode 100644 index 0000000000000..fd5b06fc80675 --- /dev/null +++ b/docs/generated/devkit/extractLayoutDirectory.md @@ -0,0 +1,20 @@ +# Function: extractLayoutDirectory + +▸ **extractLayoutDirectory**(`directory`): `Object` + +Experimental + +#### Parameters + +| Name | Type | +| :---------- | :------- | +| `directory` | `string` | + +#### Returns + +`Object` + +| Name | Type | +| :----------------- | :------- | +| `layoutDirectory` | `string` | +| `projectDirectory` | `string` | diff --git a/docs/generated/devkit/formatFiles.md b/docs/generated/devkit/formatFiles.md new file mode 100644 index 0000000000000..37ba400abf2ee --- /dev/null +++ b/docs/generated/devkit/formatFiles.md @@ -0,0 +1,15 @@ +# Function: formatFiles + +▸ **formatFiles**(`tree`): `Promise`<`void`\> + +Formats all the created or updated files using Prettier + +#### Parameters + +| Name | Type | Description | +| :----- | :------------------------------------ | :------------------- | +| `tree` | [`Tree`](../../devkit/documents/Tree) | the file system tree | + +#### Returns + +`Promise`<`void`\> diff --git a/docs/generated/devkit/generateFiles.md b/docs/generated/devkit/generateFiles.md new file mode 100644 index 0000000000000..9f6c31ec721bc --- /dev/null +++ b/docs/generated/devkit/generateFiles.md @@ -0,0 +1,38 @@ +# Function: 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/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` diff --git a/docs/generated/devkit/getDependentPackagesForProject.md b/docs/generated/devkit/getDependentPackagesForProject.md new file mode 100644 index 0000000000000..50f871e4649fc --- /dev/null +++ b/docs/generated/devkit/getDependentPackagesForProject.md @@ -0,0 +1,19 @@ +# Function: getDependentPackagesForProject + +▸ **getDependentPackagesForProject**(`projectGraph`, `name`): `Object` + +#### Parameters + +| Name | Type | +| :------------- | :---------------------------------------------------- | +| `projectGraph` | [`ProjectGraph`](../../devkit/documents/ProjectGraph) | +| `name` | `string` | + +#### Returns + +`Object` + +| Name | Type | +| :------------------- | :-------------------------------------------------------------- | +| `npmPackages` | `string`[] | +| `workspaceLibraries` | [`WorkspaceLibrary`](../../devkit/documents/WorkspaceLibrary)[] | diff --git a/docs/generated/devkit/getNpmPackageSharedConfig.md b/docs/generated/devkit/getNpmPackageSharedConfig.md new file mode 100644 index 0000000000000..4bf755bfc53e1 --- /dev/null +++ b/docs/generated/devkit/getNpmPackageSharedConfig.md @@ -0,0 +1,17 @@ +# Function: getNpmPackageSharedConfig + +▸ **getNpmPackageSharedConfig**(`pkgName`, `version`): [`SharedLibraryConfig`](../../devkit/documents/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/SharedLibraryConfig) \| `undefined` diff --git a/docs/generated/devkit/getOutputsForTargetAndConfiguration.md b/docs/generated/devkit/getOutputsForTargetAndConfiguration.md new file mode 100644 index 0000000000000..80540c33b6829 --- /dev/null +++ b/docs/generated/devkit/getOutputsForTargetAndConfiguration.md @@ -0,0 +1,16 @@ +# Function: getOutputsForTargetAndConfiguration + +▸ **getOutputsForTargetAndConfiguration**(`task`, `node`): `string`[] + +Returns the list of outputs that will be cached. + +#### Parameters + +| Name | Type | Description | +| :----- | :-------------------------------------------------------------------------- | :-------------------------------------------------------- | +| `task` | `Pick`<[`Task`](../../devkit/documents/Task), `"overrides"` \| `"target"`\> | target + overrides | +| `node` | [`ProjectGraphProjectNode`](../../devkit/documents/ProjectGraphProjectNode) | ProjectGraphProjectNode object that the task runs against | + +#### Returns + +`string`[] diff --git a/docs/generated/devkit/getPackageManagerCommand.md b/docs/generated/devkit/getPackageManagerCommand.md new file mode 100644 index 0000000000000..8db29b0c8002d --- /dev/null +++ b/docs/generated/devkit/getPackageManagerCommand.md @@ -0,0 +1,24 @@ +# Function: getPackageManagerCommand + +▸ **getPackageManagerCommand**(`packageManager?`, `root?`): `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 | Default value | Description | +| :--------------- | :-------------------------------------------------------- | :-------------- | :------------------------------------------------------------------------------------------ | +| `packageManager` | [`PackageManager`](../../devkit/documents/PackageManager) | `undefined` | The package manager to use. If not provided, it will be detected based on the lock file. | +| `root` | `string` | `workspaceRoot` | The directory the commands will be ran inside of. Defaults to the current workspace's root. | + +#### Returns + +`PackageManagerCommands` diff --git a/docs/generated/devkit/getPackageManagerVersion.md b/docs/generated/devkit/getPackageManagerVersion.md new file mode 100644 index 0000000000000..94bb7d7dff108 --- /dev/null +++ b/docs/generated/devkit/getPackageManagerVersion.md @@ -0,0 +1,18 @@ +# Function: getPackageManagerVersion + +▸ **getPackageManagerVersion**(`packageManager?`, `cwd?`): `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/PackageManager) | +| `cwd` | `string` | + +#### Returns + +`string` diff --git a/docs/generated/devkit/getProjects.md b/docs/generated/devkit/getProjects.md new file mode 100644 index 0000000000000..089fc5c0e981e --- /dev/null +++ b/docs/generated/devkit/getProjects.md @@ -0,0 +1,17 @@ +# Function: getProjects + +▸ **getProjects**(`tree`): `Map`<`string`, [`ProjectConfiguration`](../../devkit/documents/ProjectConfiguration)\> + +Get a map of all projects in a workspace. + +Use [readProjectConfiguration](../../devkit/documents/readProjectConfiguration) if only one project is needed. + +#### Parameters + +| Name | Type | +| :----- | :------------------------------------ | +| `tree` | [`Tree`](../../devkit/documents/Tree) | + +#### Returns + +`Map`<`string`, [`ProjectConfiguration`](../../devkit/documents/ProjectConfiguration)\> diff --git a/docs/generated/devkit/getWorkspaceLayout.md b/docs/generated/devkit/getWorkspaceLayout.md new file mode 100644 index 0000000000000..da7038f5e44fb --- /dev/null +++ b/docs/generated/devkit/getWorkspaceLayout.md @@ -0,0 +1,29 @@ +# Function: 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/Tree) | file system tree | + +#### Returns + +`Object` + +| Name | Type | Description | +| :-------------------- | :-------- | :----------------------------------------------------------------------- | +| `appsDir` | `string` | - | +| `libsDir` | `string` | - | +| `npmScope` | `string` | **`Deprecated`** This will be removed in Nx 17. Use getNpmScope instead. | +| `standaloneAsDefault` | `boolean` | - | diff --git a/docs/generated/devkit/getWorkspacePath.md b/docs/generated/devkit/getWorkspacePath.md new file mode 100644 index 0000000000000..d0a10f09ac896 --- /dev/null +++ b/docs/generated/devkit/getWorkspacePath.md @@ -0,0 +1,17 @@ +# Function: getWorkspacePath + +▸ **getWorkspacePath**(`tree`): `"angular.json"` \| `"workspace.json"` + +**`Deprecated`** + +all projects are configured using project.json + +#### Parameters + +| Name | Type | +| :----- | :------------------------------------ | +| `tree` | [`Tree`](../../devkit/documents/Tree) | + +#### Returns + +`"angular.json"` \| `"workspace.json"` diff --git a/docs/generated/devkit/hashArray.md b/docs/generated/devkit/hashArray.md new file mode 100644 index 0000000000000..c462cff3995c3 --- /dev/null +++ b/docs/generated/devkit/hashArray.md @@ -0,0 +1,13 @@ +# Function: hashArray + +▸ **hashArray**(`content`): `string` + +#### Parameters + +| Name | Type | +| :-------- | :--------- | +| `content` | `string`[] | + +#### Returns + +`string` diff --git a/docs/generated/devkit/installPackagesTask.md b/docs/generated/devkit/installPackagesTask.md new file mode 100644 index 0000000000000..ed9ebe9df70a3 --- /dev/null +++ b/docs/generated/devkit/installPackagesTask.md @@ -0,0 +1,19 @@ +# Function: 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 | Description | +| :---------------- | :-------------------------------------------------------- | :------------------------------------------------------------ | +| `tree` | [`Tree`](../../devkit/documents/Tree) | the file system tree | +| `alwaysRun?` | `boolean` | always run the command even if `package.json` hasn't changed. | +| `cwd?` | `string` | - | +| `packageManager?` | [`PackageManager`](../../devkit/documents/PackageManager) | - | + +#### Returns + +`void` diff --git a/docs/generated/devkit/isStandaloneProject.md b/docs/generated/devkit/isStandaloneProject.md new file mode 100644 index 0000000000000..744a520e445af --- /dev/null +++ b/docs/generated/devkit/isStandaloneProject.md @@ -0,0 +1,20 @@ +# Function: 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/Tree) | the file system tree | +| `project` | `string` | the project name | + +#### Returns + +`boolean` diff --git a/docs/generated/devkit/joinPathFragments.md b/docs/generated/devkit/joinPathFragments.md new file mode 100644 index 0000000000000..b4a849bb9c4d7 --- /dev/null +++ b/docs/generated/devkit/joinPathFragments.md @@ -0,0 +1,15 @@ +# Function: joinPathFragments + +▸ **joinPathFragments**(`...fragments`): `string` + +Normalized path fragments and joins them + +#### Parameters + +| Name | Type | +| :------------- | :--------- | +| `...fragments` | `string`[] | + +#### Returns + +`string` diff --git a/docs/generated/devkit/logger.md b/docs/generated/devkit/logger.md new file mode 100644 index 0000000000000..6ef004c9e6645 --- /dev/null +++ b/docs/generated/devkit/logger.md @@ -0,0 +1,14 @@ +# Variable: logger + +• `Const` **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` | diff --git a/docs/generated/devkit/mapRemotes.md b/docs/generated/devkit/mapRemotes.md new file mode 100644 index 0000000000000..0c5e7df238f77 --- /dev/null +++ b/docs/generated/devkit/mapRemotes.md @@ -0,0 +1,18 @@ +# Function: 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/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`\> diff --git a/docs/generated/devkit/mapRemotesForSSR.md b/docs/generated/devkit/mapRemotesForSSR.md new file mode 100644 index 0000000000000..451da98d00ca7 --- /dev/null +++ b/docs/generated/devkit/mapRemotesForSSR.md @@ -0,0 +1,18 @@ +# Function: 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/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`\> diff --git a/docs/generated/devkit/moveFilesToNewDirectory.md b/docs/generated/devkit/moveFilesToNewDirectory.md new file mode 100644 index 0000000000000..902ba382e13df --- /dev/null +++ b/docs/generated/devkit/moveFilesToNewDirectory.md @@ -0,0 +1,17 @@ +# Function: moveFilesToNewDirectory + +▸ **moveFilesToNewDirectory**(`tree`, `oldDir`, `newDir`): `void` + +Analogous to cp -r oldDir newDir + +#### Parameters + +| Name | Type | +| :------- | :------------------------------------ | +| `tree` | [`Tree`](../../devkit/documents/Tree) | +| `oldDir` | `string` | +| `newDir` | `string` | + +#### Returns + +`void` diff --git a/docs/generated/devkit/names.md b/docs/generated/devkit/names.md new file mode 100644 index 0000000000000..39785c3f91ba3 --- /dev/null +++ b/docs/generated/devkit/names.md @@ -0,0 +1,30 @@ +# Function: 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` | diff --git a/docs/generated/devkit/ngcli_adapter.md b/docs/generated/devkit/ngcli_adapter.md deleted file mode 100644 index 49bf7022494bd..0000000000000 --- a/docs/generated/devkit/ngcli_adapter.md +++ /dev/null @@ -1,118 +0,0 @@ -# Module: ngcli-adapter - -## Table of contents - -### Classes - -- [NxScopedHost](../../devkit/documents/ngcli_adapter#nxscopedhost) - -### Functions - -- [mockSchematicsForTesting](../../devkit/documents/ngcli_adapter#mockschematicsfortesting) -- [overrideCollectionResolutionForTesting](../../devkit/documents/ngcli_adapter#overridecollectionresolutionfortesting) -- [wrapAngularDevkitSchematic](../../devkit/documents/ngcli_adapter#wrapangulardevkitschematic) - -## Classes - -### NxScopedHost - -• **NxScopedHost**: `Object` - -## Functions - -### mockSchematicsForTesting - -▸ **mockSchematicsForTesting**(`schematics`): `void` - -If you have an Nx Devkit generator invoking the wrapped Angular Devkit schematic, -and you don't want the Angular Devkit schematic to run, you can mock it up using this function. - -Unfortunately, there are some edge cases in the Nx-Angular devkit integration that -can be seen in the unit tests context. This function is useful for handling that as well. - -In this case, you can mock it up. - -Example: - -```typescript -mockSchematicsForTesting({ - 'mycollection:myschematic': (tree, params) => { - tree.write('README.md'); - }, -}); -``` - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `schematics` | `Object` | - -#### Returns - -`void` - ---- - -### overrideCollectionResolutionForTesting - -▸ **overrideCollectionResolutionForTesting**(`collections`): `void` - -By default, Angular Devkit schematic collections will be resolved using the Node resolution. -This doesn't work if you are testing schematics that refer to other schematics in the -same repo. - -This function can can be used to override the resolution behaviour. - -Example: - -```typescript -overrideCollectionResolutionForTesting({ - '@nx/workspace': path.join( - __dirname, - '../../../../workspace/generators.json' - ), - '@nx/angular': path.join(__dirname, '../../../../angular/generators.json'), - '@nx/linter': path.join(__dirname, '../../../../linter/generators.json'), -}); -``` - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `collections` | `Object` | - -#### Returns - -`void` - ---- - -### wrapAngularDevkitSchematic - -▸ **wrapAngularDevkitSchematic**(`collectionName`, `generatorName`): (`host`: [`Tree`](../../devkit/documents/nx_devkit#tree), `generatorOptions`: { `[k: string]`: `any`; }) => `Promise`<`any`\> - -#### Parameters - -| Name | Type | -| :--------------- | :------- | -| `collectionName` | `string` | -| `generatorName` | `string` | - -#### Returns - -`fn` - -▸ (`host`, `generatorOptions`): `Promise`<`any`\> - -##### Parameters - -| Name | Type | -| :----------------- | :---------------------------------------------- | -| `host` | [`Tree`](../../devkit/documents/nx_devkit#tree) | -| `generatorOptions` | `Object` | - -##### Returns - -`Promise`<`any`\> diff --git a/docs/generated/devkit/ngcli_adapter/.nojekyll b/docs/generated/devkit/ngcli_adapter/.nojekyll new file mode 100644 index 0000000000000..e2ac6616addc2 --- /dev/null +++ b/docs/generated/devkit/ngcli_adapter/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/docs/generated/devkit/ngcli_adapter/NxScopedHost.md b/docs/generated/devkit/ngcli_adapter/NxScopedHost.md new file mode 100644 index 0000000000000..decb621e06019 --- /dev/null +++ b/docs/generated/devkit/ngcli_adapter/NxScopedHost.md @@ -0,0 +1,380 @@ +# Class: NxScopedHost + +## Hierarchy + +- `ScopedHost`<`any`\> + + ↳ **`NxScopedHost`** + +## Table of contents + +### Constructors + +- [constructor](../../devkit/documents/ngcli_adapter/NxScopedHost#constructor) + +### Properties + +- [\_delegate](../../devkit/documents/ngcli_adapter/NxScopedHost#_delegate) +- [\_root](../../devkit/documents/ngcli_adapter/NxScopedHost#_root) +- [root](../../devkit/documents/ngcli_adapter/NxScopedHost#root) + +### Accessors + +- [capabilities](../../devkit/documents/ngcli_adapter/NxScopedHost#capabilities) + +### Methods + +- [\_resolve](../../devkit/documents/ngcli_adapter/NxScopedHost#_resolve) +- [delete](../../devkit/documents/ngcli_adapter/NxScopedHost#delete) +- [exists](../../devkit/documents/ngcli_adapter/NxScopedHost#exists) +- [isDirectory](../../devkit/documents/ngcli_adapter/NxScopedHost#isdirectory) +- [isFile](../../devkit/documents/ngcli_adapter/NxScopedHost#isfile) +- [list](../../devkit/documents/ngcli_adapter/NxScopedHost#list) +- [mergeProjectConfiguration](../../devkit/documents/ngcli_adapter/NxScopedHost#mergeprojectconfiguration) +- [read](../../devkit/documents/ngcli_adapter/NxScopedHost#read) +- [readExistingAngularJson](../../devkit/documents/ngcli_adapter/NxScopedHost#readexistingangularjson) +- [readJson](../../devkit/documents/ngcli_adapter/NxScopedHost#readjson) +- [readMergedWorkspaceConfiguration](../../devkit/documents/ngcli_adapter/NxScopedHost#readmergedworkspaceconfiguration) +- [rename](../../devkit/documents/ngcli_adapter/NxScopedHost#rename) +- [stat](../../devkit/documents/ngcli_adapter/NxScopedHost#stat) +- [watch](../../devkit/documents/ngcli_adapter/NxScopedHost#watch) +- [write](../../devkit/documents/ngcli_adapter/NxScopedHost#write) + +## Constructors + +### constructor + +• **new NxScopedHost**(`root`) + +#### Parameters + +| Name | Type | +| :----- | :------- | +| `root` | `string` | + +#### Overrides + +virtualFs.ScopedHost<any\>.constructor + +## Properties + +### \_delegate + +• `Protected` **\_delegate**: `Host`<`any`\> + +#### Inherited from + +virtualFs.ScopedHost.\_delegate + +--- + +### \_root + +• `Protected` **\_root**: `Path` + +#### Inherited from + +virtualFs.ScopedHost.\_root + +--- + +### root + +• `Private` **root**: `string` + +## Accessors + +### capabilities + +• `get` **capabilities**(): `HostCapabilities` + +#### Returns + +`HostCapabilities` + +#### Inherited from + +virtualFs.ScopedHost.capabilities + +## Methods + +### \_resolve + +▸ `Protected` **\_resolve**(`path`): `Path` + +#### Parameters + +| Name | Type | +| :----- | :----- | +| `path` | `Path` | + +#### Returns + +`Path` + +#### Inherited from + +virtualFs.ScopedHost.\_resolve + +--- + +### delete + +▸ **delete**(`path`): `Observable`<`void`\> + +#### Parameters + +| Name | Type | +| :----- | :----- | +| `path` | `Path` | + +#### Returns + +`Observable`<`void`\> + +#### Inherited from + +virtualFs.ScopedHost.delete + +--- + +### exists + +▸ **exists**(`path`): `Observable`<`boolean`\> + +#### Parameters + +| Name | Type | +| :----- | :----- | +| `path` | `Path` | + +#### Returns + +`Observable`<`boolean`\> + +#### Overrides + +virtualFs.ScopedHost.exists + +--- + +### isDirectory + +▸ **isDirectory**(`path`): `Observable`<`boolean`\> + +#### Parameters + +| Name | Type | +| :----- | :----- | +| `path` | `Path` | + +#### Returns + +`Observable`<`boolean`\> + +#### Inherited from + +virtualFs.ScopedHost.isDirectory + +--- + +### isFile + +▸ **isFile**(`path`): `Observable`<`boolean`\> + +#### Parameters + +| Name | Type | +| :----- | :----- | +| `path` | `Path` | + +#### Returns + +`Observable`<`boolean`\> + +#### Overrides + +virtualFs.ScopedHost.isFile + +--- + +### list + +▸ **list**(`path`): `Observable`<`PathFragment`[]\> + +#### Parameters + +| Name | Type | +| :----- | :----- | +| `path` | `Path` | + +#### Returns + +`Observable`<`PathFragment`[]\> + +#### Inherited from + +virtualFs.ScopedHost.list + +--- + +### mergeProjectConfiguration + +▸ **mergeProjectConfiguration**(`existing`, `updated`, `projectName`): `AngularProjectConfiguration` + +#### Parameters + +| Name | Type | +| :------------ | :---------------------------- | +| `existing` | `AngularProjectConfiguration` | +| `updated` | `AngularProjectConfiguration` | +| `projectName` | `string` | + +#### Returns + +`AngularProjectConfiguration` + +--- + +### read + +▸ **read**(`path`): `Observable`<`ArrayBuffer`\> + +#### Parameters + +| Name | Type | +| :----- | :----- | +| `path` | `Path` | + +#### Returns + +`Observable`<`ArrayBuffer`\> + +#### Overrides + +virtualFs.ScopedHost.read + +--- + +### readExistingAngularJson + +▸ **readExistingAngularJson**(): `Observable`<`any`\> + +#### Returns + +`Observable`<`any`\> + +--- + +### readJson + +▸ `Private` **readJson**<`T`\>(`path`): `Observable`<`T`\> + +#### Type parameters + +| Name | Type | +| :--- | :---- | +| `T` | `any` | + +#### Parameters + +| Name | Type | +| :----- | :------- | +| `path` | `string` | + +#### Returns + +`Observable`<`T`\> + +--- + +### readMergedWorkspaceConfiguration + +▸ `Private` **readMergedWorkspaceConfiguration**(): `Observable`<`any`\> + +#### Returns + +`Observable`<`any`\> + +--- + +### rename + +▸ **rename**(`from`, `to`): `Observable`<`void`\> + +#### Parameters + +| Name | Type | +| :----- | :----- | +| `from` | `Path` | +| `to` | `Path` | + +#### Returns + +`Observable`<`void`\> + +#### Inherited from + +virtualFs.ScopedHost.rename + +--- + +### stat + +▸ **stat**(`path`): `Observable`<`any`\> + +#### Parameters + +| Name | Type | +| :----- | :----- | +| `path` | `Path` | + +#### Returns + +`Observable`<`any`\> + +#### Inherited from + +virtualFs.ScopedHost.stat + +--- + +### watch + +▸ **watch**(`path`, `options?`): `Observable`<`HostWatchEvent`\> + +#### Parameters + +| Name | Type | +| :--------- | :----------------- | +| `path` | `Path` | +| `options?` | `HostWatchOptions` | + +#### Returns + +`Observable`<`HostWatchEvent`\> + +#### Inherited from + +virtualFs.ScopedHost.watch + +--- + +### write + +▸ **write**(`path`, `content`): `Observable`<`void`\> + +#### Parameters + +| Name | Type | +| :-------- | :------------ | +| `path` | `Path` | +| `content` | `ArrayBuffer` | + +#### Returns + +`Observable`<`void`\> + +#### Overrides + +virtualFs.ScopedHost.write diff --git a/docs/generated/devkit/ngcli_adapter/README.md b/docs/generated/devkit/ngcli_adapter/README.md new file mode 100644 index 0000000000000..8250da93e4678 --- /dev/null +++ b/docs/generated/devkit/ngcli_adapter/README.md @@ -0,0 +1,13 @@ +# @nx/devkit + +## Table of contents + +### Classes + +- [NxScopedHost](../../devkit/documents/ngcli_adapter/NxScopedHost) + +### Functions + +- [mockSchematicsForTesting](../../devkit/documents/ngcli_adapter/mockSchematicsForTesting) +- [overrideCollectionResolutionForTesting](../../devkit/documents/ngcli_adapter/overrideCollectionResolutionForTesting) +- [wrapAngularDevkitSchematic](../../devkit/documents/ngcli_adapter/wrapAngularDevkitSchematic) diff --git a/docs/generated/devkit/ngcli_adapter/mockSchematicsForTesting.md b/docs/generated/devkit/ngcli_adapter/mockSchematicsForTesting.md new file mode 100644 index 0000000000000..c2450bf7320ca --- /dev/null +++ b/docs/generated/devkit/ngcli_adapter/mockSchematicsForTesting.md @@ -0,0 +1,31 @@ +# Function: mockSchematicsForTesting + +▸ **mockSchematicsForTesting**(`schematics`): `void` + +If you have an Nx Devkit generator invoking the wrapped Angular Devkit schematic, +and you don't want the Angular Devkit schematic to run, you can mock it up using this function. + +Unfortunately, there are some edge cases in the Nx-Angular devkit integration that +can be seen in the unit tests context. This function is useful for handling that as well. + +In this case, you can mock it up. + +Example: + +```typescript +mockSchematicsForTesting({ + 'mycollection:myschematic': (tree, params) => { + tree.write('README'); + }, +}); +``` + +#### Parameters + +| Name | Type | +| :----------- | :------- | +| `schematics` | `Object` | + +#### Returns + +`void` diff --git a/docs/generated/devkit/ngcli_adapter/overrideCollectionResolutionForTesting.md b/docs/generated/devkit/ngcli_adapter/overrideCollectionResolutionForTesting.md new file mode 100644 index 0000000000000..0861f2e510327 --- /dev/null +++ b/docs/generated/devkit/ngcli_adapter/overrideCollectionResolutionForTesting.md @@ -0,0 +1,32 @@ +# Function: overrideCollectionResolutionForTesting + +▸ **overrideCollectionResolutionForTesting**(`collections`): `void` + +By default, Angular Devkit schematic collections will be resolved using the Node resolution. +This doesn't work if you are testing schematics that refer to other schematics in the +same repo. + +This function can can be used to override the resolution behaviour. + +Example: + +```typescript +overrideCollectionResolutionForTesting({ + '@nx/workspace': path.join( + __dirname, + '../../../../workspace/generators.json' + ), + '@nx/angular': path.join(__dirname, '../../../../angular/generators.json'), + '@nx/linter': path.join(__dirname, '../../../../linter/generators.json'), +}); +``` + +#### Parameters + +| Name | Type | +| :------------ | :------- | +| `collections` | `Object` | + +#### Returns + +`void` diff --git a/docs/generated/devkit/ngcli_adapter/wrapAngularDevkitSchematic.md b/docs/generated/devkit/ngcli_adapter/wrapAngularDevkitSchematic.md new file mode 100644 index 0000000000000..41610a07b2be6 --- /dev/null +++ b/docs/generated/devkit/ngcli_adapter/wrapAngularDevkitSchematic.md @@ -0,0 +1,27 @@ +# Function: wrapAngularDevkitSchematic + +▸ **wrapAngularDevkitSchematic**(`collectionName`, `generatorName`): (`host`: `Tree`, `generatorOptions`: { `[k: string]`: `any`; }) => `Promise`<`any`\> + +#### Parameters + +| Name | Type | +| :--------------- | :------- | +| `collectionName` | `string` | +| `generatorName` | `string` | + +#### Returns + +`fn` + +▸ (`host`, `generatorOptions`): `Promise`<`any`\> + +##### Parameters + +| Name | Type | +| :----------------- | :------- | +| `host` | `Tree` | +| `generatorOptions` | `Object` | + +##### Returns + +`Promise`<`any`\> diff --git a/docs/generated/devkit/normalizePath.md b/docs/generated/devkit/normalizePath.md new file mode 100644 index 0000000000000..5625dc2e200de --- /dev/null +++ b/docs/generated/devkit/normalizePath.md @@ -0,0 +1,15 @@ +# Function: normalizePath + +▸ **normalizePath**(`osSpecificPath`): `string` + +Coverts an os specific path to a unix style path + +#### Parameters + +| Name | Type | +| :--------------- | :------- | +| `osSpecificPath` | `string` | + +#### Returns + +`string` diff --git a/docs/generated/devkit/nx_devkit.md b/docs/generated/devkit/nx_devkit.md deleted file mode 100644 index d288ca40288b7..0000000000000 --- a/docs/generated/devkit/nx_devkit.md +++ /dev/null @@ -1,2469 +0,0 @@ -# Module: @nx/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 - -### Enumerations - -- [ChangeType](../../devkit/documents/nx_devkit#changetype) -- [DependencyType](../../devkit/documents/nx_devkit#dependencytype) - -### Classes - -- [ProjectGraphBuilder](../../devkit/documents/nx_devkit#projectgraphbuilder) -- [Workspaces](../../devkit/documents/nx_devkit#workspaces) - -### Interfaces - -- [DefaultTasksRunnerOptions](../../devkit/documents/nx_devkit#defaulttasksrunneroptions) -- [ExecutorContext](../../devkit/documents/nx_devkit#executorcontext) -- [ExecutorsJson](../../devkit/documents/nx_devkit#executorsjson) -- [FileChange](../../devkit/documents/nx_devkit#filechange) -- [FileData](../../devkit/documents/nx_devkit#filedata) -- [GeneratorsJson](../../devkit/documents/nx_devkit#generatorsjson) -- [Hash](../../devkit/documents/nx_devkit#hash) -- [HasherContext](../../devkit/documents/nx_devkit#hashercontext) -- [ImplicitJsonSubsetDependency](../../devkit/documents/nx_devkit#implicitjsonsubsetdependency) -- [JsonParseOptions](../../devkit/documents/nx_devkit#jsonparseoptions) -- [JsonSerializeOptions](../../devkit/documents/nx_devkit#jsonserializeoptions) -- [MigrationsJson](../../devkit/documents/nx_devkit#migrationsjson) -- [ModuleFederationConfig](../../devkit/documents/nx_devkit#modulefederationconfig) -- [NxAffectedConfig](../../devkit/documents/nx_devkit#nxaffectedconfig) -- [NxJsonConfiguration](../../devkit/documents/nx_devkit#nxjsonconfiguration) -- [NxPlugin](../../devkit/documents/nx_devkit#nxplugin) -- [ProjectConfiguration](../../devkit/documents/nx_devkit#projectconfiguration) -- [ProjectFileMap](../../devkit/documents/nx_devkit#projectfilemap) -- [ProjectGraph](../../devkit/documents/nx_devkit#projectgraph) -- [ProjectGraphDependency](../../devkit/documents/nx_devkit#projectgraphdependency) -- [ProjectGraphExternalNode](../../devkit/documents/nx_devkit#projectgraphexternalnode) -- [ProjectGraphProcessorContext](../../devkit/documents/nx_devkit#projectgraphprocessorcontext) -- [ProjectGraphProjectNode](../../devkit/documents/nx_devkit#projectgraphprojectnode) -- [ProjectsConfigurations](../../devkit/documents/nx_devkit#projectsconfigurations) -- [RemoteCache](../../devkit/documents/nx_devkit#remotecache) -- [SharedLibraryConfig](../../devkit/documents/nx_devkit#sharedlibraryconfig) -- [StringDeletion](../../devkit/documents/nx_devkit#stringdeletion) -- [StringInsertion](../../devkit/documents/nx_devkit#stringinsertion) -- [Target](../../devkit/documents/nx_devkit#target) -- [TargetConfiguration](../../devkit/documents/nx_devkit#targetconfiguration) -- [TargetDependencyConfig](../../devkit/documents/nx_devkit#targetdependencyconfig) -- [Task](../../devkit/documents/nx_devkit#task) -- [TaskGraph](../../devkit/documents/nx_devkit#taskgraph) -- [TaskHasher](../../devkit/documents/nx_devkit#taskhasher) -- [Tree](../../devkit/documents/nx_devkit#tree) -- [Workspace](../../devkit/documents/nx_devkit#workspace) - -### Type Aliases - -- [AdditionalSharedConfig](../../devkit/documents/nx_devkit#additionalsharedconfig) -- [CustomHasher](../../devkit/documents/nx_devkit#customhasher) -- [Executor](../../devkit/documents/nx_devkit#executor) -- [Generator](../../devkit/documents/nx_devkit#generator) -- [GeneratorCallback](../../devkit/documents/nx_devkit#generatorcallback) -- [Hasher](../../devkit/documents/nx_devkit#hasher) -- [ImplicitDependencyEntry](../../devkit/documents/nx_devkit#implicitdependencyentry) -- [ModuleFederationLibrary](../../devkit/documents/nx_devkit#modulefederationlibrary) -- [PackageManager](../../devkit/documents/nx_devkit#packagemanager) -- [ProjectGraphNode](../../devkit/documents/nx_devkit#projectgraphnode) -- [ProjectTargetConfigurator](../../devkit/documents/nx_devkit#projecttargetconfigurator) -- [ProjectType](../../devkit/documents/nx_devkit#projecttype) -- [Remotes](../../devkit/documents/nx_devkit#remotes) -- [SharedFunction](../../devkit/documents/nx_devkit#sharedfunction) -- [SharedWorkspaceLibraryConfig](../../devkit/documents/nx_devkit#sharedworkspacelibraryconfig) -- [StringChange](../../devkit/documents/nx_devkit#stringchange) -- [TaskGraphExecutor](../../devkit/documents/nx_devkit#taskgraphexecutor) -- [WorkspaceConfiguration](../../devkit/documents/nx_devkit#workspaceconfiguration) -- [WorkspaceJsonConfiguration](../../devkit/documents/nx_devkit#workspacejsonconfiguration) -- [WorkspaceLibrary](../../devkit/documents/nx_devkit#workspacelibrary) -- [WorkspaceLibrarySecondaryEntryPoint](../../devkit/documents/nx_devkit#workspacelibrarysecondaryentrypoint) - -### Variables - -- [NX_VERSION](../../devkit/documents/nx_devkit#nx_version) -- [appRootPath](../../devkit/documents/nx_devkit#approotpath) -- [cacheDir](../../devkit/documents/nx_devkit#cachedir) -- [logger](../../devkit/documents/nx_devkit#logger) -- [output](../../devkit/documents/nx_devkit#output) -- [workspaceRoot](../../devkit/documents/nx_devkit#workspaceroot) - -### Functions - -- [addDependenciesToPackageJson](../../devkit/documents/nx_devkit#adddependenciestopackagejson) -- [addProjectConfiguration](../../devkit/documents/nx_devkit#addprojectconfiguration) -- [applyAdditionalShared](../../devkit/documents/nx_devkit#applyadditionalshared) -- [applyChangesToString](../../devkit/documents/nx_devkit#applychangestostring) -- [applySharedFunction](../../devkit/documents/nx_devkit#applysharedfunction) -- [convertNxExecutor](../../devkit/documents/nx_devkit#convertnxexecutor) -- [convertNxGenerator](../../devkit/documents/nx_devkit#convertnxgenerator) -- [createProjectFileMapUsingProjectGraph](../../devkit/documents/nx_devkit#createprojectfilemapusingprojectgraph) -- [createProjectGraphAsync](../../devkit/documents/nx_devkit#createprojectgraphasync) -- [defaultTasksRunner](../../devkit/documents/nx_devkit#defaulttasksrunner) -- [detectPackageManager](../../devkit/documents/nx_devkit#detectpackagemanager) -- [ensurePackage](../../devkit/documents/nx_devkit#ensurepackage) -- [extractLayoutDirectory](../../devkit/documents/nx_devkit#extractlayoutdirectory) -- [formatFiles](../../devkit/documents/nx_devkit#formatfiles) -- [generateFiles](../../devkit/documents/nx_devkit#generatefiles) -- [getDependentPackagesForProject](../../devkit/documents/nx_devkit#getdependentpackagesforproject) -- [getNpmPackageSharedConfig](../../devkit/documents/nx_devkit#getnpmpackagesharedconfig) -- [getOutputsForTargetAndConfiguration](../../devkit/documents/nx_devkit#getoutputsfortargetandconfiguration) -- [getPackageManagerCommand](../../devkit/documents/nx_devkit#getpackagemanagercommand) -- [getPackageManagerVersion](../../devkit/documents/nx_devkit#getpackagemanagerversion) -- [getProjects](../../devkit/documents/nx_devkit#getprojects) -- [getWorkspaceLayout](../../devkit/documents/nx_devkit#getworkspacelayout) -- [getWorkspacePath](../../devkit/documents/nx_devkit#getworkspacepath) -- [hashArray](../../devkit/documents/nx_devkit#hasharray) -- [installPackagesTask](../../devkit/documents/nx_devkit#installpackagestask) -- [isStandaloneProject](../../devkit/documents/nx_devkit#isstandaloneproject) -- [joinPathFragments](../../devkit/documents/nx_devkit#joinpathfragments) -- [mapRemotes](../../devkit/documents/nx_devkit#mapremotes) -- [mapRemotesForSSR](../../devkit/documents/nx_devkit#mapremotesforssr) -- [moveFilesToNewDirectory](../../devkit/documents/nx_devkit#movefilestonewdirectory) -- [names](../../devkit/documents/nx_devkit#names) -- [normalizePath](../../devkit/documents/nx_devkit#normalizepath) -- [offsetFromRoot](../../devkit/documents/nx_devkit#offsetfromroot) -- [parseJson](../../devkit/documents/nx_devkit#parsejson) -- [parseTargetString](../../devkit/documents/nx_devkit#parsetargetstring) -- [readAllWorkspaceConfiguration](../../devkit/documents/nx_devkit#readallworkspaceconfiguration) -- [readCachedProjectGraph](../../devkit/documents/nx_devkit#readcachedprojectgraph) -- [readJson](../../devkit/documents/nx_devkit#readjson) -- [readJsonFile](../../devkit/documents/nx_devkit#readjsonfile) -- [readNxJson](../../devkit/documents/nx_devkit#readnxjson) -- [readProjectConfiguration](../../devkit/documents/nx_devkit#readprojectconfiguration) -- [readRootPackageJson](../../devkit/documents/nx_devkit#readrootpackagejson) -- [readTargetOptions](../../devkit/documents/nx_devkit#readtargetoptions) -- [readWorkspaceConfiguration](../../devkit/documents/nx_devkit#readworkspaceconfiguration) -- [removeDependenciesFromPackageJson](../../devkit/documents/nx_devkit#removedependenciesfrompackagejson) -- [removeProjectConfiguration](../../devkit/documents/nx_devkit#removeprojectconfiguration) -- [reverse](../../devkit/documents/nx_devkit#reverse) -- [runExecutor](../../devkit/documents/nx_devkit#runexecutor) -- [runTasksInSerial](../../devkit/documents/nx_devkit#runtasksinserial) -- [serializeJson](../../devkit/documents/nx_devkit#serializejson) -- [sharePackages](../../devkit/documents/nx_devkit#sharepackages) -- [shareWorkspaceLibraries](../../devkit/documents/nx_devkit#shareworkspacelibraries) -- [stripIndents](../../devkit/documents/nx_devkit#stripindents) -- [stripJsonComments](../../devkit/documents/nx_devkit#stripjsoncomments) -- [targetToTargetString](../../devkit/documents/nx_devkit#targettotargetstring) -- [toJS](../../devkit/documents/nx_devkit#tojs) -- [updateJson](../../devkit/documents/nx_devkit#updatejson) -- [updateNxJson](../../devkit/documents/nx_devkit#updatenxjson) -- [updateProjectConfiguration](../../devkit/documents/nx_devkit#updateprojectconfiguration) -- [updateTsConfigsToJs](../../devkit/documents/nx_devkit#updatetsconfigstojs) -- [updateWorkspaceConfiguration](../../devkit/documents/nx_devkit#updateworkspaceconfiguration) -- [visitNotIgnoredFiles](../../devkit/documents/nx_devkit#visitnotignoredfiles) -- [workspaceLayout](../../devkit/documents/nx_devkit#workspacelayout) -- [writeJson](../../devkit/documents/nx_devkit#writejson) -- [writeJsonFile](../../devkit/documents/nx_devkit#writejsonfile) - -## Enumerations - -### ChangeType - -• **ChangeType**: `Object` - ---- - -### DependencyType - -• **DependencyType**: `Object` - -Type of dependency between projects - -## Classes - -### ProjectGraphBuilder - -• **ProjectGraphBuilder**: `Object` - ---- - -### Workspaces - -• **Workspaces**: `Object` - -## Interfaces - -### DefaultTasksRunnerOptions - -• **DefaultTasksRunnerOptions**: `Object` - ---- - -### ExecutorContext - -• **ExecutorContext**: `Object` - -Context that is passed into an executor - ---- - -### ExecutorsJson - -• **ExecutorsJson**: `Object` - ---- - -### FileChange - -• **FileChange**: `Object` - -Description of a file change in the Nx virtual file system/ - ---- - -### FileData - -• **FileData**: `Object` - -Some metadata about a file - ---- - -### GeneratorsJson - -• **GeneratorsJson**: `Object` - ---- - -### Hash - -• **Hash**: `Object` - -A data structure returned by the default hasher. - ---- - -### HasherContext - -• **HasherContext**: `Object` - ---- - -### ImplicitJsonSubsetDependency - -• **ImplicitJsonSubsetDependency**<`T`\>: `Object` - -#### Type parameters - -| Name | Type | -| :--- | :------------------ | -| `T` | `"*"` \| `string`[] | - ---- - -### JsonParseOptions - -• **JsonParseOptions**: `Object` - ---- - -### JsonSerializeOptions - -• **JsonSerializeOptions**: `Object` - ---- - -### MigrationsJson - -• **MigrationsJson**: `Object` - ---- - -### ModuleFederationConfig - -• **ModuleFederationConfig**: `Object` - ---- - -### NxAffectedConfig - -• **NxAffectedConfig**: `Object` - ---- - -### NxJsonConfiguration - -• **NxJsonConfiguration**<`T`\>: `Object` - -Nx.json configuration - -@note: when adding properties here add them to `allowedWorkspaceExtensions` in adapter/compat.ts - -#### Type parameters - -| Name | Type | -| :--- | :------------------ | -| `T` | `"*"` \| `string`[] | - ---- - -### NxPlugin - -• **NxPlugin**: `Object` - -A plugin for Nx - ---- - -### ProjectConfiguration - -• **ProjectConfiguration**: `Object` - -Project configuration - -@note: when adding properties here add them to `allowedProjectExtensions` in adapter/compat.ts - ---- - -### ProjectFileMap - -• **ProjectFileMap**: `Object` - -A list of files separated by the project they belong to - ---- - -### ProjectGraph - -• **ProjectGraph**: `Object` - -A Graph of projects in the workspace and dependencies between them - ---- - -### ProjectGraphDependency - -• **ProjectGraphDependency**: `Object` - -A dependency between two projects - ---- - -### ProjectGraphExternalNode - -• **ProjectGraphExternalNode**: `Object` - -A node describing an external dependency -`name` has as form of: - -- `npm:packageName` for root dependencies or -- `npm:packageName@version` for nested transitive dependencies - -This is vital for our node discovery to always point to root dependencies, -while allowing tracking of the full tree of different nested versions - ---- - -### ProjectGraphProcessorContext - -• **ProjectGraphProcessorContext**: `Object` - -Additional information to be used to process a project graph - ---- - -### ProjectGraphProjectNode - -• **ProjectGraphProjectNode**: `Object` - -A node describing a project in a workspace - ---- - -### ProjectsConfigurations - -• **ProjectsConfigurations**: `Object` - -Projects Configurations -@note: when adding properties here add them to `allowedWorkspaceExtensions` in adapter/compat.ts - ---- - -### RemoteCache - -• **RemoteCache**: `Object` - ---- - -### SharedLibraryConfig - -• **SharedLibraryConfig**: `Object` - ---- - -### StringDeletion - -• **StringDeletion**: `Object` - ---- - -### StringInsertion - -• **StringInsertion**: `Object` - ---- - -### Target - -• **Target**: `Object` - ---- - -### TargetConfiguration - -• **TargetConfiguration**<`T`\>: `Object` - -Target's configuration - -#### Type parameters - -| Name | Type | -| :--- | :---- | -| `T` | `any` | - ---- - -### TargetDependencyConfig - -• **TargetDependencyConfig**: `Object` - ---- - -### Task - -• **Task**: `Object` - -A representation of the invocation of an Executor - ---- - -### TaskGraph - -• **TaskGraph**: `Object` - -Graph of Tasks to be executed - ---- - -### TaskHasher - -• **TaskHasher**: `Object` - ---- - -### Tree - -• **Tree**: `Object` - -Virtual file system tree. - ---- - -### Workspace - -• **Workspace**: `Object` - -**`Deprecated`** - -use ProjectsConfigurations or NxJsonConfiguration - -## Type Aliases - -### AdditionalSharedConfig - -Ƭ **AdditionalSharedConfig**: (`string` \| [libraryName: string, sharedConfig: SharedLibraryConfig] \| { `libraryName`: `string` ; `sharedConfig`: [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig) })[] - ---- - -### CustomHasher - -Ƭ **CustomHasher**: (`task`: [`Task`](../../devkit/documents/nx_devkit#task), `context`: [`HasherContext`](../../devkit/documents/nx_devkit#hashercontext)) => `Promise`<[`Hash`](../../devkit/documents/nx_devkit#hash)\> - -#### Type declaration - -▸ (`task`, `context`): `Promise`<[`Hash`](../../devkit/documents/nx_devkit#hash)\> - -##### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------- | -| `task` | [`Task`](../../devkit/documents/nx_devkit#task) | -| `context` | [`HasherContext`](../../devkit/documents/nx_devkit#hashercontext) | - -##### Returns - -`Promise`<[`Hash`](../../devkit/documents/nx_devkit#hash)\> - ---- - -### Executor - -Ƭ **Executor**<`T`\>: (`options`: `T`, `context`: [`ExecutorContext`](../../devkit/documents/nx_devkit#executorcontext)) => `Promise`<{ `success`: `boolean` }\> \| `AsyncIterableIterator`<{ `success`: `boolean` }\> - -#### Type parameters - -| Name | Type | -| :--- | :---- | -| `T` | `any` | - -#### Type declaration - -▸ (`options`, `context`): `Promise`<{ `success`: `boolean` }\> \| `AsyncIterableIterator`<{ `success`: `boolean` }\> - -Implementation of a target of a project - -##### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------- | -| `options` | `T` | -| `context` | [`ExecutorContext`](../../devkit/documents/nx_devkit#executorcontext) | - -##### Returns - -`Promise`<{ `success`: `boolean` }\> \| `AsyncIterableIterator`<{ `success`: `boolean` }\> - ---- - -### Generator - -Ƭ **Generator**<`T`\>: (`tree`: `any`, `schema`: `T`) => `void` \| [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback)\> - -#### Type parameters - -| Name | Type | -| :--- | :-------- | -| `T` | `unknown` | - -#### Type declaration - -▸ (`tree`, `schema`): `void` \| [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/documents/nx_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/nx_devkit#generatorcallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/documents/nx_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`\> - ---- - -### Hasher - -Ƭ **Hasher**: [`TaskHasher`](../../devkit/documents/nx_devkit#taskhasher) - ---- - -### ImplicitDependencyEntry - -Ƭ **ImplicitDependencyEntry**<`T`\>: `Object` - -#### Type parameters - -| Name | Type | -| :--- | :------------------ | -| `T` | `"*"` \| `string`[] | - -#### Index signature - -▪ [key: `string`]: `T` \| [`ImplicitJsonSubsetDependency`](../../devkit/documents/nx_devkit#implicitjsonsubsetdependency)<`T`\> - ---- - -### ModuleFederationLibrary - -Ƭ **ModuleFederationLibrary**: `Object` - -#### Type declaration - -| Name | Type | -| :----- | :------- | -| `name` | `string` | -| `type` | `string` | - ---- - -### PackageManager - -Ƭ **PackageManager**: `"yarn"` \| `"pnpm"` \| `"npm"` - ---- - -### ProjectGraphNode - -Ƭ **ProjectGraphNode**: [`ProjectGraphProjectNode`](../../devkit/documents/nx_devkit#projectgraphprojectnode) \| [`ProjectGraphExternalNode`](../../devkit/documents/nx_devkit#projectgraphexternalnode) - -**`Deprecated`** - -this type will be removed in v16. Use [ProjectGraphProjectNode](../../devkit/documents/nx_devkit#projectgraphprojectnode) or [ProjectGraphExternalNode](../../devkit/documents/nx_devkit#projectgraphexternalnode) instead - ---- - -### ProjectTargetConfigurator - -Ƭ **ProjectTargetConfigurator**: (`file`: `string`) => `Record`<`string`, [`TargetConfiguration`](../../devkit/documents/nx_devkit#targetconfiguration)\> - -#### Type declaration - -▸ (`file`): `Record`<`string`, [`TargetConfiguration`](../../devkit/documents/nx_devkit#targetconfiguration)\> - -##### Parameters - -| Name | Type | -| :----- | :------- | -| `file` | `string` | - -##### Returns - -`Record`<`string`, [`TargetConfiguration`](../../devkit/documents/nx_devkit#targetconfiguration)\> - ---- - -### ProjectType - -Ƭ **ProjectType**: `"library"` \| `"application"` - -Type of project supported - ---- - -### Remotes - -Ƭ **Remotes**: `string`[] \| [remoteName: string, remoteUrl: string][] - ---- - -### SharedFunction - -Ƭ **SharedFunction**: (`libraryName`: `string`, `sharedConfig`: [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig)) => `undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig) - -#### Type declaration - -▸ (`libraryName`, `sharedConfig`): `undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig) - -##### Parameters - -| Name | Type | -| :------------- | :---------------------------------------------------------------------------- | -| `libraryName` | `string` | -| `sharedConfig` | [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig) | - -##### Returns - -`undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig) - ---- - -### SharedWorkspaceLibraryConfig - -Ƭ **SharedWorkspaceLibraryConfig**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------- | :-------------------------------------------------------------------------------------------------------------------------- | -| `getAliases` | () => `Record`<`string`, `string`\> | -| `getLibraries` | (`eager?`: `boolean`) => `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig)\> | -| `getReplacementPlugin` | () => `NormalModuleReplacementPlugin` | - ---- - -### StringChange - -Ƭ **StringChange**: [`StringInsertion`](../../devkit/documents/nx_devkit#stringinsertion) \| [`StringDeletion`](../../devkit/documents/nx_devkit#stringdeletion) - -A change to be made to a string - ---- - -### TaskGraphExecutor - -Ƭ **TaskGraphExecutor**<`T`\>: (`taskGraph`: [`TaskGraph`](../../devkit/documents/nx_devkit#taskgraph), `options`: `Record`<`string`, `T`\>, `overrides`: `T`, `context`: [`ExecutorContext`](../../devkit/documents/nx_devkit#executorcontext)) => `Promise`<`BatchExecutorResult` \| `AsyncIterableIterator`<`BatchExecutorTaskResult`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---- | -| `T` | `any` | - -#### Type declaration - -▸ (`taskGraph`, `options`, `overrides`, `context`): `Promise`<`BatchExecutorResult` \| `AsyncIterableIterator`<`BatchExecutorTaskResult`\>\> - -Implementation of a target of a project that handles multiple projects to be batched - -##### Parameters - -| Name | Type | -| :---------- | :-------------------------------------------------------------------- | -| `taskGraph` | [`TaskGraph`](../../devkit/documents/nx_devkit#taskgraph) | -| `options` | `Record`<`string`, `T`\> | -| `overrides` | `T` | -| `context` | [`ExecutorContext`](../../devkit/documents/nx_devkit#executorcontext) | - -##### Returns - -`Promise`<`BatchExecutorResult` \| `AsyncIterableIterator`<`BatchExecutorTaskResult`\>\> - ---- - -### WorkspaceConfiguration - -Ƭ **WorkspaceConfiguration**: `Omit`<[`ProjectsConfigurations`](../../devkit/documents/nx_devkit#projectsconfigurations), `"projects"`\> & `Partial`<[`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration)\> - -**`Deprecated`** - -using NxJsonConfiguration - ---- - -### WorkspaceJsonConfiguration - -Ƭ **WorkspaceJsonConfiguration**: [`ProjectsConfigurations`](../../devkit/documents/nx_devkit#projectsconfigurations) - -**`Deprecated`** - -use ProjectsConfigurations - ---- - -### 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` | - -## Variables - -### NX_VERSION - -• `Const` **NX_VERSION**: `string` - -**`Description`** - -The version of Nx used by the workspace. Returns null if no version is found. - ---- - -### appRootPath - -• `Const` **appRootPath**: `string` = `workspaceRoot` - -The root of the workspace. - -**`Deprecated`** - -use workspaceRoot instead - ---- - -### cacheDir - -• `Const` **cacheDir**: `string` - -Path to the directory where Nx stores its cache and daemon-related files. - ---- - -### logger - -• `Const` **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` | - ---- - -### output - -• `Const` **output**: `CLIOutput` - ---- - -### workspaceRoot - -• **workspaceRoot**: `string` - -The root of the workspace - -## Functions - -### addDependenciesToPackageJson - -▸ **addDependenciesToPackageJson**(`tree`, `dependencies`, `devDependencies`, `packageJsonPath?`): [`GeneratorCallback`](../../devkit/documents/nx_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/nx_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/nx_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/nx_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/nx_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/nx_devkit#sharedlibraryconfig)\> | The original Shared Config | -| `additionalShared` | [`AdditionalSharedConfig`](../../devkit/documents/nx_devkit#additionalsharedconfig) | The additional dependencies to add | -| `projectGraph` | [`ProjectGraph`](../../devkit/documents/nx_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/nx_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/nx_devkit#sharedlibraryconfig)\> | The original Shared Config to be modified | -| `sharedFn` | [`SharedFunction`](../../devkit/documents/nx_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/nx_devkit#executor) | - -#### 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/nx_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`\> - ---- - -### createProjectFileMapUsingProjectGraph - -▸ **createProjectFileMapUsingProjectGraph**(`graph`): `Promise`<[`ProjectFileMap`](../../devkit/documents/nx_devkit#projectfilemap)\> - -#### Parameters - -| Name | Type | -| :------ | :-------------------------------------------------------------- | -| `graph` | [`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph) | - -#### Returns - -`Promise`<[`ProjectFileMap`](../../devkit/documents/nx_devkit#projectfilemap)\> - ---- - -### createProjectGraphAsync - -▸ **createProjectGraphAsync**(`opts?`): `Promise`<[`ProjectGraph`](../../devkit/documents/nx_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/nx_devkit#projectgraph)\> - ---- - -### defaultTasksRunner - -▸ **defaultTasksRunner**(`tasks`, `options`, `context?`): `any` - -`any | Promise<{ [id: string]: TaskStatus }>` -will change to Promise<{ [id: string]: TaskStatus }> after Nx 15 is released. - -#### Parameters - -| Name | Type | -| :--------------------------- | :-------------------------------------------------------------------------------------------------- | -| `tasks` | [`Task`](../../devkit/documents/nx_devkit#task)[] | -| `options` | [`DefaultTasksRunnerOptions`](../../devkit/documents/nx_devkit#defaulttasksrunneroptions) | -| `context?` | `Object` | -| `context.daemon?` | `DaemonClient` | -| `context.hasher?` | [`TaskHasher`](../../devkit/documents/nx_devkit#taskhasher) | -| `context.initiatingProject?` | `string` | -| `context.nxArgs` | `NxArgs` | -| `context.nxJson` | [`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration)<`string`[] \| `"*"`\> | -| `context.projectGraph` | [`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph) | -| `context.target?` | `string` | -| `context.taskGraph?` | [`TaskGraph`](../../devkit/documents/nx_devkit#taskgraph) | - -#### Returns - -`any` - ---- - -### detectPackageManager - -▸ **detectPackageManager**(`dir?`): [`PackageManager`](../../devkit/documents/nx_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/nx_devkit#packagemanager) - ---- - -### ensurePackage - -▸ **ensurePackage**(`tree`, `pkg`, `requiredVersion`, `options?`): `void` - -**`Deprecated`** - -Use the other function signature without a Tree - -Use a package that has not been installed as a dependency. - -For example: - -```typescript -ensurePackage(tree, '@nx/jest', nxVersion); -``` - -This install the @nx/jest@ and return the module -When running with --dryRun, the function will throw when dependencies are missing. -Returns null for ESM dependencies. Import them with a dynamic import instead. - -#### Parameters - -| Name | Type | Description | -| :------------------------ | :---------------------------------------------- | :----------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | the file system tree | -| `pkg` | `string` | the package to check (e.g. @nx/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` - -▸ **ensurePackage**<`T`\>(`pkg`, `version`): `T` - -Ensure that dependencies and devDependencies from package.json are installed at the required versions. -Returns null for ESM dependencies. Import them with a dynamic import instead. - -For example: - -```typescript -ensurePackage('@nx/jest', nxVersion); -``` - -#### Type parameters - -| Name | Type | -| :--- | :------------------------ | -| `T` | extends `unknown` = `any` | - -#### Parameters - -| Name | Type | Description | -| :-------- | :------- | :---------------------------------------------------------- | -| `pkg` | `string` | the package to install and require | -| `version` | `string` | the version to install if the package doesn't exist already | - -#### Returns - -`T` - ---- - -### 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/nx_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/nx_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/nx_devkit#projectgraph) | -| `name` | `string` | - -#### Returns - -`Object` - -| Name | Type | -| :------------------- | :------------------------------------------------------------------------ | -| `npmPackages` | `string`[] | -| `workspaceLibraries` | [`WorkspaceLibrary`](../../devkit/documents/nx_devkit#workspacelibrary)[] | - ---- - -### getNpmPackageSharedConfig - -▸ **getNpmPackageSharedConfig**(`pkgName`, `version`): [`SharedLibraryConfig`](../../devkit/documents/nx_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/nx_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/nx_devkit#task), `"overrides"` \| `"target"`\> | target + overrides | -| `node` | [`ProjectGraphProjectNode`](../../devkit/documents/nx_devkit#projectgraphprojectnode) | ProjectGraphProjectNode object that the task runs against | - -#### Returns - -`string`[] - ---- - -### getPackageManagerCommand - -▸ **getPackageManagerCommand**(`packageManager?`, `root?`): `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 | Default value | Description | -| :--------------- | :------------------------------------------------------------------ | :-------------- | :------------------------------------------------------------------------------------------ | -| `packageManager` | [`PackageManager`](../../devkit/documents/nx_devkit#packagemanager) | `undefined` | The package manager to use. If not provided, it will be detected based on the lock file. | -| `root` | `string` | `workspaceRoot` | The directory the commands will be ran inside of. Defaults to the current workspace's root. | - -#### Returns - -`PackageManagerCommands` - ---- - -### getPackageManagerVersion - -▸ **getPackageManagerVersion**(`packageManager?`, `cwd?`): `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/nx_devkit#packagemanager) | -| `cwd` | `string` | - -#### Returns - -`string` - ---- - -### getProjects - -▸ **getProjects**(`tree`): `Map`<`string`, [`ProjectConfiguration`](../../devkit/documents/nx_devkit#projectconfiguration)\> - -Get a map of all projects in a workspace. - -Use [readProjectConfiguration](../../devkit/documents/nx_devkit#readprojectconfiguration) if only one project is needed. - -#### Parameters - -| Name | Type | -| :----- | :---------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | - -#### Returns - -`Map`<`string`, [`ProjectConfiguration`](../../devkit/documents/nx_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/nx_devkit#tree) | file system tree | - -#### Returns - -`Object` - -| Name | Type | Description | -| :-------------------- | :-------- | :----------------------------------------------------------------------- | -| `appsDir` | `string` | - | -| `libsDir` | `string` | - | -| `npmScope` | `string` | **`Deprecated`** This will be removed in Nx 17. Use getNpmScope instead. | -| `standaloneAsDefault` | `boolean` | - | - ---- - -### getWorkspacePath - -▸ **getWorkspacePath**(`tree`): `"angular.json"` \| `"workspace.json"` - -**`Deprecated`** - -all projects are configured using project.json - -#### Parameters - -| Name | Type | -| :----- | :---------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | - -#### Returns - -`"angular.json"` \| `"workspace.json"` - ---- - -### hashArray - -▸ **hashArray**(`content`): `string` - -#### Parameters - -| Name | Type | -| :-------- | :--------- | -| `content` | `string`[] | - -#### Returns - -`string` - ---- - -### 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/nx_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/nx_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/nx_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/nx_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/nx_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/nx_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/nx_devkit#jsonparseoptions) | JSON parse options | - -#### Returns - -`T` - -Object the JSON content represents - ---- - -### parseTargetString - -▸ **parseTargetString**(`targetString`): [`Target`](../../devkit/documents/nx_devkit#target) - -@deprecated(v17) A project graph should be passed to parseTargetString for best accuracy. - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `targetString` | `string` | - -#### Returns - -[`Target`](../../devkit/documents/nx_devkit#target) - -▸ **parseTargetString**(`targetString`, `projectGraph`): [`Target`](../../devkit/documents/nx_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/nx_devkit#projectgraph) | - | - -#### Returns - -[`Target`](../../devkit/documents/nx_devkit#target) - ---- - -### readAllWorkspaceConfiguration - -▸ **readAllWorkspaceConfiguration**(): [`ProjectsConfigurations`](../../devkit/documents/nx_devkit#projectsconfigurations) & [`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration) - -**`Deprecated`** - -Use readProjectsConfigurationFromProjectGraph(await createProjectGraphAsync()) - -#### Returns - -[`ProjectsConfigurations`](../../devkit/documents/nx_devkit#projectsconfigurations) & [`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration) - ---- - -### readCachedProjectGraph - -▸ **readCachedProjectGraph**(): [`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph) - -Synchronously reads the latest cached copy of the workspace's ProjectGraph. - -**`Throws`** - -if there is no cached ProjectGraph to read from - -#### Returns - -[`ProjectGraph`](../../devkit/documents/nx_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/nx_devkit#tree) | file system tree | -| `path` | `string` | file path | -| `options?` | [`JsonParseOptions`](../../devkit/documents/nx_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/nx_devkit#nxjsonconfiguration) \| `null` - -**`Deprecated`** - -You must pass a [Tree](../../devkit/documents/nx_devkit#tree) - -#### Returns - -[`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration) \| `null` - -▸ **readNxJson**(`tree`): [`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration) \| `null` - -Reads nx.json - -#### Parameters - -| Name | Type | -| :----- | :---------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | - -#### Returns - -[`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration) \| `null` - ---- - -### readProjectConfiguration - -▸ **readProjectConfiguration**(`tree`, `projectName`): [`ProjectConfiguration`](../../devkit/documents/nx_devkit#projectconfiguration) - -Reads a project configuration. - -**`Throws`** - -If supplied projectName cannot be found - -#### Parameters - -| Name | Type | Description | -| :------------ | :---------------------------------------------- | :---------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nx_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/nx_devkit#projectconfiguration) - ---- - -### readRootPackageJson - -▸ **readRootPackageJson**(): `Object` - -#### Returns - -`Object` - -| Name | Type | -| :----------------- | :----------------------------- | -| `dependencies?` | { `[key: string]`: `string`; } | -| `devDependencies?` | { `[key: string]`: `string`; } | - ---- - -### readTargetOptions - -▸ **readTargetOptions**<`T`\>(`«destructured»`, `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 | -| :--------------- | :-------------------------------------------------------------------- | -| `«destructured»` | [`Target`](../../devkit/documents/nx_devkit#target) | -| `context` | [`ExecutorContext`](../../devkit/documents/nx_devkit#executorcontext) | - -#### Returns - -`T` - ---- - -### readWorkspaceConfiguration - -▸ **readWorkspaceConfiguration**(`tree`): [`WorkspaceConfiguration`](../../devkit/documents/nx_devkit#workspaceconfiguration) - -Read general workspace configuration such as the default project or cli settings - -This does _not_ provide projects configuration, use [readProjectConfiguration](../../devkit/documents/nx_devkit#readprojectconfiguration) instead. - -**`Deprecated`** - -use readNxJson - -#### Parameters - -| Name | Type | -| :----- | :---------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | - -#### Returns - -[`WorkspaceConfiguration`](../../devkit/documents/nx_devkit#workspaceconfiguration) - ---- - -### removeDependenciesFromPackageJson - -▸ **removeDependenciesFromPackageJson**(`tree`, `dependencies`, `devDependencies`, `packageJsonPath?`): [`GeneratorCallback`](../../devkit/documents/nx_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/nx_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/nx_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/nx_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/nx_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/nx_devkit#projectgraph) | - -#### Returns - -[`ProjectGraph`](../../devkit/documents/nx_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` | [`Target`](../../devkit/documents/nx_devkit#target) | -| `overrides` | `Object` | -| `context` | [`ExecutorContext`](../../devkit/documents/nx_devkit#executorcontext) | - -#### Returns - -`Promise`<`AsyncIterableIterator`<`T`\>\> - ---- - -### runTasksInSerial - -▸ **runTasksInSerial**(`...tasks`): [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) - -Run tasks in serial - -#### Parameters - -| Name | Type | Description | -| :--------- | :-------------------------------------------------------------------------- | :-------------------------- | -| `...tasks` | [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback)[] | The tasks to run in serial. | - -#### Returns - -[`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) - ---- - -### 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/nx_devkit#jsonserializeoptions) | JSON serialize options | - -#### Returns - -`string` - -the formatted JSON representation of the object - ---- - -### sharePackages - -▸ **sharePackages**(`packages`): `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nx_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/nx_devkit#sharedlibraryconfig)\> - ---- - -### shareWorkspaceLibraries - -▸ **shareWorkspaceLibraries**(`libraries`, `tsConfigPath?`): [`SharedWorkspaceLibraryConfig`](../../devkit/documents/nx_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/nx_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/nx_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 - -▸ **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/nx_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/nx_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/nx_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/nx_devkit#jsonparseoptions) & [`JsonSerializeOptions`](../../devkit/documents/nx_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/nx_devkit#tree) | -| `nxJson` | [`NxJsonConfiguration`](../../devkit/documents/nx_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/nx_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/nx_devkit#projectconfiguration) | project configuration | - -#### Returns - -`void` - ---- - -### updateTsConfigsToJs - -▸ **updateTsConfigsToJs**(`tree`, `options`): `void` - -#### Parameters - -| Name | Type | -| :-------------------- | :---------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nx_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/nx_devkit#updateprojectconfiguration) or [addProjectConfiguration](../../devkit/documents/nx_devkit#addprojectconfiguration) instead. - -**`Deprecated`** - -use updateNxJson - -#### Parameters - -| Name | Type | -| :---------------- | :---------------------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | -| `workspaceConfig` | [`WorkspaceConfiguration`](../../devkit/documents/nx_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/nx_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/nx_devkit#tree) | File system tree | -| `path` | `string` | Path of JSON file in the Tree | -| `value` | `T` | Serializable value to write | -| `options?` | [`JsonSerializeOptions`](../../devkit/documents/nx_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/devkit/offsetFromRoot.md b/docs/generated/devkit/offsetFromRoot.md new file mode 100644 index 0000000000000..5acd660495058 --- /dev/null +++ b/docs/generated/devkit/offsetFromRoot.md @@ -0,0 +1,22 @@ +# Function: 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` diff --git a/docs/generated/devkit/output.md b/docs/generated/devkit/output.md new file mode 100644 index 0000000000000..b92a2e23f5e11 --- /dev/null +++ b/docs/generated/devkit/output.md @@ -0,0 +1,3 @@ +# Variable: output + +• `Const` **output**: `CLIOutput` diff --git a/docs/generated/devkit/parseJson.md b/docs/generated/devkit/parseJson.md new file mode 100644 index 0000000000000..9a735e6810aee --- /dev/null +++ b/docs/generated/devkit/parseJson.md @@ -0,0 +1,25 @@ +# Function: 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/JsonParseOptions) | JSON parse options | + +#### Returns + +`T` + +Object the JSON content represents diff --git a/docs/generated/devkit/parseTargetString.md b/docs/generated/devkit/parseTargetString.md new file mode 100644 index 0000000000000..de6b54560d7d8 --- /dev/null +++ b/docs/generated/devkit/parseTargetString.md @@ -0,0 +1,37 @@ +# Function: parseTargetString + +▸ **parseTargetString**(`targetString`): [`Target`](../../devkit/documents/Target) + +@deprecated(v17) A project graph should be passed to parseTargetString for best accuracy. + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `targetString` | `string` | + +#### Returns + +[`Target`](../../devkit/documents/Target) + +▸ **parseTargetString**(`targetString`, `projectGraph`): [`Target`](../../devkit/documents/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/ProjectGraph) | - | + +#### Returns + +[`Target`](../../devkit/documents/Target) diff --git a/docs/generated/devkit/readAllWorkspaceConfiguration.md b/docs/generated/devkit/readAllWorkspaceConfiguration.md new file mode 100644 index 0000000000000..309682dcd6600 --- /dev/null +++ b/docs/generated/devkit/readAllWorkspaceConfiguration.md @@ -0,0 +1,11 @@ +# Function: readAllWorkspaceConfiguration + +▸ **readAllWorkspaceConfiguration**(): [`ProjectsConfigurations`](../../devkit/documents/ProjectsConfigurations) & [`NxJsonConfiguration`](../../devkit/documents/NxJsonConfiguration) + +**`Deprecated`** + +Use readProjectsConfigurationFromProjectGraph(await createProjectGraphAsync()) + +#### Returns + +[`ProjectsConfigurations`](../../devkit/documents/ProjectsConfigurations) & [`NxJsonConfiguration`](../../devkit/documents/NxJsonConfiguration) diff --git a/docs/generated/devkit/readCachedProjectGraph.md b/docs/generated/devkit/readCachedProjectGraph.md new file mode 100644 index 0000000000000..29438ba344b6f --- /dev/null +++ b/docs/generated/devkit/readCachedProjectGraph.md @@ -0,0 +1,13 @@ +# Function: readCachedProjectGraph + +▸ **readCachedProjectGraph**(): [`ProjectGraph`](../../devkit/documents/ProjectGraph) + +Synchronously reads the latest cached copy of the workspace's ProjectGraph. + +**`Throws`** + +if there is no cached ProjectGraph to read from + +#### Returns + +[`ProjectGraph`](../../devkit/documents/ProjectGraph) diff --git a/docs/generated/devkit/readJson.md b/docs/generated/devkit/readJson.md new file mode 100644 index 0000000000000..c5a648bf900f0 --- /dev/null +++ b/docs/generated/devkit/readJson.md @@ -0,0 +1,23 @@ +# Function: 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/Tree) | file system tree | +| `path` | `string` | file path | +| `options?` | [`JsonParseOptions`](../../devkit/documents/JsonParseOptions) | Optional JSON Parse Options | + +#### Returns + +`T` diff --git a/docs/generated/devkit/readJsonFile.md b/docs/generated/devkit/readJsonFile.md new file mode 100644 index 0000000000000..7597ec82f37b5 --- /dev/null +++ b/docs/generated/devkit/readJsonFile.md @@ -0,0 +1,24 @@ +# Function: 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 diff --git a/docs/generated/devkit/readNxJson.md b/docs/generated/devkit/readNxJson.md new file mode 100644 index 0000000000000..84c5949d11ced --- /dev/null +++ b/docs/generated/devkit/readNxJson.md @@ -0,0 +1,25 @@ +# Function: readNxJson + +▸ **readNxJson**(): [`NxJsonConfiguration`](../../devkit/documents/NxJsonConfiguration) \| `null` + +**`Deprecated`** + +You must pass a [Tree](../../devkit/documents/Tree) + +#### Returns + +[`NxJsonConfiguration`](../../devkit/documents/NxJsonConfiguration) \| `null` + +▸ **readNxJson**(`tree`): [`NxJsonConfiguration`](../../devkit/documents/NxJsonConfiguration) \| `null` + +Reads nx.json + +#### Parameters + +| Name | Type | +| :----- | :------------------------------------ | +| `tree` | [`Tree`](../../devkit/documents/Tree) | + +#### Returns + +[`NxJsonConfiguration`](../../devkit/documents/NxJsonConfiguration) \| `null` diff --git a/docs/generated/devkit/readProjectConfiguration.md b/docs/generated/devkit/readProjectConfiguration.md new file mode 100644 index 0000000000000..73bf85b6aecc7 --- /dev/null +++ b/docs/generated/devkit/readProjectConfiguration.md @@ -0,0 +1,20 @@ +# Function: readProjectConfiguration + +▸ **readProjectConfiguration**(`tree`, `projectName`): [`ProjectConfiguration`](../../devkit/documents/ProjectConfiguration) + +Reads a project configuration. + +**`Throws`** + +If supplied projectName cannot be found + +#### Parameters + +| Name | Type | Description | +| :------------ | :------------------------------------ | :---------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/Tree) | the file system tree | +| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | + +#### Returns + +[`ProjectConfiguration`](../../devkit/documents/ProjectConfiguration) diff --git a/docs/generated/devkit/readRootPackageJson.md b/docs/generated/devkit/readRootPackageJson.md new file mode 100644 index 0000000000000..281627472e6cc --- /dev/null +++ b/docs/generated/devkit/readRootPackageJson.md @@ -0,0 +1,12 @@ +# Function: readRootPackageJson + +▸ **readRootPackageJson**(): `Object` + +#### Returns + +`Object` + +| Name | Type | +| :----------------- | :----------------------------- | +| `dependencies?` | { `[key: string]`: `string`; } | +| `devDependencies?` | { `[key: string]`: `string`; } | diff --git a/docs/generated/devkit/readTargetOptions.md b/docs/generated/devkit/readTargetOptions.md new file mode 100644 index 0000000000000..e9e7364b89652 --- /dev/null +++ b/docs/generated/devkit/readTargetOptions.md @@ -0,0 +1,24 @@ +# Function: readTargetOptions + +▸ **readTargetOptions**<`T`\>(`«destructured»`, `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 | +| :--------------- | :---------------------------------------------------------- | +| `«destructured»` | [`Target`](../../devkit/documents/Target) | +| `context` | [`ExecutorContext`](../../devkit/documents/ExecutorContext) | + +#### Returns + +`T` diff --git a/docs/generated/devkit/readWorkspaceConfiguration.md b/docs/generated/devkit/readWorkspaceConfiguration.md new file mode 100644 index 0000000000000..1e39513c9783b --- /dev/null +++ b/docs/generated/devkit/readWorkspaceConfiguration.md @@ -0,0 +1,21 @@ +# Function: readWorkspaceConfiguration + +▸ **readWorkspaceConfiguration**(`tree`): [`WorkspaceConfiguration`](../../devkit/documents/WorkspaceConfiguration) + +Read general workspace configuration such as the default project or cli settings + +This does _not_ provide projects configuration, use [readProjectConfiguration](../../devkit/documents/readProjectConfiguration) instead. + +**`Deprecated`** + +use readNxJson + +#### Parameters + +| Name | Type | +| :----- | :------------------------------------ | +| `tree` | [`Tree`](../../devkit/documents/Tree) | + +#### Returns + +[`WorkspaceConfiguration`](../../devkit/documents/WorkspaceConfiguration) diff --git a/docs/generated/devkit/removeDependenciesFromPackageJson.md b/docs/generated/devkit/removeDependenciesFromPackageJson.md new file mode 100644 index 0000000000000..6fe6b0a308498 --- /dev/null +++ b/docs/generated/devkit/removeDependenciesFromPackageJson.md @@ -0,0 +1,28 @@ +# Function: removeDependenciesFromPackageJson + +▸ **removeDependenciesFromPackageJson**(`tree`, `dependencies`, `devDependencies`, `packageJsonPath?`): [`GeneratorCallback`](../../devkit/documents/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 | Description | +| :----------------- | :------------------------------------ | :-------------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/Tree) | - | +| `dependencies` | `string`[] | Dependencies to be removed from the dependencies section of package.json | +| `devDependencies` | `string`[] | Dependencies to be removed from the devDependencies section of package.json | +| `packageJsonPath?` | `string` | - | + +#### Returns + +[`GeneratorCallback`](../../devkit/documents/GeneratorCallback) + +Callback to uninstall dependencies only if necessary. undefined is returned if changes are not necessary. diff --git a/docs/generated/devkit/removeProjectConfiguration.md b/docs/generated/devkit/removeProjectConfiguration.md new file mode 100644 index 0000000000000..2536dcef2ec88 --- /dev/null +++ b/docs/generated/devkit/removeProjectConfiguration.md @@ -0,0 +1,16 @@ +# Function: removeProjectConfiguration + +▸ **removeProjectConfiguration**(`tree`, `projectName`): `void` + +Removes the configuration of an existing project. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------------------------------------ | :---------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/Tree) | the file system tree | +| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | + +#### Returns + +`void` diff --git a/docs/generated/devkit/reverse.md b/docs/generated/devkit/reverse.md new file mode 100644 index 0000000000000..5f79f2d94e09b --- /dev/null +++ b/docs/generated/devkit/reverse.md @@ -0,0 +1,18 @@ +# Function: reverse + +▸ **reverse**(`graph`): [`ProjectGraph`](../../devkit/documents/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/ProjectGraph) | + +#### Returns + +[`ProjectGraph`](../../devkit/documents/ProjectGraph) diff --git a/docs/generated/devkit/runExecutor.md b/docs/generated/devkit/runExecutor.md new file mode 100644 index 0000000000000..83e1057716f53 --- /dev/null +++ b/docs/generated/devkit/runExecutor.md @@ -0,0 +1,49 @@ +# Function: 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` | [`Target`](../../devkit/documents/Target) | +| `overrides` | `Object` | +| `context` | [`ExecutorContext`](../../devkit/documents/ExecutorContext) | + +#### Returns + +`Promise`<`AsyncIterableIterator`<`T`\>\> diff --git a/docs/generated/devkit/runTasksInSerial.md b/docs/generated/devkit/runTasksInSerial.md new file mode 100644 index 0000000000000..f0864f014c5d0 --- /dev/null +++ b/docs/generated/devkit/runTasksInSerial.md @@ -0,0 +1,15 @@ +# Function: runTasksInSerial + +▸ **runTasksInSerial**(`...tasks`): [`GeneratorCallback`](../../devkit/documents/GeneratorCallback) + +Run tasks in serial + +#### Parameters + +| Name | Type | Description | +| :--------- | :---------------------------------------------------------------- | :-------------------------- | +| `...tasks` | [`GeneratorCallback`](../../devkit/documents/GeneratorCallback)[] | The tasks to run in serial. | + +#### Returns + +[`GeneratorCallback`](../../devkit/documents/GeneratorCallback) diff --git a/docs/generated/devkit/serializeJson.md b/docs/generated/devkit/serializeJson.md new file mode 100644 index 0000000000000..d0d9465fc9676 --- /dev/null +++ b/docs/generated/devkit/serializeJson.md @@ -0,0 +1,25 @@ +# Function: 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/JsonSerializeOptions) | JSON serialize options | + +#### Returns + +`string` + +the formatted JSON representation of the object diff --git a/docs/generated/devkit/sharePackages.md b/docs/generated/devkit/sharePackages.md new file mode 100644 index 0000000000000..aea4acc2d7412 --- /dev/null +++ b/docs/generated/devkit/sharePackages.md @@ -0,0 +1,19 @@ +# Function: sharePackages + +▸ **sharePackages**(`packages`): `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/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/SharedLibraryConfig)\> diff --git a/docs/generated/devkit/shareWorkspaceLibraries.md b/docs/generated/devkit/shareWorkspaceLibraries.md new file mode 100644 index 0000000000000..54f256f749aaf --- /dev/null +++ b/docs/generated/devkit/shareWorkspaceLibraries.md @@ -0,0 +1,17 @@ +# Function: shareWorkspaceLibraries + +▸ **shareWorkspaceLibraries**(`libraries`, `tsConfigPath?`): [`SharedWorkspaceLibraryConfig`](../../devkit/documents/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/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/SharedWorkspaceLibraryConfig) diff --git a/docs/generated/devkit/stripIndents.md b/docs/generated/devkit/stripIndents.md new file mode 100644 index 0000000000000..8fc719dffc11d --- /dev/null +++ b/docs/generated/devkit/stripIndents.md @@ -0,0 +1,26 @@ +# Function: 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` diff --git a/docs/generated/devkit/stripJsonComments.md b/docs/generated/devkit/stripJsonComments.md new file mode 100644 index 0000000000000..584b3f6eb6e32 --- /dev/null +++ b/docs/generated/devkit/stripJsonComments.md @@ -0,0 +1,18 @@ +# Function: stripJsonComments + +▸ **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` diff --git a/docs/generated/devkit/targetToTargetString.md b/docs/generated/devkit/targetToTargetString.md new file mode 100644 index 0000000000000..917f84e3ef86e --- /dev/null +++ b/docs/generated/devkit/targetToTargetString.md @@ -0,0 +1,15 @@ +# Function: targetToTargetString + +▸ **targetToTargetString**(`target`): `string` + +Returns a string in the format "project:target[:configuration]" for the target + +#### Parameters + +| Name | Type | Description | +| :------- | :---------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `target` | [`Target`](../../devkit/documents/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` diff --git a/docs/generated/devkit/toJS.md b/docs/generated/devkit/toJS.md new file mode 100644 index 0000000000000..be8963faba5dd --- /dev/null +++ b/docs/generated/devkit/toJS.md @@ -0,0 +1,15 @@ +# Function: toJS + +▸ **toJS**(`tree`): `void` + +Rename and transpile any new typescript files created to javascript files + +#### Parameters + +| Name | Type | +| :----- | :------------------------------------ | +| `tree` | [`Tree`](../../devkit/documents/Tree) | + +#### Returns + +`void` diff --git a/docs/generated/devkit/updateJson.md b/docs/generated/devkit/updateJson.md new file mode 100644 index 0000000000000..9fec1749d0171 --- /dev/null +++ b/docs/generated/devkit/updateJson.md @@ -0,0 +1,25 @@ +# Function: 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/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/JsonParseOptions) & [`JsonSerializeOptions`](../../devkit/documents/JsonSerializeOptions) | Optional JSON Parse and Serialize Options | + +#### Returns + +`void` diff --git a/docs/generated/devkit/updateNxJson.md b/docs/generated/devkit/updateNxJson.md new file mode 100644 index 0000000000000..f833e2abcf8a6 --- /dev/null +++ b/docs/generated/devkit/updateNxJson.md @@ -0,0 +1,16 @@ +# Function: updateNxJson + +▸ **updateNxJson**(`tree`, `nxJson`): `void` + +Update nx.json + +#### Parameters + +| Name | Type | +| :------- | :---------------------------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/Tree) | +| `nxJson` | [`NxJsonConfiguration`](../../devkit/documents/NxJsonConfiguration)<`string`[] \| `"*"`\> | + +#### Returns + +`void` diff --git a/docs/generated/devkit/updateProjectConfiguration.md b/docs/generated/devkit/updateProjectConfiguration.md new file mode 100644 index 0000000000000..7c799ded8e756 --- /dev/null +++ b/docs/generated/devkit/updateProjectConfiguration.md @@ -0,0 +1,17 @@ +# Function: updateProjectConfiguration + +▸ **updateProjectConfiguration**(`tree`, `projectName`, `projectConfiguration`): `void` + +Updates the configuration of an existing project. + +#### Parameters + +| Name | Type | Description | +| :--------------------- | :-------------------------------------------------------------------- | :---------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/Tree) | the file system tree | +| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | +| `projectConfiguration` | [`ProjectConfiguration`](../../devkit/documents/ProjectConfiguration) | project configuration | + +#### Returns + +`void` diff --git a/docs/generated/devkit/updateTsConfigsToJs.md b/docs/generated/devkit/updateTsConfigsToJs.md new file mode 100644 index 0000000000000..1d3a2d6f6d440 --- /dev/null +++ b/docs/generated/devkit/updateTsConfigsToJs.md @@ -0,0 +1,15 @@ +# Function: updateTsConfigsToJs + +▸ **updateTsConfigsToJs**(`tree`, `options`): `void` + +#### Parameters + +| Name | Type | +| :-------------------- | :------------------------------------ | +| `tree` | [`Tree`](../../devkit/documents/Tree) | +| `options` | `Object` | +| `options.projectRoot` | `string` | + +#### Returns + +`void` diff --git a/docs/generated/devkit/updateWorkspaceConfiguration.md b/docs/generated/devkit/updateWorkspaceConfiguration.md new file mode 100644 index 0000000000000..b119a21df9fa7 --- /dev/null +++ b/docs/generated/devkit/updateWorkspaceConfiguration.md @@ -0,0 +1,22 @@ +# Function: 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/updateProjectConfiguration) or [addProjectConfiguration](../../devkit/documents/addProjectConfiguration) instead. + +**`Deprecated`** + +use updateNxJson + +#### Parameters + +| Name | Type | +| :---------------- | :------------------------------------------------------------------------ | +| `tree` | [`Tree`](../../devkit/documents/Tree) | +| `workspaceConfig` | [`WorkspaceConfiguration`](../../devkit/documents/WorkspaceConfiguration) | + +#### Returns + +`void` diff --git a/docs/generated/devkit/visitNotIgnoredFiles.md b/docs/generated/devkit/visitNotIgnoredFiles.md new file mode 100644 index 0000000000000..59daf7b5577de --- /dev/null +++ b/docs/generated/devkit/visitNotIgnoredFiles.md @@ -0,0 +1,17 @@ +# Function: visitNotIgnoredFiles + +▸ **visitNotIgnoredFiles**(`tree`, `dirPath`, `visitor`): `void` + +Utility to act on all files in a tree that are not ignored by git. + +#### Parameters + +| Name | Type | +| :-------- | :------------------------------------ | +| `tree` | [`Tree`](../../devkit/documents/Tree) | +| `dirPath` | `string` | +| `visitor` | (`path`: `string`) => `void` | + +#### Returns + +`void` diff --git a/docs/generated/devkit/workspaceLayout.md b/docs/generated/devkit/workspaceLayout.md new file mode 100644 index 0000000000000..6ebebabb415db --- /dev/null +++ b/docs/generated/devkit/workspaceLayout.md @@ -0,0 +1,14 @@ +# Function: workspaceLayout + +▸ **workspaceLayout**(): `Object` + +Returns information about where apps and libs will be created. + +#### Returns + +`Object` + +| Name | Type | +| :-------- | :------- | +| `appsDir` | `string` | +| `libsDir` | `string` | diff --git a/docs/generated/devkit/workspaceRoot.md b/docs/generated/devkit/workspaceRoot.md new file mode 100644 index 0000000000000..803f702737682 --- /dev/null +++ b/docs/generated/devkit/workspaceRoot.md @@ -0,0 +1,5 @@ +# Variable: workspaceRoot + +• **workspaceRoot**: `string` + +The root of the workspace diff --git a/docs/generated/devkit/writeJson.md b/docs/generated/devkit/writeJson.md new file mode 100644 index 0000000000000..c0f5ab1c603c5 --- /dev/null +++ b/docs/generated/devkit/writeJson.md @@ -0,0 +1,24 @@ +# Function: 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/Tree) | File system tree | +| `path` | `string` | Path of JSON file in the Tree | +| `value` | `T` | Serializable value to write | +| `options?` | [`JsonSerializeOptions`](../../devkit/documents/JsonSerializeOptions) | Optional JSON Serialize Options | + +#### Returns + +`void` diff --git a/docs/generated/devkit/writeJsonFile.md b/docs/generated/devkit/writeJsonFile.md new file mode 100644 index 0000000000000..054d3e3678863 --- /dev/null +++ b/docs/generated/devkit/writeJsonFile.md @@ -0,0 +1,23 @@ +# Function: 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/manifests/packages.json b/docs/generated/manifests/packages.json index 8ff6e10ae836c..faf7598da242f 100644 --- a/docs/generated/manifests/packages.json +++ b/docs/generated/manifests/packages.json @@ -599,7 +599,7 @@ "isExternal": false, "path": "/packages/devkit/documents/nx_devkit", "tags": [], - "originalFilePath": "generated/devkit/nx_devkit" + "originalFilePath": "generated/devkit/README" }, "/packages/devkit/documents/ngcli_adapter": { "id": "ngcli_adapter", @@ -610,7 +610,7 @@ "isExternal": false, "path": "/packages/devkit/documents/ngcli_adapter", "tags": [], - "originalFilePath": "generated/devkit/ngcli_adapter" + "originalFilePath": "generated/devkit/ngcli_adapter/README" } }, "root": "/packages/devkit", diff --git a/docs/generated/packages-metadata.json b/docs/generated/packages-metadata.json index 3a571a38f6aa5..ab7e810ac3410 100644 --- a/docs/generated/packages-metadata.json +++ b/docs/generated/packages-metadata.json @@ -591,7 +591,7 @@ "isExternal": false, "path": "devkit/documents/nx_devkit", "tags": [], - "originalFilePath": "generated/devkit/nx_devkit" + "originalFilePath": "generated/devkit/README" }, { "id": "ngcli_adapter", @@ -602,7 +602,7 @@ "isExternal": false, "path": "devkit/documents/ngcli_adapter", "tags": [], - "originalFilePath": "generated/devkit/ngcli_adapter" + "originalFilePath": "generated/devkit/ngcli_adapter/README" } ], "executors": [], diff --git a/docs/generated/packages/devkit/documents/ngcli_adapter.md b/docs/generated/packages/devkit/documents/ngcli_adapter.md index 49bf7022494bd..8250da93e4678 100644 --- a/docs/generated/packages/devkit/documents/ngcli_adapter.md +++ b/docs/generated/packages/devkit/documents/ngcli_adapter.md @@ -1,118 +1,13 @@ -# Module: ngcli-adapter +# @nx/devkit ## Table of contents ### Classes -- [NxScopedHost](../../devkit/documents/ngcli_adapter#nxscopedhost) +- [NxScopedHost](../../devkit/documents/ngcli_adapter/NxScopedHost) ### Functions -- [mockSchematicsForTesting](../../devkit/documents/ngcli_adapter#mockschematicsfortesting) -- [overrideCollectionResolutionForTesting](../../devkit/documents/ngcli_adapter#overridecollectionresolutionfortesting) -- [wrapAngularDevkitSchematic](../../devkit/documents/ngcli_adapter#wrapangulardevkitschematic) - -## Classes - -### NxScopedHost - -• **NxScopedHost**: `Object` - -## Functions - -### mockSchematicsForTesting - -▸ **mockSchematicsForTesting**(`schematics`): `void` - -If you have an Nx Devkit generator invoking the wrapped Angular Devkit schematic, -and you don't want the Angular Devkit schematic to run, you can mock it up using this function. - -Unfortunately, there are some edge cases in the Nx-Angular devkit integration that -can be seen in the unit tests context. This function is useful for handling that as well. - -In this case, you can mock it up. - -Example: - -```typescript -mockSchematicsForTesting({ - 'mycollection:myschematic': (tree, params) => { - tree.write('README.md'); - }, -}); -``` - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `schematics` | `Object` | - -#### Returns - -`void` - ---- - -### overrideCollectionResolutionForTesting - -▸ **overrideCollectionResolutionForTesting**(`collections`): `void` - -By default, Angular Devkit schematic collections will be resolved using the Node resolution. -This doesn't work if you are testing schematics that refer to other schematics in the -same repo. - -This function can can be used to override the resolution behaviour. - -Example: - -```typescript -overrideCollectionResolutionForTesting({ - '@nx/workspace': path.join( - __dirname, - '../../../../workspace/generators.json' - ), - '@nx/angular': path.join(__dirname, '../../../../angular/generators.json'), - '@nx/linter': path.join(__dirname, '../../../../linter/generators.json'), -}); -``` - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `collections` | `Object` | - -#### Returns - -`void` - ---- - -### wrapAngularDevkitSchematic - -▸ **wrapAngularDevkitSchematic**(`collectionName`, `generatorName`): (`host`: [`Tree`](../../devkit/documents/nx_devkit#tree), `generatorOptions`: { `[k: string]`: `any`; }) => `Promise`<`any`\> - -#### Parameters - -| Name | Type | -| :--------------- | :------- | -| `collectionName` | `string` | -| `generatorName` | `string` | - -#### Returns - -`fn` - -▸ (`host`, `generatorOptions`): `Promise`<`any`\> - -##### Parameters - -| Name | Type | -| :----------------- | :---------------------------------------------- | -| `host` | [`Tree`](../../devkit/documents/nx_devkit#tree) | -| `generatorOptions` | `Object` | - -##### Returns - -`Promise`<`any`\> +- [mockSchematicsForTesting](../../devkit/documents/ngcli_adapter/mockSchematicsForTesting) +- [overrideCollectionResolutionForTesting](../../devkit/documents/ngcli_adapter/overrideCollectionResolutionForTesting) +- [wrapAngularDevkitSchematic](../../devkit/documents/ngcli_adapter/wrapAngularDevkitSchematic) diff --git a/docs/generated/packages/devkit/documents/nx_devkit.md b/docs/generated/packages/devkit/documents/nx_devkit.md index d288ca40288b7..9c7cdadc7cf50 100644 --- a/docs/generated/packages/devkit/documents/nx_devkit.md +++ b/docs/generated/packages/devkit/documents/nx_devkit.md @@ -1,4 +1,4 @@ -# Module: @nx/devkit +# @nx/devkit The Nx Devkit is the underlying technology used to customize Nx to support different technologies and custom use-cases. It contains many utility @@ -13,2457 +13,150 @@ It only uses language primitives and immutable objects ### Enumerations -- [ChangeType](../../devkit/documents/nx_devkit#changetype) -- [DependencyType](../../devkit/documents/nx_devkit#dependencytype) +- [ChangeType](../../devkit/documents/ChangeType) +- [DependencyType](../../devkit/documents/DependencyType) ### Classes -- [ProjectGraphBuilder](../../devkit/documents/nx_devkit#projectgraphbuilder) -- [Workspaces](../../devkit/documents/nx_devkit#workspaces) +- [ProjectGraphBuilder](../../devkit/documents/ProjectGraphBuilder) +- [Workspaces](../../devkit/documents/Workspaces) ### Interfaces -- [DefaultTasksRunnerOptions](../../devkit/documents/nx_devkit#defaulttasksrunneroptions) -- [ExecutorContext](../../devkit/documents/nx_devkit#executorcontext) -- [ExecutorsJson](../../devkit/documents/nx_devkit#executorsjson) -- [FileChange](../../devkit/documents/nx_devkit#filechange) -- [FileData](../../devkit/documents/nx_devkit#filedata) -- [GeneratorsJson](../../devkit/documents/nx_devkit#generatorsjson) -- [Hash](../../devkit/documents/nx_devkit#hash) -- [HasherContext](../../devkit/documents/nx_devkit#hashercontext) -- [ImplicitJsonSubsetDependency](../../devkit/documents/nx_devkit#implicitjsonsubsetdependency) -- [JsonParseOptions](../../devkit/documents/nx_devkit#jsonparseoptions) -- [JsonSerializeOptions](../../devkit/documents/nx_devkit#jsonserializeoptions) -- [MigrationsJson](../../devkit/documents/nx_devkit#migrationsjson) -- [ModuleFederationConfig](../../devkit/documents/nx_devkit#modulefederationconfig) -- [NxAffectedConfig](../../devkit/documents/nx_devkit#nxaffectedconfig) -- [NxJsonConfiguration](../../devkit/documents/nx_devkit#nxjsonconfiguration) -- [NxPlugin](../../devkit/documents/nx_devkit#nxplugin) -- [ProjectConfiguration](../../devkit/documents/nx_devkit#projectconfiguration) -- [ProjectFileMap](../../devkit/documents/nx_devkit#projectfilemap) -- [ProjectGraph](../../devkit/documents/nx_devkit#projectgraph) -- [ProjectGraphDependency](../../devkit/documents/nx_devkit#projectgraphdependency) -- [ProjectGraphExternalNode](../../devkit/documents/nx_devkit#projectgraphexternalnode) -- [ProjectGraphProcessorContext](../../devkit/documents/nx_devkit#projectgraphprocessorcontext) -- [ProjectGraphProjectNode](../../devkit/documents/nx_devkit#projectgraphprojectnode) -- [ProjectsConfigurations](../../devkit/documents/nx_devkit#projectsconfigurations) -- [RemoteCache](../../devkit/documents/nx_devkit#remotecache) -- [SharedLibraryConfig](../../devkit/documents/nx_devkit#sharedlibraryconfig) -- [StringDeletion](../../devkit/documents/nx_devkit#stringdeletion) -- [StringInsertion](../../devkit/documents/nx_devkit#stringinsertion) -- [Target](../../devkit/documents/nx_devkit#target) -- [TargetConfiguration](../../devkit/documents/nx_devkit#targetconfiguration) -- [TargetDependencyConfig](../../devkit/documents/nx_devkit#targetdependencyconfig) -- [Task](../../devkit/documents/nx_devkit#task) -- [TaskGraph](../../devkit/documents/nx_devkit#taskgraph) -- [TaskHasher](../../devkit/documents/nx_devkit#taskhasher) -- [Tree](../../devkit/documents/nx_devkit#tree) -- [Workspace](../../devkit/documents/nx_devkit#workspace) +- [DefaultTasksRunnerOptions](../../devkit/documents/DefaultTasksRunnerOptions) +- [ExecutorContext](../../devkit/documents/ExecutorContext) +- [ExecutorsJson](../../devkit/documents/ExecutorsJson) +- [FileChange](../../devkit/documents/FileChange) +- [FileData](../../devkit/documents/FileData) +- [GeneratorsJson](../../devkit/documents/GeneratorsJson) +- [Hash](../../devkit/documents/Hash) +- [HasherContext](../../devkit/documents/HasherContext) +- [ImplicitJsonSubsetDependency](../../devkit/documents/ImplicitJsonSubsetDependency) +- [JsonParseOptions](../../devkit/documents/JsonParseOptions) +- [JsonSerializeOptions](../../devkit/documents/JsonSerializeOptions) +- [MigrationsJson](../../devkit/documents/MigrationsJson) +- [ModuleFederationConfig](../../devkit/documents/ModuleFederationConfig) +- [NxAffectedConfig](../../devkit/documents/NxAffectedConfig) +- [NxJsonConfiguration](../../devkit/documents/NxJsonConfiguration) +- [NxPlugin](../../devkit/documents/NxPlugin) +- [ProjectConfiguration](../../devkit/documents/ProjectConfiguration) +- [ProjectFileMap](../../devkit/documents/ProjectFileMap) +- [ProjectGraph](../../devkit/documents/ProjectGraph) +- [ProjectGraphDependency](../../devkit/documents/ProjectGraphDependency) +- [ProjectGraphExternalNode](../../devkit/documents/ProjectGraphExternalNode) +- [ProjectGraphProcessorContext](../../devkit/documents/ProjectGraphProcessorContext) +- [ProjectGraphProjectNode](../../devkit/documents/ProjectGraphProjectNode) +- [ProjectsConfigurations](../../devkit/documents/ProjectsConfigurations) +- [RemoteCache](../../devkit/documents/RemoteCache) +- [SharedLibraryConfig](../../devkit/documents/SharedLibraryConfig) +- [StringDeletion](../../devkit/documents/StringDeletion) +- [StringInsertion](../../devkit/documents/StringInsertion) +- [Target](../../devkit/documents/Target) +- [TargetConfiguration](../../devkit/documents/TargetConfiguration) +- [TargetDependencyConfig](../../devkit/documents/TargetDependencyConfig) +- [Task](../../devkit/documents/Task) +- [TaskGraph](../../devkit/documents/TaskGraph) +- [TaskHasher](../../devkit/documents/TaskHasher) +- [Tree](../../devkit/documents/Tree) +- [Workspace](../../devkit/documents/Workspace) ### Type Aliases -- [AdditionalSharedConfig](../../devkit/documents/nx_devkit#additionalsharedconfig) -- [CustomHasher](../../devkit/documents/nx_devkit#customhasher) -- [Executor](../../devkit/documents/nx_devkit#executor) -- [Generator](../../devkit/documents/nx_devkit#generator) -- [GeneratorCallback](../../devkit/documents/nx_devkit#generatorcallback) -- [Hasher](../../devkit/documents/nx_devkit#hasher) -- [ImplicitDependencyEntry](../../devkit/documents/nx_devkit#implicitdependencyentry) -- [ModuleFederationLibrary](../../devkit/documents/nx_devkit#modulefederationlibrary) -- [PackageManager](../../devkit/documents/nx_devkit#packagemanager) -- [ProjectGraphNode](../../devkit/documents/nx_devkit#projectgraphnode) -- [ProjectTargetConfigurator](../../devkit/documents/nx_devkit#projecttargetconfigurator) -- [ProjectType](../../devkit/documents/nx_devkit#projecttype) -- [Remotes](../../devkit/documents/nx_devkit#remotes) -- [SharedFunction](../../devkit/documents/nx_devkit#sharedfunction) -- [SharedWorkspaceLibraryConfig](../../devkit/documents/nx_devkit#sharedworkspacelibraryconfig) -- [StringChange](../../devkit/documents/nx_devkit#stringchange) -- [TaskGraphExecutor](../../devkit/documents/nx_devkit#taskgraphexecutor) -- [WorkspaceConfiguration](../../devkit/documents/nx_devkit#workspaceconfiguration) -- [WorkspaceJsonConfiguration](../../devkit/documents/nx_devkit#workspacejsonconfiguration) -- [WorkspaceLibrary](../../devkit/documents/nx_devkit#workspacelibrary) -- [WorkspaceLibrarySecondaryEntryPoint](../../devkit/documents/nx_devkit#workspacelibrarysecondaryentrypoint) +- [AdditionalSharedConfig](../../devkit/documents/AdditionalSharedConfig) +- [CustomHasher](../../devkit/documents/CustomHasher) +- [Executor](../../devkit/documents/Executor) +- [Generator](../../devkit/documents/Generator) +- [GeneratorCallback](../../devkit/documents/GeneratorCallback) +- [Hasher](../../devkit/documents/Hasher) +- [ImplicitDependencyEntry](../../devkit/documents/ImplicitDependencyEntry) +- [ModuleFederationLibrary](../../devkit/documents/ModuleFederationLibrary) +- [PackageManager](../../devkit/documents/PackageManager) +- [ProjectGraphNode](../../devkit/documents/ProjectGraphNode) +- [ProjectTargetConfigurator](../../devkit/documents/ProjectTargetConfigurator) +- [ProjectType](../../devkit/documents/ProjectType) +- [Remotes](../../devkit/documents/Remotes) +- [SharedFunction](../../devkit/documents/SharedFunction) +- [SharedWorkspaceLibraryConfig](../../devkit/documents/SharedWorkspaceLibraryConfig) +- [StringChange](../../devkit/documents/StringChange) +- [TaskGraphExecutor](../../devkit/documents/TaskGraphExecutor) +- [WorkspaceConfiguration](../../devkit/documents/WorkspaceConfiguration) +- [WorkspaceJsonConfiguration](../../devkit/documents/WorkspaceJsonConfiguration) +- [WorkspaceLibrary](../../devkit/documents/WorkspaceLibrary) +- [WorkspaceLibrarySecondaryEntryPoint](../../devkit/documents/WorkspaceLibrarySecondaryEntryPoint) ### Variables -- [NX_VERSION](../../devkit/documents/nx_devkit#nx_version) -- [appRootPath](../../devkit/documents/nx_devkit#approotpath) -- [cacheDir](../../devkit/documents/nx_devkit#cachedir) -- [logger](../../devkit/documents/nx_devkit#logger) -- [output](../../devkit/documents/nx_devkit#output) -- [workspaceRoot](../../devkit/documents/nx_devkit#workspaceroot) +- [NX_VERSION](../../devkit/documents/NX_VERSION) +- [appRootPath](../../devkit/documents/appRootPath) +- [cacheDir](../../devkit/documents/cacheDir) +- [logger](../../devkit/documents/logger) +- [output](../../devkit/documents/output) +- [workspaceRoot](../../devkit/documents/workspaceRoot) ### Functions -- [addDependenciesToPackageJson](../../devkit/documents/nx_devkit#adddependenciestopackagejson) -- [addProjectConfiguration](../../devkit/documents/nx_devkit#addprojectconfiguration) -- [applyAdditionalShared](../../devkit/documents/nx_devkit#applyadditionalshared) -- [applyChangesToString](../../devkit/documents/nx_devkit#applychangestostring) -- [applySharedFunction](../../devkit/documents/nx_devkit#applysharedfunction) -- [convertNxExecutor](../../devkit/documents/nx_devkit#convertnxexecutor) -- [convertNxGenerator](../../devkit/documents/nx_devkit#convertnxgenerator) -- [createProjectFileMapUsingProjectGraph](../../devkit/documents/nx_devkit#createprojectfilemapusingprojectgraph) -- [createProjectGraphAsync](../../devkit/documents/nx_devkit#createprojectgraphasync) -- [defaultTasksRunner](../../devkit/documents/nx_devkit#defaulttasksrunner) -- [detectPackageManager](../../devkit/documents/nx_devkit#detectpackagemanager) -- [ensurePackage](../../devkit/documents/nx_devkit#ensurepackage) -- [extractLayoutDirectory](../../devkit/documents/nx_devkit#extractlayoutdirectory) -- [formatFiles](../../devkit/documents/nx_devkit#formatfiles) -- [generateFiles](../../devkit/documents/nx_devkit#generatefiles) -- [getDependentPackagesForProject](../../devkit/documents/nx_devkit#getdependentpackagesforproject) -- [getNpmPackageSharedConfig](../../devkit/documents/nx_devkit#getnpmpackagesharedconfig) -- [getOutputsForTargetAndConfiguration](../../devkit/documents/nx_devkit#getoutputsfortargetandconfiguration) -- [getPackageManagerCommand](../../devkit/documents/nx_devkit#getpackagemanagercommand) -- [getPackageManagerVersion](../../devkit/documents/nx_devkit#getpackagemanagerversion) -- [getProjects](../../devkit/documents/nx_devkit#getprojects) -- [getWorkspaceLayout](../../devkit/documents/nx_devkit#getworkspacelayout) -- [getWorkspacePath](../../devkit/documents/nx_devkit#getworkspacepath) -- [hashArray](../../devkit/documents/nx_devkit#hasharray) -- [installPackagesTask](../../devkit/documents/nx_devkit#installpackagestask) -- [isStandaloneProject](../../devkit/documents/nx_devkit#isstandaloneproject) -- [joinPathFragments](../../devkit/documents/nx_devkit#joinpathfragments) -- [mapRemotes](../../devkit/documents/nx_devkit#mapremotes) -- [mapRemotesForSSR](../../devkit/documents/nx_devkit#mapremotesforssr) -- [moveFilesToNewDirectory](../../devkit/documents/nx_devkit#movefilestonewdirectory) -- [names](../../devkit/documents/nx_devkit#names) -- [normalizePath](../../devkit/documents/nx_devkit#normalizepath) -- [offsetFromRoot](../../devkit/documents/nx_devkit#offsetfromroot) -- [parseJson](../../devkit/documents/nx_devkit#parsejson) -- [parseTargetString](../../devkit/documents/nx_devkit#parsetargetstring) -- [readAllWorkspaceConfiguration](../../devkit/documents/nx_devkit#readallworkspaceconfiguration) -- [readCachedProjectGraph](../../devkit/documents/nx_devkit#readcachedprojectgraph) -- [readJson](../../devkit/documents/nx_devkit#readjson) -- [readJsonFile](../../devkit/documents/nx_devkit#readjsonfile) -- [readNxJson](../../devkit/documents/nx_devkit#readnxjson) -- [readProjectConfiguration](../../devkit/documents/nx_devkit#readprojectconfiguration) -- [readRootPackageJson](../../devkit/documents/nx_devkit#readrootpackagejson) -- [readTargetOptions](../../devkit/documents/nx_devkit#readtargetoptions) -- [readWorkspaceConfiguration](../../devkit/documents/nx_devkit#readworkspaceconfiguration) -- [removeDependenciesFromPackageJson](../../devkit/documents/nx_devkit#removedependenciesfrompackagejson) -- [removeProjectConfiguration](../../devkit/documents/nx_devkit#removeprojectconfiguration) -- [reverse](../../devkit/documents/nx_devkit#reverse) -- [runExecutor](../../devkit/documents/nx_devkit#runexecutor) -- [runTasksInSerial](../../devkit/documents/nx_devkit#runtasksinserial) -- [serializeJson](../../devkit/documents/nx_devkit#serializejson) -- [sharePackages](../../devkit/documents/nx_devkit#sharepackages) -- [shareWorkspaceLibraries](../../devkit/documents/nx_devkit#shareworkspacelibraries) -- [stripIndents](../../devkit/documents/nx_devkit#stripindents) -- [stripJsonComments](../../devkit/documents/nx_devkit#stripjsoncomments) -- [targetToTargetString](../../devkit/documents/nx_devkit#targettotargetstring) -- [toJS](../../devkit/documents/nx_devkit#tojs) -- [updateJson](../../devkit/documents/nx_devkit#updatejson) -- [updateNxJson](../../devkit/documents/nx_devkit#updatenxjson) -- [updateProjectConfiguration](../../devkit/documents/nx_devkit#updateprojectconfiguration) -- [updateTsConfigsToJs](../../devkit/documents/nx_devkit#updatetsconfigstojs) -- [updateWorkspaceConfiguration](../../devkit/documents/nx_devkit#updateworkspaceconfiguration) -- [visitNotIgnoredFiles](../../devkit/documents/nx_devkit#visitnotignoredfiles) -- [workspaceLayout](../../devkit/documents/nx_devkit#workspacelayout) -- [writeJson](../../devkit/documents/nx_devkit#writejson) -- [writeJsonFile](../../devkit/documents/nx_devkit#writejsonfile) - -## Enumerations - -### ChangeType - -• **ChangeType**: `Object` - ---- - -### DependencyType - -• **DependencyType**: `Object` - -Type of dependency between projects - -## Classes - -### ProjectGraphBuilder - -• **ProjectGraphBuilder**: `Object` - ---- - -### Workspaces - -• **Workspaces**: `Object` - -## Interfaces - -### DefaultTasksRunnerOptions - -• **DefaultTasksRunnerOptions**: `Object` - ---- - -### ExecutorContext - -• **ExecutorContext**: `Object` - -Context that is passed into an executor - ---- - -### ExecutorsJson - -• **ExecutorsJson**: `Object` - ---- - -### FileChange - -• **FileChange**: `Object` - -Description of a file change in the Nx virtual file system/ - ---- - -### FileData - -• **FileData**: `Object` - -Some metadata about a file - ---- - -### GeneratorsJson - -• **GeneratorsJson**: `Object` - ---- - -### Hash - -• **Hash**: `Object` - -A data structure returned by the default hasher. - ---- - -### HasherContext - -• **HasherContext**: `Object` - ---- - -### ImplicitJsonSubsetDependency - -• **ImplicitJsonSubsetDependency**<`T`\>: `Object` - -#### Type parameters - -| Name | Type | -| :--- | :------------------ | -| `T` | `"*"` \| `string`[] | - ---- - -### JsonParseOptions - -• **JsonParseOptions**: `Object` - ---- - -### JsonSerializeOptions - -• **JsonSerializeOptions**: `Object` - ---- - -### MigrationsJson - -• **MigrationsJson**: `Object` - ---- - -### ModuleFederationConfig - -• **ModuleFederationConfig**: `Object` - ---- - -### NxAffectedConfig - -• **NxAffectedConfig**: `Object` - ---- - -### NxJsonConfiguration - -• **NxJsonConfiguration**<`T`\>: `Object` - -Nx.json configuration - -@note: when adding properties here add them to `allowedWorkspaceExtensions` in adapter/compat.ts - -#### Type parameters - -| Name | Type | -| :--- | :------------------ | -| `T` | `"*"` \| `string`[] | - ---- - -### NxPlugin - -• **NxPlugin**: `Object` - -A plugin for Nx - ---- - -### ProjectConfiguration - -• **ProjectConfiguration**: `Object` - -Project configuration - -@note: when adding properties here add them to `allowedProjectExtensions` in adapter/compat.ts - ---- - -### ProjectFileMap - -• **ProjectFileMap**: `Object` - -A list of files separated by the project they belong to - ---- - -### ProjectGraph - -• **ProjectGraph**: `Object` - -A Graph of projects in the workspace and dependencies between them - ---- - -### ProjectGraphDependency - -• **ProjectGraphDependency**: `Object` - -A dependency between two projects - ---- - -### ProjectGraphExternalNode - -• **ProjectGraphExternalNode**: `Object` - -A node describing an external dependency -`name` has as form of: - -- `npm:packageName` for root dependencies or -- `npm:packageName@version` for nested transitive dependencies - -This is vital for our node discovery to always point to root dependencies, -while allowing tracking of the full tree of different nested versions - ---- - -### ProjectGraphProcessorContext - -• **ProjectGraphProcessorContext**: `Object` - -Additional information to be used to process a project graph - ---- - -### ProjectGraphProjectNode - -• **ProjectGraphProjectNode**: `Object` - -A node describing a project in a workspace - ---- - -### ProjectsConfigurations - -• **ProjectsConfigurations**: `Object` - -Projects Configurations -@note: when adding properties here add them to `allowedWorkspaceExtensions` in adapter/compat.ts - ---- - -### RemoteCache - -• **RemoteCache**: `Object` - ---- - -### SharedLibraryConfig - -• **SharedLibraryConfig**: `Object` - ---- - -### StringDeletion - -• **StringDeletion**: `Object` - ---- - -### StringInsertion - -• **StringInsertion**: `Object` - ---- - -### Target - -• **Target**: `Object` - ---- - -### TargetConfiguration - -• **TargetConfiguration**<`T`\>: `Object` - -Target's configuration - -#### Type parameters - -| Name | Type | -| :--- | :---- | -| `T` | `any` | - ---- - -### TargetDependencyConfig - -• **TargetDependencyConfig**: `Object` - ---- - -### Task - -• **Task**: `Object` - -A representation of the invocation of an Executor - ---- - -### TaskGraph - -• **TaskGraph**: `Object` - -Graph of Tasks to be executed - ---- - -### TaskHasher - -• **TaskHasher**: `Object` - ---- - -### Tree - -• **Tree**: `Object` - -Virtual file system tree. - ---- - -### Workspace - -• **Workspace**: `Object` - -**`Deprecated`** - -use ProjectsConfigurations or NxJsonConfiguration - -## Type Aliases - -### AdditionalSharedConfig - -Ƭ **AdditionalSharedConfig**: (`string` \| [libraryName: string, sharedConfig: SharedLibraryConfig] \| { `libraryName`: `string` ; `sharedConfig`: [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig) })[] - ---- - -### CustomHasher - -Ƭ **CustomHasher**: (`task`: [`Task`](../../devkit/documents/nx_devkit#task), `context`: [`HasherContext`](../../devkit/documents/nx_devkit#hashercontext)) => `Promise`<[`Hash`](../../devkit/documents/nx_devkit#hash)\> - -#### Type declaration - -▸ (`task`, `context`): `Promise`<[`Hash`](../../devkit/documents/nx_devkit#hash)\> - -##### Parameters - -| Name | Type | -| :-------- | :---------------------------------------------------------------- | -| `task` | [`Task`](../../devkit/documents/nx_devkit#task) | -| `context` | [`HasherContext`](../../devkit/documents/nx_devkit#hashercontext) | - -##### Returns - -`Promise`<[`Hash`](../../devkit/documents/nx_devkit#hash)\> - ---- - -### Executor - -Ƭ **Executor**<`T`\>: (`options`: `T`, `context`: [`ExecutorContext`](../../devkit/documents/nx_devkit#executorcontext)) => `Promise`<{ `success`: `boolean` }\> \| `AsyncIterableIterator`<{ `success`: `boolean` }\> - -#### Type parameters - -| Name | Type | -| :--- | :---- | -| `T` | `any` | - -#### Type declaration - -▸ (`options`, `context`): `Promise`<{ `success`: `boolean` }\> \| `AsyncIterableIterator`<{ `success`: `boolean` }\> - -Implementation of a target of a project - -##### Parameters - -| Name | Type | -| :-------- | :-------------------------------------------------------------------- | -| `options` | `T` | -| `context` | [`ExecutorContext`](../../devkit/documents/nx_devkit#executorcontext) | - -##### Returns - -`Promise`<{ `success`: `boolean` }\> \| `AsyncIterableIterator`<{ `success`: `boolean` }\> - ---- - -### Generator - -Ƭ **Generator**<`T`\>: (`tree`: `any`, `schema`: `T`) => `void` \| [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback)\> - -#### Type parameters - -| Name | Type | -| :--- | :-------- | -| `T` | `unknown` | - -#### Type declaration - -▸ (`tree`, `schema`): `void` \| [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/documents/nx_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/nx_devkit#generatorcallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/documents/nx_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`\> - ---- - -### Hasher - -Ƭ **Hasher**: [`TaskHasher`](../../devkit/documents/nx_devkit#taskhasher) - ---- - -### ImplicitDependencyEntry - -Ƭ **ImplicitDependencyEntry**<`T`\>: `Object` - -#### Type parameters - -| Name | Type | -| :--- | :------------------ | -| `T` | `"*"` \| `string`[] | - -#### Index signature - -▪ [key: `string`]: `T` \| [`ImplicitJsonSubsetDependency`](../../devkit/documents/nx_devkit#implicitjsonsubsetdependency)<`T`\> - ---- - -### ModuleFederationLibrary - -Ƭ **ModuleFederationLibrary**: `Object` - -#### Type declaration - -| Name | Type | -| :----- | :------- | -| `name` | `string` | -| `type` | `string` | - ---- - -### PackageManager - -Ƭ **PackageManager**: `"yarn"` \| `"pnpm"` \| `"npm"` - ---- - -### ProjectGraphNode - -Ƭ **ProjectGraphNode**: [`ProjectGraphProjectNode`](../../devkit/documents/nx_devkit#projectgraphprojectnode) \| [`ProjectGraphExternalNode`](../../devkit/documents/nx_devkit#projectgraphexternalnode) - -**`Deprecated`** - -this type will be removed in v16. Use [ProjectGraphProjectNode](../../devkit/documents/nx_devkit#projectgraphprojectnode) or [ProjectGraphExternalNode](../../devkit/documents/nx_devkit#projectgraphexternalnode) instead - ---- - -### ProjectTargetConfigurator - -Ƭ **ProjectTargetConfigurator**: (`file`: `string`) => `Record`<`string`, [`TargetConfiguration`](../../devkit/documents/nx_devkit#targetconfiguration)\> - -#### Type declaration - -▸ (`file`): `Record`<`string`, [`TargetConfiguration`](../../devkit/documents/nx_devkit#targetconfiguration)\> - -##### Parameters - -| Name | Type | -| :----- | :------- | -| `file` | `string` | - -##### Returns - -`Record`<`string`, [`TargetConfiguration`](../../devkit/documents/nx_devkit#targetconfiguration)\> - ---- - -### ProjectType - -Ƭ **ProjectType**: `"library"` \| `"application"` - -Type of project supported - ---- - -### Remotes - -Ƭ **Remotes**: `string`[] \| [remoteName: string, remoteUrl: string][] - ---- - -### SharedFunction - -Ƭ **SharedFunction**: (`libraryName`: `string`, `sharedConfig`: [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig)) => `undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig) - -#### Type declaration - -▸ (`libraryName`, `sharedConfig`): `undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig) - -##### Parameters - -| Name | Type | -| :------------- | :---------------------------------------------------------------------------- | -| `libraryName` | `string` | -| `sharedConfig` | [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig) | - -##### Returns - -`undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig) - ---- - -### SharedWorkspaceLibraryConfig - -Ƭ **SharedWorkspaceLibraryConfig**: `Object` - -#### Type declaration - -| Name | Type | -| :--------------------- | :-------------------------------------------------------------------------------------------------------------------------- | -| `getAliases` | () => `Record`<`string`, `string`\> | -| `getLibraries` | (`eager?`: `boolean`) => `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig)\> | -| `getReplacementPlugin` | () => `NormalModuleReplacementPlugin` | - ---- - -### StringChange - -Ƭ **StringChange**: [`StringInsertion`](../../devkit/documents/nx_devkit#stringinsertion) \| [`StringDeletion`](../../devkit/documents/nx_devkit#stringdeletion) - -A change to be made to a string - ---- - -### TaskGraphExecutor - -Ƭ **TaskGraphExecutor**<`T`\>: (`taskGraph`: [`TaskGraph`](../../devkit/documents/nx_devkit#taskgraph), `options`: `Record`<`string`, `T`\>, `overrides`: `T`, `context`: [`ExecutorContext`](../../devkit/documents/nx_devkit#executorcontext)) => `Promise`<`BatchExecutorResult` \| `AsyncIterableIterator`<`BatchExecutorTaskResult`\>\> - -#### Type parameters - -| Name | Type | -| :--- | :---- | -| `T` | `any` | - -#### Type declaration - -▸ (`taskGraph`, `options`, `overrides`, `context`): `Promise`<`BatchExecutorResult` \| `AsyncIterableIterator`<`BatchExecutorTaskResult`\>\> - -Implementation of a target of a project that handles multiple projects to be batched - -##### Parameters - -| Name | Type | -| :---------- | :-------------------------------------------------------------------- | -| `taskGraph` | [`TaskGraph`](../../devkit/documents/nx_devkit#taskgraph) | -| `options` | `Record`<`string`, `T`\> | -| `overrides` | `T` | -| `context` | [`ExecutorContext`](../../devkit/documents/nx_devkit#executorcontext) | - -##### Returns - -`Promise`<`BatchExecutorResult` \| `AsyncIterableIterator`<`BatchExecutorTaskResult`\>\> - ---- - -### WorkspaceConfiguration - -Ƭ **WorkspaceConfiguration**: `Omit`<[`ProjectsConfigurations`](../../devkit/documents/nx_devkit#projectsconfigurations), `"projects"`\> & `Partial`<[`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration)\> - -**`Deprecated`** - -using NxJsonConfiguration - ---- - -### WorkspaceJsonConfiguration - -Ƭ **WorkspaceJsonConfiguration**: [`ProjectsConfigurations`](../../devkit/documents/nx_devkit#projectsconfigurations) - -**`Deprecated`** - -use ProjectsConfigurations - ---- - -### 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` | - -## Variables - -### NX_VERSION - -• `Const` **NX_VERSION**: `string` - -**`Description`** - -The version of Nx used by the workspace. Returns null if no version is found. - ---- - -### appRootPath - -• `Const` **appRootPath**: `string` = `workspaceRoot` - -The root of the workspace. - -**`Deprecated`** - -use workspaceRoot instead - ---- - -### cacheDir - -• `Const` **cacheDir**: `string` - -Path to the directory where Nx stores its cache and daemon-related files. - ---- - -### logger - -• `Const` **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` | - ---- - -### output - -• `Const` **output**: `CLIOutput` - ---- - -### workspaceRoot - -• **workspaceRoot**: `string` - -The root of the workspace - -## Functions - -### addDependenciesToPackageJson - -▸ **addDependenciesToPackageJson**(`tree`, `dependencies`, `devDependencies`, `packageJsonPath?`): [`GeneratorCallback`](../../devkit/documents/nx_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/nx_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/nx_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/nx_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/nx_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/nx_devkit#sharedlibraryconfig)\> | The original Shared Config | -| `additionalShared` | [`AdditionalSharedConfig`](../../devkit/documents/nx_devkit#additionalsharedconfig) | The additional dependencies to add | -| `projectGraph` | [`ProjectGraph`](../../devkit/documents/nx_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/nx_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/nx_devkit#sharedlibraryconfig)\> | The original Shared Config to be modified | -| `sharedFn` | [`SharedFunction`](../../devkit/documents/nx_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/nx_devkit#executor) | - -#### 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/nx_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`\> - ---- - -### createProjectFileMapUsingProjectGraph - -▸ **createProjectFileMapUsingProjectGraph**(`graph`): `Promise`<[`ProjectFileMap`](../../devkit/documents/nx_devkit#projectfilemap)\> - -#### Parameters - -| Name | Type | -| :------ | :-------------------------------------------------------------- | -| `graph` | [`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph) | - -#### Returns - -`Promise`<[`ProjectFileMap`](../../devkit/documents/nx_devkit#projectfilemap)\> - ---- - -### createProjectGraphAsync - -▸ **createProjectGraphAsync**(`opts?`): `Promise`<[`ProjectGraph`](../../devkit/documents/nx_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/nx_devkit#projectgraph)\> - ---- - -### defaultTasksRunner - -▸ **defaultTasksRunner**(`tasks`, `options`, `context?`): `any` - -`any | Promise<{ [id: string]: TaskStatus }>` -will change to Promise<{ [id: string]: TaskStatus }> after Nx 15 is released. - -#### Parameters - -| Name | Type | -| :--------------------------- | :-------------------------------------------------------------------------------------------------- | -| `tasks` | [`Task`](../../devkit/documents/nx_devkit#task)[] | -| `options` | [`DefaultTasksRunnerOptions`](../../devkit/documents/nx_devkit#defaulttasksrunneroptions) | -| `context?` | `Object` | -| `context.daemon?` | `DaemonClient` | -| `context.hasher?` | [`TaskHasher`](../../devkit/documents/nx_devkit#taskhasher) | -| `context.initiatingProject?` | `string` | -| `context.nxArgs` | `NxArgs` | -| `context.nxJson` | [`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration)<`string`[] \| `"*"`\> | -| `context.projectGraph` | [`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph) | -| `context.target?` | `string` | -| `context.taskGraph?` | [`TaskGraph`](../../devkit/documents/nx_devkit#taskgraph) | - -#### Returns - -`any` - ---- - -### detectPackageManager - -▸ **detectPackageManager**(`dir?`): [`PackageManager`](../../devkit/documents/nx_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/nx_devkit#packagemanager) - ---- - -### ensurePackage - -▸ **ensurePackage**(`tree`, `pkg`, `requiredVersion`, `options?`): `void` - -**`Deprecated`** - -Use the other function signature without a Tree - -Use a package that has not been installed as a dependency. - -For example: - -```typescript -ensurePackage(tree, '@nx/jest', nxVersion); -``` - -This install the @nx/jest@ and return the module -When running with --dryRun, the function will throw when dependencies are missing. -Returns null for ESM dependencies. Import them with a dynamic import instead. - -#### Parameters - -| Name | Type | Description | -| :------------------------ | :---------------------------------------------- | :----------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | the file system tree | -| `pkg` | `string` | the package to check (e.g. @nx/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` - -▸ **ensurePackage**<`T`\>(`pkg`, `version`): `T` - -Ensure that dependencies and devDependencies from package.json are installed at the required versions. -Returns null for ESM dependencies. Import them with a dynamic import instead. - -For example: - -```typescript -ensurePackage('@nx/jest', nxVersion); -``` - -#### Type parameters - -| Name | Type | -| :--- | :------------------------ | -| `T` | extends `unknown` = `any` | - -#### Parameters - -| Name | Type | Description | -| :-------- | :------- | :---------------------------------------------------------- | -| `pkg` | `string` | the package to install and require | -| `version` | `string` | the version to install if the package doesn't exist already | - -#### Returns - -`T` - ---- - -### 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/nx_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/nx_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/nx_devkit#projectgraph) | -| `name` | `string` | - -#### Returns - -`Object` - -| Name | Type | -| :------------------- | :------------------------------------------------------------------------ | -| `npmPackages` | `string`[] | -| `workspaceLibraries` | [`WorkspaceLibrary`](../../devkit/documents/nx_devkit#workspacelibrary)[] | - ---- - -### getNpmPackageSharedConfig - -▸ **getNpmPackageSharedConfig**(`pkgName`, `version`): [`SharedLibraryConfig`](../../devkit/documents/nx_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/nx_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/nx_devkit#task), `"overrides"` \| `"target"`\> | target + overrides | -| `node` | [`ProjectGraphProjectNode`](../../devkit/documents/nx_devkit#projectgraphprojectnode) | ProjectGraphProjectNode object that the task runs against | - -#### Returns - -`string`[] - ---- - -### getPackageManagerCommand - -▸ **getPackageManagerCommand**(`packageManager?`, `root?`): `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 | Default value | Description | -| :--------------- | :------------------------------------------------------------------ | :-------------- | :------------------------------------------------------------------------------------------ | -| `packageManager` | [`PackageManager`](../../devkit/documents/nx_devkit#packagemanager) | `undefined` | The package manager to use. If not provided, it will be detected based on the lock file. | -| `root` | `string` | `workspaceRoot` | The directory the commands will be ran inside of. Defaults to the current workspace's root. | - -#### Returns - -`PackageManagerCommands` - ---- - -### getPackageManagerVersion - -▸ **getPackageManagerVersion**(`packageManager?`, `cwd?`): `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/nx_devkit#packagemanager) | -| `cwd` | `string` | - -#### Returns - -`string` - ---- - -### getProjects - -▸ **getProjects**(`tree`): `Map`<`string`, [`ProjectConfiguration`](../../devkit/documents/nx_devkit#projectconfiguration)\> - -Get a map of all projects in a workspace. - -Use [readProjectConfiguration](../../devkit/documents/nx_devkit#readprojectconfiguration) if only one project is needed. - -#### Parameters - -| Name | Type | -| :----- | :---------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | - -#### Returns - -`Map`<`string`, [`ProjectConfiguration`](../../devkit/documents/nx_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/nx_devkit#tree) | file system tree | - -#### Returns - -`Object` - -| Name | Type | Description | -| :-------------------- | :-------- | :----------------------------------------------------------------------- | -| `appsDir` | `string` | - | -| `libsDir` | `string` | - | -| `npmScope` | `string` | **`Deprecated`** This will be removed in Nx 17. Use getNpmScope instead. | -| `standaloneAsDefault` | `boolean` | - | - ---- - -### getWorkspacePath - -▸ **getWorkspacePath**(`tree`): `"angular.json"` \| `"workspace.json"` - -**`Deprecated`** - -all projects are configured using project.json - -#### Parameters - -| Name | Type | -| :----- | :---------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | - -#### Returns - -`"angular.json"` \| `"workspace.json"` - ---- - -### hashArray - -▸ **hashArray**(`content`): `string` - -#### Parameters - -| Name | Type | -| :-------- | :--------- | -| `content` | `string`[] | - -#### Returns - -`string` - ---- - -### 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/nx_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/nx_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/nx_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/nx_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/nx_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/nx_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/nx_devkit#jsonparseoptions) | JSON parse options | - -#### Returns - -`T` - -Object the JSON content represents - ---- - -### parseTargetString - -▸ **parseTargetString**(`targetString`): [`Target`](../../devkit/documents/nx_devkit#target) - -@deprecated(v17) A project graph should be passed to parseTargetString for best accuracy. - -#### Parameters - -| Name | Type | -| :------------- | :------- | -| `targetString` | `string` | - -#### Returns - -[`Target`](../../devkit/documents/nx_devkit#target) - -▸ **parseTargetString**(`targetString`, `projectGraph`): [`Target`](../../devkit/documents/nx_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/nx_devkit#projectgraph) | - | - -#### Returns - -[`Target`](../../devkit/documents/nx_devkit#target) - ---- - -### readAllWorkspaceConfiguration - -▸ **readAllWorkspaceConfiguration**(): [`ProjectsConfigurations`](../../devkit/documents/nx_devkit#projectsconfigurations) & [`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration) - -**`Deprecated`** - -Use readProjectsConfigurationFromProjectGraph(await createProjectGraphAsync()) - -#### Returns - -[`ProjectsConfigurations`](../../devkit/documents/nx_devkit#projectsconfigurations) & [`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration) - ---- - -### readCachedProjectGraph - -▸ **readCachedProjectGraph**(): [`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph) - -Synchronously reads the latest cached copy of the workspace's ProjectGraph. - -**`Throws`** - -if there is no cached ProjectGraph to read from - -#### Returns - -[`ProjectGraph`](../../devkit/documents/nx_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/nx_devkit#tree) | file system tree | -| `path` | `string` | file path | -| `options?` | [`JsonParseOptions`](../../devkit/documents/nx_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/nx_devkit#nxjsonconfiguration) \| `null` - -**`Deprecated`** - -You must pass a [Tree](../../devkit/documents/nx_devkit#tree) - -#### Returns - -[`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration) \| `null` - -▸ **readNxJson**(`tree`): [`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration) \| `null` - -Reads nx.json - -#### Parameters - -| Name | Type | -| :----- | :---------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | - -#### Returns - -[`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration) \| `null` - ---- - -### readProjectConfiguration - -▸ **readProjectConfiguration**(`tree`, `projectName`): [`ProjectConfiguration`](../../devkit/documents/nx_devkit#projectconfiguration) - -Reads a project configuration. - -**`Throws`** - -If supplied projectName cannot be found - -#### Parameters - -| Name | Type | Description | -| :------------ | :---------------------------------------------- | :---------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nx_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/nx_devkit#projectconfiguration) - ---- - -### readRootPackageJson - -▸ **readRootPackageJson**(): `Object` - -#### Returns - -`Object` - -| Name | Type | -| :----------------- | :----------------------------- | -| `dependencies?` | { `[key: string]`: `string`; } | -| `devDependencies?` | { `[key: string]`: `string`; } | - ---- - -### readTargetOptions - -▸ **readTargetOptions**<`T`\>(`«destructured»`, `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 | -| :--------------- | :-------------------------------------------------------------------- | -| `«destructured»` | [`Target`](../../devkit/documents/nx_devkit#target) | -| `context` | [`ExecutorContext`](../../devkit/documents/nx_devkit#executorcontext) | - -#### Returns - -`T` - ---- - -### readWorkspaceConfiguration - -▸ **readWorkspaceConfiguration**(`tree`): [`WorkspaceConfiguration`](../../devkit/documents/nx_devkit#workspaceconfiguration) - -Read general workspace configuration such as the default project or cli settings - -This does _not_ provide projects configuration, use [readProjectConfiguration](../../devkit/documents/nx_devkit#readprojectconfiguration) instead. - -**`Deprecated`** - -use readNxJson - -#### Parameters - -| Name | Type | -| :----- | :---------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | - -#### Returns - -[`WorkspaceConfiguration`](../../devkit/documents/nx_devkit#workspaceconfiguration) - ---- - -### removeDependenciesFromPackageJson - -▸ **removeDependenciesFromPackageJson**(`tree`, `dependencies`, `devDependencies`, `packageJsonPath?`): [`GeneratorCallback`](../../devkit/documents/nx_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/nx_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/nx_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/nx_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/nx_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/nx_devkit#projectgraph) | - -#### Returns - -[`ProjectGraph`](../../devkit/documents/nx_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` | [`Target`](../../devkit/documents/nx_devkit#target) | -| `overrides` | `Object` | -| `context` | [`ExecutorContext`](../../devkit/documents/nx_devkit#executorcontext) | - -#### Returns - -`Promise`<`AsyncIterableIterator`<`T`\>\> - ---- - -### runTasksInSerial - -▸ **runTasksInSerial**(`...tasks`): [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) - -Run tasks in serial - -#### Parameters - -| Name | Type | Description | -| :--------- | :-------------------------------------------------------------------------- | :-------------------------- | -| `...tasks` | [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback)[] | The tasks to run in serial. | - -#### Returns - -[`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) - ---- - -### 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/nx_devkit#jsonserializeoptions) | JSON serialize options | - -#### Returns - -`string` - -the formatted JSON representation of the object - ---- - -### sharePackages - -▸ **sharePackages**(`packages`): `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nx_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/nx_devkit#sharedlibraryconfig)\> - ---- - -### shareWorkspaceLibraries - -▸ **shareWorkspaceLibraries**(`libraries`, `tsConfigPath?`): [`SharedWorkspaceLibraryConfig`](../../devkit/documents/nx_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/nx_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/nx_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 - -▸ **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/nx_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/nx_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/nx_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/nx_devkit#jsonparseoptions) & [`JsonSerializeOptions`](../../devkit/documents/nx_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/nx_devkit#tree) | -| `nxJson` | [`NxJsonConfiguration`](../../devkit/documents/nx_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/nx_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/nx_devkit#projectconfiguration) | project configuration | - -#### Returns - -`void` - ---- - -### updateTsConfigsToJs - -▸ **updateTsConfigsToJs**(`tree`, `options`): `void` - -#### Parameters - -| Name | Type | -| :-------------------- | :---------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nx_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/nx_devkit#updateprojectconfiguration) or [addProjectConfiguration](../../devkit/documents/nx_devkit#addprojectconfiguration) instead. - -**`Deprecated`** - -use updateNxJson - -#### Parameters - -| Name | Type | -| :---------------- | :---------------------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | -| `workspaceConfig` | [`WorkspaceConfiguration`](../../devkit/documents/nx_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/nx_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/nx_devkit#tree) | File system tree | -| `path` | `string` | Path of JSON file in the Tree | -| `value` | `T` | Serializable value to write | -| `options?` | [`JsonSerializeOptions`](../../devkit/documents/nx_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` +- [addDependenciesToPackageJson](../../devkit/documents/addDependenciesToPackageJson) +- [addProjectConfiguration](../../devkit/documents/addProjectConfiguration) +- [applyAdditionalShared](../../devkit/documents/applyAdditionalShared) +- [applyChangesToString](../../devkit/documents/applyChangesToString) +- [applySharedFunction](../../devkit/documents/applySharedFunction) +- [convertNxExecutor](../../devkit/documents/convertNxExecutor) +- [convertNxGenerator](../../devkit/documents/convertNxGenerator) +- [createProjectFileMapUsingProjectGraph](../../devkit/documents/createProjectFileMapUsingProjectGraph) +- [createProjectGraphAsync](../../devkit/documents/createProjectGraphAsync) +- [defaultTasksRunner](../../devkit/documents/defaultTasksRunner) +- [detectPackageManager](../../devkit/documents/detectPackageManager) +- [ensurePackage](../../devkit/documents/ensurePackage) +- [extractLayoutDirectory](../../devkit/documents/extractLayoutDirectory) +- [formatFiles](../../devkit/documents/formatFiles) +- [generateFiles](../../devkit/documents/generateFiles) +- [getDependentPackagesForProject](../../devkit/documents/getDependentPackagesForProject) +- [getNpmPackageSharedConfig](../../devkit/documents/getNpmPackageSharedConfig) +- [getOutputsForTargetAndConfiguration](../../devkit/documents/getOutputsForTargetAndConfiguration) +- [getPackageManagerCommand](../../devkit/documents/getPackageManagerCommand) +- [getPackageManagerVersion](../../devkit/documents/getPackageManagerVersion) +- [getProjects](../../devkit/documents/getProjects) +- [getWorkspaceLayout](../../devkit/documents/getWorkspaceLayout) +- [getWorkspacePath](../../devkit/documents/getWorkspacePath) +- [hashArray](../../devkit/documents/hashArray) +- [installPackagesTask](../../devkit/documents/installPackagesTask) +- [isStandaloneProject](../../devkit/documents/isStandaloneProject) +- [joinPathFragments](../../devkit/documents/joinPathFragments) +- [mapRemotes](../../devkit/documents/mapRemotes) +- [mapRemotesForSSR](../../devkit/documents/mapRemotesForSSR) +- [moveFilesToNewDirectory](../../devkit/documents/moveFilesToNewDirectory) +- [names](../../devkit/documents/names) +- [normalizePath](../../devkit/documents/normalizePath) +- [offsetFromRoot](../../devkit/documents/offsetFromRoot) +- [parseJson](../../devkit/documents/parseJson) +- [parseTargetString](../../devkit/documents/parseTargetString) +- [readAllWorkspaceConfiguration](../../devkit/documents/readAllWorkspaceConfiguration) +- [readCachedProjectGraph](../../devkit/documents/readCachedProjectGraph) +- [readJson](../../devkit/documents/readJson) +- [readJsonFile](../../devkit/documents/readJsonFile) +- [readNxJson](../../devkit/documents/readNxJson) +- [readProjectConfiguration](../../devkit/documents/readProjectConfiguration) +- [readRootPackageJson](../../devkit/documents/readRootPackageJson) +- [readTargetOptions](../../devkit/documents/readTargetOptions) +- [readWorkspaceConfiguration](../../devkit/documents/readWorkspaceConfiguration) +- [removeDependenciesFromPackageJson](../../devkit/documents/removeDependenciesFromPackageJson) +- [removeProjectConfiguration](../../devkit/documents/removeProjectConfiguration) +- [reverse](../../devkit/documents/reverse) +- [runExecutor](../../devkit/documents/runExecutor) +- [runTasksInSerial](../../devkit/documents/runTasksInSerial) +- [serializeJson](../../devkit/documents/serializeJson) +- [sharePackages](../../devkit/documents/sharePackages) +- [shareWorkspaceLibraries](../../devkit/documents/shareWorkspaceLibraries) +- [stripIndents](../../devkit/documents/stripIndents) +- [stripJsonComments](../../devkit/documents/stripJsonComments) +- [targetToTargetString](../../devkit/documents/targetToTargetString) +- [toJS](../../devkit/documents/toJS) +- [updateJson](../../devkit/documents/updateJson) +- [updateNxJson](../../devkit/documents/updateNxJson) +- [updateProjectConfiguration](../../devkit/documents/updateProjectConfiguration) +- [updateTsConfigsToJs](../../devkit/documents/updateTsConfigsToJs) +- [updateWorkspaceConfiguration](../../devkit/documents/updateWorkspaceConfiguration) +- [visitNotIgnoredFiles](../../devkit/documents/visitNotIgnoredFiles) +- [workspaceLayout](../../devkit/documents/workspaceLayout) +- [writeJson](../../devkit/documents/writeJson) +- [writeJsonFile](../../devkit/documents/writeJsonFile) diff --git a/docs/map.json b/docs/map.json index 92b438779d7bd..16a0ae8e41371 100644 --- a/docs/map.json +++ b/docs/map.json @@ -1776,12 +1776,12 @@ { "id": "nx_devkit", "name": "Overview", - "file": "generated/devkit/nx_devkit" + "file": "generated/devkit/README" }, { "id": "ngcli_adapter", "name": "Ng CLI Adapter", - "file": "generated/devkit/ngcli_adapter" + "file": "generated/devkit/ngcli_adapter/README" } ] }, diff --git a/nx-dev/data-access-documents/src/lib/documents.api.ts b/nx-dev/data-access-documents/src/lib/documents.api.ts index 582a41e4b10d8..dca0444acc63e 100644 --- a/nx-dev/data-access-documents/src/lib/documents.api.ts +++ b/nx-dev/data-access-documents/src/lib/documents.api.ts @@ -67,10 +67,27 @@ export class DocumentsApi { const document: DocumentMetadata | null = this.manifest[this.getManifestKey(path.join('/'))] || null; - if (!document) + if (!document) { + if ( + path[0] === 'packages' && + path[1] === 'devkit' && + path[2] === 'documents' + ) { + const file = `generated/devkit/${path.slice(3).join('/')}`; + return { + content: readFileSync(this.getFilePath(file), 'utf8'), + description: '', + filePath: this.getFilePath(file), + id: path.at(-1) || '', + name: path.at(-1) || '', + relatedDocuments: {}, + tags: [], + }; + } throw new Error( `Document not found in manifest with: "${path.join('/')}"` ); + } if (this.isDocumentIndex(document)) return this.getDocumentIndex(path); return { content: readFileSync(this.getFilePath(document.file), 'utf8'), diff --git a/nx-dev/data-access-packages/src/lib/packages.api.ts b/nx-dev/data-access-packages/src/lib/packages.api.ts index 897f90641967b..bc0595d1652b8 100644 --- a/nx-dev/data-access-packages/src/lib/packages.api.ts +++ b/nx-dev/data-access-packages/src/lib/packages.api.ts @@ -6,7 +6,7 @@ import { ProcessedPackageMetadata, SchemaMetadata, } from '@nx/nx-dev/models-package'; -import { readFileSync } from 'fs'; +import { readFileSync, lstatSync, readdirSync } from 'fs'; import { join } from 'path'; interface StaticDocumentPaths { @@ -92,6 +92,32 @@ export class PackagesApi { Object.keys(p.documents).map((path) => experiment.documents.push(generateSegments(path, this.options.prefix)) ); + if (p.name === 'devkit') { + readdirSync('../../docs/generated/devkit').forEach((fileName) => { + if (fileName.endsWith('.md')) { + experiment.documents.push( + generateSegments( + `packages/devkit/documents/${fileName.replace('.md', '')}`, + this.options.prefix + ) + ); + } else { + readdirSync('../../docs/generated/devkit/' + fileName).forEach( + (subFileName) => { + experiment.documents.push( + generateSegments( + `packages/devkit/documents/${fileName}/${subFileName.replace( + '.md', + '' + )}`, + this.options.prefix + ) + ); + } + ); + } + }); + } Object.keys(p.executors).forEach((path) => experiment.executors.push(generateSegments(path, this.options.prefix)) diff --git a/nx-dev/nx-dev-e2e/src/e2e/additional-api-references.cy.ts b/nx-dev/nx-dev-e2e/src/e2e/additional-api-references.cy.ts index ddfa59ad2ae29..60fab6376620c 100644 --- a/nx-dev/nx-dev-e2e/src/e2e/additional-api-references.cy.ts +++ b/nx-dev/nx-dev-e2e/src/e2e/additional-api-references.cy.ts @@ -47,11 +47,11 @@ describe('nx-dev: Additional API references section', () => { path: '/storybook/storybook-composition-setup', }, { - title: 'Module: @nx/devkit', + title: '@nx/devkit', path: '/devkit/index', }, { - title: 'Module: ngcli-adapter', + title: '@nx/devkit', path: '/devkit/ngcli_adapter', }, ]).forEach((page) => assertTextOnPage(page.path, page.title)); diff --git a/scripts/documentation/generators/generate-devkit-documentation.ts b/scripts/documentation/generators/generate-devkit-documentation.ts index fd500e23847ab..e2a140c4b480b 100644 --- a/scripts/documentation/generators/generate-devkit-documentation.ts +++ b/scripts/documentation/generators/generate-devkit-documentation.ts @@ -1,5 +1,6 @@ import * as chalk from 'chalk'; import { execSync, ExecSyncOptions } from 'child_process'; +import { readFileSync, writeFileSync } from 'fs'; import { join } from 'path'; export function generateDevkitDocumentation() { @@ -10,22 +11,35 @@ export function generateDevkitDocumentation() { }; execSync( - 'nx build typedoc-theme && rm -rf node_modules/@nx/typedoc-theme && cp -R dist/typedoc-theme node_modules/@nx/typedoc-theme', + 'nx build devkit && nx build typedoc-theme && rm -rf node_modules/@nx/typedoc-theme && cp -R dist/typedoc-theme node_modules/@nx/typedoc-theme', execSyncOptions ); execSync( - `rm -rf docs/generated/devkit && pnpm typedoc packages/devkit/index.d.ts packages/devkit/ngcli-adapter.ts --tsconfig packages/devkit/tsconfig.lib.json --out ./docs/generated/devkit --plugin typedoc-plugin-markdown --plugin @nx/typedoc-theme --hideBreadcrumbs true --disableSources --publicPath ../../devkit/ --theme nx-markdown-theme --readme none`, + 'cp packages/devkit/tsconfig.lib.json build/packages/devkit/tsconfig.lib.json', execSyncOptions ); + + writeFileSync( + 'build/packages/devkit/tsconfig.lib.json', + readFileSync('build/packages/devkit/tsconfig.lib.json') + .toString() + .replace( + '"extends": "./tsconfig.json"', + '"extends": "../../../packages/devkit/tsconfig.json"' + ) + ); + execSync( - `rm -rf docs/generated/devkit/modules.md docs/generated/devkit/.nojekyll`, + `rm -rf docs/generated/devkit && pnpm typedoc build/packages/devkit/index.d.ts --tsconfig build/packages/devkit/tsconfig.lib.json --out ./docs/generated/devkit --plugin typedoc-plugin-markdown --plugin @nx/typedoc-theme --hideBreadcrumbs true --disableSources --allReflectionsHaveOwnDocument --publicPath ../../devkit/ --theme nx-markdown-theme --readme none`, execSyncOptions ); execSync( - `rm -rf docs/generated/devkit/modules.md docs/generated/devkit/README.md`, + `pnpm typedoc build/packages/devkit/ngcli-adapter.d.ts --tsconfig build/packages/devkit/tsconfig.lib.json --out ./docs/generated/devkit/ngcli_adapter --plugin typedoc-plugin-markdown --plugin @nx/typedoc-theme --hideBreadcrumbs true --disableSources --allReflectionsHaveOwnDocument --publicPath ../../devkit/ngcli_adapter/ --theme nx-markdown-theme --readme none`, execSyncOptions ); + execSync(`rm -rf build/packages/devkit/tsconfig.lib.json`, execSyncOptions); + execSync(`rm -rf docs/generated/devkit/.nojekyll`, execSyncOptions); execSync( `pnpm prettier docs/generated/devkit --write --config ${join( __dirname, diff --git a/scripts/documentation/map-link-checker.ts b/scripts/documentation/map-link-checker.ts index ad5ebcb9831c7..ec0d9da8d4887 100644 --- a/scripts/documentation/map-link-checker.ts +++ b/scripts/documentation/map-link-checker.ts @@ -39,8 +39,12 @@ const mapPathList: string[] = readJsonSync(`${basePath}/map.json`, { }) .content.map((file: any) => filePathExtractor(file)) .flat(); -const readmeMissList = readmePathList.filter((x) => !mapPathList.includes(x)); -const mapMissList = mapPathList.filter((x) => !readmePathList.includes(x)); +const readmeMissList = readmePathList.filter( + (x) => !mapPathList.includes(x) && !x.startsWith('generated/devkit/') +); +const mapMissList = mapPathList.filter( + (x) => !readmePathList.includes(x) && !x.startsWith('generated/devkit/') +); let scriptError = false; diff --git a/typedoc-theme/src/lib/theme.ts b/typedoc-theme/src/lib/theme.ts index c27d37f7561cc..16034ef600a17 100644 --- a/typedoc-theme/src/lib/theme.ts +++ b/typedoc-theme/src/lib/theme.ts @@ -19,7 +19,7 @@ export default class NxMarkdownTheme extends MarkdownTheme { return ( super .render(page, template) - .replace(/.md#/gi, '#') + .replace(/.md/gi, '') /** * Hack: This is the simplest way to update the urls and make them work * in the `/packages/[name]/documents/[index|ngcli_adapter] context.