@rushstack/rush-sdk 5.101.0 → 5.102.0-pr3949.4

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 (41) hide show
  1. package/dist/rush-lib.d.ts +402 -8
  2. package/dist/tsdoc-metadata.json +1 -1
  3. package/lib/api/CobuildConfiguration.d.ts +71 -0
  4. package/lib/api/CobuildConfiguration.js +1 -0
  5. package/lib/api/CustomTipsConfiguration.d.ts +89 -0
  6. package/lib/api/CustomTipsConfiguration.js +1 -0
  7. package/lib/api/EnvironmentConfiguration.d.ts +61 -0
  8. package/lib/api/ExperimentsConfiguration.d.ts +6 -0
  9. package/lib/api/RushConfiguration.d.ts +11 -0
  10. package/lib/cli/actions/BaseInstallAction.d.ts +2 -0
  11. package/lib/cli/actions/CheckAction.d.ts +1 -0
  12. package/lib/index.d.ts +4 -1
  13. package/lib/logic/RushConstants.d.ts +10 -0
  14. package/lib/logic/base/BaseInstallManagerTypes.d.ts +4 -0
  15. package/lib/logic/buildCache/ProjectBuildCache.d.ts +5 -4
  16. package/lib/logic/cobuild/CobuildLock.d.ts +43 -0
  17. package/lib/logic/cobuild/CobuildLock.js +1 -0
  18. package/lib/logic/cobuild/DisjointSet.d.ts +28 -0
  19. package/lib/logic/cobuild/DisjointSet.js +1 -0
  20. package/lib/logic/cobuild/ICobuildLockProvider.d.ts +99 -0
  21. package/lib/logic/cobuild/ICobuildLockProvider.js +1 -0
  22. package/lib/logic/operations/AsyncOperationQueue.d.ts +23 -4
  23. package/lib/logic/operations/CacheableOperationPlugin.d.ts +41 -0
  24. package/lib/logic/operations/CacheableOperationPlugin.js +1 -0
  25. package/lib/logic/operations/IOperationExecutionResult.d.ts +4 -0
  26. package/lib/logic/operations/IOperationRunner.d.ts +21 -6
  27. package/lib/logic/operations/OperationExecutionManager.d.ts +6 -0
  28. package/lib/logic/operations/OperationExecutionRecord.d.ts +15 -1
  29. package/lib/logic/operations/OperationMetadataManager.d.ts +3 -1
  30. package/lib/logic/operations/OperationStateFile.d.ts +2 -0
  31. package/lib/logic/operations/OperationStatus.d.ts +8 -0
  32. package/lib/logic/operations/PeriodicCallback.d.ts +20 -0
  33. package/lib/logic/operations/PeriodicCallback.js +1 -0
  34. package/lib/logic/operations/ProjectLogWritable.d.ts +11 -0
  35. package/lib/logic/operations/ShellOperationRunner.d.ts +2 -26
  36. package/lib/logic/versionMismatch/VersionMismatchFinder.d.ts +3 -2
  37. package/lib/pluginFramework/PhasedCommandHooks.d.ts +24 -4
  38. package/lib/pluginFramework/RushSession.d.ts +11 -2
  39. package/lib/utilities/NullTerminalProvider.d.ts +10 -0
  40. package/lib/utilities/NullTerminalProvider.js +1 -0
  41. package/package.json +2 -2
@@ -6,6 +6,7 @@
6
6
  /// <reference types="node" />
7
7
 
8
8
  import { AsyncParallelHook } from 'tapable';
9
+ import { AsyncSeriesBailHook } from 'tapable';
9
10
  import { AsyncSeriesHook } from 'tapable';
10
11
  import { AsyncSeriesWaterfallHook } from 'tapable';
11
12
  import type { CollatedWriter } from '@rushstack/stream-collator';
