Skip to content

Commit 83e4e12

Browse files
committed
try: get deps list
1 parent 9d3310a commit 83e4e12

File tree

4 files changed

+74
-5
lines changed

4 files changed

+74
-5
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,16 @@ tests on custom file
4747
- https://eslint.org/docs/rules/no-restricted-syntax - one must know ASTs
4848
- Didn't found any valid resource on eslint, assume that no resources exist for babel
4949

50-
Try
50+
Try
5151
- `tsc --extendedDiagnostics`
5252
How long stuff took and how big/complex it is.
5353
- `tsc --listFiles`
5454
List of every file included in the compilation.
5555
- `tsc --explainFiles`
5656
List of every file and *why* it's included.
5757
- https://github.com/amcasey/ts-analyze-trace
58+
59+
❌ add search by dependencies using dpdm
5860

5961
✅ Think if we can solve problems with exports using rev-dep
6062
- how to get root files in rev-dep

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"babel-plugin-root-import": "^6.6.0",
2323
"copy-webpack-plugin": "^10.2.0",
2424
"dependency-cruiser": "^11.3.0",
25+
"dpdm": "^3.8.0",
2526
"fs-extra": "^10.0.0",
2627
"jest": "^27.4.4",
2728
"node-fetch-commonjs": "^3.1.1",

tools/dpdm-test.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const { parseDependencyTree } = require('dpdm');
2+
3+
const entryPoint = 'src/search.ts'
4+
5+
console.log('entryPoint', entryPoint)
6+
// Entry point is glob, relative to cwd I suppose (absolute path does not work)
7+
parseDependencyTree(entryPoint, {
8+
/* options, see below */
9+
}).then((tree) => {
10+
console.log('tree', tree);
11+
const projectFiles = Object.keys(tree).filter((file) => !file.includes('node_modules') && /\.(ts|js|tsx|jsx|json|mjs)$/.test(file))
12+
console.log('projectFiles', projectFiles)
13+
});

yarn.lock

Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,14 @@
12301230
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83"
12311231
integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw==
12321232

1233-
"@types/glob@^7.2.0":
1233+
"@types/fs-extra@^9.0.12":
1234+
version "9.0.13"
1235+
resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-9.0.13.tgz#7594fbae04fe7f1918ce8b3d213f74ff44ac1f45"
1236+
integrity sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==
1237+
dependencies:
1238+
"@types/node" "*"
1239+
1240+
"@types/glob@^7.1.4", "@types/glob@^7.2.0":
12341241
version "7.2.0"
12351242
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb"
12361243
integrity sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==
@@ -1333,6 +1340,13 @@
13331340
dependencies:
13341341
"@types/yargs-parser" "*"
13351342

1343+
"@types/yargs@^17.0.2":
1344+
version "17.0.8"
1345+
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.8.tgz#d23a3476fd3da8a0ea44b5494ca7fa677b9dad4c"
1346+
integrity sha512-wDeUwiUmem9FzsyysEwRukaEdDNcwbROvQ9QGRKaLI6t+IltNzbn4/i4asmB10auvZGQCzSQ6t0GSczEThlUXw==
1347+
dependencies:
1348+
"@types/yargs-parser" "*"
1349+
13361350
"@wasm-tool/wasm-pack-plugin@^1.6.0":
13371351
version "1.6.0"
13381352
resolved "https://registry.yarnpkg.com/@wasm-tool/wasm-pack-plugin/-/wasm-pack-plugin-1.6.0.tgz#a2dbec777b317b04f72e13f0080a3f483cd89809"
@@ -2321,6 +2335,22 @@ domexception@^2.0.1:
23212335
dependencies:
23222336
webidl-conversions "^5.0.0"
23232337

