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
|
@@ -38,6 +38,173 @@ var init_cjs_shims = __esm({
|
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
+
// src/utils/findEnvFiles.cjs
|
|
42
|
+
var require_findEnvFiles = __commonJS({
|
|
43
|
+
"src/utils/findEnvFiles.cjs"(exports2, module2) {
|
|
44
|
+
init_cjs_shims();
|
|
45
|
+
var fs2 = require("fs");
|
|
46
|
+
var path2 = require("path");
|
|
47
|
+
var glob = require("glob");
|
|
48
|
+
var DEFAULT_IGNORES = [
|
|
49
|
+
"**/node_modules/**",
|
|
50
|
+
"**/.git/**",
|
|
51
|
+
"**/.yarn/**",
|
|
52
|
+
"**/.pnpm/**",
|
|
53
|
+
"**/dist/**",
|
|
54
|
+
"**/build/**",
|
|
55
|
+
"**/coverage/**",
|
|
56
|
+
"**/vendor/**",
|
|
57
|
+
"**/tmp/**",
|
|
58
|
+
"**/.cache/**",
|
|
59
|
+
"**/assets/**",
|
|
60
|
+
"**/logs/**",
|
|
61
|
+
"**/output/**",
|
|
62
|
+
"**/public/**",
|
|
63
|
+
"**/static/**",
|
|
64
|
+
"**/temp/**",
|
|
65
|
+
"**/backup/**",
|
|
66
|
+
"**/backups/**",
|
|
67
|
+
"**/examples/**",
|
|
68
|
+
"**/docs/**",
|
|
69
|
+
"**/tests/**",
|
|
70
|
+
"**/__tests__/**",
|
|
71
|
+
"**/spec/**",
|
|
72
|
+
"**/__specs__/**",
|
|
73
|
+
"**/scripts/**",
|
|
74
|
+
"**/bin/**",
|
|
75
|
+
"**/hooks/**",
|
|
76
|
+
"**/config/**",
|
|
77
|
+
"**/configs/**",
|
|
78
|
+
"**/settings/**",
|
|
79
|
+
"**/.vscode/**",
|
|
80
|
+
"**/.idea/**"
|
|
81
|
+
];
|
|
82
|
+
function findEnvFiles(startDir = process.cwd(), filter) {
|
|
83
|
+
const found = /* @__PURE__ */ new Set();
|
|
84
|
+
function addFile(file) {
|
|
85
|
+
const normalized = path2.normalize(file);
|
|
86
|
+
if (typeof filter === "function" && !filter(normalized)) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
found.add(normalized);
|
|
90
|
+
}
|
|
91
|
+
let current = path2.resolve(startDir);
|
|
92
|
+
while (true) {
|
|
93
|
+
const envPath = path2.join(current, ".env");
|
|
94
|
+
if (fs2.existsSync(envPath)) {
|
|
95
|
+
addFile(envPath);
|
|
96
|
+
}
|
|
97
|
+
const parent = path2.dirname(current);
|
|
98
|
+
if (parent === current) {
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
current = parent;
|
|
102
|
+
}
|
|
103
|
+
const files = glob.globSync("**/.env*", {
|
|
104
|
+
cwd: startDir,
|
|
105
|
+
absolute: true,
|
|
106
|
+
nodir: true,
|
|
107
|
+
ignore: DEFAULT_IGNORES
|
|
108
|
+
});
|
|
109
|
+
for (const file of files) {
|
|
110
|
+
addFile(file);
|
|
111
|
+
}
|
|
112
|
+
return [...found];
|
|
113
|
+
}
|
|
114
|
+
function findEnvWithToken(startDir = process.cwd(), tokenName = "GITHUB_TOKEN") {
|
|
115
|
+
const envFiles = findEnvFiles(startDir);
|
|
116
|
+
return envFiles.find((file) => {
|
|
117
|
+
try {
|
|
118
|
+
const content = fs2.readFileSync(file, "utf-8");
|
|
119
|
+
if (tokenName instanceof RegExp) {
|
|
120
|
+
return tokenName.test(content);
|
|
121
|
+
}
|
|
122
|
+
const regex = new RegExp(`^\\s*${tokenName}\\s*=`, "m");
|
|
123
|
+
return regex.test(content);
|
|
124
|
+
} catch (err) {
|
|
125
|
+
console.warn(`Failed to read ${file}: ${err instanceof Error ? err.message : String(err)}`);
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
module2.exports = {
|
|
131
|
+
DEFAULT_IGNORES,
|
|
132
|
+
findEnvFiles,
|
|
133
|
+
findEnvWithToken,
|
|
134
|
+
default: findEnvFiles
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
// src/binary-collections/config.cjs
|
|
140
|
+
var require_config = __commonJS({
|
|
141
|
+
"src/binary-collections/config.cjs"(exports2, module2) {
|
|
142
|
+
init_cjs_shims();
|
|
143
|
+
var path2 = require("upath");
|
|
144
|
+
var minimistLib = require("minimist");
|
|
145
|
+
var { findEnvWithToken } = require_findEnvFiles();
|
|
146
|
+
var dotenv = require("dotenv");
|
|
147
|
+
var { cosmiconfig } = require("cosmiconfig");
|
|
148
|
+
var loadDotenv = (tokenKey = /ACCESS_TOKEN|GITHUB_TOKEN/) => dotenv.config({ path: findEnvWithToken(void 0, tokenKey), quiet: true, overwrite: true });
|
|
149
|
+
loadDotenv();
|
|
150
|
+
var cliArgv = minimistLib(process.argv.slice(2), {
|
|
151
|
+
string: ["token"]
|
|
152
|
+
});
|
|
153
|
+
var GITHUB_ACCESS_TOKEN = cliArgv.token || process.env.ACCESS_TOKEN || process.env.GITHUB_TOKEN || process.env.GH_TOKEN;
|
|
154
|
+
function getTempPath(...segments) {
|
|
155
|
+
return path2.join(process.env.TEMP_DIR || path2.join(process.cwd(), "tmp"), ...segments);
|
|
156
|
+
}
|
|
157
|
+
async function getConfig(options = {}) {
|
|
158
|
+
const explorer = cosmiconfig("binary-collections", {
|
|
159
|
+
searchStrategy: "project",
|
|
160
|
+
stopDir: options.stopDir
|
|
161
|
+
});
|
|
162
|
+
try {
|
|
163
|
+
const result = await explorer.search(options.searchFrom);
|
|
164
|
+
return result ? result.config : null;
|
|
165
|
+
} catch {
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
module2.exports = {
|
|
170
|
+
getTempPath,
|
|
171
|
+
GITHUB_ACCESS_TOKEN,
|
|
172
|
+
loadDotenv,
|
|
173
|
+
getConfig
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
// src/utils/fetchResponse.cjs
|
|
179
|
+
var require_fetchResponse = __commonJS({
|
|
180
|
+
"src/utils/fetchResponse.cjs"(exports2, module2) {
|
|
181
|
+
init_cjs_shims();
|
|
182
|
+
var axios = require("axios");
|
|
183
|
+
async function fetchResponse2(url, options = {}) {
|
|
184
|
+
var _a, _b, _c;
|
|
185
|
+
const response = await axios.get(url, {
|
|
186
|
+
maxRedirects: 5,
|
|
187
|
+
responseType: "arraybuffer",
|
|
188
|
+
validateStatus: () => true,
|
|
189
|
+
...options
|
|
190
|
+
});
|
|
191
|
+
const finalUrl = ((_b = (_a = response.request) == null ? void 0 : _a.res) == null ? void 0 : _b.responseUrl) ?? ((_c = response.request) == null ? void 0 : _c.responseURL) ?? url;
|
|
192
|
+
return {
|
|
193
|
+
finalUrl,
|
|
194
|
+
status: response.status,
|
|
195
|
+
statusText: response.statusText,
|
|
196
|
+
contentType: response.headers["content-type"],
|
|
197
|
+
contentLength: response.headers["content-length"],
|
|
198
|
+
dataLength: Buffer.isBuffer(response.data) ? response.data.length : void 0,
|
|
199
|
+
data: response.data
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
module2.exports = fetchResponse2;
|
|
203
|
+
module2.exports.fetchResponse = fetchResponse2;
|
|
204
|
+
module2.exports.default = fetchResponse2;
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
|
|
41
208
|
// src/utils/index.cjs
|
|
42
209
|
var require_utils = __commonJS({
|
|
43
210
|
"src/utils/index.cjs"(exports2, module2) {
|
|
@@ -205,131 +372,6 @@ var require_utils = __commonJS({
|
|
|
205
372
|
}
|
|
206
373
|
});
|
|
207
374
|
|
|
208
|
-
// src/utils/fetchResponse.cjs
|
|
209
|
-
var require_fetchResponse = __commonJS({
|
|
210
|
-
"src/utils/fetchResponse.cjs"(exports2, module2) {
|
|
211
|
-
init_cjs_shims();
|
|
212
|
-
var axios = require("axios");
|
|
213
|
-
async function fetchResponse2(url, options = {}) {
|
|
214
|
-
var _a, _b, _c;
|
|
215
|
-
const response = await axios.get(url, {
|
|
216
|
-
maxRedirects: 5,
|
|
217
|
-
responseType: "arraybuffer",
|
|
218
|
-
validateStatus: () => true,
|
|
219
|
-
...options
|
|
220
|
-
});
|
|
221
|
-
const finalUrl = ((_b = (_a = response.request) == null ? void 0 : _a.res) == null ? void 0 : _b.responseUrl) ?? ((_c = response.request) == null ? void 0 : _c.responseURL) ?? url;
|
|
222
|
-
return {
|
|
223
|
-
finalUrl,
|
|
224
|
-
status: response.status,
|
|
225
|
-
statusText: response.statusText,
|
|
226
|
-
contentType: response.headers["content-type"],
|
|
227
|
-
contentLength: response.headers["content-length"],
|
|
228
|
-
dataLength: Buffer.isBuffer(response.data) ? response.data.length : void 0,
|
|
229
|
-
data: response.data
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
module2.exports = fetchResponse2;
|
|
233
|
-
module2.exports.fetchResponse = fetchResponse2;
|
|
234
|
-
module2.exports.default = fetchResponse2;
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
|
-
|
|
238
|
-
// src/utils/findEnvFiles.cjs
|
|
239
|
-
var require_findEnvFiles = __commonJS({
|
|
240
|
-
"src/utils/findEnvFiles.cjs"(exports2, module2) {
|
|
241
|
-
init_cjs_shims();
|
|
242
|
-
var fs2 = require("fs");
|
|
243
|
-
var path2 = require("path");
|
|
244
|
-
var glob = require("glob");
|
|
245
|
-
var DEFAULT_IGNORES = [
|
|
246
|
-
"**/node_modules/**",
|
|
247
|
-
"**/.git/**",
|
|
248
|
-
"**/.yarn/**",
|
|
249
|
-
"**/.pnpm/**",
|
|
250
|
-
"**/dist/**",
|
|
251
|
-
"**/build/**",
|
|
252
|
-
"**/coverage/**",
|
|
253
|
-
"**/vendor/**",
|
|
254
|
-
"**/tmp/**",
|
|
255
|
-
"**/.cache/**",
|
|
256
|
-
"**/assets/**",
|
|
257
|
-
"**/logs/**",
|
|
258
|
-
"**/output/**",
|
|
259
|
-
"**/public/**",
|
|
260
|
-
"**/static/**",
|
|
261
|
-
"**/temp/**",
|
|
262
|
-
"**/backup/**",
|
|
263
|
-
"**/backups/**",
|
|
264
|
-
"**/examples/**",
|
|
265
|
-
"**/docs/**",
|
|
266
|
-
"**/tests/**",
|
|
267
|
-
"**/__tests__/**",
|
|
268
|
-
"**/spec/**",
|
|
269
|
-
"**/__specs__/**",
|
|
270
|
-
"**/scripts/**",
|
|
271
|
-
"**/bin/**",
|
|
272
|
-
"**/hooks/**",
|
|
273
|
-
"**/config/**",
|
|
274
|
-
"**/configs/**",
|
|
275
|
-
"**/settings/**",
|
|
276
|
-
"**/.vscode/**",
|
|
277
|
-
"**/.idea/**"
|
|
278
|
-
];
|
|
279
|
-
function findEnvFiles2(startDir = process.cwd(), filter) {
|
|
280
|
-
const found = /* @__PURE__ */ new Set();
|
|
281
|
-
function addFile(file) {
|
|
282
|
-
const normalized = path2.normalize(file);
|
|
283
|
-
if (typeof filter === "function" && !filter(normalized)) {
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
found.add(normalized);
|
|
287
|
-
}
|
|
288
|
-
let current = path2.resolve(startDir);
|
|
289
|
-
while (true) {
|
|
290
|
-
const envPath2 = path2.join(current, ".env");
|
|
291
|
-
if (fs2.existsSync(envPath2)) {
|
|
292
|
-
addFile(envPath2);
|
|
293
|
-
}
|
|
294
|
-
const parent = path2.dirname(current);
|
|
295
|
-
if (parent === current) {
|
|
296
|
-
break;
|
|
297
|
-
}
|
|
298
|
-
current = parent;
|
|
299
|
-
}
|
|
300
|
-
const files = glob.globSync("**/.env*", {
|
|
301
|
-
cwd: startDir,
|
|
302
|
-
absolute: true,
|
|
303
|
-
nodir: true,
|
|
304
|
-
ignore: DEFAULT_IGNORES
|
|
305
|
-
});
|
|
306
|
-
for (const file of files) {
|
|
307
|
-
addFile(file);
|
|
308
|
-
}
|
|
309
|
-
return [...found];
|
|
310
|
-
}
|
|
311
|
-
function findEnvWithToken(startDir = process.cwd(), tokenName = "GITHUB_TOKEN") {
|
|
312
|
-
const envFiles = findEnvFiles2(startDir);
|
|
313
|
-
return envFiles.find((file) => {
|
|
314
|
-
try {
|
|
315
|
-
const content = fs2.readFileSync(file, "utf-8");
|
|
316
|
-
const regex = new RegExp(`^\\s*${tokenName}\\s*=`, "m");
|
|
317
|
-
return regex.test(content);
|
|
318
|
-
} catch (err) {
|
|
319
|
-
console.warn(`Failed to read ${file}: ${err instanceof Error ? err.message : String(err)}`);
|
|
320
|
-
return false;
|
|
321
|
-
}
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
module2.exports = {
|
|
325
|
-
DEFAULT_IGNORES,
|
|
326
|
-
findEnvFiles: findEnvFiles2,
|
|
327
|
-
findEnvWithToken,
|
|
328
|
-
default: findEnvFiles2
|
|
329
|
-
};
|
|
330
|
-
}
|
|
331
|
-
});
|
|
332
|
-
|
|
333
375
|
// src/package-resolutions-updater.mjs
|
|
334
376
|
var package_resolutions_updater_exports = {};
|
|
335
377
|
__export(package_resolutions_updater_exports, {
|
|
@@ -342,30 +384,14 @@ __export(package_resolutions_updater_exports, {
|
|
|
342
384
|
});
|
|
343
385
|
module.exports = __toCommonJS(package_resolutions_updater_exports);
|
|
344
386
|
init_cjs_shims();
|
|
345
|
-
var dotenv = __toESM(require("dotenv"), 1);
|
|
346
387
|
var import_fs = __toESM(require("fs"), 1);
|
|
388
|
+
var import_git_command_helper = require("git-command-helper");
|
|
347
389
|
var import_os = __toESM(require("os"), 1);
|
|
348
390
|
var import_upath = __toESM(require("upath"), 1);
|
|
349
|
-
var
|
|
391
|
+
var import_config = __toESM(require_config(), 1);
|
|
350
392
|
var import_fetchResponse = __toESM(require_fetchResponse(), 1);
|
|
351
|
-
var
|
|
352
|
-
var import_git_command_helper = require("git-command-helper");
|
|
353
|
-
var projectDir = process.cwd();
|
|
354
|
-
var envPath = import_upath.default.join(projectDir, ".env");
|
|
393
|
+
var utils = __toESM(require_utils(), 1);
|
|
355
394
|
var args = utils.getArgs();
|
|
356
|
-
if (!import_fs.default.existsSync(envPath)) {
|
|
357
|
-
const envFiles = (0, import_findEnvFiles.findEnvFiles)(projectDir, (file) => {
|
|
358
|
-
const content = import_fs.default.readFileSync(file, "utf-8");
|
|
359
|
-
return /GITHUB_TOKEN|ACCESS_TOKEN/.test(content);
|
|
360
|
-
});
|
|
361
|
-
if (envFiles.length > 0) {
|
|
362
|
-
envPath = envFiles[0];
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
if (import_fs.default.existsSync(envPath)) {
|
|
366
|
-
dotenv.config({ path: envPath, quiet: true, override: true });
|
|
367
|
-
}
|
|
368
|
-
var ACCESS_TOKEN = process.env.ACCESS_TOKEN || process.env.GITHUB_TOKEN;
|
|
369
395
|
if (args.help || args.h) {
|
|
370
396
|
showHelp();
|
|
371
397
|
}
|
|
@@ -389,7 +415,6 @@ Requirements:
|
|
|
389
415
|
- Node.js v18+ recommended
|
|
390
416
|
Dependencies:
|
|
391
417
|
- ansi-colors \u2013 for styled terminal output
|
|
392
|
-
- dotenv \u2013 to load GitHub token from .env
|
|
393
418
|
Examples:
|
|
394
419
|
node src/package-resolutions-updater.mjs
|
|
395
420
|
node src/package-resolutions-updater.mjs --help
|
|
@@ -430,7 +455,7 @@ async function fetchJson(url) {
|
|
|
430
455
|
"User-Agent": selectedUserAgent,
|
|
431
456
|
Accept: "application/vnd.github.v3+json",
|
|
432
457
|
"X-GitHub-Api-Version": "2022-11-28",
|
|
433
|
-
...
|
|
458
|
+
...import_config.GITHUB_ACCESS_TOKEN ? { Authorization: `token ${import_config.GITHUB_ACCESS_TOKEN}` } : {}
|
|
434
459
|
},
|
|
435
460
|
responseType: "json"
|
|
436
461
|
});
|
|
@@ -508,15 +533,25 @@ function replaceRawWithLatestHash(url, latestHash) {
|
|
|
508
533
|
}
|
|
509
534
|
async function resolvePackageResolutionUpdates(resolutions, specialPackageOverrides = []) {
|
|
510
535
|
const updates = [];
|
|
511
|
-
for (const [currentPkgName,
|
|
536
|
+
for (const [currentPkgName, version] of Object.entries(resolutions || {})) {
|
|
537
|
+
const isUrl = typeof version === "string" && (version.startsWith("http://") || version.startsWith("https://"));
|
|
538
|
+
if (!isUrl) {
|
|
539
|
+
updates.push({
|
|
540
|
+
skipped: true,
|
|
541
|
+
currentPkgName,
|
|
542
|
+
url: version,
|
|
543
|
+
error: new Error("Version is not a URL, skipping")
|
|
544
|
+
});
|
|
545
|
+
continue;
|
|
546
|
+
}
|
|
512
547
|
let repo;
|
|
513
548
|
try {
|
|
514
|
-
repo = (0, import_git_command_helper.parseGitHubUrl)(
|
|
549
|
+
repo = (0, import_git_command_helper.parseGitHubUrl)(version);
|
|
515
550
|
} catch (error) {
|
|
516
551
|
updates.push({
|
|
517
552
|
skipped: true,
|
|
518
553
|
currentPkgName,
|
|
519
|
-
url,
|
|
554
|
+
url: version,
|
|
520
555
|
error
|
|
521
556
|
});
|
|
522
557
|
continue;
|
|
@@ -524,25 +559,25 @@ async function resolvePackageResolutionUpdates(resolutions, specialPackageOverri
|
|
|
524
559
|
try {
|
|
525
560
|
const override = specialPackageOverrides.find((p) => p.pkg === currentPkgName);
|
|
526
561
|
const latest = override ? await getLatestCommit(override.owner, override.repo, override.branch) : await getLatestCommitAcrossBranches(repo.owner, repo.repo);
|
|
527
|
-
const new_url = replaceRawWithLatestHash(
|
|
562
|
+
const new_url = replaceRawWithLatestHash(version, latest.sha);
|
|
528
563
|
const response = await (0, import_fetchResponse.default)(new_url);
|
|
529
564
|
if (response.status < 200 || response.status >= 300) {
|
|
530
565
|
updates.push({
|
|
531
566
|
failed: true,
|
|
532
567
|
currentPkgName,
|
|
533
|
-
url,
|
|
568
|
+
url: version,
|
|
534
569
|
new_url,
|
|
535
570
|
repo,
|
|
536
571
|
latest,
|
|
537
572
|
error: new Error(`New URL not accessible (status ${response.status}).
|
|
538
|
-
original: ${
|
|
573
|
+
original: ${version}
|
|
539
574
|
new: ${new_url}`)
|
|
540
575
|
});
|
|
541
576
|
continue;
|
|
542
577
|
}
|
|
543
578
|
updates.push({
|
|
544
579
|
currentPkgName,
|
|
545
|
-
url,
|
|
580
|
+
url: version,
|
|
546
581
|
new_url,
|
|
547
582
|
repo,
|
|
548
583
|
latest
|
|
@@ -551,7 +586,7 @@ new: ${new_url}`)
|
|
|
551
586
|
updates.push({
|
|
552
587
|
failed: true,
|
|
553
588
|
currentPkgName,
|
|
554
|
-
url,
|
|
589
|
+
url: version,
|
|
555
590
|
repo,
|
|
556
591
|
error
|
|
557
592
|
});
|
|
@@ -36,6 +36,15 @@ export function resolvePackageResolutionUpdates(resolutions: any, specialPackage
|
|
|
36
36
|
skipped: boolean;
|
|
37
37
|
currentPkgName: string;
|
|
38
38
|
url: any;
|
|
39
|
+
error: Error;
|
|
40
|
+
failed?: undefined;
|
|
41
|
+
new_url?: undefined;
|
|
42
|
+
repo?: undefined;
|
|
43
|
+
latest?: undefined;
|
|
44
|
+
} | {
|
|
45
|
+
skipped: boolean;
|
|
46
|
+
currentPkgName: string;
|
|
47
|
+
url: string;
|
|
39
48
|
error: unknown;
|
|
40
49
|
failed?: undefined;
|
|
41
50
|
new_url?: undefined;
|
|
@@ -44,7 +53,7 @@ export function resolvePackageResolutionUpdates(resolutions: any, specialPackage
|
|
|
44
53
|
} | {
|
|
45
54
|
failed: boolean;
|
|
46
55
|
currentPkgName: string;
|
|
47
|
-
url:
|
|
56
|
+
url: string;
|
|
48
57
|
new_url: string;
|
|
49
58
|
repo: import("git-command-helper").ParsedGitHubUrl;
|
|
50
59
|
latest: {
|
|
@@ -58,7 +67,7 @@ export function resolvePackageResolutionUpdates(resolutions: any, specialPackage
|
|
|
58
67
|
skipped?: undefined;
|
|
59
68
|
} | {
|
|
60
69
|
currentPkgName: string;
|
|
61
|
-
url:
|
|
70
|
+
url: string;
|
|
62
71
|
new_url: string;
|
|
63
72
|
repo: import("git-command-helper").ParsedGitHubUrl;
|
|
64
73
|
latest: {
|
|
@@ -74,7 +83,7 @@ export function resolvePackageResolutionUpdates(resolutions: any, specialPackage
|
|
|
74
83
|
} | {
|
|
75
84
|
failed: boolean;
|
|
76
85
|
currentPkgName: string;
|
|
77
|
-
url:
|
|
86
|
+
url: string;
|
|
78
87
|
repo: import("git-command-helper").ParsedGitHubUrl;
|
|
79
88
|
error: unknown;
|
|
80
89
|
skipped?: undefined;
|
|
@@ -6,9 +6,10 @@ import {
|
|
|
6
6
|
parseGitHubUrl,
|
|
7
7
|
replaceRawWithLatestHash,
|
|
8
8
|
resolvePackageResolutionUpdates
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NHD4HLSU.mjs";
|
|
10
10
|
import "./chunk-KLKAIFKI.mjs";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-3T6AMFI3.mjs";
|
|
12
|
+
import "./chunk-J4M5EL5P.mjs";
|
|
12
13
|
import "./chunk-6RK5UCTP.mjs";
|
|
13
14
|
import "./chunk-QQ4A6DLD.mjs";
|
|
14
15
|
export {
|
|
@@ -180,6 +180,143 @@ var require_utils = __commonJS({
|
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
182
|
|
|
183
|
+
// src/utils/findEnvFiles.cjs
|
|
184
|
+
var require_findEnvFiles = __commonJS({
|
|
185
|
+
"src/utils/findEnvFiles.cjs"(exports2, module2) {
|
|
186
|
+
init_cjs_shims();
|
|
187
|
+
var fs2 = require("fs");
|
|
188
|
+
var path2 = require("path");
|
|
189
|
+
var glob2 = require("glob");
|
|
190
|
+
var DEFAULT_IGNORES = [
|
|
191
|
+
"**/node_modules/**",
|
|
192
|
+
"**/.git/**",
|
|
193
|
+
"**/.yarn/**",
|
|
194
|
+
"**/.pnpm/**",
|
|
195
|
+
"**/dist/**",
|
|
196
|
+
"**/build/**",
|
|
197
|
+
"**/coverage/**",
|
|
198
|
+
"**/vendor/**",
|
|
199
|
+
"**/tmp/**",
|
|
200
|
+
"**/.cache/**",
|
|
201
|
+
"**/assets/**",
|
|
202
|
+
"**/logs/**",
|
|
203
|
+
"**/output/**",
|
|
204
|
+
"**/public/**",
|
|
205
|
+
"**/static/**",
|
|
206
|
+
"**/temp/**",
|
|
207
|
+
"**/backup/**",
|
|
208
|
+
"**/backups/**",
|
|
209
|
+
"**/examples/**",
|
|
210
|
+
"**/docs/**",
|
|
211
|
+
"**/tests/**",
|
|
212
|
+
"**/__tests__/**",
|
|
213
|
+
"**/spec/**",
|
|
214
|
+
"**/__specs__/**",
|
|
215
|
+
"**/scripts/**",
|
|
216
|
+
"**/bin/**",
|
|
217
|
+
"**/hooks/**",
|
|
218
|
+
"**/config/**",
|
|
219
|
+
"**/configs/**",
|
|
220
|
+
"**/settings/**",
|
|
221
|
+
"**/.vscode/**",
|
|
222
|
+
"**/.idea/**"
|
|
223
|
+
];
|
|
224
|
+
function findEnvFiles(startDir = process.cwd(), filter) {
|
|
225
|
+
const found = /* @__PURE__ */ new Set();
|
|
226
|
+
function addFile(file) {
|
|
227
|
+
const normalized = path2.normalize(file);
|
|
228
|
+
if (typeof filter === "function" && !filter(normalized)) {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
found.add(normalized);
|
|
232
|
+
}
|
|
233
|
+
let current = path2.resolve(startDir);
|
|
234
|
+
while (true) {
|
|
235
|
+
const envPath = path2.join(current, ".env");
|
|
236
|
+
if (fs2.existsSync(envPath)) {
|
|
237
|
+
addFile(envPath);
|
|
238
|
+
}
|
|
239
|
+
const parent = path2.dirname(current);
|
|
240
|
+
if (parent === current) {
|
|
241
|
+
break;
|
|
242
|
+
}
|
|
243
|
+
current = parent;
|
|
244
|
+
}
|
|
245
|
+
const files = glob2.globSync("**/.env*", {
|
|
246
|
+
cwd: startDir,
|
|
247
|
+
absolute: true,
|
|
248
|
+
nodir: true,
|
|
249
|
+
ignore: DEFAULT_IGNORES
|
|
250
|
+
});
|
|
251
|
+
for (const file of files) {
|
|
252
|
+
addFile(file);
|
|
253
|
+
}
|
|
254
|
+
return [...found];
|
|
255
|
+
}
|
|
256
|
+
function findEnvWithToken(startDir = process.cwd(), tokenName = "GITHUB_TOKEN") {
|
|
257
|
+
const envFiles = findEnvFiles(startDir);
|
|
258
|
+
return envFiles.find((file) => {
|
|
259
|
+
try {
|
|
260
|
+
const content = fs2.readFileSync(file, "utf-8");
|
|
261
|
+
if (tokenName instanceof RegExp) {
|
|
262
|
+
return tokenName.test(content);
|
|
263
|
+
}
|
|
264
|
+
const regex = new RegExp(`^\\s*${tokenName}\\s*=`, "m");
|
|
265
|
+
return regex.test(content);
|
|
266
|
+
} catch (err) {
|
|
267
|
+
console.warn(`Failed to read ${file}: ${err instanceof Error ? err.message : String(err)}`);
|
|
268
|
+
return false;
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
module2.exports = {
|
|
273
|
+
DEFAULT_IGNORES,
|
|
274
|
+
findEnvFiles,
|
|
275
|
+
findEnvWithToken,
|
|
276
|
+
default: findEnvFiles
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
// src/binary-collections/config.cjs
|
|
282
|
+
var require_config = __commonJS({
|
|
283
|
+
"src/binary-collections/config.cjs"(exports2, module2) {
|
|
284
|
+
init_cjs_shims();
|
|
285
|
+
var path2 = require("upath");
|
|
286
|
+
var minimistLib = require("minimist");
|
|
287
|
+
var { findEnvWithToken } = require_findEnvFiles();
|
|
288
|
+
var dotenv = require("dotenv");
|
|
289
|
+
var { cosmiconfig } = require("cosmiconfig");
|
|
290
|
+
var loadDotenv2 = (tokenKey = /ACCESS_TOKEN|GITHUB_TOKEN/) => dotenv.config({ path: findEnvWithToken(void 0, tokenKey), quiet: true, overwrite: true });
|
|
291
|
+
loadDotenv2();
|
|
292
|
+
var cliArgv = minimistLib(process.argv.slice(2), {
|
|
293
|
+
string: ["token"]
|
|
294
|
+
});
|
|
295
|
+
var GITHUB_ACCESS_TOKEN = cliArgv.token || process.env.ACCESS_TOKEN || process.env.GITHUB_TOKEN || process.env.GH_TOKEN;
|
|
296
|
+
function getTempPath(...segments) {
|
|
297
|
+
return path2.join(process.env.TEMP_DIR || path2.join(process.cwd(), "tmp"), ...segments);
|
|
298
|
+
}
|
|
299
|
+
async function getConfig(options = {}) {
|
|
300
|
+
const explorer = cosmiconfig("binary-collections", {
|
|
301
|
+
searchStrategy: "project",
|
|
302
|
+
stopDir: options.stopDir
|
|
303
|
+
});
|
|
304
|
+
try {
|
|
305
|
+
const result = await explorer.search(options.searchFrom);
|
|
306
|
+
return result ? result.config : null;
|
|
307
|
+
} catch {
|
|
308
|
+
return null;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
module2.exports = {
|
|
312
|
+
getTempPath,
|
|
313
|
+
GITHUB_ACCESS_TOKEN,
|
|
314
|
+
loadDotenv: loadDotenv2,
|
|
315
|
+
getConfig
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
|
|
183
320
|
// src/print-directory-tree.cjs
|
|
184
321
|
init_cjs_shims();
|
|
185
322
|
var fs = require("fs");
|
|
@@ -190,10 +327,9 @@ var { execSync } = require("child_process");
|
|
|
190
327
|
var glob = require("glob");
|
|
191
328
|
var { getArgs } = require_utils();
|
|
192
329
|
var sbgUtil = require("sbg-utility");
|
|
193
|
-
var
|
|
330
|
+
var { loadDotenv } = require_config();
|
|
194
331
|
var projectDir = process.cwd();
|
|
195
|
-
|
|
196
|
-
if (fs.existsSync(envPath)) dotenv.config({ path: envPath, quiet: true, override: true });
|
|
332
|
+
loadDotenv();
|
|
197
333
|
var argv = getArgs();
|
|
198
334
|
async function main() {
|
|
199
335
|
let relativeOutputFile = "tmp/directory-structure.txt";
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
require_config
|
|
4
|
+
} from "./chunk-3T6AMFI3.mjs";
|
|
5
|
+
import "./chunk-J4M5EL5P.mjs";
|
|
2
6
|
import {
|
|
3
7
|
require_utils
|
|
4
8
|
} from "./chunk-6RK5UCTP.mjs";
|
|
@@ -20,10 +24,9 @@ var require_print_directory_tree = __commonJS({
|
|
|
20
24
|
var glob = __require("glob");
|
|
21
25
|
var { getArgs } = require_utils();
|
|
22
26
|
var sbgUtil = __require("sbg-utility");
|
|
23
|
-
var
|
|
27
|
+
var { loadDotenv } = require_config();
|
|
24
28
|
var projectDir = process.cwd();
|
|
25
|
-
|
|
26
|
-
if (fs.existsSync(envPath)) dotenv.config({ path: envPath, quiet: true, override: true });
|
|
29
|
+
loadDotenv();
|
|
27
30
|
var argv = getArgs();
|
|
28
31
|
async function main() {
|
|
29
32
|
let relativeOutputFile = "tmp/directory-structure.txt";
|