binary-collections 2.0.8 → 2.0.10

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 (250) hide show
  1. package/binaries/binary-executor.cjs +43 -0
  2. package/{bin → binaries}/clean-nodemodule +0 -0
  3. package/binaries/clean-nodemodule.cjs +43 -0
  4. package/binaries/clean-nodemodule.cmd +4 -0
  5. package/{bin → binaries}/clean-nodemodules +0 -0
  6. package/binaries/clean-nodemodules.cjs +43 -0
  7. package/binaries/clean-nodemodules.cmd +5 -0
  8. package/{bin → binaries}/dev +0 -0
  9. package/binaries/dev.cjs +43 -0
  10. package/{bin → binaries}/empty +0 -0
  11. package/binaries/empty.cjs +43 -0
  12. package/{bin → binaries}/git-reduce-size +0 -0
  13. package/binaries/git-reduce-size.cjs +43 -0
  14. package/binaries/javakill.cjs +43 -0
  15. package/{bin → binaries}/javakill.cmd +0 -0
  16. package/{bin → binaries}/kill-process +0 -0
  17. package/binaries/kill-process.cjs +43 -0
  18. package/binaries/nodekill.cjs +43 -0
  19. package/{bin → binaries}/nodekill.ps1 +0 -0
  20. package/{bin → binaries}/prod +0 -0
  21. package/binaries/prod.cjs +43 -0
  22. package/{bin → binaries}/rmfind +0 -0
  23. package/binaries/rmfind.cjs +43 -0
  24. package/{bin → binaries}/rmx +0 -0
  25. package/binaries/rmx.cjs +43 -0
  26. package/{bin → binaries}/submodule-token +0 -0
  27. package/binaries/submodule-token.cjs +43 -0
  28. package/docs-src/clean-github-actions-caches.md +26 -0
  29. package/docs-src/free-chatgpt.md +26 -0
  30. package/lib/binary-collections-config.cjs +3 -2
  31. package/lib/binary-collections-config.mjs +2 -2
  32. package/lib/binary-collections.cjs +452 -87
  33. package/lib/binary-collections.mjs +247 -8
  34. package/lib/changelog.cjs +328 -0
  35. package/lib/changelog.mjs +205 -0
  36. package/lib/chunk-4EWQC6GZ.mjs +382 -0
  37. package/lib/chunk-4ZI7BQKQ.mjs +381 -0
  38. package/lib/chunk-5J2BEPY5.mjs +83 -0
  39. package/lib/{chunk-4BYBVEYC.mjs → chunk-66PAU5PS.mjs} +5 -4
  40. package/lib/chunk-6HHJRKFB.mjs +59 -0
  41. package/lib/chunk-6S4NXESK.mjs +26 -0
  42. package/lib/{chunk-ZYAQRPUL.mjs → chunk-7YD7IPFF.mjs} +2 -2
  43. package/lib/{chunk-SH3L6HHV.mjs → chunk-A2JQXI5Z.mjs} +2 -2
  44. package/lib/{chunk-EGSSKVDH.mjs → chunk-A3VUZEJK.mjs} +1 -1
  45. package/lib/chunk-AGZYRDC2.mjs +323 -0
  46. package/lib/{chunk-VVEZVNIV.mjs → chunk-AI4CVPJ7.mjs} +6 -6
  47. package/lib/chunk-BDCHCWHD.mjs +136 -0
  48. package/lib/chunk-BEZKJ25G.mjs +140 -0
  49. package/lib/chunk-DI5MDPSN.mjs +386 -0
  50. package/lib/{chunk-ONIBBBQ3.mjs → chunk-E6FDDAOO.mjs} +4 -3
  51. package/lib/chunk-FKI7IEB5.mjs +172 -0
  52. package/lib/chunk-GJTGHXRA.mjs +356 -0
  53. package/lib/{chunk-YV7DO3YV.mjs → chunk-HLGOWBEO.mjs} +1 -1
  54. package/lib/chunk-HMRMTYZM.mjs +40 -0
  55. package/lib/chunk-HN52G2YL.mjs +305 -0
  56. package/lib/chunk-HO6GHCOB.mjs +385 -0
  57. package/lib/chunk-LEM5OMRP.mjs +384 -0
  58. package/lib/{chunk-YX5U7XDR.mjs → chunk-M3YIYRHT.mjs} +6 -5
  59. package/lib/chunk-O6SWBEOQ.mjs +81 -0
  60. package/lib/{chunk-JGR2NW6D.mjs → chunk-PDSXF5HY.mjs} +3 -3
  61. package/lib/{chunk-AASHBCRW.mjs → chunk-QQ4A6DLD.mjs} +8 -0
  62. package/lib/chunk-RCP7DHVY.mjs +190 -0
  63. package/lib/chunk-SBNDSKG5.mjs +136 -0
  64. package/lib/chunk-U6SO4QEV.mjs +320 -0
  65. package/lib/{chunk-APBWENF6.mjs → chunk-V3N3JEUF.mjs} +3 -3
  66. package/lib/chunk-XD6BJK6Q.mjs +351 -0
  67. package/lib/chunk-XVBFFVCJ.mjs +209 -0
  68. package/lib/chunk-YXSFGA2D.mjs +383 -0
  69. package/lib/clean-github-actions-caches.cjs +243 -148
  70. package/lib/clean-github-actions-caches.mjs +4 -3
  71. package/lib/del-gradle.cjs +2 -2
  72. package/lib/del-gradle.js +1 -1
  73. package/lib/del-gradle.mjs +2 -2
  74. package/lib/del-node-modules.cjs +2 -2
  75. package/lib/del-node-modules.js +1 -1
  76. package/lib/del-node-modules.mjs +2 -2
  77. package/lib/del-ps.cjs +29 -8
  78. package/lib/del-ps.js +2 -2
  79. package/lib/del-ps.mjs +7 -5
  80. package/lib/del-yarn-caches.cjs +26 -5
  81. package/lib/del-yarn-caches.js +38 -3
  82. package/lib/del-yarn-caches.mjs +6 -6
  83. package/lib/find-node-modules-cli.cjs +5 -4
  84. package/lib/find-node-modules-cli.js +1 -1
  85. package/lib/find-node-modules-cli.mjs +2 -2
  86. package/lib/find-node-modules.cjs +4 -3
  87. package/lib/{find-node-modules.d.ts → find-node-modules.d.cts} +1 -1
  88. package/lib/find-node-modules.mjs +2 -2
  89. package/lib/free-chatgpt.cjs +548 -0
  90. package/lib/free-chatgpt.d.ts +1 -0
  91. package/lib/free-chatgpt.js +51 -0
  92. package/lib/free-chatgpt.mjs +50 -0
  93. package/lib/git/gitattributes.cjs +1 -1
  94. package/lib/git/{gitattributes.d.mts → gitattributes.d.cts} +5 -7
  95. package/lib/git/gitattributes.mjs +2 -2
  96. package/lib/git/line-endings.cjs +297 -64
  97. package/lib/git/line-endings.mjs +4 -4
  98. package/lib/git/normalize.cjs +26 -36
  99. package/lib/git/normalize.mjs +2 -2
  100. package/lib/git/permissions.cjs +77 -11
  101. package/lib/git/permissions.mjs +3 -3
  102. package/lib/git/pull-strategy.cjs +76 -9
  103. package/lib/git/pull-strategy.mjs +3 -3
  104. package/lib/git/user-config.cjs +266 -83
  105. package/lib/git/user-config.mjs +4 -4
  106. package/lib/git/utils.cjs +40 -60
  107. package/lib/git/utils.mjs +2 -2
  108. package/lib/git-diff-cli.cjs +651 -0
  109. package/lib/git-diff-cli.d.ts +1 -0
  110. package/lib/git-diff-cli.js +15 -0
  111. package/lib/git-diff-cli.mjs +16 -0
  112. package/lib/git-diff.cjs +657 -58
  113. package/lib/git-diff.d.ts +38 -83
  114. package/lib/git-diff.js +152 -0
  115. package/lib/git-diff.mjs +23 -85
  116. package/lib/git-fix.cjs +685 -97
  117. package/lib/git-fix.mjs +12 -11
  118. package/lib/git-purge.cjs +3 -3
  119. package/lib/git-purge.d.cts +1 -0
  120. package/lib/git-purge.mjs +43 -37
  121. package/lib/index.cjs +7 -6
  122. package/lib/index.d.ts +1 -1
  123. package/lib/index.js +2 -5
  124. package/lib/index.mjs +4 -4
  125. package/lib/npm-run-series.cjs +3 -3
  126. package/lib/npm-run-series.mjs +42 -36
  127. package/lib/package-resolutions-updater.cjs +174 -1
  128. package/lib/package-resolutions-updater.mjs +270 -290
  129. package/lib/print-directory-tree.cjs +275 -210
  130. package/lib/print-directory-tree.mjs +2 -2
  131. package/lib/ps/connected-domain.cjs +25 -2
  132. package/lib/ps/connected-domain.d.ts +10 -2
  133. package/lib/ps/connected-domain.js +5 -2
  134. package/lib/ps/connected-domain.mjs +8 -4
  135. package/lib/ps/index.cjs +345 -322
  136. package/lib/ps/index.d.mjs +1 -1
  137. package/lib/ps/index.js +1 -1
  138. package/lib/ps/index.mjs +179 -182
  139. package/lib/ps/isWin.cjs +24 -1
  140. package/lib/ps/isWin.d.ts +1 -1
  141. package/lib/ps/isWin.js +3 -1
  142. package/lib/ps/isWin.mjs +8 -4
  143. package/lib/ps/table-parser.cjs +167 -159
  144. package/lib/ps/table-parser.d.ts +5 -0
  145. package/lib/ps/table-parser.js +10 -4
  146. package/lib/ps/table-parser.mjs +9 -5
  147. package/lib/remove-module.cjs +262 -0
  148. package/lib/remove-module.d.mts +1 -0
  149. package/lib/remove-module.mjs +111 -0
  150. package/lib/rmpath.cjs +274 -0
  151. package/lib/rmpath.d.mts +3 -0
  152. package/lib/rmpath.mjs +108 -0
  153. package/lib/submodule-install.cjs +264 -85
  154. package/lib/submodule-install.mjs +56 -7
  155. package/lib/submodule-remove-cli.cjs +103 -0
  156. package/lib/submodule-remove-cli.d.ts +1 -0
  157. package/lib/submodule-remove-cli.js +31 -0
  158. package/lib/submodule-remove-cli.mjs +28 -0
  159. package/lib/submodule-remove.cjs +43 -0
  160. package/lib/submodule-remove.d.cts +2 -0
  161. package/lib/submodule-remove.mjs +6 -0
  162. package/lib/utils/chatgpt.cjs +383 -0
  163. package/lib/utils/chatgpt.d.ts +31 -0
  164. package/lib/utils/chatgpt.js +541 -0
  165. package/lib/utils/chatgpt.mjs +8 -0
  166. package/lib/{utils.cjs → utils/index.cjs} +1 -1
  167. package/lib/{utils.mjs → utils/index.mjs} +2 -2
  168. package/lib/yarn-reinstall.cjs +172 -38
  169. package/lib/yarn-reinstall.mjs +2 -2
  170. package/package.json +91 -71
  171. package/readme.md +43 -69
  172. package/releases/readme.md +36 -0
  173. package/test/README.md +101 -0
  174. package/test/package.json +2 -1
  175. package/test-project/readme.md +26 -0
  176. package/tmp/test-repo/README.md +35 -0
  177. package/tmp/typedoc/readme.md +320 -0
  178. package/bin/bash-dummy +0 -56
  179. package/bin/bash-dummy.cmd +0 -25
  180. package/bin/dir-tree.cmd +0 -7
  181. package/bin/git-diff +0 -4
  182. package/bin/git-diff.cmd +0 -7
  183. package/bin/git-fix +0 -36
  184. package/bin/git-fix.cmd +0 -7
  185. package/bin/rmpath +0 -70
  186. package/bin/submodule-install.txt +0 -118
  187. package/bin/submodule-remove +0 -46
  188. package/bin/submodule.txt +0 -172
  189. package/lib/binary-collections-config.d.mts +0 -18
  190. package/lib/binary-collections-config.js +0 -39
  191. package/lib/binary-collections.d.mts +0 -121
  192. package/lib/binary-collections.d.ts +0 -121
  193. package/lib/chunk-DPKAJKFO.mjs +0 -171
  194. package/lib/chunk-G3THLIDT.mjs +0 -200
  195. package/lib/chunk-W3ENOM53.mjs +0 -18
  196. package/lib/clean-github-actions-caches.d.mts +0 -169
  197. package/lib/clean-github-actions-caches.d.ts +0 -169
  198. package/lib/del-gradle.d.mts +0 -2
  199. package/lib/del-node-modules.d.mts +0 -2
  200. package/lib/del-ps.d.mts +0 -2
  201. package/lib/del-yarn-caches.d.mts +0 -2
  202. package/lib/find-node-modules-cli.d.mts +0 -1
  203. package/lib/find-node-modules.d.mts +0 -13
  204. package/lib/find-node-modules.js +0 -53
  205. package/lib/git/line-endings.d.mts +0 -83
  206. package/lib/git/line-endings.d.ts +0 -83
  207. package/lib/git/normalize.d.mts +0 -43
  208. package/lib/git/normalize.d.ts +0 -43
  209. package/lib/git/permissions.d.mts +0 -17
  210. package/lib/git/permissions.d.ts +0 -17
  211. package/lib/git/pull-strategy.d.mts +0 -15
  212. package/lib/git/pull-strategy.d.ts +0 -15
  213. package/lib/git/user-config.d.mts +0 -105
  214. package/lib/git/user-config.d.ts +0 -105
  215. package/lib/git/utils.d.mts +0 -69
  216. package/lib/git/utils.d.ts +0 -69
  217. package/lib/git-diff.d.mts +0 -84
  218. package/lib/git-fix.d.mts +0 -141
  219. package/lib/git-fix.d.ts +0 -141
  220. package/lib/git-purge.d.mts +0 -2
  221. package/lib/git-purge.js +0 -59
  222. package/lib/index.d.mts +0 -1
  223. package/lib/npm-run-series.d.mts +0 -1
  224. package/lib/npm-run-series.d.ts +0 -2
  225. package/lib/npm-run-series.js +0 -86
  226. package/lib/package-resolutions-updater.d.ts +0 -326
  227. package/lib/print-directory-tree.d.mts +0 -234
  228. package/lib/print-directory-tree.d.ts +0 -234
  229. package/lib/ps/connected-domain.d.mts +0 -3
  230. package/lib/ps/index.d.d.mts +0 -26
  231. package/lib/ps/index.d.d.ts +0 -26
  232. package/lib/ps/index.d.mts +0 -26
  233. package/lib/ps/isWin.d.mts +0 -3
  234. package/lib/ps/table-parser.d.mts +0 -3
  235. package/lib/submodule-install.d.mts +0 -121
  236. package/lib/submodule-install.d.ts +0 -121
  237. package/lib/utils.d.mts +0 -40
  238. package/lib/utils.js +0 -181
  239. package/lib/yarn-reinstall.d.mts +0 -49
  240. package/lib/yarn-reinstall.d.ts +0 -49
  241. package/src/package-resolutions-updater.mjs +0 -325
  242. package/src/print-directory-tree.cjs +0 -234
  243. package/src/ps/index.js +0 -286
  244. package/src/yarn-reinstall.cjs +0 -49
  245. /package/{bin → binaries}/nodekill +0 -0
  246. /package/{bin → binaries}/nodekill.cmd +0 -0
  247. /package/lib/{binary-collections-config.d.ts → binary-collections-config.d.cts} +0 -0
  248. /package/lib/{git-purge.d.ts → changelog.d.cts} +0 -0
  249. /package/lib/{git-diff.d.cts → npm-run-series.d.cts} +0 -0
  250. /package/lib/{utils.d.ts → utils/index.d.cts} +0 -0
