binary-collections 2.0.13 → 2.0.14
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/binaries/binary-executor.cjs +307 -238
- package/binaries/clean-nodemodule.cjs +307 -238
- package/binaries/clean-nodemodules.cjs +307 -238
- package/binaries/composer.cjs +323 -0
- package/binaries/composer.cmd +2 -0
- package/binaries/composer.phar +0 -0
- package/binaries/dev.cjs +307 -238
- package/binaries/empty.cjs +307 -238
- package/binaries/git-reduce-size.cjs +307 -238
- package/binaries/javakill.cjs +307 -238
- package/binaries/kill-process.cjs +307 -238
- package/binaries/nodekill.cjs +307 -238
- package/binaries/prod.cjs +307 -238
- package/binaries/py.cjs +307 -238
- package/binaries/rmfind.cjs +307 -238
- package/binaries/rmx.cjs +307 -238
- package/binaries/submodule-token.cjs +307 -238
- package/binaries/test-cjs.cjs +307 -238
- package/binaries/test-esm.cjs +307 -238
- package/binaries/yarn-clean.cjs +307 -238
- package/binaries/yc.cjs +307 -238
- package/binaries/ycw.cjs +307 -238
- package/docs-src/binary-collections.md +1 -1
- package/docs-src/clean-github-actions-caches.md +1 -1
- package/docs-src/copy-move-file.md +1 -4
- package/docs-src/del-ps.md +1 -1
- package/docs-src/find-node-modules.md +1 -1
- package/docs-src/generate-test-ci.md +56 -0
- package/docs-src/get-latest-workflow-status.md +100 -0
- package/docs-src/git-diff.md +1 -1
- package/docs-src/git-fix.md +1 -1
- package/docs-src/git-purge.md +1 -1
- package/docs-src/kill-night-crows.md +1 -1
- package/docs-src/node-cache-cleaner.md +2 -2
- package/docs-src/node-package-packer.md +1 -1
- package/docs-src/opencode-cli.md +127 -0
- package/docs-src/package-resolutions-updater.md +1 -1
- package/docs-src/rmpath.md +1 -1
- package/docs-src/run-by-checksum.md +1 -1
- package/docs-src/submodule-remove.md +1 -1
- package/docs-src/upload-backend.md +29 -0
- package/docs-src/vscode-cli.md +84 -0
- package/docs-src/workflow-badge.md +120 -0
- package/lib/binary-collections/config.cjs +14 -2
- package/lib/binary-collections/config.d.cts +10 -0
- package/lib/binary-collections/config.mjs +2 -2
- package/lib/binary-collections/findScript.cjs +43 -21
- package/lib/binary-collections/findScript.mjs +2 -2
- package/lib/binary-collections/listScript.cjs +43 -21
- package/lib/binary-collections/listScript.mjs +2 -2
- package/lib/binary-collections.cjs +43 -21
- package/lib/binary-collections.mjs +6 -6
- package/lib/chunk-2SJKVOTN.mjs +146 -0
- package/lib/{chunk-2MN4VPV2.mjs → chunk-3F6EIHYG.mjs} +2 -2
- package/lib/chunk-546KAIYT.mjs +113 -0
- package/lib/chunk-56BVU63B.mjs +86 -0
- package/lib/chunk-5WAOOOGZ.mjs +77 -0
- package/lib/chunk-72XTQ3CK.mjs +45 -0
- package/lib/chunk-7N52Z4IJ.mjs +39 -0
- package/lib/chunk-7Q6YEUQF.mjs +246 -0
- package/lib/{chunk-NQXUYO67.mjs → chunk-AJ3OIYYP.mjs} +43 -21
- package/lib/chunk-AQZ7LMFS.mjs +100 -0
- package/lib/chunk-BDCMTOZI.mjs +246 -0
- package/lib/chunk-BEUM4LH4.mjs +184 -0
- package/lib/{chunk-TBWXE7ST.mjs → chunk-BO4TZS4Q.mjs} +5 -2
- package/lib/chunk-CM3IC5YC.mjs +226 -0
- package/lib/{chunk-FLYSZFLW.mjs → chunk-D42YBRZW.mjs} +1 -1
- package/lib/chunk-FR3DMHJC.mjs +146 -0
- package/lib/chunk-I3O5ZRYU.mjs +77 -0
- package/lib/chunk-J4M5EL5P.mjs +108 -0
- package/lib/chunk-JK3MG2KF.mjs +236 -0
- package/lib/chunk-JMUFQSPE.mjs +184 -0
- package/lib/chunk-JVMLKHD2.mjs +62 -0
- package/lib/chunk-KAT2JNLZ.mjs +146 -0
- package/lib/{chunk-CD3HF3LK.mjs → chunk-KRCPFWIF.mjs} +6 -3
- package/lib/chunk-LACQTD5V.mjs +225 -0
- package/lib/chunk-MCCMMZSM.mjs +60 -0
- package/lib/chunk-OA2RKEY3.mjs +162 -0
- package/lib/{chunk-X2B3X7D4.mjs → chunk-PAZH45HS.mjs} +7 -1
- package/lib/chunk-QZMGBDSA.mjs +32 -0
- package/lib/chunk-RKPIBGKE.mjs +61 -0
- package/lib/chunk-SARIXFHP.mjs +44 -0
- package/lib/chunk-SJYP66BO.mjs +62 -0
- package/lib/chunk-SWUAEY4H.mjs +44 -0
- package/lib/chunk-TP3O2JGW.mjs +88 -0
- package/lib/chunk-UAIF5VIA.mjs +89 -0
- package/lib/chunk-UDZBVKXH.mjs +94 -0
- package/lib/chunk-UEOWRYAN.mjs +32 -0
- package/lib/chunk-UHPFLJXH.mjs +227 -0
- package/lib/chunk-UYNBNLV5.mjs +113 -0
- package/lib/chunk-WOC4FZ6F.mjs +164 -0
- package/lib/chunk-X7UVQ6ZC.mjs +183 -0
- package/lib/{chunk-RDN6HF5Z.mjs → chunk-XI67TI46.mjs} +1 -1
- package/lib/chunk-XW5NZAKI.mjs +82 -0
- package/lib/chunk-YLV4QATP.mjs +86 -0
- package/lib/chunk-YWSLMAQ7.mjs +65 -0
- package/lib/chunk-ZB4IQ6VJ.mjs +46 -0
- package/lib/cross-env/index.mjs +3 -3
- package/lib/del-gradle.cjs +1 -1
- package/lib/del-gradle.mjs +22 -16
- package/lib/del-node-modules.cjs +1 -1
- package/lib/del-node-modules.mjs +148 -142
- package/lib/find-node-modules-cli.cjs +1 -1
- package/lib/find-node-modules-cli.mjs +10 -4
- package/lib/{git-diff-cli.cjs → git/git-diff-cli.cjs} +18 -6
- package/lib/{git-diff-cli.mjs → git/git-diff-cli.mjs} +7 -7
- package/lib/{git-diff.cjs → git/git-diff.cjs} +16 -4
- package/lib/{git-diff.js → git/git-diff.js} +3 -3
- package/lib/{git-diff.mjs → git/git-diff.mjs} +6 -6
- package/lib/{git-fix.cjs → git/git-fix.cjs} +134 -3
- package/lib/{git-fix.mjs → git/git-fix.mjs} +19 -14
- package/lib/{git-purge.cjs → git/git-purge.cjs} +1 -1
- package/lib/{git-purge.mjs → git/git-purge.mjs} +4 -4
- package/lib/git/user-config.cjs +131 -1
- package/lib/git/user-config.mjs +3 -1
- package/lib/{clean-github-actions-caches-cli.cjs → github-workflows/clean-github-actions-caches-cli.cjs} +38 -10
- package/lib/{clean-github-actions-caches-cli.mjs → github-workflows/clean-github-actions-caches-cli.mjs} +7 -6
- package/lib/{clean-github-actions-caches.cjs → github-workflows/clean-github-actions-caches.cjs} +38 -10
- package/lib/{clean-github-actions-caches.mjs → github-workflows/clean-github-actions-caches.mjs} +5 -4
- package/lib/github-workflows/generate-test-ci-step-cli.cjs +240 -0
- package/lib/github-workflows/generate-test-ci-step-cli.d.mts +2 -0
- package/lib/github-workflows/generate-test-ci-step-cli.mjs +132 -0
- package/lib/github-workflows/get-latest-workflow-status-cli.cjs +541 -0
- package/lib/github-workflows/get-latest-workflow-status-cli.d.mts +2 -0
- package/lib/github-workflows/get-latest-workflow-status-cli.mjs +61 -0
- package/lib/github-workflows/get-latest-workflow-status.cjs +56 -0
- package/lib/github-workflows/get-latest-workflow-status.d.mts +1 -0
- package/lib/github-workflows/get-latest-workflow-status.mjs +8 -0
- package/lib/github-workflows/utils.cjs +271 -0
- package/lib/github-workflows/utils.d.cts +76 -0
- package/lib/github-workflows/utils.mjs +8 -0
- package/lib/github-workflows/workflow-badge-cli.cjs +722 -0
- package/lib/github-workflows/workflow-badge-cli.d.mts +2 -0
- package/lib/github-workflows/workflow-badge-cli.mjs +98 -0
- package/lib/github-workflows/workflow-badge-generator.cjs +200 -0
- package/lib/github-workflows/workflow-badge-generator.d.mts +14 -0
- package/lib/github-workflows/workflow-badge-generator.mjs +8 -0
- package/lib/github-workflows/workflow-test-data.cjs +73 -0
- package/lib/github-workflows/workflow-test-data.d.cts +63 -0
- package/lib/github-workflows/workflow-test-data.mjs +6 -0
- package/lib/opencode/cli/auth-rotate.cjs +143 -0
- package/lib/opencode/cli/auth-rotate.d.ts +1 -0
- package/lib/opencode/cli/auth-rotate.js +70 -0
- package/lib/opencode/cli/auth-rotate.mjs +10 -0
- package/lib/opencode/cli/list-projects.cjs +184 -0
- package/lib/opencode/cli/list-projects.d.ts +1 -0
- package/lib/opencode/cli/list-projects.js +32 -0
- package/lib/opencode/cli/list-projects.mjs +11 -0
- package/lib/opencode/cli/list-sessions.cjs +215 -0
- package/lib/opencode/cli/list-sessions.d.ts +1 -0
- package/lib/opencode/cli/list-sessions.js +45 -0
- package/lib/opencode/cli/list-sessions.mjs +11 -0
- package/lib/opencode/database.cjs +349 -0
- package/lib/opencode/database.d.ts +91 -0
- package/lib/opencode/database.js +252 -0
- package/lib/opencode/database.mjs +28 -0
- package/lib/opencode/database.runner.cjs +145 -0
- package/lib/opencode/database.runner.d.ts +1 -0
- package/lib/opencode/database.runner.js +56 -0
- package/lib/opencode/database.runner.mjs +37 -0
- package/lib/opencode/opencode-zen.runner.cjs +48 -0
- package/lib/opencode/opencode-zen.runner.d.mts +1 -0
- package/lib/opencode/opencode-zen.runner.mjs +31 -0
- package/lib/opencode/sqlite.cjs +114 -0
- package/lib/opencode/sqlite.d.ts +18 -0
- package/lib/opencode/sqlite.js +82 -0
- package/lib/opencode/sqlite.mjs +10 -0
- package/lib/opencode/storage.cjs +124 -0
- package/lib/opencode/storage.d.ts +27 -0
- package/lib/opencode/storage.js +101 -0
- package/lib/opencode/storage.mjs +38 -0
- package/lib/opencode/storage.runner.cjs +50 -0
- package/lib/opencode/storage.runner.d.ts +1 -0
- package/lib/opencode/storage.runner.js +13 -0
- package/lib/opencode/storage.runner.mjs +29 -0
- package/lib/opencode/types.cjs +17 -0
- package/lib/opencode/types.d.ts +31 -0
- package/lib/opencode/types.js +2 -0
- package/lib/opencode/types.mjs +7 -0
- package/lib/opencode/utils/check-api.cjs +59 -0
- package/lib/opencode/utils/check-api.d.ts +12 -0
- package/lib/opencode/utils/check-api.js +46 -0
- package/lib/opencode/utils/check-api.mjs +8 -0
- package/lib/opencode-cli.cjs +473 -0
- package/lib/opencode-cli.d.ts +2 -0
- package/lib/opencode-cli.js +115 -0
- package/lib/opencode-cli.mjs +111 -0
- package/lib/package-resolutions-updater-cli.cjs +181 -154
- package/lib/package-resolutions-updater-cli.mjs +3 -2
- package/lib/package-resolutions-updater.cjs +181 -154
- package/lib/package-resolutions-updater.d.mts +12 -3
- package/lib/package-resolutions-updater.mjs +3 -2
- package/lib/print-directory-tree.cjs +131 -3
- package/lib/print-directory-tree.mjs +6 -3
- package/lib/rmpath-cli.cjs +131 -5
- package/lib/rmpath-cli.mjs +3 -1
- package/lib/rmpath.cjs +147 -11
- package/lib/rmpath.mjs +3 -1
- package/lib/run-by-checksum/hash.cjs +18 -2
- package/lib/run-by-checksum/hash.d.ts +4 -1
- package/lib/run-by-checksum/hash.js +38 -4
- package/lib/run-by-checksum/hash.mjs +1 -1
- package/lib/run-by-checksum/run.cjs +18 -2
- package/lib/run-by-checksum/run.mjs +2 -2
- package/lib/run-by-checksum-cli.cjs +18 -2
- package/lib/run-by-checksum-cli.mjs +2 -2
- package/lib/submodule-install.cjs +130 -4
- package/lib/submodule-install.mjs +5 -4
- package/lib/submodule-remove-cli.cjs +131 -5
- package/lib/submodule-remove-cli.mjs +3 -1
- package/lib/submodule-remove.cjs +146 -5
- package/lib/submodule-remove.mjs +3 -1
- package/lib/utils/findEnvFiles.cjs +3 -0
- package/lib/utils/findEnvFiles.d.cts +2 -2
- package/lib/utils/findEnvFiles.mjs +1 -1
- package/lib/vscode/project.cjs +0 -0
- package/lib/vscode/project.d.ts +0 -0
- package/lib/vscode/project.js +1 -0
- package/lib/vscode/project.mjs +7 -0
- package/lib/vscode/storage.cjs +138 -0
- package/lib/vscode/storage.d.ts +51 -0
- package/lib/vscode/storage.js +169 -0
- package/lib/vscode/storage.mjs +42 -0
- package/lib/vscode/storage.runner.cjs +125 -0
- package/lib/vscode/storage.runner.d.ts +1 -0
- package/lib/vscode/storage.runner.js +47 -0
- package/lib/vscode/storage.runner.mjs +60 -0
- package/lib/vscode-cli.cjs +155 -0
- package/lib/vscode-cli.d.ts +2 -0
- package/lib/vscode-cli.js +80 -0
- package/lib/vscode-cli.mjs +71 -0
- package/package.json +43 -21
- package/readme.md +41 -8
- package/releases/readme.md +1 -1
- package/src/github-workflows/generate-test-ci-step-cli.mjs +126 -0
- package/vendor/clue/ndjson-react/README.md +365 -0
- package/vendor/composer/pcre/README.md +189 -0
- package/vendor/composer/semver/README.md +99 -0
- package/vendor/composer/xdebug-handler/README.md +305 -0
- package/vendor/ergebnis/agent-detector/README.md +107 -0
- package/vendor/evenement/evenement/README.md +64 -0
- package/vendor/fidry/cpu-core-counter/README.md +138 -0
- package/vendor/friendsofphp/php-cs-fixer/README.md +97 -0
- package/vendor/psr/container/README.md +13 -0
- package/vendor/psr/event-dispatcher/README.md +6 -0
- package/vendor/psr/log/README.md +58 -0
- package/vendor/react/cache/README.md +367 -0
- package/vendor/react/child-process/README.md +619 -0
- package/vendor/react/dns/README.md +453 -0
- package/vendor/react/event-loop/README.md +930 -0
- package/vendor/react/promise/README.md +722 -0
- package/vendor/react/socket/README.md +1564 -0
- package/vendor/react/stream/README.md +1249 -0
- package/vendor/sebastian/diff/README.md +151 -0
- package/vendor/symfony/console/README.md +30 -0
- package/vendor/symfony/deprecation-contracts/README.md +26 -0
- package/vendor/symfony/event-dispatcher/README.md +25 -0
- package/vendor/symfony/event-dispatcher-contracts/README.md +9 -0
- package/vendor/symfony/filesystem/README.md +23 -0
- package/vendor/symfony/finder/README.md +24 -0
- package/vendor/symfony/options-resolver/README.md +25 -0
- package/vendor/symfony/polyfill-ctype/README.md +12 -0
- package/vendor/symfony/polyfill-intl-grapheme/README.md +32 -0
- package/vendor/symfony/polyfill-intl-normalizer/README.md +14 -0
- package/vendor/symfony/polyfill-mbstring/README.md +13 -0
- package/vendor/symfony/polyfill-php80/README.md +25 -0
- package/vendor/symfony/polyfill-php81/README.md +18 -0
- package/vendor/symfony/polyfill-php84/README.md +23 -0
- package/vendor/symfony/polyfill-php85/README.md +20 -0
- package/vendor/symfony/process/README.md +23 -0
- package/vendor/symfony/service-contracts/README.md +9 -0
- package/vendor/symfony/stopwatch/README.md +52 -0
- package/vendor/symfony/string/README.md +24 -0
- package/lib/del-gradle.js +0 -16
- package/lib/del-node-modules.js +0 -211
- package/lib/find-node-modules-cli.js +0 -4
- /package/lib/{clean-github-actions-caches-cli.d.cts → del-gradle.d.cts} +0 -0
- /package/lib/{del-gradle.d.ts → del-node-modules.d.cts} +0 -0
- /package/lib/{find-node-modules-cli.d.ts → find-node-modules-cli.d.cts} +0 -0
- /package/lib/{git-diff-cli.d.ts → git/git-diff-cli.d.ts} +0 -0
- /package/lib/{git-diff-cli.js → git/git-diff-cli.js} +0 -0
- /package/lib/{git-diff.d.ts → git/git-diff.d.ts} +0 -0
- /package/lib/{git-fix.d.cts → git/git-fix.d.cts} +0 -0
- /package/lib/{git-purge.d.cts → git/git-purge.d.cts} +0 -0
- /package/lib/{del-node-modules.d.ts → github-workflows/clean-github-actions-caches-cli.d.cts} +0 -0
- /package/lib/{clean-github-actions-caches.d.cts → github-workflows/clean-github-actions-caches.d.cts} +0 -0
package/lib/del-node-modules.mjs
CHANGED
|
@@ -3,158 +3,164 @@ import {
|
|
|
3
3
|
require_utils
|
|
4
4
|
} from "./chunk-6RK5UCTP.mjs";
|
|
5
5
|
import {
|
|
6
|
+
__commonJS,
|
|
6
7
|
__require,
|
|
7
8
|
init_esm_shims
|
|
8
9
|
} from "./chunk-QQ4A6DLD.mjs";
|
|
9
10
|
|
|
10
|
-
// src/del-node-modules.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
// src/del-node-modules.cjs
|
|
12
|
+
var require_del_node_modules = __commonJS({
|
|
13
|
+
"src/del-node-modules.cjs"() {
|
|
14
|
+
init_esm_shims();
|
|
15
|
+
var fs = __require("fs");
|
|
16
|
+
var fsp = fs.promises;
|
|
17
|
+
var path = __require("upath");
|
|
18
|
+
var os = __require("os");
|
|
19
|
+
var { getArgs } = require_utils();
|
|
20
|
+
var argv = getArgs({
|
|
21
|
+
boolean: ["force", "help"],
|
|
22
|
+
alias: { h: "help", f: "force", c: "concurrent" },
|
|
23
|
+
default: { force: false, concurrent: 2 }
|
|
24
|
+
});
|
|
25
|
+
if (argv.help) {
|
|
26
|
+
console.log(`Usage: clean-node [--force] [-c|--concurrent N]
|
|
24
27
|
By default runs in dry-run mode. Use --force to actually delete.
|
|
25
28
|
Use -c/--concurrent to set concurrent removals (default 2).`);
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
var DRY_RUN = !argv.force;
|
|
29
|
-
var defaultConcurrency = Math.max(2, os.cpus().length || 2);
|
|
30
|
-
var CONCURRENCY = Math.max(1, Number(argv.concurrent || argv.c || defaultConcurrency));
|
|
31
|
-
var customChars = "@.";
|
|
32
|
-
var vowels = "aeiouAEIOU";
|
|
33
|
-
var alnum = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
|
34
|
-
var combined = alnum + vowels + customChars;
|
|
35
|
-
var ROOT = process.cwd();
|
|
36
|
-
async function isSymlinkAsync(p) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
async function removeAsync(target) {
|
|
44
|
-
if (await isSymlinkAsync(target)) {
|
|
45
|
-
console.log("Skipping symlink", target);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
if (DRY_RUN) {
|
|
49
|
-
console.log("Would remove", target);
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
try {
|
|
53
|
-
await fsp.rm(target, { recursive: true, force: true });
|
|
54
|
-
console.log("Deleting", target);
|
|
55
|
-
} catch (e) {
|
|
56
|
-
console.error("Failed:", target, e.message);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
function runWithConcurrency(tasks, concurrency) {
|
|
60
|
-
return new Promise((resolve, reject) => {
|
|
61
|
-
let i = 0;
|
|
62
|
-
let active = 0;
|
|
63
|
-
let done = 0;
|
|
64
|
-
const total = tasks.length;
|
|
65
|
-
if (total === 0) return resolve();
|
|
66
|
-
function next() {
|
|
67
|
-
if (done === total) return resolve();
|
|
68
|
-
while (active < concurrency && i < total) {
|
|
69
|
-
const idx = i++;
|
|
70
|
-
active++;
|
|
71
|
-
Promise.resolve().then(() => tasks[idx]()).then(() => {
|
|
72
|
-
active--;
|
|
73
|
-
done++;
|
|
74
|
-
next();
|
|
75
|
-
}).catch((err) => reject(err));
|
|
29
|
+
process.exit(0);
|
|
30
|
+
}
|
|
31
|
+
var DRY_RUN = !argv.force;
|
|
32
|
+
var defaultConcurrency = Math.max(2, os.cpus().length || 2);
|
|
33
|
+
var CONCURRENCY = Math.max(1, Number(argv.concurrent || argv.c || defaultConcurrency));
|
|
34
|
+
var customChars = "@.";
|
|
35
|
+
var vowels = "aeiouAEIOU";
|
|
36
|
+
var alnum = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
|
37
|
+
var combined = alnum + vowels + customChars;
|
|
38
|
+
var ROOT = process.cwd();
|
|
39
|
+
async function isSymlinkAsync(p) {
|
|
40
|
+
try {
|
|
41
|
+
return (await fsp.lstat(p)).isSymbolicLink();
|
|
42
|
+
} catch {
|
|
43
|
+
return false;
|
|
76
44
|
}
|
|
77
45
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
callback(fullPath, entry);
|
|
93
|
-
if (entry.isDirectory()) {
|
|
94
|
-
if (skipNodeModulesChildren && entry.name === "node_modules") {
|
|
95
|
-
continue;
|
|
46
|
+
async function removeAsync(target) {
|
|
47
|
+
if (await isSymlinkAsync(target)) {
|
|
48
|
+
console.log("Skipping symlink", target);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (DRY_RUN) {
|
|
52
|
+
console.log("Would remove", target);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
await fsp.rm(target, { recursive: true, force: true });
|
|
57
|
+
console.log("Deleting", target);
|
|
58
|
+
} catch (e) {
|
|
59
|
+
console.error("Failed:", target, e.message);
|
|
96
60
|
}
|
|
97
|
-
walk(fullPath, callback, { skipNodeModulesChildren });
|
|
98
61
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
62
|
+
function runWithConcurrency(tasks, concurrency) {
|
|
63
|
+
return new Promise((resolve, reject) => {
|
|
64
|
+
let i = 0;
|
|
65
|
+
let active = 0;
|
|
66
|
+
let done = 0;
|
|
67
|
+
const total = tasks.length;
|
|
68
|
+
if (total === 0) return resolve();
|
|
69
|
+
function next() {
|
|
70
|
+
if (done === total) return resolve();
|
|
71
|
+
while (active < concurrency && i < total) {
|
|
72
|
+
const idx = i++;
|
|
73
|
+
active++;
|
|
74
|
+
Promise.resolve().then(() => tasks[idx]()).then(() => {
|
|
75
|
+
active--;
|
|
76
|
+
done++;
|
|
77
|
+
next();
|
|
78
|
+
}).catch((err) => reject(err));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
next();
|
|
82
|
+
});
|
|
116
83
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
84
|
+
function walk(dir, callback, { skipNodeModulesChildren = false } = {}) {
|
|
85
|
+
let entries;
|
|
86
|
+
try {
|
|
87
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
88
|
+
} catch {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
for (const entry of entries) {
|
|
92
|
+
const fullPath = path.join(dir, entry.name);
|
|
93
|
+
if (entry.isSymbolicLink()) continue;
|
|
94
|
+
if (skipNodeModulesChildren && dir.includes("node_modules")) continue;
|
|
95
|
+
callback(fullPath, entry);
|
|
96
|
+
if (entry.isDirectory()) {
|
|
97
|
+
if (skipNodeModulesChildren && entry.name === "node_modules") {
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
walk(fullPath, callback, { skipNodeModulesChildren });
|
|
101
|
+
}
|
|
102
|
+
}
|
|
127
103
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
104
|
+
async function processNodeModules(dir) {
|
|
105
|
+
console.log("Found:", dir);
|
|
106
|
+
let items;
|
|
107
|
+
try {
|
|
108
|
+
items = fs.readdirSync(dir, { withFileTypes: true });
|
|
109
|
+
} catch {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const targets = items.filter((entry) => entry.name.length && combined.includes(entry.name[0]));
|
|
113
|
+
const tasks = targets.map((entry) => async () => {
|
|
114
|
+
const name = entry.name;
|
|
115
|
+
const target = path.join(dir, name);
|
|
116
|
+
if (entry.isSymbolicLink && entry.isSymbolicLink()) {
|
|
117
|
+
console.log("Skipping symlink", target);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
await removeAsync(target);
|
|
121
|
+
});
|
|
122
|
+
await runWithConcurrency(tasks, CONCURRENCY);
|
|
123
|
+
await removeAsync(dir);
|
|
124
|
+
}
|
|
125
|
+
async function main() {
|
|
126
|
+
const nodeModulesDirs = [];
|
|
127
|
+
walk(ROOT, (fullPath, entry) => {
|
|
128
|
+
if (entry.isDirectory() && entry.name === "node_modules") {
|
|
129
|
+
nodeModulesDirs.push(fullPath);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
for (const dir of nodeModulesDirs) {
|
|
133
|
+
await processNodeModules(dir);
|
|
134
|
+
}
|
|
135
|
+
const packageLocks = [];
|
|
136
|
+
const yarnLocks = [];
|
|
137
|
+
const yarnCaches = [];
|
|
138
|
+
walk(
|
|
139
|
+
ROOT,
|
|
140
|
+
(fullPath, entry) => {
|
|
141
|
+
const base = path.basename(fullPath);
|
|
142
|
+
if (base === "package-lock.json") packageLocks.push(fullPath);
|
|
143
|
+
if (base === "yarn.lock") yarnLocks.push(fullPath);
|
|
144
|
+
if (entry.isDirectory() && fullPath.endsWith(path.join(".yarn", "cache"))) yarnCaches.push(fullPath);
|
|
145
|
+
},
|
|
146
|
+
{ skipNodeModulesChildren: true }
|
|
147
|
+
);
|
|
148
|
+
if (DRY_RUN) {
|
|
149
|
+
console.log("Would remove package-lock.json files:");
|
|
150
|
+
for (const p of packageLocks) console.log(p);
|
|
151
|
+
console.log("Would remove yarn.lock files:");
|
|
152
|
+
for (const p of yarnLocks) console.log(p);
|
|
153
|
+
console.log("Would remove .yarn/cache directories:");
|
|
154
|
+
for (const p of yarnCaches) console.log(p);
|
|
155
|
+
} else {
|
|
156
|
+
const allTasks = [];
|
|
157
|
+
allTasks.push(...packageLocks.map((p) => async () => removeAsync(p)));
|
|
158
|
+
allTasks.push(...yarnLocks.map((p) => async () => removeAsync(p)));
|
|
159
|
+
allTasks.push(...yarnCaches.map((p) => async () => removeAsync(p)));
|
|
160
|
+
await runWithConcurrency(allTasks, CONCURRENCY);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
main();
|
|
158
164
|
}
|
|
159
|
-
}
|
|
160
|
-
|
|
165
|
+
});
|
|
166
|
+
export default require_del_node_modules();
|
|
@@ -4,10 +4,16 @@ import {
|
|
|
4
4
|
require_find_node_modules
|
|
5
5
|
} from "./chunk-UY5VUEA3.mjs";
|
|
6
6
|
import {
|
|
7
|
+
__commonJS,
|
|
7
8
|
init_esm_shims
|
|
8
9
|
} from "./chunk-QQ4A6DLD.mjs";
|
|
9
10
|
|
|
10
|
-
// src/find-node-modules-cli.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
// src/find-node-modules-cli.cjs
|
|
12
|
+
var require_find_node_modules_cli = __commonJS({
|
|
13
|
+
"src/find-node-modules-cli.cjs"() {
|
|
14
|
+
init_esm_shims();
|
|
15
|
+
var findNodeModules = require_find_node_modules();
|
|
16
|
+
findNodeModules(null, console.log);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
export default require_find_node_modules_cli();
|
|
@@ -115,6 +115,9 @@ var require_findEnvFiles = __commonJS({
|
|
|
115
115
|
return envFiles.find((file) => {
|
|
116
116
|
try {
|
|
117
117
|
const content = fs3.readFileSync(file, "utf-8");
|
|
118
|
+
if (tokenName instanceof RegExp) {
|
|
119
|
+
return tokenName.test(content);
|
|
120
|
+
}
|
|
118
121
|
const regex = new RegExp(`^\\s*${tokenName}\\s*=`, "m");
|
|
119
122
|
return regex.test(content);
|
|
120
123
|
} catch (err) {
|
|
@@ -137,8 +140,15 @@ var require_config = __commonJS({
|
|
|
137
140
|
"src/binary-collections/config.cjs"(exports2, module2) {
|
|
138
141
|
init_cjs_shims();
|
|
139
142
|
var path3 = require("upath");
|
|
143
|
+
var minimistLib = require("minimist");
|
|
140
144
|
var { findEnvWithToken } = require_findEnvFiles();
|
|
141
|
-
require("dotenv")
|
|
145
|
+
var dotenv = require("dotenv");
|
|
146
|
+
var loadDotenv = (tokenKey = /ACCESS_TOKEN|GITHUB_TOKEN/) => dotenv.config({ path: findEnvWithToken(void 0, tokenKey), quiet: true, overwrite: true });
|
|
147
|
+
loadDotenv();
|
|
148
|
+
var cliArgv = minimistLib(process.argv.slice(2), {
|
|
149
|
+
string: ["token"]
|
|
150
|
+
});
|
|
151
|
+
var GITHUB_ACCESS_TOKEN = cliArgv.token || process.env.ACCESS_TOKEN || process.env.GITHUB_TOKEN || process.env.GH_TOKEN;
|
|
142
152
|
function getTempDir() {
|
|
143
153
|
return process.env.TEMP_DIR || path3.join(process.cwd(), "tmp");
|
|
144
154
|
}
|
|
@@ -149,7 +159,9 @@ var require_config = __commonJS({
|
|
|
149
159
|
module2.exports = {
|
|
150
160
|
getTempDir,
|
|
151
161
|
getTempPath: getTempPath2,
|
|
152
|
-
TEMP_BASE_DIR
|
|
162
|
+
TEMP_BASE_DIR,
|
|
163
|
+
GITHUB_ACCESS_TOKEN,
|
|
164
|
+
loadDotenv
|
|
153
165
|
};
|
|
154
166
|
}
|
|
155
167
|
});
|
|
@@ -321,10 +333,10 @@ var require_utils = __commonJS({
|
|
|
321
333
|
}
|
|
322
334
|
});
|
|
323
335
|
|
|
324
|
-
// src/git-diff-cli.js
|
|
336
|
+
// src/git/git-diff-cli.js
|
|
325
337
|
init_cjs_shims();
|
|
326
338
|
|
|
327
|
-
// src/git-diff.js
|
|
339
|
+
// src/git/git-diff.js
|
|
328
340
|
init_cjs_shims();
|
|
329
341
|
var import_ansi_colors = __toESM(require("ansi-colors"), 1);
|
|
330
342
|
var import_child_process = require("child_process");
|
|
@@ -846,7 +858,7 @@ async function runChatGpt(chatgptOptions = {}) {
|
|
|
846
858
|
}
|
|
847
859
|
}
|
|
848
860
|
|
|
849
|
-
// src/git-diff.js
|
|
861
|
+
// src/git/git-diff.js
|
|
850
862
|
var import_utils = __toESM(require_utils(), 1);
|
|
851
863
|
var __filename2 = (0, import_url.fileURLToPath)(importMetaUrl);
|
|
852
864
|
var __dirname = import_upath2.default.dirname(__filename2);
|
|
@@ -1058,7 +1070,7 @@ Thank you!`
|
|
|
1058
1070
|
}
|
|
1059
1071
|
}
|
|
1060
1072
|
|
|
1061
|
-
// src/git-diff-cli.js
|
|
1073
|
+
// src/git/git-diff-cli.js
|
|
1062
1074
|
(async () => {
|
|
1063
1075
|
await mainGitDiff();
|
|
1064
1076
|
})();
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
mainGitDiff
|
|
5
|
-
} from "
|
|
6
|
-
import "
|
|
7
|
-
import "
|
|
8
|
-
import "
|
|
9
|
-
import "
|
|
5
|
+
} from "../chunk-3F6EIHYG.mjs";
|
|
6
|
+
import "../chunk-SARIXFHP.mjs";
|
|
7
|
+
import "../chunk-J4M5EL5P.mjs";
|
|
8
|
+
import "../chunk-GAGABICI.mjs";
|
|
9
|
+
import "../chunk-6RK5UCTP.mjs";
|
|
10
10
|
import {
|
|
11
11
|
init_esm_shims
|
|
12
|
-
} from "
|
|
12
|
+
} from "../chunk-QQ4A6DLD.mjs";
|
|
13
13
|
|
|
14
|
-
// src/git-diff-cli.js
|
|
14
|
+
// src/git/git-diff-cli.js
|
|
15
15
|
init_esm_shims();
|
|
16
16
|
(async () => {
|
|
17
17
|
await mainGitDiff();
|
|
@@ -120,6 +120,9 @@ var require_findEnvFiles = __commonJS({
|
|
|
120
120
|
return envFiles.find((file) => {
|
|
121
121
|
try {
|
|
122
122
|
const content = fs3.readFileSync(file, "utf-8");
|
|
123
|
+
if (tokenName instanceof RegExp) {
|
|
124
|
+
return tokenName.test(content);
|
|
125
|
+
}
|
|
123
126
|
const regex = new RegExp(`^\\s*${tokenName}\\s*=`, "m");
|
|
124
127
|
return regex.test(content);
|
|
125
128
|
} catch (err) {
|
|
@@ -142,8 +145,15 @@ var require_config = __commonJS({
|
|
|
142
145
|
"src/binary-collections/config.cjs"(exports2, module2) {
|
|
143
146
|
init_cjs_shims();
|
|
144
147
|
var path3 = require("upath");
|
|
148
|
+
var minimistLib = require("minimist");
|
|
145
149
|
var { findEnvWithToken } = require_findEnvFiles();
|
|
146
|
-
require("dotenv")
|
|
150
|
+
var dotenv = require("dotenv");
|
|
151
|
+
var loadDotenv = (tokenKey = /ACCESS_TOKEN|GITHUB_TOKEN/) => dotenv.config({ path: findEnvWithToken(void 0, tokenKey), quiet: true, overwrite: true });
|
|
152
|
+
loadDotenv();
|
|
153
|
+
var cliArgv = minimistLib(process.argv.slice(2), {
|
|
154
|
+
string: ["token"]
|
|
155
|
+
});
|
|
156
|
+
var GITHUB_ACCESS_TOKEN = cliArgv.token || process.env.ACCESS_TOKEN || process.env.GITHUB_TOKEN || process.env.GH_TOKEN;
|
|
147
157
|
function getTempDir() {
|
|
148
158
|
return process.env.TEMP_DIR || path3.join(process.cwd(), "tmp");
|
|
149
159
|
}
|
|
@@ -154,7 +164,9 @@ var require_config = __commonJS({
|
|
|
154
164
|
module2.exports = {
|
|
155
165
|
getTempDir,
|
|
156
166
|
getTempPath: getTempPath2,
|
|
157
|
-
TEMP_BASE_DIR
|
|
167
|
+
TEMP_BASE_DIR,
|
|
168
|
+
GITHUB_ACCESS_TOKEN,
|
|
169
|
+
loadDotenv
|
|
158
170
|
};
|
|
159
171
|
}
|
|
160
172
|
});
|
|
@@ -326,7 +338,7 @@ var require_utils = __commonJS({
|
|
|
326
338
|
}
|
|
327
339
|
});
|
|
328
340
|
|
|
329
|
-
// src/git-diff.js
|
|
341
|
+
// src/git/git-diff.js
|
|
330
342
|
var git_diff_exports = {};
|
|
331
343
|
__export(git_diff_exports, {
|
|
332
344
|
CACHE_DIR: () => CACHE_DIR,
|
|
@@ -860,7 +872,7 @@ async function runChatGpt(chatgptOptions = {}) {
|
|
|
860
872
|
}
|
|
861
873
|
}
|
|
862
874
|
|
|
863
|
-
// src/git-diff.js
|
|
875
|
+
// src/git/git-diff.js
|
|
864
876
|
var import_utils = __toESM(require_utils(), 1);
|
|
865
877
|
var __filename2 = (0, import_url.fileURLToPath)(importMetaUrl);
|
|
866
878
|
var __dirname = import_upath2.default.dirname(__filename2);
|
|
@@ -22,9 +22,9 @@ const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
|
22
22
|
const sbg_utility_1 = require("sbg-utility");
|
|
23
23
|
const upath_1 = __importDefault(require("upath"));
|
|
24
24
|
const url_1 = require("url");
|
|
25
|
-
const config_cjs_1 = require("
|
|
26
|
-
const chatgpt_js_1 = require("
|
|
27
|
-
const index_cjs_1 = require("
|
|
25
|
+
const config_cjs_1 = require("../binary-collections/config.cjs");
|
|
26
|
+
const chatgpt_js_1 = require("../utils/chatgpt.js");
|
|
27
|
+
const index_cjs_1 = require("../utils/index.cjs");
|
|
28
28
|
const __filename = (0, url_1.fileURLToPath)(import.meta.url);
|
|
29
29
|
const __dirname = upath_1.default.dirname(__filename);
|
|
30
30
|
const args = (0, index_cjs_1.getArgs)();
|
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
git_diff_default,
|
|
10
10
|
mainGitDiff,
|
|
11
11
|
runGitDiff
|
|
12
|
-
} from "
|
|
13
|
-
import "
|
|
14
|
-
import "
|
|
15
|
-
import "
|
|
16
|
-
import "
|
|
17
|
-
import "
|
|
12
|
+
} from "../chunk-3F6EIHYG.mjs";
|
|
13
|
+
import "../chunk-SARIXFHP.mjs";
|
|
14
|
+
import "../chunk-J4M5EL5P.mjs";
|
|
15
|
+
import "../chunk-GAGABICI.mjs";
|
|
16
|
+
import "../chunk-6RK5UCTP.mjs";
|
|
17
|
+
import "../chunk-QQ4A6DLD.mjs";
|
|
18
18
|
export {
|
|
19
19
|
CACHE_DIR,
|
|
20
20
|
DIFF_OUTPUT,
|