binary-collections 2.0.9 → 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 (253) 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 -105
  33. package/lib/binary-collections.mjs +131 -84
  34. package/lib/changelog.cjs +3 -3
  35. package/lib/changelog.mjs +177 -171
  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 +3 -2
  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.js +51 -0
  91. package/lib/free-chatgpt.mjs +50 -0
  92. package/lib/git/gitattributes.cjs +1 -1
  93. package/lib/git/{gitattributes.d.mts → gitattributes.d.cts} +5 -7
  94. package/lib/git/gitattributes.mjs +2 -2
  95. package/lib/git/line-endings.cjs +297 -64
  96. package/lib/git/line-endings.mjs +4 -4
  97. package/lib/git/normalize.cjs +26 -36
  98. package/lib/git/normalize.mjs +2 -2
  99. package/lib/git/permissions.cjs +77 -11
  100. package/lib/git/permissions.mjs +3 -3
  101. package/lib/git/pull-strategy.cjs +76 -9
  102. package/lib/git/pull-strategy.mjs +3 -3
  103. package/lib/git/user-config.cjs +266 -83
  104. package/lib/git/user-config.mjs +4 -4
  105. package/lib/git/utils.cjs +40 -60
  106. package/lib/git/utils.mjs +2 -2
  107. package/lib/git-diff-cli.cjs +651 -0
  108. package/lib/git-diff-cli.d.ts +1 -0
  109. package/lib/git-diff-cli.js +15 -0
  110. package/lib/git-diff-cli.mjs +16 -0
  111. package/lib/git-diff.cjs +657 -58
  112. package/lib/git-diff.d.ts +38 -83
  113. package/lib/git-diff.js +152 -0
  114. package/lib/git-diff.mjs +23 -85
  115. package/lib/git-fix.cjs +685 -97
  116. package/lib/git-fix.mjs +14 -13
  117. package/lib/git-purge.cjs +3 -3
  118. package/lib/git-purge.d.cts +1 -0
  119. package/lib/git-purge.mjs +43 -37
  120. package/lib/index.cjs +7 -6
  121. package/lib/index.d.ts +1 -1
  122. package/lib/index.js +2 -5
  123. package/lib/index.mjs +4 -4
  124. package/lib/npm-run-series.cjs +3 -3
  125. package/lib/npm-run-series.mjs +42 -36
  126. package/lib/package-resolutions-updater.cjs +5 -5
  127. package/lib/package-resolutions-updater.mjs +266 -309
  128. package/lib/print-directory-tree.cjs +275 -210
  129. package/lib/print-directory-tree.mjs +2 -2
  130. package/lib/ps/connected-domain.cjs +25 -2
  131. package/lib/ps/connected-domain.d.ts +10 -2
  132. package/lib/ps/connected-domain.js +5 -2
  133. package/lib/ps/connected-domain.mjs +8 -4
  134. package/lib/ps/index.cjs +345 -322
  135. package/lib/ps/index.d.mjs +1 -1
  136. package/lib/ps/index.js +1 -1
  137. package/lib/ps/index.mjs +179 -182
  138. package/lib/ps/isWin.cjs +24 -1
  139. package/lib/ps/isWin.d.ts +1 -1
  140. package/lib/ps/isWin.js +3 -1
  141. package/lib/ps/isWin.mjs +8 -4
  142. package/lib/ps/table-parser.cjs +167 -159
  143. package/lib/ps/table-parser.d.ts +5 -0
  144. package/lib/ps/table-parser.js +10 -4
  145. package/lib/ps/table-parser.mjs +9 -5
  146. package/lib/remove-module.cjs +262 -0
  147. package/lib/remove-module.d.mts +1 -0
  148. package/lib/remove-module.mjs +111 -0
  149. package/lib/rmpath.cjs +274 -0
  150. package/lib/rmpath.d.mts +3 -0
  151. package/lib/rmpath.mjs +108 -0
  152. package/lib/submodule-install.cjs +264 -86
  153. package/lib/submodule-install.mjs +51 -3
  154. package/lib/submodule-remove-cli.cjs +103 -0
  155. package/lib/submodule-remove-cli.d.ts +1 -0
  156. package/lib/submodule-remove-cli.js +31 -0
  157. package/lib/submodule-remove-cli.mjs +28 -0
  158. package/lib/submodule-remove.cjs +43 -0
  159. package/lib/submodule-remove.d.cts +2 -0
  160. package/lib/submodule-remove.mjs +6 -0
  161. package/lib/utils/chatgpt.cjs +383 -0
  162. package/lib/utils/chatgpt.d.ts +31 -0
  163. package/lib/utils/chatgpt.js +541 -0
  164. package/lib/utils/chatgpt.mjs +8 -0
  165. package/lib/{utils.cjs → utils/index.cjs} +1 -1
  166. package/lib/{utils.mjs → utils/index.mjs} +2 -2
  167. package/lib/yarn-reinstall.cjs +172 -38
  168. package/lib/yarn-reinstall.mjs +2 -2
  169. package/package.json +91 -71
  170. package/readme.md +43 -69
  171. package/releases/readme.md +36 -0
  172. package/test/README.md +101 -0
  173. package/test/package.json +2 -1
  174. package/test-project/readme.md +26 -0
  175. package/tmp/test-repo/README.md +35 -0
  176. package/tmp/test-repo/package.json +1 -1
  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 -137
  192. package/lib/binary-collections.d.ts +0 -137
  193. package/lib/changelog.d.mts +0 -2
  194. package/lib/changelog.js +0 -226
  195. package/lib/chunk-DPKAJKFO.mjs +0 -171
  196. package/lib/chunk-G3THLIDT.mjs +0 -200
  197. package/lib/chunk-W3ENOM53.mjs +0 -18
  198. package/lib/clean-github-actions-caches.d.mts +0 -169
  199. package/lib/clean-github-actions-caches.d.ts +0 -169
  200. package/lib/del-gradle.d.mts +0 -2
  201. package/lib/del-node-modules.d.mts +0 -2
  202. package/lib/del-ps.d.mts +0 -2
  203. package/lib/del-yarn-caches.d.mts +0 -2
  204. package/lib/find-node-modules-cli.d.mts +0 -1
  205. package/lib/find-node-modules.d.mts +0 -13
  206. package/lib/find-node-modules.js +0 -53
  207. package/lib/git/line-endings.d.mts +0 -83
  208. package/lib/git/line-endings.d.ts +0 -83
  209. package/lib/git/normalize.d.mts +0 -43
  210. package/lib/git/normalize.d.ts +0 -43
  211. package/lib/git/permissions.d.mts +0 -17
  212. package/lib/git/permissions.d.ts +0 -17
  213. package/lib/git/pull-strategy.d.mts +0 -15
  214. package/lib/git/pull-strategy.d.ts +0 -15
  215. package/lib/git/user-config.d.mts +0 -105
  216. package/lib/git/user-config.d.ts +0 -105
  217. package/lib/git/utils.d.mts +0 -69
  218. package/lib/git/utils.d.ts +0 -69
  219. package/lib/git-diff.d.mts +0 -84
  220. package/lib/git-fix.d.mts +0 -141
  221. package/lib/git-fix.d.ts +0 -141
  222. package/lib/git-purge.d.mts +0 -2
  223. package/lib/git-purge.js +0 -59
  224. package/lib/index.d.mts +0 -1
  225. package/lib/npm-run-series.d.mts +0 -1
  226. package/lib/npm-run-series.d.ts +0 -2
  227. package/lib/npm-run-series.js +0 -86
  228. package/lib/package-resolutions-updater.d.ts +0 -352
  229. package/lib/print-directory-tree.d.mts +0 -234
  230. package/lib/print-directory-tree.d.ts +0 -234
  231. package/lib/ps/connected-domain.d.mts +0 -3
  232. package/lib/ps/index.d.d.mts +0 -26
  233. package/lib/ps/index.d.d.ts +0 -26
  234. package/lib/ps/index.d.mts +0 -26
  235. package/lib/ps/isWin.d.mts +0 -3
  236. package/lib/ps/table-parser.d.mts +0 -3
  237. package/lib/submodule-install.d.mts +0 -121
  238. package/lib/submodule-install.d.ts +0 -121
  239. package/lib/utils.d.mts +0 -40
  240. package/lib/utils.js +0 -181
  241. package/lib/yarn-reinstall.d.mts +0 -49
  242. package/lib/yarn-reinstall.d.ts +0 -49
  243. package/src/package-resolutions-updater.mjs +0 -350
  244. package/src/print-directory-tree.cjs +0 -234
  245. package/src/ps/index.js +0 -286
  246. package/src/yarn-reinstall.cjs +0 -49
  247. /package/{bin → binaries}/nodekill +0 -0
  248. /package/{bin → binaries}/nodekill.cmd +0 -0
  249. /package/lib/{binary-collections-config.d.ts → binary-collections-config.d.cts} +0 -0
  250. /package/lib/{changelog.d.ts → changelog.d.cts} +0 -0
  251. /package/lib/{git-purge.d.ts → free-chatgpt.d.ts} +0 -0
  252. /package/lib/{git-diff.d.cts → npm-run-series.d.cts} +0 -0
  253. /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
- };