binary-collections 2.0.7 → 2.0.9
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/bin/dir-tree.cmd +7 -0
- package/bin/git-diff +4 -0
- package/bin/git-diff.cmd +5 -2
- package/bin/{git-fix-encoding → git-fix} +1 -4
- package/bin/git-fix.cmd +7 -0
- package/bin/nodekill +0 -0
- package/bin/nodekill.ps1 +0 -0
- package/bin/{submodule → submodule.txt} +0 -0
- package/lib/binary-collections-config.cjs +14 -0
- package/lib/binary-collections-config.d.mts +18 -0
- package/lib/binary-collections-config.d.ts +16 -0
- package/lib/binary-collections-config.js +39 -0
- package/lib/binary-collections-config.mjs +6 -0
- package/lib/binary-collections.cjs +123 -0
- package/lib/binary-collections.d.cts +2 -0
- package/lib/binary-collections.d.mts +137 -0
- package/lib/binary-collections.d.ts +137 -0
- package/lib/binary-collections.mjs +300 -0
- package/lib/changelog.cjs +328 -0
- package/lib/changelog.d.mts +2 -0
- package/lib/changelog.d.ts +1 -0
- package/lib/changelog.js +226 -0
- package/lib/changelog.mjs +199 -0
- package/lib/chunk-4BYBVEYC.mjs +30 -0
- package/lib/{chunk-FB6YIQYR.mjs → chunk-AASHBCRW.mjs} +17 -2
- package/lib/chunk-APBWENF6.mjs +135 -0
- package/lib/{chunk-4LEXWIIF.mjs → chunk-DPKAJKFO.mjs} +2 -4
- package/lib/chunk-EGSSKVDH.mjs +66 -0
- package/lib/{chunk-3LOB2P54.mjs → chunk-G3THLIDT.mjs} +3 -5
- package/lib/chunk-JGR2NW6D.mjs +187 -0
- package/lib/chunk-ONIBBBQ3.mjs +108 -0
- package/lib/chunk-SH3L6HHV.mjs +27 -0
- package/lib/chunk-VVEZVNIV.mjs +81 -0
- package/lib/{chunk-JL32QDSH.mjs → chunk-W3ENOM53.mjs} +2 -4
- package/lib/chunk-YV7DO3YV.mjs +48 -0
- package/lib/{chunk-BSD5CIRU.mjs → chunk-YX5U7XDR.mjs} +11 -5
- package/lib/chunk-ZYAQRPUL.mjs +28 -0
- package/lib/clean-github-actions-caches.cjs +162 -0
- package/lib/clean-github-actions-caches.d.cts +1 -0
- package/lib/clean-github-actions-caches.d.mts +169 -0
- package/lib/clean-github-actions-caches.d.ts +169 -0
- package/lib/clean-github-actions-caches.mjs +132 -0
- package/lib/del-gradle.cjs +87 -3
- package/lib/del-gradle.js +1 -1
- package/lib/del-gradle.mjs +4 -6
- package/lib/del-node-modules.cjs +86 -2
- package/lib/del-node-modules.mjs +3 -5
- package/lib/del-ps.cjs +89 -5
- package/lib/del-ps.js +2 -2
- package/lib/del-ps.mjs +6 -8
- package/lib/del-yarn-caches.cjs +86 -2
- package/lib/del-yarn-caches.mjs +3 -5
- package/lib/find-node-modules-cli.cjs +8 -0
- package/lib/find-node-modules-cli.mjs +2 -3
- package/lib/find-node-modules.cjs +8 -0
- package/lib/find-node-modules.d.mts +3 -0
- package/lib/find-node-modules.d.ts +3 -0
- package/lib/find-node-modules.js +12 -0
- package/lib/find-node-modules.mjs +2 -3
- package/lib/git/gitattributes.cjs +171 -0
- package/lib/git/gitattributes.d.mts +35 -0
- package/lib/git/gitattributes.d.ts +33 -0
- package/lib/git/gitattributes.js +223 -0
- package/lib/git/gitattributes.mjs +6 -0
- package/lib/git/line-endings.cjs +74 -0
- package/lib/git/line-endings.d.cts +7 -0
- package/lib/git/line-endings.d.mts +83 -0
- package/lib/git/line-endings.d.ts +83 -0
- package/lib/git/line-endings.mjs +8 -0
- package/lib/git/normalize.cjs +42 -0
- package/lib/git/normalize.d.cts +6 -0
- package/lib/git/normalize.d.mts +43 -0
- package/lib/git/normalize.d.ts +43 -0
- package/lib/git/normalize.mjs +6 -0
- package/lib/git/permissions.cjs +15 -0
- package/lib/git/permissions.d.cts +6 -0
- package/lib/git/permissions.d.mts +17 -0
- package/lib/git/permissions.d.ts +17 -0
- package/lib/git/permissions.mjs +7 -0
- package/lib/git/pull-strategy.cjs +13 -0
- package/lib/git/pull-strategy.d.cts +5 -0
- package/lib/git/pull-strategy.d.mts +15 -0
- package/lib/git/pull-strategy.d.ts +15 -0
- package/lib/git/pull-strategy.mjs +7 -0
- package/lib/git/user-config.cjs +100 -0
- package/lib/git/user-config.d.cts +10 -0
- package/lib/git/user-config.d.mts +105 -0
- package/lib/git/user-config.d.ts +105 -0
- package/lib/git/user-config.mjs +8 -0
- package/lib/git/utils.cjs +70 -0
- package/lib/git/utils.d.cts +20 -0
- package/lib/git/utils.d.mts +69 -0
- package/lib/git/utils.d.ts +69 -0
- package/lib/git/utils.mjs +6 -0
- package/lib/git-diff.cjs +23 -24
- package/lib/git-diff.d.mts +25 -28
- package/lib/git-diff.d.ts +25 -28
- package/lib/git-diff.mjs +32 -27
- package/lib/git-fix.cjs +129 -0
- package/lib/git-fix.d.cts +2 -0
- package/lib/git-fix.d.mts +141 -0
- package/lib/git-fix.d.ts +141 -0
- package/lib/git-fix.mjs +151 -0
- package/lib/git-purge.cjs +86 -2
- package/lib/git-purge.mjs +3 -5
- package/lib/index.cjs +8 -0
- package/lib/index.mjs +3 -5
- package/lib/npm-run-series.cjs +140 -1
- package/lib/npm-run-series.js +2 -1
- package/lib/npm-run-series.mjs +7 -5
- package/lib/package-resolutions-updater.cjs +447 -0
- package/lib/package-resolutions-updater.d.mts +1 -0
- package/lib/package-resolutions-updater.d.ts +352 -0
- package/lib/package-resolutions-updater.mjs +339 -0
- package/lib/print-directory-tree.cjs +241 -0
- package/lib/print-directory-tree.d.cts +1 -0
- package/lib/print-directory-tree.d.mts +234 -0
- package/lib/print-directory-tree.d.ts +234 -0
- package/lib/print-directory-tree.mjs +182 -0
- package/lib/ps/connected-domain.mjs +2 -3
- package/lib/ps/index.cjs +3 -3
- package/lib/ps/index.d.mjs +1 -2
- package/lib/ps/index.js +6 -3
- package/lib/ps/index.mjs +9 -11
- package/lib/ps/isWin.mjs +2 -3
- package/lib/ps/table-parser.mjs +3 -4
- package/lib/submodule-install.cjs +18 -35
- package/lib/submodule-install.d.mts +17 -37
- package/lib/submodule-install.d.ts +17 -37
- package/lib/submodule-install.mjs +21 -29
- package/lib/utils.cjs +86 -2
- package/lib/utils.d.mts +29 -9
- package/lib/utils.d.ts +28 -8
- package/lib/utils.js +139 -8
- package/lib/utils.mjs +2 -3
- package/lib/yarn-reinstall.cjs +9 -7
- package/lib/yarn-reinstall.d.mts +12 -8
- package/lib/yarn-reinstall.d.ts +12 -8
- package/lib/yarn-reinstall.mjs +14 -10
- package/package.json +109 -80
- package/readme.md +74 -11
- package/src/package-resolutions-updater.mjs +350 -0
- package/src/print-directory-tree.cjs +234 -0
- package/src/ps/index.js +4 -3
- package/src/yarn-reinstall.cjs +49 -0
- package/test-project/package.json +16 -0
- package/tmp/test-repo/package.json +7 -0
- package/bin/git-fix-encoding.cmd +0 -6
- package/lib/chunk-OKYLF2MU.mjs +0 -53
- package/lib/chunk-VXZQNLPU.mjs +0 -23
- package/lib/package-resolutions.cjs +0 -28
- package/lib/package-resolutions.d.mts +0 -25
- package/lib/package-resolutions.d.ts +0 -25
- package/lib/package-resolutions.mjs +0 -31
- /package/bin/{submodule-install → submodule-install.txt} +0 -0
package/lib/del-gradle.cjs
CHANGED
|
@@ -16,11 +16,56 @@ var init_cjs_shims = __esm({
|
|
|
16
16
|
var require_utils = __commonJS({
|
|
17
17
|
"src/utils.js"(exports2, module2) {
|
|
18
18
|
init_cjs_shims();
|
|
19
|
-
var
|
|
19
|
+
var fs = require("fs");
|
|
20
|
+
var path2 = require("upath");
|
|
20
21
|
var argv = require("minimist")(process.argv.slice(2));
|
|
22
|
+
var { exec } = require("child_process");
|
|
23
|
+
var { URL: URL2 } = require("url");
|
|
24
|
+
var { promisify } = require("util");
|
|
25
|
+
var execAsync = promisify(exec);
|
|
26
|
+
async function parseGitRemotes() {
|
|
27
|
+
try {
|
|
28
|
+
const { stdout } = await execAsync("git remote -v");
|
|
29
|
+
const lines = stdout.split("\n");
|
|
30
|
+
const remotes = {};
|
|
31
|
+
lines.forEach((line) => {
|
|
32
|
+
const [name, url] = line.split(" ");
|
|
33
|
+
if (name && url) {
|
|
34
|
+
const [repoUrl] = url.split(" ");
|
|
35
|
+
try {
|
|
36
|
+
const parsedUrl = new URL2(repoUrl);
|
|
37
|
+
const pathParts = parsedUrl.pathname.split("/").filter(Boolean);
|
|
38
|
+
if (parsedUrl.hostname === "github.com" && pathParts.length === 2) {
|
|
39
|
+
let repoPath = pathParts.join("/");
|
|
40
|
+
if (repoPath.endsWith(".git")) {
|
|
41
|
+
repoPath = repoPath.slice(0, -4);
|
|
42
|
+
}
|
|
43
|
+
remotes[name] = repoPath;
|
|
44
|
+
}
|
|
45
|
+
} catch (e) {
|
|
46
|
+
console.error("URL Parsing Error:", e.message);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return remotes;
|
|
51
|
+
} catch (error) {
|
|
52
|
+
console.error("Error:", error.message);
|
|
53
|
+
return {};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
module2.exports.parseGitRemotes = parseGitRemotes;
|
|
57
|
+
function joinPathPreserveDriveLetter(...segments) {
|
|
58
|
+
let fullPath = require("path").join(...segments);
|
|
59
|
+
if (/^[a-z]:\\/.test(fullPath)) {
|
|
60
|
+
fullPath = fullPath.charAt(0).toUpperCase() + fullPath.slice(1);
|
|
61
|
+
}
|
|
62
|
+
return fullPath;
|
|
63
|
+
}
|
|
64
|
+
module2.exports.joinPathPreserveDriveLetter = joinPathPreserveDriveLetter;
|
|
21
65
|
function getArgs() {
|
|
22
66
|
return argv;
|
|
23
67
|
}
|
|
68
|
+
module2.exports.getArgs = getArgs;
|
|
24
69
|
function del2(fullPath) {
|
|
25
70
|
if (fs.statSync(fullPath).isDirectory()) {
|
|
26
71
|
const subdir = fs.readdirSync(fullPath).map((dirPath) => path2.resolve(fullPath, dirPath));
|
|
@@ -36,6 +81,7 @@ var require_utils = __commonJS({
|
|
|
36
81
|
}
|
|
37
82
|
}
|
|
38
83
|
}
|
|
84
|
+
module2.exports.del = del2;
|
|
39
85
|
function delStream(globStream2) {
|
|
40
86
|
globStream2.stream().on("data", (result) => {
|
|
41
87
|
const fullPath = path2.resolve(process.cwd(), result);
|
|
@@ -48,15 +94,53 @@ var require_utils = __commonJS({
|
|
|
48
94
|
del2(fullPath);
|
|
49
95
|
});
|
|
50
96
|
}
|
|
97
|
+
module2.exports.delStream = delStream;
|
|
98
|
+
function getFileTreeString(hashArray) {
|
|
99
|
+
const tree = {};
|
|
100
|
+
const hashMap = {};
|
|
101
|
+
for (const entry of hashArray) {
|
|
102
|
+
const [filePath, hash] = entry.split(" ");
|
|
103
|
+
hashMap[filePath] = hash;
|
|
104
|
+
const parts = filePath.split("/");
|
|
105
|
+
let current = tree;
|
|
106
|
+
for (let i = 0; i < parts.length; i++) {
|
|
107
|
+
const part = parts[i];
|
|
108
|
+
if (i === parts.length - 1) {
|
|
109
|
+
current[part] = null;
|
|
110
|
+
} else {
|
|
111
|
+
current[part] = current[part] || {};
|
|
112
|
+
current = current[part];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function printNode(node, prefix = "", parentPath = "") {
|
|
117
|
+
const keys = Object.keys(node).sort();
|
|
118
|
+
let lines = [];
|
|
119
|
+
keys.forEach((key, idx) => {
|
|
120
|
+
const isLast = idx === keys.length - 1;
|
|
121
|
+
const branch = isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ";
|
|
122
|
+
const currentPath = parentPath ? parentPath + "/" + key : key;
|
|
123
|
+
if (node[key] === null) {
|
|
124
|
+
lines.push(prefix + branch + key + " [" + (hashMap[currentPath] || "") + "]");
|
|
125
|
+
} else {
|
|
126
|
+
lines.push(prefix + branch + key + "/");
|
|
127
|
+
lines = lines.concat(printNode(node[key], prefix + (isLast ? " " : "\u2502 "), currentPath));
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
return lines;
|
|
131
|
+
}
|
|
132
|
+
return printNode(tree, "", "").join("\n");
|
|
133
|
+
}
|
|
134
|
+
module2.exports.getFileTreeString = getFileTreeString;
|
|
51
135
|
var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
52
|
-
module2.exports =
|
|
136
|
+
module2.exports.delay = delay;
|
|
53
137
|
}
|
|
54
138
|
});
|
|
55
139
|
|
|
56
140
|
// src/del-gradle.js
|
|
57
141
|
init_cjs_shims();
|
|
58
142
|
var glob = require("glob");
|
|
59
|
-
var
|
|
143
|
+
var path = require("upath");
|
|
60
144
|
var { del } = require_utils();
|
|
61
145
|
var globStream = new glob.Glob(["**/build.gradle"], {
|
|
62
146
|
withFileTypes: false,
|
package/lib/del-gradle.js
CHANGED
package/lib/del-gradle.mjs
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
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-APBWENF6.mjs";
|
|
5
5
|
import {
|
|
6
|
+
__require,
|
|
6
7
|
init_esm_shims
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import {
|
|
9
|
-
__require
|
|
10
|
-
} from "./chunk-FB6YIQYR.mjs";
|
|
8
|
+
} from "./chunk-AASHBCRW.mjs";
|
|
11
9
|
|
|
12
10
|
// src/del-gradle.js
|
|
13
11
|
init_esm_shims();
|
|
14
12
|
var glob = __require("glob");
|
|
15
|
-
var
|
|
13
|
+
var path = __require("upath");
|
|
16
14
|
var { del } = require_utils();
|
|
17
15
|
var globStream = new glob.Glob(["**/build.gradle"], {
|
|
18
16
|
withFileTypes: false,
|
package/lib/del-node-modules.cjs
CHANGED
|
@@ -16,11 +16,56 @@ var init_cjs_shims = __esm({
|
|
|
16
16
|
var require_utils = __commonJS({
|
|
17
17
|
"src/utils.js"(exports2, module2) {
|
|
18
18
|
init_cjs_shims();
|
|
19
|
-
var
|
|
19
|
+
var fs = require("fs");
|
|
20
|
+
var path = require("upath");
|
|
20
21
|
var argv = require("minimist")(process.argv.slice(2));
|
|
22
|
+
var { exec } = require("child_process");
|
|
23
|
+
var { URL: URL2 } = require("url");
|
|
24
|
+
var { promisify } = require("util");
|
|
25
|
+
var execAsync = promisify(exec);
|
|
26
|
+
async function parseGitRemotes() {
|
|
27
|
+
try {
|
|
28
|
+
const { stdout } = await execAsync("git remote -v");
|
|
29
|
+
const lines = stdout.split("\n");
|
|
30
|
+
const remotes = {};
|
|
31
|
+
lines.forEach((line) => {
|
|
32
|
+
const [name, url] = line.split(" ");
|
|
33
|
+
if (name && url) {
|
|
34
|
+
const [repoUrl] = url.split(" ");
|
|
35
|
+
try {
|
|
36
|
+
const parsedUrl = new URL2(repoUrl);
|
|
37
|
+
const pathParts = parsedUrl.pathname.split("/").filter(Boolean);
|
|
38
|
+
if (parsedUrl.hostname === "github.com" && pathParts.length === 2) {
|
|
39
|
+
let repoPath = pathParts.join("/");
|
|
40
|
+
if (repoPath.endsWith(".git")) {
|
|
41
|
+
repoPath = repoPath.slice(0, -4);
|
|
42
|
+
}
|
|
43
|
+
remotes[name] = repoPath;
|
|
44
|
+
}
|
|
45
|
+
} catch (e) {
|
|
46
|
+
console.error("URL Parsing Error:", e.message);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return remotes;
|
|
51
|
+
} catch (error) {
|
|
52
|
+
console.error("Error:", error.message);
|
|
53
|
+
return {};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
module2.exports.parseGitRemotes = parseGitRemotes;
|
|
57
|
+
function joinPathPreserveDriveLetter(...segments) {
|
|
58
|
+
let fullPath = require("path").join(...segments);
|
|
59
|
+
if (/^[a-z]:\\/.test(fullPath)) {
|
|
60
|
+
fullPath = fullPath.charAt(0).toUpperCase() + fullPath.slice(1);
|
|
61
|
+
}
|
|
62
|
+
return fullPath;
|
|
63
|
+
}
|
|
64
|
+
module2.exports.joinPathPreserveDriveLetter = joinPathPreserveDriveLetter;
|
|
21
65
|
function getArgs() {
|
|
22
66
|
return argv;
|
|
23
67
|
}
|
|
68
|
+
module2.exports.getArgs = getArgs;
|
|
24
69
|
function del(fullPath) {
|
|
25
70
|
if (fs.statSync(fullPath).isDirectory()) {
|
|
26
71
|
const subdir = fs.readdirSync(fullPath).map((dirPath) => path.resolve(fullPath, dirPath));
|
|
@@ -36,6 +81,7 @@ var require_utils = __commonJS({
|
|
|
36
81
|
}
|
|
37
82
|
}
|
|
38
83
|
}
|
|
84
|
+
module2.exports.del = del;
|
|
39
85
|
function delStream2(globStream) {
|
|
40
86
|
globStream.stream().on("data", (result) => {
|
|
41
87
|
const fullPath = path.resolve(process.cwd(), result);
|
|
@@ -48,8 +94,46 @@ var require_utils = __commonJS({
|
|
|
48
94
|
del(fullPath);
|
|
49
95
|
});
|
|
50
96
|
}
|
|
97
|
+
module2.exports.delStream = delStream2;
|
|
98
|
+
function getFileTreeString(hashArray) {
|
|
99
|
+
const tree = {};
|
|
100
|
+
const hashMap = {};
|
|
101
|
+
for (const entry of hashArray) {
|
|
102
|
+
const [filePath, hash] = entry.split(" ");
|
|
103
|
+
hashMap[filePath] = hash;
|
|
104
|
+
const parts = filePath.split("/");
|
|
105
|
+
let current = tree;
|
|
106
|
+
for (let i = 0; i < parts.length; i++) {
|
|
107
|
+
const part = parts[i];
|
|
108
|
+
if (i === parts.length - 1) {
|
|
109
|
+
current[part] = null;
|
|
110
|
+
} else {
|
|
111
|
+
current[part] = current[part] || {};
|
|
112
|
+
current = current[part];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function printNode(node, prefix = "", parentPath = "") {
|
|
117
|
+
const keys = Object.keys(node).sort();
|
|
118
|
+
let lines = [];
|
|
119
|
+
keys.forEach((key, idx) => {
|
|
120
|
+
const isLast = idx === keys.length - 1;
|
|
121
|
+
const branch = isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ";
|
|
122
|
+
const currentPath = parentPath ? parentPath + "/" + key : key;
|
|
123
|
+
if (node[key] === null) {
|
|
124
|
+
lines.push(prefix + branch + key + " [" + (hashMap[currentPath] || "") + "]");
|
|
125
|
+
} else {
|
|
126
|
+
lines.push(prefix + branch + key + "/");
|
|
127
|
+
lines = lines.concat(printNode(node[key], prefix + (isLast ? " " : "\u2502 "), currentPath));
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
return lines;
|
|
131
|
+
}
|
|
132
|
+
return printNode(tree, "", "").join("\n");
|
|
133
|
+
}
|
|
134
|
+
module2.exports.getFileTreeString = getFileTreeString;
|
|
51
135
|
var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
52
|
-
module2.exports =
|
|
136
|
+
module2.exports.delay = delay;
|
|
53
137
|
}
|
|
54
138
|
});
|
|
55
139
|
|
package/lib/del-node-modules.mjs
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
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-APBWENF6.mjs";
|
|
5
5
|
import {
|
|
6
|
+
__require,
|
|
6
7
|
init_esm_shims
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import {
|
|
9
|
-
__require
|
|
10
|
-
} from "./chunk-FB6YIQYR.mjs";
|
|
8
|
+
} from "./chunk-AASHBCRW.mjs";
|
|
11
9
|
|
|
12
10
|
// src/del-node-modules.js
|
|
13
11
|
init_esm_shims();
|
package/lib/del-ps.cjs
CHANGED
|
@@ -25,11 +25,56 @@ var require_isWin = __commonJS({
|
|
|
25
25
|
var require_utils = __commonJS({
|
|
26
26
|
"src/utils.js"(exports2, module2) {
|
|
27
27
|
init_cjs_shims();
|
|
28
|
-
var
|
|
28
|
+
var fs = require("fs");
|
|
29
|
+
var path = require("upath");
|
|
29
30
|
var argv = require("minimist")(process.argv.slice(2));
|
|
30
|
-
|
|
31
|
+
var { exec } = require("child_process");
|
|
32
|
+
var { URL: URL2 } = require("url");
|
|
33
|
+
var { promisify } = require("util");
|
|
34
|
+
var execAsync = promisify(exec);
|
|
35
|
+
async function parseGitRemotes() {
|
|
36
|
+
try {
|
|
37
|
+
const { stdout } = await execAsync("git remote -v");
|
|
38
|
+
const lines = stdout.split("\n");
|
|
39
|
+
const remotes = {};
|
|
40
|
+
lines.forEach((line) => {
|
|
41
|
+
const [name, url] = line.split(" ");
|
|
42
|
+
if (name && url) {
|
|
43
|
+
const [repoUrl] = url.split(" ");
|
|
44
|
+
try {
|
|
45
|
+
const parsedUrl = new URL2(repoUrl);
|
|
46
|
+
const pathParts = parsedUrl.pathname.split("/").filter(Boolean);
|
|
47
|
+
if (parsedUrl.hostname === "github.com" && pathParts.length === 2) {
|
|
48
|
+
let repoPath = pathParts.join("/");
|
|
49
|
+
if (repoPath.endsWith(".git")) {
|
|
50
|
+
repoPath = repoPath.slice(0, -4);
|
|
51
|
+
}
|
|
52
|
+
remotes[name] = repoPath;
|
|
53
|
+
}
|
|
54
|
+
} catch (e) {
|
|
55
|
+
console.error("URL Parsing Error:", e.message);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return remotes;
|
|
60
|
+
} catch (error) {
|
|
61
|
+
console.error("Error:", error.message);
|
|
62
|
+
return {};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
module2.exports.parseGitRemotes = parseGitRemotes;
|
|
66
|
+
function joinPathPreserveDriveLetter(...segments) {
|
|
67
|
+
let fullPath = require("path").join(...segments);
|
|
68
|
+
if (/^[a-z]:\\/.test(fullPath)) {
|
|
69
|
+
fullPath = fullPath.charAt(0).toUpperCase() + fullPath.slice(1);
|
|
70
|
+
}
|
|
71
|
+
return fullPath;
|
|
72
|
+
}
|
|
73
|
+
module2.exports.joinPathPreserveDriveLetter = joinPathPreserveDriveLetter;
|
|
74
|
+
function getArgs2() {
|
|
31
75
|
return argv;
|
|
32
76
|
}
|
|
77
|
+
module2.exports.getArgs = getArgs2;
|
|
33
78
|
function del(fullPath) {
|
|
34
79
|
if (fs.statSync(fullPath).isDirectory()) {
|
|
35
80
|
const subdir = fs.readdirSync(fullPath).map((dirPath) => path.resolve(fullPath, dirPath));
|
|
@@ -45,6 +90,7 @@ var require_utils = __commonJS({
|
|
|
45
90
|
}
|
|
46
91
|
}
|
|
47
92
|
}
|
|
93
|
+
module2.exports.del = del;
|
|
48
94
|
function delStream(globStream) {
|
|
49
95
|
globStream.stream().on("data", (result) => {
|
|
50
96
|
const fullPath = path.resolve(process.cwd(), result);
|
|
@@ -57,8 +103,46 @@ var require_utils = __commonJS({
|
|
|
57
103
|
del(fullPath);
|
|
58
104
|
});
|
|
59
105
|
}
|
|
106
|
+
module2.exports.delStream = delStream;
|
|
107
|
+
function getFileTreeString(hashArray) {
|
|
108
|
+
const tree = {};
|
|
109
|
+
const hashMap = {};
|
|
110
|
+
for (const entry of hashArray) {
|
|
111
|
+
const [filePath, hash] = entry.split(" ");
|
|
112
|
+
hashMap[filePath] = hash;
|
|
113
|
+
const parts = filePath.split("/");
|
|
114
|
+
let current = tree;
|
|
115
|
+
for (let i = 0; i < parts.length; i++) {
|
|
116
|
+
const part = parts[i];
|
|
117
|
+
if (i === parts.length - 1) {
|
|
118
|
+
current[part] = null;
|
|
119
|
+
} else {
|
|
120
|
+
current[part] = current[part] || {};
|
|
121
|
+
current = current[part];
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function printNode(node, prefix = "", parentPath = "") {
|
|
126
|
+
const keys = Object.keys(node).sort();
|
|
127
|
+
let lines = [];
|
|
128
|
+
keys.forEach((key, idx) => {
|
|
129
|
+
const isLast = idx === keys.length - 1;
|
|
130
|
+
const branch = isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ";
|
|
131
|
+
const currentPath = parentPath ? parentPath + "/" + key : key;
|
|
132
|
+
if (node[key] === null) {
|
|
133
|
+
lines.push(prefix + branch + key + " [" + (hashMap[currentPath] || "") + "]");
|
|
134
|
+
} else {
|
|
135
|
+
lines.push(prefix + branch + key + "/");
|
|
136
|
+
lines = lines.concat(printNode(node[key], prefix + (isLast ? " " : "\u2502 "), currentPath));
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
return lines;
|
|
140
|
+
}
|
|
141
|
+
return printNode(tree, "", "").join("\n");
|
|
142
|
+
}
|
|
143
|
+
module2.exports.getFileTreeString = getFileTreeString;
|
|
60
144
|
var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
61
|
-
module2.exports =
|
|
145
|
+
module2.exports.delay = delay;
|
|
62
146
|
}
|
|
63
147
|
});
|
|
64
148
|
|
|
@@ -67,8 +151,8 @@ init_cjs_shims();
|
|
|
67
151
|
var crossSpawn = require("cross-spawn");
|
|
68
152
|
var ps = require("ps-node");
|
|
69
153
|
var isWin = require_isWin();
|
|
70
|
-
var
|
|
71
|
-
|
|
154
|
+
var { getArgs } = require_utils();
|
|
155
|
+
getArgs()._.forEach((command) => {
|
|
72
156
|
ps.lookup(
|
|
73
157
|
{
|
|
74
158
|
command,
|
package/lib/del-ps.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const crossSpawn = require("cross-spawn");
|
|
2
2
|
const ps = require("ps-node");
|
|
3
3
|
const isWin = require("./ps/isWin");
|
|
4
|
-
const
|
|
5
|
-
|
|
4
|
+
const { getArgs } = require("./utils.js");
|
|
5
|
+
getArgs()._.forEach((command) => {
|
|
6
6
|
ps.lookup({
|
|
7
7
|
command,
|
|
8
8
|
psargs: "ux"
|
package/lib/del-ps.mjs
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
require_isWin
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-W3ENOM53.mjs";
|
|
5
5
|
import {
|
|
6
6
|
require_utils
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-APBWENF6.mjs";
|
|
8
8
|
import {
|
|
9
|
+
__require,
|
|
9
10
|
init_esm_shims
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import {
|
|
12
|
-
__require
|
|
13
|
-
} from "./chunk-FB6YIQYR.mjs";
|
|
11
|
+
} from "./chunk-AASHBCRW.mjs";
|
|
14
12
|
|
|
15
13
|
// src/del-ps.js
|
|
16
14
|
init_esm_shims();
|
|
17
15
|
var crossSpawn = __require("cross-spawn");
|
|
18
16
|
var ps = __require("ps-node");
|
|
19
17
|
var isWin = require_isWin();
|
|
20
|
-
var
|
|
21
|
-
|
|
18
|
+
var { getArgs } = require_utils();
|
|
19
|
+
getArgs()._.forEach((command) => {
|
|
22
20
|
ps.lookup(
|
|
23
21
|
{
|
|
24
22
|
command,
|
package/lib/del-yarn-caches.cjs
CHANGED
|
@@ -16,11 +16,56 @@ var init_cjs_shims = __esm({
|
|
|
16
16
|
var require_utils = __commonJS({
|
|
17
17
|
"src/utils.js"(exports2, module2) {
|
|
18
18
|
init_cjs_shims();
|
|
19
|
-
var
|
|
19
|
+
var fs = require("fs");
|
|
20
|
+
var path = require("upath");
|
|
20
21
|
var argv = require("minimist")(process.argv.slice(2));
|
|
22
|
+
var { exec } = require("child_process");
|
|
23
|
+
var { URL: URL2 } = require("url");
|
|
24
|
+
var { promisify } = require("util");
|
|
25
|
+
var execAsync = promisify(exec);
|
|
26
|
+
async function parseGitRemotes() {
|
|
27
|
+
try {
|
|
28
|
+
const { stdout } = await execAsync("git remote -v");
|
|
29
|
+
const lines = stdout.split("\n");
|
|
30
|
+
const remotes = {};
|
|
31
|
+
lines.forEach((line) => {
|
|
32
|
+
const [name, url] = line.split(" ");
|
|
33
|
+
if (name && url) {
|
|
34
|
+
const [repoUrl] = url.split(" ");
|
|
35
|
+
try {
|
|
36
|
+
const parsedUrl = new URL2(repoUrl);
|
|
37
|
+
const pathParts = parsedUrl.pathname.split("/").filter(Boolean);
|
|
38
|
+
if (parsedUrl.hostname === "github.com" && pathParts.length === 2) {
|
|
39
|
+
let repoPath = pathParts.join("/");
|
|
40
|
+
if (repoPath.endsWith(".git")) {
|
|
41
|
+
repoPath = repoPath.slice(0, -4);
|
|
42
|
+
}
|
|
43
|
+
remotes[name] = repoPath;
|
|
44
|
+
}
|
|
45
|
+
} catch (e) {
|
|
46
|
+
console.error("URL Parsing Error:", e.message);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return remotes;
|
|
51
|
+
} catch (error) {
|
|
52
|
+
console.error("Error:", error.message);
|
|
53
|
+
return {};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
module2.exports.parseGitRemotes = parseGitRemotes;
|
|
57
|
+
function joinPathPreserveDriveLetter(...segments) {
|
|
58
|
+
let fullPath = require("path").join(...segments);
|
|
59
|
+
if (/^[a-z]:\\/.test(fullPath)) {
|
|
60
|
+
fullPath = fullPath.charAt(0).toUpperCase() + fullPath.slice(1);
|
|
61
|
+
}
|
|
62
|
+
return fullPath;
|
|
63
|
+
}
|
|
64
|
+
module2.exports.joinPathPreserveDriveLetter = joinPathPreserveDriveLetter;
|
|
21
65
|
function getArgs() {
|
|
22
66
|
return argv;
|
|
23
67
|
}
|
|
68
|
+
module2.exports.getArgs = getArgs;
|
|
24
69
|
function del(fullPath) {
|
|
25
70
|
if (fs.statSync(fullPath).isDirectory()) {
|
|
26
71
|
const subdir = fs.readdirSync(fullPath).map((dirPath) => path.resolve(fullPath, dirPath));
|
|
@@ -36,6 +81,7 @@ var require_utils = __commonJS({
|
|
|
36
81
|
}
|
|
37
82
|
}
|
|
38
83
|
}
|
|
84
|
+
module2.exports.del = del;
|
|
39
85
|
function delStream2(globStream) {
|
|
40
86
|
globStream.stream().on("data", (result) => {
|
|
41
87
|
const fullPath = path.resolve(process.cwd(), result);
|
|
@@ -48,8 +94,46 @@ var require_utils = __commonJS({
|
|
|
48
94
|
del(fullPath);
|
|
49
95
|
});
|
|
50
96
|
}
|
|
97
|
+
module2.exports.delStream = delStream2;
|
|
98
|
+
function getFileTreeString(hashArray) {
|
|
99
|
+
const tree = {};
|
|
100
|
+
const hashMap = {};
|
|
101
|
+
for (const entry of hashArray) {
|
|
102
|
+
const [filePath, hash] = entry.split(" ");
|
|
103
|
+
hashMap[filePath] = hash;
|
|
104
|
+
const parts = filePath.split("/");
|
|
105
|
+
let current = tree;
|
|
106
|
+
for (let i = 0; i < parts.length; i++) {
|
|
107
|
+
const part = parts[i];
|
|
108
|
+
if (i === parts.length - 1) {
|
|
109
|
+
current[part] = null;
|
|
110
|
+
} else {
|
|
111
|
+
current[part] = current[part] || {};
|
|
112
|
+
current = current[part];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function printNode(node, prefix = "", parentPath = "") {
|
|
117
|
+
const keys = Object.keys(node).sort();
|
|
118
|
+
let lines = [];
|
|
119
|
+
keys.forEach((key, idx) => {
|
|
120
|
+
const isLast = idx === keys.length - 1;
|
|
121
|
+
const branch = isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ";
|
|
122
|
+
const currentPath = parentPath ? parentPath + "/" + key : key;
|
|
123
|
+
if (node[key] === null) {
|
|
124
|
+
lines.push(prefix + branch + key + " [" + (hashMap[currentPath] || "") + "]");
|
|
125
|
+
} else {
|
|
126
|
+
lines.push(prefix + branch + key + "/");
|
|
127
|
+
lines = lines.concat(printNode(node[key], prefix + (isLast ? " " : "\u2502 "), currentPath));
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
return lines;
|
|
131
|
+
}
|
|
132
|
+
return printNode(tree, "", "").join("\n");
|
|
133
|
+
}
|
|
134
|
+
module2.exports.getFileTreeString = getFileTreeString;
|
|
51
135
|
var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
52
|
-
module2.exports =
|
|
136
|
+
module2.exports.delay = delay;
|
|
53
137
|
}
|
|
54
138
|
});
|
|
55
139
|
|
package/lib/del-yarn-caches.mjs
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
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-APBWENF6.mjs";
|
|
5
5
|
import {
|
|
6
|
+
__require,
|
|
6
7
|
init_esm_shims
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import {
|
|
9
|
-
__require
|
|
10
|
-
} from "./chunk-FB6YIQYR.mjs";
|
|
8
|
+
} from "./chunk-AASHBCRW.mjs";
|
|
11
9
|
|
|
12
10
|
// src/del-yarn-caches.js
|
|
13
11
|
init_esm_shims();
|
|
@@ -49,7 +49,15 @@ var require_find_node_modules = __commonJS({
|
|
|
49
49
|
});
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
+
if (typeof module2 !== "undefined" && require.main === module2) {
|
|
53
|
+
findNodeModules2(null, console.log).then((dirs) => {
|
|
54
|
+
console.log(`Found ${dirs.length} node_modules directories.`);
|
|
55
|
+
}).catch((err) => {
|
|
56
|
+
console.error("Error finding node_modules directories:", err);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
52
59
|
module2.exports = findNodeModules2;
|
|
60
|
+
module2.exports.default = findNodeModules2;
|
|
53
61
|
}
|
|
54
62
|
});
|
|
55
63
|
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
require_find_node_modules
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YX5U7XDR.mjs";
|
|
6
6
|
import {
|
|
7
7
|
init_esm_shims
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-FB6YIQYR.mjs";
|
|
8
|
+
} from "./chunk-AASHBCRW.mjs";
|
|
10
9
|
|
|
11
10
|
// src/find-node-modules-cli.js
|
|
12
11
|
init_esm_shims();
|
|
@@ -31,4 +31,12 @@ function findNodeModules(dir = process.cwd(), callback = null) {
|
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
+
if (typeof module !== "undefined" && require.main === module) {
|
|
35
|
+
findNodeModules(null, console.log).then((dirs) => {
|
|
36
|
+
console.log(`Found ${dirs.length} node_modules directories.`);
|
|
37
|
+
}).catch((err) => {
|
|
38
|
+
console.error("Error finding node_modules directories:", err);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
34
41
|
module.exports = findNodeModules;
|
|
42
|
+
module.exports.default = findNodeModules;
|
|
@@ -6,5 +6,8 @@
|
|
|
6
6
|
* @returns {Promise<string[]>} - A promise that resolves to an array of full paths to "node_modules" directories.
|
|
7
7
|
*/
|
|
8
8
|
declare function findNodeModules(dir?: string, callback?: Function): Promise<string[]>;
|
|
9
|
+
declare namespace findNodeModules {
|
|
10
|
+
export { findNodeModules as default };
|
|
11
|
+
}
|
|
9
12
|
|
|
10
13
|
export { findNodeModules as default };
|
|
@@ -7,3 +7,6 @@ export = findNodeModules;
|
|
|
7
7
|
* @returns {Promise<string[]>} - A promise that resolves to an array of full paths to "node_modules" directories.
|
|
8
8
|
*/
|
|
9
9
|
declare function findNodeModules(dir?: string, callback?: Function): Promise<string[]>;
|
|
10
|
+
declare namespace findNodeModules {
|
|
11
|
+
export { findNodeModules as default };
|
|
12
|
+
}
|
package/lib/find-node-modules.js
CHANGED
|
@@ -38,4 +38,16 @@ function findNodeModules(dir = process.cwd(), callback = null) {
|
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
+
// Support both CommonJS and ESM usage
|
|
42
|
+
if (typeof module !== "undefined" && require.main === module) {
|
|
43
|
+
findNodeModules(null, console.log)
|
|
44
|
+
.then((dirs) => {
|
|
45
|
+
console.log(`Found ${dirs.length} node_modules directories.`);
|
|
46
|
+
})
|
|
47
|
+
.catch((err) => {
|
|
48
|
+
console.error("Error finding node_modules directories:", err);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
// ESM export support
|
|
41
52
|
module.exports = findNodeModules;
|
|
53
|
+
module.exports.default = findNodeModules;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
require_find_node_modules
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-FB6YIQYR.mjs";
|
|
4
|
+
} from "./chunk-YX5U7XDR.mjs";
|
|
5
|
+
import "./chunk-AASHBCRW.mjs";
|
|
7
6
|
export default require_find_node_modules();
|