@rushstack/rush-sdk 5.164.0 → 5.165.0-pr5496.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.
@@ -2233,6 +2233,10 @@ export declare interface _IPnpmOptionsJson extends IPackageManagerOptionsJsonBas
2233
2233
  * {@inheritDoc PnpmOptionsConfiguration.globalNeverBuiltDependencies}
2234
2234
  */
2235
2235
  globalNeverBuiltDependencies?: string[];
2236
+ /**
2237
+ * {@inheritDoc PnpmOptionsConfiguration.globalOnlyBuiltDependencies}
2238
+ */
2239
+ globalOnlyBuiltDependencies?: string[];
2236
2240
  /**
2237
2241
  * {@inheritDoc PnpmOptionsConfiguration.globalIgnoredOptionalDependencies}
2238
2242
  */
@@ -3494,6 +3498,19 @@ export declare class PnpmOptionsConfiguration extends PackageManagerOptionsConfi
3494
3498
  * PNPM documentation: https://pnpm.io/package_json#pnpmneverbuiltdependencies
3495
3499
  */
3496
3500
  readonly globalNeverBuiltDependencies: string[] | undefined;
3501
+ /**
3502
+ * The `globalOnlyBuiltDependencies` setting specifies an allowlist of dependencies that are permitted
3503
+ * to run build scripts (`preinstall`, `install`, and `postinstall` lifecycle events). This is the inverse
3504
+ * of `globalNeverBuiltDependencies`. In PNPM 10.x, build scripts are disabled by default for security,
3505
+ * so this setting is required to explicitly permit specific packages to run their build scripts.
3506
+ * The settings are copied into the `pnpm.onlyBuiltDependencies` field of the `common/temp/package.json`
3507
+ * file that is generated by Rush during installation.
3508
+ *
3509
+ * (SUPPORTED ONLY IN PNPM 10.1.0 AND NEWER)
3510
+ *
3511
+ * PNPM documentation: https://pnpm.io/package_json#pnpmonlybuiltdependencies
3512
+ */
3513
+ readonly globalOnlyBuiltDependencies: string[] | undefined;
3497
3514
  /**
3498
3515
  * The ignoredOptionalDependencies setting allows you to exclude certain optional dependencies from being installed
3499
3516
  * during the Rush installation process. This can be useful when optional dependencies are not required or are
@@ -59,6 +59,5 @@ export declare class ChangeAction extends BaseRushAction {
59
59
  */
60
60
  private _writeFile;
61
61
  private _logNoChangeFileRequired;
62
- private _stageAndCommitGitChangesAsync;
63
62
  }
64
63
  //# sourceMappingURL=ChangeAction.d.ts.map
