@rushstack/rush-sdk 5.96.0 → 5.97.1-pr3481.18

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 (56) hide show
  1. package/dist/rush-lib.d.ts +445 -49
  2. package/lib/api/CobuildConfiguration.d.ts +63 -0
  3. package/lib/api/CobuildConfiguration.js +1 -0
  4. package/lib/api/EnvironmentConfiguration.d.ts +61 -20
  5. package/lib/api/ExperimentsConfiguration.d.ts +5 -0
  6. package/lib/api/LastInstallFlag.d.ts +58 -21
  7. package/lib/api/LastLinkFlag.d.ts +3 -7
  8. package/lib/api/RushConfiguration.d.ts +52 -0
  9. package/lib/api/RushConfigurationProject.d.ts +6 -0
  10. package/lib/api/base/BaseFlag.d.ts +50 -0
  11. package/lib/api/base/BaseFlag.js +1 -0
  12. package/lib/api/packageManager/PnpmPackageManager.d.ts +14 -0
  13. package/lib/cli/actions/InstallAction.d.ts +7 -0
  14. package/lib/cli/actions/ListAction.d.ts +4 -0
  15. package/lib/cli/actions/UpdateAction.d.ts +7 -0
  16. package/lib/cli/parsing/SelectionParameterSet.d.ts +17 -3
  17. package/lib/index.d.ts +5 -2
  18. package/lib/logic/PurgeManager.d.ts +1 -0
  19. package/lib/logic/RushConstants.d.ts +15 -0
  20. package/lib/logic/base/BaseInstallManagerTypes.d.ts +23 -0
  21. package/lib/logic/buildCache/ProjectBuildCache.d.ts +5 -4
  22. package/lib/logic/cobuild/CobuildLock.d.ts +24 -0
  23. package/lib/logic/cobuild/CobuildLock.js +1 -0
  24. package/lib/logic/cobuild/ICobuildLockProvider.d.ts +46 -0
  25. package/lib/logic/cobuild/ICobuildLockProvider.js +1 -0
  26. package/lib/logic/installManager/InstallHelpers.d.ts +1 -0
  27. package/lib/logic/operations/AsyncOperationQueue.d.ts +23 -4
  28. package/lib/logic/operations/CacheableOperationPlugin.d.ts +21 -0
  29. package/lib/logic/operations/CacheableOperationPlugin.js +1 -0
  30. package/lib/logic/operations/IOperationRunner.d.ts +29 -10
  31. package/lib/logic/operations/OperationExecutionManager.d.ts +5 -0
  32. package/lib/logic/operations/OperationExecutionRecord.d.ts +7 -1
  33. package/lib/logic/operations/OperationRunnerHooks.d.ts +50 -0
  34. package/lib/logic/operations/OperationRunnerHooks.js +1 -0
  35. package/lib/logic/operations/OperationStatus.d.ts +8 -0
  36. package/lib/logic/operations/PeriodicCallback.d.ts +20 -0
  37. package/lib/logic/operations/PeriodicCallback.js +1 -0
  38. package/lib/logic/operations/ShellOperationRunner.d.ts +4 -13
  39. package/lib/logic/pnpm/IPnpmfile.d.ts +16 -0
  40. package/lib/logic/pnpm/PnpmProjectShrinkwrapFile.d.ts +7 -0
  41. package/lib/logic/pnpm/PnpmShrinkwrapFile.d.ts +26 -0
  42. package/lib/logic/pnpm/SplitWorkspaceGlobalPnpmfileShim.d.ts +3 -0
  43. package/lib/logic/pnpm/SplitWorkspaceGlobalPnpmfileShim.js +1 -0
  44. package/lib/logic/pnpm/SplitWorkspacePnpmfileConfiguration.d.ts +23 -0
  45. package/lib/logic/pnpm/SplitWorkspacePnpmfileConfiguration.js +1 -0
  46. package/lib/logic/selectors/SplitWorkspaceProjectSelectorParser.d.ts +10 -0
  47. package/lib/logic/selectors/SplitWorkspaceProjectSelectorParser.js +1 -0
  48. package/lib/logic/versionMismatch/VersionMismatchFinderProject.d.ts +2 -0
  49. package/lib/pluginFramework/PhasedCommandHooks.d.ts +15 -1
  50. package/lib/pluginFramework/RushSession.d.ts +11 -2
  51. package/lib/utilities/PathConstants.d.ts +1 -0
  52. package/lib/utilities/npmrcUtilities.d.ts +1 -1
  53. package/lib-shim/index.d.ts.map +1 -1
  54. package/lib-shim/index.js +5 -5
  55. package/lib-shim/index.js.map +1 -1
  56. package/package.json +5 -5
