@rushstack/rush-sdk 5.112.2 → 5.113.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/rush-lib.d.ts +244 -89
  2. package/dist/tsdoc-metadata.json +1 -1
  3. package/lib/api/ExperimentsConfiguration.d.ts +2 -2
  4. package/lib/api/LastInstallFlag.d.ts +2 -1
  5. package/lib/api/LastLinkFlag.d.ts +2 -2
  6. package/lib/api/PackageJsonEditor.d.ts +15 -0
  7. package/lib/api/RushConfiguration.d.ts +56 -74
  8. package/lib/api/RushConfigurationProject.d.ts +14 -8
  9. package/lib/api/Subspace.d.ts +117 -0
  10. package/lib/api/{SubspaceConfiguration.js → Subspace.js} +1 -1
  11. package/lib/api/SubspacesConfiguration.d.ts +59 -0
  12. package/lib/api/SubspacesConfiguration.js +1 -0
  13. package/lib/api/VersionPolicyConfiguration.d.ts +1 -1
  14. package/lib/api/packageManager/PnpmPackageManager.d.ts +7 -0
  15. package/lib/cli/actions/BaseInstallAction.d.ts +4 -0
  16. package/lib/index.d.ts +3 -2
  17. package/lib/logic/ChangeManager.d.ts +1 -1
  18. package/lib/logic/ChangelogGenerator.d.ts +2 -2
  19. package/lib/logic/PublishUtilities.d.ts +2 -2
  20. package/lib/logic/RepoStateFile.d.ts +5 -3
  21. package/lib/logic/RushConstants.d.ts +8 -0
  22. package/lib/logic/base/BaseInstallManagerTypes.d.ts +5 -0
  23. package/lib/logic/base/BaseShrinkwrapFile.d.ts +3 -2
  24. package/lib/logic/installManager/InstallHelpers.d.ts +2 -1
  25. package/lib/logic/npm/NpmShrinkwrapFile.d.ts +2 -1
  26. package/lib/logic/pnpm/IPnpmfile.d.ts +15 -0
  27. package/lib/logic/pnpm/PnpmShrinkwrapFile.d.ts +8 -2
  28. package/lib/logic/pnpm/PnpmfileConfiguration.d.ts +3 -2
  29. package/lib/logic/policy/PolicyValidator.d.ts +2 -1
  30. package/lib/logic/policy/ShrinkwrapFilePolicy.d.ts +2 -1
  31. package/lib/logic/selectors/SubspaceSelectorParser.d.ts +10 -0
  32. package/lib/logic/selectors/SubspaceSelectorParser.js +1 -0
  33. package/lib/logic/versionMismatch/VersionMismatchFinder.d.ts +2 -0
  34. package/lib/logic/yarn/YarnShrinkwrapFile.d.ts +2 -1
  35. package/lib/utilities/PathConstants.d.ts +1 -0
  36. package/lib/utilities/Utilities.d.ts +4 -0
  37. package/lib/utilities/npmrcUtilities.d.ts +1 -1
  38. package/lib-shim/helpers.js.map +1 -1
  39. package/lib-shim/index.js.map +1 -1
  40. package/lib-shim/loader.js.map +1 -1
  41. package/package.json +6 -6
  42. package/lib/api/SubspaceConfiguration.d.ts +0 -26
