binary-collections 2.0.13 → 2.0.14

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 (286) hide show
  1. package/binaries/binary-executor.cjs +307 -238
  2. package/binaries/clean-nodemodule.cjs +307 -238
  3. package/binaries/clean-nodemodules.cjs +307 -238
  4. package/binaries/composer.cjs +323 -0
  5. package/binaries/composer.cmd +2 -0
  6. package/binaries/composer.phar +0 -0
  7. package/binaries/dev.cjs +307 -238
  8. package/binaries/empty.cjs +307 -238
  9. package/binaries/git-reduce-size.cjs +307 -238
  10. package/binaries/javakill.cjs +307 -238
  11. package/binaries/kill-process.cjs +307 -238
  12. package/binaries/nodekill.cjs +307 -238
  13. package/binaries/prod.cjs +307 -238
  14. package/binaries/py.cjs +307 -238
  15. package/binaries/rmfind.cjs +307 -238
  16. package/binaries/rmx.cjs +307 -238
  17. package/binaries/submodule-token.cjs +307 -238
  18. package/binaries/test-cjs.cjs +307 -238
  19. package/binaries/test-esm.cjs +307 -238
  20. package/binaries/yarn-clean.cjs +307 -238
  21. package/binaries/yc.cjs +307 -238
  22. package/binaries/ycw.cjs +307 -238
  23. package/docs-src/binary-collections.md +1 -1
  24. package/docs-src/clean-github-actions-caches.md +1 -1
  25. package/docs-src/copy-move-file.md +1 -4
  26. package/docs-src/del-ps.md +1 -1
  27. package/docs-src/find-node-modules.md +1 -1
  28. package/docs-src/generate-test-ci.md +56 -0
  29. package/docs-src/get-latest-workflow-status.md +100 -0
  30. package/docs-src/git-diff.md +1 -1
  31. package/docs-src/git-fix.md +1 -1
  32. package/docs-src/git-purge.md +1 -1
  33. package/docs-src/kill-night-crows.md +1 -1
  34. package/docs-src/node-cache-cleaner.md +2 -2
  35. package/docs-src/node-package-packer.md +1 -1
  36. package/docs-src/opencode-cli.md +127 -0
  37. package/docs-src/package-resolutions-updater.md +1 -1
  38. package/docs-src/rmpath.md +1 -1
  39. package/docs-src/run-by-checksum.md +1 -1
  40. package/docs-src/submodule-remove.md +1 -1
  41. package/docs-src/upload-backend.md +29 -0
  42. package/docs-src/vscode-cli.md +84 -0
  43. package/docs-src/workflow-badge.md +120 -0
  44. package/lib/binary-collections/config.cjs +14 -2
  45. package/lib/binary-collections/config.d.cts +10 -0
  46. package/lib/binary-collections/config.mjs +2 -2
  47. package/lib/binary-collections/findScript.cjs +43 -21
  48. package/lib/binary-collections/findScript.mjs +2 -2
  49. package/lib/binary-collections/listScript.cjs +43 -21
  50. package/lib/binary-collections/listScript.mjs +2 -2
  51. package/lib/binary-collections.cjs +43 -21
  52. package/lib/binary-collections.mjs +6 -6
  53. package/lib/chunk-2SJKVOTN.mjs +146 -0
  54. package/lib/{chunk-2MN4VPV2.mjs → chunk-3F6EIHYG.mjs} +2 -2
  55. package/lib/chunk-546KAIYT.mjs +113 -0
  56. package/lib/chunk-56BVU63B.mjs +86 -0
  57. package/lib/chunk-5WAOOOGZ.mjs +77 -0
  58. package/lib/chunk-72XTQ3CK.mjs +45 -0
  59. package/lib/chunk-7N52Z4IJ.mjs +39 -0
  60. package/lib/chunk-7Q6YEUQF.mjs +246 -0
  61. package/lib/{chunk-NQXUYO67.mjs → chunk-AJ3OIYYP.mjs} +43 -21
  62. package/lib/chunk-AQZ7LMFS.mjs +100 -0
  63. package/lib/chunk-BDCMTOZI.mjs +246 -0
  64. package/lib/chunk-BEUM4LH4.mjs +184 -0
  65. package/lib/{chunk-TBWXE7ST.mjs → chunk-BO4TZS4Q.mjs} +5 -2
  66. package/lib/chunk-CM3IC5YC.mjs +226 -0
  67. package/lib/{chunk-FLYSZFLW.mjs → chunk-D42YBRZW.mjs} +1 -1
  68. package/lib/chunk-FR3DMHJC.mjs +146 -0
  69. package/lib/chunk-I3O5ZRYU.mjs +77 -0
  70. package/lib/chunk-J4M5EL5P.mjs +108 -0
  71. package/lib/chunk-JK3MG2KF.mjs +236 -0
  72. package/lib/chunk-JMUFQSPE.mjs +184 -0
  73. package/lib/chunk-JVMLKHD2.mjs +62 -0
  74. package/lib/chunk-KAT2JNLZ.mjs +146 -0
  75. package/lib/{chunk-CD3HF3LK.mjs → chunk-KRCPFWIF.mjs} +6 -3
  76. package/lib/chunk-LACQTD5V.mjs +225 -0
  77. package/lib/chunk-MCCMMZSM.mjs +60 -0
  78. package/lib/chunk-OA2RKEY3.mjs +162 -0
  79. package/lib/{chunk-X2B3X7D4.mjs → chunk-PAZH45HS.mjs} +7 -1
  80. package/lib/chunk-QZMGBDSA.mjs +32 -0
  81. package/lib/chunk-RKPIBGKE.mjs +61 -0
  82. package/lib/chunk-SARIXFHP.mjs +44 -0
  83. package/lib/chunk-SJYP66BO.mjs +62 -0
  84. package/lib/chunk-SWUAEY4H.mjs +44 -0
  85. package/lib/chunk-TP3O2JGW.mjs +88 -0
  86. package/lib/chunk-UAIF5VIA.mjs +89 -0
  87. package/lib/chunk-UDZBVKXH.mjs +94 -0
  88. package/lib/chunk-UEOWRYAN.mjs +32 -0
  89. package/lib/chunk-UHPFLJXH.mjs +227 -0
  90. package/lib/chunk-UYNBNLV5.mjs +113 -0
  91. package/lib/chunk-WOC4FZ6F.mjs +164 -0
  92. package/lib/chunk-X7UVQ6ZC.mjs +183 -0
  93. package/lib/{chunk-RDN6HF5Z.mjs → chunk-XI67TI46.mjs} +1 -1
  94. package/lib/chunk-XW5NZAKI.mjs +82 -0
  95. package/lib/chunk-YLV4QATP.mjs +86 -0
  96. package/lib/chunk-YWSLMAQ7.mjs +65 -0
  97. package/lib/chunk-ZB4IQ6VJ.mjs +46 -0
  98. package/lib/cross-env/index.mjs +3 -3
  99. package/lib/del-gradle.cjs +1 -1
  100. package/lib/del-gradle.mjs +22 -16
  101. package/lib/del-node-modules.cjs +1 -1
  102. package/lib/del-node-modules.mjs +148 -142
  103. package/lib/find-node-modules-cli.cjs +1 -1
  104. package/lib/find-node-modules-cli.mjs +10 -4
  105. package/lib/{git-diff-cli.cjs → git/git-diff-cli.cjs} +18 -6
  106. package/lib/{git-diff-cli.mjs → git/git-diff-cli.mjs} +7 -7
  107. package/lib/{git-diff.cjs → git/git-diff.cjs} +16 -4
  108. package/lib/{git-diff.js → git/git-diff.js} +3 -3
  109. package/lib/{git-diff.mjs → git/git-diff.mjs} +6 -6
  110. package/lib/{git-fix.cjs → git/git-fix.cjs} +134 -3
  111. package/lib/{git-fix.mjs → git/git-fix.mjs} +19 -14
  112. package/lib/{git-purge.cjs → git/git-purge.cjs} +1 -1
  113. package/lib/{git-purge.mjs → git/git-purge.mjs} +4 -4
  114. package/lib/git/user-config.cjs +131 -1
  115. package/lib/git/user-config.mjs +3 -1
  116. package/lib/{clean-github-actions-caches-cli.cjs → github-workflows/clean-github-actions-caches-cli.cjs} +38 -10
  117. package/lib/{clean-github-actions-caches-cli.mjs → github-workflows/clean-github-actions-caches-cli.mjs} +7 -6
  118. package/lib/{clean-github-actions-caches.cjs → github-workflows/clean-github-actions-caches.cjs} +38 -10
  119. package/lib/{clean-github-actions-caches.mjs → github-workflows/clean-github-actions-caches.mjs} +5 -4
  120. package/lib/github-workflows/generate-test-ci-step-cli.cjs +240 -0
  121. package/lib/github-workflows/generate-test-ci-step-cli.d.mts +2 -0
  122. package/lib/github-workflows/generate-test-ci-step-cli.mjs +132 -0
  123. package/lib/github-workflows/get-latest-workflow-status-cli.cjs +541 -0
  124. package/lib/github-workflows/get-latest-workflow-status-cli.d.mts +2 -0
  125. package/lib/github-workflows/get-latest-workflow-status-cli.mjs +61 -0
  126. package/lib/github-workflows/get-latest-workflow-status.cjs +56 -0
  127. package/lib/github-workflows/get-latest-workflow-status.d.mts +1 -0
  128. package/lib/github-workflows/get-latest-workflow-status.mjs +8 -0
  129. package/lib/github-workflows/utils.cjs +271 -0
  130. package/lib/github-workflows/utils.d.cts +76 -0
  131. package/lib/github-workflows/utils.mjs +8 -0
  132. package/lib/github-workflows/workflow-badge-cli.cjs +722 -0
  133. package/lib/github-workflows/workflow-badge-cli.d.mts +2 -0
  134. package/lib/github-workflows/workflow-badge-cli.mjs +98 -0
  135. package/lib/github-workflows/workflow-badge-generator.cjs +200 -0
  136. package/lib/github-workflows/workflow-badge-generator.d.mts +14 -0
  137. package/lib/github-workflows/workflow-badge-generator.mjs +8 -0
  138. package/lib/github-workflows/workflow-test-data.cjs +73 -0
  139. package/lib/github-workflows/workflow-test-data.d.cts +63 -0
  140. package/lib/github-workflows/workflow-test-data.mjs +6 -0
  141. package/lib/opencode/cli/auth-rotate.cjs +143 -0
  142. package/lib/opencode/cli/auth-rotate.d.ts +1 -0
  143. package/lib/opencode/cli/auth-rotate.js +70 -0
  144. package/lib/opencode/cli/auth-rotate.mjs +10 -0
  145. package/lib/opencode/cli/list-projects.cjs +184 -0
  146. package/lib/opencode/cli/list-projects.d.ts +1 -0
  147. package/lib/opencode/cli/list-projects.js +32 -0
  148. package/lib/opencode/cli/list-projects.mjs +11 -0
  149. package/lib/opencode/cli/list-sessions.cjs +215 -0
  150. package/lib/opencode/cli/list-sessions.d.ts +1 -0
  151. package/lib/opencode/cli/list-sessions.js +45 -0
  152. package/lib/opencode/cli/list-sessions.mjs +11 -0
  153. package/lib/opencode/database.cjs +349 -0
  154. package/lib/opencode/database.d.ts +91 -0
  155. package/lib/opencode/database.js +252 -0
  156. package/lib/opencode/database.mjs +28 -0
  157. package/lib/opencode/database.runner.cjs +145 -0
  158. package/lib/opencode/database.runner.d.ts +1 -0
  159. package/lib/opencode/database.runner.js +56 -0
  160. package/lib/opencode/database.runner.mjs +37 -0
  161. package/lib/opencode/opencode-zen.runner.cjs +48 -0
  162. package/lib/opencode/opencode-zen.runner.d.mts +1 -0
  163. package/lib/opencode/opencode-zen.runner.mjs +31 -0
  164. package/lib/opencode/sqlite.cjs +114 -0
  165. package/lib/opencode/sqlite.d.ts +18 -0
  166. package/lib/opencode/sqlite.js +82 -0
  167. package/lib/opencode/sqlite.mjs +10 -0
  168. package/lib/opencode/storage.cjs +124 -0
  169. package/lib/opencode/storage.d.ts +27 -0
  170. package/lib/opencode/storage.js +101 -0
  171. package/lib/opencode/storage.mjs +38 -0
  172. package/lib/opencode/storage.runner.cjs +50 -0
  173. package/lib/opencode/storage.runner.d.ts +1 -0
  174. package/lib/opencode/storage.runner.js +13 -0
  175. package/lib/opencode/storage.runner.mjs +29 -0
  176. package/lib/opencode/types.cjs +17 -0
  177. package/lib/opencode/types.d.ts +31 -0
  178. package/lib/opencode/types.js +2 -0
  179. package/lib/opencode/types.mjs +7 -0
  180. package/lib/opencode/utils/check-api.cjs +59 -0
  181. package/lib/opencode/utils/check-api.d.ts +12 -0
  182. package/lib/opencode/utils/check-api.js +46 -0
  183. package/lib/opencode/utils/check-api.mjs +8 -0
  184. package/lib/opencode-cli.cjs +473 -0
  185. package/lib/opencode-cli.d.ts +2 -0
  186. package/lib/opencode-cli.js +115 -0
  187. package/lib/opencode-cli.mjs +111 -0
  188. package/lib/package-resolutions-updater-cli.cjs +181 -154
  189. package/lib/package-resolutions-updater-cli.mjs +3 -2
  190. package/lib/package-resolutions-updater.cjs +181 -154
  191. package/lib/package-resolutions-updater.d.mts +12 -3
  192. package/lib/package-resolutions-updater.mjs +3 -2
  193. package/lib/print-directory-tree.cjs +131 -3
  194. package/lib/print-directory-tree.mjs +6 -3
  195. package/lib/rmpath-cli.cjs +131 -5
  196. package/lib/rmpath-cli.mjs +3 -1
  197. package/lib/rmpath.cjs +147 -11
  198. package/lib/rmpath.mjs +3 -1
  199. package/lib/run-by-checksum/hash.cjs +18 -2
  200. package/lib/run-by-checksum/hash.d.ts +4 -1
  201. package/lib/run-by-checksum/hash.js +38 -4
  202. package/lib/run-by-checksum/hash.mjs +1 -1
  203. package/lib/run-by-checksum/run.cjs +18 -2
  204. package/lib/run-by-checksum/run.mjs +2 -2
  205. package/lib/run-by-checksum-cli.cjs +18 -2
  206. package/lib/run-by-checksum-cli.mjs +2 -2
  207. package/lib/submodule-install.cjs +130 -4
  208. package/lib/submodule-install.mjs +5 -4
  209. package/lib/submodule-remove-cli.cjs +131 -5
  210. package/lib/submodule-remove-cli.mjs +3 -1
  211. package/lib/submodule-remove.cjs +146 -5
  212. package/lib/submodule-remove.mjs +3 -1
  213. package/lib/utils/findEnvFiles.cjs +3 -0
  214. package/lib/utils/findEnvFiles.d.cts +2 -2
  215. package/lib/utils/findEnvFiles.mjs +1 -1
  216. package/lib/vscode/project.cjs +0 -0
  217. package/lib/vscode/project.d.ts +0 -0
  218. package/lib/vscode/project.js +1 -0
  219. package/lib/vscode/project.mjs +7 -0
  220. package/lib/vscode/storage.cjs +138 -0
  221. package/lib/vscode/storage.d.ts +51 -0
  222. package/lib/vscode/storage.js +169 -0
  223. package/lib/vscode/storage.mjs +42 -0
  224. package/lib/vscode/storage.runner.cjs +125 -0
  225. package/lib/vscode/storage.runner.d.ts +1 -0
  226. package/lib/vscode/storage.runner.js +47 -0
  227. package/lib/vscode/storage.runner.mjs +60 -0
  228. package/lib/vscode-cli.cjs +155 -0
  229. package/lib/vscode-cli.d.ts +2 -0
  230. package/lib/vscode-cli.js +80 -0
  231. package/lib/vscode-cli.mjs +71 -0
  232. package/package.json +43 -21
  233. package/readme.md +41 -8
  234. package/releases/readme.md +1 -1
  235. package/src/github-workflows/generate-test-ci-step-cli.mjs +126 -0
  236. package/vendor/clue/ndjson-react/README.md +365 -0
  237. package/vendor/composer/pcre/README.md +189 -0
  238. package/vendor/composer/semver/README.md +99 -0
  239. package/vendor/composer/xdebug-handler/README.md +305 -0
  240. package/vendor/ergebnis/agent-detector/README.md +107 -0
  241. package/vendor/evenement/evenement/README.md +64 -0
  242. package/vendor/fidry/cpu-core-counter/README.md +138 -0
  243. package/vendor/friendsofphp/php-cs-fixer/README.md +97 -0
  244. package/vendor/psr/container/README.md +13 -0
  245. package/vendor/psr/event-dispatcher/README.md +6 -0
  246. package/vendor/psr/log/README.md +58 -0
  247. package/vendor/react/cache/README.md +367 -0
  248. package/vendor/react/child-process/README.md +619 -0
  249. package/vendor/react/dns/README.md +453 -0
  250. package/vendor/react/event-loop/README.md +930 -0
  251. package/vendor/react/promise/README.md +722 -0
  252. package/vendor/react/socket/README.md +1564 -0
  253. package/vendor/react/stream/README.md +1249 -0
  254. package/vendor/sebastian/diff/README.md +151 -0
  255. package/vendor/symfony/console/README.md +30 -0
  256. package/vendor/symfony/deprecation-contracts/README.md +26 -0
  257. package/vendor/symfony/event-dispatcher/README.md +25 -0
  258. package/vendor/symfony/event-dispatcher-contracts/README.md +9 -0
  259. package/vendor/symfony/filesystem/README.md +23 -0
  260. package/vendor/symfony/finder/README.md +24 -0
  261. package/vendor/symfony/options-resolver/README.md +25 -0
  262. package/vendor/symfony/polyfill-ctype/README.md +12 -0
  263. package/vendor/symfony/polyfill-intl-grapheme/README.md +32 -0
  264. package/vendor/symfony/polyfill-intl-normalizer/README.md +14 -0
  265. package/vendor/symfony/polyfill-mbstring/README.md +13 -0
  266. package/vendor/symfony/polyfill-php80/README.md +25 -0
  267. package/vendor/symfony/polyfill-php81/README.md +18 -0
  268. package/vendor/symfony/polyfill-php84/README.md +23 -0
  269. package/vendor/symfony/polyfill-php85/README.md +20 -0
  270. package/vendor/symfony/process/README.md +23 -0
  271. package/vendor/symfony/service-contracts/README.md +9 -0
  272. package/vendor/symfony/stopwatch/README.md +52 -0
  273. package/vendor/symfony/string/README.md +24 -0
  274. package/lib/del-gradle.js +0 -16
  275. package/lib/del-node-modules.js +0 -211
  276. package/lib/find-node-modules-cli.js +0 -4
  277. /package/lib/{clean-github-actions-caches-cli.d.cts → del-gradle.d.cts} +0 -0
  278. /package/lib/{del-gradle.d.ts → del-node-modules.d.cts} +0 -0
  279. /package/lib/{find-node-modules-cli.d.ts → find-node-modules-cli.d.cts} +0 -0
  280. /package/lib/{git-diff-cli.d.ts → git/git-diff-cli.d.ts} +0 -0
  281. /package/lib/{git-diff-cli.js → git/git-diff-cli.js} +0 -0
  282. /package/lib/{git-diff.d.ts → git/git-diff.d.ts} +0 -0
  283. /package/lib/{git-fix.d.cts → git/git-fix.d.cts} +0 -0
  284. /package/lib/{git-purge.d.cts → git/git-purge.d.cts} +0 -0
  285. /package/lib/{del-node-modules.d.ts → github-workflows/clean-github-actions-caches-cli.d.cts} +0 -0
  286. /package/lib/{clean-github-actions-caches.d.cts → github-workflows/clean-github-actions-caches.d.cts} +0 -0