@@ -0,0 +1,63 @@
1
+ import { ITerminal } from '@rushstack/node-core-library';
2
+ import { RushSession } from '../pluginFramework/RushSession';
3
+ import type { ICobuildLockProvider } from '../logic/cobuild/ICobuildLockProvider';
4
+ import type { RushConfiguration } from './RushConfiguration';
5
+ /**
6
+ * @beta
7
+ */
8
+ export interface ICobuildJson {
9
+ cobuildEnabled: boolean;
10
+ cobuildLockProvider: string;
11
+ }
12
+ /**
13
+ * @beta
14
+ */
15
+ export interface ICobuildConfigurationOptions {
16
+ cobuildJson: ICobuildJson;
17
+ rushConfiguration: RushConfiguration;
18
+ rushSession: RushSession;
19
+ }
20
+ /**
21
+ * Use this class to load and save the "common/config/rush/cobuild.json" config file.
22
+ * This file provides configuration options for the Rush Cobuild feature.
23
+ * @beta
24
+ */
25
+ export declare class CobuildConfiguration {
26
+ private static _jsonSchema;
27
+ /**
28
+ * Indicates whether the cobuild feature is enabled.
29
+ * Typically it is enabled in the cobuild.json config file.
30
+ *
31
+ * Note: The orchestrator (or local users) should always have to opt into running with cobuilds by
32
+ * providing a cobuild context id. Even if cobuilds are "enabled" as a feature, they don't
33
+ * actually turn on for that particular build unless the cobuild context id is provided as an
34
+ * non-empty string.
35
+ */
36
+ readonly cobuildEnabled: boolean;
37
+ /**
38
+ * Cobuild context id
39
+ *
40
+ * @remarks
41
+ * The cobuild feature won't be enabled until the context id is provided as an non-empty string.
42
+ */
43
+ readonly cobuildContextId: string | undefined;
44
+ /**
45
+ * If true, Rush will automatically handle the leaf project with build cache "disabled" by writing
46
+ * to the cache in a special "log files only mode". This is useful when you want to use Cobuilds
47
+ * to improve the performance in CI validations and the leaf projects have not enabled cache.
48
+ */
49
+ readonly cobuildLeafProjectLogOnlyAllowed: boolean;
50
+ readonly cobuildLockProvider: ICobuildLockProvider;
51
+ private constructor();
52
+ /**
53
+ * Attempts to load the cobuild.json data from the standard file path `common/config/rush/cobuild.json`.
54
+ * If the file has not been created yet, then undefined is returned.
55
+ */
56
+ static tryLoadAsync(terminal: ITerminal, rushConfiguration: RushConfiguration, rushSession: RushSession): Promise<CobuildConfiguration | undefined>;
57
+ static getCobuildConfigFilePath(rushConfiguration: RushConfiguration): string;
58
+ private static _loadAsync;
59
+ get contextId(): string | undefined;
60
+ connectLockProviderAsync(): Promise<void>;
61
+ disconnectLockProviderAsync(): Promise<void>;
62
+ }
63
+ //# sourceMappingURL=CobuildConfiguration.d.ts.map
@@ -0,0 +1 @@
1
+ module.exports = require("../../lib-shim/index")._rushSdk_loadInternalModule("api/CobuildConfiguration");
@@ -9,7 +9,7 @@ export interface IEnvironmentConfigurationInitializeOptions {
9
9
  * Names of environment variables used by Rush.
10
10
  * @beta
11
11
  */
12
- export declare enum EnvironmentVariableNames {
12
+ export declare const EnvironmentVariableNames: {
13
13
  /**
14
14
  * This variable overrides the temporary folder used by Rush.
15
15
  * The default value is "common/temp" under the repository root.
@@ -17,43 +17,43 @@ export declare enum EnvironmentVariableNames {
17
17
  * @remarks This environment variable is not compatible with workspace installs. If attempting
18
18
  * to move the PNPM store path, see the `RUSH_PNPM_STORE_PATH` environment variable.
19
19
  */
20
- RUSH_TEMP_FOLDER = "RUSH_TEMP_FOLDER",
20
+ readonly RUSH_TEMP_FOLDER: "RUSH_TEMP_FOLDER";
21
21
  /**
22
22
  * This variable overrides the version of Rush that will be installed by
23
23
  * the version selector. The default value is determined by the "rushVersion"
24
24
  * field from rush.json.
25
25
  */
26
- RUSH_PREVIEW_VERSION = "RUSH_PREVIEW_VERSION",
26
+ readonly RUSH_PREVIEW_VERSION: "RUSH_PREVIEW_VERSION";
27
27
  /**
28
28
  * If this variable is set to "1", Rush will not fail the build when running a version
29
29
  * of Node that does not match the criteria specified in the "nodeSupportedVersionRange"
30
30
  * field from rush.json.
31
31
  */
32
- RUSH_ALLOW_UNSUPPORTED_NODEJS = "RUSH_ALLOW_UNSUPPORTED_NODEJS",
32
+ readonly RUSH_ALLOW_UNSUPPORTED_NODEJS: "RUSH_ALLOW_UNSUPPORTED_NODEJS";
33
33
  /**
34
34
  * Setting this environment variable overrides the value of `allowWarningsInSuccessfulBuild`
35
35
  * in the `command-line.json` configuration file. Specify `1` to allow warnings in a successful build,
36
36
  * or `0` to disallow them. (See the comments in the command-line.json file for more information).
37
37
  */
38
- RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD = "RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD",
38
+ readonly RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD: "RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD";
39
39
  /**
40
40
  * This variable selects a specific installation variant for Rush to use when installing
41
41
  * and linking package dependencies.
42
42
  * For more information, see the command-line help for the `--variant` parameter
43
43
  * and this article: https://rushjs.io/pages/advanced/installation_variants/
44
44
  */
45
- RUSH_VARIANT = "RUSH_VARIANT",
45
+ readonly RUSH_VARIANT: "RUSH_VARIANT";
46
46
  /**
47
47
  * Specifies the maximum number of concurrent processes to launch during a build.
48
48
  * For more information, see the command-line help for the `--parallelism` parameter for "rush build".
49
49
  */
50
- RUSH_PARALLELISM = "RUSH_PARALLELISM",
50
+ readonly RUSH_PARALLELISM: "RUSH_PARALLELISM";
51
51
  /**
52
52
  * If this variable is set to "1", Rush will create symlinks with absolute paths instead
53
53
  * of relative paths. This can be necessary when a repository is moved during a build or
54
54
  * if parts of a repository are moved into a sandbox.
55
55
  */
56
- RUSH_ABSOLUTE_SYMLINKS = "RUSH_ABSOLUTE_SYMLINKS",
56
+ readonly RUSH_ABSOLUTE_SYMLINKS: "RUSH_ABSOLUTE_SYMLINKS";
57
57
  /**
58
58
  * When using PNPM as the package manager, this variable can be used to configure the path that
59
59
  * PNPM will use as the store directory.
@@ -61,18 +61,18 @@ export declare enum EnvironmentVariableNames {
61
61
  * If a relative path is used, then the store path will be resolved relative to the process's
62
62
  * current working directory. An absolute path is recommended.
63
63
  */
64
- RUSH_PNPM_STORE_PATH = "RUSH_PNPM_STORE_PATH",
64
+ readonly RUSH_PNPM_STORE_PATH: "RUSH_PNPM_STORE_PATH";
65
65
  /**
66
66
  * When using PNPM as the package manager, this variable can be used to control whether or not PNPM
67
67
  * validates the integrity of the PNPM store during installation. The value of this environment variable must be
68
68
  * `1` (for true) or `0` (for false). If not specified, defaults to the value in .npmrc.
69
69
  */
70
- RUSH_PNPM_VERIFY_STORE_INTEGRITY = "RUSH_PNPM_VERIFY_STORE_INTEGRITY",
70
+ readonly RUSH_PNPM_VERIFY_STORE_INTEGRITY: "RUSH_PNPM_VERIFY_STORE_INTEGRITY";
71
71
  /**
72
72
  * This environment variable can be used to specify the `--target-folder` parameter
73
73
  * for the "rush deploy" command.
74
74
  */
75
- RUSH_DEPLOY_TARGET_FOLDER = "RUSH_DEPLOY_TARGET_FOLDER",
75
+ readonly RUSH_DEPLOY_TARGET_FOLDER: "RUSH_DEPLOY_TARGET_FOLDER";
76
76
  /**
77
77
  * Overrides the location of the `~/.rush` global folder where Rush stores temporary files.
78
78
  *
@@ -89,7 +89,7 @@ export declare enum EnvironmentVariableNames {
89
89
  *
90
90
  * POSIX is a registered trademark of the Institute of Electrical and Electronic Engineers, Inc.
91
91
  */
92
- RUSH_GLOBAL_FOLDER = "RUSH_GLOBAL_FOLDER",
92
+ readonly RUSH_GLOBAL_FOLDER: "RUSH_GLOBAL_FOLDER";
93
93
  /**
94
94
  * Provides a credential for a remote build cache, if configured. This credential overrides any cached credentials.
95
95
  *
@@ -103,7 +103,7 @@ export declare enum EnvironmentVariableNames {
103
103
  *
104
104
  * For information on SAS tokens, see here: https://docs.microsoft.com/en-us/azure/storage/common/storage-sas-overview
105
105
  */
106
- RUSH_BUILD_CACHE_CREDENTIAL = "RUSH_BUILD_CACHE_CREDENTIAL",
106
+ readonly RUSH_BUILD_CACHE_CREDENTIAL: "RUSH_BUILD_CACHE_CREDENTIAL";
107
107
  /**
108
108
  * Setting this environment variable overrides the value of `buildCacheEnabled` in the `build-cache.json`
109
109
  * configuration file.
@@ -113,26 +113,49 @@ export declare enum EnvironmentVariableNames {
113
113
  *
114
114
  * If there is no build cache configured, then this environment variable is ignored.
115
115
  */
116
- RUSH_BUILD_CACHE_ENABLED = "RUSH_BUILD_CACHE_ENABLED",
116
+ readonly RUSH_BUILD_CACHE_ENABLED: "RUSH_BUILD_CACHE_ENABLED";
117
117
  /**
118
118
  * Overrides the value of `isCacheWriteAllowed` in the `build-cache.json` configuration file. The value of this
119
119
  * environment variable must be `1` (for true) or `0` (for false). If there is no build cache configured, then
120
120
  * this environment variable is ignored.
121
121
  */
122
- RUSH_BUILD_CACHE_WRITE_ALLOWED = "RUSH_BUILD_CACHE_WRITE_ALLOWED",
122
+ readonly RUSH_BUILD_CACHE_WRITE_ALLOWED: "RUSH_BUILD_CACHE_WRITE_ALLOWED";
123
+ /**
124
+ * Setting this environment variable overrides the value of `cobuildEnabled` in the `cobuild.json`
125
+ * configuration file.
126
+ *
127
+ * @remarks
128
+ * Specify `1` to enable the cobuild or `0` to disable it.
129
+ *
130
+ * If there is no cobuild configured, then this environment variable is ignored.
131
+ */
132
+ readonly RUSH_COBUILD_ENABLED: "RUSH_COBUILD_ENABLED";
133
+ /**
134
+ * Setting this environment variable opt into running with cobuilds.
135
+ *
136
+ * @remarks
137
+ * If there is no cobuild configured, then this environment variable is ignored.
138
+ */
139
+ readonly RUSH_COBUILD_CONTEXT_ID: "RUSH_COBUILD_CONTEXT_ID";
140
+ /**
141
+ * If this variable is set to "1", When getting distributed builds, Rush will automatically handle the leaf project
142
+ * with build cache "disabled" by writing to the cache in a special "log files only mode". This is useful when you
143
+ * want to use Cobuilds to improve the performance in CI validations and the leaf projects have not enabled cache.
144
+ */
145
+ readonly RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED: "RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED";
123
146
  /**
124
147
  * Explicitly specifies the path for the Git binary that is invoked by certain Rush operations.
125
148
  */
126
- RUSH_GIT_BINARY_PATH = "RUSH_GIT_BINARY_PATH",
149
+ readonly RUSH_GIT_BINARY_PATH: "RUSH_GIT_BINARY_PATH";
127
150
  /**
128
151
  * Explicitly specifies the path for the `tar` binary that is invoked by certain Rush operations.
129
152
  */
130
- RUSH_TAR_BINARY_PATH = "RUSH_TAR_BINARY_PATH",
153
+ readonly RUSH_TAR_BINARY_PATH: "RUSH_TAR_BINARY_PATH";
131
154
  /**
132
155
  * Internal variable that explicitly specifies the path for the version of `@microsoft/rush-lib` being executed.
133
156
  * Will be set upon loading Rush.
134
157
  */
135
- RUSH_LIB_PATH = "_RUSH_LIB_PATH",
158
+ readonly RUSH_LIB_PATH: "_RUSH_LIB_PATH";
136
159
  /**
137
160
  * When Rush executes shell scripts, it sometimes changes the working directory to be a project folder or
138
161
  * the repository root folder. The original working directory (where the Rush command was invoked) is assigned
@@ -142,8 +165,8 @@ export declare enum EnvironmentVariableNames {
142
165
  * The `RUSH_INVOKED_FOLDER` variable is the same idea as the `INIT_CWD` variable that package managers
143
166
  * assign when they execute lifecycle scripts.
144
167
  */
145
- RUSH_INVOKED_FOLDER = "RUSH_INVOKED_FOLDER"
146
- }
168
+ readonly RUSH_INVOKED_FOLDER: "RUSH_INVOKED_FOLDER";
169
+ };
147
170
  /**
148
171
  * Provides Rush-specific environment variable data. All Rush environment variables must start with "RUSH_". This class
149
172
  * is designed to be used by RushConfiguration.
@@ -164,6 +187,9 @@ export declare class EnvironmentConfiguration {
164
187
  private static _buildCacheCredential;
165
188
  private static _buildCacheEnabled;
166
189
  private static _buildCacheWriteAllowed;
190
+ private static _cobuildEnabled;
191
+ private static _cobuildContextId;
192
+ private static _cobuildLeafProjectLogOnlyAllowed;
167
193
  private static _gitBinaryPath;
168
194
  private static _tarBinaryPath;
169
195
  /**
@@ -219,6 +245,21 @@ export declare class EnvironmentConfiguration {
219
245
  * See {@link EnvironmentVariableNames.RUSH_BUILD_CACHE_WRITE_ALLOWED}
220
246
  */
221
247
  static get buildCacheWriteAllowed(): boolean | undefined;
248
+ /**
249
+ * If set, enables or disables the cobuild feature.
250
+ * See {@link EnvironmentVariableNames.RUSH_COBUILD_ENABLED}
251
+ */
252
+ static get cobuildEnabled(): boolean | undefined;
253
+ /**
254
+ * Provides a determined cobuild context id if configured
255
+ * See {@link EnvironmentVariableNames.RUSH_COBUILD_CONTEXT_ID}
256
+ */
257
+ static get cobuildContextId(): string | undefined;
258
+ /**
259
+ * If set, enables or disables the cobuild leaf project log only feature.
260
+ * See {@link EnvironmentVariableNames.RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED}
261
+ */
262
+ static get cobuildLeafProjectLogOnlyAllowed(): boolean | undefined;
222
263
  /**
223
264
  * Allows the git binary path to be explicitly provided.
224
265
  * See {@link EnvironmentVariableNames.RUSH_GIT_BINARY_PATH}
@@ -35,6 +35,11 @@ export interface IExperimentsJson {
35
35
  * in common/config/rush/command-line.json.
36
36
  */
37
37
  phasedCommands?: boolean;
38
+ /**
39
+ * If true, rush install or rush update implicitly specify --ignore-scripts during pnpm install,
40
+ * and run install lifecycle scripts by pnpm rebuild --pending after pnpm install successfully.
41
+ */
42
+ deferredInstallationScripts?: boolean;
38
43
  /**
39
44
  * If true, perform a clean install after when running `rush install` or `rush update` if the
40
45
  * `.npmrc` file has changed since the last install.
@@ -1,6 +1,52 @@
1
- import { JsonObject } from '@rushstack/node-core-library';
1
+ import { IPackageJson } from '@rushstack/node-core-library';
2
+ import { BaseFlag } from './base/BaseFlag';
3
+ import { PackageManagerName } from './packageManager/PackageManager';
2
4
  import { RushConfiguration } from './RushConfiguration';
3
5
  export declare const LAST_INSTALL_FLAG_FILE_NAME: string;
6
+ /**
7
+ * This represents the JSON data structure for the "last-install.flag" file.
8
+ * @internal
9
+ */
10
+ export interface ILastInstallFlagJson {
11
+ /**
12
+ * Current node version
13
+ */
14
+ node: string;
15
+ /**
16
+ * Current package manager name
17
+ */
18
+ packageManager: PackageManagerName;
19
+ /**
20
+ * Current package manager version
21
+ */
22
+ packageManagerVersion: string;
23
+ /**
24
+ * Current rush json folder
25
+ */
26
+ rushJsonFolder: string;
27
+ /**
28
+ * The content of package.json, used in the flag file of autoinstaller
29
+ */
30
+ packageJson?: IPackageJson;
31
+ /**
32
+ * Same with pnpmOptions.pnpmStorePath in rush.json
33
+ */
34
+ storePath?: string;
35
+ /**
36
+ * True when "useWorkspaces" is true in rush.json
37
+ */
38
+ workspaces?: true;
39
+ /**
40
+ * True when user explicitly specify "--ignore-scripts" CLI parameter or deferredInstallationScripts
41
+ */
42
+ ignoreScripts?: true;
43
+ /**
44
+ * When specified, it is a list of selected projects during partial install
45
+ * It is undefined when full install
46
+ */
47
+ selectedProjectNames?: string[];
48
+ [key: string]: unknown;
49
+ }
4
50
  /**
5
51
  * @internal
6
52
  */
@@ -15,19 +61,9 @@ export interface ILockfileValidityCheckOptions {
15
61
  * it can invalidate the last install.
16
62
  * @internal
17
63
  */
18
- export declare class LastInstallFlag {
19
- private _state;
20
- /**
21
- * Returns the full path to the flag file
22
- */
23
- readonly path: string;
24
- /**
25
- * Creates a new LastInstall flag
26
- * @param folderPath - the folder that this flag is managing
27
- * @param state - optional, the state that should be managed or compared
28
- */
29
- constructor(folderPath: string, state?: JsonObject);
64
+ export declare class LastInstallFlag extends BaseFlag<ILastInstallFlagJson> {
30
65
  /**
66
+ * @override
31
67
  * Returns true if the file exists and the contents match the current state.
32
68
  */
33
69
  isValid(options?: ILockfileValidityCheckOptions): boolean;
@@ -41,14 +77,6 @@ export declare class LastInstallFlag {
41
77
  rushVerb: string;
42
78
  }): boolean;
43
79
  private _isValid;
44
- /**
45
- * Writes the flag file to disk with the current state
46
- */
47
- create(): void;
48
- /**
49
- * Removes the flag file
50
- */
51
- clear(): void;
52
80
  /**
53
81
  * Returns the name of the flag file
54
82
  */
@@ -69,5 +97,14 @@ export declare class LastInstallFlagFactory {
69
97
  * @internal
70
98
  */
71
99
  static getCommonTempFlag(rushConfiguration: RushConfiguration, extraState?: Record<string, string>): LastInstallFlag;
100
+ /**
101
+ * Gets the LastInstall flag and sets the current state. This state is used to compare
102
+ * against the last-known-good state tracked by the LastInstall flag.
103
+ * @param rushConfiguration - the configuration of the Rush repo to get the install
104
+ * state from
105
+ *
106
+ * @internal
107
+ */
108
+ static getCommonTempSplitFlag(rushConfiguration: RushConfiguration): LastInstallFlag;
72
109
  }
73
110
  //# sourceMappingURL=LastInstallFlag.d.ts.map
@@ -1,16 +1,12 @@
1
- import { LastInstallFlag } from './LastInstallFlag';
2
- import { RushConfiguration } from './RushConfiguration';
1
+ import { BaseFlag } from './base/BaseFlag';
2
+ import type { RushConfiguration } from './RushConfiguration';
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
6
6
  * indicates that linking was completed successfully.
7
7
  * @internal
8
8
  */
9
- export declare class LastLinkFlag extends LastInstallFlag {
10
- /**
11
- * @override
12
- */
13
- isValid(): boolean;
9
+ export declare class LastLinkFlag extends BaseFlag {
14
10
  /**
15
11
  * @override
16
12
  */
@@ -117,6 +117,15 @@ export interface IRushConfigurationJson {
117
117
  export interface ICurrentVariantJson {
118
118
  variant: string | JsonNull;
119
119
  }
120
+ /**
121
+ * The filter parameters to search from all projects.
122
+ */
123
+ export interface IRushConfigurationProjectsFilter {
124
+ /**
125
+ * If true, filter out projects that specify splitWorkspace as true.
126
+ */
127
+ splitWorkspace: boolean;
128
+ }
120
129
  /**
121
130
  * Options for `RushConfiguration.tryFindRushJsonLocation`.
122
131
  * @public
@@ -143,6 +152,8 @@ export declare class RushConfiguration {
143
152
  private _projects;
144
153
  private _projectsByName;
145
154
  private _projectsByTag;
155
+ private _filteredProjectsCache;
156
+ private _hasSplitWorkspaceProject;
146
157
  private _commonVersionsConfigurationsByVariant;
147
158
  /**
148
159
  * The name of the package manager being used to install dependencies
@@ -197,6 +208,12 @@ export declare class RushConfiguration {
197
208
  * Example: `C:\MyRepo\common\temp`
198
209
  */
199
210
  readonly commonTempFolder: string;
211
+ /**
212
+ * The folder where temporary files will be stored. This is always a subfolder called "temp"
213
+ * under the common folder.
214
+ * Example: `C:\MyRepo\common\temp-split`
215
+ */
216
+ readonly commonTempSplitFolder: string;
200
217
  /**
201
218
  * The folder where automation scripts are stored. This is always a subfolder called "scripts"
202
219
  * under the common folder.
@@ -251,6 +268,21 @@ export declare class RushConfiguration {
251
268
  * or `C:\MyRepo\common\temp\pnpm-lock-preinstall.yaml`
252
269
  */
253
270
  readonly tempShrinkwrapPreinstallFilename: string;
271
+ /**
272
+ * The filename (without any path) of the shrinkwrap file for split workspace that is used by the package manager.
273
+ * @remarks
274
+ * This property merely reports the filename; the file itself may not actually exist.
275
+ * Example: `pnpm-lock.yaml`
276
+ */
277
+ readonly splitWorkspaceShrinkwrapFilename: string;
278
+ /**
279
+ * The full path of the temporary shrinkwrap file for split workspace that is used during
280
+ * "rush install". This file may get rewritten by the package manager during installation.
281
+ * @remarks
282
+ * This property merely reports the filename; the file itself may not actually exist.
283
+ * Example: `C:\MyRepo\common\temp-split\pnpm-lock.yaml`
284
+ */
285
+ readonly tempSplitWorkspaceShrinkwrapFilename: string;
254
286
  /**
255
287
  * The filename of the variant dependency data file. By default this is
256
288
  * called 'current-variant.json' resides in the Rush common folder.
@@ -506,6 +538,11 @@ export declare class RushConfiguration {
506
538
  * @beta
507
539
  */
508
540
  get projectsByTag(): ReadonlyMap<string, ReadonlySet<RushConfigurationProject>>;
541
+ /**
542
+ * Search for projects according to filter
543
+ * @beta
544
+ */
545
+ getFilteredProjects(filter: IRushConfigurationProjectsFilter): RushConfigurationProject[];
509
546
  /**
510
547
  * Settings from the common-versions.json config file.
511
548
  * @remarks
@@ -524,6 +561,10 @@ export declare class RushConfiguration {
524
561
  * or "rush update".
525
562
  */
526
563
  get currentInstalledVariant(): string | undefined;
564
+ /**
565
+ * Is there any split workspace project.
566
+ */
567
+ get hasSplitWorkspaceProject(): boolean;
527
568
  /**
528
569
  * Gets the path to the common-versions.json config file for a specific variant.
529
570
  * @param variant - The name of the current variant in use by the active command.
@@ -556,6 +597,11 @@ export declare class RushConfiguration {
556
597
  * @param variant - The name of the current variant in use by the active command.
557
598
  */
558
599
  getCommittedShrinkwrapFilename(variant?: string | undefined): string;
600
+ /**
601
+ * Gets the committed shrinkwrap file name for split workspace.
602
+ * @param variant - The name of the current variant in use by the active command.
603
+ */
604
+ getCommittedSplitWorkspaceShrinkwrapFilename(): string;
559
605
  /**
560
606
  * Gets the absolute path for "pnpmfile.js" for a specific variant.
561
607
  * @param variant - The name of the current variant in use by the active command.
@@ -591,5 +637,11 @@ export declare class RushConfiguration {
591
637
  */
592
638
  tryGetProjectForPath(currentFolderPath: string): RushConfigurationProject | undefined;
593
639
  private _getVariantConfigFolderPath;
640
+ /**
641
+ * Split workspace can only works on PNPM with "useWorkspaces" enabled.
642
+ * The workspace project can NOT depend on a split workspace project.
643
+ * The split workspace project CAN depend on a workspace project.
644
+ */
645
+ private _validateSplitWorkspaceRelationships;
594
646
  }
595
647
  //# sourceMappingURL=RushConfiguration.d.ts.map
@@ -16,6 +16,7 @@ export interface IRushConfigurationProjectJson {
16
16
  skipRushCheck?: boolean;
17
17
  publishFolder?: string;
18
18
  tags?: string[];
19
+ splitWorkspace?: boolean;
19
20
  }
20
21
  /**
21
22
  * @internal
@@ -151,6 +152,11 @@ export declare class RushConfigurationProject {
151
152
  * @beta
152
153
  */
153
154
  readonly tags: ReadonlySet<string>;
155
+ /**
156
+ * Whether this project is a split workspace project.
157
+ * @beta
158
+ */
159
+ readonly splitWorkspace: boolean;
154
160
  /** @internal */
155
161
  constructor(options: IRushConfigurationProjectOptions);
156
162
  /**
@@ -0,0 +1,50 @@
1
+ import { JsonObject } from '@rushstack/node-core-library';
2
+ /**
3
+ * A base class for flag file.
4
+ * @internal
5
+ */
6
+ export declare class BaseFlag<T extends object = JsonObject> {
7
+ /**
8
+ * Flag file path
9
+ */
10
+ readonly path: string;
11
+ /**
12
+ * Content of the flag
13
+ */
14
+ protected _state: T;
15
+ /**
16
+ * Whether the current state is modified
17
+ */
18
+ protected _isModified: boolean;
19
+ /**
20
+ * Creates a new flag file
21
+ * @param folderPath - the folder that this flag is managing
22
+ * @param state - optional, the state that should be managed or compared
23
+ */
24
+ constructor(folderPath: string, state?: Partial<T>);
25
+ /**
26
+ * Returns true if the file exists and the contents match the current state.
27
+ */
28
+ isValid(): boolean;
29
+ /**
30
+ * Writes the flag file to disk with the current state
31
+ */
32
+ create(): void;
33
+ /**
34
+ * Merge new data into current state by lodash "merge"
35
+ */
36
+ mergeFromObject(data: JsonObject): void;
37
+ /**
38
+ * Writes the flag file to disk with the current state if modified
39
+ */
40
+ saveIfModified(): void;
41
+ /**
42
+ * Removes the flag file
43
+ */
44
+ clear(): void;
45
+ /**
46
+ * Returns Name of the flag file
47
+ */
48
+ protected get flagName(): string;
49
+ }
50
+ //# sourceMappingURL=BaseFlag.d.ts.map
@@ -0,0 +1 @@
1
+ module.exports = require("../../../lib-shim/index")._rushSdk_loadInternalModule("api/base/BaseFlag");
@@ -11,7 +11,21 @@ export declare class PnpmPackageManager extends PackageManager {
11
11
  * Example: `pnpmfile.js` or `.pnpmfile.cjs`
12
12
  */
13
13
  readonly pnpmfileFilename: string;
14
+ /**
15
+ * The filename of the shrinkwrap file of split workspace that is used by the package manager.
16
+ *
17
+ * @remarks
18
+ * Example: `.pnpmfile-split-workspace.cjs`
19
+ */
20
+ splitWorkspacePnpmfileFilename: string;
14
21
  /** @internal */
15
22
  constructor(version: string);
23
+ /**
24
+ * The filename of the global shrinkwrap file that is used by the package manager.
25
+ *
26
+ * @remarks
27
+ * Example: `global-pnpmfile.cjs`
28
+ */
29
+ get globalPnpmfileFilename(): string;
16
30
  }
17
31
  //# sourceMappingURL=PnpmPackageManager.d.ts.map
@@ -3,6 +3,13 @@ import type { IInstallManagerOptions } from '../../logic/base/BaseInstallManager
3
3
  import { RushCommandLineParser } from '../RushCommandLineParser';
4
4
  export declare class InstallAction extends BaseInstallAction {
5
5
  private readonly _checkOnlyParameter;
6
+ private _ignoreScriptsParameter;
7
+ /**
8
+ * Whether split workspace projects are included in install
9
+ *
10
+ * This parameter only supported when there is split workspace project
11
+ */
12
+ private _includeSplitWorkspaceParameter?;
6
13
  constructor(parser: RushCommandLineParser);
7
14
  protected buildInstallOptionsAsync(): Promise<IInstallManagerOptions>;
8
15
  }
@@ -34,6 +34,10 @@ export interface IJsonEntry {
34
34
  * @see {@link ../../api/RushConfigurationProject#RushConfigurationProject.tags | RushConfigurationProject.tags}
35
35
  */
36
36
  tags: string[];
37
+ /**
38
+ * @see {@link ../../api/RushConfigurationProject#RushConfigurationProject.splitWorkspace | RushConfigurationProject.splitWorkspace}
39
+ */
40
+ splitWorkspace: boolean;
37
41
  }
38
42
  export interface IJsonOutput {
39
43
  projects: IJsonEntry[];
@@ -4,6 +4,13 @@ import { RushCommandLineParser } from '../RushCommandLineParser';
4
4
  export declare class UpdateAction extends BaseInstallAction {
5
5
  private readonly _fullParameter;
6
6
  private readonly _recheckParameter;
7
+ private _ignoreScriptsParameter;
8
+ /**
9
+ * Whether split workspace projects are included in update
10
+ *
11
+ * This parameter only supported when there is split workspace project
12
+ */
13
+ private _includeSplitWorkspaceParameter?;
7
14
  constructor(parser: RushCommandLineParser);
8
15
  protected runAsync(): Promise<void>;
9
16
  protected buildInstallOptionsAsync(): Promise<IInstallManagerOptions>;