Skip to content

Commit

Permalink
chore: add creation of a DEPENDENCIES.json file (#7824)
Browse files Browse the repository at this point in the history
adds a DEPENDENCIES.json for programatic use
  • Loading branch information
reggi authored Oct 14, 2024
1 parent 7f541e8 commit 286739c
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
/node_modules/.gitignore text eol=lf
/workspaces/arborist/test/fixtures/.gitignore text eol=lf
/DEPENDENCIES.md text eol=lf
/DEPENDENCIES.json text eol=lf
/AUTHORS text eol=lf

# fixture tarballs should be treated as binary
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
!/CODE_OF_CONDUCT.md
!/configure
!/CONTRIBUTING.md
!/DEPENDENCIES.json
!/DEPENDENCIES.md
!/docs/
!/index.js
Expand Down
99 changes: 99 additions & 0 deletions DEPENDENCIES.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
[
[
"npm"
],
[
"@npmcli/smoke-tests",
"libnpmaccess",
"libnpmexec",
"libnpmpublish"
],
[
"@npmcli/mock-registry",
"libnpmdiff",
"libnpmfund",
"libnpmpack"
],
[
"@npmcli/arborist"
],
[
"@npmcli/metavuln-calculator"
],
[
"pacote",
"@npmcli/config",
"libnpmversion"
],
[
"@npmcli/run-script",
"@npmcli/map-workspaces",
"libnpmhook",
"libnpmorg",
"libnpmsearch",
"libnpmteam",
"init-package-json",
"npm-profile"
],
[
"@npmcli/package-json",
"npm-registry-fetch"
],
[
"@npmcli/git",
"make-fetch-happen"
],
[
"npm-pick-manifest",
"@npmcli/installed-package-contents",
"cacache",
"promzard"
],
[
"@npmcli/docs",
"npm-package-arg",
"npm-install-checks",
"npm-bundled",
"normalize-package-data",
"@npmcli/fs",
"unique-filename",
"npm-packlist",
"@npmcli/mock-globals",
"bin-links",
"nopt",
"parse-conflict-json",
"read-package-json-fast",
"read"
],
[
"@npmcli/eslint-config",
"@npmcli/template-oss",
"ignore-walk",
"semver",
"hosted-git-info",
"proc-log",
"validate-npm-package-name",
"@npmcli/promise-spawn",
"ini",
"npm-normalize-package-bin",
"json-parse-even-better-errors",
"@npmcli/node-gyp",
"fs-minipass",
"ssri",
"unique-slug",
"@npmcli/redact",
"@npmcli/agent",
"minipass-fetch",
"@npmcli/name-from-folder",
"@npmcli/query",
"cmd-shim",
"read-cmd-shim",
"write-file-atomic",
"abbrev",
"proggy",
"minify-registry-metadata",
"mute-stream",
"npm-audit-report",
"npm-user-validate"
]
]
4 changes: 4 additions & 0 deletions scripts/dependency-graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ const main = async function () {
` - ${hierarchyOurs.reverse().join(`${EOL} - `)}`,
]

fs.writeFile(join(CWD, 'DEPENDENCIES.json'),
JSON.stringify(hierarchyOurs.map(v => v.split(', ')), null, 2)
)

return fs.writeFile(join(CWD, 'DEPENDENCIES.md'), out.join(EOL))
}

Expand Down
1 change: 1 addition & 0 deletions scripts/template-oss/root.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ module.exports = {
'/node_modules/',
'/index.js',
'/DEPENDENCIES.md',
'/DEPENDENCIES.json',
'/CONTRIBUTING.md',
'/configure',
'/AUTHORS',
Expand Down

0 comments on commit 286739c

Please sign in to comment.