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.
- package/.opencode/package.json +5 -0
- package/binaries/rmx +15 -1
- package/binaries/rmx.cmd +12 -0
- package/binaries/test-cjs +9 -1
- package/binaries/test-cjs.cmd +16 -1
- package/binaries/test-esm +16 -0
- package/binaries/test-esm.cjs +178 -0
- package/binaries/test-esm.cmd +23 -0
- package/binaries/yarn-clean +1 -1
- package/binaries/yarn-clean.cmd +1 -1
- package/binaries/yarn-clean.py +33 -15
- package/binaries/yc +110 -0
- package/binaries/yc.cjs +178 -0
- package/lib/binary-collections/config.cjs +126 -0
- package/lib/binary-collections/config.mjs +7 -0
- package/lib/binary-collections/executeScript.cjs +19 -0
- package/lib/binary-collections/executeScript.d.cts +12 -0
- package/lib/binary-collections/executeScript.mjs +6 -0
- package/lib/binary-collections/findScript.cjs +284 -0
- package/lib/binary-collections/findScript.d.cts +12 -0
- package/lib/binary-collections/findScript.mjs +7 -0
- package/lib/binary-collections/listScript.cjs +266 -0
- package/lib/binary-collections/listScript.d.cts +19 -0
- package/lib/binary-collections/listScript.mjs +7 -0
- package/lib/binary-collections.cjs +224 -137
- package/lib/binary-collections.mjs +22 -282
- package/lib/changelog.cjs +2 -2
- package/lib/changelog.mjs +1 -1
- package/lib/{chunk-AJDD5DZM.mjs → chunk-2LSRSEXF.mjs} +1 -1
- package/lib/{chunk-Z6JLYU2J.mjs → chunk-5RTXZVCW.mjs} +2 -2
- package/lib/{chunk-XA3SNBPA.mjs → chunk-66KDU4TX.mjs} +93 -9
- package/lib/chunk-6PU7BAHB.mjs +61 -0
- package/lib/chunk-C6D2TTYU.mjs +32 -0
- package/lib/chunk-FB2WKVJD.mjs +158 -0
- package/lib/{chunk-NCXAP7AA.mjs → chunk-G5UUEWUO.mjs} +9 -5
- package/lib/{chunk-N436BNBK.mjs → chunk-GAGABICI.mjs} +19 -13
- package/lib/chunk-H44UWUFY.mjs +105 -0
- package/lib/chunk-NCZPTKDV.mjs +79 -0
- package/lib/chunk-NGFK3EYW.mjs +28 -0
- package/lib/chunk-NVEG3LEZ.mjs +143 -0
- package/lib/chunk-OGXVGBRI.mjs +29 -0
- package/lib/chunk-OXV52GD5.mjs +62 -0
- package/lib/chunk-PXBMHE7O.mjs +35 -0
- package/lib/chunk-R5FJOR63.mjs +47 -0
- package/lib/chunk-SPTECFE5.mjs +180 -0
- package/lib/chunk-UXCFNAR6.mjs +55 -0
- package/lib/chunk-V2IBPCEV.mjs +39 -0
- package/lib/chunk-XPJGCDOD.mjs +14 -0
- package/lib/chunk-ZOWVMII3.mjs +228 -0
- package/lib/clean-github-actions-caches-cli.cjs +465 -0
- package/lib/clean-github-actions-caches-cli.d.cts +1 -0
- package/lib/clean-github-actions-caches-cli.mjs +56 -0
- package/lib/clean-github-actions-caches.cjs +149 -205
- package/lib/clean-github-actions-caches.d.cts +15 -1
- package/lib/clean-github-actions-caches.mjs +4 -130
- package/lib/cross-env/command.cjs +63 -0
- package/lib/cross-env/command.d.ts +8 -0
- package/lib/cross-env/command.js +45 -0
- package/lib/cross-env/command.mjs +9 -0
- package/lib/cross-env/index.cjs +178 -0
- package/lib/cross-env/index.d.ts +8 -0
- package/lib/cross-env/index.js +102 -0
- package/lib/cross-env/index.mjs +101 -0
- package/lib/cross-env/variable.cjs +60 -0
- package/lib/cross-env/variable.d.ts +7 -0
- package/lib/cross-env/variable.js +59 -0
- package/lib/cross-env/variable.mjs +9 -0
- package/lib/del-gradle.cjs +2 -2
- package/lib/del-gradle.js +8 -8
- package/lib/del-gradle.mjs +1 -1
- package/lib/del-node-modules.js +24 -24
- package/lib/del-ps.cjs +2 -2
- package/lib/del-ps.js +8 -8
- package/lib/del-ps.mjs +1 -1
- package/lib/del-yarn-caches.cjs +2 -2
- package/lib/del-yarn-caches.js +2 -2
- package/lib/del-yarn-caches.mjs +1 -1
- package/lib/file/copy-cli.cjs +92 -0
- package/lib/file/copy-cli.d.mts +1 -0
- package/lib/file/copy-cli.mjs +55 -0
- package/lib/file/copy.cjs +56 -0
- package/lib/file/copy.d.mts +1 -0
- package/lib/file/copy.mjs +8 -0
- package/lib/file/move-cli.cjs +91 -0
- package/lib/file/move-cli.d.mts +1 -0
- package/lib/file/move-cli.mjs +55 -0
- package/lib/file/move.cjs +55 -0
- package/lib/file/move.d.mts +1 -0
- package/lib/file/move.mjs +8 -0
- package/lib/find-node-modules-cli.js +1 -1
- package/lib/free-chatgpt.cjs +21 -15
- package/lib/free-chatgpt.js +10 -10
- package/lib/free-chatgpt.mjs +2 -2
- package/lib/git/user-config.cjs +2 -2
- package/lib/git/user-config.mjs +2 -2
- package/lib/git-diff-cli.cjs +188 -42
- package/lib/git-diff-cli.mjs +5 -4
- package/lib/git-diff.cjs +188 -42
- package/lib/git-diff.d.ts +2 -1
- package/lib/git-diff.js +91 -34
- package/lib/git-diff.mjs +5 -4
- package/lib/git-fix.cjs +2 -2
- package/lib/git-fix.mjs +2 -2
- package/lib/git-purge.cjs +2 -2
- package/lib/git-purge.mjs +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/kill-night-crows.cjs +7 -7
- package/lib/kill-night-crows.mjs +7 -7
- package/lib/node-cache-cleaner/npm.cjs +65 -0
- package/lib/node-cache-cleaner/npm.d.ts +2 -0
- package/lib/node-cache-cleaner/npm.js +41 -0
- package/lib/node-cache-cleaner/npm.mjs +10 -0
- package/lib/node-cache-cleaner/npx.cjs +89 -0
- package/lib/node-cache-cleaner/npx.d.ts +4 -0
- package/lib/node-cache-cleaner/npx.js +82 -0
- package/lib/{ps/index.d.mjs → node-cache-cleaner/npx.mjs} +6 -5
- package/lib/node-cache-cleaner/yarn.cjs +73 -0
- package/lib/node-cache-cleaner/yarn.d.ts +2 -0
- package/lib/node-cache-cleaner/yarn.js +62 -0
- package/lib/node-cache-cleaner/yarn.mjs +10 -0
- package/lib/node-cache-cleaner-cli.cjs +182 -0
- package/lib/node-cache-cleaner-cli.d.ts +2 -0
- package/lib/node-cache-cleaner-cli.js +60 -0
- package/lib/node-cache-cleaner-cli.mjs +56 -0
- package/lib/node-executor.cjs +91 -0
- package/lib/node-executor.d.cts +2 -0
- package/lib/node-executor.mjs +103 -0
- package/lib/npm-run-series.cjs +21 -28
- package/lib/npm-run-series.mjs +20 -6
- package/lib/package-resolutions-updater-cli.cjs +213 -128
- package/lib/package-resolutions-updater-cli.mjs +17 -39
- package/lib/package-resolutions-updater.cjs +204 -98
- package/lib/package-resolutions-updater.d.mts +20 -1
- package/lib/package-resolutions-updater.mjs +7 -5
- package/lib/print-directory-tree.cjs +2 -2
- package/lib/print-directory-tree.mjs +1 -1
- package/lib/ps/connected-domain.js +10 -10
- package/lib/ps/index.cjs +1 -1
- package/lib/ps/index.mjs +177 -171
- package/lib/ps/isWin.js +1 -1
- package/lib/ps/table-parser.js +6 -6
- package/lib/remove-module.cjs +2 -2
- package/lib/remove-module.mjs +1 -1
- package/lib/rm-node-module-cli.cjs +222 -0
- package/lib/rm-node-module-cli.d.cts +1 -0
- package/lib/rm-node-module-cli.mjs +89 -0
- package/lib/rm-node-modules.cjs +127 -0
- package/lib/rm-node-modules.d.cts +35 -0
- package/lib/{binary-collections-config.mjs → rm-node-modules.mjs} +3 -3
- package/lib/rmpath.cjs +2 -2
- package/lib/rmpath.mjs +1 -1
- package/lib/submodule-install.cjs +47 -34
- package/lib/submodule-install.mjs +46 -33
- package/lib/submodule-remove-cli.cjs +1 -2
- package/lib/submodule-remove-cli.js +3 -3
- package/lib/submodule-remove-cli.mjs +1 -2
- package/lib/utils/chatgpt.cjs +19 -13
- package/lib/utils/chatgpt.js +94 -94
- package/lib/utils/chatgpt.mjs +1 -1
- package/lib/utils/findEnvFiles.cjs +28 -46
- package/lib/utils/findEnvFiles.d.cts +19 -0
- package/lib/utils/findEnvFiles.mjs +3 -5
- package/lib/utils/findWorkspaceRoot.js +4 -4
- package/lib/utils/index.cjs +2 -2
- package/lib/utils/index.mjs +1 -1
- package/lib/utils/isGithubTokenValid.js +7 -7
- package/lib/{ps/index.d.cjs → utils/isWindows.cjs} +17 -3
- package/lib/utils/isWindows.d.ts +5 -0
- package/lib/utils/isWindows.js +10 -0
- package/lib/utils/isWindows.mjs +8 -0
- package/lib/utils/runBash.cjs +53 -0
- package/lib/utils/runBash.d.cts +12 -0
- package/lib/utils/runBash.mjs +66 -0
- package/lib/yarn-per-branch-lock-installer.cjs +97 -0
- package/lib/yarn-per-branch-lock-installer.d.cts +2 -0
- package/lib/yarn-per-branch-lock-installer.mjs +109 -0
- package/lib/yarn-reinstall.cjs +2 -2
- package/lib/yarn-reinstall.mjs +1 -1
- package/package.json +61 -52
- package/readme.html +784 -0
- package/readme.md +106 -218
- package/releases/readme.md +1 -1
- package/test/README.md +2 -2
- package/test-project/package.json +8 -2
- package/test-project/workspaces/workspace-a/package.json +135 -0
- package/test-project/workspaces/workspace-a/readme.md +20 -0
- package/test-project/workspaces/workspace-a/release/readme.md +42 -0
- package/test-project/workspaces/workspace-a/test/demo/package.json +25 -0
- package/test-project/workspaces/workspace-a/test/readme.md +12 -0
- package/test-project/workspaces/workspace-b/package.json +139 -0
- package/test-project/workspaces/workspace-b/readme.md +94 -0
- package/test-project/workspaces/workspace-b/requirements.txt +1 -0
- package/test-project/workspaces/workspace-b/test/sample-project/package.json +7 -0
- package/test-project/workspaces/workspace-b/themes/hexo-theme-flowbite/package.json +96 -0
- package/test-project/workspaces/workspace-b/themes/hexo-theme-flowbite/readme.md +156 -0
- package/tmp/rm-node-modules-test-project/package.json +17 -0
- package/tmp/rm-node-modules-test-project/packages/workspace-a/package.json +16 -0
- package/tmp/rm-node-modules-test-project/packages/workspace-b/package.json +16 -0
- package/tmp/test-repo/README.md +2 -35
- package/tmp/test-repo/package.json +13 -3
- package/docs-src/clean-github-actions-caches.md +0 -26
- package/docs-src/free-chatgpt.md +0 -26
- package/lib/binary-collections-config.cjs +0 -15
- package/lib/chunk-2CBJCW7E.mjs +0 -81
- package/lib/chunk-4UHL4WVN.mjs +0 -136
- package/lib/chunk-66PAU5PS.mjs +0 -31
- package/lib/chunk-6HHJRKFB.mjs +0 -59
- package/lib/chunk-7XTEJHOE.mjs +0 -193
- package/lib/chunk-FCDQGYBF.mjs +0 -136
- package/lib/chunk-GEYA2USY.mjs +0 -207
- package/lib/chunk-GJTGHXRA.mjs +0 -356
- package/lib/chunk-ID2WBTE2.mjs +0 -80
- package/lib/chunk-JXFOHKDM.mjs +0 -239
- package/lib/chunk-PDSXF5HY.mjs +0 -187
- package/lib/chunk-RWLXRTYP.mjs +0 -109
- package/lib/chunk-TOIVAQF7.mjs +0 -136
- package/lib/chunk-V5SKYJUB.mjs +0 -136
- package/lib/chunk-WSRETQCA.mjs +0 -59
- package/lib/chunk-YYLIQQKF.mjs +0 -31
- package/lib/ps/index.d.ts +0 -2
- package/lib/ps/index.js +0 -254
- package/lib/utils/findEnvFiles.d.ts +0 -8
- package/lib/utils/findEnvFiles.js +0 -121
- package/tmp/typedoc/readme.md +0 -320
- /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/
|
|
46
|
-
var
|
|
47
|
-
"src/
|
|
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
|
-
|
|
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 (
|
|
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 (
|
|
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
|
|
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(
|
|
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
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
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
|
|
769
|
-
var
|
|
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
|
-
|
|
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
|
|
799
|
-
|
|
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
|
-
|
|
804
|
-
|
|
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
|
-
|
|
965
|
+
const fullDiffModeLabel = useUnstaged ? "unstaged" : "unstaged";
|
|
966
|
+
hasDiff = runGitDiff(
|
|
844
967
|
"git --no-pager diff",
|
|
845
|
-
`Full
|
|
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
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
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):
|
|
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
|
|
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
|
|
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,
|
|
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
|
-
|
|
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(
|
|
46
|
-
console.log(
|
|
47
|
-
console.log(
|
|
48
|
-
console.log(
|
|
49
|
-
console.log(
|
|
50
|
-
console.log(
|
|
51
|
-
console.log(
|
|
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:
|
|
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(`ℹ️
|
|
96
|
-
|
|
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
|
-
|
|
101
|
-
|
|
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(
|
|
111
|
-
console.error(
|
|
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
|
-
|
|
125
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
144
|
-
console.error(
|
|
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(
|
|
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-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
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 (
|
|
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 (
|
|
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-
|
|
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-
|
|
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 (
|
|
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 (
|
|
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
package/lib/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { findNodeModules } from
|
|
1
|
+
import { findNodeModules } from './find-node-modules.cjs';
|
|
2
2
|
export { findNodeModules };
|