@rushstack/rush-sdk 5.135.0 → 5.136.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.
- package/dist/rush-lib.d.ts +115 -26
- package/lib/api/CommonVersionsConfiguration.d.ts +1 -1
- package/lib/api/EnvironmentConfiguration.d.ts +7 -0
- package/lib/api/RushConfiguration.d.ts +50 -14
- package/lib/api/Subspace.d.ts +33 -9
- package/lib/api/Variants.d.ts +8 -0
- package/lib/api/Variants.js +1 -0
- package/lib/cli/actions/AddAction.d.ts +2 -1
- package/lib/cli/actions/BaseAddAndRemoveAction.d.ts +1 -1
- package/lib/cli/actions/BaseInstallAction.d.ts +2 -1
- package/lib/cli/actions/CheckAction.d.ts +1 -0
- package/lib/cli/actions/RemoveAction.d.ts +3 -3
- package/lib/cli/actions/UpgradeInteractiveAction.d.ts +1 -0
- package/lib/cli/scriptActions/PhasedScriptAction.d.ts +1 -0
- package/lib/logic/DependencyAnalyzer.d.ts +2 -2
- package/lib/logic/PackageJsonUpdaterTypes.d.ts +4 -0
- package/lib/logic/ProjectChangeAnalyzer.d.ts +1 -0
- package/lib/logic/RepoStateFile.d.ts +1 -1
- package/lib/logic/RushConstants.d.ts +10 -0
- package/lib/logic/base/BaseInstallManagerTypes.d.ts +4 -0
- package/lib/logic/base/BaseShrinkwrapFile.d.ts +2 -1
- package/lib/logic/npm/NpmShrinkwrapFile.d.ts +1 -1
- package/lib/logic/pnpm/PnpmShrinkwrapFile.d.ts +1 -1
- package/lib/logic/pnpm/PnpmfileConfiguration.d.ts +2 -2
- package/lib/logic/pnpm/SubspacePnpmfileConfiguration.d.ts +2 -2
- package/lib/logic/policy/PolicyValidator.d.ts +1 -1
- package/lib/logic/policy/ShrinkwrapFilePolicy.d.ts +1 -1
- package/lib/logic/versionMismatch/VersionMismatchFinder.d.ts +2 -2
- package/lib/pluginFramework/RushLifeCycle.d.ts +10 -2
- package/lib/utilities/Utilities.d.ts +1 -1
- package/lib-shim/index.js +41 -10
- package/lib-shim/index.js.map +1 -1
- package/package.json +7 -7
package/dist/rush-lib.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ import { IPackageJson } from '@rushstack/node-core-library';
|
|
|
17
17
|
import { IPrefixMatch } from '@rushstack/lookup-by-path';
|
|
18
18
|
import { ITerminal } from '@rushstack/terminal';
|
|
19
19
|
import { ITerminalProvider } from '@rushstack/terminal';
|
|
20
|
+
import { JsonNull } from '@rushstack/node-core-library';
|
|
20
21
|
import { JsonObject } from '@rushstack/node-core-library';
|
|
21
22
|
import { LookupByPath } from '@rushstack/lookup-by-path';
|
|
22
23
|
import { PackageNameParser } from '@rushstack/node-core-library';
|
|
@@ -343,7 +344,7 @@ export declare class CommonVersionsConfiguration {
|
|
|
343
344
|
* Loads the common-versions.json data from the specified file path.
|
|
344
345
|
* If the file has not been created yet, then an empty object is returned.
|
|
345
346
|
*/
|
|
346
|
-
static loadFromFile(
|
|
347
|
+
static loadFromFile(jsonFilePath: string, rushConfiguration?: RushConfiguration): CommonVersionsConfiguration;
|
|
347
348
|
private static _deserializeTable;
|
|
348
349
|
private static _serializeTable;
|
|
349
350
|
/**
|
|
@@ -683,6 +684,13 @@ export declare const EnvironmentVariableNames: {
|
|
|
683
684
|
* or `0` to disallow them. (See the comments in the command-line.json file for more information).
|
|
684
685
|
*/
|
|
685
686
|
readonly RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD: "RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD";
|
|
687
|
+
/**
|
|
688
|
+
* This variable selects a specific installation variant for Rush to use when installing
|
|
689
|
+
* and linking package dependencies.
|
|
690
|
+
* For more information, see the command-line help for the `--variant` parameter
|
|
691
|
+
* and this article: https://rushjs.io/pages/advanced/installation_variants/
|
|
692
|
+
*/
|
|
693
|
+
readonly RUSH_VARIANT: "RUSH_VARIANT";
|
|
686
694
|
/**
|
|
687
695
|
* Specifies the maximum number of concurrent processes to launch during a build.
|
|
688
696
|
* For more information, see the command-line help for the `--parallelism` parameter for "rush build".
|
|
@@ -1236,6 +1244,13 @@ export declare interface ICredentialCacheOptions {
|
|
|
1236
1244
|
supportEditing: boolean;
|
|
1237
1245
|
}
|
|
1238
1246
|
|
|
1247
|
+
/**
|
|
1248
|
+
* This represents the JSON data structure for the "current-variant.json" data file.
|
|
1249
|
+
*/
|
|
1250
|
+
declare interface ICurrentVariantJson {
|
|
1251
|
+
variant: string | JsonNull;
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1239
1254
|
/**
|
|
1240
1255
|
* Metadata for a custom tip.
|
|
1241
1256
|
*
|
|
@@ -1482,6 +1497,7 @@ export declare interface IGetChangedProjectsOptions {
|
|
|
1482
1497
|
targetBranchName: string;
|
|
1483
1498
|
terminal: ITerminal;
|
|
1484
1499
|
shouldFetch?: boolean;
|
|
1500
|
+
variant?: string;
|
|
1485
1501
|
/**
|
|
1486
1502
|
* If set to `true`, consider a project's external dependency installation layout as defined in the
|
|
1487
1503
|
* package manager lockfile when determining if it has changed.
|
|
@@ -2214,7 +2230,7 @@ declare interface IRushConfigurationJson {
|
|
|
2214
2230
|
pnpmOptions?: _IPnpmOptionsJson;
|
|
2215
2231
|
yarnOptions?: _IYarnOptionsJson;
|
|
2216
2232
|
ensureConsistentVersions?: boolean;
|
|
2217
|
-
variants?:
|
|
2233
|
+
variants?: IRushVariantOptionsJson[];
|
|
2218
2234
|
}
|
|
2219
2235
|
|
|
2220
2236
|
/**
|
|
@@ -2392,6 +2408,14 @@ export declare interface IRushSessionOptions {
|
|
|
2392
2408
|
getIsDebugMode: () => boolean;
|
|
2393
2409
|
}
|
|
2394
2410
|
|
|
2411
|
+
/**
|
|
2412
|
+
* Options defining an allowed variant as part of IRushConfigurationJson.
|
|
2413
|
+
*/
|
|
2414
|
+
declare interface IRushVariantOptionsJson {
|
|
2415
|
+
variantName: string;
|
|
2416
|
+
description: string;
|
|
2417
|
+
}
|
|
2418
|
+
|
|
2395
2419
|
/**
|
|
2396
2420
|
* Represents a readonly view of a `Stopwatch`.
|
|
2397
2421
|
* @beta
|
|
@@ -3363,7 +3387,7 @@ export declare class RepoStateFile {
|
|
|
3363
3387
|
*
|
|
3364
3388
|
* @returns true if the file was modified, otherwise false.
|
|
3365
3389
|
*/
|
|
3366
|
-
refreshState(rushConfiguration: RushConfiguration, subspace: Subspace | undefined): boolean;
|
|
3390
|
+
refreshState(rushConfiguration: RushConfiguration, subspace: Subspace | undefined, variant?: string): boolean;
|
|
3367
3391
|
/**
|
|
3368
3392
|
* Writes the "repo-state.json" file to disk, using the filename that was passed to loadFromFile().
|
|
3369
3393
|
*/
|
|
@@ -3449,6 +3473,10 @@ export declare class RushCommandLine {
|
|
|
3449
3473
|
export declare class RushConfiguration {
|
|
3450
3474
|
private static _jsonSchema;
|
|
3451
3475
|
private readonly _pathTrees;
|
|
3476
|
+
/**
|
|
3477
|
+
* @internal
|
|
3478
|
+
*/
|
|
3479
|
+
_currentVariantJsonLoadingPromise: Promise<ICurrentVariantJson | undefined> | undefined;
|
|
3452
3480
|
private _projects;
|
|
3453
3481
|
private _projectsByName;
|
|
3454
3482
|
private _projectsByTag;
|
|
@@ -3553,12 +3581,13 @@ export declare class RushConfiguration {
|
|
|
3553
3581
|
*/
|
|
3554
3582
|
readonly subspacesFeatureEnabled: boolean;
|
|
3555
3583
|
/**
|
|
3556
|
-
*
|
|
3584
|
+
* The filename of the variant dependency data file. By default this is
|
|
3585
|
+
* called 'current-variant.json' and resides in the Rush common folder.
|
|
3586
|
+
* Its data structure is defined by ICurrentVariantJson.
|
|
3557
3587
|
*
|
|
3558
|
-
*
|
|
3559
|
-
* @deprecated - Remove when the field is removed from the rush.json schema.
|
|
3588
|
+
* Example: `C:\MyRepo\common\temp\current-variant.json`
|
|
3560
3589
|
*/
|
|
3561
|
-
readonly
|
|
3590
|
+
readonly currentVariantJsonFilePath: string;
|
|
3562
3591
|
/**
|
|
3563
3592
|
* The version of the locally package manager tool. (Example: "1.2.3")
|
|
3564
3593
|
*/
|
|
@@ -3744,6 +3773,12 @@ export declare class RushConfiguration {
|
|
|
3744
3773
|
* @internal
|
|
3745
3774
|
*/
|
|
3746
3775
|
readonly _rushPluginsConfiguration: RushPluginsConfiguration;
|
|
3776
|
+
/**
|
|
3777
|
+
* The variants specified in the rush.json configuration file.
|
|
3778
|
+
*
|
|
3779
|
+
* @beta
|
|
3780
|
+
*/
|
|
3781
|
+
readonly variants: ReadonlySet<string>;
|
|
3747
3782
|
/**
|
|
3748
3783
|
* Use RushConfiguration.loadFromConfigurationFile() or Use RushConfiguration.loadFromDefaultLocation()
|
|
3749
3784
|
* instead.
|
|
@@ -3870,23 +3905,34 @@ export declare class RushConfiguration {
|
|
|
3870
3905
|
* Instead it will be initialized in an empty state, and calling CommonVersionsConfiguration.save()
|
|
3871
3906
|
* will create the file.
|
|
3872
3907
|
*
|
|
3873
|
-
* @deprecated Use `getCommonVersions` instead, which gets the correct common version data
|
|
3908
|
+
* @deprecated Use `getCommonVersions` instead, which gets the correct common version data
|
|
3909
|
+
* for a given active variant.
|
|
3874
3910
|
*/
|
|
3875
3911
|
get commonVersions(): CommonVersionsConfiguration;
|
|
3912
|
+
/**
|
|
3913
|
+
* Gets the currently-installed variant, if an installation has occurred.
|
|
3914
|
+
* For Rush operations which do not take a --variant parameter, this method
|
|
3915
|
+
* determines which variant, if any, was last specified when performing "rush install"
|
|
3916
|
+
* or "rush update".
|
|
3917
|
+
*/
|
|
3918
|
+
getCurrentlyInstalledVariantAsync(): Promise<string | undefined>;
|
|
3876
3919
|
/**
|
|
3877
3920
|
* @deprecated Use {@link Subspace.getCommonVersionsFilePath} instead
|
|
3878
3921
|
*/
|
|
3879
|
-
getCommonVersionsFilePath(subspace?: Subspace): string;
|
|
3922
|
+
getCommonVersionsFilePath(subspace?: Subspace, variant?: string): string;
|
|
3880
3923
|
/**
|
|
3881
3924
|
* @deprecated Use {@link Subspace.getCommonVersions} instead
|
|
3882
3925
|
*/
|
|
3883
|
-
getCommonVersions(subspace?: Subspace): CommonVersionsConfiguration;
|
|
3926
|
+
getCommonVersions(subspace?: Subspace, variant?: string): CommonVersionsConfiguration;
|
|
3884
3927
|
/**
|
|
3885
3928
|
* Returns a map of all direct dependencies that only have a single semantic version specifier.
|
|
3886
3929
|
*
|
|
3930
|
+
* @param subspace - The subspace to use
|
|
3931
|
+
* @param variant - The name of the current variant in use by the active command.
|
|
3932
|
+
*
|
|
3887
3933
|
* @returns A map of dependency name --\> version specifier for implicitly preferred versions.
|
|
3888
3934
|
*/
|
|
3889
|
-
getImplicitlyPreferredVersions(subspace?: Subspace): Map<string, string>;
|
|
3935
|
+
getImplicitlyPreferredVersions(subspace?: Subspace, variant?: string): Map<string, string>;
|
|
3890
3936
|
/**
|
|
3891
3937
|
* @deprecated Use {@link Subspace.getRepoStateFilePath} instead
|
|
3892
3938
|
*/
|
|
@@ -3896,13 +3942,13 @@ export declare class RushConfiguration {
|
|
|
3896
3942
|
*/
|
|
3897
3943
|
getRepoState(subspace?: Subspace): RepoStateFile;
|
|
3898
3944
|
/**
|
|
3899
|
-
* @deprecated Use {@link Subspace.
|
|
3945
|
+
* @deprecated Use {@link Subspace.getCommittedShrinkwrapFilePath} instead
|
|
3900
3946
|
*/
|
|
3901
|
-
getCommittedShrinkwrapFilename(subspace?: Subspace): string;
|
|
3947
|
+
getCommittedShrinkwrapFilename(subspace?: Subspace, variant?: string): string;
|
|
3902
3948
|
/**
|
|
3903
|
-
* @deprecated Use {@link Subspace.
|
|
3949
|
+
* @deprecated Use {@link Subspace.getPnpmfilePath} instead
|
|
3904
3950
|
*/
|
|
3905
|
-
getPnpmfilePath(subspace?: Subspace): string;
|
|
3951
|
+
getPnpmfilePath(subspace?: Subspace, variant?: string): string;
|
|
3906
3952
|
/**
|
|
3907
3953
|
* Looks up a project in the projectsByName map. If the project is not found,
|
|
3908
3954
|
* then undefined is returned.
|
|
@@ -3930,6 +3976,7 @@ export declare class RushConfiguration {
|
|
|
3930
3976
|
* If the path is not under any project's folder, returns undefined.
|
|
3931
3977
|
*/
|
|
3932
3978
|
tryGetProjectForPath(currentFolderPath: string): RushConfigurationProject | undefined;
|
|
3979
|
+
private _loadCurrentVariantJsonAsync;
|
|
3933
3980
|
}
|
|
3934
3981
|
|
|
3935
3982
|
/**
|
|
@@ -4165,6 +4212,12 @@ export declare class RushConstants {
|
|
|
4165
4212
|
* The NPM scope ("\@rush-temp") that is used for Rush's temporary projects.
|
|
4166
4213
|
*/
|
|
4167
4214
|
static readonly rushTempNpmScope: '@rush-temp';
|
|
4215
|
+
/**
|
|
4216
|
+
* The folder name ("variants") under which named variant configurations for
|
|
4217
|
+
* alternate dependency sets may be found.
|
|
4218
|
+
* Example: `C:\MyRepo\common\config\rush\variants`
|
|
4219
|
+
*/
|
|
4220
|
+
static readonly rushVariantsFolderName: 'variants';
|
|
4168
4221
|
/**
|
|
4169
4222
|
* The folder name ("temp") under the common folder, or under the .rush folder in each project's directory where
|
|
4170
4223
|
* temporary files will be stored.
|
|
@@ -4392,6 +4445,10 @@ export declare class RushConstants {
|
|
|
4392
4445
|
* The filename for the machine-generated file that tracks state for Rush alerts.
|
|
4393
4446
|
*/
|
|
4394
4447
|
static readonly rushAlertsStateFilename: 'rush-alerts-state.json';
|
|
4448
|
+
/**
|
|
4449
|
+
* The filename for the file that tracks which variant is currently installed.
|
|
4450
|
+
*/
|
|
4451
|
+
static readonly currentVariantsFilename: 'current-variants.json';
|
|
4395
4452
|
}
|
|
4396
4453
|
|
|
4397
4454
|
/**
|
|
@@ -4470,11 +4527,19 @@ export declare class RushLifecycleHooks {
|
|
|
4470
4527
|
/**
|
|
4471
4528
|
* The hook to run between preparing the common/temp folder and invoking the package manager during "rush install" or "rush update".
|
|
4472
4529
|
*/
|
|
4473
|
-
readonly beforeInstall: AsyncSeriesHook<[
|
|
4530
|
+
readonly beforeInstall: AsyncSeriesHook<[
|
|
4531
|
+
command: IGlobalCommand,
|
|
4532
|
+
subspace: Subspace,
|
|
4533
|
+
variant: string | undefined
|
|
4534
|
+
]>;
|
|
4474
4535
|
/**
|
|
4475
4536
|
* The hook to run after a successful install.
|
|
4476
4537
|
*/
|
|
4477
|
-
readonly afterInstall: AsyncSeriesHook<[
|
|
4538
|
+
readonly afterInstall: AsyncSeriesHook<[
|
|
4539
|
+
command: IRushCommand,
|
|
4540
|
+
subspace: Subspace,
|
|
4541
|
+
variant: string | undefined
|
|
4542
|
+
]>;
|
|
4478
4543
|
/**
|
|
4479
4544
|
* A hook to allow plugins to hook custom logic to process telemetry data.
|
|
4480
4545
|
*/
|
|
@@ -4613,6 +4678,21 @@ export declare class Subspace {
|
|
|
4613
4678
|
*/
|
|
4614
4679
|
getPnpmOptions(): PnpmOptionsConfiguration | undefined;
|
|
4615
4680
|
private _ensureDetail;
|
|
4681
|
+
/**
|
|
4682
|
+
* Returns the full path of the folder containing this subspace's variant-dependent configuration files
|
|
4683
|
+
* such as `pnpm-lock.yaml`.
|
|
4684
|
+
*
|
|
4685
|
+
* Example: `common/config/subspaces/my-subspace` or `common/config/subspaces/my-subspace/variants/my-variant`
|
|
4686
|
+
* @beta
|
|
4687
|
+
*
|
|
4688
|
+
* @remarks
|
|
4689
|
+
* The following files may be variant-dependent:
|
|
4690
|
+
* - Lockfiles: (i.e. - `pnpm-lock.yaml`, `npm-shrinkwrap.json`, `yarn.lock`, etc)
|
|
4691
|
+
* - 'common-versions.json'
|
|
4692
|
+
* - 'pnpmfile.js'/'.pnpmfile.cjs'
|
|
4693
|
+
* - 'pnpm-config.js'
|
|
4694
|
+
*/
|
|
4695
|
+
getVariantDependentSubspaceConfigFolderPath(variant: string | undefined): string;
|
|
4616
4696
|
/**
|
|
4617
4697
|
* Returns the full path of the folder containing this subspace's configuration files such as `pnpm-lock.yaml`.
|
|
4618
4698
|
*
|
|
@@ -4647,6 +4727,10 @@ export declare class Subspace {
|
|
|
4647
4727
|
* @beta
|
|
4648
4728
|
*/
|
|
4649
4729
|
getTempShrinkwrapFilename(): string;
|
|
4730
|
+
/**
|
|
4731
|
+
* @deprecated - Use {@link Subspace.getTempShrinkwrapPreinstallFilePath} instead.
|
|
4732
|
+
*/
|
|
4733
|
+
getTempShrinkwrapPreinstallFilename(subspaceName?: string | undefined): string;
|
|
4650
4734
|
/**
|
|
4651
4735
|
* The full path of a backup copy of tempShrinkwrapFilename. This backup copy is made
|
|
4652
4736
|
* before installation begins, and can be compared to determine how the package manager
|
|
@@ -4657,32 +4741,32 @@ export declare class Subspace {
|
|
|
4657
4741
|
* or `C:\MyRepo\common\temp\pnpm-lock-preinstall.yaml`
|
|
4658
4742
|
* @beta
|
|
4659
4743
|
*/
|
|
4660
|
-
|
|
4744
|
+
getTempShrinkwrapPreinstallFilePath(): string;
|
|
4661
4745
|
/**
|
|
4662
4746
|
* Gets the path to the common-versions.json config file for this subspace.
|
|
4663
4747
|
*
|
|
4664
4748
|
* Example: `C:\MyRepo\common\subspaces\my-subspace\common-versions.json`
|
|
4665
4749
|
* @beta
|
|
4666
4750
|
*/
|
|
4667
|
-
getCommonVersionsFilePath(): string;
|
|
4751
|
+
getCommonVersionsFilePath(variant?: string): string;
|
|
4668
4752
|
/**
|
|
4669
4753
|
* Gets the path to the pnpm-config.json config file for this subspace.
|
|
4670
4754
|
*
|
|
4671
4755
|
* Example: `C:\MyRepo\common\subspaces\my-subspace\pnpm-config.json`
|
|
4672
4756
|
* @beta
|
|
4673
4757
|
*/
|
|
4674
|
-
getPnpmConfigFilePath(): string;
|
|
4758
|
+
getPnpmConfigFilePath(variant?: string): string;
|
|
4675
4759
|
/**
|
|
4676
4760
|
* Gets the settings from the common-versions.json config file.
|
|
4677
4761
|
* @beta
|
|
4678
4762
|
*/
|
|
4679
|
-
getCommonVersions(): CommonVersionsConfiguration;
|
|
4763
|
+
getCommonVersions(variant?: string): CommonVersionsConfiguration;
|
|
4680
4764
|
/**
|
|
4681
4765
|
* Gets the ensureConsistentVersions property from the common-versions.json config file,
|
|
4682
4766
|
* or from the rush.json file if it isn't defined in common-versions.json
|
|
4683
4767
|
* @beta
|
|
4684
4768
|
*/
|
|
4685
|
-
|
|
4769
|
+
shouldEnsureConsistentVersions(variant?: string): boolean;
|
|
4686
4770
|
/**
|
|
4687
4771
|
* Gets the path to the repo-state.json file.
|
|
4688
4772
|
* @beta
|
|
@@ -4695,10 +4779,15 @@ export declare class Subspace {
|
|
|
4695
4779
|
*/
|
|
4696
4780
|
getRepoState(): RepoStateFile;
|
|
4697
4781
|
/**
|
|
4698
|
-
*
|
|
4699
|
-
* @beta
|
|
4782
|
+
* @deprecated - Use {@link Subspace.getCommittedShrinkwrapFilePath} instead.
|
|
4700
4783
|
*/
|
|
4701
4784
|
getCommittedShrinkwrapFilename(): string;
|
|
4785
|
+
/**
|
|
4786
|
+
* Gets the committed shrinkwrap file name for a specific variant.
|
|
4787
|
+
* @param variant - The name of the current variant in use by the active command.
|
|
4788
|
+
* @beta
|
|
4789
|
+
*/
|
|
4790
|
+
getCommittedShrinkwrapFilePath(variant?: string): string;
|
|
4702
4791
|
/**
|
|
4703
4792
|
* Gets the absolute path for "pnpmfile.js" for a specific subspace.
|
|
4704
4793
|
* @param subspace - The name of the current subspace in use by the active command.
|
|
@@ -4706,7 +4795,7 @@ export declare class Subspace {
|
|
|
4706
4795
|
* The file path is returned even if PNPM is not configured as the package manager.
|
|
4707
4796
|
* @beta
|
|
4708
4797
|
*/
|
|
4709
|
-
getPnpmfilePath(): string;
|
|
4798
|
+
getPnpmfilePath(variant?: string): string;
|
|
4710
4799
|
/**
|
|
4711
4800
|
* Returns true if the specified project belongs to this subspace.
|
|
4712
4801
|
* @beta
|
|
@@ -4718,7 +4807,7 @@ export declare class Subspace {
|
|
|
4718
4807
|
* Returns hash value of injected dependencies in related package.json.
|
|
4719
4808
|
* @beta
|
|
4720
4809
|
*/
|
|
4721
|
-
getPackageJsonInjectedDependenciesHash(): string | undefined;
|
|
4810
|
+
getPackageJsonInjectedDependenciesHash(variant?: string): string | undefined;
|
|
4722
4811
|
}
|
|
4723
4812
|
|
|
4724
4813
|
/**
|
|
@@ -80,7 +80,7 @@ export declare class CommonVersionsConfiguration {
|
|
|
80
80
|
* Loads the common-versions.json data from the specified file path.
|
|
81
81
|
* If the file has not been created yet, then an empty object is returned.
|
|
82
82
|
*/
|
|
83
|
-
static loadFromFile(
|
|
83
|
+
static loadFromFile(jsonFilePath: string, rushConfiguration?: RushConfiguration): CommonVersionsConfiguration;
|
|
84
84
|
private static _deserializeTable;
|
|
85
85
|
private static _serializeTable;
|
|
86
86
|
/**
|
|
@@ -36,6 +36,13 @@ export declare const EnvironmentVariableNames: {
|
|
|
36
36
|
* or `0` to disallow them. (See the comments in the command-line.json file for more information).
|
|
37
37
|
*/
|
|
38
38
|
readonly RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD: "RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD";
|
|
39
|
+
/**
|
|
40
|
+
* This variable selects a specific installation variant for Rush to use when installing
|
|
41
|
+
* and linking package dependencies.
|
|
42
|
+
* For more information, see the command-line help for the `--variant` parameter
|
|
43
|
+
* and this article: https://rushjs.io/pages/advanced/installation_variants/
|
|
44
|
+
*/
|
|
45
|
+
readonly RUSH_VARIANT: "RUSH_VARIANT";
|
|
39
46
|
/**
|
|
40
47
|
* Specifies the maximum number of concurrent processes to launch during a build.
|
|
41
48
|
* For more information, see the command-line help for the `--parallelism` parameter for "rush build".
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type PackageNameParser } from '@rushstack/node-core-library';
|
|
1
|
+
import { type PackageNameParser, type JsonNull } from '@rushstack/node-core-library';
|
|
2
2
|
import { LookupByPath } from '@rushstack/lookup-by-path';
|
|
3
3
|
import { RushConfigurationProject, type IRushConfigurationProjectJson } from './RushConfigurationProject';
|
|
4
4
|
import { ApprovedPackagesPolicy } from './ApprovedPackagesPolicy';
|
|
@@ -77,6 +77,13 @@ export interface IRushRepositoryJsonMultipleUrls extends IRushRepositoryJsonBase
|
|
|
77
77
|
urls?: string[];
|
|
78
78
|
}
|
|
79
79
|
export type IRushRepositoryJson = IRushRepositoryJsonSingleUrl | IRushRepositoryJsonMultipleUrls;
|
|
80
|
+
/**
|
|
81
|
+
* Options defining an allowed variant as part of IRushConfigurationJson.
|
|
82
|
+
*/
|
|
83
|
+
export interface IRushVariantOptionsJson {
|
|
84
|
+
variantName: string;
|
|
85
|
+
description: string;
|
|
86
|
+
}
|
|
80
87
|
/**
|
|
81
88
|
* This represents the JSON data structure for the "rush.json" configuration file.
|
|
82
89
|
* See rush.schema.json for documentation.
|
|
@@ -106,7 +113,13 @@ export interface IRushConfigurationJson {
|
|
|
106
113
|
pnpmOptions?: IPnpmOptionsJson;
|
|
107
114
|
yarnOptions?: IYarnOptionsJson;
|
|
108
115
|
ensureConsistentVersions?: boolean;
|
|
109
|
-
variants?:
|
|
116
|
+
variants?: IRushVariantOptionsJson[];
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* This represents the JSON data structure for the "current-variant.json" data file.
|
|
120
|
+
*/
|
|
121
|
+
export interface ICurrentVariantJson {
|
|
122
|
+
variant: string | JsonNull;
|
|
110
123
|
}
|
|
111
124
|
/**
|
|
112
125
|
* The filter parameters to search from all projects
|
|
@@ -139,6 +152,10 @@ export interface ITryFindRushJsonLocationOptions {
|
|
|
139
152
|
export declare class RushConfiguration {
|
|
140
153
|
private static _jsonSchema;
|
|
141
154
|
private readonly _pathTrees;
|
|
155
|
+
/**
|
|
156
|
+
* @internal
|
|
157
|
+
*/
|
|
158
|
+
_currentVariantJsonLoadingPromise: Promise<ICurrentVariantJson | undefined> | undefined;
|
|
142
159
|
private _projects;
|
|
143
160
|
private _projectsByName;
|
|
144
161
|
private _projectsByTag;
|
|
@@ -243,12 +260,13 @@ export declare class RushConfiguration {
|
|
|
243
260
|
*/
|
|
244
261
|
readonly subspacesFeatureEnabled: boolean;
|
|
245
262
|
/**
|
|
246
|
-
*
|
|
263
|
+
* The filename of the variant dependency data file. By default this is
|
|
264
|
+
* called 'current-variant.json' and resides in the Rush common folder.
|
|
265
|
+
* Its data structure is defined by ICurrentVariantJson.
|
|
247
266
|
*
|
|
248
|
-
*
|
|
249
|
-
* @deprecated - Remove when the field is removed from the rush.json schema.
|
|
267
|
+
* Example: `C:\MyRepo\common\temp\current-variant.json`
|
|
250
268
|
*/
|
|
251
|
-
readonly
|
|
269
|
+
readonly currentVariantJsonFilePath: string;
|
|
252
270
|
/**
|
|
253
271
|
* The version of the locally package manager tool. (Example: "1.2.3")
|
|
254
272
|
*/
|
|
@@ -434,6 +452,12 @@ export declare class RushConfiguration {
|
|
|
434
452
|
* @internal
|
|
435
453
|
*/
|
|
436
454
|
readonly _rushPluginsConfiguration: RushPluginsConfiguration;
|
|
455
|
+
/**
|
|
456
|
+
* The variants specified in the rush.json configuration file.
|
|
457
|
+
*
|
|
458
|
+
* @beta
|
|
459
|
+
*/
|
|
460
|
+
readonly variants: ReadonlySet<string>;
|
|
437
461
|
/**
|
|
438
462
|
* Use RushConfiguration.loadFromConfigurationFile() or Use RushConfiguration.loadFromDefaultLocation()
|
|
439
463
|
* instead.
|
|
@@ -560,23 +584,34 @@ export declare class RushConfiguration {
|
|
|
560
584
|
* Instead it will be initialized in an empty state, and calling CommonVersionsConfiguration.save()
|
|
561
585
|
* will create the file.
|
|
562
586
|
*
|
|
563
|
-
* @deprecated Use `getCommonVersions` instead, which gets the correct common version data
|
|
587
|
+
* @deprecated Use `getCommonVersions` instead, which gets the correct common version data
|
|
588
|
+
* for a given active variant.
|
|
564
589
|
*/
|
|
565
590
|
get commonVersions(): CommonVersionsConfiguration;
|
|
591
|
+
/**
|
|
592
|
+
* Gets the currently-installed variant, if an installation has occurred.
|
|
593
|
+
* For Rush operations which do not take a --variant parameter, this method
|
|
594
|
+
* determines which variant, if any, was last specified when performing "rush install"
|
|
595
|
+
* or "rush update".
|
|
596
|
+
*/
|
|
597
|
+
getCurrentlyInstalledVariantAsync(): Promise<string | undefined>;
|
|
566
598
|
/**
|
|
567
599
|
* @deprecated Use {@link Subspace.getCommonVersionsFilePath} instead
|
|
568
600
|
*/
|
|
569
|
-
getCommonVersionsFilePath(subspace?: Subspace): string;
|
|
601
|
+
getCommonVersionsFilePath(subspace?: Subspace, variant?: string): string;
|
|
570
602
|
/**
|
|
571
603
|
* @deprecated Use {@link Subspace.getCommonVersions} instead
|
|
572
604
|
*/
|
|
573
|
-
getCommonVersions(subspace?: Subspace): CommonVersionsConfiguration;
|
|
605
|
+
getCommonVersions(subspace?: Subspace, variant?: string): CommonVersionsConfiguration;
|
|
574
606
|
/**
|
|
575
607
|
* Returns a map of all direct dependencies that only have a single semantic version specifier.
|
|
576
608
|
*
|
|
609
|
+
* @param subspace - The subspace to use
|
|
610
|
+
* @param variant - The name of the current variant in use by the active command.
|
|
611
|
+
*
|
|
577
612
|
* @returns A map of dependency name --\> version specifier for implicitly preferred versions.
|
|
578
613
|
*/
|
|
579
|
-
getImplicitlyPreferredVersions(subspace?: Subspace): Map<string, string>;
|
|
614
|
+
getImplicitlyPreferredVersions(subspace?: Subspace, variant?: string): Map<string, string>;
|
|
580
615
|
/**
|
|
581
616
|
* @deprecated Use {@link Subspace.getRepoStateFilePath} instead
|
|
582
617
|
*/
|
|
@@ -586,13 +621,13 @@ export declare class RushConfiguration {
|
|
|
586
621
|
*/
|
|
587
622
|
getRepoState(subspace?: Subspace): RepoStateFile;
|
|
588
623
|
/**
|
|
589
|
-
* @deprecated Use {@link Subspace.
|
|
624
|
+
* @deprecated Use {@link Subspace.getCommittedShrinkwrapFilePath} instead
|
|
590
625
|
*/
|
|
591
|
-
getCommittedShrinkwrapFilename(subspace?: Subspace): string;
|
|
626
|
+
getCommittedShrinkwrapFilename(subspace?: Subspace, variant?: string): string;
|
|
592
627
|
/**
|
|
593
|
-
* @deprecated Use {@link Subspace.
|
|
628
|
+
* @deprecated Use {@link Subspace.getPnpmfilePath} instead
|
|
594
629
|
*/
|
|
595
|
-
getPnpmfilePath(subspace?: Subspace): string;
|
|
630
|
+
getPnpmfilePath(subspace?: Subspace, variant?: string): string;
|
|
596
631
|
/**
|
|
597
632
|
* Looks up a project in the projectsByName map. If the project is not found,
|
|
598
633
|
* then undefined is returned.
|
|
@@ -620,5 +655,6 @@ export declare class RushConfiguration {
|
|
|
620
655
|
* If the path is not under any project's folder, returns undefined.
|
|
621
656
|
*/
|
|
622
657
|
tryGetProjectForPath(currentFolderPath: string): RushConfigurationProject | undefined;
|
|
658
|
+
private _loadCurrentVariantJsonAsync;
|
|
623
659
|
}
|
|
624
660
|
//# sourceMappingURL=RushConfiguration.d.ts.map
|
package/lib/api/Subspace.d.ts
CHANGED
|
@@ -37,6 +37,21 @@ export declare class Subspace {
|
|
|
37
37
|
*/
|
|
38
38
|
getPnpmOptions(): PnpmOptionsConfiguration | undefined;
|
|
39
39
|
private _ensureDetail;
|
|
40
|
+
/**
|
|
41
|
+
* Returns the full path of the folder containing this subspace's variant-dependent configuration files
|
|
42
|
+
* such as `pnpm-lock.yaml`.
|
|
43
|
+
*
|
|
44
|
+
* Example: `common/config/subspaces/my-subspace` or `common/config/subspaces/my-subspace/variants/my-variant`
|
|
45
|
+
* @beta
|
|
46
|
+
*
|
|
47
|
+
* @remarks
|
|
48
|
+
* The following files may be variant-dependent:
|
|
49
|
+
* - Lockfiles: (i.e. - `pnpm-lock.yaml`, `npm-shrinkwrap.json`, `yarn.lock`, etc)
|
|
50
|
+
* - 'common-versions.json'
|
|
51
|
+
* - 'pnpmfile.js'/'.pnpmfile.cjs'
|
|
52
|
+
* - 'pnpm-config.js'
|
|
53
|
+
*/
|
|
54
|
+
getVariantDependentSubspaceConfigFolderPath(variant: string | undefined): string;
|
|
40
55
|
/**
|
|
41
56
|
* Returns the full path of the folder containing this subspace's configuration files such as `pnpm-lock.yaml`.
|
|
42
57
|
*
|
|
@@ -71,6 +86,10 @@ export declare class Subspace {
|
|
|
71
86
|
* @beta
|
|
72
87
|
*/
|
|
73
88
|
getTempShrinkwrapFilename(): string;
|
|
89
|
+
/**
|
|
90
|
+
* @deprecated - Use {@link Subspace.getTempShrinkwrapPreinstallFilePath} instead.
|
|
91
|
+
*/
|
|
92
|
+
getTempShrinkwrapPreinstallFilename(subspaceName?: string | undefined): string;
|
|
74
93
|
/**
|
|
75
94
|
* The full path of a backup copy of tempShrinkwrapFilename. This backup copy is made
|
|
76
95
|
* before installation begins, and can be compared to determine how the package manager
|
|
@@ -81,32 +100,32 @@ export declare class Subspace {
|
|
|
81
100
|
* or `C:\MyRepo\common\temp\pnpm-lock-preinstall.yaml`
|
|
82
101
|
* @beta
|
|
83
102
|
*/
|
|
84
|
-
|
|
103
|
+
getTempShrinkwrapPreinstallFilePath(): string;
|
|
85
104
|
/**
|
|
86
105
|
* Gets the path to the common-versions.json config file for this subspace.
|
|
87
106
|
*
|
|
88
107
|
* Example: `C:\MyRepo\common\subspaces\my-subspace\common-versions.json`
|
|
89
108
|
* @beta
|
|
90
109
|
*/
|
|
91
|
-
getCommonVersionsFilePath(): string;
|
|
110
|
+
getCommonVersionsFilePath(variant?: string): string;
|
|
92
111
|
/**
|
|
93
112
|
* Gets the path to the pnpm-config.json config file for this subspace.
|
|
94
113
|
*
|
|
95
114
|
* Example: `C:\MyRepo\common\subspaces\my-subspace\pnpm-config.json`
|
|
96
115
|
* @beta
|
|
97
116
|
*/
|
|
98
|
-
getPnpmConfigFilePath(): string;
|
|
117
|
+
getPnpmConfigFilePath(variant?: string): string;
|
|
99
118
|
/**
|
|
100
119
|
* Gets the settings from the common-versions.json config file.
|
|
101
120
|
* @beta
|
|
102
121
|
*/
|
|
103
|
-
getCommonVersions(): CommonVersionsConfiguration;
|
|
122
|
+
getCommonVersions(variant?: string): CommonVersionsConfiguration;
|
|
104
123
|
/**
|
|
105
124
|
* Gets the ensureConsistentVersions property from the common-versions.json config file,
|
|
106
125
|
* or from the rush.json file if it isn't defined in common-versions.json
|
|
107
126
|
* @beta
|
|
108
127
|
*/
|
|
109
|
-
|
|
128
|
+
shouldEnsureConsistentVersions(variant?: string): boolean;
|
|
110
129
|
/**
|
|
111
130
|
* Gets the path to the repo-state.json file.
|
|
112
131
|
* @beta
|
|
@@ -119,10 +138,15 @@ export declare class Subspace {
|
|
|
119
138
|
*/
|
|
120
139
|
getRepoState(): RepoStateFile;
|
|
121
140
|
/**
|
|
122
|
-
*
|
|
123
|
-
* @beta
|
|
141
|
+
* @deprecated - Use {@link Subspace.getCommittedShrinkwrapFilePath} instead.
|
|
124
142
|
*/
|
|
125
143
|
getCommittedShrinkwrapFilename(): string;
|
|
144
|
+
/**
|
|
145
|
+
* Gets the committed shrinkwrap file name for a specific variant.
|
|
146
|
+
* @param variant - The name of the current variant in use by the active command.
|
|
147
|
+
* @beta
|
|
148
|
+
*/
|
|
149
|
+
getCommittedShrinkwrapFilePath(variant?: string): string;
|
|
126
150
|
/**
|
|
127
151
|
* Gets the absolute path for "pnpmfile.js" for a specific subspace.
|
|
128
152
|
* @param subspace - The name of the current subspace in use by the active command.
|
|
@@ -130,7 +154,7 @@ export declare class Subspace {
|
|
|
130
154
|
* The file path is returned even if PNPM is not configured as the package manager.
|
|
131
155
|
* @beta
|
|
132
156
|
*/
|
|
133
|
-
getPnpmfilePath(): string;
|
|
157
|
+
getPnpmfilePath(variant?: string): string;
|
|
134
158
|
/**
|
|
135
159
|
* Returns true if the specified project belongs to this subspace.
|
|
136
160
|
* @beta
|
|
@@ -142,6 +166,6 @@ export declare class Subspace {
|
|
|
142
166
|
* Returns hash value of injected dependencies in related package.json.
|
|
143
167
|
* @beta
|
|
144
168
|
*/
|
|
145
|
-
getPackageJsonInjectedDependenciesHash(): string | undefined;
|
|
169
|
+
getPackageJsonInjectedDependenciesHash(variant?: string): string | undefined;
|
|
146
170
|
}
|
|
147
171
|
//# sourceMappingURL=Subspace.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CommandLineStringParameter, ICommandLineStringDefinition } from '@rushstack/ts-command-line';
|
|
2
|
+
import type { RushConfiguration } from './RushConfiguration';
|
|
3
|
+
/**
|
|
4
|
+
* Provides the parameter configuration for '--variant'.
|
|
5
|
+
*/
|
|
6
|
+
export declare const VARIANT_PARAMETER: ICommandLineStringDefinition;
|
|
7
|
+
export declare function getVariantAsync(variantsParameter: CommandLineStringParameter | undefined, rushConfiguration: RushConfiguration, defaultToCurrentlyInstalledVariant: boolean): Promise<string | undefined>;
|
|
8
|
+
//# sourceMappingURL=Variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../lib-shim/index")._rushSdk_loadInternalModule("api/Variants");
|
|
@@ -10,7 +10,8 @@ export declare class AddAction extends BaseAddAndRemoveAction {
|
|
|
10
10
|
private readonly _devDependencyFlag;
|
|
11
11
|
private readonly _peerDependencyFlag;
|
|
12
12
|
private readonly _makeConsistentFlag;
|
|
13
|
+
private readonly _variantParameter;
|
|
13
14
|
constructor(parser: RushCommandLineParser);
|
|
14
|
-
|
|
15
|
+
getUpdateOptionsAsync(): Promise<IPackageJsonUpdaterRushAddOptions>;
|
|
15
16
|
}
|
|
16
17
|
//# sourceMappingURL=AddAction.d.ts.map
|
|
@@ -29,7 +29,7 @@ export declare abstract class BaseAddAndRemoveAction extends BaseRushAction {
|
|
|
29
29
|
protected abstract readonly _packageNameList: CommandLineStringListParameter;
|
|
30
30
|
protected get specifiedPackageNameList(): readonly string[];
|
|
31
31
|
constructor(options: IBaseRushActionOptions);
|
|
32
|
-
protected abstract
|
|
32
|
+
protected abstract getUpdateOptionsAsync(): Promise<IPackageJsonUpdaterRushBaseUpdateOptions>;
|
|
33
33
|
protected getProjects(): RushConfigurationProject[];
|
|
34
34
|
runAsync(): Promise<void>;
|
|
35
35
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CommandLineFlagParameter, CommandLineIntegerParameter, IRequiredCommandLineIntegerParameter } from '@rushstack/ts-command-line';
|
|
1
|
+
import type { CommandLineFlagParameter, CommandLineIntegerParameter, CommandLineStringParameter, IRequiredCommandLineIntegerParameter } from '@rushstack/ts-command-line';
|
|
2
2
|
import { type ITerminal } from '@rushstack/terminal';
|
|
3
3
|
import { BaseRushAction, type IBaseRushActionOptions } from './BaseRushAction';
|
|
4
4
|
import type { IInstallManagerOptions } from '../../logic/base/BaseInstallManagerTypes';
|
|
@@ -8,6 +8,7 @@ import { type SelectionParameterSet } from '../parsing/SelectionParameterSet';
|
|
|
8
8
|
*/
|
|
9
9
|
export declare abstract class BaseInstallAction extends BaseRushAction {
|
|
10
10
|
protected readonly _terminal: ITerminal;
|
|
11
|
+
protected readonly _variantParameter: CommandLineStringParameter;
|
|
11
12
|
protected readonly _purgeParameter: CommandLineFlagParameter;
|
|
12
13
|
protected readonly _bypassPolicyParameter: CommandLineFlagParameter;
|
|
13
14
|
protected readonly _noLinkParameter: CommandLineFlagParameter;
|
|
@@ -5,6 +5,7 @@ export declare class CheckAction extends BaseRushAction {
|
|
|
5
5
|
private readonly _jsonFlag;
|
|
6
6
|
private readonly _verboseFlag;
|
|
7
7
|
private readonly _subspaceParameter;
|
|
8
|
+
private readonly _variantParameter;
|
|
8
9
|
constructor(parser: RushCommandLineParser);
|
|
9
10
|
protected runAsync(): Promise<void>;
|
|
10
11
|
}
|