@rushstack/rush-sdk 5.90.1 → 5.91.0

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 (2) hide show
  1. package/dist/rush-lib.d.ts +59 -11
  2. package/package.json +9 -9
@@ -1095,6 +1095,23 @@ export declare interface IOperationExecutionResult {
1095
1095
  readonly nonCachedDurationMs: number | undefined;
1096
1096
  }
1097
1097
 
1098
+ /**
1099
+ * @internal
1100
+ */
1101
+ export declare interface _IOperationMetadata {
1102
+ durationInSeconds: number;
1103
+ logPath: string;
1104
+ errorLogPath: string;
1105
+ }
1106
+
1107
+ /**
1108
+ * @internal
1109
+ */
1110
+ export declare interface _IOperationMetadataManagerOptions {
1111
+ rushProject: RushConfigurationProject;
1112
+ phase: IPhase;
1113
+ }
1114
+
1098
1115
  /**
1099
1116
  * Options for constructing a new Operation.
1100
1117
  * @alpha
@@ -1177,11 +1194,11 @@ export declare interface IOperationRunnerContext {
1177
1194
  */
1178
1195
  stdioSummarizer: StdioSummarizer;
1179
1196
  /**
1180
- * Object used to record state of the operation.
1197
+ * Object used to manage metadata of the operation.
1181
1198
  *
1182
1199
  * @internal
1183
1200
  */
1184
- _operationStateFile?: _OperationStateFile;
1201
+ _operationMetadataManager?: _OperationMetadataManager;
1185
1202
  /**
1186
1203
  * Object used to track elapsed time.
1187
1204
  */
@@ -1192,8 +1209,8 @@ export declare interface IOperationRunnerContext {
1192
1209
  * @internal
1193
1210
  */
1194
1211
  export declare interface _IOperationStateFileOptions {
1195
- rushProject: RushConfigurationProject;
1196
- phase: IPhase;
1212
+ projectFolder: string;
1213
+ metadataFolder: string;
1197
1214
  }
1198
1215
 
1199
1216
  /**
@@ -1962,6 +1979,35 @@ export declare class Operation {
1962
1979
  deleteDependency(dependency: Operation): void;
1963
1980
  }
1964
1981
 
1982
+ /**
1983
+ * A helper class for managing the meta files of a operation.
1984
+ *
1985
+ * @internal
1986
+ */
1987
+ export declare class _OperationMetadataManager {
1988
+ readonly stateFile: _OperationStateFile;
1989
+ private _metadataFolder;
1990
+ private _logPath;
1991
+ private _errorLogPath;
1992
+ private _relativeLogPath;
1993
+ private _relativeErrorLogPath;
1994
+ constructor(options: _IOperationMetadataManagerOptions);
1995
+ /**
1996
+ * Returns the relative paths of the metadata files to project folder.
1997
+ *
1998
+ * Example: `.rush/temp/operation/_phase_build/state.json`
1999
+ * Example: `.rush/temp/operation/_phase_build/all.log`
2000
+ * Example: `.rush/temp/operation/_phase_build/error.log`
2001
+ */
2002
+ get relativeFilepaths(): string[];
2003
+ saveAsync({ durationInSeconds, logPath, errorLogPath }: _IOperationMetadata): Promise<void>;
2004
+ tryRestoreAsync({ terminal, logPath, errorLogPath }: {
2005
+ terminal: ITerminal;
2006
+ logPath: string;
2007
+ errorLogPath: string;
2008
+ }): Promise<void>;
2009
+ }
2010
+
1965
2011
  /**
1966
2012
  * A helper class for managing the state file of a operation.
1967
2013
  *
@@ -1970,17 +2016,19 @@ export declare class Operation {
1970
2016
  export declare class _OperationStateFile {
1971
2017
  private _state;
1972
2018
  /**
1973
- * Returns the filename of the metadata file.
2019
+ * The path of the state json file.
2020
+ *
2021
+ * Example: `/code/repo/my-project/.rush/temp/operation/_phase_build/state.json`
1974
2022
  */
1975
- readonly filename: string;
1976
- constructor(options: _IOperationStateFileOptions);
1977
- private static _getFilename;
2023
+ readonly filepath: string;
1978
2024
  /**
1979
- * ProjectBuildCache expects the relative path for better logging
2025
+ * The relative path of the state json file to project folder
1980
2026
  *
1981
- * @internal
2027
+ * Example: `.rush/temp/operation/_phase_build/state.json`
1982
2028
  */
1983
- static getFilenameRelativeToProjectRoot(phase: IPhase): string;
2029
+ readonly relativeFilepath: string;
2030
+ static filename: string;
2031
+ constructor(options: _IOperationStateFileOptions);
1984
2032
  get state(): _IOperationStateJson | undefined;
1985
2033
  writeAsync(json: _IOperationStateJson): Promise<void>;
1986
2034
  tryRestoreAsync(): Promise<_IOperationStateJson | undefined>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rushstack/rush-sdk",
3
- "version": "5.90.1",
3
+ "version": "5.91.0",
4
4
  "description": "An API for interacting with the Rush engine",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,19 +14,19 @@
14
14
  "dependencies": {
15
15
  "@types/node-fetch": "2.6.2",
16
16
  "tapable": "2.2.1",
17
- "@rushstack/node-core-library": "3.55.1"
17
+ "@rushstack/node-core-library": "3.55.2"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@types/heft-jest": "1.0.1",
21
21
  "@types/semver": "7.3.5",
22
22
  "@types/webpack-env": "1.18.0",
23
- "@microsoft/rush-lib": "5.90.1",
24
- "@rushstack/eslint-config": "3.1.1",
25
- "@rushstack/heft": "0.49.6",
26
- "@rushstack/heft-node-rig": "1.12.3",
27
- "@rushstack/stream-collator": "4.0.226",
28
- "@rushstack/ts-command-line": "4.13.1",
29
- "@rushstack/terminal": "0.5.1"
23
+ "@microsoft/rush-lib": "5.91.0",
24
+ "@rushstack/heft": "0.49.7",
25
+ "@rushstack/eslint-config": "3.2.0",
26
+ "@rushstack/heft-node-rig": "1.12.4",
27
+ "@rushstack/stream-collator": "4.0.227",
28
+ "@rushstack/ts-command-line": "4.13.2",
29
+ "@rushstack/terminal": "0.5.2"
30
30
  },
31
31
  "scripts": {
32
32
  "build": "heft build --clean",