nx/docs/generated/devkit/Workspace.md
Jason Jean 23a217d8dd
feat(core): deprecate custom task runners (#28253)
## Current Behavior
<!-- This is the behavior we have today -->

Custom task runners are a high level abstraction to customize caching, a
relatively low level mechanism, to utilize other methods of remote
caching. The abstraction of custom task runners makes it hard for Nx to
make guarantees to make it faster.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Custom task runners are now deprecated. They will still work for Nx 20
but a warning will be shown when they are being used. The migration path
is to use Nx Cloud (the ideal caching solution) or a Nx Powerpack cache
(written by the Nx Core team which we can make guarantees about).

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-10-02 20:33:10 -04:00

13 KiB

Interface: Workspace

Deprecated

use ProjectsConfigurations or NxJsonConfiguration

Hierarchy

Table of contents

Properties

Properties

affected

Optional affected: NxAffectedConfig

Default options for nx affected

Deprecated

use defaultBase instead. For more information see https://nx.dev/deprecated/affected-config#affected-config

Inherited from

NxJsonConfiguration.affected


cacheDirectory

Optional cacheDirectory: string

Changes the directory used by Nx to store its cache.

Inherited from

NxJsonConfiguration.cacheDirectory


cli

Optional cli: Object

Default generator collection. It is used when no collection is provided.

Type declaration

Name Type
defaultProjectName? string
packageManager? PackageManager

Inherited from

NxJsonConfiguration.cli


defaultBase

Optional defaultBase: string

Default value for --base used by nx affected and nx format.

Inherited from

NxJsonConfiguration.defaultBase


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.defaultProject


enableDbCache

Optional enableDbCache: boolean

Enable the new experimental db based cache

Inherited from

NxJsonConfiguration.enableDbCache


extends

Optional extends: string

Optional (additional) Nx.json configuration file which becomes a base for this one

Inherited from

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.generators


implicitDependencies

Optional implicitDependencies: ImplicitDependencyEntry<string[] | "*">

Map of files to projects that implicitly depend on them

Deprecated

use namedInputs instead. For more information see https://nx.dev/deprecated/global-implicit-dependencies#global-implicit-dependencies

Inherited from

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.installation


namedInputs

Optional namedInputs: Object

Named inputs targets can refer to reduce duplication

Index signature

▪ [inputName: string]: (string | InputDefinition)[]

Inherited from

NxJsonConfiguration.namedInputs


neverConnectToCloud

Optional neverConnectToCloud: boolean

Set this to false to disable connection to Nx Cloud

Inherited from

NxJsonConfiguration.neverConnectToCloud


nxCloudAccessToken

Optional nxCloudAccessToken: string

If specified Nx will use nx-cloud by default with the given token. To use a different runner that accepts an access token, define it in tasksRunnerOptions

Inherited from

NxJsonConfiguration.nxCloudAccessToken


nxCloudEncryptionKey

Optional nxCloudEncryptionKey: string

Specifies the encryption key used to encrypt artifacts data before sending it to nx cloud.

Inherited from

NxJsonConfiguration.nxCloudEncryptionKey


nxCloudId

Optional nxCloudId: string

If specified Nx will use nx-cloud by default with the given cloud id. To use a different runner that accepts a cloud id, define it in tasksRunnerOptions

Inherited from

NxJsonConfiguration.nxCloudId


nxCloudUrl

Optional nxCloudUrl: string

Specifies the url pointing to an instance of nx cloud. Used for remote caching and displaying run links.

Inherited from

NxJsonConfiguration.nxCloudUrl


parallel

Optional parallel: number

Specifies how many tasks can be run in parallel.

Inherited from

NxJsonConfiguration.parallel


plugins

Optional plugins: PluginConfiguration[]

Plugins for extending the project graph

Inherited from

NxJsonConfiguration.plugins


pluginsConfig

Optional pluginsConfig: Record<string, Record<string, unknown>>

Configuration for Nx Plugins

Inherited from

NxJsonConfiguration.pluginsConfig


projects

projects: Record<string, ProjectConfiguration>

Projects' projects

Overrides

ProjectsConfigurations.projects


release

Optional release: NxReleaseConfiguration

Configuration for nx release (versioning and publishing of applications and libraries)

Inherited from

NxJsonConfiguration.release


sync

Optional sync: NxSyncConfiguration

Configuration for the nx sync command.

Inherited from

NxJsonConfiguration.sync


targetDefaults

Optional targetDefaults: TargetDefaults

Dependencies between different target names across all projects

Inherited from

NxJsonConfiguration.targetDefaults


tasksRunnerOptions

Optional tasksRunnerOptions: Object

Deprecated

Custom task runners will no longer be supported in Nx 21. Use Nx Cloud or Nx Powerpack instead. Available Task Runners for Nx to use

Index signature

▪ [tasksRunnerName: string]: { options?: any ; runner?: string }

Inherited from

NxJsonConfiguration.tasksRunnerOptions


useDaemonProcess

Optional useDaemonProcess: boolean

Set this to false to disable the daemon.

Inherited from

NxJsonConfiguration.useDaemonProcess


useInferencePlugins

Optional useInferencePlugins: boolean

Set this to false to disable adding inference plugins when generating new projects

Inherited from

NxJsonConfiguration.useInferencePlugins


version

version: number

Version of the configuration format

Inherited from

ProjectsConfigurations.version


workspaceLayout

Optional workspaceLayout: Object

Where new apps + libs should be placed

Type declaration

Name Type
appsDir? string
libsDir? string

Inherited from

NxJsonConfiguration.workspaceLayout