@rushstack/rush-sdk 5.158.1 → 5.160.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.
package/lib-shim/index.js CHANGED
@@ -108,7 +108,7 @@ async function iterateAsync(basePath, filePath, segments) {
108
108
 
109
109
  /***/ "../rush-lib/lib-esnext/api/RushGlobalFolder.js":
110
110
  /*!******************************************************************!*\
111
- !*** ../rush-lib/lib-esnext/api/RushGlobalFolder.js + 7 modules ***!
111
+ !*** ../rush-lib/lib-esnext/api/RushGlobalFolder.js + 9 modules ***!
112
112
  \******************************************************************/
113
113
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
114
114
 
@@ -120,20 +120,20 @@ __webpack_require__.d(__webpack_exports__, {
120
120
  RushGlobalFolder: () => (/* binding */ RushGlobalFolder)
121
121
  });
122
122
 
123
- // EXTERNAL MODULE: external "path"
124
- var external_path_ = __webpack_require__("path");
125
- ;// external "child_process"
126
- const external_child_process_namespaceObject = require("child_process");
127
- // EXTERNAL MODULE: external "os"
128
- var external_os_ = __webpack_require__("os");
129
- ;// external "perf_hooks"
130
- const external_perf_hooks_namespaceObject = require("perf_hooks");
131
- ;// external "stream"
132
- const external_stream_namespaceObject = require("stream");
123
+ // EXTERNAL MODULE: external "node:path"
124
+ var external_node_path_ = __webpack_require__("node:path");
125
+ ;// external "node:child_process"
126
+ const external_node_child_process_namespaceObject = require("node:child_process");
127
+ ;// external "node:os"
128
+ const external_node_os_namespaceObject = require("node:os");
129
+ ;// external "node:perf_hooks"
130
+ const external_node_perf_hooks_namespaceObject = require("node:perf_hooks");
131
+ ;// external "node:stream"
132
+ const external_node_stream_namespaceObject = require("node:stream");
133
133
  // EXTERNAL MODULE: external "@rushstack/node-core-library"
134
134
  var node_core_library_ = __webpack_require__("@rushstack/node-core-library");
135
- // EXTERNAL MODULE: external "fs"
136
- var external_fs_ = __webpack_require__("fs");
135
+ ;// external "node:fs"
136
+ const external_node_fs_namespaceObject = require("node:fs");
137
137
  ;// ../rush-lib/lib-esnext/utilities/npmrcUtilities.js
138
138
  // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
139
139
  // See LICENSE in the project root for license information.
@@ -159,8 +159,8 @@ function _trimNpmrcFile(options) {
159
159
  if (linesToPrepend) {
160
160
  npmrcFileLines.push(...linesToPrepend);
161
161
  }
162
- if (external_fs_.existsSync(sourceNpmrcPath)) {
163
- npmrcFileLines.push(...external_fs_.readFileSync(sourceNpmrcPath).toString().split('\n'));
162
+ if (external_node_fs_namespaceObject.existsSync(sourceNpmrcPath)) {
163
+ npmrcFileLines.push(...external_node_fs_namespaceObject.readFileSync(sourceNpmrcPath).toString().split('\n'));
164
164
  }
165
165
  if (linesToAppend) {
166
166
  npmrcFileLines.push(...linesToAppend);
@@ -251,7 +251,7 @@ function _copyAndTrimNpmrcFile(options) {
251
251
  logger.info(`Transforming ${sourceNpmrcPath}`); // Verbose
252
252
  logger.info(` --> "${targetNpmrcPath}"`);
253
253
  const combinedNpmrc = _trimNpmrcFile(options);
254
- external_fs_.writeFileSync(targetNpmrcPath, combinedNpmrc);
254
+ external_node_fs_namespaceObject.writeFileSync(targetNpmrcPath, combinedNpmrc);
255
255
  return combinedNpmrc;
256
256
  }
257
257
  function syncNpmrc(options) {
@@ -261,13 +261,13 @@ function syncNpmrc(options) {
261
261
  // eslint-disable-next-line no-console
262
262
  error: console.error
263
263
  }, createIfMissing = false } = options;
264
- const sourceNpmrcPath = external_path_.join(sourceNpmrcFolder, !useNpmrcPublish ? '.npmrc' : '.npmrc-publish');
265
- const targetNpmrcPath = external_path_.join(targetNpmrcFolder, '.npmrc');
264
+ const sourceNpmrcPath = external_node_path_.join(sourceNpmrcFolder, !useNpmrcPublish ? '.npmrc' : '.npmrc-publish');
265
+ const targetNpmrcPath = external_node_path_.join(targetNpmrcFolder, '.npmrc');
266
266
  try {
267
- if (external_fs_.existsSync(sourceNpmrcPath) || createIfMissing) {
267
+ if (external_node_fs_namespaceObject.existsSync(sourceNpmrcPath) || createIfMissing) {
268
268
  // Ensure the target folder exists
269
- if (!external_fs_.existsSync(targetNpmrcFolder)) {
270
- external_fs_.mkdirSync(targetNpmrcFolder, { recursive: true });
269
+ if (!external_node_fs_namespaceObject.existsSync(targetNpmrcFolder)) {
270
+ external_node_fs_namespaceObject.mkdirSync(targetNpmrcFolder, { recursive: true });
271
271
  }
272
272
  return _copyAndTrimNpmrcFile({
273
273
  sourceNpmrcPath,
@@ -276,10 +276,10 @@ function syncNpmrc(options) {
276
276
  ...options
277
277
  });
278
278
  }
279
- else if (external_fs_.existsSync(targetNpmrcPath)) {
279
+ else if (external_node_fs_namespaceObject.existsSync(targetNpmrcPath)) {
280
280
  // If the source .npmrc doesn't exist and there is one in the target, delete the one in the target
281
281
  logger.info(`Deleting ${targetNpmrcPath}`); // Verbose
282
- external_fs_.unlinkSync(targetNpmrcPath);
282
+ external_node_fs_namespaceObject.unlinkSync(targetNpmrcPath);
283
283
  }
284
284
  }
285
285
  catch (e) {
@@ -691,7 +691,7 @@ class EnvironmentConfiguration {
691
691
  if (process.env.hasOwnProperty(envVarName) && envVarName.match(/^RUSH_/i)) {
692
692
  const value = process.env[envVarName];
693
693
  // Environment variables are only case-insensitive on Windows
694
- const normalizedEnvVarName = external_os_.platform() === 'win32' ? envVarName.toUpperCase() : envVarName;
694
+ const normalizedEnvVarName = external_node_os_namespaceObject.platform() === 'win32' ? envVarName.toUpperCase() : envVarName;
695
695
  switch (normalizedEnvVarName) {
696
696
  case EnvironmentVariableNames.RUSH_TEMP_FOLDER: {
697
697
  EnvironmentConfiguration._rushTempFolderOverride =
@@ -856,24 +856,24 @@ class EnvironmentConfiguration {
856
856
  * returns 'C:\\Folder1\\folder2\\temp\\subfolder'
857
857
  */
858
858
  static _normalizeDeepestParentFolderPath(folderPath) {
859
- folderPath = external_path_.normalize(folderPath);
860
- const endsWithSlash = folderPath.charAt(folderPath.length - 1) === external_path_.sep;
861
- const parsedPath = external_path_.parse(folderPath);
859
+ folderPath = external_node_path_.normalize(folderPath);
860
+ const endsWithSlash = folderPath.charAt(folderPath.length - 1) === external_node_path_.sep;
861
+ const parsedPath = external_node_path_.parse(folderPath);
862
862
  const pathRoot = parsedPath.root;
863
863
  const pathWithoutRoot = parsedPath.dir.substr(pathRoot.length);
864
- const pathParts = [...pathWithoutRoot.split(external_path_.sep), parsedPath.name].filter((part) => !!part);
864
+ const pathParts = [...pathWithoutRoot.split(external_node_path_.sep), parsedPath.name].filter((part) => !!part);
865
865
  // Starting with all path sections, and eliminating one from the end during each loop iteration,
866
866
  // run trueCasePathSync. If trueCasePathSync returns without exception, we've found a subset
867
867
  // of the path that exists and we've now gotten the correct casing.
868
868
  //
869
869
  // Once we've found a parent folder that exists, append the path sections that didn't exist.
870
870
  for (let i = pathParts.length; i >= 0; i--) {
871
- const constructedPath = external_path_.join(pathRoot, ...pathParts.slice(0, i));
871
+ const constructedPath = external_node_path_.join(pathRoot, ...pathParts.slice(0, i));
872
872
  try {
873
873
  const normalizedConstructedPath = (0,true_case_path.trueCasePathSync)(constructedPath);
874
- const result = external_path_.join(normalizedConstructedPath, ...pathParts.slice(i));
874
+ const result = external_node_path_.join(normalizedConstructedPath, ...pathParts.slice(i));
875
875
  if (endsWithSlash) {
876
- return `${result}${external_path_.sep}`;
876
+ return `${result}${external_node_path_.sep}`;
877
877
  }
878
878
  else {
879
879
  return result;
@@ -1214,7 +1214,7 @@ class Utilities {
1214
1214
  if (unresolvedUserFolder === undefined) {
1215
1215
  throw new Error(dirError);
1216
1216
  }
1217
- homeFolder = external_path_.resolve(unresolvedUserFolder);
1217
+ homeFolder = external_node_path_.resolve(unresolvedUserFolder);
1218
1218
  if (!node_core_library_.FileSystem.exists(homeFolder)) {
1219
1219
  throw new Error(dirError);
1220
1220
  }
@@ -1226,7 +1226,7 @@ class Utilities {
1226
1226
  * Node.js equivalent of performance.now().
1227
1227
  */
1228
1228
  static getTimeInMs() {
1229
- return external_perf_hooks_namespaceObject.performance.now();
1229
+ return external_node_perf_hooks_namespaceObject.performance.now();
1230
1230
  }
1231
1231
  /**
1232
1232
  * Retries a function until a timeout is reached. The function is expected to throw if it failed and
@@ -1431,7 +1431,7 @@ class Utilities {
1431
1431
  * @param options - options for how the command should be run
1432
1432
  */
1433
1433
  static executeLifecycleCommand(command, options) {
1434
- const result = Utilities._executeLifecycleCommandInternal(command, external_child_process_namespaceObject.spawnSync, options);
1434
+ const result = Utilities._executeLifecycleCommandInternal(command, external_node_child_process_namespaceObject.spawnSync, options);
1435
1435
  if (options.handleOutput) {
1436
1436
  Utilities._processResult({
1437
1437
  error: result.error,
@@ -1452,7 +1452,7 @@ class Utilities {
1452
1452
  * @param options - options for how the command should be run
1453
1453
  */
1454
1454
  static executeLifecycleCommandAsync(command, options) {
1455
- const child = Utilities._executeLifecycleCommandInternal(command, external_child_process_namespaceObject.spawn, options);
1455
+ const child = Utilities._executeLifecycleCommandInternal(command, external_node_child_process_namespaceObject.spawn, options);
1456
1456
  if (options.connectSubprocessTerminator) {
1457
1457
  node_core_library_.SubprocessTerminator.killProcessTreeOnExit(child, node_core_library_.SubprocessTerminator.RECOMMENDED_OPTIONS);
1458
1458
  }
@@ -1473,7 +1473,7 @@ class Utilities {
1473
1473
  * Installs a package by name and version in the specified directory.
1474
1474
  */
1475
1475
  static async installPackageInDirectoryAsync({ packageName, version, tempPackageTitle, commonRushConfigFolder, maxInstallAttempts, suppressOutput, directory }) {
1476
- directory = external_path_.resolve(directory);
1476
+ directory = external_node_path_.resolve(directory);
1477
1477
  const directoryExists = await node_core_library_.FileSystem.existsAsync(directory);
1478
1478
  if (directoryExists) {
1479
1479
  // eslint-disable-next-line no-console
@@ -1489,7 +1489,7 @@ class Utilities {
1489
1489
  private: true,
1490
1490
  version: '0.0.0'
1491
1491
  };
1492
- await node_core_library_.JsonFile.saveAsync(npmPackageJson, external_path_.join(directory, node_core_library_.FileConstants.PackageJson));
1492
+ await node_core_library_.JsonFile.saveAsync(npmPackageJson, external_node_path_.join(directory, node_core_library_.FileConstants.PackageJson));
1493
1493
  if (commonRushConfigFolder) {
1494
1494
  Utilities.syncNpmrc({
1495
1495
  sourceNpmrcFolder: commonRushConfigFolder,
@@ -1616,7 +1616,7 @@ class Utilities {
1616
1616
  environment.RUSHSTACK_FILE_ERROR_BASE_FOLDER = options.pathOptions.rushJsonFolder;
1617
1617
  }
1618
1618
  for (const key of Object.getOwnPropertyNames(options.initialEnvironment)) {
1619
- const normalizedKey = external_os_.platform() === 'win32' ? key.toUpperCase() : key;
1619
+ const normalizedKey = external_node_os_namespaceObject.platform() === 'win32' ? key.toUpperCase() : key;
1620
1620
  // If Rush itself was invoked inside a lifecycle script, this may be set and would interfere
1621
1621
  // with Rush's installations. If we actually want it, we will set it explicitly below.
1622
1622
  if (normalizedKey === 'INIT_CWD') {
@@ -1653,7 +1653,7 @@ class Utilities {
1653
1653
  environment.PATH = Utilities._prependNodeModulesBinToPath(environment.PATH, options.pathOptions.projectRoot);
1654
1654
  }
1655
1655
  if (options.pathOptions.additionalPathFolders) {
1656
- environment.PATH = [...options.pathOptions.additionalPathFolders, environment.PATH].join(external_path_.delimiter);
1656
+ environment.PATH = [...options.pathOptions.additionalPathFolders, environment.PATH].join(external_node_path_.delimiter);
1657
1657
  }
1658
1658
  }
1659
1659
  // Communicate to downstream calls that they should not try to run hooks
@@ -1666,9 +1666,9 @@ class Utilities {
1666
1666
  * "/foobar/node_modules/.bin:/bin"
1667
1667
  */
1668
1668
  static _prependNodeModulesBinToPath(existingPath, rootDirectory) {
1669
- const binPath = external_path_.resolve(rootDirectory, 'node_modules', '.bin');
1669
+ const binPath = external_node_path_.resolve(rootDirectory, 'node_modules', '.bin');
1670
1670
  if (existingPath) {
1671
- return `${binPath}${external_path_.delimiter}${existingPath}`;
1671
+ return `${binPath}${external_node_path_.delimiter}${existingPath}`;
1672
1672
  }
1673
1673
  else {
1674
1674
  return binPath;
@@ -1703,9 +1703,9 @@ class Utilities {
1703
1703
  // Only escape the command if it actually contains spaces:
1704
1704
  const escapedCommand = command.indexOf(' ') < 0 ? command : Utilities.escapeShellParameter(command);
1705
1705
  const escapedArgs = args.map((x) => Utilities.escapeShellParameter(x));
1706
- const childProcess = external_child_process_namespaceObject.spawn(escapedCommand, escapedArgs, options);
1706
+ const childProcess = external_node_child_process_namespaceObject.spawn(escapedCommand, escapedArgs, options);
1707
1707
  if (onStdoutStreamChunk) {
1708
- const inspectStream = new external_stream_namespaceObject.Transform({
1708
+ const inspectStream = new external_node_stream_namespaceObject.Transform({
1709
1709
  transform: onStdoutStreamChunk
1710
1710
  ? (chunk, encoding, callback) => {
1711
1711
  const chunkString = chunk.toString();
@@ -1757,12 +1757,12 @@ class RushGlobalFolder {
1757
1757
  this.path = rushGlobalFolderOverride;
1758
1758
  }
1759
1759
  else {
1760
- this.path = external_path_.join(Utilities.getHomeFolder(), '.rush');
1760
+ this.path = external_node_path_.join(Utilities.getHomeFolder(), '.rush');
1761
1761
  }
1762
1762
  const normalizedNodeVersion = process.version.match(/^[a-z0-9\-\.]+$/i)
1763
1763
  ? process.version
1764
1764
  : 'unknown-version';
1765
- this.nodeSpecificPath = external_path_.join(this.path, `node-${normalizedNodeVersion}`);
1765
+ this.nodeSpecificPath = external_node_path_.join(this.path, `node-${normalizedNodeVersion}`);
1766
1766
  }
1767
1767
  }
1768
1768
  //# sourceMappingURL=RushGlobalFolder.js.map
@@ -1816,7 +1816,7 @@ exports.sdkContext = exports.RUSH_LIB_PATH_ENV_VAR_NAME = exports.RUSH_LIB_NAME
1816
1816
  exports.tryFindRushJsonLocation = tryFindRushJsonLocation;
1817
1817
  exports._require = _require;
1818
1818
  exports.requireRushLibUnderFolderPath = requireRushLibUnderFolderPath;
1819
- const path = __importStar(__webpack_require__(/*! path */ "path"));
1819
+ const path = __importStar(__webpack_require__(/*! node:path */ "node:path"));
1820
1820
  const node_core_library_1 = __webpack_require__(/*! @rushstack/node-core-library */ "@rushstack/node-core-library");
1821
1821
  exports.RUSH_LIB_NAME = '@microsoft/rush-lib';
1822
1822
  exports.RUSH_LIB_PATH_ENV_VAR_NAME = '_RUSH_LIB_PATH';
@@ -1917,7 +1917,7 @@ var __importStar = (this && this.__importStar) || (function () {
1917
1917
  var _a;
1918
1918
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1919
1919
  exports._rushSdk_loadInternalModule = _rushSdk_loadInternalModule;
1920
- const path = __importStar(__webpack_require__(/*! path */ "path"));
1920
+ const path = __importStar(__webpack_require__(/*! node:path */ "node:path"));
1921
1921
  const node_core_library_1 = __webpack_require__(/*! @rushstack/node-core-library */ "@rushstack/node-core-library");
1922
1922
  const terminal_1 = __webpack_require__(/*! @rushstack/terminal */ "@rushstack/terminal");
1923
1923
  const RushGlobalFolder_1 = __webpack_require__(/*! @microsoft/rush-lib/lib-esnext/api/RushGlobalFolder */ "../rush-lib/lib-esnext/api/RushGlobalFolder.js");
@@ -2127,6 +2127,16 @@ module.exports = require("fs");
2127
2127
 
2128
2128
  /***/ }),
2129
2129
 
2130
+ /***/ "node:path":
2131
+ /*!****************************!*\
2132
+ !*** external "node:path" ***!
2133
+ \****************************/
2134
+ /***/ ((module) => {
2135
+
2136
+ module.exports = require("node:path");
2137
+
2138
+ /***/ }),
2139
+
2130
2140
  /***/ "os":
2131
2141
  /*!*********************!*\
2132
2142
  !*** external "os" ***!