@@ -2,13 +2,210 @@
2
2
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
3
3
  import {
4
4
  require_utils
5
- } from "./chunk-APBWENF6.mjs";
5
+ } from "./chunk-V3N3JEUF.mjs";
6
6
  import {
7
7
  __commonJS,
8
8
  __dirname,
9
9
  __require,
10
10
  init_esm_shims
11
- } from "./chunk-AASHBCRW.mjs";
11
+ } from "./chunk-QQ4A6DLD.mjs";
12
+
13
+ // package.json
14
+ var require_package = __commonJS({
15
+ "package.json"(exports, module) {
16
+ module.exports = {
17
+ name: "binary-collections",
18
+ version: "2.0.10",
19
+ description: "Utility to clean any programming caches and more",
20
+ keywords: [
21
+ "cache",
22
+ "cleaner",
23
+ "utility"
24
+ ],
25
+ homepage: "https://www.webmanajemen.com/",
26
+ bugs: {
27
+ url: "https://github.com/dimaslanjaka/bin/issues"
28
+ },
29
+ license: "MIT",
30
+ author: {
31
+ name: "dimaslanjaka",
32
+ email: "dimaslanjaka@gmail.com",
33
+ url: "https://webmanajemen.com"
34
+ },
35
+ type: "module",
36
+ main: "lib/index.js",
37
+ exports: {
38
+ ".": {
39
+ require: {
40
+ default: "./lib/index.cjs",
41
+ types: "./lib/index.d.ts"
42
+ },
43
+ import: {
44
+ default: "./lib/index.mjs",
45
+ types: "./lib/index.d.mts"
46
+ }
47
+ },
48
+ "./package.json": "./package.json"
49
+ },
50
+ types: "lib/index.d.ts",
51
+ files: [
52
+ "binaries",
53
+ "lib",
54
+ "package.json",
55
+ "docs-src/**/*.md",
56
+ "readme.md"
57
+ ],
58
+ bin: {
59
+ "binary-collections": "lib/binary-collections.cjs",
60
+ "binary-executor": "binaries/binary-executor.cjs",
61
+ changelog: "lib/changelog.cjs",
62
+ chatgpt: "lib/free-chatgpt.cjs",
63
+ "clean-github-actions-cache": "lib/clean-github-actions-caches.cjs",
64
+ "clean-github-actions-caches": "lib/clean-github-actions-caches.cjs",
65
+ "clean-nodemodule": "binaries/clean-nodemodule.cjs",
66
+ "clean-nodemodules": "binaries/clean-nodemodules.cjs",
67
+ "clear-gh-caches": "lib/clean-github-actions-caches.cjs",
68
+ "clear-github-actions-cache": "lib/clean-github-actions-caches.cjs",
69
+ "clear-github-actions-caches": "lib/clean-github-actions-caches.cjs",
70
+ "del-gradle": "lib/del-gradle.cjs",
71
+ "del-node-modules": "lib/del-node-modules.cjs",
72
+ "del-nodemodules": "lib/del-node-modules.cjs",
73
+ "del-ps": "lib/del-ps.cjs",
74
+ "del-yarn-caches": "lib/del-yarn-caches.cjs",
75
+ "del-yarncaches": "lib/del-yarn-caches.cjs",
76
+ dev: "binaries/dev.cjs",
77
+ "dir-tree": "lib/print-directory-tree.cjs",
78
+ empty: "binaries/empty.cjs",
79
+ "find-node-modules": "lib/find-node-modules-cli.cjs",
80
+ "free-chatgpt": "lib/free-chatgpt.cjs",
81
+ "git-diff": "lib/git-diff-cli.cjs",
82
+ "git-fix": "lib/git-fix.cjs",
83
+ "git-purge": "lib/git-purge.cjs",
84
+ "git-reduce-size": "binaries/git-reduce-size.cjs",
85
+ javakill: "binaries/javakill.cjs",
86
+ "kill-process": "binaries/kill-process.cjs",
87
+ nodekill: "binaries/nodekill.cjs",
88
+ "npm-run-series": "lib/npm-run-series.cjs",
89
+ nrs: "lib/npm-run-series.cjs",
90
+ "package-resolutions-updater": "lib/package-resolutions-updater.cjs",
91
+ "pkg-res-updater": "lib/package-resolutions-updater.cjs",
92
+ "pkg-resolutions-updater": "lib/package-resolutions-updater.cjs",
93
+ "print-directory-tree": "lib/print-directory-tree.cjs",
94
+ "print-tree": "lib/print-directory-tree.cjs",
95
+ prod: "binaries/prod.cjs",
96
+ "remove-module": "lib/remove-module.cjs",
97
+ rmfind: "binaries/rmfind.cjs",
98
+ rmpath: "lib/rmpath.cjs",
99
+ rmx: "binaries/rmx.cjs",
100
+ "run-s": "lib/npm-run-series.cjs",
101
+ "run-series": "lib/npm-run-series.cjs",
102
+ "submodule-install": "lib/submodule-install.cjs",
103
+ "submodule-remove": "lib/submodule-remove-cli.cjs",
104
+ "submodule-token": "binaries/submodule-token.cjs",
105
+ "yarn-reinstall": "lib/yarn-reinstall.cjs"
106
+ },
107
+ scripts: {
108
+ build: "tsc -b tsconfig.build.json && npm run build:tsup && npm run postbuild",
109
+ "build:packages": "yarn workspaces foreach --worktree --exclude=binary-collections --no-private run build",
110
+ "build:rollup": "rollup -c rollup.config.js",
111
+ "build:tsup": "node build.tsup.js",
112
+ clean: "rimraf lib tmp/dist binaries",
113
+ pack: "node packer.cjs --yarn --filename=bin",
114
+ postbuild: "node -r ts-node/register -r dotenv/config build.exports.mjs && yarn run pack",
115
+ prepare: "husky",
116
+ test: 'npx jest --runInBand --forceExit --testTimeout=120000 --testPathIgnorePatterns="\\.mjs$"',
117
+ "test:coverage": "npm test --coverage --detectOpenHandles",
118
+ "test:esm": 'node --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand --forceExit --testTimeout=120000 --testPathIgnorePatterns="\\.(ts|js|cjs)$"',
119
+ "test:nrs": "npm test -- nrs build:**",
120
+ "test:watch": "npm test --watch",
121
+ "update:ncu": "npx npm-check-updates -u -x jsdom,chalk,hexo,deepmerge-ts --enginesNode --root",
122
+ "update:packer": "curl -L https://github.com/dimaslanjaka/nodejs-package-types/raw/main/packer.js > packer.cjs"
123
+ },
124
+ repository: {
125
+ type: "git",
126
+ url: "git+https://github.com/dimaslanjaka/bin"
127
+ },
128
+ dependencies: {
129
+ "ansi-colors": "^4.1.3",
130
+ axios: "^1.11.0",
131
+ dotenv: "^17.2.1",
132
+ execa: "^9.6.0",
133
+ "fs-extra": "^11.3.1",
134
+ "git-command-helper": "^2.1.0",
135
+ glob: "^11.0.3",
136
+ minimatch: "^10.0.3",
137
+ minimist: "^1.2.8",
138
+ "ps-node": "^0.1.6",
139
+ puppeteer: "^24.17.0",
140
+ "puppeteer-extra": "^3.3.6",
141
+ "puppeteer-extra-plugin-stealth": "^2.11.2",
142
+ remove: "^0.1.5",
143
+ "sbg-utility": "^2.0.10",
144
+ upath: "^2.0.1",
145
+ yaml: "^2.8.1",
146
+ yarn: "^1.22.22"
147
+ },
148
+ devDependencies: {
149
+ "@babel/core": "^7.28.3",
150
+ "@babel/preset-env": "^7.28.3",
151
+ "@babel/preset-typescript": "^7.27.1",
152
+ "@eslint/eslintrc": "^3.3.1",
153
+ "@eslint/js": "^9.34.0",
154
+ "@rollup/plugin-babel": "^6.0.4",
155
+ "@rollup/plugin-commonjs": "^28.0.6",
156
+ "@rollup/plugin-json": "^6.1.0",
157
+ "@rollup/plugin-node-resolve": "^16.0.1",
158
+ "@types/babel__core": "^7",
159
+ "@types/babel__preset-env": "^7",
160
+ "@types/eslint": "^9",
161
+ "@types/fs-extra": "^11",
162
+ "@types/jest": "^30.0.0",
163
+ "@types/minimist": "^1",
164
+ "@types/node": "^24.3.0",
165
+ "@types/prettier": "^3",
166
+ "@types/ps-node": "^0",
167
+ "@types/yargs": "^17",
168
+ "@typescript-eslint/eslint-plugin": "^8.40.0",
169
+ "@typescript-eslint/parser": "^8.40.0",
170
+ "babel-jest": "^30.0.5",
171
+ "browser-sync": "^3.0.4",
172
+ "cross-env": "^10.0.0",
173
+ "cross-spawn": "https://github.com/dimaslanjaka/node-cross-spawn/raw/private/release/cross-spawn.tgz",
174
+ eslint: "^9.34.0",
175
+ "eslint-config-prettier": "^10.1.8",
176
+ "eslint-plugin-prettier": "^5.5.4",
177
+ globals: "^16.3.0",
178
+ gulp: "^5.0.1",
179
+ husky: "^9.1.7",
180
+ jest: "^30.0.5",
181
+ "lint-staged": "^16.1.5",
182
+ marked: "^16.2.0",
183
+ prettier: "^3.6.2",
184
+ rimraf: "^6.0.1",
185
+ rollup: "^4.48.1",
186
+ "ts-jest": "^29.4.1",
187
+ "ts-node": "^10.9.2",
188
+ tsup: "^8.5.0",
189
+ typedoc: "^0.28.11",
190
+ "typedoc-plugin-ga": "^1.0.5",
191
+ typescript: "^5.9.2"
192
+ },
193
+ directories: {
194
+ lib: "lib",
195
+ bin: "binaries"
196
+ },
197
+ workspaces: [
198
+ "packages/*"
199
+ ],
200
+ packageManager: "yarn@4.9.2",
201
+ resolutions: {
202
+ "cross-spawn": "https://github.com/dimaslanjaka/node-cross-spawn/raw/80999ac7a7031a81e11ddb5fab0f8ba433041c98/release/cross-spawn.tgz",
203
+ "git-command-helper": "https://github.com/dimaslanjaka/git-command-helper/raw/47133aa918c1292c15949c7f190be9cb302cd6f4/release/git-command-helper.tgz",
204
+ "sbg-utility": "https://github.com/dimaslanjaka/static-blog-generator/raw/f58af787eab404891d8394fe0570ce603e0d7308/packages/sbg-utility/release/sbg-utility.tgz"
205
+ }
206
+ };
207
+ }
208
+ });
12
209
 
