binary-collections 2.0.9 → 2.0.11

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 (306) hide show
  1. package/.puppeterrc.cjs +25 -0
  2. package/binaries/binary-executor.cjs +178 -0
  3. package/{bin → binaries}/clean-nodemodule +0 -0
  4. package/binaries/clean-nodemodule.cjs +178 -0
  5. package/binaries/clean-nodemodule.cmd +4 -0
  6. package/{bin → binaries}/clean-nodemodules +0 -0
  7. package/binaries/clean-nodemodules.cjs +178 -0
  8. package/binaries/clean-nodemodules.cmd +5 -0
  9. package/{bin → binaries}/dev +0 -0
  10. package/binaries/dev.cjs +178 -0
  11. package/{bin → binaries}/empty +0 -0
  12. package/binaries/empty.cjs +178 -0
  13. package/{bin → binaries}/git-reduce-size +0 -0
  14. package/binaries/git-reduce-size.cjs +178 -0
  15. package/binaries/javakill.cjs +178 -0
  16. package/{bin → binaries}/javakill.cmd +0 -0
  17. package/binaries/kill-night-crows.bat +7 -0
  18. package/binaries/kill-night-crows.ps1 +172 -0
  19. package/{bin → binaries}/kill-process +0 -0
  20. package/binaries/kill-process.cjs +178 -0
  21. package/binaries/nodekill.cjs +178 -0
  22. package/{bin → binaries}/nodekill.ps1 +0 -0
  23. package/{bin → binaries}/prod +0 -0
  24. package/binaries/prod.cjs +178 -0
  25. package/binaries/py +111 -0
  26. package/binaries/py.cjs +178 -0
  27. package/binaries/py.cmd +49 -0
  28. package/{bin → binaries}/rmfind +0 -0
  29. package/binaries/rmfind.cjs +178 -0
  30. package/{bin → binaries}/rmx +0 -0
  31. package/binaries/rmx.cjs +178 -0
  32. package/{bin → binaries}/submodule-token +0 -0
  33. package/binaries/submodule-token.cjs +178 -0
  34. package/binaries/test-cjs +10 -0
  35. package/binaries/test-cjs.cjs +178 -0
  36. package/binaries/test-cjs.cmd +11 -0
  37. package/binaries/yarn-clean +32 -0
  38. package/binaries/yarn-clean.cjs +178 -0
  39. package/binaries/yarn-clean.cmd +30 -0
  40. package/binaries/yarn-clean.py +148 -0
  41. package/docs-src/clean-github-actions-caches.md +26 -0
  42. package/docs-src/free-chatgpt.md +26 -0
  43. package/lib/binary-collections-config.cjs +3 -2
  44. package/lib/binary-collections-config.mjs +2 -2
  45. package/lib/binary-collections.cjs +513 -105
  46. package/lib/binary-collections.mjs +178 -117
  47. package/lib/changelog.cjs +64 -16
  48. package/lib/changelog.mjs +177 -171
  49. package/lib/{chunk-VVEZVNIV.mjs → chunk-2CBJCW7E.mjs} +3 -3
  50. package/lib/chunk-34IQDTLZ.mjs +27 -0
  51. package/lib/chunk-3HFFECCI.mjs +27 -0
  52. package/lib/chunk-4UHL4WVN.mjs +136 -0
  53. package/lib/{chunk-4BYBVEYC.mjs → chunk-66PAU5PS.mjs} +5 -4
  54. package/lib/chunk-6HHJRKFB.mjs +59 -0
  55. package/lib/chunk-6S4NXESK.mjs +26 -0
  56. package/lib/chunk-7XTEJHOE.mjs +193 -0
  57. package/lib/{chunk-ZYAQRPUL.mjs → chunk-7YD7IPFF.mjs} +2 -2
  58. package/lib/{chunk-SH3L6HHV.mjs → chunk-A2JQXI5Z.mjs} +2 -2
  59. package/lib/{chunk-EGSSKVDH.mjs → chunk-A3VUZEJK.mjs} +1 -1
  60. package/lib/chunk-AJDD5DZM.mjs +109 -0
  61. package/lib/chunk-BZWVHODJ.mjs +62 -0
  62. package/lib/chunk-FCDQGYBF.mjs +136 -0
  63. package/lib/chunk-FKI7IEB5.mjs +172 -0
  64. package/lib/chunk-GEYA2USY.mjs +207 -0
  65. package/lib/chunk-GJTGHXRA.mjs +356 -0
  66. package/lib/{chunk-YV7DO3YV.mjs → chunk-HLGOWBEO.mjs} +1 -1
  67. package/lib/chunk-ID2WBTE2.mjs +80 -0
  68. package/lib/chunk-JXFOHKDM.mjs +239 -0
  69. package/lib/{chunk-YX5U7XDR.mjs → chunk-M3YIYRHT.mjs} +6 -5
  70. package/lib/chunk-N436BNBK.mjs +514 -0
  71. package/lib/chunk-NCXAP7AA.mjs +31 -0
  72. package/lib/chunk-PDN26I7O.mjs +188 -0
  73. package/lib/{chunk-JGR2NW6D.mjs → chunk-PDSXF5HY.mjs} +3 -3
  74. package/lib/{chunk-AASHBCRW.mjs → chunk-QQ4A6DLD.mjs} +8 -0
  75. package/lib/{chunk-ONIBBBQ3.mjs → chunk-RWLXRTYP.mjs} +4 -3
  76. package/lib/chunk-TOIVAQF7.mjs +136 -0
  77. package/lib/chunk-V5SKYJUB.mjs +136 -0
  78. package/lib/chunk-WSRETQCA.mjs +59 -0
  79. package/lib/chunk-XA3SNBPA.mjs +184 -0
  80. package/lib/chunk-XVBFFVCJ.mjs +209 -0
  81. package/lib/chunk-YYLIQQKF.mjs +31 -0
  82. package/lib/{chunk-APBWENF6.mjs → chunk-Z6JLYU2J.mjs} +63 -16
  83. package/lib/chunk-ZDMWBSYF.mjs +81 -0
  84. package/lib/clean-github-actions-caches.cjs +291 -148
  85. package/lib/clean-github-actions-caches.mjs +4 -3
  86. package/lib/del-gradle.cjs +63 -15
  87. package/lib/del-gradle.js +2 -1
  88. package/lib/del-gradle.mjs +2 -2
  89. package/lib/del-node-modules.cjs +143 -148
  90. package/lib/del-node-modules.js +210 -14
  91. package/lib/del-node-modules.mjs +149 -18
  92. package/lib/del-ps.cjs +90 -21
  93. package/lib/del-ps.js +3 -2
  94. package/lib/del-ps.mjs +7 -5
  95. package/lib/del-yarn-caches.cjs +87 -18
  96. package/lib/del-yarn-caches.js +38 -3
  97. package/lib/del-yarn-caches.mjs +6 -6
  98. package/lib/find-node-modules-cli.cjs +5 -4
  99. package/lib/find-node-modules-cli.js +2 -1
  100. package/lib/find-node-modules-cli.mjs +2 -2
  101. package/lib/find-node-modules.cjs +4 -3
  102. package/lib/{find-node-modules.d.ts → find-node-modules.d.cts} +1 -1
  103. package/lib/find-node-modules.mjs +2 -2
  104. package/lib/free-chatgpt.cjs +754 -0
  105. package/lib/free-chatgpt.js +51 -0
  106. package/lib/free-chatgpt.mjs +50 -0
  107. package/lib/git/gitattributes.cjs +2 -1
  108. package/lib/git/{gitattributes.d.ts → gitattributes.d.cts} +7 -2
  109. package/lib/git/gitattributes.mjs +2 -2
  110. package/lib/git/line-endings.cjs +298 -64
  111. package/lib/git/line-endings.mjs +4 -4
  112. package/lib/git/normalize.cjs +26 -36
  113. package/lib/git/normalize.mjs +2 -2
  114. package/lib/git/permissions.cjs +77 -11
  115. package/lib/git/permissions.mjs +3 -3
  116. package/lib/git/pull-strategy.cjs +76 -9
  117. package/lib/git/pull-strategy.mjs +3 -3
  118. package/lib/git/undo-commit-cli.cjs +110 -0
  119. package/lib/git/undo-commit-cli.d.ts +1 -0
  120. package/lib/git/undo-commit-cli.js +4 -0
  121. package/lib/git/undo-commit-cli.mjs +14 -0
  122. package/lib/git/undo-commit.cjs +81 -0
  123. package/lib/git/undo-commit.d.cts +1 -0
  124. package/lib/git/undo-commit.mjs +7 -0
  125. package/lib/git/undo-staged-cli.cjs +110 -0
  126. package/lib/git/undo-staged-cli.d.ts +1 -0
  127. package/lib/git/undo-staged-cli.js +4 -0
  128. package/lib/git/undo-staged-cli.mjs +14 -0
  129. package/lib/git/undo-staged.cjs +81 -0
  130. package/lib/git/undo-staged.d.cts +1 -0
  131. package/lib/git/undo-staged.mjs +7 -0
  132. package/lib/git/user-config.cjs +313 -83
  133. package/lib/git/user-config.mjs +4 -4
  134. package/lib/git/utils.cjs +40 -60
  135. package/lib/git/utils.mjs +2 -2
  136. package/lib/git-diff-cli.cjs +857 -0
  137. package/lib/git-diff-cli.js +16 -0
  138. package/lib/git-diff-cli.mjs +17 -0
  139. package/lib/git-diff.cjs +862 -58
  140. package/lib/git-diff.d.ts +38 -83
  141. package/lib/git-diff.js +152 -0
  142. package/lib/git-diff.mjs +23 -85
  143. package/lib/git-fix.cjs +733 -97
  144. package/lib/git-fix.mjs +10 -9
  145. package/lib/git-purge.cjs +64 -16
  146. package/lib/git-purge.d.cts +1 -0
  147. package/lib/git-purge.mjs +43 -37
  148. package/lib/index.cjs +7 -6
  149. package/lib/index.d.ts +1 -1
  150. package/lib/index.js +2 -5
  151. package/lib/index.mjs +4 -4
  152. package/lib/kill-night-crows.cjs +87 -0
  153. package/lib/kill-night-crows.d.mts +1 -0
  154. package/lib/kill-night-crows.mjs +65 -0
  155. package/lib/npm-run-series.cjs +63 -16
  156. package/lib/npm-run-series.mjs +42 -36
  157. package/lib/package-resolutions-updater-cli.cjs +560 -0
  158. package/lib/package-resolutions-updater-cli.d.mts +1 -0
  159. package/lib/package-resolutions-updater-cli.mjs +124 -0
  160. package/lib/package-resolutions-updater.cjs +178 -158
  161. package/lib/package-resolutions-updater.d.mts +32 -1
  162. package/lib/package-resolutions-updater.mjs +17 -338
  163. package/lib/php-cs-fixer-staged.cjs +105 -0
  164. package/lib/php-cs-fixer-staged.d.cts +2 -0
  165. package/lib/php-cs-fixer-staged.mjs +117 -0
  166. package/lib/print-directory-tree.cjs +320 -207
  167. package/lib/print-directory-tree.mjs +3 -3
  168. package/lib/ps/connected-domain.cjs +25 -2
  169. package/lib/ps/connected-domain.d.ts +10 -2
  170. package/lib/ps/connected-domain.js +5 -2
  171. package/lib/ps/connected-domain.mjs +8 -4
  172. package/lib/ps/index.cjs +345 -322
  173. package/lib/ps/index.d.mjs +1 -1
  174. package/lib/ps/index.js +2 -1
  175. package/lib/ps/index.mjs +179 -182
  176. package/lib/ps/isWin.cjs +24 -1
  177. package/lib/ps/isWin.d.ts +1 -1
  178. package/lib/ps/isWin.js +3 -1
  179. package/lib/ps/isWin.mjs +8 -4
  180. package/lib/ps/table-parser.cjs +167 -159
  181. package/lib/ps/table-parser.d.ts +5 -0
  182. package/lib/ps/table-parser.js +10 -4
  183. package/lib/ps/table-parser.mjs +9 -5
  184. package/lib/remove-module.cjs +310 -0
  185. package/lib/remove-module.d.mts +1 -0
  186. package/lib/remove-module.mjs +111 -0
  187. package/lib/rmpath.cjs +322 -0
  188. package/lib/rmpath.d.mts +3 -0
  189. package/lib/rmpath.mjs +108 -0
  190. package/lib/submodule-install.cjs +311 -86
  191. package/lib/submodule-install.mjs +53 -5
  192. package/lib/submodule-remove-cli.cjs +107 -0
  193. package/lib/submodule-remove-cli.d.ts +1 -0
  194. package/lib/submodule-remove-cli.js +31 -0
  195. package/lib/submodule-remove-cli.mjs +28 -0
  196. package/lib/submodule-remove.cjs +46 -0
  197. package/lib/submodule-remove.d.cts +2 -0
  198. package/lib/submodule-remove.mjs +6 -0
  199. package/lib/utils/chatgpt.cjs +541 -0
  200. package/lib/utils/chatgpt.d.ts +31 -0
  201. package/lib/utils/chatgpt.js +708 -0
  202. package/lib/utils/chatgpt.mjs +8 -0
  203. package/lib/utils/findEnvFiles.cjs +107 -0
  204. package/lib/utils/findEnvFiles.d.ts +8 -0
  205. package/lib/utils/findEnvFiles.js +121 -0
  206. package/lib/utils/findEnvFiles.mjs +8 -0
  207. package/lib/utils/findWorkspaceRoot.cjs +70 -0
  208. package/lib/utils/findWorkspaceRoot.d.ts +9 -0
  209. package/lib/utils/findWorkspaceRoot.js +57 -0
  210. package/lib/utils/findWorkspaceRoot.mjs +40 -0
  211. package/lib/{utils.cjs → utils/index.cjs} +61 -14
  212. package/lib/{utils.mjs → utils/index.mjs} +2 -2
  213. package/lib/utils/isGithubTokenValid.cjs +64 -0
  214. package/lib/utils/isGithubTokenValid.d.ts +7 -0
  215. package/lib/utils/isGithubTokenValid.js +48 -0
  216. package/lib/utils/isGithubTokenValid.mjs +36 -0
  217. package/lib/yarn-reinstall.cjs +220 -38
  218. package/lib/yarn-reinstall.mjs +2 -2
  219. package/package.json +138 -104
  220. package/readme.md +48 -75
  221. package/releases/readme.md +36 -0
  222. package/requirements.txt +1 -0
  223. package/test/README.md +101 -0
  224. package/test/package.json +2 -1
  225. package/test-project/readme.md +26 -0
  226. package/tmp/test-repo/README.md +35 -0
  227. package/tmp/test-repo/package.json +1 -1
  228. package/tmp/typedoc/readme.md +320 -0
  229. package/bin/bash-dummy +0 -56
  230. package/bin/bash-dummy.cmd +0 -25
  231. package/bin/dir-tree.cmd +0 -7
  232. package/bin/git-diff +0 -4
  233. package/bin/git-diff.cmd +0 -7
  234. package/bin/git-fix +0 -36
  235. package/bin/git-fix.cmd +0 -7
  236. package/bin/rmpath +0 -70
  237. package/bin/submodule-install.txt +0 -118
  238. package/bin/submodule-remove +0 -46
  239. package/bin/submodule.txt +0 -172
  240. package/lib/binary-collections-config.d.mts +0 -18
  241. package/lib/binary-collections-config.js +0 -39
  242. package/lib/binary-collections.d.mts +0 -137
  243. package/lib/binary-collections.d.ts +0 -137
  244. package/lib/changelog.d.mts +0 -2
  245. package/lib/changelog.js +0 -226
  246. package/lib/chunk-DPKAJKFO.mjs +0 -171
  247. package/lib/chunk-G3THLIDT.mjs +0 -200
  248. package/lib/chunk-W3ENOM53.mjs +0 -18
  249. package/lib/clean-github-actions-caches.d.mts +0 -169
  250. package/lib/clean-github-actions-caches.d.ts +0 -169
  251. package/lib/del-gradle.d.mts +0 -2
  252. package/lib/del-node-modules.d.mts +0 -2
  253. package/lib/del-ps.d.mts +0 -2
  254. package/lib/del-yarn-caches.d.mts +0 -2
  255. package/lib/find-node-modules-cli.d.mts +0 -1
  256. package/lib/find-node-modules.d.mts +0 -13
  257. package/lib/find-node-modules.js +0 -53
  258. package/lib/git/gitattributes.d.mts +0 -35
  259. package/lib/git/gitattributes.js +0 -223
  260. package/lib/git/line-endings.d.mts +0 -83
  261. package/lib/git/line-endings.d.ts +0 -83
  262. package/lib/git/normalize.d.mts +0 -43
  263. package/lib/git/normalize.d.ts +0 -43
  264. package/lib/git/permissions.d.mts +0 -17
  265. package/lib/git/permissions.d.ts +0 -17
  266. package/lib/git/pull-strategy.d.mts +0 -15
  267. package/lib/git/pull-strategy.d.ts +0 -15
  268. package/lib/git/user-config.d.mts +0 -105
  269. package/lib/git/user-config.d.ts +0 -105
  270. package/lib/git/utils.d.mts +0 -69
  271. package/lib/git/utils.d.ts +0 -69
  272. package/lib/git-diff.d.mts +0 -84
  273. package/lib/git-fix.d.mts +0 -141
  274. package/lib/git-fix.d.ts +0 -141
  275. package/lib/git-purge.d.mts +0 -2
  276. package/lib/git-purge.js +0 -59
  277. package/lib/index.d.mts +0 -1
  278. package/lib/npm-run-series.d.mts +0 -1
  279. package/lib/npm-run-series.js +0 -86
  280. package/lib/package-resolutions-updater.d.ts +0 -352
  281. package/lib/print-directory-tree.d.mts +0 -234
  282. package/lib/print-directory-tree.d.ts +0 -234
  283. package/lib/ps/connected-domain.d.mts +0 -3
  284. package/lib/ps/index.d.d.mts +0 -26
  285. package/lib/ps/index.d.d.ts +0 -26
  286. package/lib/ps/index.d.mts +0 -26
  287. package/lib/ps/isWin.d.mts +0 -3
  288. package/lib/ps/table-parser.d.mts +0 -3
  289. package/lib/submodule-install.d.mts +0 -121
  290. package/lib/submodule-install.d.ts +0 -121
  291. package/lib/utils.d.mts +0 -40
  292. package/lib/utils.js +0 -181
  293. package/lib/yarn-reinstall.d.mts +0 -49
  294. package/lib/yarn-reinstall.d.ts +0 -49
  295. package/src/package-resolutions-updater.mjs +0 -350
  296. package/src/print-directory-tree.cjs +0 -234
  297. package/src/ps/index.js +0 -286
  298. package/src/yarn-reinstall.cjs +0 -49
  299. /package/{bin → binaries}/nodekill +0 -0
  300. /package/{bin → binaries}/nodekill.cmd +0 -0
  301. /package/lib/{binary-collections-config.d.ts → binary-collections-config.d.cts} +0 -0
  302. /package/lib/{changelog.d.ts → changelog.d.cts} +0 -0
  303. /package/lib/{git-purge.d.ts → free-chatgpt.d.ts} +0 -0
  304. /package/lib/{git-diff.d.cts → git-diff-cli.d.ts} +0 -0
  305. /package/lib/{npm-run-series.d.ts → npm-run-series.d.cts} +0 -0
  306. /package/lib/{utils.d.ts → utils/index.d.cts} +0 -0
