@rushstack/rush-sdk 5.96.0 → 5.97.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rush-lib.d.ts +20 -20
- package/lib/api/EnvironmentConfiguration.d.ts +20 -20
- package/lib-shim/index.d.ts.map +1 -1
- package/lib-shim/index.js +5 -5
- package/lib-shim/index.js.map +1 -1
- package/package.json +5 -5
package/dist/rush-lib.d.ts
CHANGED
|
@@ -440,7 +440,7 @@ export declare class EnvironmentConfiguration {
|
|
|
440
440
|
* Names of environment variables used by Rush.
|
|
441
441
|
* @beta
|
|
442
442
|
*/
|
|
443
|
-
export declare
|
|
443
|
+
export declare const EnvironmentVariableNames: {
|
|
444
444
|
/**
|
|
445
445
|
* This variable overrides the temporary folder used by Rush.
|
|
446
446
|
* The default value is "common/temp" under the repository root.
|
|
@@ -448,43 +448,43 @@ export declare enum EnvironmentVariableNames {
|
|
|
448
448
|
* @remarks This environment variable is not compatible with workspace installs. If attempting
|
|
449
449
|
* to move the PNPM store path, see the `RUSH_PNPM_STORE_PATH` environment variable.
|
|
450
450
|
*/
|
|
451
|
-
RUSH_TEMP_FOLDER
|
|
451
|
+
readonly RUSH_TEMP_FOLDER: "RUSH_TEMP_FOLDER";
|
|
452
452
|
/**
|
|
453
453
|
* This variable overrides the version of Rush that will be installed by
|
|
454
454
|
* the version selector. The default value is determined by the "rushVersion"
|
|
455
455
|
* field from rush.json.
|
|
456
456
|
*/
|
|
457
|
-
RUSH_PREVIEW_VERSION
|
|
457
|
+
readonly RUSH_PREVIEW_VERSION: "RUSH_PREVIEW_VERSION";
|
|
458
458
|
/**
|
|
459
459
|
* If this variable is set to "1", Rush will not fail the build when running a version
|
|
460
460
|
* of Node that does not match the criteria specified in the "nodeSupportedVersionRange"
|
|
461
461
|
* field from rush.json.
|
|
462
462
|
*/
|
|
463
|
-
RUSH_ALLOW_UNSUPPORTED_NODEJS
|
|
463
|
+
readonly RUSH_ALLOW_UNSUPPORTED_NODEJS: "RUSH_ALLOW_UNSUPPORTED_NODEJS";
|
|
464
464
|
/**
|
|
465
465
|
* Setting this environment variable overrides the value of `allowWarningsInSuccessfulBuild`
|
|
466
466
|
* in the `command-line.json` configuration file. Specify `1` to allow warnings in a successful build,
|
|
467
467
|
* or `0` to disallow them. (See the comments in the command-line.json file for more information).
|
|
468
468
|
*/
|
|
469
|
-
RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD
|
|
469
|
+
readonly RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD: "RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD";
|
|
470
470
|
/**
|
|
471
471
|
* This variable selects a specific installation variant for Rush to use when installing
|
|
472
472
|
* and linking package dependencies.
|
|
473
473
|
* For more information, see the command-line help for the `--variant` parameter
|
|
474
474
|
* and this article: https://rushjs.io/pages/advanced/installation_variants/
|
|
475
475
|
*/
|
|
476
|
-
RUSH_VARIANT
|
|
476
|
+
readonly RUSH_VARIANT: "RUSH_VARIANT";
|
|
477
477
|
/**
|
|
478
478
|
* Specifies the maximum number of concurrent processes to launch during a build.
|
|
479
479
|
* For more information, see the command-line help for the `--parallelism` parameter for "rush build".
|
|
480
480
|
*/
|
|
481
|
-
RUSH_PARALLELISM
|
|
481
|
+
readonly RUSH_PARALLELISM: "RUSH_PARALLELISM";
|
|
482
482
|
/**
|
|
483
483
|
* If this variable is set to "1", Rush will create symlinks with absolute paths instead
|
|
484
484
|
* of relative paths. This can be necessary when a repository is moved during a build or
|
|
485
485
|
* if parts of a repository are moved into a sandbox.
|
|
486
486
|
*/
|
|
487
|
-
RUSH_ABSOLUTE_SYMLINKS
|
|
487
|
+
readonly RUSH_ABSOLUTE_SYMLINKS: "RUSH_ABSOLUTE_SYMLINKS";
|
|
488
488
|
/**
|
|
489
489
|
* When using PNPM as the package manager, this variable can be used to configure the path that
|
|
490
490
|
* PNPM will use as the store directory.
|
|
@@ -492,18 +492,18 @@ export declare enum EnvironmentVariableNames {
|
|
|
492
492
|
* If a relative path is used, then the store path will be resolved relative to the process's
|
|
493
493
|
* current working directory. An absolute path is recommended.
|
|
494
494
|
*/
|
|
495
|
-
RUSH_PNPM_STORE_PATH
|
|
495
|
+
readonly RUSH_PNPM_STORE_PATH: "RUSH_PNPM_STORE_PATH";
|
|
496
496
|
/**
|
|
497
497
|
* When using PNPM as the package manager, this variable can be used to control whether or not PNPM
|
|
498
498
|
* validates the integrity of the PNPM store during installation. The value of this environment variable must be
|
|
499
499
|
* `1` (for true) or `0` (for false). If not specified, defaults to the value in .npmrc.
|
|
500
500
|
*/
|
|
501
|
-
RUSH_PNPM_VERIFY_STORE_INTEGRITY
|
|
501
|
+
readonly RUSH_PNPM_VERIFY_STORE_INTEGRITY: "RUSH_PNPM_VERIFY_STORE_INTEGRITY";
|
|
502
502
|
/**
|
|
503
503
|
* This environment variable can be used to specify the `--target-folder` parameter
|
|
504
504
|
* for the "rush deploy" command.
|
|
505
505
|
*/
|
|
506
|
-
RUSH_DEPLOY_TARGET_FOLDER
|
|
506
|
+
readonly RUSH_DEPLOY_TARGET_FOLDER: "RUSH_DEPLOY_TARGET_FOLDER";
|
|
507
507
|
/**
|
|
508
508
|
* Overrides the location of the `~/.rush` global folder where Rush stores temporary files.
|
|
509
509
|
*
|
|
@@ -520,7 +520,7 @@ export declare enum EnvironmentVariableNames {
|
|
|
520
520
|
*
|
|
521
521
|
* POSIX is a registered trademark of the Institute of Electrical and Electronic Engineers, Inc.
|
|
522
522
|
*/
|
|
523
|
-
RUSH_GLOBAL_FOLDER
|
|
523
|
+
readonly RUSH_GLOBAL_FOLDER: "RUSH_GLOBAL_FOLDER";
|
|
524
524
|
/**
|
|
525
525
|
* Provides a credential for a remote build cache, if configured. This credential overrides any cached credentials.
|
|
526
526
|
*
|
|
@@ -534,7 +534,7 @@ export declare enum EnvironmentVariableNames {
|
|
|
534
534
|
*
|
|
535
535
|
* For information on SAS tokens, see here: https://docs.microsoft.com/en-us/azure/storage/common/storage-sas-overview
|
|
536
536
|
*/
|
|
537
|
-
RUSH_BUILD_CACHE_CREDENTIAL
|
|
537
|
+
readonly RUSH_BUILD_CACHE_CREDENTIAL: "RUSH_BUILD_CACHE_CREDENTIAL";
|
|
538
538
|
/**
|
|
539
539
|
* Setting this environment variable overrides the value of `buildCacheEnabled` in the `build-cache.json`
|
|
540
540
|
* configuration file.
|
|
@@ -544,26 +544,26 @@ export declare enum EnvironmentVariableNames {
|
|
|
544
544
|
*
|
|
545
545
|
* If there is no build cache configured, then this environment variable is ignored.
|
|
546
546
|
*/
|
|
547
|
-
RUSH_BUILD_CACHE_ENABLED
|
|
547
|
+
readonly RUSH_BUILD_CACHE_ENABLED: "RUSH_BUILD_CACHE_ENABLED";
|
|
548
548
|
/**
|
|
549
549
|
* Overrides the value of `isCacheWriteAllowed` in the `build-cache.json` configuration file. The value of this
|
|
550
550
|
* environment variable must be `1` (for true) or `0` (for false). If there is no build cache configured, then
|
|
551
551
|
* this environment variable is ignored.
|
|
552
552
|
*/
|
|
553
|
-
RUSH_BUILD_CACHE_WRITE_ALLOWED
|
|
553
|
+
readonly RUSH_BUILD_CACHE_WRITE_ALLOWED: "RUSH_BUILD_CACHE_WRITE_ALLOWED";
|
|
554
554
|
/**
|
|
555
555
|
* Explicitly specifies the path for the Git binary that is invoked by certain Rush operations.
|
|
556
556
|
*/
|
|
557
|
-
RUSH_GIT_BINARY_PATH
|
|
557
|
+
readonly RUSH_GIT_BINARY_PATH: "RUSH_GIT_BINARY_PATH";
|
|
558
558
|
/**
|
|
559
559
|
* Explicitly specifies the path for the `tar` binary that is invoked by certain Rush operations.
|
|
560
560
|
*/
|
|
561
|
-
RUSH_TAR_BINARY_PATH
|
|
561
|
+
readonly RUSH_TAR_BINARY_PATH: "RUSH_TAR_BINARY_PATH";
|
|
562
562
|
/**
|
|
563
563
|
* Internal variable that explicitly specifies the path for the version of `@microsoft/rush-lib` being executed.
|
|
564
564
|
* Will be set upon loading Rush.
|
|
565
565
|
*/
|
|
566
|
-
RUSH_LIB_PATH
|
|
566
|
+
readonly RUSH_LIB_PATH: "_RUSH_LIB_PATH";
|
|
567
567
|
/**
|
|
568
568
|
* When Rush executes shell scripts, it sometimes changes the working directory to be a project folder or
|
|
569
569
|
* the repository root folder. The original working directory (where the Rush command was invoked) is assigned
|
|
@@ -573,8 +573,8 @@ export declare enum EnvironmentVariableNames {
|
|
|
573
573
|
* The `RUSH_INVOKED_FOLDER` variable is the same idea as the `INIT_CWD` variable that package managers
|
|
574
574
|
* assign when they execute lifecycle scripts.
|
|
575
575
|
*/
|
|
576
|
-
RUSH_INVOKED_FOLDER
|
|
577
|
-
}
|
|
576
|
+
readonly RUSH_INVOKED_FOLDER: "RUSH_INVOKED_FOLDER";
|
|
577
|
+
};
|
|
578
578
|
|
|
579
579
|
/**
|
|
580
580
|
* Events happen during Rush runs.
|
|
@@ -9,7 +9,7 @@ export interface IEnvironmentConfigurationInitializeOptions {
|
|
|
9
9
|
* Names of environment variables used by Rush.
|
|
10
10
|
* @beta
|
|
11
11
|
*/
|
|
12
|
-
export declare
|
|
12
|
+
export declare const EnvironmentVariableNames: {
|
|
13
13
|
/**
|
|
14
14
|
* This variable overrides the temporary folder used by Rush.
|
|
15
15
|
* The default value is "common/temp" under the repository root.
|
|
@@ -17,43 +17,43 @@ export declare enum EnvironmentVariableNames {
|
|
|
17
17
|
* @remarks This environment variable is not compatible with workspace installs. If attempting
|
|
18
18
|
* to move the PNPM store path, see the `RUSH_PNPM_STORE_PATH` environment variable.
|
|
19
19
|
*/
|
|
20
|
-
RUSH_TEMP_FOLDER
|
|
20
|
+
readonly RUSH_TEMP_FOLDER: "RUSH_TEMP_FOLDER";
|
|
21
21
|
/**
|
|
22
22
|
* This variable overrides the version of Rush that will be installed by
|
|
23
23
|
* the version selector. The default value is determined by the "rushVersion"
|
|
24
24
|
* field from rush.json.
|
|
25
25
|
*/
|
|
26
|
-
RUSH_PREVIEW_VERSION
|
|
26
|
+
readonly RUSH_PREVIEW_VERSION: "RUSH_PREVIEW_VERSION";
|
|
27
27
|
/**
|
|
28
28
|
* If this variable is set to "1", Rush will not fail the build when running a version
|
|
29
29
|
* of Node that does not match the criteria specified in the "nodeSupportedVersionRange"
|
|
30
30
|
* field from rush.json.
|
|
31
31
|
*/
|
|
32
|
-
RUSH_ALLOW_UNSUPPORTED_NODEJS
|
|
32
|
+
readonly RUSH_ALLOW_UNSUPPORTED_NODEJS: "RUSH_ALLOW_UNSUPPORTED_NODEJS";
|
|
33
33
|
/**
|
|
34
34
|
* Setting this environment variable overrides the value of `allowWarningsInSuccessfulBuild`
|
|
35
35
|
* in the `command-line.json` configuration file. Specify `1` to allow warnings in a successful build,
|
|
36
36
|
* or `0` to disallow them. (See the comments in the command-line.json file for more information).
|
|
37
37
|
*/
|
|
38
|
-
RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD
|
|
38
|
+
readonly RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD: "RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD";
|
|
39
39
|
/**
|
|
40
40
|
* This variable selects a specific installation variant for Rush to use when installing
|
|
41
41
|
* and linking package dependencies.
|
|
42
42
|
* For more information, see the command-line help for the `--variant` parameter
|
|
43
43
|
* and this article: https://rushjs.io/pages/advanced/installation_variants/
|
|
44
44
|
*/
|
|
45
|
-
RUSH_VARIANT
|
|
45
|
+
readonly RUSH_VARIANT: "RUSH_VARIANT";
|
|
46
46
|
/**
|
|
47
47
|
* Specifies the maximum number of concurrent processes to launch during a build.
|
|
48
48
|
* For more information, see the command-line help for the `--parallelism` parameter for "rush build".
|
|
49
49
|
*/
|
|
50
|
-
RUSH_PARALLELISM
|
|
50
|
+
readonly RUSH_PARALLELISM: "RUSH_PARALLELISM";
|
|
51
51
|
/**
|
|
52
52
|
* If this variable is set to "1", Rush will create symlinks with absolute paths instead
|
|
53
53
|
* of relative paths. This can be necessary when a repository is moved during a build or
|
|
54
54
|
* if parts of a repository are moved into a sandbox.
|
|
55
55
|
*/
|
|
56
|
-
RUSH_ABSOLUTE_SYMLINKS
|
|
56
|
+
readonly RUSH_ABSOLUTE_SYMLINKS: "RUSH_ABSOLUTE_SYMLINKS";
|
|
57
57
|
/**
|
|
58
58
|
* When using PNPM as the package manager, this variable can be used to configure the path that
|
|
59
59
|
* PNPM will use as the store directory.
|
|
@@ -61,18 +61,18 @@ export declare enum EnvironmentVariableNames {
|
|
|
61
61
|
* If a relative path is used, then the store path will be resolved relative to the process's
|
|
62
62
|
* current working directory. An absolute path is recommended.
|
|
63
63
|
*/
|
|
64
|
-
RUSH_PNPM_STORE_PATH
|
|
64
|
+
readonly RUSH_PNPM_STORE_PATH: "RUSH_PNPM_STORE_PATH";
|
|
65
65
|
/**
|
|
66
66
|
* When using PNPM as the package manager, this variable can be used to control whether or not PNPM
|
|
67
67
|
* validates the integrity of the PNPM store during installation. The value of this environment variable must be
|
|
68
68
|
* `1` (for true) or `0` (for false). If not specified, defaults to the value in .npmrc.
|
|
69
69
|
*/
|
|
70
|
-
RUSH_PNPM_VERIFY_STORE_INTEGRITY
|
|
70
|
+
readonly RUSH_PNPM_VERIFY_STORE_INTEGRITY: "RUSH_PNPM_VERIFY_STORE_INTEGRITY";
|
|
71
71
|
/**
|
|
72
72
|
* This environment variable can be used to specify the `--target-folder` parameter
|
|
73
73
|
* for the "rush deploy" command.
|
|
74
74
|
*/
|
|
75
|
-
RUSH_DEPLOY_TARGET_FOLDER
|
|
75
|
+
readonly RUSH_DEPLOY_TARGET_FOLDER: "RUSH_DEPLOY_TARGET_FOLDER";
|
|
76
76
|
/**
|
|
77
77
|
* Overrides the location of the `~/.rush` global folder where Rush stores temporary files.
|
|
78
78
|
*
|
|
@@ -89,7 +89,7 @@ export declare enum EnvironmentVariableNames {
|
|
|
89
89
|
*
|
|
90
90
|
* POSIX is a registered trademark of the Institute of Electrical and Electronic Engineers, Inc.
|
|
91
91
|
*/
|
|
92
|
-
RUSH_GLOBAL_FOLDER
|
|
92
|
+
readonly RUSH_GLOBAL_FOLDER: "RUSH_GLOBAL_FOLDER";
|
|
93
93
|
/**
|
|
94
94
|
* Provides a credential for a remote build cache, if configured. This credential overrides any cached credentials.
|
|
95
95
|
*
|
|
@@ -103,7 +103,7 @@ export declare enum EnvironmentVariableNames {
|
|
|
103
103
|
*
|
|
104
104
|
* For information on SAS tokens, see here: https://docs.microsoft.com/en-us/azure/storage/common/storage-sas-overview
|
|
105
105
|
*/
|
|
106
|
-
RUSH_BUILD_CACHE_CREDENTIAL
|
|
106
|
+
readonly RUSH_BUILD_CACHE_CREDENTIAL: "RUSH_BUILD_CACHE_CREDENTIAL";
|
|
107
107
|
/**
|
|
108
108
|
* Setting this environment variable overrides the value of `buildCacheEnabled` in the `build-cache.json`
|
|
109
109
|
* configuration file.
|
|
@@ -113,26 +113,26 @@ export declare enum EnvironmentVariableNames {
|
|
|
113
113
|
*
|
|
114
114
|
* If there is no build cache configured, then this environment variable is ignored.
|
|
115
115
|
*/
|
|
116
|
-
RUSH_BUILD_CACHE_ENABLED
|
|
116
|
+
readonly RUSH_BUILD_CACHE_ENABLED: "RUSH_BUILD_CACHE_ENABLED";
|
|
117
117
|
/**
|
|
118
118
|
* Overrides the value of `isCacheWriteAllowed` in the `build-cache.json` configuration file. The value of this
|
|
119
119
|
* environment variable must be `1` (for true) or `0` (for false). If there is no build cache configured, then
|
|
120
120
|
* this environment variable is ignored.
|
|
121
121
|
*/
|
|
122
|
-
RUSH_BUILD_CACHE_WRITE_ALLOWED
|
|
122
|
+
readonly RUSH_BUILD_CACHE_WRITE_ALLOWED: "RUSH_BUILD_CACHE_WRITE_ALLOWED";
|
|
123
123
|
/**
|
|
124
124
|
* Explicitly specifies the path for the Git binary that is invoked by certain Rush operations.
|
|
125
125
|
*/
|
|
126
|
-
RUSH_GIT_BINARY_PATH
|
|
126
|
+
readonly RUSH_GIT_BINARY_PATH: "RUSH_GIT_BINARY_PATH";
|
|
127
127
|
/**
|
|
128
128
|
* Explicitly specifies the path for the `tar` binary that is invoked by certain Rush operations.
|
|
129
129
|
*/
|
|
130
|
-
RUSH_TAR_BINARY_PATH
|
|
130
|
+
readonly RUSH_TAR_BINARY_PATH: "RUSH_TAR_BINARY_PATH";
|
|
131
131
|
/**
|
|
132
132
|
* Internal variable that explicitly specifies the path for the version of `@microsoft/rush-lib` being executed.
|
|
133
133
|
* Will be set upon loading Rush.
|
|
134
134
|
*/
|
|
135
|
-
RUSH_LIB_PATH
|
|
135
|
+
readonly RUSH_LIB_PATH: "_RUSH_LIB_PATH";
|
|
136
136
|
/**
|
|
137
137
|
* When Rush executes shell scripts, it sometimes changes the working directory to be a project folder or
|
|
138
138
|
* the repository root folder. The original working directory (where the Rush command was invoked) is assigned
|
|
@@ -142,8 +142,8 @@ export declare enum EnvironmentVariableNames {
|
|
|
142
142
|
* The `RUSH_INVOKED_FOLDER` variable is the same idea as the `INIT_CWD` variable that package managers
|
|
143
143
|
* assign when they execute lifecycle scripts.
|
|
144
144
|
*/
|
|
145
|
-
RUSH_INVOKED_FOLDER
|
|
146
|
-
}
|
|
145
|
+
readonly RUSH_INVOKED_FOLDER: "RUSH_INVOKED_FOLDER";
|
|
146
|
+
};
|
|
147
147
|
/**
|
|
148
148
|
* Provides Rush-specific environment variable data. All Rush environment variables must start with "RUSH_". This class
|
|
149
149
|
* is designed to be used by RushConfiguration.
|
package/lib-shim/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAqNA;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAO1E"}
|
package/lib-shim/index.js
CHANGED
|
@@ -30,6 +30,7 @@ exports._rushSdk_loadInternalModule = void 0;
|
|
|
30
30
|
const path = __importStar(require("path"));
|
|
31
31
|
const node_core_library_1 = require("@rushstack/node-core-library");
|
|
32
32
|
const RUSH_LIB_NAME = '@microsoft/rush-lib';
|
|
33
|
+
const RUSH_LIB_PATH_ENV_VAR_NAME = '_RUSH_LIB_PATH';
|
|
33
34
|
const verboseEnabled = typeof process !== 'undefined' && process.env.RUSH_SDK_DEBUG === '1';
|
|
34
35
|
const terminal = new node_core_library_1.Terminal(new node_core_library_1.ConsoleTerminalProvider({
|
|
35
36
|
verboseEnabled
|
|
@@ -89,21 +90,20 @@ if (rushLibModule === undefined) {
|
|
|
89
90
|
// SCENARIO 3: A tool or script has been invoked as a child process by an instance of "rush-lib" and can use the
|
|
90
91
|
// version that invoked it. In this case, use process.env._RUSH_LIB_PATH to find "rush-lib".
|
|
91
92
|
if (rushLibModule === undefined) {
|
|
92
|
-
const
|
|
93
|
-
const rushLibPath = process.env[rushLibVariable];
|
|
93
|
+
const rushLibPath = process.env[RUSH_LIB_PATH_ENV_VAR_NAME];
|
|
94
94
|
if (rushLibPath) {
|
|
95
|
-
terminal.writeVerboseLine(`Try to load ${RUSH_LIB_NAME} from process.env.${
|
|
95
|
+
terminal.writeVerboseLine(`Try to load ${RUSH_LIB_NAME} from process.env.${RUSH_LIB_PATH_ENV_VAR_NAME} from caller package`);
|
|
96
96
|
try {
|
|
97
97
|
rushLibModule = _require(rushLibPath);
|
|
98
98
|
}
|
|
99
99
|
catch (error) {
|
|
100
100
|
// Log this as a warning, since it is unexpected to define an incorrect value of the variable.
|
|
101
|
-
terminal.writeWarningLine(`Failed to load ${RUSH_LIB_NAME} via process.env.${
|
|
101
|
+
terminal.writeWarningLine(`Failed to load ${RUSH_LIB_NAME} via process.env.${RUSH_LIB_PATH_ENV_VAR_NAME}`);
|
|
102
102
|
}
|
|
103
103
|
if (rushLibModule !== undefined) {
|
|
104
104
|
// to track which scenario is active and how it got initialized.
|
|
105
105
|
global.___rush___rushLibModuleFromEnvironment = rushLibModule;
|
|
106
|
-
terminal.writeVerboseLine(`Loaded ${RUSH_LIB_NAME} from process.env.${
|
|
106
|
+
terminal.writeVerboseLine(`Loaded ${RUSH_LIB_NAME} from process.env.${RUSH_LIB_PATH_ENV_VAR_NAME}`);
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
}
|
package/lib-shim/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,2CAA6B;AAC7B,oEAUsC;AAGtC,MAAM,aAAa,GAA0B,qBAAqB,CAAC;AAEnE,MAAM,cAAc,GAAY,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,GAAG,CAAC;AACrG,MAAM,QAAQ,GAAa,IAAI,4BAAQ,CACrC,IAAI,2CAAuB,CAAC;IAC1B,cAAc;CACf,CAAC,CACH,CAAC;AAUF,SAAS,QAAQ,CAAU,UAAkB;IAC3C,IAAI,OAAO,uBAAuB,KAAK,UAAU,EAAE;QACjD,6FAA6F;QAC7F,kEAAkE;QAClE,2FAA2F;QAC3F,mBAAmB;QACnB,OAAO,uBAAuB,CAAC,UAAU,CAAC,CAAC;KAC5C;SAAM;QACL,OAAO,OAAO,CAAC,UAAU,CAAC,CAAC;KAC5B;AACH,CAAC;AAED,qGAAqG;AACrG,gGAAgG;AAChG,IAAI,aAAa,GACf,MAAM,CAAC,uBAAuB;IAC9B,MAAM,CAAC,sCAAsC;IAC7C,MAAM,CAAC,4CAA4C,CAAC;AACtD,IAAI,YAAY,GAAW,EAAE,CAAC;AAE9B,6FAA6F;AAC7F,+FAA+F;AAC/F,IAAI,aAAa,KAAK,SAAS,EAAE;IAC/B,MAAM,aAAa,GAA8B,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,QAAQ,CAAC;IAC1E,IAAI,aAAa,EAAE;QACjB,MAAM,mBAAm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AAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QACzD,IAAI,YAAY,KAAK,aAAa,EAAE;YAClC,MAAM;SACP;QAED,aAAa,GAAG,YAAY,CAAC;KAC9B;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport * as path from 'path';\nimport {\n JsonFile,\n JsonObject,\n Import,\n IPackageJson,\n PackageJsonLookup,\n Executable,\n FileSystem,\n Terminal,\n ConsoleTerminalProvider\n} from '@rushstack/node-core-library';\nimport type { SpawnSyncReturns } from 'child_process';\n\nconst RUSH_LIB_NAME: '@microsoft/rush-lib' = '@microsoft/rush-lib';\n\nconst verboseEnabled: boolean = typeof process !== 'undefined' && process.env.RUSH_SDK_DEBUG === '1';\nconst terminal: Terminal = new Terminal(\n new ConsoleTerminalProvider({\n verboseEnabled\n })\n);\n\ntype RushLibModuleType = Record<string, unknown>;\ndeclare const global: NodeJS.Global &\n typeof globalThis & {\n ___rush___rushLibModule?: RushLibModuleType;\n ___rush___rushLibModuleFromEnvironment?: RushLibModuleType;\n ___rush___rushLibModuleFromInstallAndRunRush?: RushLibModuleType;\n };\n\nfunction _require<TResult>(moduleName: string): TResult {\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 } else {\n return require(moduleName);\n }\n}\n\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.\nlet rushLibModule: RushLibModuleType | undefined =\n global.___rush___rushLibModule ||\n global.___rush___rushLibModuleFromEnvironment ||\n global.___rush___rushLibModuleFromInstallAndRunRush;\nlet errorMessage: string = '';\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 (rushLibModule === undefined) {\n const importingPath: string | null | undefined = module?.parent?.filename;\n if (importingPath) {\n const callerPackageFolder: string | undefined =\n PackageJsonLookup.instance.tryGetPackageFolderFor(importingPath);\n\n if (callerPackageFolder !== undefined) {\n const callerPackageJson: IPackageJson = _require(path.join(callerPackageFolder, 'package.json'));\n\n // Does the caller properly declare a dependency on rush-lib?\n if (\n (callerPackageJson.dependencies && callerPackageJson.dependencies[RUSH_LIB_NAME] !== undefined) ||\n (callerPackageJson.devDependencies &&\n callerPackageJson.devDependencies[RUSH_LIB_NAME] !== undefined) ||\n (callerPackageJson.peerDependencies &&\n callerPackageJson.peerDependencies[RUSH_LIB_NAME] !== undefined)\n ) {\n // Try to resolve rush-lib from the caller's folder\n terminal.writeVerboseLine(`Try to load ${RUSH_LIB_NAME} from caller package`);\n try {\n rushLibModule = requireRushLibUnderFolderPath(callerPackageFolder);\n } catch (error) {\n // If we fail to resolve it, ignore the error\n terminal.writeVerboseLine(`Failed to load ${RUSH_LIB_NAME} from caller package`);\n }\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 (rushLibModule !== undefined) {\n // to track which scenario is active and how it got initialized.\n global.___rush___rushLibModule = rushLibModule;\n terminal.writeVerboseLine(`Loaded ${RUSH_LIB_NAME} from caller`);\n }\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 (rushLibModule === undefined) {\n const rushLibVariable: '_RUSH_LIB_PATH' = '_RUSH_LIB_PATH';\n const rushLibPath: string | undefined = process.env[rushLibVariable];\n if (rushLibPath) {\n terminal.writeVerboseLine(\n `Try to load ${RUSH_LIB_NAME} from process.env.${rushLibVariable} from caller package`\n );\n try {\n rushLibModule = _require(rushLibPath);\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 ${RUSH_LIB_NAME} via process.env.${rushLibVariable}`);\n }\n\n if (rushLibModule !== undefined) {\n // to track which scenario is active and how it got initialized.\n global.___rush___rushLibModuleFromEnvironment = rushLibModule;\n terminal.writeVerboseLine(`Loaded ${RUSH_LIB_NAME} from process.env.${rushLibVariable}`);\n }\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 use install-run-rush.js to obtain the appropriate rush-lib version for the monorepo.\nif (rushLibModule === undefined) {\n try {\n const rushJsonPath: string | undefined = tryFindRushJsonLocation(process.cwd());\n if (!rushJsonPath) {\n throw new Error(\n '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 }\n const monorepoRoot: string = path.dirname(rushJsonPath);\n\n const rushJson: JsonObject = JsonFile.load(rushJsonPath);\n const { rushVersion } = rushJson;\n\n const installRunNodeModuleFolder: string = path.join(\n monorepoRoot,\n `common/temp/install-run/@microsoft+rush@${rushVersion}`\n );\n\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 ${RUSH_LIB_NAME} installed by install-run-rush`);\n rushLibModule = requireRushLibUnderFolderPath(installRunNodeModuleFolder);\n } catch (e) {\n let installAndRunRushStderrContent: string = '';\n try {\n const installAndRunRushJSPath: string = path.join(monorepoRoot, 'common/scripts/install-run-rush.js');\n\n terminal.writeLine('The Rush engine has not been installed yet. Invoking install-run-rush.js...');\n\n const installAndRuhRushProcess: SpawnSyncReturns<string> = Executable.spawnSync(\n 'node',\n [installAndRunRushJSPath, '--help'],\n {\n stdio: 'pipe'\n }\n );\n\n installAndRunRushStderrContent = installAndRuhRushProcess.stderr;\n if (installAndRuhRushProcess.status !== 0) {\n throw new Error(`The ${RUSH_LIB_NAME} package failed to install`);\n }\n\n // Retry to load \"rush-lib\" after install-run-rush run\n terminal.writeVerboseLine(\n `Trying to load ${RUSH_LIB_NAME} installed by install-run-rush a second time`\n );\n rushLibModule = requireRushLibUnderFolderPath(installRunNodeModuleFolder);\n } catch (e) {\n console.error(`${installAndRunRushStderrContent}`);\n throw new Error(`The ${RUSH_LIB_NAME} package failed to load`);\n }\n }\n\n if (rushLibModule !== undefined) {\n // to track which scenario is active and how it got initialized.\n global.___rush___rushLibModuleFromInstallAndRunRush = rushLibModule;\n terminal.writeVerboseLine(`Loaded ${RUSH_LIB_NAME} installed by install-run-rush`);\n }\n } catch (e) {\n // no-catch\n errorMessage = (e as Error).message;\n }\n}\n\nif (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 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\n// Based on TypeScript's __exportStar()\nfor (const property in rushLibModule) {\n if (property !== 'default' && !exports.hasOwnProperty(property)) {\n const rushLibModuleForClosure: RushLibModuleType = rushLibModule;\n\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/**\n * Used by the .js stubs for path-based imports of `@microsoft/rush-lib` internal APIs.\n */\nexport function _rushSdk_loadInternalModule(srcImportPath: string): unknown {\n if (!exports._RushInternals) {\n throw new Error(\n `Rush version ${exports.Rush.version} does not support internal API imports via rush-sdk`\n );\n }\n return exports._RushInternals.loadModule(srcImportPath);\n}\n\n/**\n * Require `@microsoft/rush-lib` under the specified folder path.\n */\nfunction requireRushLibUnderFolderPath(folderPath: string): RushLibModuleType {\n const rushLibModulePath: string = Import.resolveModule({\n modulePath: RUSH_LIB_NAME,\n baseFolderPath: folderPath\n });\n\n return _require(rushLibModulePath);\n}\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: string): string | undefined {\n let currentFolder: string = startingFolder;\n\n // Look upwards at parent folders until we find a folder containing rush.json\n for (let i: number = 0; i < 10; ++i) {\n const rushJsonFilename: string = path.join(currentFolder, 'rush.json');\n\n if (FileSystem.exists(rushJsonFilename)) {\n return rushJsonFilename;\n }\n\n const parentFolder: string = path.dirname(currentFolder);\n if (parentFolder === currentFolder) {\n break;\n }\n\n currentFolder = parentFolder;\n }\n\n return undefined;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,2CAA6B;AAC7B,oEAUsC;AAItC,MAAM,aAAa,GAA0B,qBAAqB,CAAC;AACnE,MAAM,0BAA0B,GAAkD,gBAAgB,CAAC;AAEnG,MAAM,cAAc,GAAY,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,GAAG,CAAC;AACrG,MAAM,QAAQ,GAAa,IAAI,4BAAQ,CACrC,IAAI,2CAAuB,CAAC;IAC1B,cAAc;CACf,CAAC,CACH,CAAC;AAUF,SAAS,QAAQ,CAAU,UAAkB;IAC3C,IAAI,OAAO,uBAAuB,KAAK,UAAU,EAAE;QACjD,6FAA6F;QAC7F,kEAAkE;QAClE,2FAA2F;QAC3F,mBAAmB;QACnB,OAAO,uBAAuB,CAAC,UAAU,CAAC,CAAC;KAC5C;SAAM;QACL,OAAO,OAAO,CAAC,UAAU,CAAC,CAAC;KAC5B;AACH,CAAC;AAED,qGAAqG;AACrG,gGAAgG;AAChG,IAAI,aAAa,GACf,MAAM,CAAC,uBAAuB;IAC9B,MAAM,CAAC,sC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CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE;QACnC,MAAM,gBAAgB,GAAW,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;QAEvE,IAAI,8BAAU,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE;YACvC,OAAO,gBAAgB,CAAC;SACzB;QAED,MAAM,YAAY,GAAW,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QACzD,IAAI,YAAY,KAAK,aAAa,EAAE;YAClC,MAAM;SACP;QAED,aAAa,GAAG,YAAY,CAAC;KAC9B;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport * as path from 'path';\nimport {\n JsonFile,\n JsonObject,\n Import,\n IPackageJson,\n PackageJsonLookup,\n Executable,\n FileSystem,\n Terminal,\n ConsoleTerminalProvider\n} from '@rushstack/node-core-library';\nimport type { SpawnSyncReturns } from 'child_process';\nimport type { EnvironmentVariableNames } from '@microsoft/rush-lib';\n\nconst RUSH_LIB_NAME: '@microsoft/rush-lib' = '@microsoft/rush-lib';\nconst RUSH_LIB_PATH_ENV_VAR_NAME: typeof EnvironmentVariableNames.RUSH_LIB_PATH = '_RUSH_LIB_PATH';\n\nconst verboseEnabled: boolean = typeof process !== 'undefined' && process.env.RUSH_SDK_DEBUG === '1';\nconst terminal: Terminal = new Terminal(\n new ConsoleTerminalProvider({\n verboseEnabled\n })\n);\n\ntype RushLibModuleType = Record<string, unknown>;\ndeclare const global: NodeJS.Global &\n typeof globalThis & {\n ___rush___rushLibModule?: RushLibModuleType;\n ___rush___rushLibModuleFromEnvironment?: RushLibModuleType;\n ___rush___rushLibModuleFromInstallAndRunRush?: RushLibModuleType;\n };\n\nfunction _require<TResult>(moduleName: string): TResult {\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 } else {\n return require(moduleName);\n }\n}\n\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.\nlet rushLibModule: RushLibModuleType | undefined =\n global.___rush___rushLibModule ||\n global.___rush___rushLibModuleFromEnvironment ||\n global.___rush___rushLibModuleFromInstallAndRunRush;\nlet errorMessage: string = '';\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 (rushLibModule === undefined) {\n const importingPath: string | null | undefined = module?.parent?.filename;\n if (importingPath) {\n const callerPackageFolder: string | undefined =\n PackageJsonLookup.instance.tryGetPackageFolderFor(importingPath);\n\n if (callerPackageFolder !== undefined) {\n const callerPackageJson: IPackageJson = _require(path.join(callerPackageFolder, 'package.json'));\n\n // Does the caller properly declare a dependency on rush-lib?\n if (\n (callerPackageJson.dependencies && callerPackageJson.dependencies[RUSH_LIB_NAME] !== undefined) ||\n (callerPackageJson.devDependencies &&\n callerPackageJson.devDependencies[RUSH_LIB_NAME] !== undefined) ||\n (callerPackageJson.peerDependencies &&\n callerPackageJson.peerDependencies[RUSH_LIB_NAME] !== undefined)\n ) {\n // Try to resolve rush-lib from the caller's folder\n terminal.writeVerboseLine(`Try to load ${RUSH_LIB_NAME} from caller package`);\n try {\n rushLibModule = requireRushLibUnderFolderPath(callerPackageFolder);\n } catch (error) {\n // If we fail to resolve it, ignore the error\n terminal.writeVerboseLine(`Failed to load ${RUSH_LIB_NAME} from caller package`);\n }\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 (rushLibModule !== undefined) {\n // to track which scenario is active and how it got initialized.\n global.___rush___rushLibModule = rushLibModule;\n terminal.writeVerboseLine(`Loaded ${RUSH_LIB_NAME} from caller`);\n }\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 (rushLibModule === undefined) {\n const rushLibPath: string | undefined = process.env[RUSH_LIB_PATH_ENV_VAR_NAME];\n if (rushLibPath) {\n terminal.writeVerboseLine(\n `Try to load ${RUSH_LIB_NAME} from process.env.${RUSH_LIB_PATH_ENV_VAR_NAME} from caller package`\n );\n try {\n rushLibModule = _require(rushLibPath);\n } catch (error) {\n // Log this as a warning, since it is unexpected to define an incorrect value of the variable.\n terminal.writeWarningLine(\n `Failed to load ${RUSH_LIB_NAME} via process.env.${RUSH_LIB_PATH_ENV_VAR_NAME}`\n );\n }\n\n if (rushLibModule !== undefined) {\n // to track which scenario is active and how it got initialized.\n global.___rush___rushLibModuleFromEnvironment = rushLibModule;\n terminal.writeVerboseLine(`Loaded ${RUSH_LIB_NAME} from process.env.${RUSH_LIB_PATH_ENV_VAR_NAME}`);\n }\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 use install-run-rush.js to obtain the appropriate rush-lib version for the monorepo.\nif (rushLibModule === undefined) {\n try {\n const rushJsonPath: string | undefined = tryFindRushJsonLocation(process.cwd());\n if (!rushJsonPath) {\n throw new Error(\n '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 }\n const monorepoRoot: string = path.dirname(rushJsonPath);\n\n const rushJson: JsonObject = JsonFile.load(rushJsonPath);\n const { rushVersion } = rushJson;\n\n const installRunNodeModuleFolder: string = path.join(\n monorepoRoot,\n `common/temp/install-run/@microsoft+rush@${rushVersion}`\n );\n\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 ${RUSH_LIB_NAME} installed by install-run-rush`);\n rushLibModule = requireRushLibUnderFolderPath(installRunNodeModuleFolder);\n } catch (e) {\n let installAndRunRushStderrContent: string = '';\n try {\n const installAndRunRushJSPath: string = path.join(monorepoRoot, 'common/scripts/install-run-rush.js');\n\n terminal.writeLine('The Rush engine has not been installed yet. Invoking install-run-rush.js...');\n\n const installAndRuhRushProcess: SpawnSyncReturns<string> = Executable.spawnSync(\n 'node',\n [installAndRunRushJSPath, '--help'],\n {\n stdio: 'pipe'\n }\n );\n\n installAndRunRushStderrContent = installAndRuhRushProcess.stderr;\n if (installAndRuhRushProcess.status !== 0) {\n throw new Error(`The ${RUSH_LIB_NAME} package failed to install`);\n }\n\n // Retry to load \"rush-lib\" after install-run-rush run\n terminal.writeVerboseLine(\n `Trying to load ${RUSH_LIB_NAME} installed by install-run-rush a second time`\n );\n rushLibModule = requireRushLibUnderFolderPath(installRunNodeModuleFolder);\n } catch (e) {\n console.error(`${installAndRunRushStderrContent}`);\n throw new Error(`The ${RUSH_LIB_NAME} package failed to load`);\n }\n }\n\n if (rushLibModule !== undefined) {\n // to track which scenario is active and how it got initialized.\n global.___rush___rushLibModuleFromInstallAndRunRush = rushLibModule;\n terminal.writeVerboseLine(`Loaded ${RUSH_LIB_NAME} installed by install-run-rush`);\n }\n } catch (e) {\n // no-catch\n errorMessage = (e as Error).message;\n }\n}\n\nif (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 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\n// Based on TypeScript's __exportStar()\nfor (const property in rushLibModule) {\n if (property !== 'default' && !exports.hasOwnProperty(property)) {\n const rushLibModuleForClosure: RushLibModuleType = rushLibModule;\n\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/**\n * Used by the .js stubs for path-based imports of `@microsoft/rush-lib` internal APIs.\n */\nexport function _rushSdk_loadInternalModule(srcImportPath: string): unknown {\n if (!exports._RushInternals) {\n throw new Error(\n `Rush version ${exports.Rush.version} does not support internal API imports via rush-sdk`\n );\n }\n return exports._RushInternals.loadModule(srcImportPath);\n}\n\n/**\n * Require `@microsoft/rush-lib` under the specified folder path.\n */\nfunction requireRushLibUnderFolderPath(folderPath: string): RushLibModuleType {\n const rushLibModulePath: string = Import.resolveModule({\n modulePath: RUSH_LIB_NAME,\n baseFolderPath: folderPath\n });\n\n return _require(rushLibModulePath);\n}\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: string): string | undefined {\n let currentFolder: string = startingFolder;\n\n // Look upwards at parent folders until we find a folder containing rush.json\n for (let i: number = 0; i < 10; ++i) {\n const rushJsonFilename: string = path.join(currentFolder, 'rush.json');\n\n if (FileSystem.exists(rushJsonFilename)) {\n return rushJsonFilename;\n }\n\n const parentFolder: string = path.dirname(currentFolder);\n if (parentFolder === currentFolder) {\n break;\n }\n\n currentFolder = parentFolder;\n }\n\n return undefined;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rushstack/rush-sdk",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.97.1",
|
|
4
4
|
"description": "An API for interacting with the Rush engine",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"@types/heft-jest": "1.0.1",
|
|
21
21
|
"@types/semver": "7.3.5",
|
|
22
22
|
"@types/webpack-env": "1.18.0",
|
|
23
|
-
"@microsoft/rush-lib": "5.
|
|
23
|
+
"@microsoft/rush-lib": "5.97.1",
|
|
24
24
|
"@rushstack/eslint-config": "3.2.0",
|
|
25
25
|
"@rushstack/heft": "0.50.0",
|
|
26
|
-
"@rushstack/heft-node-rig": "1.12.
|
|
27
|
-
"@rushstack/stream-collator": "4.0.
|
|
26
|
+
"@rushstack/heft-node-rig": "1.12.6",
|
|
27
|
+
"@rushstack/stream-collator": "4.0.229",
|
|
28
28
|
"@rushstack/ts-command-line": "4.13.2",
|
|
29
|
-
"@rushstack/terminal": "0.5.
|
|
29
|
+
"@rushstack/terminal": "0.5.4"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "heft build --clean",
|