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
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
+
};
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
const minimist_1 = __importDefault(require("minimist"));
|
|
17
|
+
const storage_js_1 = require("./vscode/storage.js");
|
|
18
|
+
const argv = (0, minimist_1.default)(process.argv.slice(2), {
|
|
19
|
+
alias: { h: 'help', 'copilot-memory': ['copilotMemory', 'cm'] }
|
|
20
|
+
});
|
|
21
|
+
function printHelp() {
|
|
22
|
+
console.log(`
|
|
23
|
+
Usage: vscode-cli <command> [options]
|
|
24
|
+
|
|
25
|
+
Commands:
|
|
26
|
+
list project List all workspace projects
|
|
27
|
+
list project --copilot-memory
|
|
28
|
+
List only projects with Copilot memory tool directories
|
|
29
|
+
|
|
30
|
+
Options:
|
|
31
|
+
-h, --help Show this help message
|
|
32
|
+
--copilot-memory Filter to projects with Copilot memory tool
|
|
33
|
+
`);
|
|
34
|
+
}
|
|
35
|
+
function main() {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
if (argv.help || argv._.length === 0) {
|
|
38
|
+
printHelp();
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const command = argv._[0];
|
|
42
|
+
if (command === 'list') {
|
|
43
|
+
const sub = argv._[1];
|
|
44
|
+
if (sub === 'project') {
|
|
45
|
+
const all = yield (0, storage_js_1.listWorkspaceProjects)();
|
|
46
|
+
let projects = all;
|
|
47
|
+
if (argv['copilot-memory']) {
|
|
48
|
+
projects = all.filter((p) => p.copilotMemoryDir);
|
|
49
|
+
}
|
|
50
|
+
console.log(`Projects (${projects.length}):\n`);
|
|
51
|
+
if (!projects.length)
|
|
52
|
+
return;
|
|
53
|
+
const rows = projects.map((p) => ({
|
|
54
|
+
id: p.storageId.slice(0, 8),
|
|
55
|
+
folder: p.folder,
|
|
56
|
+
hasMemory: p.copilotMemoryDir ? 'yes' : ''
|
|
57
|
+
}));
|
|
58
|
+
const idWidth = Math.max(2, ...rows.map((r) => r.id.length));
|
|
59
|
+
const folderWidth = Math.max(6, ...rows.map((r) => r.folder.length));
|
|
60
|
+
const sep = '─'.repeat(idWidth + folderWidth + 12);
|
|
61
|
+
console.log(` ${'ID'.padEnd(idWidth)} ${'Folder'.padEnd(folderWidth)} Memory`);
|
|
62
|
+
console.log(` ${sep}`);
|
|
63
|
+
for (const r of rows) {
|
|
64
|
+
console.log(` ${r.id.padEnd(idWidth)} ${r.folder.padEnd(folderWidth)} ${r.hasMemory}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
console.error(`Unknown subcommand: list ${sub || ''}`);
|
|
69
|
+
printHelp();
|
|
70
|
+
process.exit(1);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
console.error(`Unknown command: ${command}`);
|
|
75
|
+
printHelp();
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
main();
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
listWorkspaceProjects
|
|
5
|
+
} from "./chunk-UDZBVKXH.mjs";
|
|
6
|
+
import {
|
|
7
|
+
init_esm_shims
|
|
8
|
+
} from "./chunk-QQ4A6DLD.mjs";
|
|
9
|
+
|
|
10
|
+
// src/vscode-cli.ts
|
|
11
|
+
init_esm_shims();
|
|
12
|
+
import minimist from "minimist";
|
|
13
|
+
var argv = minimist(process.argv.slice(2), {
|
|
14
|
+
alias: { h: "help", "copilot-memory": ["copilotMemory", "cm"] }
|
|
15
|
+
});
|
|
16
|
+
function printHelp() {
|
|
17
|
+
console.log(`
|
|
18
|
+
Usage: vscode-cli <command> [options]
|
|
19
|
+
|
|
20
|
+
Commands:
|
|
21
|
+
list project List all workspace projects
|
|
22
|
+
list project --copilot-memory
|
|
23
|
+
List only projects with Copilot memory tool directories
|
|
24
|
+
|
|
25
|
+
Options:
|
|
26
|
+
-h, --help Show this help message
|
|
27
|
+
--copilot-memory Filter to projects with Copilot memory tool
|
|
28
|
+
`);
|
|
29
|
+
}
|
|
30
|
+
async function main() {
|
|
31
|
+
if (argv.help || argv._.length === 0) {
|
|
32
|
+
printHelp();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const command = argv._[0];
|
|
36
|
+
if (command === "list") {
|
|
37
|
+
const sub = argv._[1];
|
|
38
|
+
if (sub === "project") {
|
|
39
|
+
const all = await listWorkspaceProjects();
|
|
40
|
+
let projects = all;
|
|
41
|
+
if (argv["copilot-memory"]) {
|
|
42
|
+
projects = all.filter((p) => p.copilotMemoryDir);
|
|
43
|
+
}
|
|
44
|
+
console.log(`Projects (${projects.length}):
|
|
45
|
+
`);
|
|
46
|
+
if (!projects.length) return;
|
|
47
|
+
const rows = projects.map((p) => ({
|
|
48
|
+
id: p.storageId.slice(0, 8),
|
|
49
|
+
folder: p.folder,
|
|
50
|
+
hasMemory: p.copilotMemoryDir ? "yes" : ""
|
|
51
|
+
}));
|
|
52
|
+
const idWidth = Math.max(2, ...rows.map((r) => r.id.length));
|
|
53
|
+
const folderWidth = Math.max(6, ...rows.map((r) => r.folder.length));
|
|
54
|
+
const sep = "\u2500".repeat(idWidth + folderWidth + 12);
|
|
55
|
+
console.log(` ${"ID".padEnd(idWidth)} ${"Folder".padEnd(folderWidth)} Memory`);
|
|
56
|
+
console.log(` ${sep}`);
|
|
57
|
+
for (const r of rows) {
|
|
58
|
+
console.log(` ${r.id.padEnd(idWidth)} ${r.folder.padEnd(folderWidth)} ${r.hasMemory}`);
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
console.error(`Unknown subcommand: list ${sub || ""}`);
|
|
62
|
+
printHelp();
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
} else {
|
|
66
|
+
console.error(`Unknown command: ${command}`);
|
|
67
|
+
printHelp();
|
|
68
|
+
process.exit(1);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
main();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "binary-collections",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.15",
|
|
4
4
|
"description": "Utility to clean any programming caches and more",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cache",
|
|
@@ -34,12 +34,13 @@
|
|
|
34
34
|
},
|
|
35
35
|
"types": "lib/index.d.ts",
|
|
36
36
|
"files": [
|
|
37
|
-
"binaries",
|
|
38
|
-
"lib",
|
|
39
|
-
"docs-src",
|
|
37
|
+
"binaries/**/*",
|
|
38
|
+
"lib/**/*",
|
|
39
|
+
"docs-src/*.md",
|
|
40
40
|
"readme.md",
|
|
41
41
|
".puppeterrc.cjs",
|
|
42
|
-
"requirements.txt"
|
|
42
|
+
"requirements.txt",
|
|
43
|
+
".github/**/*"
|
|
43
44
|
],
|
|
44
45
|
"scripts": {
|
|
45
46
|
"build": "tsc -b tsconfig.build.json && npm run build-tsup && npm run build-exports",
|
|
@@ -51,13 +52,16 @@
|
|
|
51
52
|
"pack": "node package.cjs --yarn --filename=bin",
|
|
52
53
|
"prepare": "husky",
|
|
53
54
|
"puppeteer:browser": "npx -y puppeteer browsers install chrome",
|
|
54
|
-
"test": "
|
|
55
|
+
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand --forceExit --testTimeout=120000 --detectOpenHandles",
|
|
55
56
|
"test-coverage": "npm test --coverage --detectOpenHandles",
|
|
56
57
|
"test-esm": "test-esm",
|
|
57
58
|
"test-nrs": "npm test -- nrs build-**",
|
|
58
59
|
"test-watch": "npm test --watch",
|
|
59
60
|
"update:ncu": "npx npm-check-updates -u --enginesNode --root -x jest -x @types/jest -x babel-jest -x @babel/core -x @babel/preset-env -x @babel/preset-typescript -x ts-jest -x eslint -x @eslint/eslintrc -x @eslint/js -x @typescript-eslint/eslint-plugin -x @typescript-eslint/parser -x eslint-config-prettier -x eslint-plugin-prettier -x typescript-eslint -x prettier -x typescript -x ts-node -x @yarnpkg/core",
|
|
60
|
-
"update:packer": "curl -L https://github.com/dimaslanjaka/nodejs-package-types/raw/main/packer.js > packer.cjs"
|
|
61
|
+
"update:packer": "curl -L https://github.com/dimaslanjaka/nodejs-package-types/raw/main/packer.js > packer.cjs",
|
|
62
|
+
"serve": "php -S 0.0.0.0:8490",
|
|
63
|
+
"upload": "node scripts/upload-backend.mjs",
|
|
64
|
+
"mkdocs-serve": "mkdocs serve -a \"0.0.0.0:5173\" --livereload"
|
|
61
65
|
},
|
|
62
66
|
"repository": {
|
|
63
67
|
"type": "git",
|
|
@@ -67,6 +71,8 @@
|
|
|
67
71
|
"@yarnpkg/core": "^4.7.0",
|
|
68
72
|
"ansi-colors": "^4.1.3",
|
|
69
73
|
"axios": "^1.16.1",
|
|
74
|
+
"better-sqlite3": "^12.10.0",
|
|
75
|
+
"cosmiconfig": "^9.0.1",
|
|
70
76
|
"cross-spawn": "https://github.com/dimaslanjaka/node-cross-spawn/raw/78b09a1f799430fb251c1b438ec56ce7957674f4/release/cross-spawn.tgz",
|
|
71
77
|
"crypto-js": "^4.2.0",
|
|
72
78
|
"dotenv": "^17.4.2",
|
|
@@ -75,6 +81,8 @@
|
|
|
75
81
|
"glob": "^13.0.6",
|
|
76
82
|
"minimatch": "^10.2.5",
|
|
77
83
|
"minimist": "^1.2.8",
|
|
84
|
+
"openai": "^6.41.0",
|
|
85
|
+
"proxy-agent": "^8.0.1",
|
|
78
86
|
"ps-node": "^0.1.6",
|
|
79
87
|
"puppeteer": "^25.0.4",
|
|
80
88
|
"puppeteer-extra": "^3.3.6",
|
|
@@ -84,21 +92,23 @@
|
|
|
84
92
|
"upath": "^3.0.7",
|
|
85
93
|
"which": "^7.0.0",
|
|
86
94
|
"yaml": "^2.9.0",
|
|
87
|
-
"yarn": "^1.22.22"
|
|
88
|
-
"zlib": "^1.0.5"
|
|
95
|
+
"yarn": "^1.22.22"
|
|
89
96
|
},
|
|
90
97
|
"devDependencies": {
|
|
91
98
|
"@babel/core": "^7.29.0",
|
|
92
99
|
"@babel/plugin-syntax-import-assertions": "^7.28.6",
|
|
93
100
|
"@babel/preset-env": "^7.29.2",
|
|
94
101
|
"@babel/preset-typescript": "^7.28.5",
|
|
95
|
-
"@dimaslanjaka/eslint-base-config": "^1.0.
|
|
102
|
+
"@dimaslanjaka/eslint-base-config": "^1.0.2",
|
|
103
|
+
"@rollup/plugin-alias": "^6.0.0",
|
|
96
104
|
"@rollup/plugin-babel": "^7.0.0",
|
|
97
|
-
"@rollup/plugin-commonjs": "^29.0.
|
|
105
|
+
"@rollup/plugin-commonjs": "^29.0.3",
|
|
98
106
|
"@rollup/plugin-json": "^6.1.0",
|
|
99
107
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
108
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
100
109
|
"@types/babel__core": "^7",
|
|
101
110
|
"@types/babel__preset-env": "^7",
|
|
111
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
102
112
|
"@types/crypto-js": "^4",
|
|
103
113
|
"@types/fs-extra": "^11",
|
|
104
114
|
"@types/jest": "^30.0.0",
|
|
@@ -115,10 +125,11 @@
|
|
|
115
125
|
"gulp": "^5.0.1",
|
|
116
126
|
"husky": "^9.1.7",
|
|
117
127
|
"jest": "^30.4.2",
|
|
118
|
-
"lint-staged": "^17.0.
|
|
128
|
+
"lint-staged": "^17.0.7",
|
|
119
129
|
"marked": "^18.0.4",
|
|
120
130
|
"rimraf": "^6.1.3",
|
|
121
|
-
"rollup": "^4.
|
|
131
|
+
"rollup": "^4.0.0",
|
|
132
|
+
"ssh2-sftp-client": "^12.1.1",
|
|
122
133
|
"ts-jest": "^29.4.9",
|
|
123
134
|
"ts-node": "^10.9.2",
|
|
124
135
|
"tsup": "^8.5.1",
|
|
@@ -134,12 +145,13 @@
|
|
|
134
145
|
"packageManager": "yarn@4.9.2",
|
|
135
146
|
"resolutions": {
|
|
136
147
|
"@types/through2": "https://github.com/dimaslanjaka/nodejs-package-types/raw/refs/heads/through2/release/types-through2.tgz",
|
|
137
|
-
"cross-spawn": "https://github.com/dimaslanjaka/node-cross-spawn/raw/
|
|
138
|
-
"git-command-helper": "https://github.com/dimaslanjaka/git-command-helper/raw/
|
|
148
|
+
"cross-spawn": "https://github.com/dimaslanjaka/node-cross-spawn/raw/eb82c8e0e60ce425fdf6e89cd53f4391bb8c77cd/release/cross-spawn.tgz",
|
|
149
|
+
"git-command-helper": "https://github.com/dimaslanjaka/git-command-helper/raw/7a28dad83c17abfc4b6ccd2b7327c39ff67adfe5/release/git-command-helper.tgz",
|
|
139
150
|
"sbg-utility": "https://github.com/dimaslanjaka/static-blog-generator/raw/44e5c7b79b4e60f8c2d34857c27b8ce677d7493e/packages/sbg-utility/release/sbg-utility.tgz",
|
|
140
|
-
"@dimaslanjaka/eslint-base-config": "https://github.com/dimaslanjaka/eslint-base-config/raw/
|
|
151
|
+
"@dimaslanjaka/eslint-base-config": "https://github.com/dimaslanjaka/eslint-base-config/raw/822b872f18985462f0da358579cd6493472a2ee0/release/dimaslanjaka-eslint-base-config.tgz"
|
|
141
152
|
},
|
|
142
153
|
"bin": {
|
|
154
|
+
"actions-badge": "lib/github-workflows/workflow-badge-cli.cjs",
|
|
143
155
|
"binary-collections": "lib/binary-collections.cjs",
|
|
144
156
|
"binary-executor": "binaries/binary-executor.cjs",
|
|
145
157
|
"build-package": "lib/node-package-packer-cli.cjs",
|
|
@@ -147,13 +159,14 @@
|
|
|
147
159
|
"build-tarball": "lib/node-package-packer-cli.cjs",
|
|
148
160
|
"changelog": "lib/changelog.cjs",
|
|
149
161
|
"chatgpt": "lib/free-chatgpt.cjs",
|
|
150
|
-
"clean-github-actions-cache": "lib/clean-github-actions-caches-cli.cjs",
|
|
151
|
-
"clean-github-actions-caches": "lib/clean-github-actions-caches-cli.cjs",
|
|
162
|
+
"clean-github-actions-cache": "lib/github-workflows/clean-github-actions-caches-cli.cjs",
|
|
163
|
+
"clean-github-actions-caches": "lib/github-workflows/clean-github-actions-caches-cli.cjs",
|
|
152
164
|
"clean-nodemodule": "binaries/clean-nodemodule.cjs",
|
|
153
165
|
"clean-nodemodules": "binaries/clean-nodemodules.cjs",
|
|
154
|
-
"clear-gh-caches": "lib/clean-github-actions-caches-cli.cjs",
|
|
155
|
-
"clear-github-actions-cache": "lib/clean-github-actions-caches-cli.cjs",
|
|
156
|
-
"clear-github-actions-caches": "lib/clean-github-actions-caches-cli.cjs",
|
|
166
|
+
"clear-gh-caches": "lib/github-workflows/clean-github-actions-caches-cli.cjs",
|
|
167
|
+
"clear-github-actions-cache": "lib/github-workflows/clean-github-actions-caches-cli.cjs",
|
|
168
|
+
"clear-github-actions-caches": "lib/github-workflows/clean-github-actions-caches-cli.cjs",
|
|
169
|
+
"composer": "binaries/composer.cjs",
|
|
157
170
|
"copy": "lib/file/copy-cli.cjs",
|
|
158
171
|
"copy-file": "lib/file/copy-cli.cjs",
|
|
159
172
|
"del-gradle": "lib/del-gradle.cjs",
|
|
@@ -174,15 +187,20 @@
|
|
|
174
187
|
"file-downloader": "lib/downloader-cli.cjs",
|
|
175
188
|
"find-node-modules": "lib/find-node-modules-cli.cjs",
|
|
176
189
|
"free-chatgpt": "lib/free-chatgpt.cjs",
|
|
177
|
-
"
|
|
178
|
-
"
|
|
179
|
-
"
|
|
190
|
+
"generate-test-ci": "src/github-workflows/generate-test-ci-step-cli.mjs",
|
|
191
|
+
"get-latest-workflow": "lib/github-workflows/get-latest-workflow-status-cli.cjs",
|
|
192
|
+
"get-latest-workflow-status": "lib/github-workflows/get-latest-workflow-status-cli.cjs",
|
|
193
|
+
"gh-status-badge": "lib/github-workflows/workflow-badge-cli.cjs",
|
|
194
|
+
"git-diff": "lib/git/git-diff-cli.cjs",
|
|
195
|
+
"git-fix": "lib/git/git-fix.cjs",
|
|
196
|
+
"git-purge": "lib/git/git-purge.cjs",
|
|
180
197
|
"git-reduce-size": "binaries/git-reduce-size.cjs",
|
|
181
198
|
"git-undo-commit": "lib/git/undo-commit.cjs",
|
|
182
199
|
"git-undo-staged": "lib/git/undo-staged.cjs",
|
|
183
200
|
"javakill": "binaries/javakill.cjs",
|
|
184
201
|
"kill-night-crows": "lib/kill-night-crows.cjs",
|
|
185
202
|
"kill-process": "binaries/kill-process.cjs",
|
|
203
|
+
"latest-workflow": "lib/github-workflows/get-latest-workflow-status-cli.cjs",
|
|
186
204
|
"move": "lib/file/move-cli.cjs",
|
|
187
205
|
"move-file": "lib/file/move-cli.cjs",
|
|
188
206
|
"node-cache-cleaner": "lib/node-cache-cleaner-cli.cjs",
|
|
@@ -194,6 +212,8 @@
|
|
|
194
212
|
"nodekill": "binaries/nodekill.cjs",
|
|
195
213
|
"npm-run-series": "lib/npm-run-series.cjs",
|
|
196
214
|
"nrs": "lib/npm-run-series.cjs",
|
|
215
|
+
"opc": "lib/opencode-cli.cjs",
|
|
216
|
+
"opencode-cli": "lib/opencode-cli.cjs",
|
|
197
217
|
"pack-node-package": "lib/node-package-packer-cli.cjs",
|
|
198
218
|
"pack-tarball": "lib/node-package-packer-cli.cjs",
|
|
199
219
|
"package-resolutions-updater": "lib/package-resolutions-updater-cli.cjs",
|
|
@@ -201,7 +221,7 @@
|
|
|
201
221
|
"pkg-res-updater": "lib/package-resolutions-updater-cli.cjs",
|
|
202
222
|
"pkg-resolutions-updater": "lib/package-resolutions-updater-cli.cjs",
|
|
203
223
|
"print-directory-tree": "lib/print-directory-tree.cjs",
|
|
204
|
-
"print-tarball-tree": "lib/print-tarball-tree.cjs",
|
|
224
|
+
"print-tarball-tree": "lib/print-tarball-tree-cli.cjs",
|
|
205
225
|
"print-tree": "lib/print-directory-tree.cjs",
|
|
206
226
|
"prod": "binaries/prod.cjs",
|
|
207
227
|
"py": "binaries/py.cjs",
|
|
@@ -222,12 +242,16 @@
|
|
|
222
242
|
"submodule-remove": "lib/submodule-remove-cli.cjs",
|
|
223
243
|
"submodule-token": "binaries/submodule-token.cjs",
|
|
224
244
|
"tarball-packer": "lib/node-package-packer-cli.cjs",
|
|
225
|
-
"tarball-tree": "lib/print-tarball-tree.cjs",
|
|
245
|
+
"tarball-tree": "lib/print-tarball-tree-cli.cjs",
|
|
226
246
|
"test-cjs": "binaries/test-cjs.cjs",
|
|
227
247
|
"test-esm": "binaries/test-esm.cjs",
|
|
228
248
|
"undo-commit": "lib/git/undo-commit.cjs",
|
|
229
249
|
"undo-last-commit": "lib/git/undo-commit.cjs",
|
|
230
250
|
"undo-staged": "lib/git/undo-staged.cjs",
|
|
251
|
+
"vscode-cli": "lib/vscode-cli.cjs",
|
|
252
|
+
"wf-badge": "lib/github-workflows/workflow-badge-cli.cjs",
|
|
253
|
+
"wf-status": "lib/github-workflows/get-latest-workflow-status-cli.cjs",
|
|
254
|
+
"workflow-badge": "lib/github-workflows/workflow-badge-cli.cjs",
|
|
231
255
|
"y-install": "lib/yarn-per-branch-lock-installer.cjs",
|
|
232
256
|
"yarn-clean": "binaries/yarn-clean.cjs",
|
|
233
257
|
"yarn-install": "lib/yarn-per-branch-lock-installer.cjs",
|
package/readme.md
CHANGED
|
@@ -1,8 +1,29 @@
|
|
|
1
1
|
# 🚀 Binary Collections
|
|
2
2
|
|
|
3
|
+
<details>
|
|
4
|
+
<summary>Build Release CI</summary>
|
|
5
|
+
|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
</details>
|
|
9
|
+
|
|
10
|
+
<details>
|
|
11
|
+
<summary>Pages CI</summary>
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
</details>
|
|
16
|
+
|
|
17
|
+
<details>
|
|
18
|
+
<summary>Test CI</summary>
|
|
19
|
+
|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
3
24
|
A comprehensive toolkit of Node.js CLI utilities designed to streamline everyday development workflows.
|
|
4
25
|
|
|
5
|
-
It provides fast, lightweight commands for common tasks like git operations, dependency management, submodule handling, and running npm scripts in sequence or parallel—helping you reduce repetitive work and improve terminal productivity.
|
|
26
|
+
It provides fast, lightweight commands for common tasks like git operations, dependency management, submodule handling, conditional execution, CI workflow generation, and running npm scripts in sequence or parallel—helping you reduce repetitive work and improve terminal productivity.
|
|
6
27
|
|
|
7
28
|
## ✨ Features
|
|
8
29
|
|
|
@@ -15,14 +36,23 @@ It provides fast, lightweight commands for common tasks like git operations, dep
|
|
|
15
36
|
* 🔁 **Task Orchestration**
|
|
16
37
|
Run npm scripts sequentially or in parallel with improved control and execution clarity.
|
|
17
38
|
|
|
39
|
+
* 🔐 **Conditional Execution**
|
|
40
|
+
Run commands only when file contents change — uses SHA-256 checksums to detect modifications and skip unnecessary re-executions.
|
|
41
|
+
|
|
18
42
|
* 📁 **Repository & Submodule Automation**
|
|
19
43
|
Simplify initialization, syncing, and maintenance of Git submodules and multi-repository setups.
|
|
20
44
|
|
|
21
45
|
* 📦 **Build & Package Utilities**
|
|
22
|
-
Enhance NPM workflows with improved script execution, dependency handling, and
|
|
46
|
+
Enhance NPM workflows with improved script execution, dependency handling, resolution helpers, and automatic tarball packaging.
|
|
23
47
|
|
|
24
48
|
* 🛠️ **Development Helpers**
|
|
25
|
-
General-purpose utilities for process management, environment setup,
|
|
49
|
+
General-purpose utilities for process management, environment setup, file system operations, downloads, and archive inspection.
|
|
50
|
+
|
|
51
|
+
* 🤖 **AI & IDE Tooling**
|
|
52
|
+
Inspect and manage OpenCode databases, browse VS Code workspace storage, and list Copilot memory tool directories.
|
|
53
|
+
|
|
54
|
+
* 🔄 **CI/CD Automation**
|
|
55
|
+
Generate GitHub Actions workflow YAML from test file detection, query latest workflow run status, generate live SVG status badges, and clean up stale action caches automatically.
|
|
26
56
|
|
|
27
57
|
* 🚀 **Performance-Focused CLI Design**
|
|
28
58
|
Lightweight, fast-executing commands designed to reduce friction and speed up everyday development tasks.
|
|
@@ -61,6 +91,69 @@ For development or manual setup.
|
|
|
61
91
|
git clone -b master https://github.com/dimaslanjaka/bin bin
|
|
62
92
|
```
|
|
63
93
|
|
|
94
|
+
## Configuration
|
|
95
|
+
|
|
96
|
+
Binary Collections supports project-level configuration via a `binary-collections.config` file in your project root. Only the name `binary-collections.config` is supported — no `.rc`, JSON, or YAML variants.
|
|
97
|
+
|
|
98
|
+
### Supported Extensions
|
|
99
|
+
|
|
100
|
+
| Extension | Module System |
|
|
101
|
+
|-----------|---------------|
|
|
102
|
+
| `.js` | ESM (project must have `"type": "module"` in `package.json`) |
|
|
103
|
+
| `.cjs` | CommonJS (always works) |
|
|
104
|
+
| `.mjs` | ESM (always works) |
|
|
105
|
+
|
|
106
|
+
### Boilerplate Config
|
|
107
|
+
|
|
108
|
+
A ready-to-use example is provided in the project root:
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
binary-collections.config-example.js
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Copy and rename it to start configuring:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
cp binary-collections.config-example.js binary-collections.config.js
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Example — CJS Config (`binary-collections.config.cjs`)
|
|
121
|
+
|
|
122
|
+
```js
|
|
123
|
+
module.exports = {
|
|
124
|
+
tempDir: './.my-cache'
|
|
125
|
+
};
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Example — ESM Config (`binary-collections.config.mjs`)
|
|
129
|
+
|
|
130
|
+
```js
|
|
131
|
+
export default {
|
|
132
|
+
tempDir: './.my-cache'
|
|
133
|
+
};
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Example — `package.json`
|
|
137
|
+
|
|
138
|
+
Add a `binary-collections` property to your `package.json`:
|
|
139
|
+
|
|
140
|
+
```json
|
|
141
|
+
{
|
|
142
|
+
"name": "my-project",
|
|
143
|
+
"binary-collections": {
|
|
144
|
+
"tempDir": "./.my-cache"
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Configurable Properties
|
|
150
|
+
|
|
151
|
+
| Property | Type | Description |
|
|
152
|
+
|----------|------|-------------|
|
|
153
|
+
| `tempDir` | `string` | Base directory for temporary files |
|
|
154
|
+
| `githubToken` | `string` | GitHub API token override |
|
|
155
|
+
| `opencode.keys` | `Array<{name, key}>` | OpenCode API keys for `auth rotate` and other commands |
|
|
156
|
+
|
|
64
157
|
## VSCode Integration
|
|
65
158
|
|
|
66
159
|
To make these tools available directly in your VSCode terminal, create or update `.vscode/settings.json`:
|
|
@@ -136,16 +229,19 @@ binary-collections list
|
|
|
136
229
|
|
|
137
230
|
| Category | Commands | Description | Docs |
|
|
138
231
|
|---|---|---|---|
|
|
139
|
-
| **Git** | `git-purge`, `git-diff`, `git-fix`, `git-reduce-size`, `git-undo` | Git repository management and optimization | [`git-purge.md`](./docs-src/git-purge.md), [`git-diff.md`](./docs-src/git-diff.md), [`git-fix.md`](./docs-src/git-fix.md), [`git-reduce-size.md`](./docs-src/git-reduce-size.md), [`git-undo.md`](./docs-src/git-undo.md) |
|
|
140
|
-
| **Submodules** | `submodule
|
|
232
|
+
| **Git** | `git-purge`, `git-diff`, `git-fix`, `git-reduce-size`, `git-undo-commit`, `git-undo-staged` | Git repository management, diff enhancements, undo helpers, and optimization | [`git-purge.md`](./docs-src/git-purge.md), [`git-diff.md`](./docs-src/git-diff.md), [`git-fix.md`](./docs-src/git-fix.md), [`git-reduce-size.md`](./docs-src/git-reduce-size.md), [`git-undo.md`](./docs-src/git-undo.md) |
|
|
233
|
+
| **Submodules** | `submodule-install`, `submodule-remove`, `submodule-token` | Git submodule operations with authentication token injection | [`submodule-install.md`](./docs-src/submodule-install.md), [`submodule-remove.md`](./docs-src/submodule-remove.md), [`submodule-token.md`](./docs-src/submodule-token.md) |
|
|
141
234
|
| **NPM Scripts** | `nrs`, `run-s`, `run-series`, `npm-run-series` | Run npm scripts in series with pattern matching | [`npm-run-series.md`](./docs-src/npm-run-series.md) |
|
|
235
|
+
| **Conditional Execution** | `run-by-checksum`, `run-checksum`, `run-c` | Run commands only when file checksums change (SHA-256 based) | [`run-by-checksum.md`](./docs-src/run-by-checksum.md) |
|
|
236
|
+
| **Build & Package** | `node-package-packer`, `tarball-packer`, `pack-tarball`, `build-tarball`, `build-package` | Automated tarball creation, release packaging, and metadata generation | [`node-package-packer.md`](./docs-src/node-package-packer.md) |
|
|
142
237
|
| **Package Mgmt** | `yarn-reinstall`, `pkg-resolutions-updater`, `pkg-res-updater`, `yarn-install`, `yarn-clean` | Yarn/package resolutions management utilities | [`yarn-reinstall.md`](./docs-src/yarn-reinstall.md), [`yarn-install.md`](./docs-src/yarn-install.md), [`node-cache-cleaner.md`](./docs-src/node-cache-cleaner.md), [`package-resolutions-updater.md`](./docs-src/package-resolutions-updater.md) |
|
|
143
238
|
| **Node.js Dev** | `find-node-modules`, `find-nodemodules`, `dev`, `prod`, `empty`, `node-cache-cleaner`, `node-executor`, `py` | Node.js development helpers | [`find-node-modules.md`](./docs-src/find-node-modules.md), [`env-helpers.md`](./docs-src/env-helpers.md), [`node-cache-cleaner.md`](./docs-src/node-cache-cleaner.md), [`node-executor.md`](./docs-src/node-executor.md), [`py.md`](./docs-src/py.md) |
|
|
144
239
|
| **Process Mgmt** | `kill-process`, `nodekill`, `javakill`, `del-ps`, `kill-night-crows` | Process management and termination | [`del-ps.md`](./docs-src/del-ps.md), [`kill-night-crows.md`](./docs-src/kill-night-crows.md) |
|
|
145
|
-
| **File System** | `rmfind`, `
|
|
240
|
+
| **File System** | `rmfind`, `rmx`, `rmpath`, `print-tree`, `dir-tree`, `copy`, `move`, `remove-module`, `downloader`, `download`, `fetch-file`, `print-tarball-tree`, `tarball-tree` | File system operations, URL downloads, archive tree inspection | [`copy-move-file.md`](./docs-src/copy-move-file.md), [`rmpath.md`](./docs-src/rmpath.md), [`rmfind-rmx.md`](./docs-src/rmfind-rmx.md), [`print-directory-tree.md`](./docs-src/print-directory-tree.md), [`remove-module.md`](./docs-src/remove-module.md), [`downloader.md`](./docs-src/downloader.md), [`print-tarball-tree.md`](./docs-src/print-tarball-tree.md) |
|
|
146
241
|
| **Cleanup** | `del-nodemodules`, `del-yarncaches`, `del-gradle`, `del-yarn-caches`, `yarn-clean` | Cache and build directory cleanup | [`node-cache-cleaner.md`](./docs-src/node-cache-cleaner.md), [`del-gradle.md`](./docs-src/del-gradle.md) |
|
|
147
|
-
| **GitHub Actions** | `clean-github-actions-caches`, `
|
|
148
|
-
| **
|
|
242
|
+
| **CI/GitHub Actions** | `clean-github-actions-caches`, `clear-gh-caches`, `generate-test-ci`, `get-latest-workflow-status`, `get-latest-workflow`, `latest-workflow`, `wf-status`, `workflow-badge`, `wf-badge`, `gh-status-badge`, `actions-badge` | GitHub Actions cache cleanup, automated CI workflow generation, workflow status inspection, and live SVG badge generation | [`clean-github-actions-caches.md`](./docs-src/clean-github-actions-caches.md), [`generate-test-ci.md`](./docs-src/generate-test-ci.md), [`get-latest-workflow-status.md`](./docs-src/get-latest-workflow-status.md), [`workflow-badge.md`](./docs-src/workflow-badge.md) |
|
|
243
|
+
| **AI & IDE Tooling** | `opc`, `opencode-cli`, `vscode-cli` | OpenCode database management (list/delete sessions and projects) and VS Code workspace inspection with Copilot memory detection | [`opencode-cli.md`](./docs-src/opencode-cli.md), [`vscode-cli.md`](./docs-src/vscode-cli.md) |
|
|
244
|
+
| **Other** | `binary-collections`, `changelog`, `php-cs-fixer-staged`, `free-chatgpt`, `test-runners` | Main dispatcher, changelog generation, PHP CS fixer for staged files, ChatGPT client, and Jest runners for CJS/ESM | [`binary-collections.md`](./docs-src/binary-collections.md), [`changelog.md`](./docs-src/changelog.md), [`php-cs-fixer-staged.md`](./docs-src/php-cs-fixer-staged.md), [`free-chatgpt.md`](./docs-src/free-chatgpt.md), [`test-runners.md`](./docs-src/test-runners.md) |
|
|
149
245
|
|
|
150
246
|
---
|
|
151
247
|
|
package/releases/readme.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
## Releases
|
|
3
3
|
| version | tarball url |
|
|
4
4
|
| :--- | :--- |
|
|
5
|
-
| latest | https://github.com/dimaslanjaka/bin/raw/
|
|
5
|
+
| latest | https://github.com/dimaslanjaka/bin/raw/53834fc/releases/bin.tgz |
|
|
6
6
|
| latest | https://github.com/dimaslanjaka/bin/raw/master/releases/bin.tgz |
|
|
7
7
|
|
|
8
8
|
use this tarball with `resolutions`:
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from 'fs-extra';
|
|
3
|
+
import path from 'upath';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import yaml from 'yaml';
|
|
6
|
+
import { execSync } from 'child_process';
|
|
7
|
+
import { glob } from 'glob';
|
|
8
|
+
import minimist from 'minimist';
|
|
9
|
+
import actionObject from './workflow-test-data.cjs';
|
|
10
|
+
|
|
11
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
12
|
+
const __dirname = path.dirname(__filename);
|
|
13
|
+
|
|
14
|
+
let actionFile = path.resolve(process.cwd(), '.github/workflows/test.yml');
|
|
15
|
+
|
|
16
|
+
const DEFAULT_PATTERNS = [
|
|
17
|
+
'test/**/*.test.{js,cjs,mjs,ts}',
|
|
18
|
+
'test/**/*.spec.{js,cjs,mjs,ts}',
|
|
19
|
+
'tests/**/*.test.{js,cjs,mjs,ts}',
|
|
20
|
+
'tests/**/*.spec.{js,cjs,mjs,ts}'
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
function showHelp() {
|
|
24
|
+
console.log(`\
|
|
25
|
+
Usage: generate-test-ci-step.mjs [options]
|
|
26
|
+
|
|
27
|
+
Options:
|
|
28
|
+
-p, --pattern <glob> Test file patterns to search for (can be specified multiple times)
|
|
29
|
+
--ignore, --ex <glob> Ignore patterns to exclude from results (can be specified multiple times)
|
|
30
|
+
-o, --output <file> Output YAML file path (default: .github/workflows/test.yml)
|
|
31
|
+
-h, --help Show this help message
|
|
32
|
+
|
|
33
|
+
Examples:
|
|
34
|
+
$ node src/github-workflows/generate-test-ci-step.mjs
|
|
35
|
+
$ node src/github-workflows/generate-test-ci-step.mjs -p "test/**/*.test.js"
|
|
36
|
+
$ node src/github-workflows/generate-test-ci-step.mjs --pattern "test/**/*.test.js" --ignore "**/fixtures/**"
|
|
37
|
+
$ node src/github-workflows/generate-test-ci-step.mjs -o .github/workflows/ci.yml -p "src/**/*.test.ts" --ignore "**/node_modules/**"
|
|
38
|
+
`);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async function collectTests(patterns, ignorePatterns) {
|
|
42
|
+
const entries = await glob(patterns, {
|
|
43
|
+
onlyFiles: true,
|
|
44
|
+
cwd: process.cwd(),
|
|
45
|
+
ignore: ignorePatterns
|
|
46
|
+
});
|
|
47
|
+
return entries.map((p) => p.replace(/\\/g, '/')).sort();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async function main() {
|
|
51
|
+
const argv = minimist(process.argv.slice(2), {
|
|
52
|
+
string: ['pattern', 'ignore', 'ex', 'output'],
|
|
53
|
+
alias: {
|
|
54
|
+
p: 'pattern',
|
|
55
|
+
o: 'output',
|
|
56
|
+
h: 'help'
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// Merge --ex into --ignore so both flags work
|
|
61
|
+
if (argv.ex) {
|
|
62
|
+
const exList = Array.isArray(argv.ex) ? argv.ex : [argv.ex];
|
|
63
|
+
argv.ignore = argv.ignore ? [].concat(argv.ignore).concat(exList) : exList;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (argv.help) {
|
|
67
|
+
showHelp();
|
|
68
|
+
process.exit(0);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (argv.output) {
|
|
72
|
+
actionFile = path.resolve(process.cwd(), argv.output);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const patterns = argv.pattern ? (Array.isArray(argv.pattern) ? argv.pattern : [argv.pattern]) : DEFAULT_PATTERNS;
|
|
76
|
+
|
|
77
|
+
const ignorePatterns = argv.ignore ? (Array.isArray(argv.ignore) ? argv.ignore : [argv.ignore]) : [];
|
|
78
|
+
|
|
79
|
+
const files = await collectTests(patterns, ignorePatterns);
|
|
80
|
+
for (const file of files) {
|
|
81
|
+
const ext = (path.extname(file) || '').toLowerCase();
|
|
82
|
+
const filename = path.basename(file);
|
|
83
|
+
let runCmd;
|
|
84
|
+
if (ext === '.mjs') {
|
|
85
|
+
runCmd = `if [ -f "${file}" ]; then\n bash bin/test-esm --testPathPatterns="${filename}"\nelse\n echo "Skipping missing test file: ${file}"\nfi`;
|
|
86
|
+
} else if (ext === '.cjs') {
|
|
87
|
+
runCmd = `if [ -f "${file}" ]; then\n bash bin/test-cjs --testPathPatterns="${filename}"\nelse\n echo "Skipping missing test file: ${file}"\nfi`;
|
|
88
|
+
} else if (ext === '.ts') {
|
|
89
|
+
runCmd = `if [ -f "${file}" ]; then\n node node_modules/jest/bin/jest.js --runInBand --forceExit --testTimeout=120000 --detectOpenHandles --testPathPatterns="${filename}"\nelse\n echo "Skipping missing test file: ${file}"\nfi`;
|
|
90
|
+
} else {
|
|
91
|
+
runCmd = `if [ -f "${file}" ]; then\n npm test -- --testPathPatterns="${filename}"\nelse\n echo "Skipping missing test file: ${file}"\nfi`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Skip files that are not tracked by git (untracked files shouldn't be included in committed actions)
|
|
95
|
+
try {
|
|
96
|
+
execSync(`git ls-files --error-unmatch -- "${file}"`, { cwd: process.cwd(), stdio: 'ignore' });
|
|
97
|
+
} catch {
|
|
98
|
+
console.warn(`Skipping untracked test file: ${file}`);
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const rawId = file;
|
|
103
|
+
let safeId = rawId.replace(/[^A-Za-z0-9_-]+/g, '-');
|
|
104
|
+
if (!/^[A-Za-z_]/.test(safeId)) safeId = `_${safeId}`;
|
|
105
|
+
safeId = (safeId.slice(0, 90) || `test-${Math.random().toString(36).slice(2, 8)}`).replace(/-(test|spec)$/, '');
|
|
106
|
+
|
|
107
|
+
actionObject.jobs.ci.steps.push({
|
|
108
|
+
name: `🧪 Run tests in ${file}`,
|
|
109
|
+
id: `run-${safeId}`,
|
|
110
|
+
shell: 'bash',
|
|
111
|
+
run: runCmd
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const yamlContent = yaml.stringify(actionObject);
|
|
116
|
+
fs.ensureDirSync(path.dirname(actionFile));
|
|
117
|
+
fs.writeFileSync(actionFile, yamlContent, 'utf-8');
|
|
118
|
+
try {
|
|
119
|
+
execSync(`npx -y prettier@latest -w "${actionFile}"`, { stdio: 'inherit', cwd: process.cwd() });
|
|
120
|
+
} catch {
|
|
121
|
+
// prettier is optional — skip formatting if unavailable
|
|
122
|
+
}
|
|
123
|
+
console.log(`Generated ${actionFile} with ${files.length} test steps.`);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
main();
|