package/lib/changelog.js DELETED
@@ -1,226 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- const fs = require("fs");
11
- const path = require("path");
12
- const { EOL } = require("os");
13
- const { getArgs } = require("./utils");
14
- const spawn = require("child_process").spawn;
15
- const pkgPath = path.join(process.cwd(), "package.json");
16
- if (!fs.existsSync(pkgPath)) {
17
- throw new Error(`package.json not found at ${pkgPath}`);
18
- }
19
- const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
20
- const args = getArgs();
21
- // Show help if no arguments or --help/-h is passed
22
- if (args.help || args.h) {
23
- showHelp();
24
- }
25
- /**
26
- * Prints help information for the changelog script.
27
- */
28
- function showHelp() {
29
- console.log(`\nUsage: node changelog.js [options]\n`);
30
- console.log(`Options:`);
31
- console.log(` --help, -h Show this help message and exit`);
32
- console.log(`\nDescription:`);
33
- console.log(` Generates a CHANGELOG.md file from git commit history.`);
34
- console.log(` - Looks for version bumps and groups commits by version.`);
35
- console.log(` - Skips dependabot and irrelevant commits.`);
36
- console.log(` - Outputs the original git log to tmp/original.md for reference.`);
37
- console.log(`\nExample:`);
38
- console.log(` node changelog.js`);
39
- console.log(``);
40
- }
41
- /**
42
- * git
43
- * @param {string[]} command
44
- * @returns {Promise<string>}
45
- */
46
- const gitExec = (command) => new Promise((resolve, reject) => {
47
- const thread = spawn("git", command, { stdio: ["inherit", "pipe", "pipe"] });
48
- const stdOut = [];
49
- const stdErr = [];
50
- thread.stdout.on("data", (data) => {
51
- stdOut.push(data.toString("utf8"));
52
- });
53
- thread.stderr.on("data", (data) => {
54
- stdErr.push(data.toString("utf8"));
55
- });
56
- thread.on("close", () => {
57
- if (stdErr.length) {
58
- reject(stdErr.join(""));
59
- return;
60
- }
61
- resolve(stdOut.join());
62
- });
63
- });
64
- /**
65
- * Extracts all version numbers in X.X.X format from a multiline string.
66
- * @param {string} str
67
- * @returns {string[]}
68
- */
69
- function extractVersions(str) {
70
- const regex = /\bv?(\d+\.\d+\.\d+)\b/g;
71
- const matches = [];
72
- let match;
73
- while ((match = regex.exec(str)) !== null) {
74
- matches.push(match[1]);
75
- }
76
- return Array.from(new Set(matches));
77
- }
78
- // Git log format used:
79
- // %h - Abbreviated commit hash
80
- // %ad - Author date (formatted as "YYYY-MM-DD HH:MM:SS")
81
- // %B - Raw body (commit message)
82
- // %d - Ref names (branch, tag, etc.)
83
- // Fields are separated by " !|! "
84
- // Example: --pretty=format:"%h !|! %ad !|! %B %d" --date=format:"%Y-%m-%d %H:%M:%S"
85
- // `--pretty=format:"%h !|! %ad !|! %B %d"`, `--date=format:"%Y-%m-%d %H:%M:%S"`
86
- // Now includes author and committer name/email in the log format
87
- (() => __awaiter(this, void 0, void 0, function* () {
88
- const log = yield gitExec([
89
- "log",
90
- "--reverse",
91
- `--pretty=format:"=!=%h !|! %ad !|! %an !|! %cn !|! %s !|! %B !|! %d=!="`,
92
- `--date=format:"%Y-%m-%d %H:%M:%S"`
93
- ]);
94
- let markdown = `## CHANGELOG of ${pkg.name}\n\n`;
95
- const repo = yield gitExec(["remote", "get-url", "origin"]);
96
- const repoUrl = repo.trim().replace(/\.git$/, "");
97
- console.log(`Repository URL: ${repoUrl}`);
98
- const matches = [...log.matchAll(/=!=(.*?)(?:=!=|=!=,)/gs)];
99
- const results = matches.map((m) => m[1].trim());
100
- /** @type {Record<string, string[]>} */
101
- const versionsCommits = {};
102
- let currentVersionCommit = "";
103
- for (const str of results) {
104
- const splitx = str.split("!|!").map((s) => s.trim());
105
- // Now splitx: [hash, date, authorName, committerName, summary, message, ref]
106
- const o = {
107
- hash: splitx[0] ? splitx[0] : "",
108
- date: splitx[1] ? splitx[1].replace(/^"|"$/g, "") : "",
109
- authorName: splitx[2] ? splitx[2] : "",
110
- committerName: splitx[3] ? splitx[3] : "",
111
- summary: splitx[4] ? splitx[4] : "",
112
- message: splitx[5] ? splitx[5] : "",
113
- ref: splitx[6] ? splitx[6] : ""
114
- };
115
- let isBumped = /chore\(bump\)|chore: release/i.test(o.summary) || /release/i.test(o.summary) || /tag: v/i.test(o.summary);
116
- if (o.summary.trim().startsWith("v")) {
117
- isBumped = true; // Treat any commit starting with 'v' as a version bump
118
- }
119
- if (/^\d+\.\d+\.\d+$/.test(o.summary.trim())) {
120
- isBumped = true; // Treat commits with version format as version bumps
121
- }
122
- if (o.summary.trim().startsWith("fix:")) {
123
- isBumped = false; // Do not treat 'fix:' commits as version bumps
124
- }
125
- if (isBumped && !extractVersions(o.summary).length > 0)
126
- isBumped = false; // Ensure we have a version in the summary
127
- if (o.hash && o.date && o.message) {
128
- // Skip commits by dependabot[bot]
129
- if (o.authorName === "dependabot[bot]") {
130
- continue;
131
- }
132
- // Skip commits by regex
133
- if (/^chore\(tarball\): update|merge pull request|merge branch|^migrate from|^update$|^update build from https?:\/\//i.test(o.message)) {
134
- continue;
135
- }
136
- // Skip build summary messages like "Build Tue Dec 27 20:18:29 UTC 2022"
137
- 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)) {
138
- continue;
139
- }
140
- if (/initial commit/i.test(o.message)) {
141
- versionsCommits["0.0.0"] = [];
142
- currentVersionCommit = "0.0.0";
143
- continue;
144
- }
145
- if (isBumped) {
146
- console.log(`Detected version bump: ${o.summary}`);
147
- const v = extractVersions(o.message).join(", ");
148
- versionsCommits[v] = [];
149
- currentVersionCommit = v;
150
- }
151
- else {
152
- if (!currentVersionCommit) {
153
- throw new Error(`No current version commit set for message: ${o.message} (hash: ${o.hash})`);
154
- }
155
- // Remove all trailing quotes, spaces, and commas from message
156
- const cleanMsg = o.message.replace(/["'\s,]+$/g, "");
157
- // Overwrite previous entry if message is duplicated (keep latest hash)
158
- const commitsArr = versionsCommits[currentVersionCommit];
159
- // Find index of previous entry with the same message (message is now on the line after the metadata)
160
- const prevIdx = commitsArr.findIndex((entry) => {
161
- // Extract the message part (after the first empty line)
162
- const parts = entry.split(/\r?\n/);
163
- // Find the first non-empty line after the metadata line
164
- let msgLine = "";
165
- for (let i = 1; i < parts.length; i++) {
166
- if (parts[i].trim() !== "") {
167
- msgLine = parts[i].trim();
168
- break;
169
- }
170
- }
171
- return msgLine === cleanMsg;
172
- });
173
- // Add changelog entry without author/committer info
174
- let newEntry;
175
- if (cleanMsg.includes("\n")) {
176
- // Multiline message: put message on new line
177
- newEntry = `- [ _${o.date}_ ] [${o.hash}](<${repoUrl}/commit/${o.hash}>)` + EOL + EOL + `${cleanMsg}`;
178
- }
179
- else {
180
- // Single line message: put message on same line
181
- newEntry = `- [ _${o.date}_ ] [${o.hash}](<${repoUrl}/commit/${o.hash}>) ${cleanMsg}`;
182
- }
183
- if (prevIdx !== -1) {
184
- // Overwrite previous occurrence with the latest hash/date
185
- commitsArr[prevIdx] = newEntry;
186
- }
187
- else {
188
- commitsArr.push(newEntry);
189
- }
190
- }
191
- }
192
- }
193
- // Iterate versionsCommits in reverse order
194
- const versions = Object.keys(versionsCommits).sort((a, b) => {
195
- const aParts = a.split(".").map(Number);
196
- const bParts = b.split(".").map(Number);
197
- for (let i = 0; i < Math.max(aParts.length, bParts.length); i++) {
198
- const aPart = aParts[i] || 0; // Default to 0 if part is missing
199
- const bPart = bParts[i] || 0; // Default to 0 if part is missing
200
- if (aPart !== bPart) {
201
- return bPart - aPart; // Sort in descending order
202
- }
203
- }
204
- return 0; // They are equal
205
- });
206
- for (const version of versions) {
207
- if (versionsCommits[version].length > 0) {
208
- markdown += `\n### ${version}\n\n`;
209
- markdown += versionsCommits[version]
210
- .map((str) => {
211
- const lines = str.trim().split(/\r?\n/);
212
- return [lines[0], ...lines.slice(1).map((line) => " " + line)].join(EOL);
213
- })
214
- .join(EOL);
215
- }
216
- else {
217
- markdown += `\n### ${version}\n\n`;
218
- markdown += `- No changes recorded for this version.\n`;
219
- }
220
- }
221
- fs.mkdirSync(path.join(__dirname, "tmp"), { recursive: true });
222
- fs.writeFileSync(path.join(__dirname, "tmp/original.md"), log);
223
- fs.writeFileSync(path.join(__dirname, "CHANGELOG.md"), markdown);
224
- console.log(`Original log written to tmp/original.md`);
225
- console.log(`Changelog updated successfully. You can find it at CHANGELOG.md`);
226
- }))();
@@ -1,171 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import {
3
- __commonJS,
4
- init_esm_shims
5
- } from "./chunk-AASHBCRW.mjs";
6
-
7
- // src/ps/connected-domain.js
8
- var require_connected_domain = __commonJS({
9
- "src/ps/connected-domain.js"(exports, module) {
10
- init_esm_shims();
11
- module.exports = function(tdArray, indicator, hardlink) {
12
- hardlink = hardlink || false;
13
- if (!tdArray) {
14
- throw new Error("tdArray must be provided");
15
- }
16
- if (!indicator) {
17
- throw new Error("indicator must be provided");
18
- }
19
- tdArray = JSON.parse(JSON.stringify(tdArray));
20
- var domains = {};
21
- var domainUUID = 0;
22
- var pointsHash = {};
23
- tdArray.forEach(function(row, y) {
24
- row.forEach(function(colItem, x) {
25
- var identifier2 = indicator(colItem, x, y);
26
- var neighbours = [];
27
- if (tdArray[y - 1] && tdArray[y - 1][x] !== void 0) {
28
- neighbours.push(pointsHash[x + "_" + (y - 1)]);
29
- }
30
- if (row[x - 1] !== void 0) {
31
- neighbours.push(pointsHash[x - 1 + "_" + y]);
32
- }
33
- if (!hardlink) {
34
- if (tdArray[y - 1] && tdArray[y - 1][x - 1] !== void 0) {
35
- neighbours.push(pointsHash[x - 1 + "_" + (y - 1)]);
36
- }
37
- if (tdArray[y - 1] && tdArray[y - 1][x + 1] !== void 0) {
38
- neighbours.push(pointsHash[x + 1 + "_" + (y - 1)]);
39
- }
40
- }
41
- if (neighbours.length) {
42
- var matched = false;
43
- neighbours.forEach(function(neighbour) {
44
- if (neighbour.identifier == identifier2) {
45
- if (!matched) {
46
- addPointToDomain(colItem, x, y, neighbour.domainId);
47
- matched = true;
48
- } else {
49
- var colItemPoint = pointsHash[x + "_" + y];
50
- if (neighbour.domainId != colItemPoint.domainId) {
51
- mergeDomains(neighbour.domainId, colItemPoint.domainId);
52
- }
53
- }
54
- }
55
- });
56
- if (!matched) {
57
- addNewDomain(colItem, x, y, identifier2);
58
- }
59
- } else {
60
- addNewDomain(colItem, x, y, identifier2);
61
- }
62
- });
63
- });
64
- var result = {
65
- domains: [],
66
- totalDomains: 0,
67
- groupByIdentifier: {},
68
- totalIdentifiers: 0
69
- };
70
- var domainId = null;
71
- var identifier = null;
72
- var domain = null;
73
- for (domainId in domains) {
74
- domain = domains[domainId];
75
- domain.bounding = calculateBounding(domain.points);
76
- identifier = domain.identifier;
77
- result.domains.push(domain);
78
- result.totalDomains++;
79
- if (!(identifier in result.groupByIdentifier)) {
80
- result.groupByIdentifier[identifier] = [];
81
- result.totalIdentifiers++;
82
- }
83
- result.groupByIdentifier[identifier].push(domain);
84
- }
85
- function calculateBounding(points) {
86
- var minX = null;
87
- var minY = null;
88
- var maxX = null;
89
- var maxY = null;
90
- points.forEach(function(point) {
91
- if (minX === null || point.x < minX) {
92
- minX = point.x;
93
- }
94
- if (minY === null || point.y < minY) {
95
- minY = point.y;
96
- }
97
- if (maxX === null || point.x > maxX) {
98
- maxX = point.x;
99
- }
100
- if (maxY === null || point.y > maxY) {
101
- maxY = point.y;
102
- }
103
- });
104
- var w = maxX - minX;
105
- var h = maxY - minY;
106
- return {
107
- x: minX,
108
- y: minY,
109
- w,
110
- h
111
- };
112
- }
113
- function addNewDomain(point, x, y, identifier2) {
114
- var newDomain = {
115
- identifier: identifier2,
116
- domainId: ++domainUUID,
117
- bounding: {},
118
- points: []
119
- };
120
- var newPoint = {
121
- value: point,
122
- x,
123
- y,
124
- identifier: identifier2,
125
- domainId: newDomain.domainId
126
- };
127
- pointsHash[x + "_" + y] = {
128
- value: point,
129
- identifier: identifier2,
130
- domainId: newDomain.domainId
131
- };
132
- newDomain.points.push(newPoint);
133
- domains[newDomain.domainId] = newDomain;
134
- }
135
- function addPointToDomain(point, x, y, domainId2) {
136
- var domain2 = domains[domainId2];
137
- var newPoint = {
138
- value: point,
139
- x,
140
- y,
141
- identifier: domain2.identifier,
142
- domainId: domainId2
143
- };
144
- pointsHash[x + "_" + y] = {
145
- value: point,
146
- identifier: domain2.identifier,
147
- domainId: domainId2
148
- };
149
- domain2.points.push(newPoint);
150
- }
151
- function mergeDomains(domainAId, domainBId) {
152
- var domainA = domains[domainAId];
153
- var domainB = domains[domainBId];
154
- if (domainA.identifier == domainB.identifier) {
155
- domainB.domainId = domainA.domainId;
156
- domainB.points.forEach(function(point) {
157
- point.domainId = domainA.domainId;
158
- pointsHash[point.x + "_" + point.y].domainId = domainA.domainId;
159
- });
160
- domainA.points = domainA.points.concat(domainB.points);
161
- delete domains[domainBId];
162
- }
163
- }
164
- return result;
165
- };
166
- }
167
- });
168
-
169
- export {
170
- require_connected_domain
171
- };
@@ -1,200 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import {
3
- require_connected_domain
4
- } from "./chunk-DPKAJKFO.mjs";
5
- import {
6
- __commonJS,
7
- init_esm_shims
8
- } from "./chunk-AASHBCRW.mjs";
9
-
10
- // src/ps/table-parser.js
11
- var require_table_parser = __commonJS({
12
- "src/ps/table-parser.js"(exports, module) {
13
- init_esm_shims();
14
- var ConnectedDomain = require_connected_domain();
15
- var EMPTY_EX = /\s/;
16
- module.exports.parse = function(output) {
17
- var linesTmp = output.split(/(\r\n)|(\n\r)|\n|\r/);
18
- var lines = [];
19
- var titleInfo = {};
20
- var twoDimArray = [];
21
- linesTmp.forEach(function(line) {
22
- if (line && line.trim()) {
23
- lines.push(line);
24
- }
25
- });
26
- lines.forEach(function(line, index) {
27
- if (index == 0) {
28
- var fields = line.split(/\s+/);
29
- var currentIndex = 0;
30
- fields.forEach(function(field, idx) {
31
- if (field) {
32
- var info = titleInfo[field] = {};
33
- var indexBegin = line.indexOf(field, currentIndex);
34
- var indexEnd = currentIndex = indexBegin + field.length;
35
- if (idx == 0) {
36
- info.titleBegin = 0;
37
- } else {
38
- info.titleBegin = indexBegin;
39
- }
40
- if (idx == fields.length - 1) {
41
- info.titleEnd = line.length - 1;
42
- } else {
43
- info.titleEnd = indexEnd;
44
- }
45
- }
46
- });
47
- } else {
48
- twoDimArray[index - 1] = line.split("");
49
- }
50
- });
51
- var connectedDomains = ConnectedDomain(
52
- twoDimArray,
53
- function(value) {
54
- if (EMPTY_EX.test(value)) {
55
- return -1;
56
- } else {
57
- return 1;
58
- }
59
- },
60
- true
61
- );
62
- var valuesDomainsVerticalGroups = [];
63
- connectedDomains.domains.sort(function(a, b) {
64
- return a.bounding.x - b.bounding.x;
65
- });
66
- connectedDomains.domains.forEach(function(domain) {
67
- if (domain.identifier === 1) {
68
- var overlapped = false;
69
- valuesDomainsVerticalGroups.forEach(function(group) {
70
- var bounding = domain.bounding;
71
- var left = bounding.x;
72
- var right = bounding.x + bounding.w;
73
- if (overlap(left, right, group.begin, group.end)) {
74
- overlapped = true;
75
- group.domains.push(domain);
76
- group.begin = group.begin > left ? left : group.begin;
77
- group.end = group.end < right ? right : group.end;
78
- }
79
- });
80
- if (!overlapped) {
81
- valuesDomainsVerticalGroups.push({
82
- begin: domain.bounding.x,
83
- end: domain.bounding.x + domain.bounding.w,
84
- domains: [domain]
85
- });
86
- }
87
- }
88
- });
89
- valuesDomainsVerticalGroups.forEach(function(group) {
90
- var title = null;
91
- var info = null;
92
- var overlapped = false;
93
- var minimunLeftDistance = null;
94
- var nearestLeftTitle = null;
95
- var distance = null;
96
- for (title in titleInfo) {
97
- info = titleInfo[title];
98
- if (group.begin > info.titleBegin) {
99
- distance = group.begin - info.titleBegin;
100
- if (!nearestLeftTitle || distance < minimunLeftDistance) {
101
- nearestLeftTitle = title;
102
- minimunLeftDistance = distance;
103
- }
104
- }
105
- if (overlap(group.begin, group.end, info.titleBegin, info.titleEnd)) {
106
- overlapped = true;
107
- info.titleBegin = info.titleBegin > group.begin ? group.begin : info.titleBegin;
108
- info.titleEnd = info.titleEnd < group.end ? group.end : info.titleEnd;
109
- }
110
- }
111
- if (!overlapped && nearestLeftTitle) {
112
- var nearestTitleField = titleInfo[nearestLeftTitle];
113
- nearestTitleField.titleBegin = nearestTitleField.titleBegin > group.begin ? group.begin : nearestTitleField.titleBegin;
114
- nearestTitleField.titleEnd = nearestTitleField.titleEnd < group.end ? group.end : nearestTitleField.titleEnd;
115
- }
116
- });
117
- var result = [];
118
- lines.forEach(function(line, index) {
119
- if (index > 0) {
120
- var lineItem = {};
121
- var title = null;
122
- var info = null;
123
- var value = null;
124
- for (title in titleInfo) {
125
- info = titleInfo[title];
126
- value = line.substring(info.titleBegin, info.titleEnd + 1);
127
- lineItem[title] = splitValue(value.trim());
128
- }
129
- result.push(lineItem);
130
- }
131
- });
132
- return result;
133
- };
134
- function overlap(begin1, end1, begin2, end2) {
135
- return begin1 > begin2 && begin1 < end2 || // 2--1--2--1 or 2--1--1--2
136
- end1 > begin2 && end1 < end2 || // 1--2--1--2 or 2--1--1--2
137
- begin1 <= begin2 && end1 >= end2;
138
- }
139
- function splitValue(value) {
140
- var match = value.match(/"/g);
141
- if (!match || match.length == 1) {
142
- return value.split(/\s+/);
143
- } else {
144
- var result = [];
145
- var chunk = null;
146
- var ifInWrappedChunk = false;
147
- var ifInPureWrappedChunk = false;
148
- var quotaCount = 0;
149
- var maxQuotaCount = match.length % 2 == 0 ? match.length : match.length - 1;
150
- var previousItem = null;
151
- var values = value.split("");
152
- values.forEach(function(item, index) {
153
- if (item !== " ") {
154
- if (item === '"') {
155
- if (ifInWrappedChunk === false && quotaCount <= maxQuotaCount) {
156
- ifInWrappedChunk = true;
157
- quotaCount++;
158
- if (previousItem === " " || previousItem === null) {
159
- ifInPureWrappedChunk = true;
160
- chunk = "";
161
- } else {
162
- chunk += item;
163
- }
164
- } else if (ifInWrappedChunk === true) {
165
- ifInWrappedChunk = false;
166
- quotaCount++;
167
- if (ifInPureWrappedChunk === true) {
168
- ifInPureWrappedChunk = false;
169
- result.push(chunk);
170
- chunk = null;
171
- } else {
172
- chunk += item;
173
- }
174
- }
175
- } else if (ifInWrappedChunk === false && (previousItem === " " || previousItem === null)) {
176
- chunk = item;
177
- } else {
178
- chunk += item;
179
- }
180
- } else if (ifInWrappedChunk) {
181
- chunk += item;
182
- } else if (chunk !== null) {
183
- result.push(chunk);
184
- chunk = null;
185
- }
186
- previousItem = item;
187
- if (index == values.length - 1 && chunk !== null) {
188
- result.push(chunk);
189
- chunk = null;
190
- }
191
- });
192
- return result;
193
- }
194
- }
195
- }
196
- });
197
-
198
- export {
199
- require_table_parser
200
- };
@@ -1,18 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import {
3
- __commonJS,
4
- init_esm_shims
5
- } from "./chunk-AASHBCRW.mjs";
6
-
7
- // src/ps/isWin.js
8
- var require_isWin = __commonJS({
9
- "src/ps/isWin.js"(exports, module) {
10
- init_esm_shims();
11
- var isWin = process.platform === "win32";
12
- module.exports = isWin;
13
- }
14
- });
15
-
16
- export {
17
- require_isWin
18
- };