@rushstack/package-extractor 0.10.16 → 0.10.17

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.17",
6
+ "tag": "@rushstack/package-extractor_v0.10.17",
7
+ "date": "Tue, 11 Mar 2025 02:12:34 GMT",
8
+ "comments": {
9
+ "dependency": [
10
+ {
11
+ "comment": "Updating dependency \"@rushstack/node-core-library\" to `5.12.0`"
12
+ },
13
+ {
14
+ "comment": "Updating dependency \"@rushstack/terminal\" to `0.15.1`"
15
+ },
16
+ {
17
+ "comment": "Updating dependency \"@rushstack/ts-command-line\" to `4.23.6`"
18
+ },
19
+ {
20
+ "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.11.21`"
21
+ },
22
+ {
23
+ "comment": "Updating dependency \"@rushstack/heft\" to `0.70.0`"
24
+ },
25
+ {
26
+ "comment": "Updating dependency \"@rushstack/webpack-preserve-dynamic-require-plugin\" to `0.11.90`"
27
+ }
28
+ ]
29
+ }
30
+ },
4
31
  {
5
32
  "version": "0.10.16",
6
33
  "tag": "@rushstack/package-extractor_v0.10.16",
package/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Change Log - @rushstack/package-extractor
2
2
 
3
- This log was last generated on Tue, 11 Mar 2025 00:11:25 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 11 Mar 2025 02:12:34 GMT and should not be manually modified.
4
+
5
+ ## 0.10.17
6
+ Tue, 11 Mar 2025 02:12:34 GMT
7
+
8
+ _Version update only_
4
9
 
5
10
  ## 0.10.16
6
11
  Tue, 11 Mar 2025 00:11:25 GMT
@@ -47834,8 +47834,9 @@ const nodePath = __importStar(__webpack_require__(/*! path */ 16928));
47834
47834
  */
47835
47835
  class RealNodeModulePathResolver {
47836
47836
  constructor(options = {}) {
47837
- const { fs: { lstatSync = nodeFs.lstatSync, readlinkSync = nodeFs.readlinkSync } = nodeFs, path: { isAbsolute = nodePath.isAbsolute, join = nodePath.join, resolve = nodePath.resolve, sep = nodePath.sep } = nodePath } = options;
47837
+ const { fs: { lstatSync = nodeFs.lstatSync, readlinkSync = nodeFs.readlinkSync } = nodeFs, path: { isAbsolute = nodePath.isAbsolute, join = nodePath.join, resolve = nodePath.resolve, sep = nodePath.sep } = nodePath, ignoreMissingPaths = false } = options;
47838
47838
  const cache = (this._cache = new Map());
47839
+ this._errorCache = new Map();
47839
47840
  this._fs = {
47840
47841
  lstatSync,
47841
47842
  readlinkSync
@@ -47846,6 +47847,9 @@ class RealNodeModulePathResolver {
47846
47847
  resolve,
47847
47848
  sep
47848
47849
  };
47850
+ this._lstatOptions = {
47851
+ throwIfNoEntry: !ignoreMissingPaths
47852
+ };
47849
47853
  const nodeModulesToken = `${sep}node_modules${sep}`;
47850
47854
  const self = this;
47851
47855
  function realNodeModulePathInternal(input) {
@@ -47924,16 +47928,28 @@ class RealNodeModulePathResolver {
47924
47928
  */
47925
47929
  _tryReadLink(link) {
47926
47930
  const cached = this._cache.get(link);
47927
- if (cached) {
47928
- return cached;
47931
+ if (cached !== undefined) {
47932
+ return cached || undefined;
47933
+ }
47934
+ const cachedError = this._errorCache.get(link);
47935
+ if (cachedError) {
47936
+ // Fill the properties but fix the stack trace.
47937
+ throw Object.assign(new Error(cachedError.message), cachedError);
47929
47938
  }
47930
47939
  // On Windows, calling `readlink` on a directory throws an EUNKOWN, not EINVAL, so just pay the cost
47931
47940
  // of an lstat call.
47932
- const stat = this._fs.lstatSync(link);
47933
- if (stat.isSymbolicLink()) {
47934
- // path.join(x, '.') will trim trailing slashes, if applicable
47935
- const result = this._path.join(this._fs.readlinkSync(link, 'utf8'), '.');
47936
- return result;
47941
+ try {
47942
+ const stat = this._fs.lstatSync(link, this._lstatOptions);
47943
+ if (stat === null || stat === void 0 ? void 0 : stat.isSymbolicLink()) {
47944
+ // path.join(x, '.') will trim trailing slashes, if applicable
47945
+ const result = this._path.join(this._fs.readlinkSync(link, 'utf8'), '.');
47946
+ return result;
47947
+ }
47948
+ // Ensure we cache that this was not a symbolic link.
47949
+ this._cache.set(link, false);
47950
+ }
47951
+ catch (err) {
47952
+ this._errorCache.set(link, err);
47937
47953
  }
47938
47954
  }
47939
47955
  }
@@ -53821,7 +53837,7 @@ class Import {
53821
53837
  * and a system module is found, then its name is returned without any file path.
53822
53838
  */
53823
53839
  static resolvePackage(options) {
53824
- const { packageName, includeSystemModules, baseFolderPath, allowSelfReference, getRealPath } = options;
53840
+ const { packageName, includeSystemModules, baseFolderPath, allowSelfReference, getRealPath, useNodeJSResolver } = options;
53825
53841
  if (includeSystemModules && Import._builtInModules.has(packageName)) {
53826
53842
  return packageName;
53827
53843
  }
@@ -53834,20 +53850,17 @@ class Import {
53834
53850
  }
53835
53851
  PackageName_1.PackageName.parse(packageName); // Ensure the package name is valid and doesn't contain a path
53836
53852
  try {
53837
- // Append a slash to the package name to ensure `resolve.sync` doesn't attempt to return a system package
53838
- const resolvedPath = Resolve.sync(`${packageName}/`, {
53839
- basedir: normalizedRootPath,
53840
- preserveSymlinks: false,
53841
- packageFilter: (pkg, pkgFile, dir) => {
53842
- // Hardwire "main" to point to a file that is guaranteed to exist.
53843
- // This helps resolve packages such as @types/node that have no entry point.
53844
- // And then we can use path.dirname() below to locate the package folder,
53845
- // even if the real entry point was in an subfolder with arbitrary nesting.
53846
- pkg.main = 'package.json';
53847
- return pkg;
53848
- },
53849
- realpathSync: getRealPath
53850
- });
53853
+ const resolvedPath = useNodeJSResolver
53854
+ ? require.resolve(`${packageName}/package.json`, {
53855
+ paths: [normalizedRootPath]
53856
+ })
53857
+ : // Append `/package.json` to ensure `resolve.sync` doesn't attempt to return a system package, and to avoid
53858
+ // having to mess with the `packageFilter` option.
53859
+ Resolve.sync(`${packageName}/package.json`, {
53860
+ basedir: normalizedRootPath,
53861
+ preserveSymlinks: false,
53862
+ realpathSync: getRealPath
53863
+ });
53851
53864
  const packagePath = path.dirname(resolvedPath);
53852
53865
  return packagePath;
53853
53866
  }
@@ -53892,18 +53905,11 @@ class Import {
53892
53905
  }
53893
53906
  : undefined;
53894
53907
  Resolve.default(
53895
- // Append a slash to the package name to ensure `resolve` doesn't attempt to return a system package
53896
- `${packageName}/`, {
53908
+ // Append `/package.json` to ensure `resolve` doesn't attempt to return a system package, and to avoid
53909
+ // having to mess with the `packageFilter` option.
53910
+ `${packageName}/package.json`, {
53897
53911
  basedir: normalizedRootPath,
53898
53912
  preserveSymlinks: false,
53899
- packageFilter: (pkg, pkgFile, dir) => {
53900
- // Hardwire "main" to point to a file that is guaranteed to exist.
53901
- // This helps resolve packages such as @types/node that have no entry point.
53902
- // And then we can use path.dirname() below to locate the package folder,
53903
- // even if the real entry point was in an subfolder with arbitrary nesting.
53904
- pkg.main = 'package.json';
53905
- return pkg;
53906
- },
53907
53913
  realpath: realPathFn
53908
53914
  }, (error, resolvedPath) => {
53909
53915
  if (error) {