Rush StackShopBlogEvents
Skip to main content

Home > @microsoft/rush-lib > Subspace

Subspace class

This represents the subspace configurations for a repository, based on the "subspaces.json" configuration file.

Signature:

export declare class Subspace 

Constructors

Constructor

Modifiers

Description

(constructor)(options)

Constructs a new instance of the Subspace class

Properties

Property

Modifiers

Type

Description

subspaceName

readonly

string

Methods

Method

Modifiers

Description

contains(project)

(BETA) Returns true if the specified project belongs to this subspace.

getCommittedShrinkwrapFilename()

getCommittedShrinkwrapFilePath(variant)

(BETA) Gets the committed shrinkwrap file name for a specific variant.

getCommonVersions(variant)

(BETA) Gets the settings from the common-versions.json config file.

getCommonVersionsFilePath(variant)

(BETA) Gets the full path to the common-versions.json config file for this subspace.

Example (subspaces feature enabled): C:\MyRepo\common\config\subspaces\my-subspace\common-versions.json Example (subspaces feature disabled): C:\MyRepo\common\config\rush\common-versions.json

getPackageJsonInjectedDependenciesHash(variant)

(BETA) Returns hash value of injected dependencies in related package.json.

getPnpmCatalogsHash()

Computes a hash of the PNPM catalog definitions for this subspace. Returns undefined if no catalogs are defined.

getPnpmConfigFilePath()

(BETA) Gets the full path to the pnpm-config.json config file for this subspace.

Example (subspaces feature enabled): C:\MyRepo\common\config\subspaces\my-subspace\pnpm-config.json Example (subspaces feature disabled): C:\MyRepo\common\config\rush\pnpm-config.json

getPnpmfilePath(variant)

(BETA) Gets the absolute path for "pnpmfile.js" for a specific subspace.

getPnpmOptions()

(BETA) Returns the parsed contents of the pnpm-config.json config file.

getProjects()

(BETA) Returns the list of projects belonging to this subspace.

getRepoState()

(BETA) Gets the contents from the repo-state.json file.

getRepoStateFilePath()

(BETA) Gets the path to the repo-state.json file.

getSubspaceConfigFolderPath()

(BETA) Returns the full path of the folder containing this subspace's configuration files such as pnpm-lock.yaml.

Example (subspaces feature enabled): C:\MyRepo\common\config\subspaces\my-subspace Example (subspaces feature disabled): C:\MyRepo\common\config\rush

getSubspacePnpmPatchesFolderPath()

(BETA) Returns the full path of the folder containing this subspace's configuration files such as pnpm-lock.yaml.

Example (subspaces feature enabled): C:\MyRepo\common\config\subspaces\my-subspace\pnpm-patches Example (subspaces feature disabled): C:\MyRepo\common\pnpm-patches

getSubspaceTempFolderPath()

(BETA) The full path of the folder where the subspace's node_modules and other temporary files will be stored.

Example (subspaces feature enabled): C:\MyRepo\common\temp\subspaces\my-subspace Example (subspaces feature disabled): C:\MyRepo\common\temp

getTempShrinkwrapFilename()

(BETA) Returns full path of the temporary shrinkwrap file for a specific subspace and returns the common workspace shrinkwrap if no subspaceName is provided.

getTempShrinkwrapPreinstallFilename(subspaceName)

getTempShrinkwrapPreinstallFilePath()

(BETA) The full path of a backup copy of tempShrinkwrapFilename. This backup copy is made before installation begins, and can be compared to determine how the package manager modified tempShrinkwrapFilename.

getVariantDependentSubspaceConfigFolderPath(variant)

(BETA) Returns the full path of the folder containing this subspace's variant-dependent configuration files such as pnpm-lock.yaml.

Example (variants): C:\MyRepo\common\config\rush\variants\my-variant Example (variants and subspaces): C:\MyRepo\common\config\subspaces\my-subspace\variants\my-variant Example (subspaces): C:\MyRepo\common\config\subspaces\my-subspace Example (neither): C:\MyRepo\common\config\rush

shouldEnsureConsistentVersions(variant)

(BETA) Gets the ensureConsistentVersions property from the common-versions.json config file, or from the rush.json file if it isn't defined in common-versions.json