13
210
  // src/binary-collections.cjs
14
211
  var require_binary_collections = __commonJS({
@@ -16,8 +213,10 @@ var require_binary_collections = __commonJS({
16
213
  init_esm_shims();
17
214
  var { spawn } = __require("child_process");
18
215
  var { glob } = __require("glob");
19
- var path = __require("path");
216
+ var path = __require("upath");
20
217
  var { getArgs } = require_utils();
218
+ var pkgJson = require_package();
219
+ var fs = __require("fs-extra");
21
220
  function showHelp() {
22
221
  console.log("\u{1F680} Binary Collections - Dynamic Script Runner");
23
222
  console.log("\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550");
@@ -38,6 +237,7 @@ var require_binary_collections = __commonJS({
38
237
  }
39
238
  function findScript(scriptName, searchDir = null) {
40
239
  if (!searchDir) searchDir = __dirname;
240
+ let result;
41
241
  const ignorePatterns = [
42
242
  `**/*config*.{cjs,js,mjs}`,
43
243
  `**/utils.{cjs,js,mjs}`,
@@ -54,14 +254,40 @@ var require_binary_collections = __commonJS({
54
254
  absolute: true
55
255
  });
56
256
  if (files.length > 0) {
57
- return files[0];
257
+ result = files[0];
258
+ } else {
259
+ if (pkgJson.bin[scriptName]) {
260
+ const find = [
261
+ path.join(searchDir, pkgJson.bin[scriptName]),
262
+ path.join(process.cwd(), "node_modules/binary-collections", pkgJson.bin[scriptName]),
263
+ path.join(__dirname, pkgJson.bin[scriptName]),
264
+ path.join(path.join(__dirname, ".."), pkgJson.bin[scriptName])
265
+ ];
266
+ const filtered = find.filter((file) => fs.existsSync(file));
267
+ if (filtered.length > 0) {
268
+ result = filtered[0];
269
+ } else {
270
+ console.warn(`\u26A0\uFE0F Script "${scriptName}" not found in ${searchDir}.`);
271
+ console.warn(`\u{1F50D} Searched for: ${pattern} in ${searchDir}`);
272
+ }
273
+ }
58
274
  }
59
275
  } catch (error) {
60
276
  console.error(`\u{1F50D} Error searching for script: ${error.message}`);
61
277
  }
62
- return null;
278
+ if (result && !result.includes("-cli")) {
279
+ const ext = path.extname(result);
280
+ const filename = path.basename(result, ext);
281
+ const cliFile = path.join(path.dirname(result), `${filename}-cli${ext}`);
282
+ if (fs.existsSync(cliFile)) {
283
+ result = cliFile;
284
+ console.log(`\u{1F50D} Found CLI version: ${cliFile}`);
285
+ }
286
+ }
287
+ return result;
63
288
  }
64
289
  function executeScript(scriptPath, args) {
290
+ console.log(`\u{1F527} Executing script: ${scriptPath} args: ${args.join(" ")}`);
65
291
  const child = spawn("node", [scriptPath, ...args], {
66
292
  stdio: "inherit",
67
293
  shell: true
@@ -77,11 +303,24 @@ var require_binary_collections = __commonJS({
77
303
  function main() {
78
304
  const args = getArgs();
79
305
  const positional = args._ || [];
80
- if (positional.length === 0 || positional.length === 1 && (args.help || args.h)) {
81
- showHelp();
306
+ console.log(`\u{1F50D} Parsed arguments: ${JSON.stringify(args)}`);
307
+ if (positional.length === 0) {
308
+ return showHelp();
82
309
  }
83
310
  const scriptName = positional[0];
84
- const scriptArgs = positional.slice(1);
311
+ const scriptArgs = [];
312
+ scriptArgs.push(...positional.slice(1));
313
+ Object.keys(args).forEach((key) => {
314
+ if (key !== "_") {
315
+ const value = args[key];
316
+ if (typeof value === "boolean" && value) {
317
+ scriptArgs.push(key.length === 1 ? `-${key}` : `--${key}`);
318
+ } else if (value !== true && value !== false) {
319
+ scriptArgs.push(key.length === 1 ? `-${key}` : `--${key}`);
320
+ scriptArgs.push(value);
321
+ }
322
+ }
323
+ });
85
324
  const scriptPath = findScript(scriptName);
86
325
  if (!scriptPath) {
87
326
  console.error(`\u274C Error: Script "${scriptName}" not found.`);
@@ -0,0 +1,328 @@
1
+ var __getOwnPropNames = Object.getOwnPropertyNames;
2
+ var __esm = (fn, res) => function __init() {
3
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
4
+ };
5
+ var __commonJS = (cb, mod) => function __require() {
6
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
7
+ };
8
+
9
+ // node_modules/tsup/assets/cjs_shims.js
10
+ var init_cjs_shims = __esm({
11
+ "node_modules/tsup/assets/cjs_shims.js"() {
12
+ }
13
+ });
14
+
15
+ // src/utils/index.cjs
16
+ var require_utils = __commonJS({
17
+ "src/utils/index.cjs"(exports2, module2) {
18
+ init_cjs_shims();
19
+ var fs2 = require("fs");
20
+ var path2 = require("upath");
21
+ var argv = require("minimist")(process.argv.slice(2));
22
+ var { exec } = require("child_process");
23
+ var { URL: URL2 } = require("url");
24
+ var { promisify } = require("util");
25
+ var execAsync = promisify(exec);
26
+ async function parseGitRemotes() {
27
+ try {
28
+ const { stdout } = await execAsync("git remote -v");
29
+ const lines = stdout.split("\n");
30
+ const remotes = {};
31
+ lines.forEach((line) => {
32
+ const [name, url] = line.split(" ");
33
+ if (name && url) {
34
+ const [repoUrl] = url.split(" ");
35
+ try {
36
+ const parsedUrl = new URL2(repoUrl);
37
+ const pathParts = parsedUrl.pathname.split("/").filter(Boolean);
38
+ if (parsedUrl.hostname === "github.com" && pathParts.length === 2) {
39
+ let repoPath = pathParts.join("/");
40
+ if (repoPath.endsWith(".git")) {
41
+ repoPath = repoPath.slice(0, -4);
42
+ }
43
+ remotes[name] = repoPath;
44
+ }
45
+ } catch (e) {
46
+ console.error("URL Parsing Error:", e.message);
47
+ }
48
+ }
49
+ });
50
+ return remotes;
51
+ } catch (error) {
52
+ console.error("Error:", error.message);
53
+ return {};
54
+ }
55
+ }
56
+ module2.exports.parseGitRemotes = parseGitRemotes;
57
+ function joinPathPreserveDriveLetter(...segments) {
58
+ let fullPath = require("path").join(...segments);
59
+ if (/^[a-z]:\\/.test(fullPath)) {
60
+ fullPath = fullPath.charAt(0).toUpperCase() + fullPath.slice(1);
61
+ }
62
+ return fullPath;
63
+ }
64
+ module2.exports.joinPathPreserveDriveLetter = joinPathPreserveDriveLetter;
65
+ function getArgs2() {
66
+ return argv;
67
+ }
68
+ module2.exports.getArgs = getArgs2;
69
+ function del(fullPath) {
70
+ if (fs2.statSync(fullPath).isDirectory()) {
71
+ const subdir = fs2.readdirSync(fullPath).map((dirPath) => path2.resolve(fullPath, dirPath));
72
+ for (let i = 0; i < subdir.length; i++) {
73
+ del(subdir[i]);
74
+ }
75
+ } else {
76
+ try {
77
+ fs2.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
78
+ console.log("deleted", fullPath);
79
+ } catch (_) {
80
+ console.log("failed delete", fullPath);
81
+ }
82
+ }
83
+ }
84
+ module2.exports.del = del;
85
+ function delStream(globStream) {
86
+ globStream.stream().on("data", (result) => {
87
+ const fullPath = path2.resolve(process.cwd(), result);
88
+ if (fs2.statSync(fullPath).isDirectory()) {
89
+ const subdir = fs2.readdirSync(fullPath).map((dirPath) => path2.resolve(fullPath, dirPath));
90
+ for (let i = 0; i < subdir.length; i++) {
91
+ del(subdir[i]);
92
+ }
93
+ }
94
+ del(fullPath);
95
+ });
96
+ }
97
+ module2.exports.delStream = delStream;
98
+ function getFileTreeString(hashArray) {
99
+ const tree = {};
100
+ const hashMap = {};
101
+ for (const entry of hashArray) {
102
+ const [filePath, hash] = entry.split(" ");
103
+ hashMap[filePath] = hash;
104
+ const parts = filePath.split("/");
105
+ let current = tree;
106
+ for (let i = 0; i < parts.length; i++) {
107
+ const part = parts[i];
108
+ if (i === parts.length - 1) {
109
+ current[part] = null;
110
+ } else {
111
+ current[part] = current[part] || {};
112
+ current = current[part];
113
+ }
114
+ }
115
+ }
116
+ function printNode(node, prefix = "", parentPath = "") {
117
+ const keys = Object.keys(node).sort();
118
+ let lines = [];
119
+ keys.forEach((key, idx) => {
120
+ const isLast = idx === keys.length - 1;
121
+ const branch = isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ";
122
+ const currentPath = parentPath ? parentPath + "/" + key : key;
123
+ if (node[key] === null) {
124
+ lines.push(prefix + branch + key + " [" + (hashMap[currentPath] || "") + "]");
125
+ } else {
126
+ lines.push(prefix + branch + key + "/");
127
+ lines = lines.concat(printNode(node[key], prefix + (isLast ? " " : "\u2502 "), currentPath));
128
+ }
129
+ });
130
+ return lines;
131
+ }
132
+ return printNode(tree, "", "").join("\n");
133
+ }
134
+ module2.exports.getFileTreeString = getFileTreeString;
135
+ var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
136
+ module2.exports.delay = delay;
137
+ }
138
+ });
139
+
140
+ // src/changelog.cjs
141
+ init_cjs_shims();
142
+ var fs = require("fs");
143
+ var path = require("path");
144
+ var { EOL } = require("os");
145
+ var { getArgs } = require_utils();
146
+ var spawn = require("child_process").spawn;
147
+ var pkgPath = path.join(process.cwd(), "package.json");
148
+ if (!fs.existsSync(pkgPath)) {
149
+ throw new Error(`package.json not found at ${pkgPath}`);
150
+ }
151
+ var pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
152
+ var args = getArgs();
153
+ if (args.help || args.h) {
154
+ showHelp();
155
+ }
156
+ function showHelp() {
157
+ console.log(`
158
+ Usage: node changelog.js [options]
159
+ `);
160
+ console.log(`Options:`);
161
+ console.log(` --help, -h Show this help message and exit`);
162
+ console.log(`
163
+ Description:`);
164
+ console.log(` Generates a CHANGELOG.md file from git commit history.`);
165
+ console.log(` - Looks for version bumps and groups commits by version.`);
166
+ console.log(` - Skips dependabot and irrelevant commits.`);
167
+ console.log(` - Outputs the original git log to tmp/original.md for reference.`);
168
+ console.log(`
169
+ Example:`);
170
+ console.log(` node changelog.js`);
171
+ console.log(``);
172
+ }
173
+ var gitExec = (command) => new Promise((resolve, reject) => {
174
+ const thread = spawn("git", command, { stdio: ["inherit", "pipe", "pipe"] });
175
+ const stdOut = [];
176
+ const stdErr = [];
177
+ thread.stdout.on("data", (data) => {
178
+ stdOut.push(data.toString("utf8"));
179
+ });
180
+ thread.stderr.on("data", (data) => {
181
+ stdErr.push(data.toString("utf8"));
182
+ });
183
+ thread.on("close", () => {
184
+ if (stdErr.length) {
185
+ reject(stdErr.join(""));
186
+ return;
187
+ }
188
+ resolve(stdOut.join());
189
+ });
190
+ });
191
+ function extractVersions(str) {
192
+ const regex = /\bv?(\d+\.\d+\.\d+)\b/g;
193
+ const matches = [];
194
+ let match;
195
+ while ((match = regex.exec(str)) !== null) {
196
+ matches.push(match[1]);
197
+ }
198
+ return Array.from(new Set(matches));
199
+ }
200
+ (async () => {
201
+ const log = await gitExec([
202
+ "log",
203
+ "--reverse",
204
+ `--pretty=format:"=!=%h !|! %ad !|! %an !|! %cn !|! %s !|! %B !|! %d=!="`,
205
+ `--date=format:"%Y-%m-%d %H:%M:%S"`
206
+ ]);
207
+ let markdown = `## CHANGELOG of ${pkg.name}
208
+
209
+ `;
210
+ const repo = await gitExec(["remote", "get-url", "origin"]);
211
+ const repoUrl = repo.trim().replace(/\.git$/, "");
212
+ console.log(`Repository URL: ${repoUrl}`);
213
+ const matches = [...log.matchAll(/=!=(.*?)(?:=!=|=!=,)/gs)];
214
+ const results = matches.map((m) => m[1].trim());
215
+ const versionsCommits = {};
216
+ let currentVersionCommit = "";
217
+ for (const str of results) {
218
+ const splitx = str.split("!|!").map((s) => s.trim());
219
+ const o = {
220
+ hash: splitx[0] ? splitx[0] : "",
221
+ date: splitx[1] ? splitx[1].replace(/^"|"$/g, "") : "",
222
+ authorName: splitx[2] ? splitx[2] : "",
223
+ committerName: splitx[3] ? splitx[3] : "",
224
+ summary: splitx[4] ? splitx[4] : "",
225
+ message: splitx[5] ? splitx[5] : "",
226
+ ref: splitx[6] ? splitx[6] : ""
227
+ };
228
+ let isBumped = /chore\(bump\)|chore: release/i.test(o.summary) || /release/i.test(o.summary) || /tag: v/i.test(o.summary);
229
+ if (o.summary.trim().startsWith("v")) {
230
+ isBumped = true;
231
+ }
232
+ if (/^\d+\.\d+\.\d+$/.test(o.summary.trim())) {
233
+ isBumped = true;
234
+ }
235
+ if (o.summary.trim().startsWith("fix:")) {
236
+ isBumped = false;
237
+ }
238
+ if (isBumped && !extractVersions(o.summary).length > 0) isBumped = false;
239
+ if (o.hash && o.date && o.message) {
240
+ if (o.authorName === "dependabot[bot]") {
241
+ continue;
242
+ }
243
+ if (/^chore\(tarball\): update|merge pull request|merge branch|^migrate from|^update$|^update build from https?:\/\//i.test(
244
+ o.message
245
+ )) {
246
+ continue;
247
+ }
248
+ if (/^Build\s+\w{3}\s+\w{3}\s+\d{1,2}\s+\d{2}:\d{2}:\d{2}\s+\w+\s+\d{4}$/i.test(o.summary)) {
249
+ continue;
250
+ }
251
+ if (/initial commit/i.test(o.message)) {
252
+ versionsCommits["0.0.0"] = [];
253
+ currentVersionCommit = "0.0.0";
254
+ continue;
255
+ }
256
+ if (isBumped) {
257
+ console.log(`Detected version bump: ${o.summary}`);
258
+ const v = extractVersions(o.message).join(", ");
259
+ versionsCommits[v] = [];
260
+ currentVersionCommit = v;
261
+ } else {
262
+ if (!currentVersionCommit) {
263
+ throw new Error(`No current version commit set for message: ${o.message} (hash: ${o.hash})`);
264
+ }
265
+ const cleanMsg = o.message.replace(/["'\s,]+$/g, "");
266
+ const commitsArr = versionsCommits[currentVersionCommit];
267
+ const prevIdx = commitsArr.findIndex((entry) => {
268
+ const parts = entry.split(/\r?\n/);
269
+ let msgLine = "";
270
+ for (let i = 1; i < parts.length; i++) {
271
+ if (parts[i].trim() !== "") {
272
+ msgLine = parts[i].trim();
273
+ break;
274
+ }
275
+ }
276
+ return msgLine === cleanMsg;
277
+ });
278
+ let newEntry;
279
+ if (cleanMsg.includes("\n")) {
280
+ newEntry = `- [ _${o.date}_ ] [${o.hash}](<${repoUrl}/commit/${o.hash}>)` + EOL + EOL + `${cleanMsg}`;
281
+ } else {
282
+ newEntry = `- [ _${o.date}_ ] [${o.hash}](<${repoUrl}/commit/${o.hash}>) ${cleanMsg}`;
283
+ }
284
+ if (prevIdx !== -1) {
285
+ commitsArr[prevIdx] = newEntry;
286
+ } else {
287
+ commitsArr.push(newEntry);
288
+ }
289
+ }
290
+ }
291
+ }
292
+ const versions = Object.keys(versionsCommits).sort((a, b) => {
293
+ const aParts = a.split(".").map(Number);
294
+ const bParts = b.split(".").map(Number);
295
+ for (let i = 0; i < Math.max(aParts.length, bParts.length); i++) {
296
+ const aPart = aParts[i] || 0;
297
+ const bPart = bParts[i] || 0;
298
+ if (aPart !== bPart) {
299
+ return bPart - aPart;
300
+ }
301
+ }
302
+ return 0;
303
+ });
304
+ for (const version of versions) {
305
+ if (versionsCommits[version].length > 0) {
306
+ markdown += `
307
+ ### ${version}
308
+
309
+ `;
310
+ markdown += versionsCommits[version].map((str) => {
311
+ const lines = str.trim().split(/\r?\n/);
312
+ return [lines[0], ...lines.slice(1).map((line) => " " + line)].join(EOL);
313
+ }).join(EOL);
314
+ } else {
315
+ markdown += `
316
+ ### ${version}
317
+
318
+ `;
319
+ markdown += `- No changes recorded for this version.
320
+ `;
321
+ }
322
+ }
323
+ fs.mkdirSync(path.join(__dirname, "tmp"), { recursive: true });
324
+ fs.writeFileSync(path.join(__dirname, "tmp/original.md"), log);
325
+ fs.writeFileSync(path.join(__dirname, "CHANGELOG.md"), markdown);
326
+ console.log(`Original log written to tmp/original.md`);
327
+ console.log(`Changelog updated successfully. You can find it at CHANGELOG.md`);
328
+ })();