@rushstack/package-extractor 0.10.4 → 0.10.5

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/CHANGELOG.json CHANGED
@@ -1,6 +1,33 @@
1
1
  {
2
2
  "name": "@rushstack/package-extractor",
3
3
  "entries": [
4
+ {
5
+ "version": "0.10.5",
6
+ "tag": "@rushstack/package-extractor_v0.10.5",
7
+ "date": "Sat, 14 Dec 2024 01:11:07 GMT",
8
+ "comments": {
9
+ "dependency": [
10
+ {
11
+ "comment": "Updating dependency \"@rushstack/node-core-library\" to `5.10.1`"
12
+ },
13
+ {
14
+ "comment": "Updating dependency \"@rushstack/terminal\" to `0.14.4`"
15
+ },
16
+ {
17
+ "comment": "Updating dependency \"@rushstack/ts-command-line\" to `4.23.2`"
18
+ },
19
+ {
20
+ "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.11.9`"
21
+ },
22
+ {
23
+ "comment": "Updating dependency \"@rushstack/heft\" to `0.68.11`"
24
+ },
25
+ {
26
+ "comment": "Updating dependency \"@rushstack/webpack-preserve-dynamic-require-plugin\" to `0.11.78`"
27
+ }
28
+ ]
29
+ }
30
+ },
4
31
  {
5
32
  "version": "0.10.4",
6
33
  "tag": "@rushstack/package-extractor_v0.10.4",
package/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Change Log - @rushstack/package-extractor
2
2
 
3
- This log was last generated on Mon, 09 Dec 2024 20:31:43 GMT and should not be manually modified.
3
+ This log was last generated on Sat, 14 Dec 2024 01:11:07 GMT and should not be manually modified.
4
+
5
+ ## 0.10.5
6
+ Sat, 14 Dec 2024 01:11:07 GMT
7
+
8
+ _Version update only_
4
9
 
5
10
  ## 0.10.4
6
11
  Mon, 09 Dec 2024 20:31:43 GMT
@@ -63771,16 +63771,21 @@ const nodePath = __importStar(__webpack_require__(/*! path */ 16928));
63771
63771
  * @public
63772
63772
  */
63773
63773
  class RealNodeModulePathResolver {
63774
- constructor(options = {
63775
- fs: nodeFs,
63776
- path: nodePath
63777
- }) {
63774
+ constructor(options = {}) {
63775
+ const { fs: { lstatSync = nodeFs.lstatSync, readlinkSync = nodeFs.readlinkSync } = nodeFs, path: { isAbsolute = nodePath.isAbsolute, join = nodePath.join, resolve = nodePath.resolve, sep = nodePath.sep } = nodePath } = options;
63778
63776
  const cache = (this._cache = new Map());
63779
- const { path, fs } = options;
63780
- const { sep: pathSeparator } = path;
63781
- this._fs = fs;
63782
- const nodeModulesToken = `${pathSeparator}node_modules${pathSeparator}`;
63783
- const tryReadLink = this._tryReadLink.bind(this);
63777
+ this._fs = {
63778
+ lstatSync,
63779
+ readlinkSync
63780
+ };
63781
+ this._path = {
63782
+ isAbsolute,
63783
+ join,
63784
+ resolve,
63785
+ sep
63786
+ };
63787
+ const nodeModulesToken = `${sep}node_modules${sep}`;
63788
+ const self = this;
63784
63789
  function realNodeModulePathInternal(input) {
63785
63790
  // Find the last node_modules path segment
63786
63791
  const nodeModulesIndex = input.lastIndexOf(nodeModulesToken);
@@ -63790,7 +63795,7 @@ class RealNodeModulePathResolver {
63790
63795
  }
63791
63796
  // First assume that the next path segment after node_modules is a symlink
63792
63797
  let linkStart = nodeModulesIndex + nodeModulesToken.length - 1;
63793
- let linkEnd = input.indexOf(pathSeparator, linkStart + 1);
63798
+ let linkEnd = input.indexOf(sep, linkStart + 1);
63794
63799
  // If the path segment starts with a '@', then it is a scoped package
63795
63800
  const isScoped = input.charAt(linkStart + 1) === '@';
63796
63801
  if (isScoped) {
@@ -63798,10 +63803,12 @@ class RealNodeModulePathResolver {
63798
63803
  if (linkEnd < 0) {
63799
63804
  // Symlink missing, so see if anything before the last node_modules needs resolving,
63800
63805
  // and preserve the rest of the path
63801
- return `${realNodeModulePathInternal(input.slice(0, nodeModulesIndex))}${input.slice(nodeModulesIndex)}`;
63806
+ return join(realNodeModulePathInternal(input.slice(0, nodeModulesIndex)), input.slice(nodeModulesIndex + 1),
63807
+ // Joining to `.` will clean up any extraneous trailing slashes
63808
+ '.');
63802
63809
  }
63803
63810
  linkStart = linkEnd;
63804
- linkEnd = input.indexOf(pathSeparator, linkStart + 1);
63811
+ linkEnd = input.indexOf(sep, linkStart + 1);
63805
63812
  }
63806
63813
  // No trailing separator, so the link is the last path segment
63807
63814
  if (linkEnd < 0) {
@@ -63809,13 +63816,14 @@ class RealNodeModulePathResolver {
63809
63816
  }
63810
63817
  const linkCandidate = input.slice(0, linkEnd);
63811
63818
  // Check if the link is a symlink
63812
- const linkTarget = tryReadLink(linkCandidate);
63813
- if (linkTarget && path.isAbsolute(linkTarget)) {
63819
+ const linkTarget = self._tryReadLink(linkCandidate);
63820
+ if (linkTarget && isAbsolute(linkTarget)) {
63814
63821
  // Absolute path, combine the link target with any remaining path segments
63815
63822
  // Cache the resolution to avoid the readlink call in subsequent calls
63816
63823
  cache.set(linkCandidate, linkTarget);
63817
63824
  cache.set(linkTarget, linkTarget);
63818
- return `${linkTarget}${input.slice(linkEnd)}`;
63825
+ // Joining to `.` will clean up any extraneous trailing slashes
63826
+ return join(linkTarget, input.slice(linkEnd + 1), '.');
63819
63827
  }
63820
63828
  // Relative path or does not exist
63821
63829
  // Either way, the path before the last node_modules could itself be in a node_modules folder
@@ -63823,18 +63831,20 @@ class RealNodeModulePathResolver {
63823
63831
  const realpathBeforeNodeModules = realNodeModulePathInternal(input.slice(0, nodeModulesIndex));
63824
63832
  if (linkTarget) {
63825
63833
  // Relative path in symbolic link. Should be resolved relative to real path of base path.
63826
- const resolvedTarget = path.resolve(`${realpathBeforeNodeModules}${input.slice(nodeModulesIndex, linkStart)}`, linkTarget);
63834
+ const resolvedTarget = resolve(realpathBeforeNodeModules, input.slice(nodeModulesIndex + 1, linkStart), linkTarget);
63827
63835
  // Cache the result of the combined resolution to avoid the readlink call in subsequent calls
63828
63836
  cache.set(linkCandidate, resolvedTarget);
63829
63837
  cache.set(resolvedTarget, resolvedTarget);
63830
- return `${resolvedTarget}${input.slice(linkEnd)}`;
63838
+ // Joining to `.` will clean up any extraneous trailing slashes
63839
+ return join(resolvedTarget, input.slice(linkEnd + 1), '.');
63831
63840
  }
63832
63841
  // No symlink, so just return the real path before the last node_modules combined with the
63833
63842
  // subsequent path segments
63834
- return `${realpathBeforeNodeModules}${input.slice(nodeModulesIndex)}`;
63843
+ // Joining to `.` will clean up any extraneous trailing slashes
63844
+ return join(realpathBeforeNodeModules, input.slice(nodeModulesIndex + 1), '.');
63835
63845
  }
63836
63846
  this.realNodeModulePath = (input) => {
63837
- return realNodeModulePathInternal(path.normalize(input));
63847
+ return realNodeModulePathInternal(resolve(input));
63838
63848
  };
63839
63849
  }
63840
63850
  /**
@@ -63859,7 +63869,9 @@ class RealNodeModulePathResolver {
63859
63869
  // of an lstat call.
63860
63870
  const stat = this._fs.lstatSync(link);
63861
63871
  if (stat.isSymbolicLink()) {
63862
- return this._fs.readlinkSync(link, 'utf8');
63872
+ // path.join(x, '.') will trim trailing slashes, if applicable
63873
+ const result = this._path.join(this._fs.readlinkSync(link, 'utf8'), '.');
63874
+ return result;
63863
63875
  }
63864
63876
  }
63865
63877
  }