dependency-tree 11.0.2 → 11.1.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/README.md CHANGED
@@ -50,6 +50,7 @@ const list = dependencyTree.toList({
50
50
  * `requireConfig`: path to a requirejs config for AMD modules (allows for the result of aliased module paths)
51
51
  * `webpackConfig`: path to a webpack config for aliased modules
52
52
  * `tsConfig`: path to a typescript config (or a preloaded object representing the typescript config)
53
+ * `tsConfigPath`: a (virtual) path to typescript config file when `tsConfig` option is given as an object, not a string. Needed to calculate [Path Mapping](https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping). If not given when `tsConfig` is an object, **Path Mapping** is ignored. This is not needed when `tsConfig` is given as a path string.
53
54
  * `nodeModulesConfig`: config for resolving entry file for node_modules
54
55
  * `visited`: object used for avoiding redundant subtree generations via memoization.
55
56
  * `nonExistent`: array used for storing the list of partial paths that do not exist
package/index.js CHANGED
@@ -106,6 +106,7 @@ module.exports._getDependencies = function(config = {}) {
106
106
  webpackConfig: config.webpackConfig,
107
107
  nodeModulesConfig: config.nodeModulesConfig,
108
108
  tsConfig: config.tsConfig,
109
+ tsConfigPath: config.tsConfigPath,
109
110
  noTypeDefinitions: config.noTypeDefinitions
110
111
  });
111
112
 
package/lib/config.js CHANGED
@@ -18,8 +18,8 @@ module.exports = class Config {
18
18
  this.nodeModulesConfig = options.nodeModulesConfig;
19
19
  this.detectiveConfig = options.detective || options.detectiveConfig || {};
20
20
  this.tsConfig = options.tsConfig;
21
+ this.tsConfigPath = options.tsConfigPath;
21
22
  this.noTypeDefinitions = options.noTypeDefinitions;
22
-
23
23
  this.filter = options.filter;
24
24
 
25
25
  if (!this.filename) throw new Error('filename not given');
@@ -31,6 +31,7 @@ module.exports = class Config {
31
31
  const ts = require('typescript');
32
32
  const tsParsedConfig = ts.readJsonConfigFile(this.tsConfig, ts.sys.readFile);
33
33
  const obj = ts.parseJsonSourceFileConfigFileContent(tsParsedConfig, ts.sys, path.dirname(this.tsConfig));
34
+ this.tsConfigPath ||= this.tsConfig;
34
35
  this.tsConfig = obj.raw;
35
36
  }
36
37
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dependency-tree",
3
- "version": "11.0.2",
3
+ "version": "11.1.1",
4
4
  "description": "Get the dependency tree of a module",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -50,8 +50,8 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "commander": "^12.1.0",
53
- "filing-cabinet": "^5.0.2",
54
- "precinct": "^12.1.3",
53
+ "filing-cabinet": "^5.0.3",
54
+ "precinct": "^12.2.0",
55
55
  "typescript": "^5.7.3"
56
56
  },
57
57
  "devDependencies": {