2338+
dpdm@^3.8.0:
2339+
version "3.8.0"
2340+
resolved "https://registry.yarnpkg.com/dpdm/-/dpdm-3.8.0.tgz#3bd73433ca97fc54f92f130b1c7d9070d55463ce"
2341+
integrity sha512-irzNgThrdJEf61l5F3w8yMLjjZfw4c2LL//xZGZ3q7E6YhVBCiEApduRNtSw1Og6UCVub5GzwwZn3WT0tO8hSA==
2342+
dependencies:
2343+
"@types/fs-extra" "^9.0.12"
2344+
"@types/glob" "^7.1.4"
2345+
"@types/yargs" "^17.0.2"
2346+
chalk "^4.1.2"
2347+
fs-extra "^10.0.0"
2348+
glob "^7.1.7"
2349+
ora "^5.4.1"
2350+
tslib "^2.3.1"
2351+
typescript "^4.4.3"
2352+
yargs "^17.1.1"
2353+
23242354
duplexer2@~0.1.4:
23252355
version "0.1.4"
23262356
resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1"
@@ -2665,7 +2695,7 @@ glob-to-regexp@^0.4.1:
26652695
resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e"
26662696
integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==
26672697

2668-
glob@7.2.0, glob@^7.0.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4:
2698+
glob@7.2.0, glob@^7.0.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.7:
26692699
version "7.2.0"
26702700
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023"
26712701
integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==
@@ -4316,7 +4346,7 @@ string-length@^4.0.1:
43164346
char-regex "^1.0.2"
43174347
strip-ansi "^6.0.0"
43184348

4319-
string-width@^4.1.0, string-width@^4.2.0:
4349+
string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
43204350
version "4.2.3"
43214351
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
43224352
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -4537,7 +4567,7 @@ tsconfig-paths@^3.9.0:
45374567
minimist "^1.2.0"
45384568
strip-bom "^3.0.0"
45394569

4540-
tslib@^2.1.0:
4570+
tslib@^2.1.0, tslib@^2.3.1:
45414571
version "2.3.1"
45424572
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01"
45434573
integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==
@@ -4566,6 +4596,11 @@ typedarray-to-buffer@^3.1.5:
45664596
dependencies:
45674597
is-typedarray "^1.0.0"
45684598

4599+
typescript@^4.4.3:
4600+
version "4.5.5"
4601+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3"
4602+
integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==
4603+
45694604
typescript@^4.5.2:
45704605
version "4.5.2"
45714606
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.2.tgz#8ac1fba9f52256fdb06fb89e4122fa6a346c2998"
@@ -4855,6 +4890,11 @@ yargs-parser@20.x, yargs-parser@^20.2.2:
48554890
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
48564891
integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==
48574892

4893+
yargs-parser@^21.0.0:
4894+
version "21.0.0"
4895+
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.0.tgz#a485d3966be4317426dd56bdb6a30131b281dc55"
4896+
integrity sha512-z9kApYUOCwoeZ78rfRYYWdiU/iNL6mwwYlkkZfJoyMR1xps+NEBX5X7XmRpxkZHhXJ6+Ey00IwKxBBSW9FIjyA==
4897+
48584898
yargs@^16.2.0:
48594899
version "16.2.0"
48604900
resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
@@ -4867,3 +4907,16 @@ yargs@^16.2.0:
48674907
string-width "^4.2.0"
48684908
y18n "^5.0.5"
48694909
yargs-parser "^20.2.2"
4910+
4911+
yargs@^17.1.1:
4912+
version "17.3.1"
4913+
resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.3.1.tgz#da56b28f32e2fd45aefb402ed9c26f42be4c07b9"
4914+
integrity sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==
4915+
dependencies:
4916+
cliui "^7.0.2"
4917+
escalade "^3.1.1"
4918+
get-caller-file "^2.0.5"
4919+
require-directory "^2.1.1"
4920+
string-width "^4.2.3"
4921+
y18n "^5.0.5"
4922+
yargs-parser "^21.0.0"

0 commit comments

Comments
 (0)