binary-collections 2.0.11 → 2.0.12

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 (225) hide show
  1. package/.opencode/package.json +5 -0
  2. package/binaries/rmx +15 -1
  3. package/binaries/rmx.cmd +12 -0
  4. package/binaries/test-cjs +9 -1
  5. package/binaries/test-cjs.cmd +16 -1
  6. package/binaries/test-esm +16 -0
  7. package/binaries/test-esm.cjs +178 -0
  8. package/binaries/test-esm.cmd +23 -0
  9. package/binaries/yarn-clean +1 -1
  10. package/binaries/yarn-clean.cmd +1 -1
  11. package/binaries/yarn-clean.py +33 -15
  12. package/binaries/yc +110 -0
  13. package/binaries/yc.cjs +178 -0
  14. package/lib/binary-collections/config.cjs +126 -0
  15. package/lib/binary-collections/config.mjs +7 -0
  16. package/lib/binary-collections/executeScript.cjs +19 -0
  17. package/lib/binary-collections/executeScript.d.cts +12 -0
  18. package/lib/binary-collections/executeScript.mjs +6 -0
  19. package/lib/binary-collections/findScript.cjs +284 -0
  20. package/lib/binary-collections/findScript.d.cts +12 -0
  21. package/lib/binary-collections/findScript.mjs +7 -0
  22. package/lib/binary-collections/listScript.cjs +266 -0
  23. package/lib/binary-collections/listScript.d.cts +19 -0
  24. package/lib/binary-collections/listScript.mjs +7 -0
  25. package/lib/binary-collections.cjs +224 -137
  26. package/lib/binary-collections.mjs +22 -282
  27. package/lib/changelog.cjs +2 -2
  28. package/lib/changelog.mjs +1 -1
  29. package/lib/{chunk-AJDD5DZM.mjs → chunk-2LSRSEXF.mjs} +1 -1
  30. package/lib/{chunk-Z6JLYU2J.mjs → chunk-5RTXZVCW.mjs} +2 -2
  31. package/lib/{chunk-XA3SNBPA.mjs → chunk-66KDU4TX.mjs} +93 -9
  32. package/lib/chunk-6PU7BAHB.mjs +61 -0
  33. package/lib/chunk-C6D2TTYU.mjs +32 -0
  34. package/lib/chunk-FB2WKVJD.mjs +158 -0
  35. package/lib/{chunk-NCXAP7AA.mjs → chunk-G5UUEWUO.mjs} +9 -5
  36. package/lib/{chunk-N436BNBK.mjs → chunk-GAGABICI.mjs} +19 -13
  37. package/lib/chunk-H44UWUFY.mjs +105 -0
  38. package/lib/chunk-NCZPTKDV.mjs +79 -0
  39. package/lib/chunk-NGFK3EYW.mjs +28 -0
  40. package/lib/chunk-NVEG3LEZ.mjs +143 -0
  41. package/lib/chunk-OGXVGBRI.mjs +29 -0
  42. package/lib/chunk-OXV52GD5.mjs +62 -0
  43. package/lib/chunk-PXBMHE7O.mjs +35 -0
  44. package/lib/chunk-R5FJOR63.mjs +47 -0
  45. package/lib/chunk-SPTECFE5.mjs +180 -0
  46. package/lib/chunk-UXCFNAR6.mjs +55 -0
  47. package/lib/chunk-V2IBPCEV.mjs +39 -0
  48. package/lib/chunk-XPJGCDOD.mjs +14 -0
  49. package/lib/chunk-ZOWVMII3.mjs +228 -0
  50. package/lib/clean-github-actions-caches-cli.cjs +465 -0
  51. package/lib/clean-github-actions-caches-cli.d.cts +1 -0
  52. package/lib/clean-github-actions-caches-cli.mjs +56 -0
  53. package/lib/clean-github-actions-caches.cjs +149 -205
  54. package/lib/clean-github-actions-caches.d.cts +15 -1
  55. package/lib/clean-github-actions-caches.mjs +4 -130
  56. package/lib/cross-env/command.cjs +63 -0
  57. package/lib/cross-env/command.d.ts +8 -0
  58. package/lib/cross-env/command.js +45 -0
  59. package/lib/cross-env/command.mjs +9 -0
  60. package/lib/cross-env/index.cjs +178 -0
  61. package/lib/cross-env/index.d.ts +8 -0
  62. package/lib/cross-env/index.js +102 -0
  63. package/lib/cross-env/index.mjs +101 -0
  64. package/lib/cross-env/variable.cjs +60 -0
  65. package/lib/cross-env/variable.d.ts +7 -0
  66. package/lib/cross-env/variable.js +59 -0
  67. package/lib/cross-env/variable.mjs +9 -0
  68. package/lib/del-gradle.cjs +2 -2
  69. package/lib/del-gradle.js +8 -8
  70. package/lib/del-gradle.mjs +1 -1
  71. package/lib/del-node-modules.js +24 -24
  72. package/lib/del-ps.cjs +2 -2
  73. package/lib/del-ps.js +8 -8
  74. package/lib/del-ps.mjs +1 -1
  75. package/lib/del-yarn-caches.cjs +2 -2
  76. package/lib/del-yarn-caches.js +2 -2
  77. package/lib/del-yarn-caches.mjs +1 -1
  78. package/lib/file/copy-cli.cjs +92 -0
  79. package/lib/file/copy-cli.d.mts +1 -0
  80. package/lib/file/copy-cli.mjs +55 -0
  81. package/lib/file/copy.cjs +56 -0
  82. package/lib/file/copy.d.mts +1 -0
  83. package/lib/file/copy.mjs +8 -0
  84. package/lib/file/move-cli.cjs +91 -0
  85. package/lib/file/move-cli.d.mts +1 -0
  86. package/lib/file/move-cli.mjs +55 -0
  87. package/lib/file/move.cjs +55 -0
  88. package/lib/file/move.d.mts +1 -0
  89. package/lib/file/move.mjs +8 -0
  90. package/lib/find-node-modules-cli.js +1 -1
  91. package/lib/free-chatgpt.cjs +21 -15
  92. package/lib/free-chatgpt.js +10 -10
  93. package/lib/free-chatgpt.mjs +2 -2
  94. package/lib/git/user-config.cjs +2 -2
  95. package/lib/git/user-config.mjs +2 -2
  96. package/lib/git-diff-cli.cjs +188 -42
  97. package/lib/git-diff-cli.mjs +5 -4
  98. package/lib/git-diff.cjs +188 -42
  99. package/lib/git-diff.d.ts +2 -1
  100. package/lib/git-diff.js +91 -34
  101. package/lib/git-diff.mjs +5 -4
  102. package/lib/git-fix.cjs +2 -2
  103. package/lib/git-fix.mjs +2 -2
  104. package/lib/git-purge.cjs +2 -2
  105. package/lib/git-purge.mjs +1 -1
  106. package/lib/index.d.ts +1 -1
  107. package/lib/kill-night-crows.cjs +7 -7
  108. package/lib/kill-night-crows.mjs +7 -7
  109. package/lib/node-cache-cleaner/npm.cjs +65 -0
  110. package/lib/node-cache-cleaner/npm.d.ts +2 -0
  111. package/lib/node-cache-cleaner/npm.js +41 -0
  112. package/lib/node-cache-cleaner/npm.mjs +10 -0
  113. package/lib/node-cache-cleaner/npx.cjs +89 -0
  114. package/lib/node-cache-cleaner/npx.d.ts +4 -0
  115. package/lib/node-cache-cleaner/npx.js +82 -0
  116. package/lib/{ps/index.d.mjs → node-cache-cleaner/npx.mjs} +6 -5
  117. package/lib/node-cache-cleaner/yarn.cjs +73 -0
  118. package/lib/node-cache-cleaner/yarn.d.ts +2 -0
  119. package/lib/node-cache-cleaner/yarn.js +62 -0
  120. package/lib/node-cache-cleaner/yarn.mjs +10 -0
  121. package/lib/node-cache-cleaner-cli.cjs +182 -0
  122. package/lib/node-cache-cleaner-cli.d.ts +2 -0
  123. package/lib/node-cache-cleaner-cli.js +60 -0
  124. package/lib/node-cache-cleaner-cli.mjs +56 -0
  125. package/lib/node-executor.cjs +91 -0
  126. package/lib/node-executor.d.cts +2 -0
  127. package/lib/node-executor.mjs +103 -0
  128. package/lib/npm-run-series.cjs +21 -28
  129. package/lib/npm-run-series.mjs +20 -6
  130. package/lib/package-resolutions-updater-cli.cjs +213 -128
  131. package/lib/package-resolutions-updater-cli.mjs +17 -39
  132. package/lib/package-resolutions-updater.cjs +204 -98
  133. package/lib/package-resolutions-updater.d.mts +20 -1
  134. package/lib/package-resolutions-updater.mjs +7 -5
  135. package/lib/print-directory-tree.cjs +2 -2
  136. package/lib/print-directory-tree.mjs +1 -1
  137. package/lib/ps/connected-domain.js +10 -10
  138. package/lib/ps/index.cjs +1 -1
  139. package/lib/ps/index.mjs +177 -171
  140. package/lib/ps/isWin.js +1 -1
  141. package/lib/ps/table-parser.js +6 -6
  142. package/lib/remove-module.cjs +2 -2
  143. package/lib/remove-module.mjs +1 -1
  144. package/lib/rm-node-module-cli.cjs +222 -0
  145. package/lib/rm-node-module-cli.d.cts +1 -0
  146. package/lib/rm-node-module-cli.mjs +89 -0
  147. package/lib/rm-node-modules.cjs +127 -0
  148. package/lib/rm-node-modules.d.cts +35 -0
  149. package/lib/{binary-collections-config.mjs → rm-node-modules.mjs} +3 -3
  150. package/lib/rmpath.cjs +2 -2
  151. package/lib/rmpath.mjs +1 -1
  152. package/lib/submodule-install.cjs +47 -34
  153. package/lib/submodule-install.mjs +46 -33
  154. package/lib/submodule-remove-cli.cjs +1 -2
  155. package/lib/submodule-remove-cli.js +3 -3
  156. package/lib/submodule-remove-cli.mjs +1 -2
  157. package/lib/utils/chatgpt.cjs +19 -13
  158. package/lib/utils/chatgpt.js +94 -94
  159. package/lib/utils/chatgpt.mjs +1 -1
  160. package/lib/utils/findEnvFiles.cjs +28 -46
  161. package/lib/utils/findEnvFiles.d.cts +19 -0
  162. package/lib/utils/findEnvFiles.mjs +3 -5
  163. package/lib/utils/findWorkspaceRoot.js +4 -4
  164. package/lib/utils/index.cjs +2 -2
  165. package/lib/utils/index.mjs +1 -1
  166. package/lib/utils/isGithubTokenValid.js +7 -7
  167. package/lib/{ps/index.d.cjs → utils/isWindows.cjs} +17 -3
  168. package/lib/utils/isWindows.d.ts +5 -0
  169. package/lib/utils/isWindows.js +10 -0
  170. package/lib/utils/isWindows.mjs +8 -0
  171. package/lib/utils/runBash.cjs +53 -0
  172. package/lib/utils/runBash.d.cts +12 -0
  173. package/lib/utils/runBash.mjs +66 -0
  174. package/lib/yarn-per-branch-lock-installer.cjs +97 -0
  175. package/lib/yarn-per-branch-lock-installer.d.cts +2 -0
  176. package/lib/yarn-per-branch-lock-installer.mjs +109 -0
  177. package/lib/yarn-reinstall.cjs +2 -2
  178. package/lib/yarn-reinstall.mjs +1 -1
  179. package/package.json +61 -52
  180. package/readme.html +784 -0
  181. package/readme.md +106 -218
  182. package/releases/readme.md +1 -1
  183. package/test/README.md +2 -2
  184. package/test-project/package.json +8 -2
  185. package/test-project/workspaces/workspace-a/package.json +135 -0
  186. package/test-project/workspaces/workspace-a/readme.md +20 -0
  187. package/test-project/workspaces/workspace-a/release/readme.md +42 -0
  188. package/test-project/workspaces/workspace-a/test/demo/package.json +25 -0
  189. package/test-project/workspaces/workspace-a/test/readme.md +12 -0
  190. package/test-project/workspaces/workspace-b/package.json +139 -0
  191. package/test-project/workspaces/workspace-b/readme.md +94 -0
  192. package/test-project/workspaces/workspace-b/requirements.txt +1 -0
  193. package/test-project/workspaces/workspace-b/test/sample-project/package.json +7 -0
  194. package/test-project/workspaces/workspace-b/themes/hexo-theme-flowbite/package.json +96 -0
  195. package/test-project/workspaces/workspace-b/themes/hexo-theme-flowbite/readme.md +156 -0
  196. package/tmp/rm-node-modules-test-project/package.json +17 -0
  197. package/tmp/rm-node-modules-test-project/packages/workspace-a/package.json +16 -0
  198. package/tmp/rm-node-modules-test-project/packages/workspace-b/package.json +16 -0
  199. package/tmp/test-repo/README.md +2 -35
  200. package/tmp/test-repo/package.json +13 -3
  201. package/docs-src/clean-github-actions-caches.md +0 -26
  202. package/docs-src/free-chatgpt.md +0 -26
  203. package/lib/binary-collections-config.cjs +0 -15
  204. package/lib/chunk-2CBJCW7E.mjs +0 -81
  205. package/lib/chunk-4UHL4WVN.mjs +0 -136
  206. package/lib/chunk-66PAU5PS.mjs +0 -31
  207. package/lib/chunk-6HHJRKFB.mjs +0 -59
  208. package/lib/chunk-7XTEJHOE.mjs +0 -193
  209. package/lib/chunk-FCDQGYBF.mjs +0 -136
  210. package/lib/chunk-GEYA2USY.mjs +0 -207
  211. package/lib/chunk-GJTGHXRA.mjs +0 -356
  212. package/lib/chunk-ID2WBTE2.mjs +0 -80
  213. package/lib/chunk-JXFOHKDM.mjs +0 -239
  214. package/lib/chunk-PDSXF5HY.mjs +0 -187
  215. package/lib/chunk-RWLXRTYP.mjs +0 -109
  216. package/lib/chunk-TOIVAQF7.mjs +0 -136
  217. package/lib/chunk-V5SKYJUB.mjs +0 -136
  218. package/lib/chunk-WSRETQCA.mjs +0 -59
  219. package/lib/chunk-YYLIQQKF.mjs +0 -31
  220. package/lib/ps/index.d.ts +0 -2
  221. package/lib/ps/index.js +0 -254
  222. package/lib/utils/findEnvFiles.d.ts +0 -8
  223. package/lib/utils/findEnvFiles.js +0 -121
  224. package/tmp/typedoc/readme.md +0 -320
  225. /package/lib/{binary-collections-config.d.cts → binary-collections/config.d.cts} +0 -0