@@ -3,158 +3,164 @@ import {
3
3
  require_utils
4
4
  } from "./chunk-6RK5UCTP.mjs";
5
5
  import {
6
+ __commonJS,
6
7
  __require,
7
8
  init_esm_shims
8
9
  } from "./chunk-QQ4A6DLD.mjs";
9
10
 
10
- // src/del-node-modules.js
11
- init_esm_shims();
12
- var fs = __require("fs");
13
- var fsp = fs.promises;
14
- var path = __require("upath");
15
- var os = __require("os");
16
- var { getArgs } = require_utils();
17
- var argv = getArgs({
18
- boolean: ["force", "help"],
19
- alias: { h: "help", f: "force", c: "concurrent" },
20
- default: { force: false, concurrent: 2 }
21
- });
22
- if (argv.help) {
23
- console.log(`Usage: clean-node [--force] [-c|--concurrent N]
11
+ // src/del-node-modules.cjs
12
+ var require_del_node_modules = __commonJS({
13
+ "src/del-node-modules.cjs"() {
14
+ init_esm_shims();
15
+ var fs = __require("fs");
16
+ var fsp = fs.promises;
17
+ var path = __require("upath");
18
+ var os = __require("os");
19
+ var { getArgs } = require_utils();
20
+ var argv = getArgs({
21
+ boolean: ["force", "help"],
22
+ alias: { h: "help", f: "force", c: "concurrent" },
23
+ default: { force: false, concurrent: 2 }
24
+ });
25
+ if (argv.help) {
26
+ console.log(`Usage: clean-node [--force] [-c|--concurrent N]
24
27
  By default runs in dry-run mode. Use --force to actually delete.
25
28
  Use -c/--concurrent to set concurrent removals (default 2).`);
26
- process.exit(0);
27
- }
28
- var DRY_RUN = !argv.force;
29
- var defaultConcurrency = Math.max(2, os.cpus().length || 2);
30
- var CONCURRENCY = Math.max(1, Number(argv.concurrent || argv.c || defaultConcurrency));
31
- var customChars = "@.";
32
- var vowels = "aeiouAEIOU";
33
- var alnum = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
34
- var combined = alnum + vowels + customChars;
35
- var ROOT = process.cwd();
36
- async function isSymlinkAsync(p) {
37
- try {
38
- return (await fsp.lstat(p)).isSymbolicLink();
39
- } catch {
40
- return false;
41
- }
42
- }
43
- async function removeAsync(target) {
44
- if (await isSymlinkAsync(target)) {
45
- console.log("Skipping symlink", target);
46
- return;
47
- }
48
- if (DRY_RUN) {
49
- console.log("Would remove", target);
50
- return;
51
- }
52
- try {
53
- await fsp.rm(target, { recursive: true, force: true });
54
- console.log("Deleting", target);
55
- } catch (e) {
56
- console.error("Failed:", target, e.message);
57
- }
58
- }
59
- function runWithConcurrency(tasks, concurrency) {
60
- return new Promise((resolve, reject) => {
61
- let i = 0;
62
- let active = 0;
63
- let done = 0;
64
- const total = tasks.length;
65
- if (total === 0) return resolve();
66
- function next() {
67
- if (done === total) return resolve();
68
- while (active < concurrency && i < total) {
69
- const idx = i++;
70
- active++;
71
- Promise.resolve().then(() => tasks[idx]()).then(() => {
72
- active--;
73
- done++;
74
- next();
75
- }).catch((err) => reject(err));
29
+ process.exit(0);
30
+ }
31
+ var DRY_RUN = !argv.force;
32
+ var defaultConcurrency = Math.max(2, os.cpus().length || 2);
33
+ var CONCURRENCY = Math.max(1, Number(argv.concurrent || argv.c || defaultConcurrency));
34
+ var customChars = "@.";
35
+ var vowels = "aeiouAEIOU";
36
+ var alnum = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
37
+ var combined = alnum + vowels + customChars;
38
+ var ROOT = process.cwd();
39
+ async function isSymlinkAsync(p) {
40
+ try {
41
+ return (await fsp.lstat(p)).isSymbolicLink();
42
+ } catch {
43
+ return false;
76
44
  }
77
45
  }
78
- next();
79
- });
80
- }
81
- function walk(dir, callback, { skipNodeModulesChildren = false } = {}) {
82
- let entries;
83
- try {
84
- entries = fs.readdirSync(dir, { withFileTypes: true });
85
- } catch {
86
- return;
87
- }
88
- for (const entry of entries) {
89
- const fullPath = path.join(dir, entry.name);
90
- if (entry.isSymbolicLink()) continue;
91
- if (skipNodeModulesChildren && dir.includes("node_modules")) continue;
92
- callback(fullPath, entry);
93
- if (entry.isDirectory()) {
94
- if (skipNodeModulesChildren && entry.name === "node_modules") {
95
- continue;
46
+ async function removeAsync(target) {
47
+ if (await isSymlinkAsync(target)) {
48
+ console.log("Skipping symlink", target);
49
+ return;
50
+ }
51
+ if (DRY_RUN) {
52
+ console.log("Would remove", target);
53
+ return;
54
+ }
55
+ try {
56
+ await fsp.rm(target, { recursive: true, force: true });
57
+ console.log("Deleting", target);
58
+ } catch (e) {
59
+ console.error("Failed:", target, e.message);
96
60
  }
97
- walk(fullPath, callback, { skipNodeModulesChildren });
98
61
  }
99
- }
100
- }
101
- async function processNodeModules(dir) {
102
- console.log("Found:", dir);
103
- let items;
104
- try {
105
- items = fs.readdirSync(dir, { withFileTypes: true });
106
- } catch {
107
- return;
108
- }
109
- const targets = items.filter((entry) => entry.name.length && combined.includes(entry.name[0]));
110
- const tasks = targets.map((entry) => async () => {
111
- const name = entry.name;
112
- const target = path.join(dir, name);
113
- if (entry.isSymbolicLink && entry.isSymbolicLink()) {
114
- console.log("Skipping symlink", target);
115
- return;
62
+ function runWithConcurrency(tasks, concurrency) {
63
+ return new Promise((resolve, reject) => {
64
+ let i = 0;
65
+ let active = 0;
66
+ let done = 0;
67
+ const total = tasks.length;
68
+ if (total === 0) return resolve();
69
+ function next() {
70
+ if (done === total) return resolve();
71
+ while (active < concurrency && i < total) {
72
+ const idx = i++;
73
+ active++;
74
+ Promise.resolve().then(() => tasks[idx]()).then(() => {
75
+ active--;
76
+ done++;
77
+ next();
78
+ }).catch((err) => reject(err));
79
+ }
80
+ }
81
+ next();
82
+ });
116
83
  }
117
- await removeAsync(target);
118
- });
119
- await runWithConcurrency(tasks, CONCURRENCY);
120
- await removeAsync(dir);
121
- }
122
- async function main() {
123
- const nodeModulesDirs = [];
124
- walk(ROOT, (fullPath, entry) => {
125
- if (entry.isDirectory() && entry.name === "node_modules") {
126
- nodeModulesDirs.push(fullPath);
84
+ function walk(dir, callback, { skipNodeModulesChildren = false } = {}) {
85
+ let entries;
86
+ try {
87
+ entries = fs.readdirSync(dir, { withFileTypes: true });
88
+ } catch {
89
+ return;
90
+ }
91
+ for (const entry of entries) {
92
+ const fullPath = path.join(dir, entry.name);
93
+ if (entry.isSymbolicLink()) continue;
94
+ if (skipNodeModulesChildren && dir.includes("node_modules")) continue;
95
+ callback(fullPath, entry);
96
+ if (entry.isDirectory()) {
97
+ if (skipNodeModulesChildren && entry.name === "node_modules") {
98
+ continue;
99
+ }
100
+ walk(fullPath, callback, { skipNodeModulesChildren });
101
+ }
102
+ }
127
103
  }
128
- });
129
- for (const dir of nodeModulesDirs) {
130
- await processNodeModules(dir);
131
- }
132
- const packageLocks = [];
133
- const yarnLocks = [];
134
- const yarnCaches = [];
135
- walk(
136
- ROOT,
137
- (fullPath, entry) => {
138
- const base = path.basename(fullPath);
139
- if (base === "package-lock.json") packageLocks.push(fullPath);
140
- if (base === "yarn.lock") yarnLocks.push(fullPath);
141
- if (entry.isDirectory() && fullPath.endsWith(path.join(".yarn", "cache"))) yarnCaches.push(fullPath);
142
- },
143
- { skipNodeModulesChildren: true }
144
- );
145
- if (DRY_RUN) {
146
- console.log("Would remove package-lock.json files:");
147
- for (const p of packageLocks) console.log(p);
148
- console.log("Would remove yarn.lock files:");
149
- for (const p of yarnLocks) console.log(p);
150
- console.log("Would remove .yarn/cache directories:");
151
- for (const p of yarnCaches) console.log(p);
152
- } else {
153
- const allTasks = [];
154
- allTasks.push(...packageLocks.map((p) => async () => removeAsync(p)));
155
- allTasks.push(...yarnLocks.map((p) => async () => removeAsync(p)));
156
- allTasks.push(...yarnCaches.map((p) => async () => removeAsync(p)));
157
- await runWithConcurrency(allTasks, CONCURRENCY);
104
+ async function processNodeModules(dir) {
105
+ console.log("Found:", dir);
106
+ let items;
107
+ try {
108
+ items = fs.readdirSync(dir, { withFileTypes: true });
109
+ } catch {
110
+ return;
111
+ }
112
+ const targets = items.filter((entry) => entry.name.length && combined.includes(entry.name[0]));
113
+ const tasks = targets.map((entry) => async () => {
114
+ const name = entry.name;
115
+ const target = path.join(dir, name);
116
+ if (entry.isSymbolicLink && entry.isSymbolicLink()) {
117
+ console.log("Skipping symlink", target);
118
+ return;
119
+ }
120
+ await removeAsync(target);
121
+ });
122
+ await runWithConcurrency(tasks, CONCURRENCY);
123
+ await removeAsync(dir);
124
+ }
125
+ async function main() {
126
+ const nodeModulesDirs = [];
127
+ walk(ROOT, (fullPath, entry) => {
128
+ if (entry.isDirectory() && entry.name === "node_modules") {
129
+ nodeModulesDirs.push(fullPath);
130
+ }
131
+ });
132
+ for (const dir of nodeModulesDirs) {
133
+ await processNodeModules(dir);
134
+ }
135
+ const packageLocks = [];
136
+ const yarnLocks = [];
137
+ const yarnCaches = [];
138
+ walk(
139
+ ROOT,
140
+ (fullPath, entry) => {
141
+ const base = path.basename(fullPath);
142
+ if (base === "package-lock.json") packageLocks.push(fullPath);
143
+ if (base === "yarn.lock") yarnLocks.push(fullPath);
144
+ if (entry.isDirectory() && fullPath.endsWith(path.join(".yarn", "cache"))) yarnCaches.push(fullPath);
145
+ },
146
+ { skipNodeModulesChildren: true }
147
+ );
148
+ if (DRY_RUN) {
149
+ console.log("Would remove package-lock.json files:");
150
+ for (const p of packageLocks) console.log(p);
151
+ console.log("Would remove yarn.lock files:");
152
+ for (const p of yarnLocks) console.log(p);
153
+ console.log("Would remove .yarn/cache directories:");
154
+ for (const p of yarnCaches) console.log(p);
155
+ } else {
156
+ const allTasks = [];
157
+ allTasks.push(...packageLocks.map((p) => async () => removeAsync(p)));
158
+ allTasks.push(...yarnLocks.map((p) => async () => removeAsync(p)));
159
+ allTasks.push(...yarnCaches.map((p) => async () => removeAsync(p)));
160
+ await runWithConcurrency(allTasks, CONCURRENCY);
161
+ }
162
+ }
163
+ main();
158
164
  }
159
- }
160
- main();
165
+ });
166
+ export default require_del_node_modules();
@@ -62,7 +62,7 @@ var require_find_node_modules = __commonJS({
62
62
  }
63
63
  });
64
64
 
65
- // src/find-node-modules-cli.js
65
+ // src/find-node-modules-cli.cjs
66
66
  init_cjs_shims();
67
67
  var findNodeModules = require_find_node_modules();
68
68
  findNodeModules(null, console.log);
@@ -4,10 +4,16 @@ import {
4
4
  require_find_node_modules
5
5
  } from "./chunk-UY5VUEA3.mjs";
6
6
  import {
7
+ __commonJS,
7
8
  init_esm_shims
8
9
  } from "./chunk-QQ4A6DLD.mjs";
9
10
 
10
- // src/find-node-modules-cli.js
11
- init_esm_shims();
12
- var findNodeModules = require_find_node_modules();
13
- findNodeModules(null, console.log);
11
+ // src/find-node-modules-cli.cjs
12
+ var require_find_node_modules_cli = __commonJS({
13
+ "src/find-node-modules-cli.cjs"() {
14
+ init_esm_shims();
15
+ var findNodeModules = require_find_node_modules();
16
+ findNodeModules(null, console.log);
17
+ }
18
+ });
19
+ export default require_find_node_modules_cli();
@@ -115,6 +115,9 @@ var require_findEnvFiles = __commonJS({
115
115
  return envFiles.find((file) => {
116
116
  try {
117
117
  const content = fs3.readFileSync(file, "utf-8");
118
+ if (tokenName instanceof RegExp) {
119
+ return tokenName.test(content);
120
+ }
118
121
  const regex = new RegExp(`^\\s*${tokenName}\\s*=`, "m");
119
122
  return regex.test(content);
120
123
  } catch (err) {
@@ -137,8 +140,15 @@ var require_config = __commonJS({
137
140
  "src/binary-collections/config.cjs"(exports2, module2) {
138
141
  init_cjs_shims();
139
142
  var path3 = require("upath");
143
+ var minimistLib = require("minimist");
140
144
  var { findEnvWithToken } = require_findEnvFiles();
141
- require("dotenv").config({ path: findEnvWithToken(), quiet: true, overwrite: true });
145
+ var dotenv = require("dotenv");
146
+ var loadDotenv = (tokenKey = /ACCESS_TOKEN|GITHUB_TOKEN/) => dotenv.config({ path: findEnvWithToken(void 0, tokenKey), quiet: true, overwrite: true });
147
+ loadDotenv();
148
+ var cliArgv = minimistLib(process.argv.slice(2), {
149
+ string: ["token"]
150
+ });
151
+ var GITHUB_ACCESS_TOKEN = cliArgv.token || process.env.ACCESS_TOKEN || process.env.GITHUB_TOKEN || process.env.GH_TOKEN;
142
152
  function getTempDir() {
143
153
  return process.env.TEMP_DIR || path3.join(process.cwd(), "tmp");
144
154
  }
@@ -149,7 +159,9 @@ var require_config = __commonJS({
149
159
  module2.exports = {
150
160
  getTempDir,
151
161
  getTempPath: getTempPath2,
152
- TEMP_BASE_DIR
162
+ TEMP_BASE_DIR,
163
+ GITHUB_ACCESS_TOKEN,
164
+ loadDotenv
153
165
  };
154
166
  }
155
167
  });
@@ -321,10 +333,10 @@ var require_utils = __commonJS({
321
333
  }
322
334
  });
323
335
 
324
- // src/git-diff-cli.js
336
+ // src/git/git-diff-cli.js
325
337
  init_cjs_shims();
326
338
 
327
- // src/git-diff.js
339
+ // src/git/git-diff.js
328
340
  init_cjs_shims();
329
341
  var import_ansi_colors = __toESM(require("ansi-colors"), 1);
330
342
  var import_child_process = require("child_process");
@@ -846,7 +858,7 @@ async function runChatGpt(chatgptOptions = {}) {
846
858
  }
847
859
  }
848
860
 
849
- // src/git-diff.js
861
+ // src/git/git-diff.js
850
862
  var import_utils = __toESM(require_utils(), 1);
851
863
  var __filename2 = (0, import_url.fileURLToPath)(importMetaUrl);
852
864
  var __dirname = import_upath2.default.dirname(__filename2);
@@ -1058,7 +1070,7 @@ Thank you!`
1058
1070
  }
1059
1071
  }
