dependency-tree 11.4.0 → 11.4.2

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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/bin/cli.js +4 -4
  3. package/package.json +14 -6
package/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  npm install dependency-tree
11
11
  ```
12
12
 
13
- * Works for JS (AMD, CommonJS, ES6 modules), TypeScript, and CSS preprocessors (CSS (PostCSS), Sass, Stylus, and Less); basically, any module type supported by [Precinct](https://github.com/dependents/node-precinct).
13
+ * Works for JS (AMD, CommonJS, ES6 modules), TypeScript, and CSS preprocessors (CSS (PostCSS), Sass, Stylus, and Less); basically, any module type supported by [precinct](https://github.com/dependents/node-precinct).
14
14
  - For CommonJS modules, 3rd party dependencies (npm installed dependencies) are included in the tree by default
15
15
  - Dependency path resolutions are handled by [filing-cabinet](https://github.com/dependents/node-filing-cabinet)
16
16
  - Supports RequireJS and Webpack loaders
package/bin/cli.js CHANGED
@@ -10,12 +10,14 @@ program
10
10
  .name(name)
11
11
  .description(description)
12
12
  .version(version)
13
+ .argument('<filename>', 'the path to file to examine')
13
14
  .usage('[options] <filename>')
14
15
  .option('-d, --directory <path>', 'location of files of supported filetypes')
15
16
  .option('-c, --require-config <path>', 'path to a requirejs config')
16
17
  .option('-w, --webpack-config <path>', 'path to a webpack config')
17
18
  .option('-t, --ts-config <path>', 'path to a typescript config')
18
19
  .option('--list-form', 'output the list form of the tree (one element per line)')
20
+ .showHelpAfterError()
19
21
  .parse();
20
22
 
21
23
  const cliOptions = program.opts();
@@ -27,16 +29,14 @@ const options = {
27
29
  tsConfig: cliOptions.tsConfig
28
30
  };
29
31
 
30
- let tree;
31
-
32
32
  if (cliOptions.listForm) {
33
- tree = dependencyTree.toList(options);
33
+ const tree = dependencyTree.toList(options);
34
34
 
35
35
  for (const node of tree) {
36
36
  console.log(node);
37
37
  }
38
38
  } else {
39
- tree = dependencyTree(options);
39
+ const tree = dependencyTree(options);
40
40
 
41
41
  console.log(JSON.stringify(tree));
42
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dependency-tree",
3
- "version": "11.4.0",
3
+ "version": "11.4.2",
4
4
  "description": "Get the dependency tree of a module",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -16,7 +16,7 @@
16
16
  "scripts": {
17
17
  "lint": "xo",
18
18
  "fix": "xo --fix",
19
- "mocha": "mocha",
19
+ "mocha": "mocha \"test/*.test.mjs\"",
20
20
  "test": "npm run lint && npm run mocha",
21
21
  "test:ci": "c8 npm run mocha"
22
22
  },
@@ -50,8 +50,8 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "commander": "^12.1.0",
53
- "filing-cabinet": "^5.2.0",
54
- "precinct": "^12.2.0",
53
+ "filing-cabinet": "^5.3.0",
54
+ "precinct": "^12.3.1",
55
55
  "typescript": "^5.9.3"
56
56
  },
57
57
  "devDependencies": {
@@ -59,7 +59,7 @@
59
59
  "debug": "^4.4.3",
60
60
  "mocha": "^11.7.5",
61
61
  "mock-fs": "^5.5.0",
62
- "resolve": "^1.22.11",
62
+ "resolve": "^1.22.12",
63
63
  "sinon": "^19.0.5",
64
64
  "xo": "^0.60.0"
65
65
  },
@@ -103,6 +103,14 @@
103
103
  "unicorn/prefer-module": "off",
104
104
  "unicorn/prefer-top-level-await": "off",
105
105
  "unicorn/prevent-abbreviations": "off"
106
- }
106
+ },
107
+ "overrides": [
108
+ {
109
+ "files": "test/**/*.{c,m}js",
110
+ "envs": [
111
+ "mocha"
112
+ ]
113
+ }
114
+ ]
107
115
  }
108
116
  }