dependency-tree 7.1.0 → 8.0.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/README.md +2 -2
- package/lib/Config.js +8 -0
- package/package.json +14 -16
- package/.node-version +0 -1
package/README.md
CHANGED
|
@@ -49,8 +49,8 @@ var list = dependencyTree.toList({
|
|
|
49
49
|
* `filter`: a function used to determine if a module (and its subtree) should be included in the dependency tree
|
|
50
50
|
- The first argument given to the filter is an absolute filepath to the dependency and the second is the filepath to the currently traversed file. Should return a `Boolean`. If it returns `true`, the module is included in the resulting tree.
|
|
51
51
|
* `detective`: object with configuration specific to detectives used to find dependencies of a file
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
- for example `detective.amd.skipLazyLoaded: true` tells the AMD detective to omit inner requires
|
|
53
|
+
- See [precinct's usage docs](https://github.com/dependents/node-precinct#usage) for the list of module types you can pass options to.
|
|
54
54
|
|
|
55
55
|
#### Format Details
|
|
56
56
|
|
package/lib/Config.js
CHANGED
|
@@ -22,6 +22,14 @@ class Config {
|
|
|
22
22
|
if (!this.directory) { throw new Error('directory not given'); }
|
|
23
23
|
if (this.filter && typeof this.filter !== 'function') { throw new Error('filter must be a function'); }
|
|
24
24
|
|
|
25
|
+
if ('string' === typeof this.tsConfig) {
|
|
26
|
+
debug('preparsing the ts config into an object for performance');
|
|
27
|
+
const ts = require('typescript');
|
|
28
|
+
const tsParsedConfig = ts.readJsonConfigFile(this.tsConfig, ts.sys.readFile);
|
|
29
|
+
const obj = ts.parseJsonSourceFileConfigFileContent(tsParsedConfig, ts.sys, path.dirname(this.tsConfig));
|
|
30
|
+
this.tsConfig = obj.raw;
|
|
31
|
+
}
|
|
32
|
+
|
|
25
33
|
debug('given filename: ' + this.filename);
|
|
26
34
|
|
|
27
35
|
this.filename = path.resolve(process.cwd(), this.filename);
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dependency-tree",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "Get the dependency tree of a module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"test": "jscs index.js test/test.js && ./node_modules/.bin/mocha --require
|
|
7
|
+
"test": "jscs index.js test/test.js && ./node_modules/.bin/mocha --require esm test/test.js"
|
|
8
8
|
},
|
|
9
9
|
"bin": {
|
|
10
10
|
"dependency-tree": "bin/cli.js"
|
|
@@ -34,26 +34,24 @@
|
|
|
34
34
|
"url": "https://github.com/mrjoelkemp/node-dependency-tree/issues"
|
|
35
35
|
},
|
|
36
36
|
"engines": {
|
|
37
|
-
"node": ">=
|
|
37
|
+
"node": "^10.13 || ^12 || >=14"
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://github.com/mrjoelkemp/node-dependency-tree",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"commander": "^2.
|
|
42
|
-
"debug": "^4.
|
|
43
|
-
"filing-cabinet": "^
|
|
44
|
-
"precinct": "^
|
|
41
|
+
"commander": "^2.20.3",
|
|
42
|
+
"debug": "^4.3.1",
|
|
43
|
+
"filing-cabinet": "^3.0.0",
|
|
44
|
+
"precinct": "^7.0.0",
|
|
45
|
+
"typescript": "^3.9.7"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
|
-
"
|
|
48
|
-
"@babel/core": "^7.2.2",
|
|
49
|
-
"@babel/preset-env": "^7.2.3",
|
|
50
|
-
"@babel/register": "^7.0.0",
|
|
48
|
+
"esm": "^3.2.25",
|
|
51
49
|
"jscs": "^3.0.7",
|
|
52
50
|
"jscs-preset-mrjoelkemp": "~2.0.0",
|
|
53
|
-
"mocha": "^
|
|
54
|
-
"mock-fs": "^4.
|
|
55
|
-
"resolve": "^1.
|
|
56
|
-
"rewire": "^
|
|
57
|
-
"sinon": "^
|
|
51
|
+
"mocha": "^8.2.1",
|
|
52
|
+
"mock-fs": "^4.13.0",
|
|
53
|
+
"resolve": "^1.19.0",
|
|
54
|
+
"rewire": "^5.0.0",
|
|
55
|
+
"sinon": "^9.2.1"
|
|
58
56
|
}
|
|
59
57
|
}
|
package/.node-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
8.16.2
|