Rush StackShopBlogEvents
Skip to main content

Home > @microsoft/rush-lib > IOperationSettings

IOperationSettings interface

This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

export interface IOperationSettings 

Properties

Property

Modifiers

Type

Description

allowCobuildWithoutCache?

boolean

(ALPHA) (Optional) If true, this operation can use cobuilds for orchestration without restoring build cache entries.

dependsOnAdditionalFiles?

string[]

(ALPHA) (Optional) An optional list of glob (minimatch) patterns pointing to files that can affect this operation. The hash values of the contents of these files will become part of the final hash when reading and writing the build cache.

Note: if a particular file will be matched by patterns provided by both incrementalBuildIgnoredGlobs and dependsOnAdditionalFiles options - dependsOnAdditionalFiles will win and the file will be included calculating final hash value when reading and writing the build cache

dependsOnEnvVars?

string[]

(ALPHA) (Optional) An optional list of environment variables that can affect this operation. The values of these environment variables will become part of the hash when reading and writing the build cache.

Note: generally speaking, all environment variables available to Rush are also available to any operations performed -- Rush assumes that environment variables do not affect build outputs unless you list them here.

dependsOnNodeVersion?

boolean | NodeVersionGranularity

(ALPHA) (Optional) Specifies whether and at what granularity the Node.js version should be included in the hash used for the build cache. When enabled, changing the Node.js version at the specified granularity will invalidate cached outputs and cause the operation to be re-executed. This is useful for projects that produce Node.js-version-specific outputs, such as native module builds.

Allowed values: - true — alias for "patch", includes the full version (e.g. 18.17.1) - "major" — includes only the major version (e.g. 18) - "minor" — includes the major and minor version (e.g. 18.17) - "patch" — includes the full version (e.g. 18.17.1)

disableBuildCacheForOperation?

boolean

(ALPHA) (Optional) Disable caching for this operation. The operation will never be restored from cache. This may be useful if this operation affects state outside of its folder.

This option is only used when the build cache is enabled for the repo. You can set disableBuildCacheForOperation=true to disable caching for a specific project operation. This is a useful workaround if that project's build scripts violate the assumptions of the cache, for example by writing files outside the project folder. Where possible, a better solution is to improve the build scripts to be compatible with caching.

ignoreChangedProjectsOnlyFlag?

boolean

(ALPHA) (Optional) If true, this operation will never be skipped by the --changed-projects-only flag.

operationName

string

(ALPHA) The name of the operation. This should be a key in the package.json's scripts object.

outputFolderNames?

string[]

(ALPHA) (Optional) Specify the folders where this operation writes its output files. If enabled, the Rush build cache will restore these folders from the cache. The strings are folder names under the project root folder.

These folders should not be tracked by Git. They must not contain symlinks.

parameterNamesToIgnore?

string[]

(ALPHA) (Optional) An optional list of custom command-line parameter names (their parameterLongName values from command-line.json) that should be ignored when invoking the command for this operation. This allows a project to opt out of parameters that don't affect its operation, preventing unnecessary cache invalidation for this operation and its consumers.

sharding?

IRushPhaseSharding

(ALPHA) (Optional) An optional config object for sharding the operation. If specified, the operation will be sharded into multiple invocations. The count property specifies the number of shards to create. The shardArgumentFormat property specifies the format of the argument to pass to the command to indicate the shard index and count. The default value is --shard={shardIndex}/{shardCount}.

weight?

number

(ALPHA) (Optional) How many concurrency units this operation should take up during execution. The maximum concurrent units is determined by the -p flag.