Skip to content

Commit 286739c

Browse files
authored
chore: add creation of a DEPENDENCIES.json file (#7824)
adds a DEPENDENCIES.json for programatic use
1 parent 7f541e8 commit 286739c

File tree

5 files changed

+106
-0
lines changed

5 files changed

+106
-0
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
/node_modules/.gitignore text eol=lf
1717
/workspaces/arborist/test/fixtures/.gitignore text eol=lf
1818
/DEPENDENCIES.md text eol=lf
19+
/DEPENDENCIES.json text eol=lf
1920
/AUTHORS text eol=lf
2021

2122
# fixture tarballs should be treated as binary

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
!/CODE_OF_CONDUCT.md
2424
!/configure
2525
!/CONTRIBUTING.md
26+
!/DEPENDENCIES.json
2627
!/DEPENDENCIES.md
2728
!/docs/
2829
!/index.js

DEPENDENCIES.json

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
[
2+
[
3+
"npm"
4+
],
5+
[
6+
"@npmcli/smoke-tests",
7+
"libnpmaccess",
8+
"libnpmexec",
9+
"libnpmpublish"
10+
],
11+
[
12+
"@npmcli/mock-registry",
13+
"libnpmdiff",
14+
"libnpmfund",
15+
"libnpmpack"
16+
],
17+
[
18+
"@npmcli/arborist"
19+
],
20+
[
21+
"@npmcli/metavuln-calculator"
22+
],
23+
[
24+
"pacote",
25+
"@npmcli/config",
26+
"libnpmversion"
27+
],
28+
[
29+
"@npmcli/run-script",
30+
"@npmcli/map-workspaces",
31+
"libnpmhook",
32+
"libnpmorg",
33+
"libnpmsearch",
34+
"libnpmteam",
35+
"init-package-json",
36+
"npm-profile"
37+
],
38+
[
39+
"@npmcli/package-json",
40+
"npm-registry-fetch"
41+
],
42+
[
43+
"@npmcli/git",
44+
"make-fetch-happen"
45+
],
46+
[
47+
"npm-pick-manifest",
48+
"@npmcli/installed-package-contents",
49+
"cacache",
50+
"promzard"
51+
],
52+
[
53+
"@npmcli/docs",
54+
"npm-package-arg",
55+
"npm-install-checks",
56+
"npm-bundled",
57+
"normalize-package-data",
58+
"@npmcli/fs",
59+
"unique-filename",
60+
"npm-packlist",
61+
"@npmcli/mock-globals",
62+
"bin-links",
63+
"nopt",
64+
"parse-conflict-json",
65+
"read-package-json-fast",
66+
"read"
67+
],
68+
[
69+
"@npmcli/eslint-config",
70+
"@npmcli/template-oss",
71+
"ignore-walk",
72+
"semver",
73+
"hosted-git-info",
74+
"proc-log",
75+
"validate-npm-package-name",
76+
"@npmcli/promise-spawn",
77+
"ini",
78+
"npm-normalize-package-bin",
79+
"json-parse-even-better-errors",
80+
"@npmcli/node-gyp",
81+
"fs-minipass",
82+
"ssri",
83+
"unique-slug",
84+
"@npmcli/redact",
85+
"@npmcli/agent",
86+
"minipass-fetch",
87+
"@npmcli/name-from-folder",
88+
"@npmcli/query",
89+
"cmd-shim",
90+
"read-cmd-shim",
91+
"write-file-atomic",
92+
"abbrev",
93+
"proggy",
94+
"minify-registry-metadata",
95+
"mute-stream",
96+
"npm-audit-report",
97+
"npm-user-validate"
98+
]
99+
]

scripts/dependency-graph.js

+4
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ const main = async function () {
114114
` - ${hierarchyOurs.reverse().join(`${EOL} - `)}`,
115115
]
116116

117+
fs.writeFile(join(CWD, 'DEPENDENCIES.json'),
118+
JSON.stringify(hierarchyOurs.map(v => v.split(', ')), null, 2)
119+
)
120+
117121
return fs.writeFile(join(CWD, 'DEPENDENCIES.md'), out.join(EOL))
118122
}
119123

scripts/template-oss/root.js

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ module.exports = {
6060
'/node_modules/',
6161
'/index.js',
6262
'/DEPENDENCIES.md',
63+
'/DEPENDENCIES.json',
6364
'/CONTRIBUTING.md',
6465
'/configure',
6566
'/AUTHORS',

0 commit comments

Comments
 (0)