binary-collections 2.0.13 → 2.0.15
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/plugins/opencode-request-logger/README.md +44 -0
- package/.venv/Lib/site-packages/pyarrow/tests/data/orc/README.md +22 -0
- 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/install-opencode-plugins.md +86 -0
- 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 +155 -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-types.cjs +17 -0
- package/lib/binary-collections/config-types.d.ts +12 -0
- package/lib/binary-collections/config-types.js +2 -0
- package/lib/binary-collections/config-types.mjs +7 -0
- package/lib/binary-collections/config.cjs +28 -8
- package/lib/binary-collections/config.d.cts +26 -8
- package/lib/binary-collections/config.mjs +2 -2
- package/lib/binary-collections/findScript.cjs +49 -25
- package/lib/binary-collections/findScript.mjs +2 -2
- package/lib/binary-collections/listScript.cjs +49 -25
- package/lib/binary-collections/listScript.mjs +2 -2
- package/lib/binary-collections.cjs +49 -25
- package/lib/binary-collections.mjs +6 -6
- package/lib/changelog.cjs +142 -4
- package/lib/changelog.mjs +9 -5
- package/lib/chunk-3T6AMFI3.mjs +52 -0
- package/lib/{chunk-2MN4VPV2.mjs → chunk-3ZF2QMDK.mjs} +4 -4
- package/lib/chunk-56BVU63B.mjs +86 -0
- package/lib/chunk-7N52Z4IJ.mjs +39 -0
- package/lib/chunk-B77D3SR4.mjs +28 -0
- package/lib/chunk-BPED62FN.mjs +115 -0
- package/lib/{chunk-RDN6HF5Z.mjs → chunk-DHFRWM2W.mjs} +1 -1
- package/lib/chunk-DPEE3FBB.mjs +146 -0
- package/lib/{chunk-MGPYPKIE.mjs → chunk-H7AE4IO3.mjs} +5 -1
- package/lib/{chunk-H44UWUFY.mjs → chunk-J4M5EL5P.mjs} +3 -0
- package/lib/chunk-KCJYREA2.mjs +67 -0
- package/lib/chunk-LACQTD5V.mjs +225 -0
- package/lib/{chunk-TBWXE7ST.mjs → chunk-NHD4HLSU.mjs} +24 -31
- package/lib/{chunk-RDGDLSPD.mjs → chunk-OWNVMKAA.mjs} +6 -5
- package/lib/chunk-SKVF4TMD.mjs +59 -0
- package/lib/{chunk-BZWVHODJ.mjs → chunk-TDUUOAQD.mjs} +5 -5
- package/lib/chunk-TP3O2JGW.mjs +88 -0
- package/lib/{chunk-FLYSZFLW.mjs → chunk-UAEKSLAX.mjs} +1 -1
- package/lib/chunk-UDZBVKXH.mjs +94 -0
- package/lib/chunk-UEOWRYAN.mjs +32 -0
- package/lib/chunk-V6PTSDW5.mjs +82 -0
- package/lib/{chunk-NQXUYO67.mjs → chunk-WNUEY6VJ.mjs} +49 -25
- package/lib/chunk-X7UVQ6ZC.mjs +183 -0
- package/lib/chunk-XW5NZAKI.mjs +82 -0
- package/lib/{chunk-LVSPEFU2.mjs → chunk-Z53IUBUN.mjs} +6 -5
- package/lib/{chunk-CD3HF3LK.mjs → chunk-Z7RM46Q4.mjs} +5 -11
- package/lib/chunk-ZB4IQ6VJ.mjs +46 -0
- 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} +32 -12
- package/lib/{git-diff-cli.mjs → git/git-diff-cli.mjs} +7 -7
- package/lib/{git-diff.cjs → git/git-diff.cjs} +30 -10
- 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} +142 -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 +139 -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} +46 -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} +46 -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 +549 -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 +279 -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 +730 -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/node-cache-cleaner-cli.mjs +3 -3
- package/lib/opencode/cli/auth-rotate.cjs +458 -0
- package/lib/opencode/cli/auth-rotate.d.ts +3 -0
- package/lib/opencode/cli/auth-rotate.js +65 -0
- package/lib/opencode/cli/auth-rotate.mjs +14 -0
- package/lib/opencode/cli/auth-rotate.runner.cjs +454 -0
- package/lib/opencode/cli/auth-rotate.runner.d.ts +1 -0
- package/lib/opencode/cli/auth-rotate.runner.js +8 -0
- package/lib/opencode/cli/auth-rotate.runner.mjs +21 -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/install-opencode-plugins-cli.cjs +82 -0
- package/lib/opencode/install-opencode-plugins-cli.d.ts +1 -0
- package/lib/opencode/install-opencode-plugins-cli.js +78 -0
- package/lib/opencode/install-opencode-plugins-cli.mjs +65 -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 +373 -0
- package/lib/opencode/utils/check-api.d.ts +16 -0
- package/lib/opencode/utils/check-api.js +132 -0
- package/lib/opencode/utils/check-api.mjs +12 -0
- package/lib/opencode/utils/check-api.runner.cjs +0 -0
- package/lib/opencode/utils/check-api.runner.d.ts +0 -0
- package/lib/opencode/utils/check-api.runner.js +1 -0
- package/lib/opencode/utils/check-api.runner.mjs +7 -0
- package/lib/opencode-cli.cjs +796 -0
- package/lib/opencode-cli.d.ts +2 -0
- package/lib/opencode-cli.js +116 -0
- package/lib/opencode-cli.mjs +116 -0
- package/lib/package-resolutions-updater-cli.cjs +189 -154
- package/lib/package-resolutions-updater-cli.mjs +3 -2
- package/lib/package-resolutions-updater.cjs +189 -154
- package/lib/package-resolutions-updater.d.mts +12 -3
- package/lib/package-resolutions-updater.mjs +3 -2
- package/lib/print-directory-tree.cjs +139 -3
- package/lib/print-directory-tree.mjs +6 -3
- package/lib/print-tarball-tree-cli.cjs +305 -0
- package/lib/print-tarball-tree-cli.d.mts +2 -0
- package/lib/print-tarball-tree-cli.mjs +54 -0
- package/lib/print-tarball-tree.cjs +43 -216
- package/lib/print-tarball-tree.d.mts +4 -1
- package/lib/print-tarball-tree.mjs +12 -66
- package/lib/rmpath-cli.cjs +139 -5
- package/lib/rmpath-cli.mjs +3 -1
- package/lib/rmpath.cjs +155 -11
- package/lib/rmpath.mjs +3 -1
- package/lib/run-by-checksum/hash.cjs +50 -56
- package/lib/run-by-checksum/hash.d.cts +24 -0
- package/lib/run-by-checksum/hash.mjs +3 -7
- package/lib/run-by-checksum/run.cjs +95 -42
- package/lib/run-by-checksum/run.js +3 -3
- package/lib/run-by-checksum/run.mjs +2 -2
- package/lib/run-by-checksum-cli.cjs +96 -58
- package/lib/run-by-checksum-cli.mjs +2 -2
- package/lib/submodule-install.cjs +138 -4
- package/lib/submodule-install.mjs +5 -4
- package/lib/submodule-remove-cli.cjs +139 -5
- package/lib/submodule-remove-cli.mjs +3 -1
- package/lib/submodule-remove.cjs +154 -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/utils/isDebug.cjs +13 -0
- package/lib/utils/isDebug.d.cts +9 -0
- package/lib/utils/isDebug.mjs +6 -0
- 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 +50 -26
- package/readme.md +104 -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/chunk-WSHVPGNM.mjs +0 -44
- package/lib/chunk-X2B3X7D4.mjs +0 -35
- 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/run-by-checksum/hash.d.ts +0 -14
- package/lib/run-by-checksum/hash.js +0 -85
- package/readme.html +0 -784
- /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,19 +140,36 @@ 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")
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
+
var dotenv = require("dotenv");
|
|
146
|
+
var { cosmiconfig } = require("cosmiconfig");
|
|
147
|
+
var loadDotenv = (tokenKey = /ACCESS_TOKEN|GITHUB_TOKEN/) => dotenv.config({ path: findEnvWithToken(void 0, tokenKey), quiet: true, overwrite: true });
|
|
148
|
+
loadDotenv();
|
|
149
|
+
var cliArgv = minimistLib(process.argv.slice(2), {
|
|
150
|
+
string: ["token"]
|
|
151
|
+
});
|
|
152
|
+
var GITHUB_ACCESS_TOKEN = cliArgv.token || process.env.ACCESS_TOKEN || process.env.GITHUB_TOKEN || process.env.GH_TOKEN;
|
|
145
153
|
function getTempPath2(...segments) {
|
|
146
|
-
return path3.join(
|
|
154
|
+
return path3.join(process.env.TEMP_DIR || path3.join(process.cwd(), "tmp"), ...segments);
|
|
155
|
+
}
|
|
156
|
+
async function getConfig(options = {}) {
|
|
157
|
+
const explorer = cosmiconfig("binary-collections", {
|
|
158
|
+
searchStrategy: "project",
|
|
159
|
+
stopDir: options.stopDir
|
|
160
|
+
});
|
|
161
|
+
try {
|
|
162
|
+
const result = await explorer.search(options.searchFrom);
|
|
163
|
+
return result ? result.config : null;
|
|
164
|
+
} catch {
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
147
167
|
}
|
|
148
|
-
var TEMP_BASE_DIR = getTempDir();
|
|
149
168
|
module2.exports = {
|
|
150
|
-
getTempDir,
|
|
151
169
|
getTempPath: getTempPath2,
|
|
152
|
-
|
|
170
|
+
GITHUB_ACCESS_TOKEN,
|
|
171
|
+
loadDotenv,
|
|
172
|
+
getConfig
|
|
153
173
|
};
|
|
154
174
|
}
|
|
155
175
|
});
|
|
@@ -321,10 +341,10 @@ var require_utils = __commonJS({
|
|
|
321
341
|
}
|
|
322
342
|
});
|
|
323
343
|
|
|
324
|
-
// src/git-diff-cli.js
|
|
344
|
+
// src/git/git-diff-cli.js
|
|
325
345
|
init_cjs_shims();
|
|
326
346
|
|
|
327
|
-
// src/git-diff.js
|
|
347
|
+
// src/git/git-diff.js
|
|
328
348
|
init_cjs_shims();
|
|
329
349
|
var import_ansi_colors = __toESM(require("ansi-colors"), 1);
|
|
330
350
|
var import_child_process = require("child_process");
|
|
@@ -846,7 +866,7 @@ async function runChatGpt(chatgptOptions = {}) {
|
|
|
846
866
|
}
|
|
847
867
|
}
|
|
848
868
|
|
|
849
|
-
// src/git-diff.js
|
|
869
|
+
// src/git/git-diff.js
|
|
850
870
|
var import_utils = __toESM(require_utils(), 1);
|
|
851
871
|
var __filename2 = (0, import_url.fileURLToPath)(importMetaUrl);
|
|
852
872
|
var __dirname = import_upath2.default.dirname(__filename2);
|
|
@@ -1058,7 +1078,7 @@ Thank you!`
|
|
|
1058
1078
|
}
|
|
1059
1079
|
}
|
|
1060
1080
|
|
|
1061
|
-
// src/git-diff-cli.js
|
|
1081
|
+
// src/git/git-diff-cli.js
|
|
1062
1082
|
(async () => {
|
|
1063
1083
|
await mainGitDiff();
|
|
1064
1084
|
})();
|
|
@@ -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-3ZF2QMDK.mjs";
|
|
6
|
+
import "../chunk-GAGABICI.mjs";
|
|
7
|
+
import "../chunk-3T6AMFI3.mjs";
|
|
8
|
+
import "../chunk-J4M5EL5P.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,19 +145,36 @@ 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")
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
+
var dotenv = require("dotenv");
|
|
151
|
+
var { cosmiconfig } = require("cosmiconfig");
|
|
152
|
+
var loadDotenv = (tokenKey = /ACCESS_TOKEN|GITHUB_TOKEN/) => dotenv.config({ path: findEnvWithToken(void 0, tokenKey), quiet: true, overwrite: true });
|
|
153
|
+
loadDotenv();
|
|
154
|
+
var cliArgv = minimistLib(process.argv.slice(2), {
|
|
155
|
+
string: ["token"]
|
|
156
|
+
});
|
|
157
|
+
var GITHUB_ACCESS_TOKEN = cliArgv.token || process.env.ACCESS_TOKEN || process.env.GITHUB_TOKEN || process.env.GH_TOKEN;
|
|
150
158
|
function getTempPath2(...segments) {
|
|
151
|
-
return path3.join(
|
|
159
|
+
return path3.join(process.env.TEMP_DIR || path3.join(process.cwd(), "tmp"), ...segments);
|
|
160
|
+
}
|
|
161
|
+
async function getConfig(options = {}) {
|
|
162
|
+
const explorer = cosmiconfig("binary-collections", {
|
|
163
|
+
searchStrategy: "project",
|
|
164
|
+
stopDir: options.stopDir
|
|
165
|
+
});
|
|
166
|
+
try {
|
|
167
|
+
const result = await explorer.search(options.searchFrom);
|
|
168
|
+
return result ? result.config : null;
|
|
169
|
+
} catch {
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
152
172
|
}
|
|
153
|
-
var TEMP_BASE_DIR = getTempDir();
|
|
154
173
|
module2.exports = {
|
|
155
|
-
getTempDir,
|
|
156
174
|
getTempPath: getTempPath2,
|
|
157
|
-
|
|
175
|
+
GITHUB_ACCESS_TOKEN,
|
|
176
|
+
loadDotenv,
|
|
177
|
+
getConfig
|
|
158
178
|
};
|
|
159
179
|
}
|
|
160
180
|
});
|
|
@@ -326,7 +346,7 @@ var require_utils = __commonJS({
|
|
|
326
346
|
}
|
|
327
347
|
});
|
|
328
348
|
|
|
329
|
-
// src/git-diff.js
|
|
349
|
+
// src/git/git-diff.js
|
|
330
350
|
var git_diff_exports = {};
|
|
331
351
|
__export(git_diff_exports, {
|
|
332
352
|
CACHE_DIR: () => CACHE_DIR,
|
|
@@ -860,7 +880,7 @@ async function runChatGpt(chatgptOptions = {}) {
|
|
|
860
880
|
}
|
|
861
881
|
}
|
|
862
882
|
|
|
863
|
-
// src/git-diff.js
|
|
883
|
+
// src/git/git-diff.js
|
|
864
884
|
var import_utils = __toESM(require_utils(), 1);
|
|
865
885
|
var __filename2 = (0, import_url.fileURLToPath)(importMetaUrl);
|
|
866
886
|
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-3ZF2QMDK.mjs";
|
|
13
|
+
import "../chunk-GAGABICI.mjs";
|
|
14
|
+
import "../chunk-3T6AMFI3.mjs";
|
|
15
|
+
import "../chunk-J4M5EL5P.mjs";
|
|
16
|
+
import "../chunk-6RK5UCTP.mjs";
|
|
17
|
+
import "../chunk-QQ4A6DLD.mjs";
|
|
18
18
|
export {
|
|
19
19
|
CACHE_DIR,
|
|
20
20
|
DIFF_OUTPUT,
|