1060
1072
 
1061
- // src/git-diff-cli.js
1073
+ // src/git/git-diff-cli.js
1062
1074
  (async () => {
1063
1075
  await mainGitDiff();
1064
1076
  })();
@@ -2,16 +2,16 @@
2
2
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
3
3
  import {
4
4
  mainGitDiff
5
- } from "./chunk-2MN4VPV2.mjs";
6
- import "./chunk-X2B3X7D4.mjs";
7
- import "./chunk-GAGABICI.mjs";
8
- import "./chunk-H44UWUFY.mjs";
9
- import "./chunk-6RK5UCTP.mjs";
5
+ } from "../chunk-3F6EIHYG.mjs";
6
+ import "../chunk-SARIXFHP.mjs";
7
+ import "../chunk-J4M5EL5P.mjs";
8
+ import "../chunk-GAGABICI.mjs";
9
+ import "../chunk-6RK5UCTP.mjs";
10
10
  import {
11
11
  init_esm_shims
12
- } from "./chunk-QQ4A6DLD.mjs";
12
+ } from "../chunk-QQ4A6DLD.mjs";
13
13
 
14
- // src/git-diff-cli.js
14
+ // src/git/git-diff-cli.js
15
15
  init_esm_shims();
16
16
  (async () => {
17
17
  await mainGitDiff();
@@ -120,6 +120,9 @@ var require_findEnvFiles = __commonJS({
120
120
  return envFiles.find((file) => {
121
121
  try {
122
122
  const content = fs3.readFileSync(file, "utf-8");
123
+ if (tokenName instanceof RegExp) {
124
+ return tokenName.test(content);
125
+ }
123
126
  const regex = new RegExp(`^\\s*${tokenName}\\s*=`, "m");
124
127
  return regex.test(content);
125
128
  } catch (err) {
@@ -142,8 +145,15 @@ var require_config = __commonJS({
142
145
  "src/binary-collections/config.cjs"(exports2, module2) {
143
146
  init_cjs_shims();
144
147
  var path3 = require("upath");
148
+ var minimistLib = require("minimist");
145
149
  var { findEnvWithToken } = require_findEnvFiles();
146
- require("dotenv").config({ path: findEnvWithToken(), quiet: true, overwrite: true });
150
+ var dotenv = require("dotenv");
151
+ var loadDotenv = (tokenKey = /ACCESS_TOKEN|GITHUB_TOKEN/) => dotenv.config({ path: findEnvWithToken(void 0, tokenKey), quiet: true, overwrite: true });
152
+ loadDotenv();
153
+ var cliArgv = minimistLib(process.argv.slice(2), {
154
+ string: ["token"]
155
+ });
156
+ var GITHUB_ACCESS_TOKEN = cliArgv.token || process.env.ACCESS_TOKEN || process.env.GITHUB_TOKEN || process.env.GH_TOKEN;
147
157
  function getTempDir() {
148
158
  return process.env.TEMP_DIR || path3.join(process.cwd(), "tmp");
149
159
  }
@@ -154,7 +164,9 @@ var require_config = __commonJS({
154
164
  module2.exports = {
155
165
  getTempDir,
156
166
  getTempPath: getTempPath2,
157
- TEMP_BASE_DIR
167
+ TEMP_BASE_DIR,
168
+ GITHUB_ACCESS_TOKEN,
169
+ loadDotenv
158
170
  };
159
171
  }
160
172
  });
@@ -326,7 +338,7 @@ var require_utils = __commonJS({
326
338
  }
327
339
  });
328
340
 
329
- // src/git-diff.js
341
+ // src/git/git-diff.js
330
342
  var git_diff_exports = {};
331
343
  __export(git_diff_exports, {
332
344
  CACHE_DIR: () => CACHE_DIR,
@@ -860,7 +872,7 @@ async function runChatGpt(chatgptOptions = {}) {
860
872
  }
861
873
  }
862
874
 
863
- // src/git-diff.js
875
+ // src/git/git-diff.js
864
876
  var import_utils = __toESM(require_utils(), 1);
865
877
  var __filename2 = (0, import_url.fileURLToPath)(importMetaUrl);
866
878
  var __dirname = import_upath2.default.dirname(__filename2);
@@ -22,9 +22,9 @@ const fs_extra_1 = __importDefault(require("fs-extra"));
22
22
  const sbg_utility_1 = require("sbg-utility");
23
23
  const upath_1 = __importDefault(require("upath"));
24
24
  const url_1 = require("url");
25
- const config_cjs_1 = require("./binary-collections/config.cjs");
26
- const chatgpt_js_1 = require("./utils/chatgpt.js");
27
- const index_cjs_1 = require("./utils/index.cjs");
25
+ const config_cjs_1 = require("../binary-collections/config.cjs");
26
+ const chatgpt_js_1 = require("../utils/chatgpt.js");
27
+ const index_cjs_1 = require("../utils/index.cjs");
28
28
  const __filename = (0, url_1.fileURLToPath)(import.meta.url);
29
29
  const __dirname = upath_1.default.dirname(__filename);
30
30
  const args = (0, index_cjs_1.getArgs)();
@@ -9,12 +9,12 @@ import {
9
9
  git_diff_default,
10
10
  mainGitDiff,
11
11
  runGitDiff
12
- } from "./chunk-2MN4VPV2.mjs";
13
- import "./chunk-X2B3X7D4.mjs";
14
- import "./chunk-GAGABICI.mjs";
15
- import "./chunk-H44UWUFY.mjs";
16
- import "./chunk-6RK5UCTP.mjs";
17
- import "./chunk-QQ4A6DLD.mjs";
12
+ } from "../chunk-3F6EIHYG.mjs";
13
+ import "../chunk-SARIXFHP.mjs";
14
+ import "../chunk-J4M5EL5P.mjs";
15
+ import "../chunk-GAGABICI.mjs";
16
+ import "../chunk-6RK5UCTP.mjs";
17
+ import "../chunk-QQ4A6DLD.mjs";
18
18
  export {
19
19
  CACHE_DIR,
20
20
  DIFF_OUTPUT,