@@ -209,6 +210,62 @@ export declare class ChangeManager {
209
210
  */
210
211
  export declare type CloudBuildCacheProviderFactory = (buildCacheJson: IBuildCacheJson) => ICloudBuildCacheProvider | Promise<ICloudBuildCacheProvider>;
211
212
 
213
+ /**
214
+ * Use this class to load and save the "common/config/rush/cobuild.json" config file.
215
+ * This file provides configuration options for the Rush Cobuild feature.
216
+ * @beta
217
+ */
218
+ export declare class CobuildConfiguration {
219
+ private static _jsonSchema;
220
+ /**
221
+ * Indicates whether the cobuild feature is enabled.
222
+ * Typically it is enabled in the cobuild.json config file.
223
+ *
224
+ * Note: The orchestrator (or local users) should always have to opt into running with cobuilds by
225
+ * providing a cobuild context id. Even if cobuilds are "enabled" as a feature, they don't
226
+ * actually turn on for that particular build unless the cobuild context id is provided as an
227
+ * non-empty string.
228
+ */
229
+ readonly cobuildEnabled: boolean;
230
+ /**
231
+ * Cobuild context id
232
+ *
233
+ * @remarks
234
+ * The cobuild feature won't be enabled until the context id is provided as an non-empty string.
235
+ */
236
+ readonly cobuildContextId: string | undefined;
237
+ /**
238
+ * This is a name of the participating cobuild runner. It can be specified by the environment variable
239
+ * RUSH_COBUILD_RUNNER_ID. If it is not provided, a random id will be generated to identify the runner.
240
+ */
241
+ readonly cobuildRunnerId: string;
242
+ /**
243
+ * If true, Rush will automatically handle the leaf project with build cache "disabled" by writing
244
+ * to the cache in a special "log files only mode". This is useful when you want to use Cobuilds
245
+ * to improve the performance in CI validations and the leaf projects have not enabled cache.
246
+ */
247
+ readonly cobuildLeafProjectLogOnlyAllowed: boolean;
248
+ private _cobuildLockProvider;
249
+ private readonly _cobuildLockProviderFactory;
250
+ private readonly _cobuildJson;
251
+ private constructor();
252
+ /**
253
+ * Attempts to load the cobuild.json data from the standard file path `common/config/rush/cobuild.json`.
254
+ * If the file has not been created yet, then undefined is returned.
255
+ */
256
+ static tryLoadAsync(terminal: ITerminal, rushConfiguration: RushConfiguration, rushSession: RushSession): Promise<CobuildConfiguration | undefined>;
257
+ static getCobuildConfigFilePath(rushConfiguration: RushConfiguration): string;
258
+ private static _loadAsync;
259
+ createLockProviderAsync(terminal: ITerminal): Promise<void>;
260
+ destroyLockProviderAsync(): Promise<void>;
261
+ get cobuildLockProvider(): ICobuildLockProvider;
262
+ }
263
+
264
+ /**
265
+ * @beta
266
+ */
267
+ export declare type CobuildLockProviderFactory = (cobuildJson: ICobuildJson) => ICobuildLockProvider | Promise<ICobuildLockProvider>;
268
+
212
269
  /**
213
270
  * Use this class to load and save the "common/config/rush/common-versions.json" config file.
214
271
  * This config file stores dependency version information that affects all projects in the repo.
@@ -307,6 +364,58 @@ export declare class CredentialCache {
307
364
  private _validate;
308
365
  }
309
366
 
367
+ /**
368
+ * An identifier representing a Rush message that can be customized by
369
+ * defining a custom tip in `common/config/rush/custom-tips.json`.
370
+ * @remarks
371
+ * Custom tip ids always start with the `TIP_` prefix.
372
+ *
373
+ * @privateRemarks
374
+ * Events from the Rush process should with "TIP_RUSH_".
375
+ * Events from a PNPM subprocess should start with "TIP_PNPM_".
376
+ *
377
+ * @beta
378
+ */
379
+ export declare type CustomTipId = 'TIP_RUSH_INCONSISTENT_VERSIONS' | string;
380
+
381
+ /**
382
+ * Used to access the `common/config/rush/custom-tips.json` config file,
383
+ * which allows repo maintainers to configure extra details to be printed alongside
384
+ * certain Rush messages.
385
+ * @beta
386
+ */
387
+ export declare class CustomTipsConfiguration {
388
+ private static _jsonSchema;
389
+ private readonly _tipMap;
390
+ private readonly _jsonFileName;
391
+ /**
392
+ * The JSON settings loaded from `custom-tips.json`.
393
+ */
394
+ readonly configuration: Readonly<ICustomTipsJson>;
395
+ /**
396
+ * The list of identifiers that are allowed to be used in the "tipId" field
397
+ * of the config file.
398
+ */
399
+ static readonly supportedTipIds: ReadonlySet<string>;
400
+ constructor(configFilename: string);
401
+ private _formatTipMessage;
402
+ /**
403
+ * If custom-tips.json defines a tip for the specified tipId,
404
+ * display the tip on the terminal.
405
+ */
406
+ showInfoTip(terminal: ITerminal, tipId: CustomTipId): void;
407
+ /**
408
+ * If custom-tips.json defines a tip for the specified tipId,
409
+ * display the tip on the terminal.
410
+ */
411
+ showWarningTip(terminal: ITerminal, tipId: CustomTipId): void;
412
+ /**
413
+ * If custom-tips.json defines a tip for the specified tipId,
414
+ * display the tip on the terminal.
415
+ */
416
+ showErrorTip(terminal: ITerminal, tipId: CustomTipId): void;
417
+ }
418
+
310
419
  /**
311
420
  * @public
312
421
  */
@@ -338,6 +447,10 @@ export declare class EnvironmentConfiguration {
338
447
  private static _buildCacheCredential;
339
448
  private static _buildCacheEnabled;
340
449
  private static _buildCacheWriteAllowed;
450
+ private static _cobuildEnabled;
451
+ private static _cobuildContextId;
452
+ private static _cobuildRunnerId;
453
+ private static _cobuildLeafProjectLogOnlyAllowed;
341
454
  private static _gitBinaryPath;
342
455
  private static _tarBinaryPath;
343
456
  /**
@@ -393,6 +506,26 @@ export declare class EnvironmentConfiguration {
393
506
  * See {@link EnvironmentVariableNames.RUSH_BUILD_CACHE_WRITE_ALLOWED}
394
507
  */
395
508
  static get buildCacheWriteAllowed(): boolean | undefined;
509
+ /**
510
+ * If set, enables or disables the cobuild feature.
511
+ * See {@link EnvironmentVariableNames.RUSH_COBUILD_ENABLED}
512
+ */
513
+ static get cobuildEnabled(): boolean | undefined;
514
+ /**
515
+ * Provides a determined cobuild context id if configured
516
+ * See {@link EnvironmentVariableNames.RUSH_COBUILD_CONTEXT_ID}
517
+ */
518
+ static get cobuildContextId(): string | undefined;
519
+ /**
520
+ * Provides a determined cobuild runner id if configured
521
+ * See {@link EnvironmentVariableNames.RUSH_COBUILD_RUNNER_ID}
522
+ */
523
+ static get cobuildRunnerId(): string | undefined;
524
+ /**
525
+ * If set, enables or disables the cobuild leaf project log only feature.
526
+ * See {@link EnvironmentVariableNames.RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED}
527
+ */
528
+ static get cobuildLeafProjectLogOnlyAllowed(): boolean | undefined;
396
529
  /**
397
530
  * Allows the git binary path to be explicitly provided.
398
531
  * See {@link EnvironmentVariableNames.RUSH_GIT_BINARY_PATH}
@@ -550,6 +683,43 @@ export declare const EnvironmentVariableNames: {
550
683
  * this environment variable is ignored.
551
684
  */
552
685
  readonly RUSH_BUILD_CACHE_WRITE_ALLOWED: "RUSH_BUILD_CACHE_WRITE_ALLOWED";
686
+ /**
687
+ * Setting this environment variable overrides the value of `cobuildEnabled` in the `cobuild.json`
688
+ * configuration file.
689
+ *
690
+ * @remarks
691
+ * Specify `1` to enable the cobuild or `0` to disable it.
692
+ *
693
+ * If there is no cobuild configured, then this environment variable is ignored.
694
+ */
695
+ readonly RUSH_COBUILD_ENABLED: "RUSH_COBUILD_ENABLED";
696
+ /**
697
+ * Setting this environment variable opts into running with cobuilds. The context id should be the same across
698
+ * multiple VMs, but changed when it is a new round of cobuilds.
699
+ *
700
+ * e.g. `Build.BuildNumber` in Azure DevOps Pipeline.
701
+ *
702
+ * @remarks
703
+ * If there is no cobuild configured, then this environment variable is ignored.
704
+ */
705
+ readonly RUSH_COBUILD_CONTEXT_ID: "RUSH_COBUILD_CONTEXT_ID";
706
+ /**
707
+ * Explicitly specifies a name for each participating cobuild runner.
708
+ *
709
+ * Setting this environment variable opts into running with cobuilds.
710
+ *
711
+ * @remarks
712
+ * This environment variable is optional, if it is not provided, a random id is used.
713
+ *
714
+ * If there is no cobuild configured, then this environment variable is ignored.
715
+ */
716
+ readonly RUSH_COBUILD_RUNNER_ID: "RUSH_COBUILD_RUNNER_ID";
717
+ /**
718
+ * If this variable is set to "1", When getting distributed builds, Rush will automatically handle the leaf project
719
+ * with build cache "disabled" by writing to the cache in a special "log files only mode". This is useful when you
720
+ * want to use Cobuilds to improve the performance in CI validations and the leaf projects have not enabled cache.
721
+ */
722
+ readonly RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED: "RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED";
553
723
  /**
554
724
  * Explicitly specifies the path for the Git binary that is invoked by certain Rush operations.
555
725
  */
@@ -713,6 +883,114 @@ export declare interface ICloudBuildCacheProvider {
713
883
  deleteCachedCredentialsAsync(terminal: ITerminal): Promise<void>;
714
884
  }
715
885
 
886
+ /**
887
+ * @beta
888
+ */
889
+ export declare interface ICobuildCompletedState {
890
+ status: OperationStatus.Success | OperationStatus.SuccessWithWarning | OperationStatus.Failure;
891
+ /**
892
+ * Completed state points to the cache id that was used to store the build cache.
893
+ * Note: Cache failed builds in a separate cache id
894
+ */
895
+ cacheId: string;
896
+ }
897
+
898
+ /**
899
+ * @beta
900
+ */
901
+ export declare interface ICobuildContext {
902
+ /**
903
+ * The key for acquiring lock.
904
+ */
905
+ lockKey: string;
906
+ /**
907
+ * The expire time of the lock in seconds.
908
+ */
909
+ lockExpireTimeInSeconds: number;
910
+ /**
911
+ * The key for storing completed state.
912
+ */
913
+ completedStateKey: string;
914
+ /**
915
+ * The contextId is provided by the monorepo maintainer, it reads from environment variable {@link EnvironmentVariableNames.RUSH_COBUILD_CONTEXT_ID}.
916
+ * It ensure only the builds from the same given contextId cooperated.
917
+ */
918
+ contextId: string;
919
+ /**
920
+ * The id of the cluster. The operations in the same cluster share the same clusterId and
921
+ * will be executed on the same machine.
922
+ */
923
+ clusterId: string;
924
+ /**
925
+ * The id of the runner. The identifier for the running machine.
926
+ *
927
+ * It can be specified via assigning `RUSH_COBUILD_RUNNER_ID` environment variable.
928
+ */
929
+ runnerId: string;
930
+ /**
931
+ * The id of the cache entry. It should be kept the same as the normal cacheId from ProjectBuildCache.
932
+ * Otherwise, there is a discrepancy in the success case wherein turning on cobuilds will
933
+ * fail to populate the normal build cache.
934
+ */
935
+ cacheId: string;
936
+ /**
937
+ * The name of NPM package
938
+ *
939
+ * Example: `@scope/MyProject`
940
+ */
941
+ packageName: string;
942
+ /**
943
+ * The name of the phase.
944
+ *
945
+ * Example: _phase:build
946
+ */
947
+ phaseName: string;
948
+ }
949
+
950
+ /**
951
+ * @beta
952
+ */
953
+ export declare interface ICobuildJson {
954
+ cobuildEnabled: boolean;
955
+ cobuildLockProvider: string;
956
+ }
957
+
958
+ /**
959
+ * @beta
960
+ */
961
+ export declare interface ICobuildLockProvider {
962
+ /**
963
+ * The callback function invoked to connect to the lock provider.
964
+ * For example, initializing the connection to the redis server.
965
+ */
966
+ connectAsync(): Promise<void>;
967
+ /**
968
+ * The callback function invoked to disconnect the lock provider.
969
+ */
970
+ disconnectAsync(): Promise<void>;
971
+ /**
972
+ * The callback function to acquire a lock with a lock key and specific contexts.
973
+ *
974
+ * NOTE: This lock implementation must be a ReentrantLock. It says the lock might be acquired
975
+ * multiple times, since tasks in the same cluster can be run in the same VM.
976
+ */
977
+ acquireLockAsync(context: Readonly<ICobuildContext>): Promise<boolean>;
978
+ /**
979
+ * The callback function to renew a lock with a lock key and specific contexts.
980
+ *
981
+ * NOTE: If the lock key expired
982
+ */
983
+ renewLockAsync(context: Readonly<ICobuildContext>): Promise<void>;
984
+ /**
985
+ * The callback function to set completed state.
986
+ */
987
+ setCompletedStateAsync(context: Readonly<ICobuildContext>, state: ICobuildCompletedState): Promise<void>;
988
+ /**
989
+ * The callback function to get completed state.
990
+ */
991
+ getCompletedStateAsync(context: Readonly<ICobuildContext>): Promise<ICobuildCompletedState | undefined>;
992
+ }
993
+
716
994
  /**
717
995
  * A collection of environment variables
718
996
  * @public
@@ -750,6 +1028,10 @@ export declare interface ICreateOperationsContext {
750
1028
  * The configuration for the build cache, if the feature is enabled.
751
1029
  */
752
1030
  readonly buildCacheConfiguration: BuildCacheConfiguration | undefined;
1031
+ /**
1032
+ * The configuration for the cobuild, if cobuild feature and build cache feature are both enabled.
1033
+ */
1034
+ readonly cobuildConfiguration: CobuildConfiguration | undefined;
753
1035
  /**
754
1036
  * The set of custom parameters for the executing command.
755
1037
  * Maps from the `longName` field in command-line.json to the parser configuration in ts-command-line.
@@ -812,6 +1094,45 @@ export declare interface ICredentialCacheOptions {
812
1094
  supportEditing: boolean;
813
1095
  }
814
1096
 
1097
+ /**
1098
+ * An item from the {@link ICustomTipsJson.customTips} list.
1099
+ * @beta
1100
+ */
1101
+ export declare interface ICustomTipItemJson {
1102
+ /**
1103
+ * (REQUIRED) An identifier indicating a message that may be printed by Rush.
1104
+ * If that message is printed, then this custom tip will be shown.
1105
+ * Consult the Rush documentation for the current list of possible identifiers.
1106
+ */
1107
+ tipId: CustomTipId;
1108
+ /**
1109
+ * (REQUIRED) The message text to be displayed for this tip.
1110
+ */
1111
+ message: string;
1112
+ /**
1113
+ * Overrides the "defaultMessagePrefix" for this tip.
1114
+ * Specify an empty string to omit the "defaultMessagePrefix" entirely.
1115
+ */
1116
+ messagePrefix?: string;
1117
+ }
1118
+
1119
+ /**
1120
+ * This interface represents the raw custom-tips.json file which allows repo maintainers
1121
+ * to configure extra details to be printed alongside certain Rush messages.
1122
+ * @beta
1123
+ */
1124
+ export declare interface ICustomTipsJson {
1125
+ /**
1126
+ * If specified, this prefix will be prepended to any the tip messages when they are displayed.
1127
+ * The default value is an empty string.
1128
+ */
1129
+ defaultMessagePrefix?: string;
1130
+ /**
1131
+ * Specifies the custom tips to be displayed by Rush.
1132
+ */
1133
+ customTips?: ICustomTipItemJson[];
1134
+ }
1135
+
815
1136
  declare interface IEnvironment {
816
1137
  [environmentVariableName: string]: string | undefined;
817
1138
  }
@@ -865,6 +1186,12 @@ export declare interface IExperimentsJson {
865
1186
  * Set this option to true to pass '--prefer-frozen-lockfile' instead.
866
1187
  */
867
1188
  usePnpmPreferFrozenLockfileForRushUpdate?: boolean;
1189
+ /**
1190
+ * By default, 'rush update' runs as a single operation.
1191
+ * Set this option to true to instead update the lockfile with `--lockfile-only`, then perform a `--frozen-lockfile` install.
1192
+ * Necessary when using the `afterAllResolved` hook in .pnpmfile.cjs.
1193
+ */
1194
+ usePnpmLockfileOnlyThenFrozenLockfileForRushUpdate?: boolean;
868
1195
  /**
869
1196
  * If using the 'preventManualShrinkwrapChanges' option, restricts the hash to only include the layout of external dependencies.
870
1197
  * Used to allow links between workspace projects or the addition/removal of references to existing dependency versions to not
@@ -1109,6 +1436,10 @@ export declare interface IOperationExecutionResult {
1109
1436
  * The value indicates the duration of the same operation without cache hit.
1110
1437
  */
1111
1438
  readonly nonCachedDurationMs: number | undefined;
1439
+ /**
1440
+ * The id of the runner which actually runs the building process in cobuild mode.
1441
+ */
1442
+ readonly cobuildRunnerId: string | undefined;
1112
1443
  }
1113
1444
 
1114
1445
  /**
@@ -1118,6 +1449,8 @@ export declare interface _IOperationMetadata {
1118
1449
  durationInSeconds: number;
1119
1450
  logPath: string;
1120
1451
  errorLogPath: string;
1452
+ cobuildContextId: string | undefined;
1453
+ cobuildRunnerId: string | undefined;
1121
1454
  }
1122
1455
 
1123
1456
  /**
@@ -1160,10 +1493,6 @@ export declare interface IOperationRunner {
1160
1493
  * Name of the operation, for logging.
1161
1494
  */
1162
1495
  readonly name: string;
1163
- /**
1164
- * This flag determines if the operation is allowed to be skipped if up to date.
1165
- */
1166
- isSkipAllowed: boolean;
1167
1496
  /**
1168
1497
  * Indicates that this runner's duration has meaning.
1169
1498
  */
@@ -1178,9 +1507,9 @@ export declare interface IOperationRunner {
1178
1507
  */
1179
1508
  warningsAreAllowed: boolean;
1180
1509
  /**
1181
- * Indicates if the output of this operation may be written to the cache
1510
+ * Full shell command string to run by this runner.
1182
1511
  */
1183
- isCacheWriteAllowed: boolean;
1512
+ commandToRun?: string;
1184
1513
  /**
1185
1514
  * Method to be executed for the operation.
1186
1515
  */
@@ -1219,6 +1548,25 @@ export declare interface IOperationRunnerContext {
1219
1548
  * Object used to track elapsed time.
1220
1549
  */
1221
1550
  stopwatch: IStopwatchResult;
1551
+ /**
1552
+ * The current execution status of an operation. Operations start in the 'ready' state,
1553
+ * but can be 'blocked' if an upstream operation failed. It is 'executing' when
1554
+ * the operation is executing. Once execution is complete, it is either 'success' or
1555
+ * 'failure'.
1556
+ */
1557
+ status: OperationStatus;
1558
+ /**
1559
+ * Error which occurred while executing this operation, this is stored in case we need
1560
+ * it later (for example to re-print errors at end of execution).
1561
+ */
1562
+ error?: Error;
1563
+ /**
1564
+ * Normally the incremental build logic will rebuild changed projects as well as
1565
+ * any projects that directly or indirectly depend on a changed project.
1566
+ * If true, then the incremental build logic will only rebuild changed projects and
1567
+ * ignore dependent projects.
1568
+ */
1569
+ readonly changedProjectsOnly: boolean;
1222
1570
  }
1223
1571
 
1224
1572
  /**
@@ -1234,6 +1582,8 @@ export declare interface _IOperationStateFileOptions {
1234
1582
  */
1235
1583
  export declare interface _IOperationStateJson {
1236
1584
  nonCachedDurationMs: number;
1585
+ cobuildContextId: string | undefined;
1586
+ cobuildRunnerId: string | undefined;
1237
1587
  }
1238
1588
 
1239
1589
  /**
@@ -2056,7 +2406,7 @@ export declare class _OperationMetadataManager {
2056
2406
  * Example: `.rush/temp/operation/_phase_build/error.log`
2057
2407
  */
2058
2408
  get relativeFilepaths(): string[];
2059
- saveAsync({ durationInSeconds, logPath, errorLogPath }: _IOperationMetadata): Promise<void>;
2409
+ saveAsync({ durationInSeconds, cobuildContextId, cobuildRunnerId, logPath, errorLogPath }: _IOperationMetadata): Promise<void>;
2060
2410
  tryRestoreAsync({ terminal, logPath, errorLogPath }: {
2061
2411
  terminal: ITerminal;
2062
2412
  logPath: string;
@@ -2099,10 +2449,18 @@ export declare enum OperationStatus {
2099
2449
  * The Operation is on the queue, ready to execute (but may be waiting for dependencies)
2100
2450
  */
2101
2451
  Ready = "READY",
2452
+ /**
2453
+ * The Operation is Queued
2454
+ */
2455
+ Queued = "QUEUED",
2102
2456
  /**
2103
2457
  * The Operation is currently executing
2104
2458
  */
2105
2459
  Executing = "EXECUTING",
2460
+ /**
2461
+ * The Operation is currently executing by a remote process
2462
+ */
2463
+ RemoteExecuting = "REMOTE EXECUTING",
2106
2464
  /**
2107
2465
  * The Operation completed successfully and did not write to standard output
2108
2466
  */
@@ -2260,7 +2618,10 @@ export declare class PhasedCommandHooks {
2260
2618
  * Hook invoked before operation start
2261
2619
  * Hook is series for stable output.
2262
2620
  */
2263
- readonly beforeExecuteOperations: AsyncSeriesHook<[Map<Operation, IOperationExecutionResult>]>;
2621
+ readonly beforeExecuteOperations: AsyncSeriesHook<[
2622
+ Map<Operation, IOperationExecutionResult>,
2623
+ ICreateOperationsContext
2624
+ ]>;
2264
2625
  /**
2265
2626
  * Hook invoked when operation status changed
2266
2627
  * Hook is series for stable output.
@@ -2272,6 +2633,16 @@ export declare class PhasedCommandHooks {
2272
2633
  * Hook is series for stable output.
2273
2634
  */
2274
2635
  readonly afterExecuteOperations: AsyncSeriesHook<[IExecutionResult, ICreateOperationsContext]>;
2636
+ /**
2637
+ * Hook invoked before executing a operation.
2638
+ */
2639
+ readonly beforeExecuteOperation: AsyncSeriesBailHook<[
2640
+ IOperationRunnerContext
2641
+ ], OperationStatus | undefined>;
2642
+ /**
2643
+ * Hook invoked after executing a operation.
2644
+ */
2645
+ readonly afterExecuteOperation: AsyncSeriesHook<[IOperationRunnerContext]>;
2275
2646
  /**
2276
2647
  * Hook invoked after a run has finished and the command is watching for changes.
2277
2648
  * May be used to display additional relevant data to the user.
@@ -2907,6 +3278,16 @@ export declare class RushConfiguration {
2907
3278
  * @beta
2908
3279
  */
2909
3280
  readonly versionPolicyConfigurationFilePath: string;
3281
+ /**
3282
+ * Accesses the custom-tips.json configuration.
3283
+ * @beta
3284
+ */
3285
+ readonly customTipsConfiguration: CustomTipsConfiguration;
3286
+ /**
3287
+ * The absolute path to the custom tips configuration file.
3288
+ * @beta
3289
+ */
3290
+ readonly customTipsConfigurationFilePath: string;
2910
3291
  /**
2911
3292
  * This configuration object contains settings repo maintainers have specified to enable
2912
3293
  * and disable experimental Rush features.
@@ -3375,6 +3756,12 @@ export declare class RushConstants {
3375
3756
  * store the state of various features as they stand in the repo.
3376
3757
  */
3377
3758
  static readonly repoStateFilename: string;
3759
+ /**
3760
+ * The filename ("custom-tips.json") for the file used by Rush to
3761
+ * print user-customized messages.
3762
+ * This configuration file should go in the "common/config/rush" folder.
3763
+ */
3764
+ static readonly customTipsFilename: string;
3378
3765
  /**
3379
3766
  * The name of the per-project folder where project-specific Rush files are stored. For example,
3380
3767
  * the package-deps files, which are used by commands to determine if a particular project needs to be rebuilt.
@@ -3415,6 +3802,10 @@ export declare class RushConstants {
3415
3802
  * Changing this ensures that cache entries generated by an old version will no longer register as a cache hit.
3416
3803
  */
3417
3804
  static readonly buildCacheVersion: number;
3805
+ /**
3806
+ * Cobuild configuration file.
3807
+ */
3808
+ static readonly cobuildFilename: string;
3418
3809
  /**
3419
3810
  * Per-project configuration filename.
3420
3811
  */
@@ -3584,12 +3975,15 @@ declare class RushPluginsConfiguration {
3584
3975
  export declare class RushSession {
3585
3976
  private readonly _options;
3586
3977
  private readonly _cloudBuildCacheProviderFactories;
3978
+ private readonly _cobuildLockProviderFactories;
3587
3979
  readonly hooks: RushLifecycleHooks;
3588
3980
  constructor(options: IRushSessionOptions);
3589
3981
  getLogger(name: string): ILogger;
3590
3982
  get terminalProvider(): ITerminalProvider;
3591
3983
  registerCloudBuildCacheProviderFactory(cacheProviderName: string, factory: CloudBuildCacheProviderFactory): void;
3592
3984
  getCloudBuildCacheProviderFactory(cacheProviderName: string): CloudBuildCacheProviderFactory | undefined;
3985
+ registerCobuildLockProviderFactory(cobuildLockProviderName: string, factory: CobuildLockProviderFactory): void;
3986
+ getCobuildLockProviderFactory(cobuildLockProviderName: string): CobuildLockProviderFactory | undefined;
3593
3987
  }
3594
3988
 
3595
3989
  /**
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.36.3"
8
+ "packageVersion": "7.36.4"
9
9
  }
10
10
  ]
11
11
  }
@@ -0,0 +1,71 @@
1
+ import { ITerminal } from '@rushstack/node-core-library';
2
+ import { CobuildLockProviderFactory, 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
+ cobuildLockProviderFactory: CobuildLockProviderFactory;
20
+ }
21
+ /**
22
+ * Use this class to load and save the "common/config/rush/cobuild.json" config file.
23
+ * This file provides configuration options for the Rush Cobuild feature.
24
+ * @beta
25
+ */
26
+ export declare class CobuildConfiguration {
27
+ private static _jsonSchema;
28
+ /**
29
+ * Indicates whether the cobuild feature is enabled.
30
+ * Typically it is enabled in the cobuild.json config file.
31
+ *
32
+ * Note: The orchestrator (or local users) should always have to opt into running with cobuilds by
33
+ * providing a cobuild context id. Even if cobuilds are "enabled" as a feature, they don't
34
+ * actually turn on for that particular build unless the cobuild context id is provided as an
35
+ * non-empty string.
36
+ */
37
+ readonly cobuildEnabled: boolean;
38
+ /**
39
+ * Cobuild context id
40
+ *
41
+ * @remarks
42
+ * The cobuild feature won't be enabled until the context id is provided as an non-empty string.
43
+ */
44
+ readonly cobuildContextId: string | undefined;
45
+ /**
46
+ * This is a name of the participating cobuild runner. It can be specified by the environment variable
47
+ * RUSH_COBUILD_RUNNER_ID. If it is not provided, a random id will be generated to identify the runner.
48
+ */
49
+ readonly cobuildRunnerId: string;
50
+ /**
51
+ * If true, Rush will automatically handle the leaf project with build cache "disabled" by writing
52
+ * to the cache in a special "log files only mode". This is useful when you want to use Cobuilds
53
+ * to improve the performance in CI validations and the leaf projects have not enabled cache.
54
+ */
55
+ readonly cobuildLeafProjectLogOnlyAllowed: boolean;
56
+ private _cobuildLockProvider;
57
+ private readonly _cobuildLockProviderFactory;
58
+ private readonly _cobuildJson;
59
+ private constructor();
60
+ /**
61
+ * Attempts to load the cobuild.json data from the standard file path `common/config/rush/cobuild.json`.
62
+ * If the file has not been created yet, then undefined is returned.
63
+ */
64
+ static tryLoadAsync(terminal: ITerminal, rushConfiguration: RushConfiguration, rushSession: RushSession): Promise<CobuildConfiguration | undefined>;
65
+ static getCobuildConfigFilePath(rushConfiguration: RushConfiguration): string;
66
+ private static _loadAsync;
67
+ createLockProviderAsync(terminal: ITerminal): Promise<void>;
68
+ destroyLockProviderAsync(): Promise<void>;
69
+ get cobuildLockProvider(): ICobuildLockProvider;
70
+ }
71
+ //# sourceMappingURL=CobuildConfiguration.d.ts.map
@@ -0,0 +1 @@
1
+ module.exports = require("../../lib-shim/index")._rushSdk_loadInternalModule("api/CobuildConfiguration");