binary-collections 2.0.8 → 2.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/binaries/binary-executor.cjs +43 -0
- package/{bin → binaries}/clean-nodemodule +0 -0
- package/binaries/clean-nodemodule.cjs +43 -0
- package/binaries/clean-nodemodule.cmd +4 -0
- package/{bin → binaries}/clean-nodemodules +0 -0
- package/binaries/clean-nodemodules.cjs +43 -0
- package/binaries/clean-nodemodules.cmd +5 -0
- package/{bin → binaries}/dev +0 -0
- package/binaries/dev.cjs +43 -0
- package/{bin → binaries}/empty +0 -0
- package/binaries/empty.cjs +43 -0
- package/{bin → binaries}/git-reduce-size +0 -0
- package/binaries/git-reduce-size.cjs +43 -0
- package/binaries/javakill.cjs +43 -0
- package/{bin → binaries}/javakill.cmd +0 -0
- package/{bin → binaries}/kill-process +0 -0
- package/binaries/kill-process.cjs +43 -0
- package/binaries/nodekill.cjs +43 -0
- package/{bin → binaries}/nodekill.ps1 +0 -0
- package/{bin → binaries}/prod +0 -0
- package/binaries/prod.cjs +43 -0
- package/{bin → binaries}/rmfind +0 -0
- package/binaries/rmfind.cjs +43 -0
- package/{bin → binaries}/rmx +0 -0
- package/binaries/rmx.cjs +43 -0
- package/{bin → binaries}/submodule-token +0 -0
- package/binaries/submodule-token.cjs +43 -0
- package/docs-src/clean-github-actions-caches.md +26 -0
- package/docs-src/free-chatgpt.md +26 -0
- package/lib/binary-collections-config.cjs +3 -2
- package/lib/binary-collections-config.mjs +2 -2
- package/lib/binary-collections.cjs +452 -87
- package/lib/binary-collections.mjs +247 -8
- package/lib/changelog.cjs +328 -0
- package/lib/changelog.mjs +205 -0
- package/lib/chunk-4EWQC6GZ.mjs +382 -0
- package/lib/chunk-4ZI7BQKQ.mjs +381 -0
- package/lib/chunk-5J2BEPY5.mjs +83 -0
- package/lib/{chunk-4BYBVEYC.mjs → chunk-66PAU5PS.mjs} +5 -4
- package/lib/chunk-6HHJRKFB.mjs +59 -0
- package/lib/chunk-6S4NXESK.mjs +26 -0
- package/lib/{chunk-ZYAQRPUL.mjs → chunk-7YD7IPFF.mjs} +2 -2
- package/lib/{chunk-SH3L6HHV.mjs → chunk-A2JQXI5Z.mjs} +2 -2
- package/lib/{chunk-EGSSKVDH.mjs → chunk-A3VUZEJK.mjs} +1 -1
- package/lib/chunk-AGZYRDC2.mjs +323 -0
- package/lib/{chunk-VVEZVNIV.mjs → chunk-AI4CVPJ7.mjs} +6 -6
- package/lib/chunk-BDCHCWHD.mjs +136 -0
- package/lib/chunk-BEZKJ25G.mjs +140 -0
- package/lib/chunk-DI5MDPSN.mjs +386 -0
- package/lib/{chunk-ONIBBBQ3.mjs → chunk-E6FDDAOO.mjs} +4 -3
- package/lib/chunk-FKI7IEB5.mjs +172 -0
- package/lib/chunk-GJTGHXRA.mjs +356 -0
- package/lib/{chunk-YV7DO3YV.mjs → chunk-HLGOWBEO.mjs} +1 -1
- package/lib/chunk-HMRMTYZM.mjs +40 -0
- package/lib/chunk-HN52G2YL.mjs +305 -0
- package/lib/chunk-HO6GHCOB.mjs +385 -0
- package/lib/chunk-LEM5OMRP.mjs +384 -0
- package/lib/{chunk-YX5U7XDR.mjs → chunk-M3YIYRHT.mjs} +6 -5
- package/lib/chunk-O6SWBEOQ.mjs +81 -0
- package/lib/{chunk-JGR2NW6D.mjs → chunk-PDSXF5HY.mjs} +3 -3
- package/lib/{chunk-AASHBCRW.mjs → chunk-QQ4A6DLD.mjs} +8 -0
- package/lib/chunk-RCP7DHVY.mjs +190 -0
- package/lib/chunk-SBNDSKG5.mjs +136 -0
- package/lib/chunk-U6SO4QEV.mjs +320 -0
- package/lib/{chunk-APBWENF6.mjs → chunk-V3N3JEUF.mjs} +3 -3
- package/lib/chunk-XD6BJK6Q.mjs +351 -0
- package/lib/chunk-XVBFFVCJ.mjs +209 -0
- package/lib/chunk-YXSFGA2D.mjs +383 -0
- package/lib/clean-github-actions-caches.cjs +243 -148
- package/lib/clean-github-actions-caches.mjs +4 -3
- package/lib/del-gradle.cjs +2 -2
- package/lib/del-gradle.js +1 -1
- package/lib/del-gradle.mjs +2 -2
- package/lib/del-node-modules.cjs +2 -2
- package/lib/del-node-modules.js +1 -1
- package/lib/del-node-modules.mjs +2 -2
- package/lib/del-ps.cjs +29 -8
- package/lib/del-ps.js +2 -2
- package/lib/del-ps.mjs +7 -5
- package/lib/del-yarn-caches.cjs +26 -5
- package/lib/del-yarn-caches.js +38 -3
- package/lib/del-yarn-caches.mjs +6 -6
- package/lib/find-node-modules-cli.cjs +5 -4
- package/lib/find-node-modules-cli.js +1 -1
- package/lib/find-node-modules-cli.mjs +2 -2
- package/lib/find-node-modules.cjs +4 -3
- package/lib/{find-node-modules.d.ts → find-node-modules.d.cts} +1 -1
- package/lib/find-node-modules.mjs +2 -2
- package/lib/free-chatgpt.cjs +548 -0
- package/lib/free-chatgpt.d.ts +1 -0
- package/lib/free-chatgpt.js +51 -0
- package/lib/free-chatgpt.mjs +50 -0
- package/lib/git/gitattributes.cjs +1 -1
- package/lib/git/{gitattributes.d.mts → gitattributes.d.cts} +5 -7
- package/lib/git/gitattributes.mjs +2 -2
- package/lib/git/line-endings.cjs +297 -64
- package/lib/git/line-endings.mjs +4 -4
- package/lib/git/normalize.cjs +26 -36
- package/lib/git/normalize.mjs +2 -2
- package/lib/git/permissions.cjs +77 -11
- package/lib/git/permissions.mjs +3 -3
- package/lib/git/pull-strategy.cjs +76 -9
- package/lib/git/pull-strategy.mjs +3 -3
- package/lib/git/user-config.cjs +266 -83
- package/lib/git/user-config.mjs +4 -4
- package/lib/git/utils.cjs +40 -60
- package/lib/git/utils.mjs +2 -2
- package/lib/git-diff-cli.cjs +651 -0
- package/lib/git-diff-cli.d.ts +1 -0
- package/lib/git-diff-cli.js +15 -0
- package/lib/git-diff-cli.mjs +16 -0
- package/lib/git-diff.cjs +657 -58
- package/lib/git-diff.d.ts +38 -83
- package/lib/git-diff.js +152 -0
- package/lib/git-diff.mjs +23 -85
- package/lib/git-fix.cjs +685 -97
- package/lib/git-fix.mjs +12 -11
- package/lib/git-purge.cjs +3 -3
- package/lib/git-purge.d.cts +1 -0
- package/lib/git-purge.mjs +43 -37
- package/lib/index.cjs +7 -6
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -5
- package/lib/index.mjs +4 -4
- package/lib/npm-run-series.cjs +3 -3
- package/lib/npm-run-series.mjs +42 -36
- package/lib/package-resolutions-updater.cjs +174 -1
- package/lib/package-resolutions-updater.mjs +270 -290
- package/lib/print-directory-tree.cjs +275 -210
- package/lib/print-directory-tree.mjs +2 -2
- package/lib/ps/connected-domain.cjs +25 -2
- package/lib/ps/connected-domain.d.ts +10 -2
- package/lib/ps/connected-domain.js +5 -2
- package/lib/ps/connected-domain.mjs +8 -4
- package/lib/ps/index.cjs +345 -322
- package/lib/ps/index.d.mjs +1 -1
- package/lib/ps/index.js +1 -1
- package/lib/ps/index.mjs +179 -182
- package/lib/ps/isWin.cjs +24 -1
- package/lib/ps/isWin.d.ts +1 -1
- package/lib/ps/isWin.js +3 -1
- package/lib/ps/isWin.mjs +8 -4
- package/lib/ps/table-parser.cjs +167 -159
- package/lib/ps/table-parser.d.ts +5 -0
- package/lib/ps/table-parser.js +10 -4
- package/lib/ps/table-parser.mjs +9 -5
- package/lib/remove-module.cjs +262 -0
- package/lib/remove-module.d.mts +1 -0
- package/lib/remove-module.mjs +111 -0
- package/lib/rmpath.cjs +274 -0
- package/lib/rmpath.d.mts +3 -0
- package/lib/rmpath.mjs +108 -0
- package/lib/submodule-install.cjs +264 -85
- package/lib/submodule-install.mjs +56 -7
- package/lib/submodule-remove-cli.cjs +103 -0
- package/lib/submodule-remove-cli.d.ts +1 -0
- package/lib/submodule-remove-cli.js +31 -0
- package/lib/submodule-remove-cli.mjs +28 -0
- package/lib/submodule-remove.cjs +43 -0
- package/lib/submodule-remove.d.cts +2 -0
- package/lib/submodule-remove.mjs +6 -0
- package/lib/utils/chatgpt.cjs +383 -0
- package/lib/utils/chatgpt.d.ts +31 -0
- package/lib/utils/chatgpt.js +541 -0
- package/lib/utils/chatgpt.mjs +8 -0
- package/lib/{utils.cjs → utils/index.cjs} +1 -1
- package/lib/{utils.mjs → utils/index.mjs} +2 -2
- package/lib/yarn-reinstall.cjs +172 -38
- package/lib/yarn-reinstall.mjs +2 -2
- package/package.json +91 -71
- package/readme.md +43 -69
- package/releases/readme.md +36 -0
- package/test/README.md +101 -0
- package/test/package.json +2 -1
- package/test-project/readme.md +26 -0
- package/tmp/test-repo/README.md +35 -0
- package/tmp/typedoc/readme.md +320 -0
- package/bin/bash-dummy +0 -56
- package/bin/bash-dummy.cmd +0 -25
- package/bin/dir-tree.cmd +0 -7
- package/bin/git-diff +0 -4
- package/bin/git-diff.cmd +0 -7
- package/bin/git-fix +0 -36
- package/bin/git-fix.cmd +0 -7
- package/bin/rmpath +0 -70
- package/bin/submodule-install.txt +0 -118
- package/bin/submodule-remove +0 -46
- package/bin/submodule.txt +0 -172
- package/lib/binary-collections-config.d.mts +0 -18
- package/lib/binary-collections-config.js +0 -39
- package/lib/binary-collections.d.mts +0 -121
- package/lib/binary-collections.d.ts +0 -121
- package/lib/chunk-DPKAJKFO.mjs +0 -171
- package/lib/chunk-G3THLIDT.mjs +0 -200
- package/lib/chunk-W3ENOM53.mjs +0 -18
- package/lib/clean-github-actions-caches.d.mts +0 -169
- package/lib/clean-github-actions-caches.d.ts +0 -169
- package/lib/del-gradle.d.mts +0 -2
- package/lib/del-node-modules.d.mts +0 -2
- package/lib/del-ps.d.mts +0 -2
- package/lib/del-yarn-caches.d.mts +0 -2
- package/lib/find-node-modules-cli.d.mts +0 -1
- package/lib/find-node-modules.d.mts +0 -13
- package/lib/find-node-modules.js +0 -53
- package/lib/git/line-endings.d.mts +0 -83
- package/lib/git/line-endings.d.ts +0 -83
- package/lib/git/normalize.d.mts +0 -43
- package/lib/git/normalize.d.ts +0 -43
- package/lib/git/permissions.d.mts +0 -17
- package/lib/git/permissions.d.ts +0 -17
- package/lib/git/pull-strategy.d.mts +0 -15
- package/lib/git/pull-strategy.d.ts +0 -15
- package/lib/git/user-config.d.mts +0 -105
- package/lib/git/user-config.d.ts +0 -105
- package/lib/git/utils.d.mts +0 -69
- package/lib/git/utils.d.ts +0 -69
- package/lib/git-diff.d.mts +0 -84
- package/lib/git-fix.d.mts +0 -141
- package/lib/git-fix.d.ts +0 -141
- package/lib/git-purge.d.mts +0 -2
- package/lib/git-purge.js +0 -59
- package/lib/index.d.mts +0 -1
- package/lib/npm-run-series.d.mts +0 -1
- package/lib/npm-run-series.d.ts +0 -2
- package/lib/npm-run-series.js +0 -86
- package/lib/package-resolutions-updater.d.ts +0 -326
- package/lib/print-directory-tree.d.mts +0 -234
- package/lib/print-directory-tree.d.ts +0 -234
- package/lib/ps/connected-domain.d.mts +0 -3
- package/lib/ps/index.d.d.mts +0 -26
- package/lib/ps/index.d.d.ts +0 -26
- package/lib/ps/index.d.mts +0 -26
- package/lib/ps/isWin.d.mts +0 -3
- package/lib/ps/table-parser.d.mts +0 -3
- package/lib/submodule-install.d.mts +0 -121
- package/lib/submodule-install.d.ts +0 -121
- package/lib/utils.d.mts +0 -40
- package/lib/utils.js +0 -181
- package/lib/yarn-reinstall.d.mts +0 -49
- package/lib/yarn-reinstall.d.ts +0 -49
- package/src/package-resolutions-updater.mjs +0 -325
- package/src/print-directory-tree.cjs +0 -234
- package/src/ps/index.js +0 -286
- package/src/yarn-reinstall.cjs +0 -49
- /package/{bin → binaries}/nodekill +0 -0
- /package/{bin → binaries}/nodekill.cmd +0 -0
- /package/lib/{binary-collections-config.d.ts → binary-collections-config.d.cts} +0 -0
- /package/lib/{git-purge.d.ts → changelog.d.cts} +0 -0
- /package/lib/{git-diff.d.cts → npm-run-series.d.cts} +0 -0
- /package/lib/{utils.d.ts → utils/index.d.cts} +0 -0
package/lib/git-fix.mjs
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
require_user_config
|
|
5
|
-
} from "./chunk-ONIBBBQ3.mjs";
|
|
6
3
|
import {
|
|
7
4
|
require_line_endings
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-O6SWBEOQ.mjs";
|
|
6
|
+
import "./chunk-PDSXF5HY.mjs";
|
|
10
7
|
import {
|
|
11
8
|
require_normalize
|
|
12
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HLGOWBEO.mjs";
|
|
13
10
|
import {
|
|
14
11
|
require_permissions
|
|
15
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-7YD7IPFF.mjs";
|
|
16
13
|
import {
|
|
17
14
|
require_pull_strategy
|
|
18
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-A2JQXI5Z.mjs";
|
|
16
|
+
import {
|
|
17
|
+
require_user_config
|
|
18
|
+
} from "./chunk-E6FDDAOO.mjs";
|
|
19
19
|
import {
|
|
20
20
|
require_utils as require_utils2
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-A3VUZEJK.mjs";
|
|
22
22
|
import {
|
|
23
23
|
require_utils
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-V3N3JEUF.mjs";
|
|
25
25
|
import {
|
|
26
26
|
__commonJS,
|
|
27
27
|
__require,
|
|
28
28
|
init_esm_shims
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-QQ4A6DLD.mjs";
|
|
30
30
|
|
|
31
31
|
// src/git-fix.cjs
|
|
32
32
|
var require_git_fix = __commonJS({
|
|
@@ -40,6 +40,7 @@ var require_git_fix = __commonJS({
|
|
|
40
40
|
var { normalizeLineEndings } = require_normalize();
|
|
41
41
|
var { getArgs } = require_utils();
|
|
42
42
|
var path = __require("upath");
|
|
43
|
+
__require("dotenv").config({ path: path.join(process.cwd(), ".env") });
|
|
43
44
|
function showHelp() {
|
|
44
45
|
console.log("Git Fix Utility");
|
|
45
46
|
console.log("----------------------------");
|
package/lib/git-purge.cjs
CHANGED
|
@@ -12,9 +12,9 @@ var init_cjs_shims = __esm({
|
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
-
// src/utils.
|
|
15
|
+
// src/utils/index.cjs
|
|
16
16
|
var require_utils = __commonJS({
|
|
17
|
-
"src/utils.
|
|
17
|
+
"src/utils/index.cjs"(exports2, module2) {
|
|
18
18
|
init_cjs_shims();
|
|
19
19
|
var fs = require("fs");
|
|
20
20
|
var path2 = require("upath");
|
|
@@ -137,7 +137,7 @@ var require_utils = __commonJS({
|
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
139
|
|
|
140
|
-
// src/git-purge.
|
|
140
|
+
// src/git-purge.cjs
|
|
141
141
|
init_cjs_shims();
|
|
142
142
|
var { spawnAsync } = require("cross-spawn");
|
|
143
143
|
var glob = require("glob");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/git-purge.mjs
CHANGED
|
@@ -1,45 +1,51 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
require_utils
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-V3N3JEUF.mjs";
|
|
5
5
|
import {
|
|
6
|
+
__commonJS,
|
|
6
7
|
__require,
|
|
7
8
|
init_esm_shims
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QQ4A6DLD.mjs";
|
|
9
10
|
|
|
10
|
-
// src/git-purge.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
11
|
+
// src/git-purge.cjs
|
|
12
|
+
var require_git_purge = __commonJS({
|
|
13
|
+
"src/git-purge.cjs"() {
|
|
14
|
+
init_esm_shims();
|
|
15
|
+
var { spawnAsync } = __require("cross-spawn");
|
|
16
|
+
var glob = __require("glob");
|
|
17
|
+
var path = __require("path");
|
|
18
|
+
var { delay } = require_utils();
|
|
19
|
+
var dirs = [];
|
|
20
|
+
var fetchDirs = (pattern, callback) => {
|
|
21
|
+
const globStream = new glob.Glob(pattern, {
|
|
22
|
+
withFileTypes: false,
|
|
23
|
+
cwd: process.cwd(),
|
|
24
|
+
ignore: ["**/node_modules/**", "**/vendor/**"]
|
|
25
|
+
});
|
|
26
|
+
globStream.stream().on("data", (result) => {
|
|
27
|
+
const fullPath = path.resolve(process.cwd(), result);
|
|
28
|
+
if (typeof callback == "function") callback(fullPath);
|
|
29
|
+
const base = path.dirname(fullPath);
|
|
30
|
+
if (!dirs.includes(base)) dirs.push(base);
|
|
31
|
+
start();
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var running = false;
|
|
35
|
+
async function start() {
|
|
36
|
+
if (running) return;
|
|
37
|
+
while (dirs.length > 0) {
|
|
38
|
+
running = true;
|
|
39
|
+
const cwd = dirs.shift();
|
|
40
|
+
console.log("pruning reflog", cwd);
|
|
41
|
+
await spawnAsync("git", ["reflog", "expire", "--expire=all", "--all"], { cwd, stdio: "pipe", shell: true }).catch(
|
|
42
|
+
(e) => console.log("failed prune reflog", e.message)
|
|
43
|
+
);
|
|
44
|
+
await delay(3);
|
|
45
|
+
running = false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
fetchDirs("**/.git");
|
|
43
49
|
}
|
|
44
|
-
}
|
|
45
|
-
|
|
50
|
+
});
|
|
51
|
+
export default require_git_purge();
|
package/lib/index.cjs
CHANGED
|
@@ -38,9 +38,9 @@ var init_cjs_shims = __esm({
|
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
// src/find-node-modules.
|
|
41
|
+
// src/find-node-modules.cjs
|
|
42
42
|
var require_find_node_modules = __commonJS({
|
|
43
|
-
"src/find-node-modules.
|
|
43
|
+
"src/find-node-modules.cjs"(exports2, module2) {
|
|
44
44
|
init_cjs_shims();
|
|
45
45
|
var glob = require("glob");
|
|
46
46
|
var path = require("path");
|
|
@@ -74,6 +74,9 @@ var require_find_node_modules = __commonJS({
|
|
|
74
74
|
});
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
+
module2.exports = findNodeModules2;
|
|
78
|
+
module2.exports.default = findNodeModules2;
|
|
79
|
+
module2.exports.findNodeModules = findNodeModules2;
|
|
77
80
|
if (typeof module2 !== "undefined" && require.main === module2) {
|
|
78
81
|
findNodeModules2(null, console.log).then((dirs) => {
|
|
79
82
|
console.log(`Found ${dirs.length} node_modules directories.`);
|
|
@@ -81,19 +84,17 @@ var require_find_node_modules = __commonJS({
|
|
|
81
84
|
console.error("Error finding node_modules directories:", err);
|
|
82
85
|
});
|
|
83
86
|
}
|
|
84
|
-
module2.exports = findNodeModules2;
|
|
85
|
-
module2.exports.default = findNodeModules2;
|
|
86
87
|
}
|
|
87
88
|
});
|
|
88
89
|
|
|
89
90
|
// src/index.ts
|
|
90
91
|
var index_exports = {};
|
|
91
92
|
__export(index_exports, {
|
|
92
|
-
findNodeModules: () => import_find_node_modules.
|
|
93
|
+
findNodeModules: () => import_find_node_modules.findNodeModules
|
|
93
94
|
});
|
|
94
95
|
module.exports = __toCommonJS(index_exports);
|
|
95
96
|
init_cjs_shims();
|
|
96
|
-
var import_find_node_modules = __toESM(require_find_node_modules());
|
|
97
|
+
var import_find_node_modules = __toESM(require_find_node_modules(), 1);
|
|
97
98
|
// Annotate the CommonJS export names for ESM import in node:
|
|
98
99
|
0 && (module.exports = {
|
|
99
100
|
findNodeModules
|
package/lib/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import findNodeModules from "./find-node-modules";
|
|
1
|
+
import { findNodeModules } from "./find-node-modules.cjs";
|
|
2
2
|
export { findNodeModules };
|
package/lib/index.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.findNodeModules = void 0;
|
|
7
|
-
const
|
|
8
|
-
exports
|
|
4
|
+
const find_node_modules_cjs_1 = require("./find-node-modules.cjs");
|
|
5
|
+
Object.defineProperty(exports, "findNodeModules", { enumerable: true, get: function () { return find_node_modules_cjs_1.findNodeModules; } });
|
package/lib/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
require_find_node_modules
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-M3YIYRHT.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__toESM,
|
|
7
7
|
init_esm_shims
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-QQ4A6DLD.mjs";
|
|
9
9
|
|
|
10
10
|
// src/index.ts
|
|
11
11
|
init_esm_shims();
|
|
12
|
-
var import_find_node_modules = __toESM(require_find_node_modules());
|
|
13
|
-
var export_findNodeModules = import_find_node_modules.
|
|
12
|
+
var import_find_node_modules = __toESM(require_find_node_modules(), 1);
|
|
13
|
+
var export_findNodeModules = import_find_node_modules.findNodeModules;
|
|
14
14
|
export {
|
|
15
15
|
export_findNodeModules as findNodeModules
|
|
16
16
|
};
|
package/lib/npm-run-series.cjs
CHANGED
|
@@ -34,9 +34,9 @@ var init_cjs_shims = __esm({
|
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
// src/utils.
|
|
37
|
+
// src/utils/index.cjs
|
|
38
38
|
var require_utils = __commonJS({
|
|
39
|
-
"src/utils.
|
|
39
|
+
"src/utils/index.cjs"(exports2, module2) {
|
|
40
40
|
init_cjs_shims();
|
|
41
41
|
var fs2 = require("fs");
|
|
42
42
|
var path2 = require("upath");
|
|
@@ -159,7 +159,7 @@ var require_utils = __commonJS({
|
|
|
159
159
|
}
|
|
160
160
|
});
|
|
161
161
|
|
|
162
|
-
// src/npm-run-series.
|
|
162
|
+
// src/npm-run-series.cjs
|
|
163
163
|
init_cjs_shims();
|
|
164
164
|
var fs = require("fs");
|
|
165
165
|
var path = require("path");
|
package/lib/npm-run-series.mjs
CHANGED
|
@@ -2,48 +2,54 @@
|
|
|
2
2
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
require_utils
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-V3N3JEUF.mjs";
|
|
6
6
|
import {
|
|
7
|
+
__commonJS,
|
|
7
8
|
__require,
|
|
8
9
|
init_esm_shims
|
|
9
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QQ4A6DLD.mjs";
|
|
10
11
|
|
|
11
|
-
// src/npm-run-series.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
12
|
+
// src/npm-run-series.cjs
|
|
13
|
+
var require_npm_run_series = __commonJS({
|
|
14
|
+
"src/npm-run-series.cjs"() {
|
|
15
|
+
init_esm_shims();
|
|
16
|
+
var fs = __require("fs");
|
|
17
|
+
var path = __require("path");
|
|
18
|
+
var { Minimatch } = __require("minimatch");
|
|
19
|
+
var { getArgs } = require_utils();
|
|
20
|
+
var args = getArgs();
|
|
21
|
+
var cwd = process.cwd();
|
|
22
|
+
var packagejson = path.join(cwd, "package.json");
|
|
23
|
+
var verbose = args["v"] || args["verbose"];
|
|
24
|
+
var usingYarn = args["yarn"];
|
|
25
|
+
(async function npmRunSeries() {
|
|
26
|
+
const { execa } = await import("execa");
|
|
27
|
+
if (fs.existsSync(packagejson)) {
|
|
28
|
+
const parse = JSON.parse(fs.readFileSync(packagejson, "utf-8"));
|
|
29
|
+
if (parse !== null && typeof parse === "object") {
|
|
30
|
+
if ("scripts" in parse) {
|
|
31
|
+
const patterns = args._;
|
|
32
|
+
const scripts = parse.scripts;
|
|
33
|
+
const scriptNames = Object.keys(scripts);
|
|
34
|
+
for (let i = 0; i < patterns.length; i++) {
|
|
35
|
+
const pattern = patterns[i];
|
|
36
|
+
const matcher = new Minimatch(pattern, { nonegate: true });
|
|
37
|
+
for (let ii = 0; ii < scriptNames.length; ii++) {
|
|
38
|
+
const scriptName = scriptNames[ii];
|
|
39
|
+
const match = matcher.match(scriptName);
|
|
40
|
+
if (verbose) console.log({ pattern, scriptName, match });
|
|
41
|
+
if (match === true) {
|
|
42
|
+
await execa(usingYarn ? "yarn" : "npm", ["run", scriptName], {
|
|
43
|
+
cwd,
|
|
44
|
+
stdio: "inherit"
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
43
48
|
}
|
|
44
49
|
}
|
|
45
50
|
}
|
|
46
51
|
}
|
|
47
|
-
}
|
|
52
|
+
})();
|
|
48
53
|
}
|
|
49
|
-
})
|
|
54
|
+
});
|
|
55
|
+
export default require_npm_run_series();
|
|
@@ -4,6 +4,12 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __esm = (fn, res) => function __init() {
|
|
8
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
9
|
+
};
|
|
10
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
11
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
+
};
|
|
7
13
|
var __copyProps = (to, from, except, desc) => {
|
|
8
14
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
15
|
for (let key of __getOwnPropNames(from))
|
|
@@ -21,16 +27,183 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
27
|
mod
|
|
22
28
|
));
|
|
23
29
|
|
|
30
|
+
// node_modules/tsup/assets/cjs_shims.js
|
|
31
|
+
var init_cjs_shims = __esm({
|
|
32
|
+
"node_modules/tsup/assets/cjs_shims.js"() {
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// src/utils/index.cjs
|
|
37
|
+
var require_utils = __commonJS({
|
|
38
|
+
"src/utils/index.cjs"(exports2, module2) {
|
|
39
|
+
init_cjs_shims();
|
|
40
|
+
var fs2 = require("fs");
|
|
41
|
+
var path2 = require("upath");
|
|
42
|
+
var argv = require("minimist")(process.argv.slice(2));
|
|
43
|
+
var { exec } = require("child_process");
|
|
44
|
+
var { URL: URL2 } = require("url");
|
|
45
|
+
var { promisify } = require("util");
|
|
46
|
+
var execAsync = promisify(exec);
|
|
47
|
+
async function parseGitRemotes() {
|
|
48
|
+
try {
|
|
49
|
+
const { stdout } = await execAsync("git remote -v");
|
|
50
|
+
const lines = stdout.split("\n");
|
|
51
|
+
const remotes = {};
|
|
52
|
+
lines.forEach((line) => {
|
|
53
|
+
const [name, url] = line.split(" ");
|
|
54
|
+
if (name && url) {
|
|
55
|
+
const [repoUrl] = url.split(" ");
|
|
56
|
+
try {
|
|
57
|
+
const parsedUrl = new URL2(repoUrl);
|
|
58
|
+
const pathParts = parsedUrl.pathname.split("/").filter(Boolean);
|
|
59
|
+
if (parsedUrl.hostname === "github.com" && pathParts.length === 2) {
|
|
60
|
+
let repoPath = pathParts.join("/");
|
|
61
|
+
if (repoPath.endsWith(".git")) {
|
|
62
|
+
repoPath = repoPath.slice(0, -4);
|
|
63
|
+
}
|
|
64
|
+
remotes[name] = repoPath;
|
|
65
|
+
}
|
|
66
|
+
} catch (e) {
|
|
67
|
+
console.error("URL Parsing Error:", e.message);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
return remotes;
|
|
72
|
+
} catch (error) {
|
|
73
|
+
console.error("Error:", error.message);
|
|
74
|
+
return {};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
module2.exports.parseGitRemotes = parseGitRemotes;
|
|
78
|
+
function joinPathPreserveDriveLetter(...segments) {
|
|
79
|
+
let fullPath = require("path").join(...segments);
|
|
80
|
+
if (/^[a-z]:\\/.test(fullPath)) {
|
|
81
|
+
fullPath = fullPath.charAt(0).toUpperCase() + fullPath.slice(1);
|
|
82
|
+
}
|
|
83
|
+
return fullPath;
|
|
84
|
+
}
|
|
85
|
+
module2.exports.joinPathPreserveDriveLetter = joinPathPreserveDriveLetter;
|
|
86
|
+
function getArgs2() {
|
|
87
|
+
return argv;
|
|
88
|
+
}
|
|
89
|
+
module2.exports.getArgs = getArgs2;
|
|
90
|
+
function del(fullPath) {
|
|
91
|
+
if (fs2.statSync(fullPath).isDirectory()) {
|
|
92
|
+
const subdir = fs2.readdirSync(fullPath).map((dirPath) => path2.resolve(fullPath, dirPath));
|
|
93
|
+
for (let i = 0; i < subdir.length; i++) {
|
|
94
|
+
del(subdir[i]);
|
|
95
|
+
}
|
|
96
|
+
} else {
|
|
97
|
+
try {
|
|
98
|
+
fs2.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
|
|
99
|
+
console.log("deleted", fullPath);
|
|
100
|
+
} catch (_) {
|
|
101
|
+
console.log("failed delete", fullPath);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
module2.exports.del = del;
|
|
106
|
+
function delStream(globStream) {
|
|
107
|
+
globStream.stream().on("data", (result) => {
|
|
108
|
+
const fullPath = path2.resolve(process.cwd(), result);
|
|
109
|
+
if (fs2.statSync(fullPath).isDirectory()) {
|
|
110
|
+
const subdir = fs2.readdirSync(fullPath).map((dirPath) => path2.resolve(fullPath, dirPath));
|
|
111
|
+
for (let i = 0; i < subdir.length; i++) {
|
|
112
|
+
del(subdir[i]);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
del(fullPath);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
module2.exports.delStream = delStream;
|
|
119
|
+
function getFileTreeString(hashArray) {
|
|
120
|
+
const tree = {};
|
|
121
|
+
const hashMap = {};
|
|
122
|
+
for (const entry of hashArray) {
|
|
123
|
+
const [filePath, hash] = entry.split(" ");
|
|
124
|
+
hashMap[filePath] = hash;
|
|
125
|
+
const parts = filePath.split("/");
|
|
126
|
+
let current = tree;
|
|
127
|
+
for (let i = 0; i < parts.length; i++) {
|
|
128
|
+
const part = parts[i];
|
|
129
|
+
if (i === parts.length - 1) {
|
|
130
|
+
current[part] = null;
|
|
131
|
+
} else {
|
|
132
|
+
current[part] = current[part] || {};
|
|
133
|
+
current = current[part];
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function printNode(node, prefix = "", parentPath = "") {
|
|
138
|
+
const keys = Object.keys(node).sort();
|
|
139
|
+
let lines = [];
|
|
140
|
+
keys.forEach((key, idx) => {
|
|
141
|
+
const isLast = idx === keys.length - 1;
|
|
142
|
+
const branch = isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ";
|
|
143
|
+
const currentPath = parentPath ? parentPath + "/" + key : key;
|
|
144
|
+
if (node[key] === null) {
|
|
145
|
+
lines.push(prefix + branch + key + " [" + (hashMap[currentPath] || "") + "]");
|
|
146
|
+
} else {
|
|
147
|
+
lines.push(prefix + branch + key + "/");
|
|
148
|
+
lines = lines.concat(printNode(node[key], prefix + (isLast ? " " : "\u2502 "), currentPath));
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
return lines;
|
|
152
|
+
}
|
|
153
|
+
return printNode(tree, "", "").join("\n");
|
|
154
|
+
}
|
|
155
|
+
module2.exports.getFileTreeString = getFileTreeString;
|
|
156
|
+
var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
157
|
+
module2.exports.delay = delay;
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
|
|
24
161
|
// src/package-resolutions-updater.mjs
|
|
162
|
+
init_cjs_shims();
|
|
25
163
|
var import_ansi_colors = __toESM(require("ansi-colors"), 1);
|
|
26
164
|
var dotenv = __toESM(require("dotenv"), 1);
|
|
27
165
|
var import_fs = __toESM(require("fs"), 1);
|
|
28
166
|
var import_https = __toESM(require("https"), 1);
|
|
29
167
|
var import_os = __toESM(require("os"), 1);
|
|
30
168
|
var import_path = __toESM(require("path"), 1);
|
|
169
|
+
var utils = __toESM(require_utils(), 1);
|
|
31
170
|
var projectDir = process.cwd();
|
|
32
171
|
var envPath = import_path.default.join(projectDir, ".env");
|
|
172
|
+
var args = utils.getArgs();
|
|
33
173
|
if (import_fs.default.existsSync(envPath)) dotenv.config({ path: envPath });
|
|
174
|
+
var ACCESS_TOKEN = process.env.GITHUB_TOKEN || process.env.ACCESS_TOKEN;
|
|
175
|
+
if (args.help || args.h) {
|
|
176
|
+
showHelp();
|
|
177
|
+
}
|
|
178
|
+
function showHelp() {
|
|
179
|
+
const helpText = `
|
|
180
|
+
GitHub Package Resolutions Updater
|
|
181
|
+
Usage:
|
|
182
|
+
node src/package-resolutions-updater.mjs [options]
|
|
183
|
+
Options:
|
|
184
|
+
--help, -h Show this help message
|
|
185
|
+
Description:
|
|
186
|
+
Updates the commit hashes in package.json's 'resolutions' field for GitHub tarball URLs to point to the latest commit SHA of the corresponding repository and branch.
|
|
187
|
+
Features:
|
|
188
|
+
- Parses GitHub URLs to extract repository owner, name, and branch.
|
|
189
|
+
- Fetches the latest commit SHA across all branches using GitHub's API.
|
|
190
|
+
- Replaces the old branch or commit in the URL with the latest SHA.
|
|
191
|
+
- Overwrites package.json with the updated URLs.
|
|
192
|
+
Requirements:
|
|
193
|
+
- GitHub Personal Access Token (GITHUB_TOKEN) via .env
|
|
194
|
+
- ESM support (type: "module" in package.json)
|
|
195
|
+
- Node.js v18+ recommended
|
|
196
|
+
Dependencies:
|
|
197
|
+
- ansi-colors \u2013 for styled terminal output
|
|
198
|
+
- dotenv \u2013 to load GitHub token from .env
|
|
199
|
+
Examples:
|
|
200
|
+
node src/package-resolutions-updater.mjs
|
|
201
|
+
node src/package-resolutions-updater.mjs --help
|
|
202
|
+
|
|
203
|
+
`;
|
|
204
|
+
console.log(helpText);
|
|
205
|
+
process.exit(0);
|
|
206
|
+
}
|
|
34
207
|
var specialPackageOverrides = [
|
|
35
208
|
// SBG packages
|
|
36
209
|
{ pkg: "sbg-utility", branch: "sbg-utility", repo: "static-blog-generator", owner: "dimaslanjaka" },
|
|
@@ -106,7 +279,7 @@ function fetchJson(url) {
|
|
|
106
279
|
"User-Agent": selectedUserAgent,
|
|
107
280
|
Accept: "application/vnd.github.v3+json",
|
|
108
281
|
"X-GitHub-Api-Version": "2022-11-28",
|
|
109
|
-
...
|
|
282
|
+
...ACCESS_TOKEN ? { Authorization: `token ${ACCESS_TOKEN}` } : {}
|
|
110
283
|
};
|
|
111
284
|
return new Promise((resolve, reject) => {
|
|
112
285
|
import_https.default.get(url, { headers }, (res) => {
|