package/lib/git-diff.cjs CHANGED
@@ -42,12 +42,108 @@ var init_cjs_shims = __esm({
42
42
  }
43
43
  });
44
44
 
45
- // src/binary-collections-config.cjs
46
- var require_binary_collections_config = __commonJS({
47
- "src/binary-collections-config.cjs"(exports2, module2) {
45
+ // src/utils/findEnvFiles.cjs
46
+ var require_findEnvFiles = __commonJS({
47
+ "src/utils/findEnvFiles.cjs"(exports2, module2) {
48
48
  init_cjs_shims();
49
+ var fs3 = require("fs");
49
50
  var path3 = require("path");
50
- require("dotenv").config({ path: path3.join(process.cwd(), ".env"), quiet: true, override: true });
51
+ var glob = require("glob");
52
+ var DEFAULT_IGNORES = [
53
+ "**/node_modules/**",
54
+ "**/.git/**",
55
+ "**/.yarn/**",
56
+ "**/.pnpm/**",
57
+ "**/dist/**",
58
+ "**/build/**",
59
+ "**/coverage/**",
60
+ "**/vendor/**",
61
+ "**/tmp/**",
62
+ "**/.cache/**",
63
+ "**/assets/**",
64
+ "**/logs/**",
65
+ "**/output/**",
66
+ "**/public/**",
67
+ "**/static/**",
68
+ "**/temp/**",
69
+ "**/backup/**",
70
+ "**/backups/**",
71
+ "**/examples/**",
72
+ "**/docs/**",
73
+ "**/tests/**",
74
+ "**/__tests__/**",
75
+ "**/spec/**",
76
+ "**/__specs__/**",
77
+ "**/scripts/**",
78
+ "**/bin/**",
79
+ "**/hooks/**",
80
+ "**/config/**",
81
+ "**/configs/**",
82
+ "**/settings/**",
83
+ "**/.vscode/**",
84
+ "**/.idea/**"
85
+ ];
86
+ function findEnvFiles(startDir = process.cwd(), filter) {
87
+ const found = /* @__PURE__ */ new Set();
88
+ function addFile(file) {
89
+ const normalized = path3.normalize(file);
90
+ if (typeof filter === "function" && !filter(normalized)) {
91
+ return;
92
+ }
93
+ found.add(normalized);
94
+ }
95
+ let current = path3.resolve(startDir);
96
+ while (true) {
97
+ const envPath = path3.join(current, ".env");
98
+ if (fs3.existsSync(envPath)) {
99
+ addFile(envPath);
100
+ }
101
+ const parent = path3.dirname(current);
102
+ if (parent === current) {
103
+ break;
104
+ }
105
+ current = parent;
106
+ }
107
+ const files = glob.globSync("**/.env*", {
108
+ cwd: startDir,
109
+ absolute: true,
110
+ nodir: true,
111
+ ignore: DEFAULT_IGNORES
112
+ });
113
+ for (const file of files) {
114
+ addFile(file);
115
+ }
116
+ return [...found];
117
+ }
118
+ function findEnvWithToken(startDir = process.cwd(), tokenName = "GITHUB_TOKEN") {
119
+ const envFiles = findEnvFiles(startDir);
120
+ return envFiles.find((file) => {
121
+ try {
122
+ const content = fs3.readFileSync(file, "utf-8");
123
+ const regex = new RegExp(`^\\s*${tokenName}\\s*=`, "m");
124
+ return regex.test(content);
125
+ } catch (err) {
126
+ console.warn(`Failed to read ${file}: ${err instanceof Error ? err.message : String(err)}`);
127
+ return false;
128
+ }
129
+ });
130
+ }
131
+ module2.exports = {
132
+ DEFAULT_IGNORES,
133
+ findEnvFiles,
134
+ findEnvWithToken,
135
+ default: findEnvFiles
136
+ };
137
+ }
138
+ });
139
+
140
+ // src/binary-collections/config.cjs
141
+ var require_config = __commonJS({
142
+ "src/binary-collections/config.cjs"(exports2, module2) {
143
+ init_cjs_shims();
144
+ var path3 = require("path");
145
+ var { findEnvWithToken } = require_findEnvFiles();
146
+ require("dotenv").config({ path: findEnvWithToken(), quiet: true, overwrite: true });
51
147
  function getTempDir() {
52
148
  return process.env.TEMP_DIR || path3.join(process.cwd(), "tmp");
53
149
  }
@@ -138,7 +234,7 @@ var require_utils = __commonJS({
138
234
  try {
139
235
  fs3.rmdirSync(fullPath);
140
236
  console.log("deleted", fullPath);
141
- } catch (e) {
237
+ } catch (_e) {
142
238
  try {
143
239
  fs3.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
144
240
  console.log("deleted", fullPath);
@@ -151,7 +247,7 @@ var require_utils = __commonJS({
151
247
  try {
152
248
  fs3.unlinkSync(fullPath);
153
249
  console.log("deleted", fullPath);
154
- } catch (e) {
250
+ } catch (_e) {
155
251
  try {
156
252
  fs3.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
157
253
  console.log("deleted", fullPath);
@@ -249,11 +345,13 @@ __export(git_diff_exports, {
249
345
  });
250
346
  module.exports = __toCommonJS(git_diff_exports);
251
347
  init_cjs_shims();
348
+ var import_ansi_colors = __toESM(require("ansi-colors"), 1);
252
349
  var import_child_process = require("child_process");
253
350
  var import_fs_extra2 = __toESM(require("fs-extra"), 1);
351
+ var import_sbg_utility = require("sbg-utility");
254
352
  var import_upath2 = __toESM(require("upath"), 1);
255
353
  var import_url = require("url");
256
- var import_binary_collections_config = __toESM(require_binary_collections_config(), 1);
354
+ var import_config = __toESM(require_config(), 1);
257
355
 
258
356
  // src/utils/chatgpt.js
259
357
  init_cjs_shims();
@@ -372,7 +470,10 @@ async function writeQuestion(page, question) {
372
470
  async function clickSubmitButton(page) {
373
471
  console.log("Attempting to click the submit button...");
374
472
  try {
375
- const userMessageCountBefore = await page.$$eval('[data-message-author-role="user"]', (elements) => elements.length);
473
+ const userMessageCountBefore = await page.$$eval(
474
+ '[data-message-author-role="user"]',
475
+ (elements) => elements.length
476
+ );
376
477
  const waitForSubmit = async (timeout = 5e3) => {
377
478
  try {
378
479
  await page.waitForFunction(
@@ -388,18 +489,21 @@ async function clickSubmitButton(page) {
388
489
  return false;
389
490
  }
390
491
  };
391
- await page.waitForFunction(() => {
392
- const candidates = [
393
- document.querySelector('[data-testid="fruitjuice-send-button"]'),
394
- document.querySelector("#composer-submit-button"),
395
- document.querySelector('[data-testid="send-button"]')
396
- ].filter(Boolean);
397
- return candidates.some((button) => {
398
- const isDisabled = button.disabled || button.getAttribute("aria-disabled") === "true";
399
- const isVisible = button.offsetParent !== null;
400
- return !isDisabled && isVisible;
401
- });
402
- }, { timeout: 5e3 }).catch(() => {
492
+ await page.waitForFunction(
493
+ () => {
494
+ const candidates = [
495
+ document.querySelector('[data-testid="fruitjuice-send-button"]'),
496
+ document.querySelector("#composer-submit-button"),
497
+ document.querySelector('[data-testid="send-button"]')
498
+ ].filter(Boolean);
499
+ return candidates.some((button) => {
500
+ const isDisabled = button.disabled || button.getAttribute("aria-disabled") === "true";
501
+ const isVisible = button.offsetParent !== null;
502
+ return !isDisabled && isVisible;
503
+ });
504
+ },
505
+ { timeout: 5e3 }
506
+ ).catch(() => {
403
507
  });
404
508
  const buttonDetails = await page.evaluate(() => {
405
509
  const selectors = [
@@ -765,20 +869,24 @@ async function runChatGpt(chatgptOptions = {}) {
765
869
  var import_utils = __toESM(require_utils(), 1);
766
870
  var __filename2 = (0, import_url.fileURLToPath)(importMetaUrl);
767
871
  var __dirname = import_upath2.default.dirname(__filename2);
768
- var DIFF_OUTPUT = (0, import_binary_collections_config.getTempPath)("git-diff.txt");
769
- var GPT_DIFF_OUTPUT = (0, import_binary_collections_config.getTempPath)("gpt-question.txt");
872
+ var args = (0, import_utils.getArgs)();
873
+ var positional = args._ || [];
874
+ var FILENAME = (0, import_sbg_utility.md5)((positional[0] || "default") + JSON.stringify(args));
875
+ var DIFF_OUTPUT = (0, import_config.getTempPath)(`git-diff/${FILENAME}.txt`);
876
+ var GPT_DIFF_OUTPUT = (0, import_config.getTempPath)(`git-diff/gpt-${FILENAME}.txt`);
770
877
  var CACHE_DIR = import_upath2.default.dirname(DIFF_OUTPUT);
771
878
  var DIFF_OUTPUT_RELATIVE = import_upath2.default.relative(process.cwd(), DIFF_OUTPUT);
772
879
  var GPT_DIFF_OUTPUT_RELATIVE = import_upath2.default.relative(process.cwd(), GPT_DIFF_OUTPUT);
773
- if (!import_fs_extra2.default.existsSync(CACHE_DIR)) {
774
- import_fs_extra2.default.mkdirSync(CACHE_DIR, { recursive: true });
775
- }
880
+ import_fs_extra2.default.ensureDirSync(CACHE_DIR, { mode: 493 });
776
881
  function showHelp() {
777
882
  console.log("\u{1F4DD} Git Diff Helper");
778
883
  console.log("\u{1F4C4} Usage:");
779
884
  console.log(" \u{1F4C2} git-diff FILE Show staged diff of specified file");
780
885
  console.log(" \u{1F4C2} git-diff --staged-only Show staged diff of all files");
781
886
  console.log(" \u{1F4C2} git-diff -s | -S Same as --staged-only");
887
+ console.log(" \u{1F4C2} git-diff --unstaged FILE Show unstaged diff of specified file");
888
+ console.log(" \u{1F4C2} git-diff --unstaged Show unstaged diff of all files");
889
+ console.log(" \u{1F4C2} git-diff -u Same as --unstaged");
782
890
  console.log(" \u{1F4C2} git-diff --ai Run ChatGPT automation for commit message");
783
891
  console.log(" \u{1F4C2} git-diff --help | -h Show this help message");
784
892
  console.log("");
@@ -795,13 +903,13 @@ function runGitDiff(command, successMessage, errorMessage) {
795
903
  // 10MB buffer to handle large diffs
796
904
  });
797
905
  if (!result || result.trim() === "") {
798
- console.log(`\u2139\uFE0F [i] No changes found for the specified criteria`);
799
- import_fs_extra2.default.writeFileSync(DIFF_OUTPUT, "# No changes found\n");
906
+ console.log(`\u2139\uFE0F [i] No changes found for the specified criteria`);
907
+ (0, import_sbg_utility.writefile)(DIFF_OUTPUT, "# No changes found\n");
800
908
  console.log(`\u2705 Empty diff saved to "${DIFF_OUTPUT_RELATIVE}"`);
801
- return;
909
+ return false;
802
910
  }
803
- import_fs_extra2.default.writeFileSync(DIFF_OUTPUT, result);
804
- import_fs_extra2.default.writeFileSync(
911
+ (0, import_sbg_utility.writefile)(DIFF_OUTPUT, result);
912
+ (0, import_sbg_utility.writefile)(
805
913
  GPT_DIFF_OUTPUT,
806
914
  `Hello, ChatGPT!
807
915
  Can you create a conventional commit message by diff content below:
@@ -814,7 +922,8 @@ Give me result as codeblock with language "text" only.
814
922
  Thank you!`
815
923
  );
816
924
  console.log(`\u2705 ${successMessage}`);
817
- console.log(`\u{1F4BE} GPT diff prompt saved to "${GPT_DIFF_OUTPUT_RELATIVE}"`);
925
+ console.log(`\u{1F4BE} GPT diff prompt saved to "${import_ansi_colors.default.green(GPT_DIFF_OUTPUT_RELATIVE)}"`);
926
+ return true;
818
927
  } catch (error) {
819
928
  console.error(`\u274C ${errorMessage}`);
820
929
  console.error(`\u{1F4DD} Command: ${command}`);
@@ -825,34 +934,71 @@ Thank you!`
825
934
  process.exit(1);
826
935
  }
827
936
  }
937
+ function fileHasChanges(file, mode) {
938
+ const command = mode === "staged" ? `git diff --cached --quiet -- "${file}"` : `git diff --quiet -- "${file}"`;
939
+ try {
940
+ (0, import_child_process.execSync)(command, { stdio: "ignore" });
941
+ return false;
942
+ } catch (error) {
943
+ if (error.status === 1) {
944
+ return true;
945
+ }
946
+ throw error;
947
+ }
948
+ }
828
949
  async function mainGitDiff() {
829
- const args = (0, import_utils.getArgs)();
830
- const positional = args._ || [];
831
950
  if (args.help || args.h) {
832
951
  showHelp();
833
952
  }
953
+ const useUnstaged = args.unstaged || args.u;
954
+ const fileFromFlag = typeof args.unstaged === "string" ? args.unstaged : typeof args.u === "string" ? args.u : null;
955
+ let hasDiff = false;
834
956
  if (args["staged-only"] || args.s || args.S) {
835
- runGitDiff(
957
+ hasDiff = runGitDiff(
836
958
  "git --no-pager diff --staged",
837
- `Full staged diff saved to "${DIFF_OUTPUT_RELATIVE}"`,
959
+ `Full staged diff saved to "${import_ansi_colors.default.green(DIFF_OUTPUT_RELATIVE)}"`,
838
960
  "Failed to save staged diff"
839
961
  );
840
962
  } else {
841
- const file = positional[0];
963
+ const file = positional[0] || fileFromFlag;
842
964
  if (!file) {
843
- runGitDiff(
965
+ const fullDiffModeLabel = useUnstaged ? "unstaged" : "unstaged";
966
+ hasDiff = runGitDiff(
844
967
  "git --no-pager diff",
845
- `Full staged diff saved to "${DIFF_OUTPUT_RELATIVE}"`,
968
+ `Full ${fullDiffModeLabel} diff saved to "${import_ansi_colors.default.green(DIFF_OUTPUT_RELATIVE)}"`,
846
969
  "Failed to save all diff's"
847
970
  );
848
971
  } else {
849
- runGitDiff(
850
- `git --no-pager diff --cached -- "${file}"`,
851
- `Staged diff of "${file}" saved to "${DIFF_OUTPUT_RELATIVE}"`,
852
- `Failed to generate diff for "${file}"`
972
+ let fileDiffMode = useUnstaged ? "unstaged" : "staged";
973
+ if (!useUnstaged && !fileHasChanges(file, "staged") && fileHasChanges(file, "unstaged")) {
974
+ fileDiffMode = "unstaged";
975
+ }
976
+ hasDiff = runGitDiff(
977
+ fileDiffMode === "unstaged" ? `git --no-pager diff -- "${file}"` : `git --no-pager diff --cached -- "${file}"`,
978
+ `${fileDiffMode[0].toUpperCase() + fileDiffMode.slice(1)} diff of "${file}" saved to "${import_ansi_colors.default.green(
979
+ DIFF_OUTPUT_RELATIVE
980
+ )}"`,
981
+ `Failed to generate ${fileDiffMode} diff for "${file}"`
853
982
  );
854
983
  }
855
984
  }
985
+ if (hasDiff) {
986
+ const opencodePrompt = [
987
+ "",
988
+ "\u{1F916} OpenCode Prompt Helper",
989
+ "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",
990
+ "",
991
+ "\u{1F4C4} App Prompt:",
992
+ ` Generate a conventional commit message from diff file: ${DIFF_OUTPUT}`,
993
+ "",
994
+ "\u{1F4BB} CLI Command:",
995
+ ` opencode run "Generate a conventional commit message from diff file ${DIFF_OUTPUT}"`,
996
+ ""
997
+ ];
998
+ const opencodePromptPath = (0, import_config.getTempPath)(`git-diff/opencode-${FILENAME}.txt`);
999
+ (0, import_sbg_utility.writefile)(opencodePromptPath, opencodePrompt.join("\n"));
1000
+ console.log(`\u{1F4A1} OpenCode prompt saved to "${import_ansi_colors.default.green(import_upath2.default.relative(process.cwd(), opencodePromptPath))}"`);
1001
+ }
856
1002
  if (args.ai) {
857
1003
  try {
858
1004
  await runChatGpt({ headless: true, questionFile: GPT_DIFF_OUTPUT });
package/lib/git-diff.d.ts CHANGED
@@ -10,6 +10,7 @@ export default runGitDiff;
10
10
  * @param {string} command - The git command to execute (e.g., "git --no-pager diff --staged")
11
11
  * @param {string} successMessage - Message to display when the command executes successfully
12
12
  * @param {string} errorMessage - Message to display when the command fails
13
+ * @returns {boolean} True when diff content exists, false when no changes were found
13
14
  *
14
15
  * @throws {Error} Exits the process with code 1 if the git command fails
15
16
  *
@@ -29,7 +30,7 @@ export default runGitDiff;
29
30
  * 'Failed to generate file diff'
30
31
  * );
31
32
  */
32
- declare function runGitDiff(command: string, successMessage: string, errorMessage: string): void;
33
+ declare function runGitDiff(command: string, successMessage: string, errorMessage: string): boolean;
33
34
  export const CACHE_DIR: string;
34
35
  export const DIFF_OUTPUT: string;
35
36
  export const DIFF_OUTPUT_RELATIVE: string;
package/lib/git-diff.js CHANGED
@@ -16,19 +16,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.GPT_DIFF_OUTPUT_RELATIVE = exports.GPT_DIFF_OUTPUT = exports.DIFF_OUTPUT_RELATIVE = exports.DIFF_OUTPUT = exports.CACHE_DIR = void 0;
17
17
  exports.gitDiff = runGitDiff;
18
18
  exports.mainGitDiff = mainGitDiff;
19
+ const ansi_colors_1 = __importDefault(require("ansi-colors"));
19
20
  const child_process_1 = require("child_process");
20
21
  const fs_extra_1 = __importDefault(require("fs-extra"));
22
+ const sbg_utility_1 = require("sbg-utility");
21
23
  const upath_1 = __importDefault(require("upath"));
22
24
  const url_1 = require("url");
23
- const binary_collections_config_cjs_1 = require("./binary-collections-config.cjs");
25
+ const config_cjs_1 = require("./binary-collections/config.cjs");
24
26
  const chatgpt_js_1 = require("./utils/chatgpt.js");
25
27
  const index_cjs_1 = require("./utils/index.cjs");
26
28
  const __filename = (0, url_1.fileURLToPath)(import.meta.url);
27
29
  const __dirname = upath_1.default.dirname(__filename);
30
+ const args = (0, index_cjs_1.getArgs)();
31
+ const positional = args._ || [];
28
32
  // Output path using centralized temp directory configuration
29
- const DIFF_OUTPUT = (0, binary_collections_config_cjs_1.getTempPath)("git-diff.txt");
33
+ const FILENAME = (0, sbg_utility_1.md5)((positional[0] || 'default') + JSON.stringify(args));
34
+ const DIFF_OUTPUT = (0, config_cjs_1.getTempPath)(`git-diff/${FILENAME}.txt`);
30
35
  exports.DIFF_OUTPUT = DIFF_OUTPUT;
31
- const GPT_DIFF_OUTPUT = (0, binary_collections_config_cjs_1.getTempPath)("gpt-question.txt");
36
+ const GPT_DIFF_OUTPUT = (0, config_cjs_1.getTempPath)(`git-diff/gpt-${FILENAME}.txt`);
32
37
  exports.GPT_DIFF_OUTPUT = GPT_DIFF_OUTPUT;
33
38
  const CACHE_DIR = upath_1.default.dirname(DIFF_OUTPUT);
34
39
  exports.CACHE_DIR = CACHE_DIR;
@@ -38,18 +43,19 @@ exports.DIFF_OUTPUT_RELATIVE = DIFF_OUTPUT_RELATIVE;
38
43
  const GPT_DIFF_OUTPUT_RELATIVE = upath_1.default.relative(process.cwd(), GPT_DIFF_OUTPUT);
39
44
  exports.GPT_DIFF_OUTPUT_RELATIVE = GPT_DIFF_OUTPUT_RELATIVE;
40
45
  // Ensure output directory exists
41
- if (!fs_extra_1.default.existsSync(CACHE_DIR)) {
42
- fs_extra_1.default.mkdirSync(CACHE_DIR, { recursive: true });
43
- }
46
+ fs_extra_1.default.ensureDirSync(CACHE_DIR, { mode: 0o755 });
44
47
  function showHelp() {
45
- console.log("\u{1F4DD} Git Diff Helper");
46
- console.log("\u{1F4C4} Usage:");
47
- console.log(" \u{1F4C2} git-diff FILE Show staged diff of specified file");
48
- console.log(" \u{1F4C2} git-diff --staged-only Show staged diff of all files");
49
- console.log(" \u{1F4C2} git-diff -s | -S Same as --staged-only");
50
- console.log(" \u{1F4C2} git-diff --ai Run ChatGPT automation for commit message");
51
- console.log(" \u{1F4C2} git-diff --help | -h Show this help message");
52
- console.log("");
48
+ console.log('\u{1F4DD} Git Diff Helper');
49
+ console.log('\u{1F4C4} Usage:');
50
+ console.log(' \u{1F4C2} git-diff FILE Show staged diff of specified file');
51
+ console.log(' \u{1F4C2} git-diff --staged-only Show staged diff of all files');
52
+ console.log(' \u{1F4C2} git-diff -s | -S Same as --staged-only');
53
+ console.log(' \u{1F4C2} git-diff --unstaged FILE Show unstaged diff of specified file');
54
+ console.log(' \u{1F4C2} git-diff --unstaged Show unstaged diff of all files');
55
+ console.log(' \u{1F4C2} git-diff -u Same as --unstaged');
56
+ console.log(' \u{1F4C2} git-diff --ai Run ChatGPT automation for commit message');
57
+ console.log(' \u{1F4C2} git-diff --help | -h Show this help message');
58
+ console.log('');
53
59
  console.log(`\u{1F4BE} Output is saved to: ${DIFF_OUTPUT_RELATIVE}`);
54
60
  console.log(`\u{1F916} GPT prompt is saved to: ${GPT_DIFF_OUTPUT_RELATIVE}`);
55
61
  process.exit(0);
@@ -64,6 +70,7 @@ function showHelp() {
64
70
  * @param {string} command - The git command to execute (e.g., "git --no-pager diff --staged")
65
71
  * @param {string} successMessage - Message to display when the command executes successfully
66
72
  * @param {string} errorMessage - Message to display when the command fails
73
+ * @returns {boolean} True when diff content exists, false when no changes were found
67
74
  *
68
75
  * @throws {Error} Exits the process with code 1 if the git command fails
69
76
  *
@@ -87,65 +94,115 @@ function runGitDiff(command, successMessage, errorMessage) {
87
94
  try {
88
95
  console.log(`🔍 [i] Running command: ${command}`);
89
96
  const result = (0, child_process_1.execSync)(command, {
90
- encoding: "utf8",
97
+ encoding: 'utf8',
91
98
  maxBuffer: 1024 * 1024 * 10 // 10MB buffer to handle large diffs
92
99
  });
93
100
  // If result is empty, inform user but don't treat as error
94
- if (!result || result.trim() === "") {
95
- console.log(`ℹ️ [i] No changes found for the specified criteria`);
96
- fs_extra_1.default.writeFileSync(DIFF_OUTPUT, "# No changes found\n");
101
+ if (!result || result.trim() === '') {
102
+ console.log(`ℹ️ [i] No changes found for the specified criteria`);
103
+ (0, sbg_utility_1.writefile)(DIFF_OUTPUT, '# No changes found\n');
97
104
  console.log(`✅ Empty diff saved to "${DIFF_OUTPUT_RELATIVE}"`);
98
- return;
105
+ return false;
99
106
  }
100
- fs_extra_1.default.writeFileSync(DIFF_OUTPUT, result);
101
- fs_extra_1.default.writeFileSync(GPT_DIFF_OUTPUT, `Hello, ChatGPT!\nCan you create a conventional commit message by diff content below:\n\n\`\`\`${result}\n\`\`\`\n\nGive me result as codeblock with language "text" only.\n\nThank you!`);
107
+ (0, sbg_utility_1.writefile)(DIFF_OUTPUT, result);
108
+ (0, sbg_utility_1.writefile)(GPT_DIFF_OUTPUT, `Hello, ChatGPT!\nCan you create a conventional commit message by diff content below:\n\n\`\`\`${result}\n\`\`\`\n\nGive me result as codeblock with language "text" only.\n\nThank you!`);
102
109
  console.log(`✅ ${successMessage}`);
103
- console.log(`💾 GPT diff prompt saved to "${GPT_DIFF_OUTPUT_RELATIVE}"`);
110
+ console.log(`💾 GPT diff prompt saved to "${ansi_colors_1.default.green(GPT_DIFF_OUTPUT_RELATIVE)}"`);
111
+ return true;
104
112
  }
105
113
  catch (error) {
106
114
  console.error(`❌ ${errorMessage}`);
107
115
  console.error(`📝 Command: ${command}`);
108
116
  console.error(`⚠️ Error: ${error.message}`);
109
117
  // Check if it's a git-related error
110
- if (error.message.includes("not a git repository")) {
111
- console.error("🚧 Make sure you are in a git repository");
118
+ if (error.message.includes('not a git repository')) {
119
+ console.error('🚧 Make sure you are in a git repository');
112
120
  }
113
121
  process.exit(1);
114
122
  }
115
123
  }
124
+ /**
125
+ * Checks whether a file has changes for a specific git diff mode.
126
+ *
127
+ * Uses `git diff --quiet` semantics:
128
+ * - exit code 0: no changes
129
+ * - exit code 1: changes exist
130
+ *
131
+ * @param {string} file - Target file path
132
+ * @param {"staged" | "unstaged"} mode - Diff mode to check
133
+ * @returns {boolean} True when changes exist for the given mode
134
+ */
135
+ function fileHasChanges(file, mode) {
136
+ const command = mode === 'staged' ? `git diff --cached --quiet -- "${file}"` : `git diff --quiet -- "${file}"`;
137
+ try {
138
+ (0, child_process_1.execSync)(command, { stdio: 'ignore' });
139
+ return false;
140
+ }
141
+ catch (error) {
142
+ if (error.status === 1) {
143
+ return true;
144
+ }
145
+ throw error;
146
+ }
147
+ }
116
148
  function mainGitDiff() {
117
149
  return __awaiter(this, void 0, void 0, function* () {
118
- const args = (0, index_cjs_1.getArgs)();
119
- const positional = args._ || [];
120
150
  // Show help if no arguments or --help/-h is passed
121
151
  if (args.help || args.h) {
122
152
  showHelp();
123
153
  }
124
- if (args["staged-only"] || args.s || args.S) {
125
- runGitDiff("git --no-pager diff --staged", `Full staged diff saved to "${DIFF_OUTPUT_RELATIVE}"`, "Failed to save staged diff");
154
+ const useUnstaged = args.unstaged || args.u;
155
+ const fileFromFlag = typeof args.unstaged === 'string' ? args.unstaged : typeof args.u === 'string' ? args.u : null;
156
+ let hasDiff = false;
157
+ if (args['staged-only'] || args.s || args.S) {
158
+ hasDiff = runGitDiff('git --no-pager diff --staged', `Full staged diff saved to "${ansi_colors_1.default.green(DIFF_OUTPUT_RELATIVE)}"`, 'Failed to save staged diff');
126
159
  }
127
160
  else {
128
161
  // Handle specific file diff
129
- const file = positional[0];
162
+ const file = positional[0] || fileFromFlag;
130
163
  if (!file) {
131
- runGitDiff("git --no-pager diff", `Full staged diff saved to "${DIFF_OUTPUT_RELATIVE}"`, "Failed to save all diff's");
164
+ const fullDiffModeLabel = useUnstaged ? 'unstaged' : 'unstaged';
165
+ hasDiff = runGitDiff('git --no-pager diff', `Full ${fullDiffModeLabel} diff saved to "${ansi_colors_1.default.green(DIFF_OUTPUT_RELATIVE)}"`, "Failed to save all diff's");
132
166
  }
133
167
  else {
134
- runGitDiff(`git --no-pager diff --cached -- "${file}"`, `Staged diff of "${file}" saved to "${DIFF_OUTPUT_RELATIVE}"`, `Failed to generate diff for "${file}"`);
168
+ let fileDiffMode = useUnstaged ? 'unstaged' : 'staged';
169
+ // Default behavior for file target: prefer staged changes, then fall back to unstaged.
170
+ if (!useUnstaged && !fileHasChanges(file, 'staged') && fileHasChanges(file, 'unstaged')) {
171
+ fileDiffMode = 'unstaged';
172
+ }
173
+ hasDiff = runGitDiff(fileDiffMode === 'unstaged' ? `git --no-pager diff -- "${file}"` : `git --no-pager diff --cached -- "${file}"`, `${fileDiffMode[0].toUpperCase() + fileDiffMode.slice(1)} diff of "${file}" saved to "${ansi_colors_1.default.green(DIFF_OUTPUT_RELATIVE)}"`, `Failed to generate ${fileDiffMode} diff for "${file}"`);
135
174
  }
136
175
  }
176
+ if (hasDiff) {
177
+ // Generate command prompt for opencode CLI
178
+ const opencodePrompt = [
179
+ '',
180
+ '🤖 OpenCode Prompt Helper',
181
+ '────────────────────────',
182
+ '',
183
+ '📄 App Prompt:',
184
+ ` Generate a conventional commit message from diff file: ${DIFF_OUTPUT}`,
185
+ '',
186
+ '💻 CLI Command:',
187
+ ` opencode run "Generate a conventional commit message from diff file ${DIFF_OUTPUT}"`,
188
+ ''
189
+ ];
190
+ const opencodePromptPath = (0, config_cjs_1.getTempPath)(`git-diff/opencode-${FILENAME}.txt`);
191
+ (0, sbg_utility_1.writefile)(opencodePromptPath, opencodePrompt.join('\n'));
192
+ console.log(`💡 OpenCode prompt saved to "${ansi_colors_1.default.green(upath_1.default.relative(process.cwd(), opencodePromptPath))}"`);
193
+ }
137
194
  // Generate commit message prompt from ChatGPT (only if --ai is specified)
138
195
  if (args.ai) {
139
196
  try {
140
197
  yield (0, chatgpt_js_1.runChatGpt)({ headless: true, questionFile: GPT_DIFF_OUTPUT });
141
198
  }
142
199
  catch (error) {
143
- console.error("❌ Error running ChatGPT:", error.message);
144
- console.error("💡 Try running with visible browser mode or check if Chrome is installed");
200
+ console.error('❌ Error running ChatGPT:', error.message);
201
+ console.error('💡 Try running with visible browser mode or check if Chrome is installed');
145
202
  }
146
203
  }
147
204
  else {
148
- console.log("💡 Tip: Use --ai flag to generate commit message with ChatGPT");
205
+ console.log('💡 Tip: Use --ai flag to generate commit message with ChatGPT');
149
206
  }
150
207
  });
151
208
  }
package/lib/git-diff.mjs CHANGED
@@ -9,10 +9,11 @@ import {
9
9
  git_diff_default,
10
10
  mainGitDiff,
11
11
  runGitDiff
12
- } from "./chunk-FCDQGYBF.mjs";
13
- import "./chunk-N436BNBK.mjs";
14
- import "./chunk-YYLIQQKF.mjs";
15
- import "./chunk-Z6JLYU2J.mjs";
12
+ } from "./chunk-SPTECFE5.mjs";
13
+ import "./chunk-G5UUEWUO.mjs";
14
+ import "./chunk-GAGABICI.mjs";
15
+ import "./chunk-H44UWUFY.mjs";
16
+ import "./chunk-5RTXZVCW.mjs";
16
17
  import "./chunk-QQ4A6DLD.mjs";
17
18
  export {
18
19
  CACHE_DIR,
package/lib/git-fix.cjs CHANGED
@@ -418,7 +418,7 @@ var require_utils2 = __commonJS({
418
418
  try {
419
419
  fs.rmdirSync(fullPath);
420
420
  console.log("deleted", fullPath);
421
- } catch (e) {
421
+ } catch (_e) {
422
422
  try {
423
423
  fs.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
424
424
  console.log("deleted", fullPath);
@@ -431,7 +431,7 @@ var require_utils2 = __commonJS({
431
431
  try {
432
432
  fs.unlinkSync(fullPath);
433
433
  console.log("deleted", fullPath);
434
- } catch (e) {
434
+ } catch (_e) {
435
435
  try {
436
436
  fs.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
437
437
  console.log("deleted", fullPath);
package/lib/git-fix.mjs CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-A2JQXI5Z.mjs";
6
6
  import {
7
7
  require_user_config
8
- } from "./chunk-AJDD5DZM.mjs";
8
+ } from "./chunk-2LSRSEXF.mjs";
9
9
  import {
10
10
  require_line_endings
11
11
  } from "./chunk-ZDMWBSYF.mjs";
@@ -21,7 +21,7 @@ import {
21
21
  } from "./chunk-A3VUZEJK.mjs";
22
22
  import {
23
23
  require_utils
24
- } from "./chunk-Z6JLYU2J.mjs";
24
+ } from "./chunk-5RTXZVCW.mjs";
25
25
  import {
26
26
  __commonJS,
27
27
  __require,
package/lib/git-purge.cjs CHANGED
@@ -88,7 +88,7 @@ var require_utils = __commonJS({
88
88
  try {
89
89
  fs.rmdirSync(fullPath);
90
90
  console.log("deleted", fullPath);
91
- } catch (e) {
91
+ } catch (_e) {
92
92
  try {
93
93
  fs.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
94
94
  console.log("deleted", fullPath);
@@ -101,7 +101,7 @@ var require_utils = __commonJS({
101
101
  try {
102
102
  fs.unlinkSync(fullPath);
103
103
  console.log("deleted", fullPath);
104
- } catch (e) {
104
+ } catch (_e) {
105
105
  try {
106
106
  fs.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
107
107
  console.log("deleted", fullPath);
package/lib/git-purge.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
2
  import {
3
3
  require_utils
4
- } from "./chunk-Z6JLYU2J.mjs";
4
+ } from "./chunk-5RTXZVCW.mjs";
5
5
  import {
6
6
  __commonJS,
7
7
  __require,
package/lib/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { findNodeModules } from "./find-node-modules.cjs";
1
+ import { findNodeModules } from './find-node-modules.cjs';
2
2
  export { findNodeModules };