@@ -1280,12 +1280,12 @@ export declare interface IExecutionResult {
1280
1280
  export declare interface IExperimentsJson {
1281
1281
  /**
1282
1282
  * By default, 'rush install' passes --no-prefer-frozen-lockfile to 'pnpm install'.
1283
- * Set this option to true to pass '--frozen-lockfile' instead.
1283
+ * Set this option to true to pass '--frozen-lockfile' instead for faster installs.
1284
1284
  */
1285
1285
  usePnpmFrozenLockfileForRushInstall?: boolean;
1286
1286
  /**
1287
1287
  * By default, 'rush update' passes --no-prefer-frozen-lockfile to 'pnpm install'.
1288
- * Set this option to true to pass '--prefer-frozen-lockfile' instead.
1288
+ * Set this option to true to pass '--prefer-frozen-lockfile' instead to minimize shrinkwrap changes.
1289
1289
  */
1290
1290
  usePnpmPreferFrozenLockfileForRushUpdate?: boolean;
1291
1291
  /**
@@ -2020,6 +2020,10 @@ declare interface IRushConfigurationProjectOptions {
2020
2020
  * If specified, validate project tags against this list.
2021
2021
  */
2022
2022
  allowedProjectTags: Set<string> | undefined;
2023
+ /**
2024
+ * The containing subspace.
2025
+ */
2026
+ subspace: Subspace;
2023
2027
  }
2024
2028
 
2025
2029
  /**
@@ -2160,6 +2164,15 @@ export declare interface IStopwatchResult {
2160
2164
  get endTime(): number | undefined;
2161
2165
  }
2162
2166
 
2167
+ /**
2168
+ * @internal
2169
+ */
2170
+ declare interface ISubspaceOptions {
2171
+ subspaceName: string;
2172
+ rushConfiguration: RushConfiguration;
2173
+ splitWorkspaceCompatibility: boolean;
2174
+ }
2175
+
2163
2176
  /**
2164
2177
  * @beta
2165
2178
  */
@@ -2719,12 +2732,24 @@ export declare class PackageJsonDependency {
2719
2732
  setVersion(newVersion: string): void;
2720
2733
  }
2721
2734
 
2735
+ /**
2736
+ * @public
2737
+ */
2738
+ export declare class PackageJsonDependencyMeta {
2739
+ private _injected;
2740
+ private _onChange;
2741
+ readonly name: string;
2742
+ constructor(name: string, injected: boolean, onChange: () => void);
2743
+ get injected(): boolean;
2744
+ }
2745
+
2722
2746
  /**
2723
2747
  * @public
2724
2748
  */
2725
2749
  export declare class PackageJsonEditor {
2726
2750
  private readonly _dependencies;
2727
2751
  private readonly _devDependencies;
2752
+ private readonly _dependenciesMeta;
2728
2753
  private readonly _resolutions;
2729
2754
  private _modified;
2730
2755
  private _sourceData;
@@ -2745,6 +2770,10 @@ export declare class PackageJsonEditor {
2745
2770
  * The list of dependencies of type DependencyType.Dev.
2746
2771
  */
2747
2772
  get devDependencyList(): ReadonlyArray<PackageJsonDependency>;
2773
+ /**
2774
+ * The list of dependenciesMeta in package.json.
2775
+ */
2776
+ get dependencyMetaList(): ReadonlyArray<PackageJsonDependencyMeta>;
2748
2777
  /**
2749
2778
  * This field is a Yarn-specific feature that allows overriding of package resolution.
2750
2779
  *
@@ -3154,7 +3183,6 @@ export declare class ProjectChangeAnalyzer {
3154
3183
  */
3155
3184
  export declare class RepoStateFile {
3156
3185
  private static _jsonSchema;
3157
- private _variant;
3158
3186
  private _pnpmShrinkwrapHash;
3159
3187
  private _preferredVersionsHash;
3160
3188
  private _isValid;
@@ -3183,16 +3211,18 @@ export declare class RepoStateFile {
3183
3211
  * @param jsonFilename - The path to the repo-state.json file.
3184
3212
  * @param variant - The variant currently being used by Rush.
3185
3213
  */
3186
- static loadFromFile(jsonFilename: string, variant: string | undefined): RepoStateFile;
3214
+ static loadFromFile(jsonFilename: string): RepoStateFile;
3187
3215
  /**
3188
3216
  * Refresh the data contained in repo-state.json using the current state
3189
3217
  * of the Rush repo, and save the file if changes were made.
3190
3218
  *
3191
3219
  * @param rushConfiguration - The Rush configuration for the repo.
3220
+ * @param subspace - The subspace that repo-state.json was loaded from,
3221
+ * or `undefined` for the default subspace.
3192
3222
  *
3193
3223
  * @returns true if the file was modified, otherwise false.
3194
3224
  */
3195
- refreshState(rushConfiguration: RushConfiguration): boolean;
3225
+ refreshState(rushConfiguration: RushConfiguration, subspace: Subspace | undefined): boolean;
3196
3226
  /**
3197
3227
  * Writes the "repo-state.json" file to disk, using the filename that was passed to loadFromFile().
3198
3228
  */
@@ -3273,8 +3303,9 @@ export declare class RushConfiguration {
3273
3303
  private _projects;
3274
3304
  private _projectsByName;
3275
3305
  private _projectsByTag;
3276
- private _rushProjectsBySubspaceName;
3277
3306
  private _commonVersionsConfigurationsByVariant;
3307
+ private readonly _subspacesByName;
3308
+ private readonly _subspaces;
3278
3309
  /**
3279
3310
  * The name of the package manager being used to install dependencies
3280
3311
  */
@@ -3364,29 +3395,15 @@ export declare class RushConfiguration {
3364
3395
  * Example: `npm-shrinkwrap.json` or `pnpm-lock.yaml`
3365
3396
  */
3366
3397
  readonly shrinkwrapFilename: string;
3367
- /**
3368
- * The full path of the temporary shrinkwrap file that is used during "rush install".
3369
- * This file may get rewritten by the package manager during installation.
3370
- * @remarks
3371
- * This property merely reports the filename; the file itself may not actually exist.
3372
- * Example: `C:\MyRepo\common\temp\npm-shrinkwrap.json` or `C:\MyRepo\common\temp\pnpm-lock.yaml`
3373
- */
3374
- readonly tempShrinkwrapFilename: string;
3375
- /**
3376
- * The full path of a backup copy of tempShrinkwrapFilename. This backup copy is made
3377
- * before installation begins, and can be compared to determine how the package manager
3378
- * modified tempShrinkwrapFilename.
3379
- * @remarks
3380
- * This property merely reports the filename; the file itself may not actually exist.
3381
- * Example: `C:\MyRepo\common\temp\npm-shrinkwrap-preinstall.json`
3382
- * or `C:\MyRepo\common\temp\pnpm-lock-preinstall.yaml`
3383
- */
3384
- readonly tempShrinkwrapPreinstallFilename: string;
3385
3398
  /**
3386
3399
  * The object that specifies subspace configurations if they are provided in the rush workspace.
3387
3400
  * @beta
3388
3401
  */
3389
- readonly subspaceConfiguration?: SubspaceConfiguration;
3402
+ readonly subspacesConfiguration: SubspacesConfiguration | undefined;
3403
+ /**
3404
+ * Returns true if subspaces.json is present with "subspacesEnabled=true".
3405
+ */
3406
+ readonly subspacesFeatureEnabled: boolean;
3390
3407
  /**
3391
3408
  * The filename of the variant dependency data file. By default this is
3392
3409
  * called 'current-variant.json' resides in the Rush common folder.
@@ -3615,35 +3632,27 @@ export declare class RushConfiguration {
3615
3632
  */
3616
3633
  get rushPluginOptionsFolder(): string;
3617
3634
  /**
3618
- * The full path of the shrinkwrap file that is tracked by Git. (The "rush install"
3619
- * command uses a temporary copy, whose path is tempShrinkwrapFilename.)
3635
+ * The full path of the temporary shrinkwrap file that is used during "rush install".
3636
+ * This file may get rewritten by the package manager during installation.
3620
3637
  * @remarks
3621
3638
  * This property merely reports the filename; the file itself may not actually exist.
3622
- * Example: `C:\MyRepo\common\npm-shrinkwrap.json` or `C:\MyRepo\common\pnpm-lock.yaml`
3639
+ * Example: `C:\MyRepo\common\temp\npm-shrinkwrap.json` or `C:\MyRepo\common\temp\pnpm-lock.yaml`
3623
3640
  *
3624
- * @deprecated Use `getCommittedShrinkwrapFilename` instead, which gets the correct common
3625
- * shrinkwrap file name for a given active variant.
3626
- */
3627
- get committedShrinkwrapFilename(): string;
3628
- /**
3629
- * Returns full path of the temporary shrinkwrap file for a specific subspace.
3630
- * @remarks
3631
- * This function takes the subspace name, and returns the full path for the subspace's shrinkwrap file.
3632
- * This function also consults the deprecated option to allow for shrinkwraps to be stored under a package folder.
3633
- * This shrinkwrap file is used during "rush install", and may be rewritten by the package manager during installation
3634
- * This property merely reports the filename, the file itself may not actually exist.
3635
- * example: `C:\MyRepo\common\<subspace_name>\pnpm-lock.yaml`
3636
- * @beta
3641
+ * @deprecated Introduced with subspaces is subspace specific tempShrinkwrapFilename accessible from the Subspace class.
3637
3642
  */
3638
- getTempSubspaceShrinkwrapFileName(subspaceName: string): string;
3643
+ get tempShrinkwrapFilename(): string;
3639
3644
  /**
3640
- * The filename (without any path) of the shrinkwrap file used for individual subspaces, used by the package manager.
3645
+ * The full path of a backup copy of tempShrinkwrapFilename. This backup copy is made
3646
+ * before installation begins, and can be compared to determine how the package manager
3647
+ * modified tempShrinkwrapFilename.
3641
3648
  * @remarks
3642
- * This property merely reports the filename; The file itself may not actually exist.
3643
- * Example: From "pnpm-lock.yaml" to "subspace-pnpm-lock.yaml"
3644
- * @beta
3649
+ * This property merely reports the filename; the file itself may not actually exist.
3650
+ * Example: `C:\MyRepo\common\temp\npm-shrinkwrap-preinstall.json`
3651
+ * or `C:\MyRepo\common\temp\pnpm-lock-preinstall.yaml`
3652
+ *
3653
+ * @deprecated Introduced with subspaces is subspace specific tempShrinkwrapPreinstallFilename accessible from the Subspace class.
3645
3654
  */
3646
- subspaceShrinkwrapFilenames(subspaceName: string): string;
3655
+ get tempShrinkwrapPreinstallFilename(): string;
3647
3656
  /**
3648
3657
  * Returns an English phrase such as "shrinkwrap file" that can be used in logging messages
3649
3658
  * to refer to the shrinkwrap file using appropriate terminology for the currently selected
@@ -3666,15 +3675,32 @@ export declare class RushConfiguration {
3666
3675
  */
3667
3676
  get repositoryDefaultFullyQualifiedRemoteBranch(): string;
3668
3677
  get projects(): RushConfigurationProject[];
3678
+ /**
3679
+ * @beta
3680
+ */
3681
+ get defaultSubspace(): Subspace;
3669
3682
  /**
3670
3683
  * A list of all the available subspaces in this workspace.
3671
3684
  * @beta
3672
3685
  */
3673
- get subspaceNames(): Iterable<string>;
3686
+ get subspaces(): readonly Subspace[];
3687
+ /**
3688
+ * @beta
3689
+ */
3690
+ tryGetSubspace(subspaceName: string): Subspace | undefined;
3691
+ /**
3692
+ * @beta
3693
+ */
3694
+ getSubspace(subspaceName: string): Subspace;
3695
+ /**
3696
+ * Returns the set of subspaces that the given projects belong to
3697
+ * @beta
3698
+ */
3699
+ getSubspacesForProjects(projects: ReadonlySet<RushConfigurationProject>): ReadonlySet<Subspace>;
3674
3700
  /**
3675
3701
  * @beta
3676
3702
  */
3677
- get projectsByName(): Map<string, RushConfigurationProject>;
3703
+ get projectsByName(): ReadonlyMap<string, RushConfigurationProject>;
3678
3704
  /**
3679
3705
  * Obtains the mapping from custom tags to projects.
3680
3706
  * @beta
@@ -3699,21 +3725,13 @@ export declare class RushConfiguration {
3699
3725
  */
3700
3726
  get currentInstalledVariant(): string | undefined;
3701
3727
  /**
3702
- * Gets the path to the common-versions.json config file for a specific variant.
3703
- * @param variant - The name of the current variant in use by the active command.
3728
+ * @deprecated Use {@link Subspace.getCommonVersionsFilePath} instead
3704
3729
  */
3705
- getCommonVersionsFilePath(variant?: string | undefined): string;
3730
+ getCommonVersionsFilePath(subspace?: Subspace): string;
3706
3731
  /**
3707
- * Returns `true` if the subspaces feature is enabled and at least one subspaces is defined
3708
- * in the `subspaces.json` config file.
3709
- * @beta
3732
+ * @deprecated Use {@link Subspace.getCommonVersions} instead
3710
3733
  */
3711
- get hasSubspaces(): boolean;
3712
- /**
3713
- * Gets the settings from the common-versions.json config file for a specific variant.
3714
- * @param variant - The name of the current variant in use by the active command.
3715
- */
3716
- getCommonVersions(variant?: string | undefined): CommonVersionsConfiguration;
3734
+ getCommonVersions(subspace?: Subspace): CommonVersionsConfiguration;
3717
3735
  /**
3718
3736
  * Returns a map of all direct dependencies that only have a single semantic version specifier.
3719
3737
  * @param variant - The name of the current variant in use by the active command.
@@ -3722,27 +3740,21 @@ export declare class RushConfiguration {
3722
3740
  */
3723
3741
  getImplicitlyPreferredVersions(variant?: string | undefined): Map<string, string>;
3724
3742
  /**
3725
- * Gets the path to the repo-state.json file for a specific variant.
3726
- * @param variant - The name of the current variant in use by the active command.
3743
+ * @deprecated Use {@link Subspace.getRepoStateFilePath} instead
3727
3744
  */
3728
- getRepoStateFilePath(variant?: string | undefined): string;
3745
+ getRepoStateFilePath(subspace?: Subspace): string;
3729
3746
  /**
3730
- * Gets the contents from the repo-state.json file for a specific variant.
3731
- * @param variant - The name of the current variant in use by the active command.
3747
+ * @deprecated Use {@link Subspace.getRepoState} instead
3732
3748
  */
3733
- getRepoState(variant?: string | undefined): RepoStateFile;
3749
+ getRepoState(subspace?: Subspace): RepoStateFile;
3734
3750
  /**
3735
- * Gets the committed shrinkwrap file name for a specific variant.
3736
- * @param variant - The name of the current variant in use by the active command.
3751
+ * @deprecated Use {@link Subspace.getCommittedShrinkwrapFilename} instead
3737
3752
  */
3738
- getCommittedShrinkwrapFilename(variant?: string | undefined): string;
3753
+ getCommittedShrinkwrapFilename(subspace?: Subspace): string;
3739
3754
  /**
3740
- * Gets the absolute path for "pnpmfile.js" for a specific variant.
3741
- * @param variant - The name of the current variant in use by the active command.
3742
- * @remarks
3743
- * The file path is returned even if PNPM is not configured as the package manager.
3755
+ * @deprecated Use {@link Subspace.getRepoStateFilePath} instead
3744
3756
  */
3745
- getPnpmfilePath(variant?: string | undefined): string;
3757
+ getPnpmfilePath(subspace?: Subspace): string;
3746
3758
  /**
3747
3759
  * Looks up a project in the projectsByName map. If the project is not found,
3748
3760
  * then undefined is returned.
@@ -3770,7 +3782,6 @@ export declare class RushConfiguration {
3770
3782
  * If the path is not under any project's folder, returns undefined.
3771
3783
  */
3772
3784
  tryGetProjectForPath(currentFolderPath: string): RushConfigurationProject | undefined;
3773
- private _getVariantConfigFolderPath;
3774
3785
  }
3775
3786
 
3776
3787
  /**
@@ -3819,6 +3830,11 @@ export declare class RushConfigurationProject {
3819
3830
  * The Rush configuration for the monorepo that the project belongs to.
3820
3831
  */
3821
3832
  readonly rushConfiguration: RushConfiguration;
3833
+ /**
3834
+ * Returns the subspace name that a project belongs to.
3835
+ * If subspaces is not enabled, returns the default subspace.
3836
+ */
3837
+ readonly subspace: Subspace;
3822
3838
  /**
3823
3839
  * The review category name, or undefined if no category was assigned.
3824
3840
  * This name must be one of the valid choices listed in RushConfiguration.reviewCategories.
@@ -3887,17 +3903,13 @@ export declare class RushConfigurationProject {
3887
3903
  */
3888
3904
  readonly tags: ReadonlySet<string>;
3889
3905
  /**
3890
- * Returns the name of the subspace that this project belongs to, as assigned by the `"subspaceName"`
3891
- * property in `rush.json`.
3892
- *
3893
- * @remarks
3894
- * If the Rush subspaces feature is disabled, the value is still return.
3895
- * When the Rush subspaces feature is enabled, an undefined `subspaceName` specifies that
3896
- * the project belongs to the default subspace (whose name is `"default"`).
3906
+ * Returns the subspace name specified in the `"subspaceName"` field in `rush.json`.
3907
+ * Note that this field may be undefined, if the `default` subspace is being used,
3908
+ * and this field may be ignored if the subspaces feature is disabled.
3897
3909
  *
3898
3910
  * @beta
3899
3911
  */
3900
- readonly subspaceName: string | undefined;
3912
+ readonly configuredSubspaceName: string | undefined;
3901
3913
  /** @internal */
3902
3914
  constructor(options: IRushConfigurationProjectOptions);
3903
3915
  /**
@@ -4039,6 +4051,10 @@ export declare class RushConstants {
4039
4051
  * The filename (".pnpmfile.cjs") used to add custom configuration to PNPM (PNPM version 6.x and later).
4040
4052
  */
4041
4053
  static readonly pnpmfileV6Filename: string;
4054
+ /**
4055
+ * The filename ("global-pnpmfile.cjs") used to add custom configuration to subspaces
4056
+ */
4057
+ static readonly pnpmfileGlobalFilename: string;
4042
4058
  /**
4043
4059
  * The folder name used to store patch files for pnpm
4044
4060
  * Example: `C:\MyRepo\common\config\pnpm-patches`
@@ -4113,6 +4129,10 @@ export declare class RushConstants {
4113
4129
  * The subspaces.json configuration file name
4114
4130
  */
4115
4131
  static readonly subspacesConfigFilename: string;
4132
+ /**
4133
+ * The name of the default subspace if one isn't specified but subspaces is enabled.
4134
+ */
4135
+ static readonly defaultSubspaceName: string;
4116
4136
  /**
4117
4137
  * Build cache configuration file.
4118
4138
  */
@@ -4377,24 +4397,159 @@ export declare class RushUserConfiguration {
4377
4397
  static getRushUserFolderPath(): string;
4378
4398
  }
4379
4399
 
4400
+ /**
4401
+ * This represents the subspace configurations for a repository, based on the "subspaces.json"
4402
+ * configuration file.
4403
+ * @public
4404
+ */
4405
+ export declare class Subspace {
4406
+ readonly subspaceName: string;
4407
+ private readonly _rushConfiguration;
4408
+ private readonly _projects;
4409
+ private readonly _splitWorkspaceCompatibility;
4410
+ private _commonVersionsConfiguration;
4411
+ private _detail;
4412
+ constructor(options: ISubspaceOptions);
4413
+ /**
4414
+ * Returns the list of projects belonging to this subspace.
4415
+ * @beta
4416
+ */
4417
+ getProjects(): RushConfigurationProject[];
4418
+ private _ensureDetail;
4419
+ /**
4420
+ * Returns the full path of the folder containing this subspace's configuration files such as `pnpm-lock.yaml`.
4421
+ *
4422
+ * Example: `common/config/subspaces/my-subspace`
4423
+ * @beta
4424
+ */
4425
+ getSubspaceConfigFolder(): string;
4426
+ /**
4427
+ * The folder where the subspace's node_modules and other temporary files will be stored.
4428
+ *
4429
+ * Example: `common/temp/subspaces/my-subspace`
4430
+ * @beta
4431
+ */
4432
+ getSubspaceTempFolder(): string;
4433
+ /**
4434
+ * Returns full path of the temporary shrinkwrap file for a specific subspace and returns the common workspace
4435
+ * shrinkwrap if no subspaceName is provided.
4436
+ * @remarks
4437
+ * This function takes the subspace name, and returns the full path for the subspace's shrinkwrap file.
4438
+ * This function also consults the deprecated option to allow for shrinkwraps to be stored under a package folder.
4439
+ * This shrinkwrap file is used during "rush install", and may be rewritten by the package manager during installation
4440
+ * This property merely reports the filename, the file itself may not actually exist.
4441
+ * example: `C:\MyRepo\common\<subspace_name>\pnpm-lock.yaml`
4442
+ * @beta
4443
+ */
4444
+ getTempShrinkwrapFilename(): string;
4445
+ /**
4446
+ * The full path of a backup copy of tempShrinkwrapFilename. This backup copy is made
4447
+ * before installation begins, and can be compared to determine how the package manager
4448
+ * modified tempShrinkwrapFilename.
4449
+ * @remarks
4450
+ * This property merely reports the filename; the file itself may not actually exist.
4451
+ * Example: `C:\MyRepo\common\temp\npm-shrinkwrap-preinstall.json`
4452
+ * or `C:\MyRepo\common\temp\pnpm-lock-preinstall.yaml`
4453
+ * @beta
4454
+ */
4455
+ getTempShrinkwrapPreinstallFilename(subspaceName?: string | undefined): string;
4456
+ /**
4457
+ * Gets the path to the common-versions.json config file for this subspace.
4458
+ *
4459
+ * Example: `C:\MyRepo\common\subspaces\my-subspace\common-versions.json`
4460
+ * @beta
4461
+ */
4462
+ getCommonVersionsFilePath(): string;
4463
+ /**
4464
+ * Gets the settings from the common-versions.json config file for a specific variant.
4465
+ * @param variant - The name of the current variant in use by the active command.
4466
+ * @beta
4467
+ */
4468
+ getCommonVersions(): CommonVersionsConfiguration;
4469
+ /**
4470
+ * Gets the path to the repo-state.json file for a specific variant.
4471
+ * @param variant - The name of the current variant in use by the active command.
4472
+ * @beta
4473
+ */
4474
+ getRepoStateFilePath(): string;
4475
+ /**
4476
+ * Gets the contents from the repo-state.json file for a specific variant.
4477
+ * @param subspaceName - The name of the subspace in use by the active command.
4478
+ * @param variant - The name of the current variant in use by the active command.
4479
+ * @beta
4480
+ */
4481
+ getRepoState(): RepoStateFile;
4482
+ /**
4483
+ * Gets the committed shrinkwrap file name for a specific variant.
4484
+ * @param variant - The name of the current variant in use by the active command.
4485
+ * @beta
4486
+ */
4487
+ getCommittedShrinkwrapFilename(): string;
4488
+ /**
4489
+ * Gets the absolute path for "pnpmfile.js" for a specific subspace.
4490
+ * @param subspace - The name of the current subspace in use by the active command.
4491
+ * @remarks
4492
+ * The file path is returned even if PNPM is not configured as the package manager.
4493
+ * @beta
4494
+ */
4495
+ getPnpmfilePath(): string;
4496
+ /**
4497
+ * Returns true if the specified project belongs to this subspace.
4498
+ * @beta
4499
+ */
4500
+ contains(project: RushConfigurationProject): boolean;
4501
+ /** @internal */
4502
+ _addProject(project: RushConfigurationProject): void;
4503
+ }
4504
+
4380
4505
  /**
4381
4506
  * This represents the subspace configurations for a repository, based on the "subspaces.json"
4382
4507
  * configuration file.
4383
4508
  * @beta
4384
4509
  */
4385
- export declare class SubspaceConfiguration {
4510
+ export declare class SubspacesConfiguration {
4386
4511
  private static _jsonSchema;
4387
4512
  /**
4388
4513
  * The absolute path to the "subspaces.json" configuration file that was loaded to construct this object.
4389
4514
  */
4390
4515
  readonly subspaceJsonFilePath: string;
4516
+ readonly subspacesEnabled: boolean;
4517
+ /**
4518
+ * This determines if the subspaces feature supports adding configuration files under the project folder itself
4519
+ */
4520
+ readonly splitWorkspaceCompatibility: boolean;
4521
+ /**
4522
+ * This determines if selectors are required when installing and building
4523
+ */
4524
+ readonly preventSelectingAllSubspaces: boolean;
4391
4525
  /**
4392
4526
  * A set of the available subspaces
4393
4527
  */
4394
- readonly subspaceNames: Set<string>;
4528
+ readonly subspaceNames: ReadonlySet<string>;
4395
4529
  private constructor();
4396
- static tryLoadFromConfigurationFile(subspaceJsonFilePath: string): SubspaceConfiguration | undefined;
4397
- static tryLoadFromDefaultLocation(rushConfiguration: RushConfiguration): SubspaceConfiguration | undefined;
4530
+ /**
4531
+ * Checks whether the provided string could be used as a subspace name.
4532
+ * Returns `undefined` if the name is valid; otherwise returns an error message.
4533
+ * @remarks
4534
+ * This is a syntax check only; it does not test whether the subspace is actually defined in the Rush configuration.
4535
+ */
4536
+ static explainIfInvalidSubspaceName(subspaceName: string, splitWorkspaceCompatibility?: boolean): string | undefined;
4537
+ /**
4538
+ * Checks whether the provided string could be used as a subspace name.
4539
+ * If not, an exception is thrown.
4540
+ * @remarks
4541
+ * This is a syntax check only; it does not test whether the subspace is actually defined in the Rush configuration.
4542
+ */
4543
+ static requireValidSubspaceName(subspaceName: string, splitWorkspaceCompatibility?: boolean): void;
4544
+ static tryLoadFromConfigurationFile(subspaceJsonFilePath: string): SubspacesConfiguration | undefined;
4545
+ static tryLoadFromDefaultLocation(rushConfiguration: RushConfiguration): SubspacesConfiguration | undefined;
4546
+ /**
4547
+ * Returns a name of the form `_RUSH_SUBSPACE_XYZ_TEMP_FOLDER` where `XYZ` is
4548
+ * derived from the subspace name.
4549
+ *
4550
+ * @internal
4551
+ */
4552
+ static _convertNameToEnvironmentVariable(subspaceName: string, splitWorkspaceCompatibility: boolean): string;
4398
4553
  }
4399
4554
 
4400
4555
  declare enum VersionFormatForCommit {
@@ -4505,7 +4660,7 @@ export declare class VersionPolicyConfiguration {
4505
4660
  /**
4506
4661
  * Validate the version policy configuration against the rush config
4507
4662
  */
4508
- validate(projectsByName: Map<string, RushConfigurationProject>): void;
4663
+ validate(projectsByName: ReadonlyMap<string, RushConfigurationProject>): void;
4509
4664
  /**
4510
4665
  * Gets the version policy by its name.
4511
4666
  * Throws error if the version policy is not found.
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.38.5"
8
+ "packageVersion": "7.39.4"
9
9
  }
10
10
  ]
11
11
  }
@@ -6,12 +6,12 @@
6
6
  export interface IExperimentsJson {
7
7
  /**
8
8
  * By default, 'rush install' passes --no-prefer-frozen-lockfile to 'pnpm install'.
9
- * Set this option to true to pass '--frozen-lockfile' instead.
9
+ * Set this option to true to pass '--frozen-lockfile' instead for faster installs.
10
10
  */
11
11
  usePnpmFrozenLockfileForRushInstall?: boolean;
12
12
  /**
13
13
  * By default, 'rush update' passes --no-prefer-frozen-lockfile to 'pnpm install'.
14
- * Set this option to true to pass '--prefer-frozen-lockfile' instead.
14
+ * Set this option to true to pass '--prefer-frozen-lockfile' instead to minimize shrinkwrap changes.
15
15
  */
16
16
  usePnpmPreferFrozenLockfileForRushUpdate?: boolean;
17
17
  /**
@@ -1,5 +1,6 @@
1
1
  import { type JsonObject } from '@rushstack/node-core-library';
2
2
  import type { RushConfiguration } from './RushConfiguration';
3
+ import type { Subspace } from './Subspace';
3
4
  export declare const LAST_INSTALL_FLAG_FILE_NAME: string;
4
5
  /**
5
6
  * @internal
@@ -68,6 +69,6 @@ export declare class LastInstallFlagFactory {
68
69
  *
69
70
  * @internal
70
71
  */
71
- static getCommonTempFlag(rushConfiguration: RushConfiguration, extraState?: Record<string, string>): LastInstallFlag;
72
+ static getCommonTempFlag(rushConfiguration: RushConfiguration, subspace: Subspace, extraState?: Record<string, string>): LastInstallFlag;
72
73
  }
73
74
  //# sourceMappingURL=LastInstallFlag.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { LastInstallFlag } from './LastInstallFlag';
2
- import type { RushConfiguration } from './RushConfiguration';
2
+ import type { Subspace } from './Subspace';
3
3
  export declare const LAST_LINK_FLAG_FILE_NAME: string;
4
4
  /**
5
5
  * A helper class for managing the last-link flag, which is persistent and
@@ -36,6 +36,6 @@ export declare class LastLinkFlagFactory {
36
36
  *
37
37
  * @internal
38
38
  */
39
- static getCommonTempFlag(rushConfiguration: RushConfiguration): LastLinkFlag;
39
+ static getCommonTempFlag(subspace: Subspace): LastLinkFlag;
40
40
  }
41
41
  //# sourceMappingURL=LastLinkFlag.d.ts.map
@@ -21,12 +21,23 @@ export declare class PackageJsonDependency {
21
21
  get version(): string;
22
22
  setVersion(newVersion: string): void;
23
23
  }
24
+ /**
25
+ * @public
26
+ */
27
+ export declare class PackageJsonDependencyMeta {
28
+ private _injected;
29
+ private _onChange;
30
+ readonly name: string;
31
+ constructor(name: string, injected: boolean, onChange: () => void);
32
+ get injected(): boolean;
33
+ }
24
34
  /**
25
35
  * @public
26
36
  */
27
37
  export declare class PackageJsonEditor {
28
38
  private readonly _dependencies;
29
39
  private readonly _devDependencies;
40
+ private readonly _dependenciesMeta;
30
41
  private readonly _resolutions;
31
42
  private _modified;
32
43
  private _sourceData;
@@ -47,6 +58,10 @@ export declare class PackageJsonEditor {
47
58
  * The list of dependencies of type DependencyType.Dev.
48
59
  */
49
60
  get devDependencyList(): ReadonlyArray<PackageJsonDependency>;
61
+ /**
62
+ * The list of dependenciesMeta in package.json.
63
+ */
64
+ get dependencyMetaList(): ReadonlyArray<PackageJsonDependencyMeta>;
50
65
  /**
51
66
  * This field is a Yarn-specific feature that allows overriding of package resolution.
52
67
  *