@@ -97,6 +97,7 @@ export declare class Git {
97
97
  * returns user.email config
98
98
  */
99
99
  tryGetGitEmailAsync(): Promise<string | undefined>;
100
+ stageAndCommitGitChangesAsync(pattern: string[], message: string, terminal: ITerminal): Promise<void>;
100
101
  /**
101
102
  * Returns an object containing either the result of the `git config user.email`
102
103
  * command or an error.
@@ -108,7 +109,7 @@ export declare class Git {
108
109
  /**
109
110
  * @internal
110
111
  */
111
- _executeGitCommandAndCaptureOutputAsync(gitPath: string, args: string[], repositoryRoot?: string): Promise<string>;
112
+ _executeGitCommandAndCaptureOutputAsync(gitPath: string, args: string[], workingDirectory?: string): Promise<string>;
112
113
  /**
113
114
  *
114
115
  * @param ref Given a ref which can be branch name, commit hash, tag name, etc, check if it is a commit hash
@@ -9,6 +9,15 @@ export interface IChangeRequests {
9
9
  packageChanges: Map<string, IChangeInfo>;
10
10
  versionPolicyChanges: Map<string, IVersionPolicyChangeInfo>;
11
11
  }
12
+ export interface IExecCommandOptions {
13
+ shouldExecute: boolean;
14
+ command: string;
15
+ args?: string[];
16
+ workingDirectory?: string;
17
+ environment?: IEnvironment;
18
+ secretSubstring?: string;
19
+ shell?: boolean;
20
+ }
12
21
  export declare class PublishUtilities {
13
22
  /**
14
23
  * Finds change requests in the given folder.
@@ -38,7 +47,7 @@ export declare class PublishUtilities {
38
47
  * @param secretSubstring -- if specified, a substring to be replaced by `<<SECRET>>` to avoid printing secrets
39
48
  * on the console
40
49
  */
41
- static execCommandAsync(shouldExecute: boolean, command: string, args?: string[], workingDirectory?: string, environment?: IEnvironment, secretSubstring?: string): Promise<void>;
50
+ static execCommandAsync(options: IExecCommandOptions): Promise<void>;
42
51
  static getNewDependencyVersion(dependencies: {
43
52
  [key: string]: string;
44
53
  }, dependencyName: string, newProjectVersion: string): string;
@@ -1,7 +1,17 @@
1
1
  import type { PackageManagerName } from '../api/packageManager/PackageManager';
2
2
  import type { BaseShrinkwrapFile } from './base/BaseShrinkwrapFile';
3
+ export interface IShrinkwrapFileFactoryOptions {
4
+ packageManager: PackageManagerName;
5
+ subspaceHasNoProjects: boolean;
6
+ }
7
+ export interface IGetShrinkwrapFileOptions extends IShrinkwrapFileFactoryOptions {
8
+ shrinkwrapFilePath: string;
9
+ }
10
+ export interface IParseShrinkwrapFileOptions extends IShrinkwrapFileFactoryOptions {
11
+ shrinkwrapContent: string;
12
+ }
3
13
  export declare class ShrinkwrapFileFactory {
4
- static getShrinkwrapFile(packageManager: PackageManagerName, shrinkwrapFilename: string): BaseShrinkwrapFile | undefined;
5
- static parseShrinkwrapFile(packageManager: PackageManagerName, shrinkwrapContent: string): BaseShrinkwrapFile | undefined;
14
+ static getShrinkwrapFile(options: IGetShrinkwrapFileOptions): BaseShrinkwrapFile | undefined;
15
+ static parseShrinkwrapFile(options: IParseShrinkwrapFileOptions): BaseShrinkwrapFile | undefined;
6
16
  }
7
17
  //# sourceMappingURL=ShrinkwrapFileFactory.d.ts.map
@@ -0,0 +1,14 @@
1
+ import type { IPhasedCommandPlugin, PhasedCommandHooks } from '../../pluginFramework/PhasedCommandHooks';
2
+ /**
3
+ * Environment variable name for forwarding ignored parameters to child processes
4
+ * @public
5
+ */
6
+ export declare const RUSHSTACK_CLI_IGNORED_PARAMETER_NAMES_ENV_VAR: 'RUSHSTACK_CLI_IGNORED_PARAMETER_NAMES';
7
+ /**
8
+ * Phased command plugin that forwards the value of the `parameterNamesToIgnore` operation setting
9
+ * to child processes as the RUSHSTACK_CLI_IGNORED_PARAMETER_NAMES environment variable.
10
+ */
11
+ export declare class IgnoredParametersPlugin implements IPhasedCommandPlugin {
12
+ apply(hooks: PhasedCommandHooks): void;
13
+ }
14
+ //# sourceMappingURL=IgnoredParametersPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ module.exports = require("../../../lib-shim/index")._rushSdk_loadInternalModule("logic/operations/IgnoredParametersPlugin");
@@ -1,4 +1,4 @@
1
- import type { LogBase } from '@pnpm/logger';
1
+ import type * as pnpmKitV8 from '@rushstack/rush-pnpm-kit-v8';
2
2
  import type { IPackageJson } from '@rushstack/node-core-library';
3
3
  import type { IPnpmShrinkwrapYaml } from './PnpmShrinkwrapFile';
4
4
  import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
@@ -46,7 +46,7 @@ export interface IPnpmfileContext {
46
46
  /**
47
47
  * The `log` parameter passed to {@link IPnpmfile.hooks.filterLog}.
48
48
  */
49
- export type IPnpmLog = LogBase & {
49
+ export type IPnpmLog = pnpmKitV8.logger.LogBase & {
50
50
  [key: string]: unknown;
51
51
  };
52
52
  /**
@@ -94,6 +94,10 @@ export interface IPnpmOptionsJson extends IPackageManagerOptionsJsonBase {
94
94
  * {@inheritDoc PnpmOptionsConfiguration.globalNeverBuiltDependencies}
95
95
  */
96
96
  globalNeverBuiltDependencies?: string[];
97
+ /**
98
+ * {@inheritDoc PnpmOptionsConfiguration.globalOnlyBuiltDependencies}
99
+ */
100
+ globalOnlyBuiltDependencies?: string[];
97
101
  /**
98
102
  * {@inheritDoc PnpmOptionsConfiguration.globalIgnoredOptionalDependencies}
99
103
  */
@@ -329,6 +333,19 @@ export declare class PnpmOptionsConfiguration extends PackageManagerOptionsConfi
329
333
  * PNPM documentation: https://pnpm.io/package_json#pnpmneverbuiltdependencies
330
334
  */
331
335
  readonly globalNeverBuiltDependencies: string[] | undefined;
336
+ /**
337
+ * The `globalOnlyBuiltDependencies` setting specifies an allowlist of dependencies that are permitted
338
+ * to run build scripts (`preinstall`, `install`, and `postinstall` lifecycle events). This is the inverse
339
+ * of `globalNeverBuiltDependencies`. In PNPM 10.x, build scripts are disabled by default for security,
340
+ * so this setting is required to explicitly permit specific packages to run their build scripts.
341
+ * The settings are copied into the `pnpm.onlyBuiltDependencies` field of the `common/temp/package.json`
342
+ * file that is generated by Rush during installation.
343
+ *
344
+ * (SUPPORTED ONLY IN PNPM 10.1.0 AND NEWER)
345
+ *
346
+ * PNPM documentation: https://pnpm.io/package_json#pnpmonlybuiltdependencies
347
+ */
348
+ readonly globalOnlyBuiltDependencies: string[] | undefined;
332
349
  /**
333
350
  * The ignoredOptionalDependencies setting allows you to exclude certain optional dependencies from being installed
334
351
  * during the Rush installation process. This can be useful when optional dependencies are not required or are
@@ -1,4 +1,16 @@
1
- import type { Lockfile, LockfileFileV9 } from '@pnpm/lockfile.types';
1
+ /**
2
+ * Fork https://github.com/pnpm/pnpm/blob/main/lockfile/fs/src/lockfileFormatConverters.ts
3
+ *
4
+ * Pnpm lockfile v9 have some breaking changes on the lockfile format. For Example, the "packages" field has been split into "packages" and "snapshots" two parts.
5
+ * Rush should not parse the lockfile by itself, but should rely on pnpm to parse the lockfile.
6
+ * To ensure consistency with pnpm's parsing logic, I copied the relevant logic from @pnpm/lockfile.fs to this file.
7
+ *
8
+ * There are some reasons for copying the relevant logic instead of depending on @pnpm/lockfile.fs directly:
9
+ * 1. @pnpm/lockfile.fs has a exports filed in package.json, which will cause convertLockfileV9ToLockfileObject cannot be imported directly.
10
+ * 2. @pnpm/lockfile.fs only provides asynchronous read methods, while rush requires synchronous reading of the lockfile file.
11
+ * Perhaps this file will be deleted in the future and instead depend on @pnpm/lockfile.fs directly.
12
+ */
13
+ import type { Lockfile, LockfileFileV9 } from '@pnpm/lockfile.types-900';
2
14
  /**
3
15
  * Convert lockfile v9 object to standard lockfile object.
4
16
  *
@@ -1,4 +1,4 @@
1
- import type { Lockfile, PackageSnapshot, ProjectSnapshot } from '@pnpm/lockfile.types';
1
+ import type { Lockfile, PackageSnapshot, ProjectSnapshot } from '@pnpm/lockfile.types-900';
2
2
  import { type ITerminal } from '@rushstack/terminal';
3
3
  import { BaseShrinkwrapFile } from '../base/BaseShrinkwrapFile';
4
4
  import { DependencySpecifier } from '../DependencySpecifier';
@@ -76,7 +76,10 @@ export interface IPnpmShrinkwrapYaml extends Lockfile {
76
76
  /** URL of the registry which was used */
77
77
  registry?: string;
78
78
  }
79
- export interface ILoadFromFileOptions {
79
+ export interface ILoadFromStringOptions {
80
+ subspaceHasNoProjects: boolean;
81
+ }
82
+ export interface ILoadFromFileOptions extends ILoadFromStringOptions {
80
83
  withCaching?: boolean;
81
84
  }
82
85
  export declare function parsePnpm9DependencyKey(dependencyName: string, versionSpecifier: IPnpmVersionSpecifier): DependencySpecifier | undefined;
@@ -108,8 +111,8 @@ export declare class PnpmShrinkwrapFile extends BaseShrinkwrapFile {
108
111
  * Clears the cache of PnpmShrinkwrapFile instances to free up memory.
109
112
  */
110
113
  static clearCache(): void;
111
- static loadFromFile(shrinkwrapYamlFilePath: string, options?: ILoadFromFileOptions): PnpmShrinkwrapFile | undefined;
112
- static loadFromString(shrinkwrapContent: string): PnpmShrinkwrapFile;
114
+ static loadFromFile(shrinkwrapYamlFilePath: string, options: ILoadFromFileOptions): PnpmShrinkwrapFile | undefined;
115
+ static loadFromString(shrinkwrapContent: string, options: ILoadFromStringOptions): PnpmShrinkwrapFile;
113
116
  getShrinkwrapHash(experimentsConfig?: IExperimentsJson): string;
114
117
  /**
115
118
  * Determine whether `pnpm-lock.yaml` contains insecure sha1 hashes.
@@ -1,5 +1,5 @@
1
1
  export declare class Npm {
2
- static getPublishedVersionsAsync(packageName: string, cwd: string, env: {
2
+ static getPublishedVersionsAsync(packageName: string, workingDirectory: string, environment: {
3
3
  [key: string]: string | undefined;
4
4
  }, extraArgs?: string[]): Promise<string[]>;
5
5
  }
@@ -22,6 +22,12 @@ export interface IExecuteCommandOptions {
22
22
  */
23
23
  onStdoutStreamChunk?: (chunk: string) => string | void;
24
24
  captureExitCodeAndSignal?: boolean;
25
+ /**
26
+ * If true, the command will be executed inside a shell. Note that this is different from
27
+ * child_process.spawn's shell option. The command will be explicitly wrapped
28
+ * in a shell depending on the operating system.
29
+ */
30
+ shell?: boolean;
25
31
  }
26
32
  /**
27
33
  * Options for {@link Utilities.installPackageInDirectoryAsync}.
@@ -87,6 +93,7 @@ export interface IEnvironmentPathOptions {
87
93
  export interface IDisposable {
88
94
  dispose(): void;
89
95
  }
96
+ export type IExecuteCommandAndCaptureOutputOptions = Omit<IExecuteCommandOptions, 'suppressOutput' | 'onStdoutStreamChunk'>;
90
97
  type OptionalKeys<T> = {
91
98
  [K in keyof T]-?: {} extends Pick<T, K> ? K : never;
92
99
  }[keyof T];
@@ -135,7 +142,12 @@ export declare class Utilities {
135
142
  * Executes the command with the specified command-line parameters, and waits for it to complete.
136
143
  * The current directory will be set to the specified workingDirectory.
137
144
  */
138
- static executeCommandAndCaptureOutputAsync(command: string, args: string[], workingDirectory: string, environment?: IEnvironment, keepEnvironment?: boolean): Promise<string>;
145
+ static executeCommandAndCaptureOutputAsync(options: IExecuteCommandAndCaptureOutputOptions & {
146
+ captureExitCodeAndSignal?: false;
147
+ }): Promise<string>;
148
+ static executeCommandAndCaptureOutputAsync(options: IExecuteCommandAndCaptureOutputOptions & {
149
+ captureExitCodeAndSignal: true;
150
+ }): Promise<IWaitForExitResult<string>>;
139
151
  /**
140
152
  * Attempts to run Utilities.executeCommand() up to maxAttempts times before giving up.
141
153
  */
@@ -152,13 +164,6 @@ export declare class Utilities {
152
164
  * @param options - options for how the command should be run
153
165
  */
154
166
  static executeLifecycleCommandAsync(command: string, options: ILifecycleCommandOptions): child_process.ChildProcess;
155
- /**
156
- * For strings passed to a shell command, this adds appropriate escaping
157
- * to avoid misinterpretation of spaces or special characters.
158
- *
159
- * Example: 'hello there' --> '"hello there"'
160
- */
161
- static escapeShellParameter(parameter: string): string;
162
167
  /**
163
168
  * Installs a package by name and version in the specified directory.
164
169
  */
@@ -198,6 +203,7 @@ export declare class Utilities {
198
203
  */
199
204
  private static _executeCommandInternalAsync;
200
205
  private static _processResult;
206
+ private static _convertCommandAndArgsToShell;
201
207
  }
202
208
  export {};
203
209
  //# sourceMappingURL=Utilities.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","mappings":";;;;;;;;;;AAAY;;AAEZ,QAAQ,iCAAiC,EAAE,mBAAO,CAAC,cAAI;AACvD,QAAQ,WAAW,EAAE,mBAAO,CAAC,cAAI;AACjC,QAAQ,wBAAwB,EAAE,mBAAO,CAAC,kBAAM;AAChD,QAAQ,kBAAkB,EAAE,mBAAO,CAAC,kBAAM;;AAE1C;AACA;AACA;;AAEA;AACA,gCAAgC,aAAa;AAC7C,oCAAoC,YAAY;AAChD;;AAEA;AACA;AACA;;AAEA;AACA,+BAA+B;AAC/B;;AAEA;AACA;AACA,QAAQ,8BAA8B;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,SAAS;AAC9C;AACA;;AAEA,yBAAyB,MAAM;AAC/B;AACA;AACA;AACA;AACA,6EAA6E,SAAS;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;AC7FA,MAAM,gCAA4B;;;;ACAlC;AACA;AAC8B;AACI;AACgB;AAClD;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,wEAAwE;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,8DAA8D;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAA6D;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,yCAAW;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,+BAA+B;AACtF;AACA;AACA;AACA,oDAAoD,mEAAmE;AACvH,mBAAmB,yDAAyD;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,MAAM,iCAAiC,KAAK;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,6BAAc;AACnC,2EAA2E,uBAAQ;AACnF,2BAA2B,yBAAU;AACrC;AACA;AACA,oDAAoD,uBAAQ;AAC5D;AACA;AACA;AACA;AACA;AACA,uCAAuC,QAAQ;AAC/C,oCAAoC,wBAAS;AAC7C;AACA,kDAAkD,mCAAgB;AAClE,+BAA+B,wBAAS;AACxC;AACA,8BAA8B,OAAO,EAAE,uBAAQ,CAAC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9kBA;AACA;AACkC;AACkB;AACkB;AACtE;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,yCAAyC,wBAAwB;AACjE;AACA;AACA;AACA;AACA,wBAAwB,wBAAS,CAAC,uBAAI;AACtC;AACA;AACA;AACA;AACA,gCAAgC,wBAAS,oBAAoB,sBAAsB;AACnF;AACA;AACA;;;;;;;;;;AC3Ba;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA,0CAA0C,4BAA4B;AACtE,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,cAAc;AACzE;AACA;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,kBAAkB,GAAG,kCAAkC,GAAG,qBAAqB;AAC/E,+BAA+B;AAC/B,gBAAgB;AAChB,qCAAqC;AACrC,0BAA0B,mBAAO,CAAC,4BAAW;AAC7C,4BAA4B,mBAAO,CAAC,kEAA8B;AAClE,qBAAqB;AACrB,kCAAkC;AAClC,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAuB;AACtC;AACA;AACA;AACA;AACA,eAAe,OAAuB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;;;;;AC5Fa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA,0CAA0C,4BAA4B;AACtE,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,cAAc;AACzE;AACA;AACA;AACA,CAAC;AACD;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mCAAmC;AACnC,0BAA0B,mBAAO,CAAC,4BAAW;AAC7C,4BAA4B,mBAAO,CAAC,kEAA8B;AAClE,mBAAmB,mBAAO,CAAC,gDAAqB;AAChD,2BAA2B,mBAAO,CAAC,2GAAqD;AACxF,kBAAkB,mBAAO,CAAC,4CAAW;AACrC;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,yBAAyB;AAClF;AACA;AACA;AACA;AACA;AACA,gEAAgE,yBAAyB;AACzF;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,yBAAyB;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,yBAAyB,mBAAmB,sCAAsC;AACnI;AACA;AACA;AACA;AACA;AACA,wDAAwD,yBAAyB,kBAAkB,qCAAqC;AACxI;AACA;AACA;AACA;AACA,gDAAgD,yBAAyB,mBAAmB,qCAAqC;AACjI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B;AACA,qDAAqD,yBAAyB;AAC9E;AACA;AACA,yDAAyD,kCAAkC,QAAQ,YAAY;AAC/G,uFAAuF,kCAAkC;AACzH;AACA;AACA;AACA,wDAAwD,yBAAyB,2BAA2B,UAAU;AACtH;AACA;AACA;AACA;AACA,gDAAgD,yBAAyB;AACzE;AACA;AACA,kDAAkD,aAAa,2CAA2C,YAAY;AACtH;AACA;AACA,6DAA6D,yBAAyB;AACtF;AACA;AACA;AACA;AACA;AACA,uDAAuD,aAAa;AACpE;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,+CAA+C,yBAAyB;AACxE;AACA;AACA,iEAAiE,yBAAyB;AAC1F;AACA;AACA;AACA;AACA,qCAAqC,+BAA+B;AACpE,2CAA2C,yBAAyB;AACpE;AACA;AACA;AACA;AACA;AACA,oDAAoD,yBAAyB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,sBAAsB;AAC9D;AACA;AACA;AACA;;;;;;;;;;ACvNA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCzBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;WACA;WACA;WACA;WACA;;;;;UEJA;UACA;UACA;UACA","sources":["webpack://@rushstack/rush-sdk/../../common/temp/default/node_modules/.pnpm/true-case-path@2.2.1/node_modules/true-case-path/index.js","webpack://@rushstack/rush-sdk/external node-commonjs \"node:os\"","webpack://@rushstack/rush-sdk/../rush-lib/lib-esnext/api/EnvironmentConfiguration.js","webpack://@rushstack/rush-sdk/../rush-lib/lib-esnext/api/RushGlobalFolder.js","webpack://@rushstack/rush-sdk/./lib-commonjs/helpers.js","webpack://@rushstack/rush-sdk/./lib-commonjs/index.js","webpack://@rushstack/rush-sdk/external commonjs \"@rushstack/node-core-library\"","webpack://@rushstack/rush-sdk/external commonjs \"@rushstack/terminal\"","webpack://@rushstack/rush-sdk/external node-commonjs \"fs\"","webpack://@rushstack/rush-sdk/external node-commonjs \"node:path\"","webpack://@rushstack/rush-sdk/external node-commonjs \"os\"","webpack://@rushstack/rush-sdk/external node-commonjs \"path\"","webpack://@rushstack/rush-sdk/external node-commonjs \"util\"","webpack://@rushstack/rush-sdk/webpack/bootstrap","webpack://@rushstack/rush-sdk/webpack/runtime/define property getters","webpack://@rushstack/rush-sdk/webpack/runtime/hasOwnProperty shorthand","webpack://@rushstack/rush-sdk/webpack/runtime/make namespace object","webpack://@rushstack/rush-sdk/webpack/runtime/node module decorator","webpack://@rushstack/rush-sdk/webpack/before-startup","webpack://@rushstack/rush-sdk/webpack/startup","webpack://@rushstack/rush-sdk/webpack/after-startup"],"sourcesContent":["'use strict'\n\nconst { readdir: _readdir, readdirSync } = require('fs')\nconst { platform } = require('os')\nconst { isAbsolute, normalize } = require('path')\nconst { promisify: pify } = require('util')\n\nconst readdir = pify(_readdir)\nconst isWindows = platform() === 'win32'\nconst delimiter = isWindows ? '\\\\' : '/'\n\nmodule.exports = {\n trueCasePath: _trueCasePath({ sync: false }),\n trueCasePathSync: _trueCasePath({ sync: true })\n}\n\nfunction getRelevantFilePathSegments(filePath) {\n return filePath.split(delimiter).filter((s) => s !== '')\n}\n\nfunction escapeString(str) {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n}\n\nfunction matchCaseInsensitive(fileOrDirectory, directoryContents, filePath) {\n const caseInsensitiveRegex = new RegExp(\n `^${escapeString(fileOrDirectory)}$`,\n 'i'\n )\n for (const file of directoryContents) {\n if (caseInsensitiveRegex.test(file)) return file\n }\n throw new Error(\n `[true-case-path]: Called with ${filePath}, but no matching file exists`\n )\n}\n\nfunction _trueCasePath({ sync }) {\n return (filePath, basePath) => {\n if (basePath) {\n if (!isAbsolute(basePath)) {\n throw new Error(\n `[true-case-path]: basePath argument must be absolute. Received \"${basePath}\"`\n )\n }\n basePath = normalize(basePath)\n }\n filePath = normalize(filePath)\n const segments = getRelevantFilePathSegments(filePath)\n if (isAbsolute(filePath)) {\n if (basePath) {\n throw new Error(\n '[true-case-path]: filePath must be relative when used with basePath'\n )\n }\n basePath = isWindows\n ? segments.shift().toUpperCase() // drive letter\n : ''\n } else if (!basePath) {\n basePath = process.cwd()\n }\n return sync\n ? iterateSync(basePath, filePath, segments)\n : iterateAsync(basePath, filePath, segments)\n }\n}\n\nfunction iterateSync(basePath, filePath, segments) {\n return segments.reduce(\n (realPath, fileOrDirectory) =>\n realPath +\n delimiter +\n matchCaseInsensitive(\n fileOrDirectory,\n readdirSync(realPath + delimiter),\n filePath\n ),\n basePath\n )\n}\n\nasync function iterateAsync(basePath, filePath, segments) {\n return await segments.reduce(\n async (realPathPromise, fileOrDirectory) =>\n (await realPathPromise) +\n delimiter +\n matchCaseInsensitive(\n fileOrDirectory,\n await readdir((await realPathPromise) + delimiter),\n filePath\n ),\n basePath\n )\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"node:os\");","// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\nimport * as os from 'node:os';\nimport * as path from 'node:path';\nimport { trueCasePathSync } from 'true-case-path';\n/**\n * Names of environment variables used by Rush.\n * @beta\n */\n// eslint-disable-next-line @typescript-eslint/typedef\nexport const EnvironmentVariableNames = {\n /**\n * This variable overrides the temporary folder used by Rush.\n * The default value is \"common/temp\" under the repository root.\n *\n * @remarks This environment variable is not compatible with workspace installs. If attempting\n * to move the PNPM store path, see the `RUSH_PNPM_STORE_PATH` environment variable.\n */\n RUSH_TEMP_FOLDER: 'RUSH_TEMP_FOLDER',\n /**\n * This variable overrides the version of Rush that will be installed by\n * the version selector. The default value is determined by the \"rushVersion\"\n * field from rush.json.\n */\n RUSH_PREVIEW_VERSION: 'RUSH_PREVIEW_VERSION',\n /**\n * If this variable is set to \"1\", Rush will not fail the build when running a version\n * of Node that does not match the criteria specified in the \"nodeSupportedVersionRange\"\n * field from rush.json.\n */\n RUSH_ALLOW_UNSUPPORTED_NODEJS: 'RUSH_ALLOW_UNSUPPORTED_NODEJS',\n /**\n * Setting this environment variable overrides the value of `allowWarningsInSuccessfulBuild`\n * in the `command-line.json` configuration file. Specify `1` to allow warnings in a successful build,\n * or `0` to disallow them. (See the comments in the command-line.json file for more information).\n */\n RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD: 'RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD',\n /**\n * This variable selects a specific installation variant for Rush to use when installing\n * and linking package dependencies.\n * For more information, see the command-line help for the `--variant` parameter\n * and this article: https://rushjs.io/pages/advanced/installation_variants/\n */\n RUSH_VARIANT: 'RUSH_VARIANT',\n /**\n * Specifies the maximum number of concurrent processes to launch during a build.\n * For more information, see the command-line help for the `--parallelism` parameter for \"rush build\".\n */\n RUSH_PARALLELISM: 'RUSH_PARALLELISM',\n /**\n * If this variable is set to \"1\", Rush will create symlinks with absolute paths instead\n * of relative paths. This can be necessary when a repository is moved during a build or\n * if parts of a repository are moved into a sandbox.\n */\n RUSH_ABSOLUTE_SYMLINKS: 'RUSH_ABSOLUTE_SYMLINKS',\n /**\n * When using PNPM as the package manager, this variable can be used to configure the path that\n * PNPM will use as the store directory.\n *\n * If a relative path is used, then the store path will be resolved relative to the process's\n * current working directory. An absolute path is recommended.\n */\n RUSH_PNPM_STORE_PATH: 'RUSH_PNPM_STORE_PATH',\n /**\n * When using PNPM as the package manager, this variable can be used to control whether or not PNPM\n * validates the integrity of the PNPM store during installation. The value of this environment variable must be\n * `1` (for true) or `0` (for false). If not specified, defaults to the value in .npmrc.\n */\n RUSH_PNPM_VERIFY_STORE_INTEGRITY: 'RUSH_PNPM_VERIFY_STORE_INTEGRITY',\n /**\n * This environment variable can be used to specify the `--target-folder` parameter\n * for the \"rush deploy\" command.\n */\n RUSH_DEPLOY_TARGET_FOLDER: 'RUSH_DEPLOY_TARGET_FOLDER',\n /**\n * Overrides the location of the `~/.rush` global folder where Rush stores temporary files.\n *\n * @remarks\n *\n * Most of the temporary files created by Rush are stored separately for each monorepo working folder,\n * to avoid issues of concurrency and compatibility between tool versions. However, a small set\n * of files (e.g. installations of the `@microsoft/rush-lib` engine and the package manager) are stored\n * in a global folder to speed up installations. The default location is `~/.rush` on POSIX-like\n * operating systems or `C:\\Users\\YourName` on Windows.\n *\n * Use `RUSH_GLOBAL_FOLDER` to specify a different folder path. This is useful for example if a Windows\n * group policy forbids executing scripts installed in a user's home directory.\n *\n * POSIX is a registered trademark of the Institute of Electrical and Electronic Engineers, Inc.\n */\n RUSH_GLOBAL_FOLDER: 'RUSH_GLOBAL_FOLDER',\n /**\n * Provides a credential for a remote build cache, if configured. This credential overrides any cached credentials.\n *\n * @remarks\n * Setting this environment variable overrides whatever credential has been saved in the\n * local cloud cache credentials using `rush update-cloud-credentials`.\n *\n *\n * If Azure Blob Storage is used to store cache entries, this must be a SAS token serialized as query\n * parameters.\n *\n * For information on SAS tokens, see here: https://docs.microsoft.com/en-us/azure/storage/common/storage-sas-overview\n */\n RUSH_BUILD_CACHE_CREDENTIAL: 'RUSH_BUILD_CACHE_CREDENTIAL',\n /**\n * Setting this environment variable overrides the value of `buildCacheEnabled` in the `build-cache.json`\n * configuration file.\n *\n * @remarks\n * Specify `1` to enable the build cache or `0` to disable it.\n *\n * If there is no build cache configured, then this environment variable is ignored.\n */\n RUSH_BUILD_CACHE_ENABLED: 'RUSH_BUILD_CACHE_ENABLED',\n /**\n * Overrides the value of `isCacheWriteAllowed` in the `build-cache.json` configuration file. The value of this\n * environment variable must be `1` (for true) or `0` (for false). If there is no build cache configured, then\n * this environment variable is ignored.\n */\n RUSH_BUILD_CACHE_WRITE_ALLOWED: 'RUSH_BUILD_CACHE_WRITE_ALLOWED',\n /**\n * Set this environment variable to a JSON string to override the build cache configuration that normally lives\n * at `common/config/rush/build-cache.json`.\n *\n * This is useful for testing purposes, or for OSS repos that are have a local-only cache, but can have\n * a different cache configuration in CI/CD pipelines.\n *\n * @remarks\n * This is similar to {@link EnvironmentVariableNames.RUSH_BUILD_CACHE_OVERRIDE_JSON_FILE_PATH}, but it allows you to specify\n * a JSON string instead of a file path. The two environment variables are mutually exclusive, meaning you can\n * only use one of them at a time.\n */\n RUSH_BUILD_CACHE_OVERRIDE_JSON: 'RUSH_BUILD_CACHE_OVERRIDE_JSON',\n /**\n * Set this environment variable to the path to a `build-cache.json` file to override the build cache configuration\n * that normally lives at `common/config/rush/build-cache.json`.\n *\n * This is useful for testing purposes, or for OSS repos that are have a local-only cache, but can have\n * a different cache configuration in CI/CD pipelines.\n *\n * @remarks\n * This is similar to {@link EnvironmentVariableNames.RUSH_BUILD_CACHE_OVERRIDE_JSON}, but it allows you to specify\n * a file path instead of a JSON string. The two environment variables are mutually exclusive, meaning you can\n * only use one of them at a time.\n */\n RUSH_BUILD_CACHE_OVERRIDE_JSON_FILE_PATH: 'RUSH_BUILD_CACHE_OVERRIDE_JSON_FILE_PATH',\n /**\n * Setting this environment variable opts into running with cobuilds. The context id should be the same across\n * multiple VMs, but changed when it is a new round of cobuilds.\n *\n * e.g. `Build.BuildNumber` in Azure DevOps Pipeline.\n *\n * @remarks\n * If there is no cobuild configured, then this environment variable is ignored.\n */\n RUSH_COBUILD_CONTEXT_ID: 'RUSH_COBUILD_CONTEXT_ID',\n /**\n * Explicitly specifies a name for each participating cobuild runner.\n *\n * Setting this environment variable opts into running with cobuilds.\n *\n * @remarks\n * This environment variable is optional, if it is not provided, a random id is used.\n *\n * If there is no cobuild configured, then this environment variable is ignored.\n */\n RUSH_COBUILD_RUNNER_ID: 'RUSH_COBUILD_RUNNER_ID',\n /**\n * If this variable is set to \"1\", When getting distributed builds, Rush will automatically handle the leaf project\n * with build cache \"disabled\" by writing to the cache in a special \"log files only mode\". This is useful when you\n * want to use Cobuilds to improve the performance in CI validations and the leaf projects have not enabled cache.\n */\n RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED: 'RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED',\n /**\n * Explicitly specifies the path for the Git binary that is invoked by certain Rush operations.\n */\n RUSH_GIT_BINARY_PATH: 'RUSH_GIT_BINARY_PATH',\n /**\n * Explicitly specifies the path for the `tar` binary that is invoked by certain Rush operations.\n */\n RUSH_TAR_BINARY_PATH: 'RUSH_TAR_BINARY_PATH',\n /**\n * Internal variable used by `rushx` when recursively invoking another `rushx` process, to avoid\n * nesting event hooks.\n */\n _RUSH_RECURSIVE_RUSHX_CALL: '_RUSH_RECURSIVE_RUSHX_CALL',\n /**\n * Internal variable that explicitly specifies the path for the version of `@microsoft/rush-lib` being executed.\n * Will be set upon loading Rush.\n */\n _RUSH_LIB_PATH: '_RUSH_LIB_PATH',\n /**\n * When Rush executes shell scripts, it sometimes changes the working directory to be a project folder or\n * the repository root folder. The original working directory (where the Rush command was invoked) is assigned\n * to the the child process's `RUSH_INVOKED_FOLDER` environment variable, in case it is needed by the script.\n *\n * @remarks\n * The `RUSH_INVOKED_FOLDER` variable is the same idea as the `INIT_CWD` variable that package managers\n * assign when they execute lifecycle scripts.\n */\n RUSH_INVOKED_FOLDER: 'RUSH_INVOKED_FOLDER',\n /**\n * When running a hook script, this environment variable communicates the original arguments\n * passed to the `rush` or `rushx` command.\n *\n * @remarks\n * Unlike `RUSH_INVOKED_FOLDER`, the `RUSH_INVOKED_ARGS` variable is only available for hook scripts.\n * Other lifecycle scripts should not make assumptions about Rush's command line syntax\n * if Rush did not explicitly pass along command-line parameters to their process.\n */\n RUSH_INVOKED_ARGS: 'RUSH_INVOKED_ARGS'\n};\n/**\n * Provides Rush-specific environment variable data. All Rush environment variables must start with \"RUSH_\". This class\n * is designed to be used by RushConfiguration.\n * @beta\n *\n * @remarks\n * Initialize will throw if any unknown parameters are present.\n */\nexport class EnvironmentConfiguration {\n /**\n * If true, the environment configuration has been validated and initialized.\n */\n static get hasBeenValidated() {\n return EnvironmentConfiguration._hasBeenValidated;\n }\n /**\n * An override for the common/temp folder path.\n */\n static get rushTempFolderOverride() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._rushTempFolderOverride;\n }\n /**\n * If \"1\", create symlinks with absolute paths instead of relative paths.\n * See {@link EnvironmentVariableNames.RUSH_ABSOLUTE_SYMLINKS}\n */\n static get absoluteSymlinks() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._absoluteSymlinks;\n }\n /**\n * If this environment variable is set to \"1\", the Node.js version check will print a warning\n * instead of causing a hard error if the environment's Node.js version doesn't match the\n * version specifier in `rush.json`'s \"nodeSupportedVersionRange\" property.\n *\n * See {@link EnvironmentVariableNames.RUSH_ALLOW_UNSUPPORTED_NODEJS}.\n */\n static get allowUnsupportedNodeVersion() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._allowUnsupportedNodeVersion;\n }\n /**\n * Setting this environment variable overrides the value of `allowWarningsInSuccessfulBuild`\n * in the `command-line.json` configuration file. Specify `1` to allow warnings in a successful build,\n * or `0` to disallow them. (See the comments in the command-line.json file for more information).\n */\n static get allowWarningsInSuccessfulBuild() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._allowWarningsInSuccessfulBuild;\n }\n /**\n * An override for the PNPM store path, if `pnpmStore` configuration is set to 'path'\n * See {@link EnvironmentVariableNames.RUSH_PNPM_STORE_PATH}\n */\n static get pnpmStorePathOverride() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._pnpmStorePathOverride;\n }\n /**\n * If specified, enables or disables integrity verification of the pnpm store during install.\n * See {@link EnvironmentVariableNames.RUSH_PNPM_VERIFY_STORE_INTEGRITY}\n */\n static get pnpmVerifyStoreIntegrity() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._pnpmVerifyStoreIntegrity;\n }\n /**\n * Overrides the location of the `~/.rush` global folder where Rush stores temporary files.\n * See {@link EnvironmentVariableNames.RUSH_GLOBAL_FOLDER}\n */\n static get rushGlobalFolderOverride() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._rushGlobalFolderOverride;\n }\n /**\n * Provides a credential for reading from and writing to a remote build cache, if configured.\n * See {@link EnvironmentVariableNames.RUSH_BUILD_CACHE_CREDENTIAL}\n */\n static get buildCacheCredential() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._buildCacheCredential;\n }\n /**\n * If set, enables or disables the cloud build cache feature.\n * See {@link EnvironmentVariableNames.RUSH_BUILD_CACHE_ENABLED}\n */\n static get buildCacheEnabled() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._buildCacheEnabled;\n }\n /**\n * If set, enables or disables writing to the cloud build cache.\n * See {@link EnvironmentVariableNames.RUSH_BUILD_CACHE_WRITE_ALLOWED}\n */\n static get buildCacheWriteAllowed() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._buildCacheWriteAllowed;\n }\n /**\n * If set, overrides the build cache configuration that normally lives at `common/config/rush/build-cache.json`.\n * See {@link EnvironmentVariableNames.RUSH_BUILD_CACHE_OVERRIDE_JSON}\n */\n static get buildCacheOverrideJson() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._buildCacheOverrideJson;\n }\n /**\n * If set, overrides the build cache configuration that normally lives at `common/config/rush/build-cache.json`.\n * See {@link EnvironmentVariableNames.RUSH_BUILD_CACHE_OVERRIDE_JSON_FILE_PATH}\n */\n static get buildCacheOverrideJsonFilePath() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._buildCacheOverrideJsonFilePath;\n }\n /**\n * Provides a determined cobuild context id if configured\n * See {@link EnvironmentVariableNames.RUSH_COBUILD_CONTEXT_ID}\n */\n static get cobuildContextId() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._cobuildContextId;\n }\n /**\n * Provides a determined cobuild runner id if configured\n * See {@link EnvironmentVariableNames.RUSH_COBUILD_RUNNER_ID}\n */\n static get cobuildRunnerId() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._cobuildRunnerId;\n }\n /**\n * If set, enables or disables the cobuild leaf project log only feature.\n * See {@link EnvironmentVariableNames.RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED}\n */\n static get cobuildLeafProjectLogOnlyAllowed() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._cobuildLeafProjectLogOnlyAllowed;\n }\n /**\n * Allows the git binary path to be explicitly provided.\n * See {@link EnvironmentVariableNames.RUSH_GIT_BINARY_PATH}\n */\n static get gitBinaryPath() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._gitBinaryPath;\n }\n /**\n * Allows the tar binary path to be explicitly provided.\n * See {@link EnvironmentVariableNames.RUSH_TAR_BINARY_PATH}\n */\n static get tarBinaryPath() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._tarBinaryPath;\n }\n /**\n * The front-end RushVersionSelector relies on `RUSH_GLOBAL_FOLDER`, so its value must be read before\n * `EnvironmentConfiguration` is initialized (and actually before the correct version of `EnvironmentConfiguration`\n * is even installed). Thus we need to read this environment variable differently from all the others.\n * @internal\n */\n static _getRushGlobalFolderOverride(processEnv) {\n const value = processEnv[EnvironmentVariableNames.RUSH_GLOBAL_FOLDER];\n if (value) {\n const normalizedValue = EnvironmentConfiguration._normalizeDeepestParentFolderPath(value);\n return normalizedValue;\n }\n }\n /**\n * Reads and validates environment variables. If any are invalid, this function will throw.\n */\n static validate(options = {}) {\n var _a, _b, _c;\n EnvironmentConfiguration.reset();\n const unknownEnvVariables = [];\n for (const envVarName in process.env) {\n if (process.env.hasOwnProperty(envVarName) && envVarName.match(/^RUSH_/i)) {\n const value = process.env[envVarName];\n // Environment variables are only case-insensitive on Windows\n const normalizedEnvVarName = os.platform() === 'win32' ? envVarName.toUpperCase() : envVarName;\n switch (normalizedEnvVarName) {\n case EnvironmentVariableNames.RUSH_TEMP_FOLDER: {\n EnvironmentConfiguration._rushTempFolderOverride =\n value && !options.doNotNormalizePaths\n ? EnvironmentConfiguration._normalizeDeepestParentFolderPath(value) || value\n : value;\n break;\n }\n case EnvironmentVariableNames.RUSH_ABSOLUTE_SYMLINKS: {\n EnvironmentConfiguration._absoluteSymlinks =\n (_a = EnvironmentConfiguration.parseBooleanEnvironmentVariable(EnvironmentVariableNames.RUSH_ABSOLUTE_SYMLINKS, value)) !== null && _a !== void 0 ? _a : false;\n break;\n }\n case EnvironmentVariableNames.RUSH_ALLOW_UNSUPPORTED_NODEJS: {\n if (value === 'true' || value === 'false') {\n // Small, undocumented acceptance of old \"true\" and \"false\" values for\n // users of RUSH_ALLOW_UNSUPPORTED_NODEJS in rush pre-v5.46.\n EnvironmentConfiguration._allowUnsupportedNodeVersion = value === 'true';\n }\n else {\n EnvironmentConfiguration._allowUnsupportedNodeVersion =\n (_b = EnvironmentConfiguration.parseBooleanEnvironmentVariable(EnvironmentVariableNames.RUSH_ALLOW_UNSUPPORTED_NODEJS, value)) !== null && _b !== void 0 ? _b : false;\n }\n break;\n }\n case EnvironmentVariableNames.RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD: {\n EnvironmentConfiguration._allowWarningsInSuccessfulBuild =\n (_c = EnvironmentConfiguration.parseBooleanEnvironmentVariable(EnvironmentVariableNames.RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD, value)) !== null && _c !== void 0 ? _c : false;\n break;\n }\n case EnvironmentVariableNames.RUSH_PNPM_STORE_PATH: {\n EnvironmentConfiguration._pnpmStorePathOverride =\n value && !options.doNotNormalizePaths\n ? EnvironmentConfiguration._normalizeDeepestParentFolderPath(value) || value\n : value;\n break;\n }\n case EnvironmentVariableNames.RUSH_PNPM_VERIFY_STORE_INTEGRITY: {\n EnvironmentConfiguration._pnpmVerifyStoreIntegrity =\n value === '1' ? true : value === '0' ? false : undefined;\n break;\n }\n case EnvironmentVariableNames.RUSH_GLOBAL_FOLDER: {\n // Handled specially below\n break;\n }\n case EnvironmentVariableNames.RUSH_BUILD_CACHE_CREDENTIAL: {\n EnvironmentConfiguration._buildCacheCredential = value;\n break;\n }\n case EnvironmentVariableNames.RUSH_BUILD_CACHE_ENABLED: {\n EnvironmentConfiguration._buildCacheEnabled =\n EnvironmentConfiguration.parseBooleanEnvironmentVariable(EnvironmentVariableNames.RUSH_BUILD_CACHE_ENABLED, value);\n break;\n }\n case EnvironmentVariableNames.RUSH_BUILD_CACHE_WRITE_ALLOWED: {\n EnvironmentConfiguration._buildCacheWriteAllowed =\n EnvironmentConfiguration.parseBooleanEnvironmentVariable(EnvironmentVariableNames.RUSH_BUILD_CACHE_WRITE_ALLOWED, value);\n break;\n }\n case EnvironmentVariableNames.RUSH_BUILD_CACHE_OVERRIDE_JSON: {\n EnvironmentConfiguration._buildCacheOverrideJson = value;\n break;\n }\n case EnvironmentVariableNames.RUSH_BUILD_CACHE_OVERRIDE_JSON_FILE_PATH: {\n EnvironmentConfiguration._buildCacheOverrideJsonFilePath = value;\n break;\n }\n case EnvironmentVariableNames.RUSH_COBUILD_CONTEXT_ID: {\n EnvironmentConfiguration._cobuildContextId = value;\n break;\n }\n case EnvironmentVariableNames.RUSH_COBUILD_RUNNER_ID: {\n EnvironmentConfiguration._cobuildRunnerId = value;\n break;\n }\n case EnvironmentVariableNames.RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED: {\n EnvironmentConfiguration._cobuildLeafProjectLogOnlyAllowed =\n EnvironmentConfiguration.parseBooleanEnvironmentVariable(EnvironmentVariableNames.RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED, value);\n break;\n }\n case EnvironmentVariableNames.RUSH_GIT_BINARY_PATH: {\n EnvironmentConfiguration._gitBinaryPath = value;\n break;\n }\n case EnvironmentVariableNames.RUSH_TAR_BINARY_PATH: {\n EnvironmentConfiguration._tarBinaryPath = value;\n break;\n }\n case EnvironmentVariableNames.RUSH_PARALLELISM:\n case EnvironmentVariableNames.RUSH_PREVIEW_VERSION:\n case EnvironmentVariableNames.RUSH_VARIANT:\n case EnvironmentVariableNames.RUSH_DEPLOY_TARGET_FOLDER:\n // Handled by @microsoft/rush front end\n break;\n case EnvironmentVariableNames.RUSH_INVOKED_FOLDER:\n case EnvironmentVariableNames.RUSH_INVOKED_ARGS:\n case EnvironmentVariableNames._RUSH_LIB_PATH:\n // Assigned by Rush itself\n break;\n case EnvironmentVariableNames._RUSH_RECURSIVE_RUSHX_CALL:\n // Assigned/read internally by RushXCommandLine\n break;\n default:\n unknownEnvVariables.push(envVarName);\n break;\n }\n }\n }\n // This strictness intends to catch mistakes where variables are misspelled or not used correctly.\n if (unknownEnvVariables.length > 0) {\n throw new Error('The following environment variables were found with the \"RUSH_\" prefix, but they are not ' +\n `recognized by this version of Rush: ${unknownEnvVariables.join(', ')}`);\n }\n if (EnvironmentConfiguration._buildCacheOverrideJsonFilePath &&\n EnvironmentConfiguration._buildCacheOverrideJson) {\n throw new Error(`Environment variable ${EnvironmentVariableNames.RUSH_BUILD_CACHE_OVERRIDE_JSON_FILE_PATH} and ` +\n `${EnvironmentVariableNames.RUSH_BUILD_CACHE_OVERRIDE_JSON} are mutually exclusive. ` +\n `Only one may be specified.`);\n }\n // See doc comment for EnvironmentConfiguration._getRushGlobalFolderOverride().\n EnvironmentConfiguration._rushGlobalFolderOverride =\n EnvironmentConfiguration._getRushGlobalFolderOverride(process.env);\n EnvironmentConfiguration._hasBeenValidated = true;\n }\n /**\n * Resets EnvironmentConfiguration into an un-initialized state.\n */\n static reset() {\n EnvironmentConfiguration._rushTempFolderOverride = undefined;\n EnvironmentConfiguration._hasBeenValidated = false;\n }\n static _ensureValidated() {\n if (!EnvironmentConfiguration._hasBeenValidated) {\n EnvironmentConfiguration.validate();\n }\n }\n static parseBooleanEnvironmentVariable(name, value) {\n if (value === '' || value === undefined) {\n return undefined;\n }\n else if (value === '0') {\n return false;\n }\n else if (value === '1') {\n return true;\n }\n else {\n throw new Error(`Invalid value \"${value}\" for the environment variable ${name}. Valid choices are 0 or 1.`);\n }\n }\n /**\n * Given a path to a folder (that may or may not exist), normalize the path, including casing,\n * to the first existing parent folder in the path.\n *\n * If no existing path can be found (for example, if the root is a volume that doesn't exist),\n * this function returns undefined.\n *\n * @example\n * If the following path exists on disk: `C:\\Folder1\\folder2\\`\n * _normalizeFirstExistingFolderPath('c:\\\\folder1\\\\folder2\\\\temp\\\\subfolder')\n * returns 'C:\\\\Folder1\\\\folder2\\\\temp\\\\subfolder'\n */\n static _normalizeDeepestParentFolderPath(folderPath) {\n folderPath = path.normalize(folderPath);\n const endsWithSlash = folderPath.charAt(folderPath.length - 1) === path.sep;\n const parsedPath = path.parse(folderPath);\n const pathRoot = parsedPath.root;\n const pathWithoutRoot = parsedPath.dir.substr(pathRoot.length);\n const pathParts = [...pathWithoutRoot.split(path.sep), parsedPath.name].filter((part) => !!part);\n // Starting with all path sections, and eliminating one from the end during each loop iteration,\n // run trueCasePathSync. If trueCasePathSync returns without exception, we've found a subset\n // of the path that exists and we've now gotten the correct casing.\n //\n // Once we've found a parent folder that exists, append the path sections that didn't exist.\n for (let i = pathParts.length; i >= 0; i--) {\n const constructedPath = path.join(pathRoot, ...pathParts.slice(0, i));\n try {\n const normalizedConstructedPath = trueCasePathSync(constructedPath);\n const result = path.join(normalizedConstructedPath, ...pathParts.slice(i));\n if (endsWithSlash) {\n return `${result}${path.sep}`;\n }\n else {\n return result;\n }\n }\n catch (e) {\n // This path doesn't exist, continue to the next subpath\n }\n }\n return undefined;\n }\n}\nEnvironmentConfiguration._hasBeenValidated = false;\nEnvironmentConfiguration._absoluteSymlinks = false;\nEnvironmentConfiguration._allowUnsupportedNodeVersion = false;\nEnvironmentConfiguration._allowWarningsInSuccessfulBuild = false;\n//# sourceMappingURL=EnvironmentConfiguration.js.map","// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\nimport * as path from 'node:path';\nimport { User } from '@rushstack/node-core-library';\nimport { EnvironmentConfiguration } from './EnvironmentConfiguration';\n/**\n * This class provides global folders that are used for rush's internal install locations.\n *\n * @internal\n */\nexport class RushGlobalFolder {\n constructor() {\n // Because RushGlobalFolder is used by the front-end VersionSelector before EnvironmentConfiguration\n // is initialized, we need to read it using a special internal API.\n const rushGlobalFolderOverride = EnvironmentConfiguration._getRushGlobalFolderOverride(process.env);\n if (rushGlobalFolderOverride !== undefined) {\n this.path = rushGlobalFolderOverride;\n }\n else {\n this.path = path.join(User.getHomeFolder(), '.rush');\n }\n const normalizedNodeVersion = process.version.match(/^[a-z0-9\\-\\.]+$/i)\n ? process.version\n : 'unknown-version';\n this.nodeSpecificPath = path.join(this.path, `node-${normalizedNodeVersion}`);\n }\n}\n//# sourceMappingURL=RushGlobalFolder.js.map","\"use strict\";\n// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sdkContext = exports.RUSH_LIB_PATH_ENV_VAR_NAME = exports.RUSH_LIB_NAME = void 0;\nexports.tryFindRushJsonLocation = tryFindRushJsonLocation;\nexports._require = _require;\nexports.requireRushLibUnderFolderPath = requireRushLibUnderFolderPath;\nconst path = __importStar(require(\"node:path\"));\nconst node_core_library_1 = require(\"@rushstack/node-core-library\");\nexports.RUSH_LIB_NAME = '@microsoft/rush-lib';\nexports.RUSH_LIB_PATH_ENV_VAR_NAME = '_RUSH_LIB_PATH';\nexports.sdkContext = {\n rushLibModule: undefined\n};\n/**\n * Find the rush.json location and return the path, or undefined if a rush.json can't be found.\n *\n * @privateRemarks\n * Keep this in sync with `RushConfiguration.tryFindRushJsonLocation`.\n */\nfunction tryFindRushJsonLocation(startingFolder) {\n let currentFolder = startingFolder;\n // Look upwards at parent folders until we find a folder containing rush.json\n for (let i = 0; i < 10; ++i) {\n const rushJsonFilename = path.join(currentFolder, 'rush.json');\n if (node_core_library_1.FileSystem.exists(rushJsonFilename)) {\n return rushJsonFilename;\n }\n const parentFolder = path.dirname(currentFolder);\n if (parentFolder === currentFolder) {\n break;\n }\n currentFolder = parentFolder;\n }\n return undefined;\n}\nfunction _require(moduleName) {\n if (typeof __non_webpack_require__ === 'function') {\n // If this library has been bundled with Webpack, we need to call the real `require` function\n // that doesn't get turned into a `__webpack_require__` statement.\n // `__non_webpack_require__` is a Webpack macro that gets turned into a `require` statement\n // during bundling.\n return __non_webpack_require__(moduleName);\n }\n else {\n return require(moduleName);\n }\n}\n/**\n * Require `@microsoft/rush-lib` under the specified folder path.\n */\nfunction requireRushLibUnderFolderPath(folderPath) {\n const rushLibModulePath = node_core_library_1.Import.resolveModule({\n modulePath: exports.RUSH_LIB_NAME,\n baseFolderPath: folderPath\n });\n return _require(rushLibModulePath);\n}\n//# sourceMappingURL=helpers.js.map","\"use strict\";\n// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._rushSdk_loadInternalModule = _rushSdk_loadInternalModule;\nconst path = __importStar(require(\"node:path\"));\nconst node_core_library_1 = require(\"@rushstack/node-core-library\");\nconst terminal_1 = require(\"@rushstack/terminal\");\nconst RushGlobalFolder_1 = require(\"@microsoft/rush-lib/lib-esnext/api/RushGlobalFolder\");\nconst helpers_1 = require(\"./helpers\");\nconst verboseEnabled = typeof process !== 'undefined' &&\n (process.env.RUSH_SDK_DEBUG === '1' || process.env._RUSH_SDK_DEBUG === '1');\nconst terminal = new terminal_1.Terminal(new terminal_1.ConsoleTerminalProvider({\n verboseEnabled\n}));\nlet errorMessage = '';\n// SCENARIO 1: Rush's PluginManager has initialized \"rush-sdk\" with Rush's own instance of rush-lib.\n// The Rush host process will assign \"global.___rush___rushLibModule\" before loading the plugin.\nif (helpers_1.sdkContext.rushLibModule === undefined) {\n helpers_1.sdkContext.rushLibModule =\n global.___rush___rushLibModule ||\n global.___rush___rushLibModuleFromEnvironment ||\n global.___rush___rushLibModuleFromRushGlobalFolder ||\n global.___rush___rushLibModuleFromInstallAndRunRush;\n}\n// SCENARIO 2: The project importing \"rush-sdk\" has installed its own instance of \"rush-lib\"\n// as a package.json dependency. For example, this is used by the Jest tests for Rush plugins.\nif (helpers_1.sdkContext.rushLibModule === undefined) {\n const importingPath = (_a = module === null || module === void 0 ? void 0 : module.parent) === null || _a === void 0 ? void 0 : _a.filename;\n if (importingPath) {\n const callerPackageFolder = node_core_library_1.PackageJsonLookup.instance.tryGetPackageFolderFor(importingPath);\n if (callerPackageFolder !== undefined) {\n const callerPackageJson = (0, helpers_1._require)(path.join(callerPackageFolder, 'package.json'));\n // Does the caller properly declare a dependency on rush-lib?\n if ((callerPackageJson.dependencies && callerPackageJson.dependencies[helpers_1.RUSH_LIB_NAME] !== undefined) ||\n (callerPackageJson.devDependencies &&\n callerPackageJson.devDependencies[helpers_1.RUSH_LIB_NAME] !== undefined) ||\n (callerPackageJson.peerDependencies &&\n callerPackageJson.peerDependencies[helpers_1.RUSH_LIB_NAME] !== undefined)) {\n // Try to resolve rush-lib from the caller's folder\n terminal.writeVerboseLine(`Try to load ${helpers_1.RUSH_LIB_NAME} from caller package`);\n try {\n helpers_1.sdkContext.rushLibModule = (0, helpers_1.requireRushLibUnderFolderPath)(callerPackageFolder);\n }\n catch (error) {\n // If we fail to resolve it, ignore the error\n terminal.writeVerboseLine(`Failed to load ${helpers_1.RUSH_LIB_NAME} from caller package`);\n }\n // If two different libraries invoke `rush-sdk`, and one of them provides \"rush-lib\"\n // then the first version to be loaded wins. We do not support side-by-side instances of \"rush-lib\".\n if (helpers_1.sdkContext.rushLibModule !== undefined) {\n // to track which scenario is active and how it got initialized.\n global.___rush___rushLibModule = helpers_1.sdkContext.rushLibModule;\n terminal.writeVerboseLine(`Loaded ${helpers_1.RUSH_LIB_NAME} from caller`);\n }\n }\n }\n }\n}\n// SCENARIO 3: A tool or script has been invoked as a child process by an instance of \"rush-lib\" and can use the\n// version that invoked it. In this case, use process.env._RUSH_LIB_PATH to find \"rush-lib\".\nif (helpers_1.sdkContext.rushLibModule === undefined) {\n const rushLibPath = process.env[helpers_1.RUSH_LIB_PATH_ENV_VAR_NAME];\n if (rushLibPath) {\n terminal.writeVerboseLine(`Try to load ${helpers_1.RUSH_LIB_NAME} from process.env.${helpers_1.RUSH_LIB_PATH_ENV_VAR_NAME} from caller package`);\n try {\n helpers_1.sdkContext.rushLibModule = (0, helpers_1._require)(rushLibPath);\n }\n catch (error) {\n // Log this as a warning, since it is unexpected to define an incorrect value of the variable.\n terminal.writeWarningLine(`Failed to load ${helpers_1.RUSH_LIB_NAME} via process.env.${helpers_1.RUSH_LIB_PATH_ENV_VAR_NAME}`);\n }\n if (helpers_1.sdkContext.rushLibModule !== undefined) {\n // to track which scenario is active and how it got initialized.\n global.___rush___rushLibModuleFromEnvironment = helpers_1.sdkContext.rushLibModule;\n terminal.writeVerboseLine(`Loaded ${helpers_1.RUSH_LIB_NAME} from process.env.${helpers_1.RUSH_LIB_PATH_ENV_VAR_NAME}`);\n }\n }\n}\n// SCENARIO 4: A standalone tool or script depends on \"rush-sdk\", and is meant to be used inside a monorepo folder.\n// In this case, we can first load the rush-lib version in rush global folder. If the expected version is not installed,\n// using install-run-rush.js to obtain the appropriate rush-lib version for the monorepo.\nif (helpers_1.sdkContext.rushLibModule === undefined) {\n try {\n const rushJsonPath = (0, helpers_1.tryFindRushJsonLocation)(process.cwd());\n if (!rushJsonPath) {\n throw new Error('Unable to find rush.json in the current folder or its parent folders.\\n' +\n 'This tool is meant to be invoked from a working directory inside a Rush repository.');\n }\n const monorepoRoot = path.dirname(rushJsonPath);\n const rushJson = node_core_library_1.JsonFile.load(rushJsonPath);\n const { rushVersion } = rushJson;\n try {\n terminal.writeVerboseLine(`Try to load ${helpers_1.RUSH_LIB_NAME} from rush global folder`);\n const rushGlobalFolder = new RushGlobalFolder_1.RushGlobalFolder();\n // The path needs to keep align with the logic inside RushVersionSelector\n const expectedGlobalRushInstalledFolder = `${rushGlobalFolder.nodeSpecificPath}/rush-${rushVersion}`;\n terminal.writeVerboseLine(`The expected global rush installed folder is \"${expectedGlobalRushInstalledFolder}\"`);\n helpers_1.sdkContext.rushLibModule = (0, helpers_1.requireRushLibUnderFolderPath)(expectedGlobalRushInstalledFolder);\n }\n catch (e) {\n terminal.writeVerboseLine(`Failed to load ${helpers_1.RUSH_LIB_NAME} from rush global folder: ${e.message}`);\n }\n if (helpers_1.sdkContext.rushLibModule !== undefined) {\n // to track which scenario is active and how it got initialized.\n global.___rush___rushLibModuleFromRushGlobalFolder = helpers_1.sdkContext.rushLibModule;\n terminal.writeVerboseLine(`Loaded ${helpers_1.RUSH_LIB_NAME} installed from rush global folder`);\n }\n else {\n const installRunNodeModuleFolder = `${monorepoRoot}/common/temp/install-run/@microsoft+rush@${rushVersion}`;\n try {\n // First, try to load the version of \"rush-lib\" that was installed by install-run-rush.js\n terminal.writeVerboseLine(`Trying to load ${helpers_1.RUSH_LIB_NAME} installed by install-run-rush`);\n helpers_1.sdkContext.rushLibModule = (0, helpers_1.requireRushLibUnderFolderPath)(installRunNodeModuleFolder);\n }\n catch (e1) {\n let installAndRunRushStderrContent = '';\n try {\n const installAndRunRushJSPath = `${monorepoRoot}/common/scripts/install-run-rush.js`;\n terminal.writeLine('The Rush engine has not been installed yet. Invoking install-run-rush.js...');\n const installAndRunRushProcess = node_core_library_1.Executable.spawnSync('node', [installAndRunRushJSPath, '--help'], {\n stdio: 'pipe'\n });\n installAndRunRushStderrContent = installAndRunRushProcess.stderr;\n if (installAndRunRushProcess.status !== 0) {\n throw new Error(`The ${helpers_1.RUSH_LIB_NAME} package failed to install`);\n }\n // Retry to load \"rush-lib\" after install-run-rush run\n terminal.writeVerboseLine(`Trying to load ${helpers_1.RUSH_LIB_NAME} installed by install-run-rush a second time`);\n helpers_1.sdkContext.rushLibModule = (0, helpers_1.requireRushLibUnderFolderPath)(installRunNodeModuleFolder);\n }\n catch (e2) {\n // eslint-disable-next-line no-console\n console.error(`${installAndRunRushStderrContent}`);\n throw new Error(`The ${helpers_1.RUSH_LIB_NAME} package failed to load`);\n }\n }\n if (helpers_1.sdkContext.rushLibModule !== undefined) {\n // to track which scenario is active and how it got initialized.\n global.___rush___rushLibModuleFromInstallAndRunRush = helpers_1.sdkContext.rushLibModule;\n terminal.writeVerboseLine(`Loaded ${helpers_1.RUSH_LIB_NAME} installed by install-run-rush`);\n }\n }\n }\n catch (e) {\n // no-catch\n errorMessage = e.message;\n }\n}\nif (helpers_1.sdkContext.rushLibModule === undefined) {\n // This error indicates that a project is trying to import \"@rushstack/rush-sdk\", but the Rush engine\n // instance cannot be found. If you are writing Jest tests for a Rush plugin, add \"@microsoft/rush-lib\"\n // to the devDependencies for your project.\n // eslint-disable-next-line no-console\n console.error(`Error: The @rushstack/rush-sdk package was not able to load the Rush engine:\n${errorMessage}\n`);\n process.exit(1);\n}\n// Based on TypeScript's __exportStar()\nfor (const property in helpers_1.sdkContext.rushLibModule) {\n if (property !== 'default' && !exports.hasOwnProperty(property)) {\n const rushLibModuleForClosure = helpers_1.sdkContext.rushLibModule;\n // Based on TypeScript's __createBinding()\n Object.defineProperty(exports, property, {\n enumerable: true,\n get: function () {\n return rushLibModuleForClosure[property];\n }\n });\n }\n}\n/**\n * Used by the .js stubs for path-based imports of `@microsoft/rush-lib` internal APIs.\n */\nfunction _rushSdk_loadInternalModule(srcImportPath) {\n if (!exports._RushInternals) {\n throw new Error(`Rush version ${exports.Rush.version} does not support internal API imports via rush-sdk`);\n }\n return exports._RushInternals.loadModule(srcImportPath);\n}\n//# sourceMappingURL=index.js.map","module.exports = require(\"@rushstack/node-core-library\");","module.exports = require(\"@rushstack/terminal\");","module.exports = require(\"fs\");","module.exports = require(\"node:path\");","module.exports = require(\"os\");","module.exports = require(\"path\");","module.exports = require(\"util\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./lib-commonjs/index.js\");\n",""],"names":[],"sourceRoot":""}
1
+ {"version":3,"file":"index.js","mappings":";;;;;;;;;;AAAY;;AAEZ,QAAQ,iCAAiC,EAAE,mBAAO,CAAC,cAAI;AACvD,QAAQ,WAAW,EAAE,mBAAO,CAAC,cAAI;AACjC,QAAQ,wBAAwB,EAAE,mBAAO,CAAC,kBAAM;AAChD,QAAQ,kBAAkB,EAAE,mBAAO,CAAC,kBAAM;;AAE1C;AACA;AACA;;AAEA;AACA,gCAAgC,aAAa;AAC7C,oCAAoC,YAAY;AAChD;;AAEA;AACA;AACA;;AAEA;AACA,+BAA+B;AAC/B;;AAEA;AACA;AACA,QAAQ,8BAA8B;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,SAAS;AAC9C;AACA;;AAEA,yBAAyB,MAAM;AAC/B;AACA;AACA;AACA;AACA,6EAA6E,SAAS;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;AC7FA,MAAM,gCAA4B,sB;;;;ACAlC;AACA;AAC8B;AACI;AACgB;AAClD;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,wEAAwE;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,8DAA8D;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAA6D;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,yCAAW;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,+BAA+B;AACtF;AACA;AACA;AACA,oDAAoD,mEAAmE;AACvH,mBAAmB,yDAAyD;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,MAAM,iCAAiC,KAAK;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,6BAAc;AACnC,2EAA2E,uBAAQ;AACnF,2BAA2B,yBAAU;AACrC;AACA;AACA,oDAAoD,uBAAQ;AAC5D;AACA;AACA;AACA;AACA;AACA,uCAAuC,QAAQ;AAC/C,oCAAoC,wBAAS;AAC7C;AACA,kDAAkD,mCAAgB;AAClE,+BAA+B,wBAAS;AACxC;AACA,8BAA8B,OAAO,EAAE,uBAAQ,CAAC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oD;;AC9kBA;AACA;AACkC;AACkB;AACkB;AACtE;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,yCAAyC,wBAAwB;AACjE;AACA;AACA;AACA;AACA,wBAAwB,wBAAS,CAAC,uBAAI;AACtC;AACA;AACA;AACA;AACA,gCAAgC,wBAAS,oBAAoB,sBAAsB;AACnF;AACA;AACA,4C;;;;;;;;;;AC3Ba;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA,0CAA0C,4BAA4B;AACtE,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,cAAc;AACzE;AACA;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,kBAAkB,GAAG,kCAAkC,GAAG,qBAAqB;AAC/E,+BAA+B;AAC/B,gBAAgB;AAChB,qCAAqC;AACrC,0BAA0B,mBAAO,CAAC,4BAAW;AAC7C,4BAA4B,mBAAO,CAAC,kEAA8B;AAClE,qBAAqB;AACrB,kCAAkC;AAClC,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAuB;AACtC;AACA;AACA;AACA;AACA,eAAe,OAAuB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,mC;;;;;;;;;;;AC5Fa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA,0CAA0C,4BAA4B;AACtE,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,cAAc;AACzE;AACA;AACA;AACA,CAAC;AACD;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mCAAmC;AACnC,0BAA0B,mBAAO,CAAC,4BAAW;AAC7C,4BAA4B,mBAAO,CAAC,kEAA8B;AAClE,mBAAmB,mBAAO,CAAC,gDAAqB;AAChD,2BAA2B,mBAAO,CAAC,2GAAqD;AACxF,kBAAkB,mBAAO,CAAC,4CAAW;AACrC;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,yBAAyB;AAClF;AACA;AACA;AACA;AACA;AACA,gEAAgE,yBAAyB;AACzF;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,yBAAyB;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,yBAAyB,mBAAmB,sCAAsC;AACnI;AACA;AACA;AACA;AACA;AACA,wDAAwD,yBAAyB,kBAAkB,qCAAqC;AACxI;AACA;AACA;AACA;AACA,gDAAgD,yBAAyB,mBAAmB,qCAAqC;AACjI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B;AACA,qDAAqD,yBAAyB;AAC9E;AACA;AACA,yDAAyD,kCAAkC,QAAQ,YAAY;AAC/G,uFAAuF,kCAAkC;AACzH;AACA;AACA;AACA,wDAAwD,yBAAyB,2BAA2B,UAAU;AACtH;AACA;AACA;AACA;AACA,gDAAgD,yBAAyB;AACzE;AACA;AACA,kDAAkD,aAAa,2CAA2C,YAAY;AACtH;AACA;AACA,6DAA6D,yBAAyB;AACtF;AACA;AACA;AACA;AACA;AACA,uDAAuD,aAAa;AACpE;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,+CAA+C,yBAAyB;AACxE;AACA;AACA,iEAAiE,yBAAyB;AAC1F;AACA;AACA;AACA;AACA,qCAAqC,+BAA+B;AACpE,2CAA2C,yBAAyB;AACpE;AACA;AACA;AACA;AACA;AACA,oDAAoD,yBAAyB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,sBAAsB;AAC9D;AACA;AACA;AACA,iC;;;;;;;;;;ACvNA,yD;;;;;;;;;;ACAA,gD;;;;;;;;;;ACAA,+B;;;;;;;;;;ACAA,sC;;;;;;;;;;ACAA,+B;;;;;;;;;;ACAA,iC;;;;;;;;;;ACAA,iC;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCzBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA,E;;;;;WCPA,wF;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D,E;;;;;WCNA;WACA;WACA;WACA;WACA,E;;;;;UEJA;UACA;UACA;UACA","sources":["webpack://@rushstack/rush-sdk/../../common/temp/default/node_modules/.pnpm/true-case-path@2.2.1/node_modules/true-case-path/index.js","webpack://@rushstack/rush-sdk/external node-commonjs \"node:os\"","webpack://@rushstack/rush-sdk/../rush-lib/lib-esnext/api/EnvironmentConfiguration.js","webpack://@rushstack/rush-sdk/../rush-lib/lib-esnext/api/RushGlobalFolder.js","webpack://@rushstack/rush-sdk/./lib-commonjs/helpers.js","webpack://@rushstack/rush-sdk/./lib-commonjs/index.js","webpack://@rushstack/rush-sdk/external commonjs \"@rushstack/node-core-library\"","webpack://@rushstack/rush-sdk/external commonjs \"@rushstack/terminal\"","webpack://@rushstack/rush-sdk/external node-commonjs \"fs\"","webpack://@rushstack/rush-sdk/external node-commonjs \"node:path\"","webpack://@rushstack/rush-sdk/external node-commonjs \"os\"","webpack://@rushstack/rush-sdk/external node-commonjs \"path\"","webpack://@rushstack/rush-sdk/external node-commonjs \"util\"","webpack://@rushstack/rush-sdk/webpack/bootstrap","webpack://@rushstack/rush-sdk/webpack/runtime/define property getters","webpack://@rushstack/rush-sdk/webpack/runtime/hasOwnProperty shorthand","webpack://@rushstack/rush-sdk/webpack/runtime/make namespace object","webpack://@rushstack/rush-sdk/webpack/runtime/node module decorator","webpack://@rushstack/rush-sdk/webpack/before-startup","webpack://@rushstack/rush-sdk/webpack/startup","webpack://@rushstack/rush-sdk/webpack/after-startup"],"sourcesContent":["'use strict'\n\nconst { readdir: _readdir, readdirSync } = require('fs')\nconst { platform } = require('os')\nconst { isAbsolute, normalize } = require('path')\nconst { promisify: pify } = require('util')\n\nconst readdir = pify(_readdir)\nconst isWindows = platform() === 'win32'\nconst delimiter = isWindows ? '\\\\' : '/'\n\nmodule.exports = {\n trueCasePath: _trueCasePath({ sync: false }),\n trueCasePathSync: _trueCasePath({ sync: true })\n}\n\nfunction getRelevantFilePathSegments(filePath) {\n return filePath.split(delimiter).filter((s) => s !== '')\n}\n\nfunction escapeString(str) {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n}\n\nfunction matchCaseInsensitive(fileOrDirectory, directoryContents, filePath) {\n const caseInsensitiveRegex = new RegExp(\n `^${escapeString(fileOrDirectory)}$`,\n 'i'\n )\n for (const file of directoryContents) {\n if (caseInsensitiveRegex.test(file)) return file\n }\n throw new Error(\n `[true-case-path]: Called with ${filePath}, but no matching file exists`\n )\n}\n\nfunction _trueCasePath({ sync }) {\n return (filePath, basePath) => {\n if (basePath) {\n if (!isAbsolute(basePath)) {\n throw new Error(\n `[true-case-path]: basePath argument must be absolute. Received \"${basePath}\"`\n )\n }\n basePath = normalize(basePath)\n }\n filePath = normalize(filePath)\n const segments = getRelevantFilePathSegments(filePath)\n if (isAbsolute(filePath)) {\n if (basePath) {\n throw new Error(\n '[true-case-path]: filePath must be relative when used with basePath'\n )\n }\n basePath = isWindows\n ? segments.shift().toUpperCase() // drive letter\n : ''\n } else if (!basePath) {\n basePath = process.cwd()\n }\n return sync\n ? iterateSync(basePath, filePath, segments)\n : iterateAsync(basePath, filePath, segments)\n }\n}\n\nfunction iterateSync(basePath, filePath, segments) {\n return segments.reduce(\n (realPath, fileOrDirectory) =>\n realPath +\n delimiter +\n matchCaseInsensitive(\n fileOrDirectory,\n readdirSync(realPath + delimiter),\n filePath\n ),\n basePath\n )\n}\n\nasync function iterateAsync(basePath, filePath, segments) {\n return await segments.reduce(\n async (realPathPromise, fileOrDirectory) =>\n (await realPathPromise) +\n delimiter +\n matchCaseInsensitive(\n fileOrDirectory,\n await readdir((await realPathPromise) + delimiter),\n filePath\n ),\n basePath\n )\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"node:os\");","// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\nimport * as os from 'node:os';\nimport * as path from 'node:path';\nimport { trueCasePathSync } from 'true-case-path';\n/**\n * Names of environment variables used by Rush.\n * @beta\n */\n// eslint-disable-next-line @typescript-eslint/typedef\nexport const EnvironmentVariableNames = {\n /**\n * This variable overrides the temporary folder used by Rush.\n * The default value is \"common/temp\" under the repository root.\n *\n * @remarks This environment variable is not compatible with workspace installs. If attempting\n * to move the PNPM store path, see the `RUSH_PNPM_STORE_PATH` environment variable.\n */\n RUSH_TEMP_FOLDER: 'RUSH_TEMP_FOLDER',\n /**\n * This variable overrides the version of Rush that will be installed by\n * the version selector. The default value is determined by the \"rushVersion\"\n * field from rush.json.\n */\n RUSH_PREVIEW_VERSION: 'RUSH_PREVIEW_VERSION',\n /**\n * If this variable is set to \"1\", Rush will not fail the build when running a version\n * of Node that does not match the criteria specified in the \"nodeSupportedVersionRange\"\n * field from rush.json.\n */\n RUSH_ALLOW_UNSUPPORTED_NODEJS: 'RUSH_ALLOW_UNSUPPORTED_NODEJS',\n /**\n * Setting this environment variable overrides the value of `allowWarningsInSuccessfulBuild`\n * in the `command-line.json` configuration file. Specify `1` to allow warnings in a successful build,\n * or `0` to disallow them. (See the comments in the command-line.json file for more information).\n */\n RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD: 'RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD',\n /**\n * This variable selects a specific installation variant for Rush to use when installing\n * and linking package dependencies.\n * For more information, see the command-line help for the `--variant` parameter\n * and this article: https://rushjs.io/pages/advanced/installation_variants/\n */\n RUSH_VARIANT: 'RUSH_VARIANT',\n /**\n * Specifies the maximum number of concurrent processes to launch during a build.\n * For more information, see the command-line help for the `--parallelism` parameter for \"rush build\".\n */\n RUSH_PARALLELISM: 'RUSH_PARALLELISM',\n /**\n * If this variable is set to \"1\", Rush will create symlinks with absolute paths instead\n * of relative paths. This can be necessary when a repository is moved during a build or\n * if parts of a repository are moved into a sandbox.\n */\n RUSH_ABSOLUTE_SYMLINKS: 'RUSH_ABSOLUTE_SYMLINKS',\n /**\n * When using PNPM as the package manager, this variable can be used to configure the path that\n * PNPM will use as the store directory.\n *\n * If a relative path is used, then the store path will be resolved relative to the process's\n * current working directory. An absolute path is recommended.\n */\n RUSH_PNPM_STORE_PATH: 'RUSH_PNPM_STORE_PATH',\n /**\n * When using PNPM as the package manager, this variable can be used to control whether or not PNPM\n * validates the integrity of the PNPM store during installation. The value of this environment variable must be\n * `1` (for true) or `0` (for false). If not specified, defaults to the value in .npmrc.\n */\n RUSH_PNPM_VERIFY_STORE_INTEGRITY: 'RUSH_PNPM_VERIFY_STORE_INTEGRITY',\n /**\n * This environment variable can be used to specify the `--target-folder` parameter\n * for the \"rush deploy\" command.\n */\n RUSH_DEPLOY_TARGET_FOLDER: 'RUSH_DEPLOY_TARGET_FOLDER',\n /**\n * Overrides the location of the `~/.rush` global folder where Rush stores temporary files.\n *\n * @remarks\n *\n * Most of the temporary files created by Rush are stored separately for each monorepo working folder,\n * to avoid issues of concurrency and compatibility between tool versions. However, a small set\n * of files (e.g. installations of the `@microsoft/rush-lib` engine and the package manager) are stored\n * in a global folder to speed up installations. The default location is `~/.rush` on POSIX-like\n * operating systems or `C:\\Users\\YourName` on Windows.\n *\n * Use `RUSH_GLOBAL_FOLDER` to specify a different folder path. This is useful for example if a Windows\n * group policy forbids executing scripts installed in a user's home directory.\n *\n * POSIX is a registered trademark of the Institute of Electrical and Electronic Engineers, Inc.\n */\n RUSH_GLOBAL_FOLDER: 'RUSH_GLOBAL_FOLDER',\n /**\n * Provides a credential for a remote build cache, if configured. This credential overrides any cached credentials.\n *\n * @remarks\n * Setting this environment variable overrides whatever credential has been saved in the\n * local cloud cache credentials using `rush update-cloud-credentials`.\n *\n *\n * If Azure Blob Storage is used to store cache entries, this must be a SAS token serialized as query\n * parameters.\n *\n * For information on SAS tokens, see here: https://docs.microsoft.com/en-us/azure/storage/common/storage-sas-overview\n */\n RUSH_BUILD_CACHE_CREDENTIAL: 'RUSH_BUILD_CACHE_CREDENTIAL',\n /**\n * Setting this environment variable overrides the value of `buildCacheEnabled` in the `build-cache.json`\n * configuration file.\n *\n * @remarks\n * Specify `1` to enable the build cache or `0` to disable it.\n *\n * If there is no build cache configured, then this environment variable is ignored.\n */\n RUSH_BUILD_CACHE_ENABLED: 'RUSH_BUILD_CACHE_ENABLED',\n /**\n * Overrides the value of `isCacheWriteAllowed` in the `build-cache.json` configuration file. The value of this\n * environment variable must be `1` (for true) or `0` (for false). If there is no build cache configured, then\n * this environment variable is ignored.\n */\n RUSH_BUILD_CACHE_WRITE_ALLOWED: 'RUSH_BUILD_CACHE_WRITE_ALLOWED',\n /**\n * Set this environment variable to a JSON string to override the build cache configuration that normally lives\n * at `common/config/rush/build-cache.json`.\n *\n * This is useful for testing purposes, or for OSS repos that are have a local-only cache, but can have\n * a different cache configuration in CI/CD pipelines.\n *\n * @remarks\n * This is similar to {@link EnvironmentVariableNames.RUSH_BUILD_CACHE_OVERRIDE_JSON_FILE_PATH}, but it allows you to specify\n * a JSON string instead of a file path. The two environment variables are mutually exclusive, meaning you can\n * only use one of them at a time.\n */\n RUSH_BUILD_CACHE_OVERRIDE_JSON: 'RUSH_BUILD_CACHE_OVERRIDE_JSON',\n /**\n * Set this environment variable to the path to a `build-cache.json` file to override the build cache configuration\n * that normally lives at `common/config/rush/build-cache.json`.\n *\n * This is useful for testing purposes, or for OSS repos that are have a local-only cache, but can have\n * a different cache configuration in CI/CD pipelines.\n *\n * @remarks\n * This is similar to {@link EnvironmentVariableNames.RUSH_BUILD_CACHE_OVERRIDE_JSON}, but it allows you to specify\n * a file path instead of a JSON string. The two environment variables are mutually exclusive, meaning you can\n * only use one of them at a time.\n */\n RUSH_BUILD_CACHE_OVERRIDE_JSON_FILE_PATH: 'RUSH_BUILD_CACHE_OVERRIDE_JSON_FILE_PATH',\n /**\n * Setting this environment variable opts into running with cobuilds. The context id should be the same across\n * multiple VMs, but changed when it is a new round of cobuilds.\n *\n * e.g. `Build.BuildNumber` in Azure DevOps Pipeline.\n *\n * @remarks\n * If there is no cobuild configured, then this environment variable is ignored.\n */\n RUSH_COBUILD_CONTEXT_ID: 'RUSH_COBUILD_CONTEXT_ID',\n /**\n * Explicitly specifies a name for each participating cobuild runner.\n *\n * Setting this environment variable opts into running with cobuilds.\n *\n * @remarks\n * This environment variable is optional, if it is not provided, a random id is used.\n *\n * If there is no cobuild configured, then this environment variable is ignored.\n */\n RUSH_COBUILD_RUNNER_ID: 'RUSH_COBUILD_RUNNER_ID',\n /**\n * If this variable is set to \"1\", When getting distributed builds, Rush will automatically handle the leaf project\n * with build cache \"disabled\" by writing to the cache in a special \"log files only mode\". This is useful when you\n * want to use Cobuilds to improve the performance in CI validations and the leaf projects have not enabled cache.\n */\n RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED: 'RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED',\n /**\n * Explicitly specifies the path for the Git binary that is invoked by certain Rush operations.\n */\n RUSH_GIT_BINARY_PATH: 'RUSH_GIT_BINARY_PATH',\n /**\n * Explicitly specifies the path for the `tar` binary that is invoked by certain Rush operations.\n */\n RUSH_TAR_BINARY_PATH: 'RUSH_TAR_BINARY_PATH',\n /**\n * Internal variable used by `rushx` when recursively invoking another `rushx` process, to avoid\n * nesting event hooks.\n */\n _RUSH_RECURSIVE_RUSHX_CALL: '_RUSH_RECURSIVE_RUSHX_CALL',\n /**\n * Internal variable that explicitly specifies the path for the version of `@microsoft/rush-lib` being executed.\n * Will be set upon loading Rush.\n */\n _RUSH_LIB_PATH: '_RUSH_LIB_PATH',\n /**\n * When Rush executes shell scripts, it sometimes changes the working directory to be a project folder or\n * the repository root folder. The original working directory (where the Rush command was invoked) is assigned\n * to the the child process's `RUSH_INVOKED_FOLDER` environment variable, in case it is needed by the script.\n *\n * @remarks\n * The `RUSH_INVOKED_FOLDER` variable is the same idea as the `INIT_CWD` variable that package managers\n * assign when they execute lifecycle scripts.\n */\n RUSH_INVOKED_FOLDER: 'RUSH_INVOKED_FOLDER',\n /**\n * When running a hook script, this environment variable communicates the original arguments\n * passed to the `rush` or `rushx` command.\n *\n * @remarks\n * Unlike `RUSH_INVOKED_FOLDER`, the `RUSH_INVOKED_ARGS` variable is only available for hook scripts.\n * Other lifecycle scripts should not make assumptions about Rush's command line syntax\n * if Rush did not explicitly pass along command-line parameters to their process.\n */\n RUSH_INVOKED_ARGS: 'RUSH_INVOKED_ARGS'\n};\n/**\n * Provides Rush-specific environment variable data. All Rush environment variables must start with \"RUSH_\". This class\n * is designed to be used by RushConfiguration.\n * @beta\n *\n * @remarks\n * Initialize will throw if any unknown parameters are present.\n */\nexport class EnvironmentConfiguration {\n /**\n * If true, the environment configuration has been validated and initialized.\n */\n static get hasBeenValidated() {\n return EnvironmentConfiguration._hasBeenValidated;\n }\n /**\n * An override for the common/temp folder path.\n */\n static get rushTempFolderOverride() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._rushTempFolderOverride;\n }\n /**\n * If \"1\", create symlinks with absolute paths instead of relative paths.\n * See {@link EnvironmentVariableNames.RUSH_ABSOLUTE_SYMLINKS}\n */\n static get absoluteSymlinks() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._absoluteSymlinks;\n }\n /**\n * If this environment variable is set to \"1\", the Node.js version check will print a warning\n * instead of causing a hard error if the environment's Node.js version doesn't match the\n * version specifier in `rush.json`'s \"nodeSupportedVersionRange\" property.\n *\n * See {@link EnvironmentVariableNames.RUSH_ALLOW_UNSUPPORTED_NODEJS}.\n */\n static get allowUnsupportedNodeVersion() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._allowUnsupportedNodeVersion;\n }\n /**\n * Setting this environment variable overrides the value of `allowWarningsInSuccessfulBuild`\n * in the `command-line.json` configuration file. Specify `1` to allow warnings in a successful build,\n * or `0` to disallow them. (See the comments in the command-line.json file for more information).\n */\n static get allowWarningsInSuccessfulBuild() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._allowWarningsInSuccessfulBuild;\n }\n /**\n * An override for the PNPM store path, if `pnpmStore` configuration is set to 'path'\n * See {@link EnvironmentVariableNames.RUSH_PNPM_STORE_PATH}\n */\n static get pnpmStorePathOverride() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._pnpmStorePathOverride;\n }\n /**\n * If specified, enables or disables integrity verification of the pnpm store during install.\n * See {@link EnvironmentVariableNames.RUSH_PNPM_VERIFY_STORE_INTEGRITY}\n */\n static get pnpmVerifyStoreIntegrity() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._pnpmVerifyStoreIntegrity;\n }\n /**\n * Overrides the location of the `~/.rush` global folder where Rush stores temporary files.\n * See {@link EnvironmentVariableNames.RUSH_GLOBAL_FOLDER}\n */\n static get rushGlobalFolderOverride() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._rushGlobalFolderOverride;\n }\n /**\n * Provides a credential for reading from and writing to a remote build cache, if configured.\n * See {@link EnvironmentVariableNames.RUSH_BUILD_CACHE_CREDENTIAL}\n */\n static get buildCacheCredential() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._buildCacheCredential;\n }\n /**\n * If set, enables or disables the cloud build cache feature.\n * See {@link EnvironmentVariableNames.RUSH_BUILD_CACHE_ENABLED}\n */\n static get buildCacheEnabled() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._buildCacheEnabled;\n }\n /**\n * If set, enables or disables writing to the cloud build cache.\n * See {@link EnvironmentVariableNames.RUSH_BUILD_CACHE_WRITE_ALLOWED}\n */\n static get buildCacheWriteAllowed() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._buildCacheWriteAllowed;\n }\n /**\n * If set, overrides the build cache configuration that normally lives at `common/config/rush/build-cache.json`.\n * See {@link EnvironmentVariableNames.RUSH_BUILD_CACHE_OVERRIDE_JSON}\n */\n static get buildCacheOverrideJson() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._buildCacheOverrideJson;\n }\n /**\n * If set, overrides the build cache configuration that normally lives at `common/config/rush/build-cache.json`.\n * See {@link EnvironmentVariableNames.RUSH_BUILD_CACHE_OVERRIDE_JSON_FILE_PATH}\n */\n static get buildCacheOverrideJsonFilePath() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._buildCacheOverrideJsonFilePath;\n }\n /**\n * Provides a determined cobuild context id if configured\n * See {@link EnvironmentVariableNames.RUSH_COBUILD_CONTEXT_ID}\n */\n static get cobuildContextId() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._cobuildContextId;\n }\n /**\n * Provides a determined cobuild runner id if configured\n * See {@link EnvironmentVariableNames.RUSH_COBUILD_RUNNER_ID}\n */\n static get cobuildRunnerId() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._cobuildRunnerId;\n }\n /**\n * If set, enables or disables the cobuild leaf project log only feature.\n * See {@link EnvironmentVariableNames.RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED}\n */\n static get cobuildLeafProjectLogOnlyAllowed() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._cobuildLeafProjectLogOnlyAllowed;\n }\n /**\n * Allows the git binary path to be explicitly provided.\n * See {@link EnvironmentVariableNames.RUSH_GIT_BINARY_PATH}\n */\n static get gitBinaryPath() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._gitBinaryPath;\n }\n /**\n * Allows the tar binary path to be explicitly provided.\n * See {@link EnvironmentVariableNames.RUSH_TAR_BINARY_PATH}\n */\n static get tarBinaryPath() {\n EnvironmentConfiguration._ensureValidated();\n return EnvironmentConfiguration._tarBinaryPath;\n }\n /**\n * The front-end RushVersionSelector relies on `RUSH_GLOBAL_FOLDER`, so its value must be read before\n * `EnvironmentConfiguration` is initialized (and actually before the correct version of `EnvironmentConfiguration`\n * is even installed). Thus we need to read this environment variable differently from all the others.\n * @internal\n */\n static _getRushGlobalFolderOverride(processEnv) {\n const value = processEnv[EnvironmentVariableNames.RUSH_GLOBAL_FOLDER];\n if (value) {\n const normalizedValue = EnvironmentConfiguration._normalizeDeepestParentFolderPath(value);\n return normalizedValue;\n }\n }\n /**\n * Reads and validates environment variables. If any are invalid, this function will throw.\n */\n static validate(options = {}) {\n var _a, _b, _c;\n EnvironmentConfiguration.reset();\n const unknownEnvVariables = [];\n for (const envVarName in process.env) {\n if (process.env.hasOwnProperty(envVarName) && envVarName.match(/^RUSH_/i)) {\n const value = process.env[envVarName];\n // Environment variables are only case-insensitive on Windows\n const normalizedEnvVarName = os.platform() === 'win32' ? envVarName.toUpperCase() : envVarName;\n switch (normalizedEnvVarName) {\n case EnvironmentVariableNames.RUSH_TEMP_FOLDER: {\n EnvironmentConfiguration._rushTempFolderOverride =\n value && !options.doNotNormalizePaths\n ? EnvironmentConfiguration._normalizeDeepestParentFolderPath(value) || value\n : value;\n break;\n }\n case EnvironmentVariableNames.RUSH_ABSOLUTE_SYMLINKS: {\n EnvironmentConfiguration._absoluteSymlinks =\n (_a = EnvironmentConfiguration.parseBooleanEnvironmentVariable(EnvironmentVariableNames.RUSH_ABSOLUTE_SYMLINKS, value)) !== null && _a !== void 0 ? _a : false;\n break;\n }\n case EnvironmentVariableNames.RUSH_ALLOW_UNSUPPORTED_NODEJS: {\n if (value === 'true' || value === 'false') {\n // Small, undocumented acceptance of old \"true\" and \"false\" values for\n // users of RUSH_ALLOW_UNSUPPORTED_NODEJS in rush pre-v5.46.\n EnvironmentConfiguration._allowUnsupportedNodeVersion = value === 'true';\n }\n else {\n EnvironmentConfiguration._allowUnsupportedNodeVersion =\n (_b = EnvironmentConfiguration.parseBooleanEnvironmentVariable(EnvironmentVariableNames.RUSH_ALLOW_UNSUPPORTED_NODEJS, value)) !== null && _b !== void 0 ? _b : false;\n }\n break;\n }\n case EnvironmentVariableNames.RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD: {\n EnvironmentConfiguration._allowWarningsInSuccessfulBuild =\n (_c = EnvironmentConfiguration.parseBooleanEnvironmentVariable(EnvironmentVariableNames.RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD, value)) !== null && _c !== void 0 ? _c : false;\n break;\n }\n case EnvironmentVariableNames.RUSH_PNPM_STORE_PATH: {\n EnvironmentConfiguration._pnpmStorePathOverride =\n value && !options.doNotNormalizePaths\n ? EnvironmentConfiguration._normalizeDeepestParentFolderPath(value) || value\n : value;\n break;\n }\n case EnvironmentVariableNames.RUSH_PNPM_VERIFY_STORE_INTEGRITY: {\n EnvironmentConfiguration._pnpmVerifyStoreIntegrity =\n value === '1' ? true : value === '0' ? false : undefined;\n break;\n }\n case EnvironmentVariableNames.RUSH_GLOBAL_FOLDER: {\n // Handled specially below\n break;\n }\n case EnvironmentVariableNames.RUSH_BUILD_CACHE_CREDENTIAL: {\n EnvironmentConfiguration._buildCacheCredential = value;\n break;\n }\n case EnvironmentVariableNames.RUSH_BUILD_CACHE_ENABLED: {\n EnvironmentConfiguration._buildCacheEnabled =\n EnvironmentConfiguration.parseBooleanEnvironmentVariable(EnvironmentVariableNames.RUSH_BUILD_CACHE_ENABLED, value);\n break;\n }\n case EnvironmentVariableNames.RUSH_BUILD_CACHE_WRITE_ALLOWED: {\n EnvironmentConfiguration._buildCacheWriteAllowed =\n EnvironmentConfiguration.parseBooleanEnvironmentVariable(EnvironmentVariableNames.RUSH_BUILD_CACHE_WRITE_ALLOWED, value);\n break;\n }\n case EnvironmentVariableNames.RUSH_BUILD_CACHE_OVERRIDE_JSON: {\n EnvironmentConfiguration._buildCacheOverrideJson = value;\n break;\n }\n case EnvironmentVariableNames.RUSH_BUILD_CACHE_OVERRIDE_JSON_FILE_PATH: {\n EnvironmentConfiguration._buildCacheOverrideJsonFilePath = value;\n break;\n }\n case EnvironmentVariableNames.RUSH_COBUILD_CONTEXT_ID: {\n EnvironmentConfiguration._cobuildContextId = value;\n break;\n }\n case EnvironmentVariableNames.RUSH_COBUILD_RUNNER_ID: {\n EnvironmentConfiguration._cobuildRunnerId = value;\n break;\n }\n case EnvironmentVariableNames.RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED: {\n EnvironmentConfiguration._cobuildLeafProjectLogOnlyAllowed =\n EnvironmentConfiguration.parseBooleanEnvironmentVariable(EnvironmentVariableNames.RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED, value);\n break;\n }\n case EnvironmentVariableNames.RUSH_GIT_BINARY_PATH: {\n EnvironmentConfiguration._gitBinaryPath = value;\n break;\n }\n case EnvironmentVariableNames.RUSH_TAR_BINARY_PATH: {\n EnvironmentConfiguration._tarBinaryPath = value;\n break;\n }\n case EnvironmentVariableNames.RUSH_PARALLELISM:\n case EnvironmentVariableNames.RUSH_PREVIEW_VERSION:\n case EnvironmentVariableNames.RUSH_VARIANT:\n case EnvironmentVariableNames.RUSH_DEPLOY_TARGET_FOLDER:\n // Handled by @microsoft/rush front end\n break;\n case EnvironmentVariableNames.RUSH_INVOKED_FOLDER:\n case EnvironmentVariableNames.RUSH_INVOKED_ARGS:\n case EnvironmentVariableNames._RUSH_LIB_PATH:\n // Assigned by Rush itself\n break;\n case EnvironmentVariableNames._RUSH_RECURSIVE_RUSHX_CALL:\n // Assigned/read internally by RushXCommandLine\n break;\n default:\n unknownEnvVariables.push(envVarName);\n break;\n }\n }\n }\n // This strictness intends to catch mistakes where variables are misspelled or not used correctly.\n if (unknownEnvVariables.length > 0) {\n throw new Error('The following environment variables were found with the \"RUSH_\" prefix, but they are not ' +\n `recognized by this version of Rush: ${unknownEnvVariables.join(', ')}`);\n }\n if (EnvironmentConfiguration._buildCacheOverrideJsonFilePath &&\n EnvironmentConfiguration._buildCacheOverrideJson) {\n throw new Error(`Environment variable ${EnvironmentVariableNames.RUSH_BUILD_CACHE_OVERRIDE_JSON_FILE_PATH} and ` +\n `${EnvironmentVariableNames.RUSH_BUILD_CACHE_OVERRIDE_JSON} are mutually exclusive. ` +\n `Only one may be specified.`);\n }\n // See doc comment for EnvironmentConfiguration._getRushGlobalFolderOverride().\n EnvironmentConfiguration._rushGlobalFolderOverride =\n EnvironmentConfiguration._getRushGlobalFolderOverride(process.env);\n EnvironmentConfiguration._hasBeenValidated = true;\n }\n /**\n * Resets EnvironmentConfiguration into an un-initialized state.\n */\n static reset() {\n EnvironmentConfiguration._rushTempFolderOverride = undefined;\n EnvironmentConfiguration._hasBeenValidated = false;\n }\n static _ensureValidated() {\n if (!EnvironmentConfiguration._hasBeenValidated) {\n EnvironmentConfiguration.validate();\n }\n }\n static parseBooleanEnvironmentVariable(name, value) {\n if (value === '' || value === undefined) {\n return undefined;\n }\n else if (value === '0') {\n return false;\n }\n else if (value === '1') {\n return true;\n }\n else {\n throw new Error(`Invalid value \"${value}\" for the environment variable ${name}. Valid choices are 0 or 1.`);\n }\n }\n /**\n * Given a path to a folder (that may or may not exist), normalize the path, including casing,\n * to the first existing parent folder in the path.\n *\n * If no existing path can be found (for example, if the root is a volume that doesn't exist),\n * this function returns undefined.\n *\n * @example\n * If the following path exists on disk: `C:\\Folder1\\folder2\\`\n * _normalizeFirstExistingFolderPath('c:\\\\folder1\\\\folder2\\\\temp\\\\subfolder')\n * returns 'C:\\\\Folder1\\\\folder2\\\\temp\\\\subfolder'\n */\n static _normalizeDeepestParentFolderPath(folderPath) {\n folderPath = path.normalize(folderPath);\n const endsWithSlash = folderPath.charAt(folderPath.length - 1) === path.sep;\n const parsedPath = path.parse(folderPath);\n const pathRoot = parsedPath.root;\n const pathWithoutRoot = parsedPath.dir.substr(pathRoot.length);\n const pathParts = [...pathWithoutRoot.split(path.sep), parsedPath.name].filter((part) => !!part);\n // Starting with all path sections, and eliminating one from the end during each loop iteration,\n // run trueCasePathSync. If trueCasePathSync returns without exception, we've found a subset\n // of the path that exists and we've now gotten the correct casing.\n //\n // Once we've found a parent folder that exists, append the path sections that didn't exist.\n for (let i = pathParts.length; i >= 0; i--) {\n const constructedPath = path.join(pathRoot, ...pathParts.slice(0, i));\n try {\n const normalizedConstructedPath = trueCasePathSync(constructedPath);\n const result = path.join(normalizedConstructedPath, ...pathParts.slice(i));\n if (endsWithSlash) {\n return `${result}${path.sep}`;\n }\n else {\n return result;\n }\n }\n catch (e) {\n // This path doesn't exist, continue to the next subpath\n }\n }\n return undefined;\n }\n}\nEnvironmentConfiguration._hasBeenValidated = false;\nEnvironmentConfiguration._absoluteSymlinks = false;\nEnvironmentConfiguration._allowUnsupportedNodeVersion = false;\nEnvironmentConfiguration._allowWarningsInSuccessfulBuild = false;\n//# sourceMappingURL=EnvironmentConfiguration.js.map","// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\nimport * as path from 'node:path';\nimport { User } from '@rushstack/node-core-library';\nimport { EnvironmentConfiguration } from './EnvironmentConfiguration';\n/**\n * This class provides global folders that are used for rush's internal install locations.\n *\n * @internal\n */\nexport class RushGlobalFolder {\n constructor() {\n // Because RushGlobalFolder is used by the front-end VersionSelector before EnvironmentConfiguration\n // is initialized, we need to read it using a special internal API.\n const rushGlobalFolderOverride = EnvironmentConfiguration._getRushGlobalFolderOverride(process.env);\n if (rushGlobalFolderOverride !== undefined) {\n this.path = rushGlobalFolderOverride;\n }\n else {\n this.path = path.join(User.getHomeFolder(), '.rush');\n }\n const normalizedNodeVersion = process.version.match(/^[a-z0-9\\-\\.]+$/i)\n ? process.version\n : 'unknown-version';\n this.nodeSpecificPath = path.join(this.path, `node-${normalizedNodeVersion}`);\n }\n}\n//# sourceMappingURL=RushGlobalFolder.js.map","\"use strict\";\n// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sdkContext = exports.RUSH_LIB_PATH_ENV_VAR_NAME = exports.RUSH_LIB_NAME = void 0;\nexports.tryFindRushJsonLocation = tryFindRushJsonLocation;\nexports._require = _require;\nexports.requireRushLibUnderFolderPath = requireRushLibUnderFolderPath;\nconst path = __importStar(require(\"node:path\"));\nconst node_core_library_1 = require(\"@rushstack/node-core-library\");\nexports.RUSH_LIB_NAME = '@microsoft/rush-lib';\nexports.RUSH_LIB_PATH_ENV_VAR_NAME = '_RUSH_LIB_PATH';\nexports.sdkContext = {\n rushLibModule: undefined\n};\n/**\n * Find the rush.json location and return the path, or undefined if a rush.json can't be found.\n *\n * @privateRemarks\n * Keep this in sync with `RushConfiguration.tryFindRushJsonLocation`.\n */\nfunction tryFindRushJsonLocation(startingFolder) {\n let currentFolder = startingFolder;\n // Look upwards at parent folders until we find a folder containing rush.json\n for (let i = 0; i < 10; ++i) {\n const rushJsonFilename = path.join(currentFolder, 'rush.json');\n if (node_core_library_1.FileSystem.exists(rushJsonFilename)) {\n return rushJsonFilename;\n }\n const parentFolder = path.dirname(currentFolder);\n if (parentFolder === currentFolder) {\n break;\n }\n currentFolder = parentFolder;\n }\n return undefined;\n}\nfunction _require(moduleName) {\n if (typeof __non_webpack_require__ === 'function') {\n // If this library has been bundled with Webpack, we need to call the real `require` function\n // that doesn't get turned into a `__webpack_require__` statement.\n // `__non_webpack_require__` is a Webpack macro that gets turned into a `require` statement\n // during bundling.\n return __non_webpack_require__(moduleName);\n }\n else {\n return require(moduleName);\n }\n}\n/**\n * Require `@microsoft/rush-lib` under the specified folder path.\n */\nfunction requireRushLibUnderFolderPath(folderPath) {\n const rushLibModulePath = node_core_library_1.Import.resolveModule({\n modulePath: exports.RUSH_LIB_NAME,\n baseFolderPath: folderPath\n });\n return _require(rushLibModulePath);\n}\n//# sourceMappingURL=helpers.js.map","\"use strict\";\n// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._rushSdk_loadInternalModule = _rushSdk_loadInternalModule;\nconst path = __importStar(require(\"node:path\"));\nconst node_core_library_1 = require(\"@rushstack/node-core-library\");\nconst terminal_1 = require(\"@rushstack/terminal\");\nconst RushGlobalFolder_1 = require(\"@microsoft/rush-lib/lib-esnext/api/RushGlobalFolder\");\nconst helpers_1 = require(\"./helpers\");\nconst verboseEnabled = typeof process !== 'undefined' &&\n (process.env.RUSH_SDK_DEBUG === '1' || process.env._RUSH_SDK_DEBUG === '1');\nconst terminal = new terminal_1.Terminal(new terminal_1.ConsoleTerminalProvider({\n verboseEnabled\n}));\nlet errorMessage = '';\n// SCENARIO 1: Rush's PluginManager has initialized \"rush-sdk\" with Rush's own instance of rush-lib.\n// The Rush host process will assign \"global.___rush___rushLibModule\" before loading the plugin.\nif (helpers_1.sdkContext.rushLibModule === undefined) {\n helpers_1.sdkContext.rushLibModule =\n global.___rush___rushLibModule ||\n global.___rush___rushLibModuleFromEnvironment ||\n global.___rush___rushLibModuleFromRushGlobalFolder ||\n global.___rush___rushLibModuleFromInstallAndRunRush;\n}\n// SCENARIO 2: The project importing \"rush-sdk\" has installed its own instance of \"rush-lib\"\n// as a package.json dependency. For example, this is used by the Jest tests for Rush plugins.\nif (helpers_1.sdkContext.rushLibModule === undefined) {\n const importingPath = (_a = module === null || module === void 0 ? void 0 : module.parent) === null || _a === void 0 ? void 0 : _a.filename;\n if (importingPath) {\n const callerPackageFolder = node_core_library_1.PackageJsonLookup.instance.tryGetPackageFolderFor(importingPath);\n if (callerPackageFolder !== undefined) {\n const callerPackageJson = (0, helpers_1._require)(path.join(callerPackageFolder, 'package.json'));\n // Does the caller properly declare a dependency on rush-lib?\n if ((callerPackageJson.dependencies && callerPackageJson.dependencies[helpers_1.RUSH_LIB_NAME] !== undefined) ||\n (callerPackageJson.devDependencies &&\n callerPackageJson.devDependencies[helpers_1.RUSH_LIB_NAME] !== undefined) ||\n (callerPackageJson.peerDependencies &&\n callerPackageJson.peerDependencies[helpers_1.RUSH_LIB_NAME] !== undefined)) {\n // Try to resolve rush-lib from the caller's folder\n terminal.writeVerboseLine(`Try to load ${helpers_1.RUSH_LIB_NAME} from caller package`);\n try {\n helpers_1.sdkContext.rushLibModule = (0, helpers_1.requireRushLibUnderFolderPath)(callerPackageFolder);\n }\n catch (error) {\n // If we fail to resolve it, ignore the error\n terminal.writeVerboseLine(`Failed to load ${helpers_1.RUSH_LIB_NAME} from caller package`);\n }\n // If two different libraries invoke `rush-sdk`, and one of them provides \"rush-lib\"\n // then the first version to be loaded wins. We do not support side-by-side instances of \"rush-lib\".\n if (helpers_1.sdkContext.rushLibModule !== undefined) {\n // to track which scenario is active and how it got initialized.\n global.___rush___rushLibModule = helpers_1.sdkContext.rushLibModule;\n terminal.writeVerboseLine(`Loaded ${helpers_1.RUSH_LIB_NAME} from caller`);\n }\n }\n }\n }\n}\n// SCENARIO 3: A tool or script has been invoked as a child process by an instance of \"rush-lib\" and can use the\n// version that invoked it. In this case, use process.env._RUSH_LIB_PATH to find \"rush-lib\".\nif (helpers_1.sdkContext.rushLibModule === undefined) {\n const rushLibPath = process.env[helpers_1.RUSH_LIB_PATH_ENV_VAR_NAME];\n if (rushLibPath) {\n terminal.writeVerboseLine(`Try to load ${helpers_1.RUSH_LIB_NAME} from process.env.${helpers_1.RUSH_LIB_PATH_ENV_VAR_NAME} from caller package`);\n try {\n helpers_1.sdkContext.rushLibModule = (0, helpers_1._require)(rushLibPath);\n }\n catch (error) {\n // Log this as a warning, since it is unexpected to define an incorrect value of the variable.\n terminal.writeWarningLine(`Failed to load ${helpers_1.RUSH_LIB_NAME} via process.env.${helpers_1.RUSH_LIB_PATH_ENV_VAR_NAME}`);\n }\n if (helpers_1.sdkContext.rushLibModule !== undefined) {\n // to track which scenario is active and how it got initialized.\n global.___rush___rushLibModuleFromEnvironment = helpers_1.sdkContext.rushLibModule;\n terminal.writeVerboseLine(`Loaded ${helpers_1.RUSH_LIB_NAME} from process.env.${helpers_1.RUSH_LIB_PATH_ENV_VAR_NAME}`);\n }\n }\n}\n// SCENARIO 4: A standalone tool or script depends on \"rush-sdk\", and is meant to be used inside a monorepo folder.\n// In this case, we can first load the rush-lib version in rush global folder. If the expected version is not installed,\n// using install-run-rush.js to obtain the appropriate rush-lib version for the monorepo.\nif (helpers_1.sdkContext.rushLibModule === undefined) {\n try {\n const rushJsonPath = (0, helpers_1.tryFindRushJsonLocation)(process.cwd());\n if (!rushJsonPath) {\n throw new Error('Unable to find rush.json in the current folder or its parent folders.\\n' +\n 'This tool is meant to be invoked from a working directory inside a Rush repository.');\n }\n const monorepoRoot = path.dirname(rushJsonPath);\n const rushJson = node_core_library_1.JsonFile.load(rushJsonPath);\n const { rushVersion } = rushJson;\n try {\n terminal.writeVerboseLine(`Try to load ${helpers_1.RUSH_LIB_NAME} from rush global folder`);\n const rushGlobalFolder = new RushGlobalFolder_1.RushGlobalFolder();\n // The path needs to keep align with the logic inside RushVersionSelector\n const expectedGlobalRushInstalledFolder = `${rushGlobalFolder.nodeSpecificPath}/rush-${rushVersion}`;\n terminal.writeVerboseLine(`The expected global rush installed folder is \"${expectedGlobalRushInstalledFolder}\"`);\n helpers_1.sdkContext.rushLibModule = (0, helpers_1.requireRushLibUnderFolderPath)(expectedGlobalRushInstalledFolder);\n }\n catch (e) {\n terminal.writeVerboseLine(`Failed to load ${helpers_1.RUSH_LIB_NAME} from rush global folder: ${e.message}`);\n }\n if (helpers_1.sdkContext.rushLibModule !== undefined) {\n // to track which scenario is active and how it got initialized.\n global.___rush___rushLibModuleFromRushGlobalFolder = helpers_1.sdkContext.rushLibModule;\n terminal.writeVerboseLine(`Loaded ${helpers_1.RUSH_LIB_NAME} installed from rush global folder`);\n }\n else {\n const installRunNodeModuleFolder = `${monorepoRoot}/common/temp/install-run/@microsoft+rush@${rushVersion}`;\n try {\n // First, try to load the version of \"rush-lib\" that was installed by install-run-rush.js\n terminal.writeVerboseLine(`Trying to load ${helpers_1.RUSH_LIB_NAME} installed by install-run-rush`);\n helpers_1.sdkContext.rushLibModule = (0, helpers_1.requireRushLibUnderFolderPath)(installRunNodeModuleFolder);\n }\n catch (e1) {\n let installAndRunRushStderrContent = '';\n try {\n const installAndRunRushJSPath = `${monorepoRoot}/common/scripts/install-run-rush.js`;\n terminal.writeLine('The Rush engine has not been installed yet. Invoking install-run-rush.js...');\n const installAndRunRushProcess = node_core_library_1.Executable.spawnSync('node', [installAndRunRushJSPath, '--help'], {\n stdio: 'pipe'\n });\n installAndRunRushStderrContent = installAndRunRushProcess.stderr;\n if (installAndRunRushProcess.status !== 0) {\n throw new Error(`The ${helpers_1.RUSH_LIB_NAME} package failed to install`);\n }\n // Retry to load \"rush-lib\" after install-run-rush run\n terminal.writeVerboseLine(`Trying to load ${helpers_1.RUSH_LIB_NAME} installed by install-run-rush a second time`);\n helpers_1.sdkContext.rushLibModule = (0, helpers_1.requireRushLibUnderFolderPath)(installRunNodeModuleFolder);\n }\n catch (e2) {\n // eslint-disable-next-line no-console\n console.error(`${installAndRunRushStderrContent}`);\n throw new Error(`The ${helpers_1.RUSH_LIB_NAME} package failed to load`);\n }\n }\n if (helpers_1.sdkContext.rushLibModule !== undefined) {\n // to track which scenario is active and how it got initialized.\n global.___rush___rushLibModuleFromInstallAndRunRush = helpers_1.sdkContext.rushLibModule;\n terminal.writeVerboseLine(`Loaded ${helpers_1.RUSH_LIB_NAME} installed by install-run-rush`);\n }\n }\n }\n catch (e) {\n // no-catch\n errorMessage = e.message;\n }\n}\nif (helpers_1.sdkContext.rushLibModule === undefined) {\n // This error indicates that a project is trying to import \"@rushstack/rush-sdk\", but the Rush engine\n // instance cannot be found. If you are writing Jest tests for a Rush plugin, add \"@microsoft/rush-lib\"\n // to the devDependencies for your project.\n // eslint-disable-next-line no-console\n console.error(`Error: The @rushstack/rush-sdk package was not able to load the Rush engine:\n${errorMessage}\n`);\n process.exit(1);\n}\n// Based on TypeScript's __exportStar()\nfor (const property in helpers_1.sdkContext.rushLibModule) {\n if (property !== 'default' && !exports.hasOwnProperty(property)) {\n const rushLibModuleForClosure = helpers_1.sdkContext.rushLibModule;\n // Based on TypeScript's __createBinding()\n Object.defineProperty(exports, property, {\n enumerable: true,\n get: function () {\n return rushLibModuleForClosure[property];\n }\n });\n }\n}\n/**\n * Used by the .js stubs for path-based imports of `@microsoft/rush-lib` internal APIs.\n */\nfunction _rushSdk_loadInternalModule(srcImportPath) {\n if (!exports._RushInternals) {\n throw new Error(`Rush version ${exports.Rush.version} does not support internal API imports via rush-sdk`);\n }\n return exports._RushInternals.loadModule(srcImportPath);\n}\n//# sourceMappingURL=index.js.map","module.exports = require(\"@rushstack/node-core-library\");","module.exports = require(\"@rushstack/terminal\");","module.exports = require(\"fs\");","module.exports = require(\"node:path\");","module.exports = require(\"os\");","module.exports = require(\"path\");","module.exports = require(\"util\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./lib-commonjs/index.js\");\n",""],"names":[],"ignoreList":[],"sourceRoot":""}
@@ -1 +1 @@
1
- {"version":3,"file":"loader.js","mappings":";;;;;;;;;;AAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA,0CAA0C,4BAA4B;AACtE,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,cAAc;AACzE;AACA;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,kBAAkB,GAAG,kCAAkC,GAAG,qBAAqB;AAC/E,+BAA+B;AAC/B,gBAAgB;AAChB,qCAAqC;AACrC,0BAA0B,mBAAO,CAAC,4BAAW;AAC7C,4BAA4B,mBAAO,CAAC,kEAA8B;AAClE,qBAAqB;AACrB,kCAAkC;AAClC,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAuB;AACtC;AACA;AACA;AACA;AACA,eAAe,OAAuB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;;;;AC5Fa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA,0CAA0C,4BAA4B;AACtE,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,cAAc;AACzE;AACA;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,qBAAqB;AACrB;AACA,0BAA0B,mBAAO,CAAC,4BAAW;AAC7C,4BAA4B,mBAAO,CAAC,kEAA8B;AAClE,kBAAkB,mBAAO,CAAC,4CAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,8BAA8B;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,uBAAuB,qBAAqB;AAC5C;AACA;AACA;AACA,oBAAoB,cAAc;AAClC,kHAAkH,YAAY;AAC9H;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,yBAAyB;AAC9E,yBAAyB;AACzB;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,+CAA+C,yBAAyB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,yBAAyB;AAClF,6BAA6B;AAC7B;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,+BAA+B;AACpE,2CAA2C,yBAAyB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,yBAAyB;AACrE,yBAAyB;AACzB;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;;;;;;;;;AC1MA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;UEtBA;UACA;UACA;UACA","sources":["webpack://@rushstack/rush-sdk/./lib-commonjs/helpers.js","webpack://@rushstack/rush-sdk/./lib-commonjs/loader.js","webpack://@rushstack/rush-sdk/external commonjs \"@rushstack/node-core-library\"","webpack://@rushstack/rush-sdk/external node-commonjs \"node:path\"","webpack://@rushstack/rush-sdk/webpack/bootstrap","webpack://@rushstack/rush-sdk/webpack/before-startup","webpack://@rushstack/rush-sdk/webpack/startup","webpack://@rushstack/rush-sdk/webpack/after-startup"],"sourcesContent":["\"use strict\";\n// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sdkContext = exports.RUSH_LIB_PATH_ENV_VAR_NAME = exports.RUSH_LIB_NAME = void 0;\nexports.tryFindRushJsonLocation = tryFindRushJsonLocation;\nexports._require = _require;\nexports.requireRushLibUnderFolderPath = requireRushLibUnderFolderPath;\nconst path = __importStar(require(\"node:path\"));\nconst node_core_library_1 = require(\"@rushstack/node-core-library\");\nexports.RUSH_LIB_NAME = '@microsoft/rush-lib';\nexports.RUSH_LIB_PATH_ENV_VAR_NAME = '_RUSH_LIB_PATH';\nexports.sdkContext = {\n rushLibModule: undefined\n};\n/**\n * Find the rush.json location and return the path, or undefined if a rush.json can't be found.\n *\n * @privateRemarks\n * Keep this in sync with `RushConfiguration.tryFindRushJsonLocation`.\n */\nfunction tryFindRushJsonLocation(startingFolder) {\n let currentFolder = startingFolder;\n // Look upwards at parent folders until we find a folder containing rush.json\n for (let i = 0; i < 10; ++i) {\n const rushJsonFilename = path.join(currentFolder, 'rush.json');\n if (node_core_library_1.FileSystem.exists(rushJsonFilename)) {\n return rushJsonFilename;\n }\n const parentFolder = path.dirname(currentFolder);\n if (parentFolder === currentFolder) {\n break;\n }\n currentFolder = parentFolder;\n }\n return undefined;\n}\nfunction _require(moduleName) {\n if (typeof __non_webpack_require__ === 'function') {\n // If this library has been bundled with Webpack, we need to call the real `require` function\n // that doesn't get turned into a `__webpack_require__` statement.\n // `__non_webpack_require__` is a Webpack macro that gets turned into a `require` statement\n // during bundling.\n return __non_webpack_require__(moduleName);\n }\n else {\n return require(moduleName);\n }\n}\n/**\n * Require `@microsoft/rush-lib` under the specified folder path.\n */\nfunction requireRushLibUnderFolderPath(folderPath) {\n const rushLibModulePath = node_core_library_1.Import.resolveModule({\n modulePath: exports.RUSH_LIB_NAME,\n baseFolderPath: folderPath\n });\n return _require(rushLibModulePath);\n}\n//# sourceMappingURL=helpers.js.map","\"use strict\";\n// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RushSdkLoader = void 0;\n/// <reference types=\"node\" preserve=\"true\" />\nconst path = __importStar(require(\"node:path\"));\nconst node_core_library_1 = require(\"@rushstack/node-core-library\");\nconst helpers_1 = require(\"./helpers\");\n/**\n * Exposes operations that control how the `@microsoft/rush-lib` engine is\n * located and loaded.\n * @public\n */\nclass RushSdkLoader {\n /**\n * Throws an \"AbortError\" exception if abortSignal.aborted is true.\n */\n static _checkForCancel(abortSignal, onNotifyEvent, progressPercent) {\n if (!(abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted)) {\n return;\n }\n if (onNotifyEvent) {\n onNotifyEvent({\n logMessage: {\n kind: 'info',\n text: `The operation was canceled`\n },\n progressPercent\n });\n }\n const error = new Error('The operation was canceled');\n error.name = 'AbortError';\n throw error;\n }\n /**\n * Returns true if the Rush engine has already been loaded.\n */\n static get isLoaded() {\n return helpers_1.sdkContext.rushLibModule !== undefined;\n }\n /**\n * Manually load the Rush engine based on rush.json found for `rushJsonSearchFolder`.\n * Throws an exception if {@link RushSdkLoader.isLoaded} is already `true`.\n *\n * @remarks\n * This API supports an callback that can be used display a progress bar,\n * log of operations, and allow the operation to be canceled prematurely.\n */\n static async loadAsync(options) {\n // SCENARIO 5: The rush-lib engine is loaded manually using rushSdkLoader.loadAsync().\n var _a, _b;\n if (!options) {\n options = {};\n }\n if (RushSdkLoader.isLoaded) {\n throw new Error('RushSdkLoader.loadAsync() failed because the Rush engine has already been loaded');\n }\n const onNotifyEvent = options.onNotifyEvent;\n let progressPercent = undefined;\n const abortSignal = options.abortSignal;\n try {\n const rushJsonSearchFolder = (_a = options.rushJsonSearchFolder) !== null && _a !== void 0 ? _a : process.cwd();\n if (onNotifyEvent) {\n onNotifyEvent({\n logMessage: {\n kind: 'debug',\n text: `Searching for rush.json starting from: ` + rushJsonSearchFolder\n },\n progressPercent\n });\n }\n const rushJsonPath = (0, helpers_1.tryFindRushJsonLocation)(rushJsonSearchFolder);\n if (!rushJsonPath) {\n throw new Error('Unable to find rush.json in the specified folder or its parent folders:\\n' +\n `${rushJsonSearchFolder}\\n`);\n }\n const monorepoRoot = path.dirname(rushJsonPath);\n const rushJson = await node_core_library_1.JsonFile.loadAsync(rushJsonPath);\n const { rushVersion } = rushJson;\n const installRunNodeModuleFolder = path.join(monorepoRoot, `common/temp/install-run/@microsoft+rush@${rushVersion}`);\n try {\n // First, try to load the version of \"rush-lib\" that was installed by install-run-rush.js\n if (onNotifyEvent) {\n onNotifyEvent({\n logMessage: {\n kind: 'info',\n text: `Trying to load ${helpers_1.RUSH_LIB_NAME} installed by install-run-rush`\n },\n progressPercent\n });\n }\n helpers_1.sdkContext.rushLibModule = (0, helpers_1.requireRushLibUnderFolderPath)(installRunNodeModuleFolder);\n }\n catch (e1) {\n let installAndRunRushStderrContent = '';\n try {\n const installAndRunRushJSPath = path.join(monorepoRoot, 'common/scripts/install-run-rush.js');\n if (onNotifyEvent) {\n onNotifyEvent({\n logMessage: {\n kind: 'info',\n text: 'The Rush engine has not been installed yet. Invoking install-run-rush.js...'\n },\n progressPercent\n });\n }\n // Start the installation\n progressPercent = 0;\n const installAndRunRushProcess = node_core_library_1.Executable.spawnSync('node', [installAndRunRushJSPath, '--help'], {\n stdio: 'pipe'\n });\n installAndRunRushStderrContent = installAndRunRushProcess.stderr;\n if (installAndRunRushProcess.status !== 0) {\n throw new Error(`The ${helpers_1.RUSH_LIB_NAME} package failed to install`);\n }\n if (abortSignal) {\n RushSdkLoader._checkForCancel(abortSignal, onNotifyEvent, progressPercent);\n }\n // TODO: Implement incremental progress updates\n progressPercent = 90;\n // Retry to load \"rush-lib\" after install-run-rush run\n if (onNotifyEvent) {\n onNotifyEvent({\n logMessage: {\n kind: 'debug',\n text: `Trying to load ${helpers_1.RUSH_LIB_NAME} installed by install-run-rush a second time`\n },\n progressPercent\n });\n }\n helpers_1.sdkContext.rushLibModule = (0, helpers_1.requireRushLibUnderFolderPath)(installRunNodeModuleFolder);\n progressPercent = 100;\n }\n catch (e2) {\n // eslint-disable-next-line no-console\n console.error(`${installAndRunRushStderrContent}`);\n throw new Error(`The ${helpers_1.RUSH_LIB_NAME} package failed to load`);\n }\n }\n if (helpers_1.sdkContext.rushLibModule !== undefined) {\n // to track which scenario is active and how it got initialized.\n global.___rush___rushLibModuleFromInstallAndRunRush = helpers_1.sdkContext.rushLibModule;\n if (onNotifyEvent) {\n onNotifyEvent({\n logMessage: {\n kind: 'debug',\n text: `Loaded ${helpers_1.RUSH_LIB_NAME} installed by install-run-rush`\n },\n progressPercent\n });\n }\n }\n }\n catch (e) {\n if (onNotifyEvent) {\n onNotifyEvent({\n logMessage: {\n kind: 'info',\n text: 'The operation failed: ' + ((_b = e.message) !== null && _b !== void 0 ? _b : 'An unknown error occurred')\n },\n progressPercent\n });\n }\n throw e;\n }\n }\n}\nexports.RushSdkLoader = RushSdkLoader;\n//# sourceMappingURL=loader.js.map","module.exports = require(\"@rushstack/node-core-library\");","module.exports = require(\"node:path\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./lib-commonjs/loader.js\");\n",""],"names":[],"sourceRoot":""}
1
+ {"version":3,"file":"loader.js","mappings":";;;;;;;;;;AAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA,0CAA0C,4BAA4B;AACtE,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,cAAc;AACzE;AACA;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,kBAAkB,GAAG,kCAAkC,GAAG,qBAAqB;AAC/E,+BAA+B;AAC/B,gBAAgB;AAChB,qCAAqC;AACrC,0BAA0B,mBAAO,CAAC,4BAAW;AAC7C,4BAA4B,mBAAO,CAAC,kEAA8B;AAClE,qBAAqB;AACrB,kCAAkC;AAClC,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAuB;AACtC;AACA;AACA;AACA;AACA,eAAe,OAAuB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,mC;;;;;;;;;;AC5Fa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA,0CAA0C,4BAA4B;AACtE,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,cAAc;AACzE;AACA;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,qBAAqB;AACrB;AACA,0BAA0B,mBAAO,CAAC,4BAAW;AAC7C,4BAA4B,mBAAO,CAAC,kEAA8B;AAClE,kBAAkB,mBAAO,CAAC,4CAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,8BAA8B;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,uBAAuB,qBAAqB;AAC5C;AACA;AACA;AACA,oBAAoB,cAAc;AAClC,kHAAkH,YAAY;AAC9H;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,yBAAyB;AAC9E,yBAAyB;AACzB;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,+CAA+C,yBAAyB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,yBAAyB;AAClF,6BAA6B;AAC7B;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,+BAA+B;AACpE,2CAA2C,yBAAyB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,yBAAyB;AACrE,yBAAyB;AACzB;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,kC;;;;;;;;;;AC1MA,yD;;;;;;;;;;ACAA,sC;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;UEtBA;UACA;UACA;UACA","sources":["webpack://@rushstack/rush-sdk/./lib-commonjs/helpers.js","webpack://@rushstack/rush-sdk/./lib-commonjs/loader.js","webpack://@rushstack/rush-sdk/external commonjs \"@rushstack/node-core-library\"","webpack://@rushstack/rush-sdk/external node-commonjs \"node:path\"","webpack://@rushstack/rush-sdk/webpack/bootstrap","webpack://@rushstack/rush-sdk/webpack/before-startup","webpack://@rushstack/rush-sdk/webpack/startup","webpack://@rushstack/rush-sdk/webpack/after-startup"],"sourcesContent":["\"use strict\";\n// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sdkContext = exports.RUSH_LIB_PATH_ENV_VAR_NAME = exports.RUSH_LIB_NAME = void 0;\nexports.tryFindRushJsonLocation = tryFindRushJsonLocation;\nexports._require = _require;\nexports.requireRushLibUnderFolderPath = requireRushLibUnderFolderPath;\nconst path = __importStar(require(\"node:path\"));\nconst node_core_library_1 = require(\"@rushstack/node-core-library\");\nexports.RUSH_LIB_NAME = '@microsoft/rush-lib';\nexports.RUSH_LIB_PATH_ENV_VAR_NAME = '_RUSH_LIB_PATH';\nexports.sdkContext = {\n rushLibModule: undefined\n};\n/**\n * Find the rush.json location and return the path, or undefined if a rush.json can't be found.\n *\n * @privateRemarks\n * Keep this in sync with `RushConfiguration.tryFindRushJsonLocation`.\n */\nfunction tryFindRushJsonLocation(startingFolder) {\n let currentFolder = startingFolder;\n // Look upwards at parent folders until we find a folder containing rush.json\n for (let i = 0; i < 10; ++i) {\n const rushJsonFilename = path.join(currentFolder, 'rush.json');\n if (node_core_library_1.FileSystem.exists(rushJsonFilename)) {\n return rushJsonFilename;\n }\n const parentFolder = path.dirname(currentFolder);\n if (parentFolder === currentFolder) {\n break;\n }\n currentFolder = parentFolder;\n }\n return undefined;\n}\nfunction _require(moduleName) {\n if (typeof __non_webpack_require__ === 'function') {\n // If this library has been bundled with Webpack, we need to call the real `require` function\n // that doesn't get turned into a `__webpack_require__` statement.\n // `__non_webpack_require__` is a Webpack macro that gets turned into a `require` statement\n // during bundling.\n return __non_webpack_require__(moduleName);\n }\n else {\n return require(moduleName);\n }\n}\n/**\n * Require `@microsoft/rush-lib` under the specified folder path.\n */\nfunction requireRushLibUnderFolderPath(folderPath) {\n const rushLibModulePath = node_core_library_1.Import.resolveModule({\n modulePath: exports.RUSH_LIB_NAME,\n baseFolderPath: folderPath\n });\n return _require(rushLibModulePath);\n}\n//# sourceMappingURL=helpers.js.map","\"use strict\";\n// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RushSdkLoader = void 0;\n/// <reference types=\"node\" preserve=\"true\" />\nconst path = __importStar(require(\"node:path\"));\nconst node_core_library_1 = require(\"@rushstack/node-core-library\");\nconst helpers_1 = require(\"./helpers\");\n/**\n * Exposes operations that control how the `@microsoft/rush-lib` engine is\n * located and loaded.\n * @public\n */\nclass RushSdkLoader {\n /**\n * Throws an \"AbortError\" exception if abortSignal.aborted is true.\n */\n static _checkForCancel(abortSignal, onNotifyEvent, progressPercent) {\n if (!(abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted)) {\n return;\n }\n if (onNotifyEvent) {\n onNotifyEvent({\n logMessage: {\n kind: 'info',\n text: `The operation was canceled`\n },\n progressPercent\n });\n }\n const error = new Error('The operation was canceled');\n error.name = 'AbortError';\n throw error;\n }\n /**\n * Returns true if the Rush engine has already been loaded.\n */\n static get isLoaded() {\n return helpers_1.sdkContext.rushLibModule !== undefined;\n }\n /**\n * Manually load the Rush engine based on rush.json found for `rushJsonSearchFolder`.\n * Throws an exception if {@link RushSdkLoader.isLoaded} is already `true`.\n *\n * @remarks\n * This API supports an callback that can be used display a progress bar,\n * log of operations, and allow the operation to be canceled prematurely.\n */\n static async loadAsync(options) {\n // SCENARIO 5: The rush-lib engine is loaded manually using rushSdkLoader.loadAsync().\n var _a, _b;\n if (!options) {\n options = {};\n }\n if (RushSdkLoader.isLoaded) {\n throw new Error('RushSdkLoader.loadAsync() failed because the Rush engine has already been loaded');\n }\n const onNotifyEvent = options.onNotifyEvent;\n let progressPercent = undefined;\n const abortSignal = options.abortSignal;\n try {\n const rushJsonSearchFolder = (_a = options.rushJsonSearchFolder) !== null && _a !== void 0 ? _a : process.cwd();\n if (onNotifyEvent) {\n onNotifyEvent({\n logMessage: {\n kind: 'debug',\n text: `Searching for rush.json starting from: ` + rushJsonSearchFolder\n },\n progressPercent\n });\n }\n const rushJsonPath = (0, helpers_1.tryFindRushJsonLocation)(rushJsonSearchFolder);\n if (!rushJsonPath) {\n throw new Error('Unable to find rush.json in the specified folder or its parent folders:\\n' +\n `${rushJsonSearchFolder}\\n`);\n }\n const monorepoRoot = path.dirname(rushJsonPath);\n const rushJson = await node_core_library_1.JsonFile.loadAsync(rushJsonPath);\n const { rushVersion } = rushJson;\n const installRunNodeModuleFolder = path.join(monorepoRoot, `common/temp/install-run/@microsoft+rush@${rushVersion}`);\n try {\n // First, try to load the version of \"rush-lib\" that was installed by install-run-rush.js\n if (onNotifyEvent) {\n onNotifyEvent({\n logMessage: {\n kind: 'info',\n text: `Trying to load ${helpers_1.RUSH_LIB_NAME} installed by install-run-rush`\n },\n progressPercent\n });\n }\n helpers_1.sdkContext.rushLibModule = (0, helpers_1.requireRushLibUnderFolderPath)(installRunNodeModuleFolder);\n }\n catch (e1) {\n let installAndRunRushStderrContent = '';\n try {\n const installAndRunRushJSPath = path.join(monorepoRoot, 'common/scripts/install-run-rush.js');\n if (onNotifyEvent) {\n onNotifyEvent({\n logMessage: {\n kind: 'info',\n text: 'The Rush engine has not been installed yet. Invoking install-run-rush.js...'\n },\n progressPercent\n });\n }\n // Start the installation\n progressPercent = 0;\n const installAndRunRushProcess = node_core_library_1.Executable.spawnSync('node', [installAndRunRushJSPath, '--help'], {\n stdio: 'pipe'\n });\n installAndRunRushStderrContent = installAndRunRushProcess.stderr;\n if (installAndRunRushProcess.status !== 0) {\n throw new Error(`The ${helpers_1.RUSH_LIB_NAME} package failed to install`);\n }\n if (abortSignal) {\n RushSdkLoader._checkForCancel(abortSignal, onNotifyEvent, progressPercent);\n }\n // TODO: Implement incremental progress updates\n progressPercent = 90;\n // Retry to load \"rush-lib\" after install-run-rush run\n if (onNotifyEvent) {\n onNotifyEvent({\n logMessage: {\n kind: 'debug',\n text: `Trying to load ${helpers_1.RUSH_LIB_NAME} installed by install-run-rush a second time`\n },\n progressPercent\n });\n }\n helpers_1.sdkContext.rushLibModule = (0, helpers_1.requireRushLibUnderFolderPath)(installRunNodeModuleFolder);\n progressPercent = 100;\n }\n catch (e2) {\n // eslint-disable-next-line no-console\n console.error(`${installAndRunRushStderrContent}`);\n throw new Error(`The ${helpers_1.RUSH_LIB_NAME} package failed to load`);\n }\n }\n if (helpers_1.sdkContext.rushLibModule !== undefined) {\n // to track which scenario is active and how it got initialized.\n global.___rush___rushLibModuleFromInstallAndRunRush = helpers_1.sdkContext.rushLibModule;\n if (onNotifyEvent) {\n onNotifyEvent({\n logMessage: {\n kind: 'debug',\n text: `Loaded ${helpers_1.RUSH_LIB_NAME} installed by install-run-rush`\n },\n progressPercent\n });\n }\n }\n }\n catch (e) {\n if (onNotifyEvent) {\n onNotifyEvent({\n logMessage: {\n kind: 'info',\n text: 'The operation failed: ' + ((_b = e.message) !== null && _b !== void 0 ? _b : 'An unknown error occurred')\n },\n progressPercent\n });\n }\n throw e;\n }\n }\n}\nexports.RushSdkLoader = RushSdkLoader;\n//# sourceMappingURL=loader.js.map","module.exports = require(\"@rushstack/node-core-library\");","module.exports = require(\"node:path\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./lib-commonjs/loader.js\");\n",""],"names":[],"ignoreList":[],"sourceRoot":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rushstack/rush-sdk",
3
- "version": "5.164.0",
3
+ "version": "5.165.0-pr5496.0",
4
4
  "description": "An API for interacting with the Rush engine",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,26 +34,26 @@
34
34
  },
35
35
  "license": "MIT",
36
36
  "dependencies": {
37
- "@pnpm/lockfile.types": "~1.0.3",
37
+ "@pnpm/lockfile.types-900": "npm:@pnpm/lockfile.types@~900.0.0",
38
38
  "tapable": "2.2.1",
39
- "@rushstack/lookup-by-path": "0.8.9",
40
39
  "@rushstack/credential-cache": "0.1.4",
41
- "@rushstack/package-deps-hash": "4.6.0",
40
+ "@rushstack/lookup-by-path": "0.8.9",
41
+ "@rushstack/node-core-library": "5.19.1",
42
42
  "@rushstack/terminal": "0.19.5",
43
- "@rushstack/node-core-library": "5.19.1"
43
+ "@rushstack/package-deps-hash": "4.6.1"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/semver": "7.5.0",
47
47
  "@types/webpack-env": "1.18.8",
48
48
  "eslint": "~9.37.0",
49
- "webpack": "~5.98.0",
50
- "@rushstack/heft": "1.1.7",
51
- "@microsoft/rush-lib": "5.164.0",
49
+ "webpack": "~5.103.0",
50
+ "@microsoft/rush-lib": "5.165.0-pr5496.0",
52
51
  "@rushstack/heft-webpack5-plugin": "1.2.7",
53
52
  "@rushstack/stream-collator": "4.1.119",
54
- "@rushstack/webpack-preserve-dynamic-require-plugin": "0.11.118",
53
+ "local-node-rig": "1.0.0",
54
+ "@rushstack/heft": "1.1.7",
55
55
  "@rushstack/ts-command-line": "5.1.5",
56
- "local-node-rig": "1.0.0"
56
+ "@rushstack/webpack-preserve-dynamic-require-plugin": "0.11.118"
57
57
  },
58
58
  "scripts": {
59
59
  "build": "heft build --clean",