Skip to content

Commit b9f028e

Browse files
committed
chore: add script to rebuild npm-cli-repos.txt
1 parent 31214a6 commit b9f028e

File tree

5 files changed

+37
-18
lines changed

5 files changed

+37
-18
lines changed

DEPENDENCIES.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ graph LR;
136136
npm-->read;
137137
npm-->semver;
138138
npm-->ssri;
139-
npm-->treeverse;
140139
npm-->validate-npm-package-name;
141140
npm-->write-file-atomic;
142141
npm-bundled-->npm-normalize-package-bin;
@@ -184,7 +183,6 @@ graph LR;
184183
npmcli-arborist-->read-package-json-fast;
185184
npmcli-arborist-->semver;
186185
npmcli-arborist-->ssri;
187-
npmcli-arborist-->treeverse;
188186
npmcli-config-->ini;
189187
npmcli-config-->nopt;
190188
npmcli-config-->npmcli-eslint-config["@npmcli/eslint-config"];
@@ -801,4 +799,4 @@ packages higher up the chain.
801799
- @npmcli/git, make-fetch-happen, @npmcli/config, init-package-json
802800
- @npmcli/installed-package-contents, @npmcli/map-workspaces, cacache, npm-pick-manifest, @npmcli/run-script, read-package-json, promzard
803801
- @npmcli/docs, @npmcli/fs, npm-bundled, read-package-json-fast, unique-filename, npm-install-checks, npm-package-arg, npm-packlist, normalize-package-data, @npmcli/package-json, bin-links, nopt, npmlog, parse-conflict-json, read
804-
- @npmcli/eslint-config, @npmcli/template-oss, ignore-walk, semver, npm-normalize-package-bin, @npmcli/name-from-folder, json-parse-even-better-errors, fs-minipass, ssri, unique-slug, @npmcli/promise-spawn, hosted-git-info, proc-log, validate-npm-package-name, @npmcli/node-gyp, minipass-fetch, @npmcli/query, cmd-shim, read-cmd-shim, write-file-atomic, abbrev, are-we-there-yet, gauge, treeverse, minify-registry-metadata, ini, @npmcli/disparity-colors, mute-stream, npm-audit-report, npm-user-validate
802+
- @npmcli/eslint-config, @npmcli/template-oss, ignore-walk, semver, npm-normalize-package-bin, @npmcli/name-from-folder, json-parse-even-better-errors, fs-minipass, ssri, unique-slug, @npmcli/promise-spawn, hosted-git-info, proc-log, validate-npm-package-name, @npmcli/node-gyp, minipass-fetch, @npmcli/query, cmd-shim, read-cmd-shim, write-file-atomic, abbrev, are-we-there-yet, gauge, minify-registry-metadata, ini, @npmcli/disparity-colors, mute-stream, npm-audit-report, npm-user-validate

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@
205205
"tap": "^16.3.4"
206206
},
207207
"scripts": {
208-
"dependencies": "node scripts/bundle-and-gitignore-deps.js && node scripts/dependency-graph.js",
208+
"dependencies": "node scripts/bundle-and-gitignore-deps.js && node scripts/update-cli-repos.js && node scripts/dependency-graph.js",
209209
"dumpconf": "env | grep npm | sort | uniq",
210210
"licenses": "licensee --production --errors-only",
211211
"test": "tap",

scripts/npm-cli-repos.txt

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,20 @@ are-we-there-yet
44
benchmarks
55
bin-links
66
cacache
7+
ci-detect
78
cli
89
cmd-shim
9-
config
1010
create-oss
11-
dezalgo
1211
disparity-colors
13-
doctornpm
1412
documentation
1513
eslint-config
16-
exec
1714
fs
1815
fs-minipass
1916
gauge
2017
git
2118
graphec
2219
hosted-git-info
2320
ignore-walk
24-
infer-owner
25-
inflight
2621
ini
2722
init-package-json
2823
installed-package-contents
@@ -32,13 +27,11 @@ map-workspaces
3227
metavuln-calculator
3328
minify-registry-metadata
3429
minipass-fetch
35-
move-file
3630
mute-stream
3731
name-from-folder
38-
nock-registry
32+
node
3933
node-gyp
4034
node-semver
41-
node-tar
4235
node-which
4336
nopt
4437
normalize-package-data
@@ -53,7 +46,6 @@ npm-packlist
5346
npm-pick-manifest
5447
npm-profile
5548
npm-registry-fetch
56-
npm-registry-mock
5749
npm-user-validate
5850
npmlog
5951
package-json
@@ -68,17 +60,15 @@ read
6860
read-cmd-shim
6961
read-package-json
7062
read-package-json-fast
71-
readdir-scoped-modules
63+
release-please
7264
rfcs
7365
run-script
7466
ssri
7567
stafftools
7668
statusboard
7769
tap-nock
7870
template-oss
79-
treeverse
8071
unique-filename
8172
unique-slug
8273
validate-npm-package-name
83-
wrappy
8474
write-file-atomic

scripts/resetdeps.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
const { join } = require('path')
33
const { CWD, run, pkg, fs, git, npm } = require('./util.js')
4+
const ciInfo = require('ci-info')
45

56
const checkout = () => git('checkout', 'node_modules/')
67

@@ -13,7 +14,9 @@ const main = async ({ packageLock }) => {
1314
await checkout()
1415
await npm('i', '--ignore-scripts', '--no-audit', '--no-fund', packageLock && '--package-lock')
1516
await npm('rebuild', '--ignore-scripts')
16-
await npm('run', 'dependencies', '--ignore-scripts')
17+
if (!ciInfo.isCI) {
18+
await npm('run', 'dependencies', '--ignore-scripts')
19+
}
1720
}
1821

1922
run(main).catch(checkout)

scripts/update-cli-repos.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
const { join } = require('path')
2+
const { fs, gh, run } = require('./util.js')
3+
4+
const query = `
5+
query {
6+
search (query: "org:npm topic:npm-cli fork:true archived:false", type: REPOSITORY, first: 100) {
7+
nodes {
8+
... on Repository {
9+
name
10+
}
11+
}
12+
}
13+
}
14+
`
15+
16+
const main = async () => {
17+
const result = await gh('api', 'graphql', '-f', `query=${query}`, { stdio: 'pipe' })
18+
if (result.code !== 0) {
19+
throw new Error(result.stderr)
20+
}
21+
22+
const repoList = JSON.parse(result.stdout)
23+
const sortedRepoList = repoList.data.search.nodes.map((node) => node.name).sort()
24+
25+
return fs.writeFile(join(__dirname, 'npm-cli-repos.txt'), sortedRepoList.join('\n'))
26+
}
27+
28+
run(main)

0 commit comments

Comments
 (0)