binary-collections 2.0.7 → 2.0.8
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 +105 -0
- package/lib/binary-collections.d.cts +2 -0
- package/lib/binary-collections.d.mts +121 -0
- package/lib/binary-collections.d.ts +121 -0
- package/lib/binary-collections.mjs +108 -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 +274 -0
- package/lib/package-resolutions-updater.d.mts +1 -0
- package/lib/package-resolutions-updater.d.ts +326 -0
- package/lib/package-resolutions-updater.mjs +316 -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 +13 -31
- package/lib/submodule-install.d.mts +12 -32
- package/lib/submodule-install.d.ts +12 -32
- package/lib/submodule-install.mjs +16 -25
- 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 +325 -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/utils.js
CHANGED
|
@@ -1,11 +1,94 @@
|
|
|
1
|
-
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
const fs = require("fs");
|
|
11
|
+
const path = require("upath");
|
|
2
12
|
const argv = require("minimist")(process.argv.slice(2));
|
|
13
|
+
const { exec } = require("child_process");
|
|
14
|
+
const { URL } = require("url");
|
|
15
|
+
const { promisify } = require("util");
|
|
16
|
+
/**
|
|
17
|
+
* Promisified version of Node.js exec function for async shell command execution.
|
|
18
|
+
* @type {(command: string) => Promise<{ stdout: string, stderr: string }>}
|
|
19
|
+
*/
|
|
20
|
+
const execAsync = promisify(exec);
|
|
21
|
+
function parseGitRemotes() {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
try {
|
|
24
|
+
// Run the `git remote -v` command
|
|
25
|
+
const { stdout } = yield execAsync("git remote -v");
|
|
26
|
+
// Split the output into lines
|
|
27
|
+
const lines = stdout.split("\n");
|
|
28
|
+
// Object to hold the remotes
|
|
29
|
+
const remotes = {};
|
|
30
|
+
// Process each line
|
|
31
|
+
lines.forEach((line) => {
|
|
32
|
+
const [name, url] = line.split("\t");
|
|
33
|
+
if (name && url) {
|
|
34
|
+
const [repoUrl] = url.split(" ");
|
|
35
|
+
try {
|
|
36
|
+
// Parse the URL
|
|
37
|
+
const parsedUrl = new URL(repoUrl);
|
|
38
|
+
// Extract the path from the URL
|
|
39
|
+
const pathParts = parsedUrl.pathname.split("/").filter(Boolean);
|
|
40
|
+
// Check if the URL is from GitHub and has the username/repo format
|
|
41
|
+
if (parsedUrl.hostname === "github.com" && pathParts.length === 2) {
|
|
42
|
+
// Remove the `.git` suffix if present
|
|
43
|
+
let repoPath = pathParts.join("/");
|
|
44
|
+
if (repoPath.endsWith(".git")) {
|
|
45
|
+
repoPath = repoPath.slice(0, -4); // Remove the `.git` suffix
|
|
46
|
+
}
|
|
47
|
+
remotes[name] = repoPath;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch (e) {
|
|
51
|
+
console.error("URL Parsing Error:", e.message);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
return remotes;
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
console.error("Error:", error.message);
|
|
59
|
+
return {};
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
module.exports.parseGitRemotes = parseGitRemotes;
|
|
64
|
+
/**
|
|
65
|
+
* Joins all given path segments together and normalizes the resulting path.
|
|
66
|
+
* Preserves the case of the drive letter on Windows.
|
|
67
|
+
*
|
|
68
|
+
* @param {...string} segments Path segments to join.
|
|
69
|
+
* @returns {string} Normalized path with drive letter case preserved.
|
|
70
|
+
*/
|
|
71
|
+
function joinPathPreserveDriveLetter(...segments) {
|
|
72
|
+
let fullPath = require("path").join(...segments);
|
|
73
|
+
// Check if the path starts with a drive letter (e.g., C:\)
|
|
74
|
+
if (/^[a-z]:\\/.test(fullPath)) {
|
|
75
|
+
// Convert the drive letter to uppercase
|
|
76
|
+
fullPath = fullPath.charAt(0).toUpperCase() + fullPath.slice(1);
|
|
77
|
+
}
|
|
78
|
+
return fullPath;
|
|
79
|
+
}
|
|
80
|
+
module.exports.joinPathPreserveDriveLetter = joinPathPreserveDriveLetter;
|
|
81
|
+
/**
|
|
82
|
+
* Returns parsed command line arguments using minimist.
|
|
83
|
+
* @returns {import('minimist').ParsedArgs} Parsed command line arguments
|
|
84
|
+
*/
|
|
3
85
|
function getArgs() {
|
|
4
86
|
return argv;
|
|
5
87
|
}
|
|
88
|
+
module.exports.getArgs = getArgs;
|
|
6
89
|
/**
|
|
7
|
-
*
|
|
8
|
-
* @param {string} fullPath
|
|
90
|
+
* Recursively deletes a file or directory at the given path.
|
|
91
|
+
* @param {string} fullPath Absolute path to the file or directory to delete.
|
|
9
92
|
*/
|
|
10
93
|
function del(fullPath) {
|
|
11
94
|
if (fs.statSync(fullPath).isDirectory()) {
|
|
@@ -25,9 +108,10 @@ function del(fullPath) {
|
|
|
25
108
|
}
|
|
26
109
|
}
|
|
27
110
|
}
|
|
111
|
+
module.exports.del = del;
|
|
28
112
|
/**
|
|
29
|
-
* glob stream
|
|
30
|
-
* @param {glob.Glob} globStream
|
|
113
|
+
* Handles a glob stream to delete matched files and directories recursively.
|
|
114
|
+
* @param {glob.Glob} globStream Glob stream object.
|
|
31
115
|
*/
|
|
32
116
|
function delStream(globStream) {
|
|
33
117
|
globStream.stream().on("data", (result) => {
|
|
@@ -42,9 +126,56 @@ function delStream(globStream) {
|
|
|
42
126
|
del(fullPath);
|
|
43
127
|
});
|
|
44
128
|
}
|
|
129
|
+
module.exports.delStream = delStream;
|
|
130
|
+
/**
|
|
131
|
+
* Creates a directory/file tree string from an array of file paths and hashes.
|
|
132
|
+
* @param {string[]} hashArray Array of strings in the format 'relative/path/to/file hash'.
|
|
133
|
+
* @returns {string} Directory/file tree as a string, with file hashes.
|
|
134
|
+
*/
|
|
135
|
+
function getFileTreeString(hashArray) {
|
|
136
|
+
const tree = {};
|
|
137
|
+
// Map file paths to hashes for quick lookup
|
|
138
|
+
const hashMap = {};
|
|
139
|
+
for (const entry of hashArray) {
|
|
140
|
+
const [filePath, hash] = entry.split(" ");
|
|
141
|
+
hashMap[filePath] = hash;
|
|
142
|
+
const parts = filePath.split("/");
|
|
143
|
+
let current = tree;
|
|
144
|
+
for (let i = 0; i < parts.length; i++) {
|
|
145
|
+
const part = parts[i];
|
|
146
|
+
if (i === parts.length - 1) {
|
|
147
|
+
current[part] = null; // file
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
current[part] = current[part] || {};
|
|
151
|
+
current = current[part];
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function printNode(node, prefix = "", parentPath = "") {
|
|
156
|
+
const keys = Object.keys(node).sort();
|
|
157
|
+
let lines = [];
|
|
158
|
+
keys.forEach((key, idx) => {
|
|
159
|
+
const isLast = idx === keys.length - 1;
|
|
160
|
+
const branch = isLast ? "└── " : "├── ";
|
|
161
|
+
const currentPath = parentPath ? parentPath + "/" + key : key;
|
|
162
|
+
if (node[key] === null) {
|
|
163
|
+
lines.push(prefix + branch + key + " [" + (hashMap[currentPath] || "") + "]");
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
lines.push(prefix + branch + key + "/");
|
|
167
|
+
lines = lines.concat(printNode(node[key], prefix + (isLast ? " " : "│ "), currentPath));
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
return lines;
|
|
171
|
+
}
|
|
172
|
+
return printNode(tree, "", "").join("\n");
|
|
173
|
+
}
|
|
174
|
+
module.exports.getFileTreeString = getFileTreeString;
|
|
45
175
|
/**
|
|
46
|
-
* async
|
|
47
|
-
* @param {number} ms
|
|
176
|
+
* Creates an async delay for the specified number of milliseconds.
|
|
177
|
+
* @param {number} ms Number of milliseconds to delay.
|
|
178
|
+
* @returns {Promise<void>} Promise that resolves after the specified delay.
|
|
48
179
|
*/
|
|
49
180
|
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
50
|
-
module.exports =
|
|
181
|
+
module.exports.delay = delay;
|
package/lib/utils.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
require_utils
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-FB6YIQYR.mjs";
|
|
4
|
+
} from "./chunk-APBWENF6.mjs";
|
|
5
|
+
import "./chunk-AASHBCRW.mjs";
|
|
7
6
|
export default require_utils();
|
package/lib/yarn-reinstall.cjs
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const { execSync } = require("child_process");
|
|
3
|
-
const
|
|
4
|
-
|
|
3
|
+
const { getArgs } = require("./utils.js");
|
|
4
|
+
const args = getArgs();
|
|
5
|
+
const positional = args._ || [];
|
|
6
|
+
if (positional.length === 0) {
|
|
5
7
|
console.error("Usage: yarn-reinstall <packageName> [--dev|-D|--peer|-P|--optional|-O]");
|
|
6
8
|
process.exit(1);
|
|
7
9
|
}
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
10
|
+
const packageName = positional[0];
|
|
11
|
+
const flags = positional.slice(1).concat(Object.keys(args)
|
|
12
|
+
.filter((k) => k !== "_" && args[k] === true)
|
|
13
|
+
.map((k) => `--${k}`));
|
|
14
|
+
if (!packageName) {
|
|
11
15
|
console.error("Please provide a package name.");
|
|
12
16
|
process.exit(1);
|
|
13
17
|
}
|
|
14
|
-
const packageName = args[pkgIndex];
|
|
15
|
-
const flags = args.slice(pkgIndex + 1);
|
|
16
18
|
// Remove and add commands
|
|
17
19
|
const removeCmd = `yarn remove ${packageName}`;
|
|
18
20
|
const addCmd = `yarn add ${packageName} ${flags.join(" ")}`.trim();
|
package/lib/yarn-reinstall.d.mts
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
const { execSync } = require("child_process");
|
|
2
|
+
const { getArgs } = require("./utils.js");
|
|
3
|
+
const args = getArgs();
|
|
4
|
+
const positional = args._ || [];
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (args.length === 0) {
|
|
6
|
+
if (positional.length === 0) {
|
|
6
7
|
console.error("Usage: yarn-reinstall <packageName> [--dev|-D|--peer|-P|--optional|-O]");
|
|
7
8
|
process.exit(1);
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
11
|
+
const packageName = positional[0];
|
|
12
|
+
const flags = positional.slice(1).concat(
|
|
13
|
+
Object.keys(args)
|
|
14
|
+
.filter((k) => k !== "_" && args[k] === true)
|
|
15
|
+
.map((k) => `--${k}`)
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
if (!packageName) {
|
|
13
19
|
console.error("Please provide a package name.");
|
|
14
20
|
process.exit(1);
|
|
15
21
|
}
|
|
16
|
-
const packageName = args[pkgIndex];
|
|
17
|
-
const flags = args.slice(pkgIndex + 1);
|
|
18
22
|
|
|
19
23
|
// Remove and add commands
|
|
20
24
|
const removeCmd = `yarn remove ${packageName}`;
|
package/lib/yarn-reinstall.d.ts
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
const { execSync } = require("child_process");
|
|
2
|
+
const { getArgs } = require("./utils.js");
|
|
3
|
+
const args = getArgs();
|
|
4
|
+
const positional = args._ || [];
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (args.length === 0) {
|
|
6
|
+
if (positional.length === 0) {
|
|
6
7
|
console.error("Usage: yarn-reinstall <packageName> [--dev|-D|--peer|-P|--optional|-O]");
|
|
7
8
|
process.exit(1);
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
11
|
+
const packageName = positional[0];
|
|
12
|
+
const flags = positional.slice(1).concat(
|
|
13
|
+
Object.keys(args)
|
|
14
|
+
.filter((k) => k !== "_" && args[k] === true)
|
|
15
|
+
.map((k) => `--${k}`)
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
if (!packageName) {
|
|
13
19
|
console.error("Please provide a package name.");
|
|
14
20
|
process.exit(1);
|
|
15
21
|
}
|
|
16
|
-
const packageName = args[pkgIndex];
|
|
17
|
-
const flags = args.slice(pkgIndex + 1);
|
|
18
22
|
|
|
19
23
|
// Remove and add commands
|
|
20
24
|
const removeCmd = `yarn remove ${packageName}`;
|
package/lib/yarn-reinstall.mjs
CHANGED
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
3
|
+
require_utils
|
|
4
|
+
} from "./chunk-APBWENF6.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__commonJS,
|
|
7
|
-
__require
|
|
8
|
-
|
|
7
|
+
__require,
|
|
8
|
+
init_esm_shims
|
|
9
|
+
} from "./chunk-AASHBCRW.mjs";
|
|
9
10
|
|
|
10
11
|
// src/yarn-reinstall.cjs
|
|
11
12
|
var require_yarn_reinstall = __commonJS({
|
|
12
13
|
"src/yarn-reinstall.cjs"() {
|
|
13
14
|
init_esm_shims();
|
|
14
15
|
var { execSync } = __require("child_process");
|
|
15
|
-
var
|
|
16
|
-
|
|
16
|
+
var { getArgs } = require_utils();
|
|
17
|
+
var args = getArgs();
|
|
18
|
+
var positional = args._ || [];
|
|
19
|
+
if (positional.length === 0) {
|
|
17
20
|
console.error("Usage: yarn-reinstall <packageName> [--dev|-D|--peer|-P|--optional|-O]");
|
|
18
21
|
process.exit(1);
|
|
19
22
|
}
|
|
20
|
-
var
|
|
21
|
-
|
|
23
|
+
var packageName = positional[0];
|
|
24
|
+
var flags = positional.slice(1).concat(
|
|
25
|
+
Object.keys(args).filter((k) => k !== "_" && args[k] === true).map((k) => `--${k}`)
|
|
26
|
+
);
|
|
27
|
+
if (!packageName) {
|
|
22
28
|
console.error("Please provide a package name.");
|
|
23
29
|
process.exit(1);
|
|
24
30
|
}
|
|
25
|
-
var packageName = args[pkgIndex];
|
|
26
|
-
var flags = args.slice(pkgIndex + 1);
|
|
27
31
|
var removeCmd = `yarn remove ${packageName}`;
|
|
28
32
|
var addCmd = `yarn add ${packageName} ${flags.join(" ")}`.trim();
|
|
29
33
|
try {
|
package/package.json
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "binary-collections",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8",
|
|
4
4
|
"description": "Utility to clean any programming caches and more",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"cache",
|
|
7
|
+
"cleaner",
|
|
8
|
+
"utility"
|
|
9
|
+
],
|
|
10
|
+
"homepage": "https://www.webmanajemen.com/",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/dimaslanjaka/bin/issues"
|
|
13
|
+
},
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"author": {
|
|
16
|
+
"email": "dimaslanjaka@gmail.com",
|
|
17
|
+
"name": "dimaslanjaka",
|
|
18
|
+
"url": "https://webmanajemen.com"
|
|
19
|
+
},
|
|
5
20
|
"main": "lib/index.js",
|
|
6
|
-
"types": "lib/index.d.ts",
|
|
7
21
|
"exports": {
|
|
8
22
|
".": {
|
|
9
23
|
"require": {
|
|
@@ -16,6 +30,7 @@
|
|
|
16
30
|
}
|
|
17
31
|
}
|
|
18
32
|
},
|
|
33
|
+
"types": "lib/index.d.ts",
|
|
19
34
|
"files": [
|
|
20
35
|
"bin",
|
|
21
36
|
"lib",
|
|
@@ -23,120 +38,134 @@
|
|
|
23
38
|
"!test",
|
|
24
39
|
"package.json"
|
|
25
40
|
],
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
41
|
+
"bin": {
|
|
42
|
+
"binary-collections": "lib/binary-collections.cjs",
|
|
43
|
+
"clean-github-actions-cache": "lib/clean-github-actions-caches.cjs",
|
|
44
|
+
"clean-github-actions-caches": "lib/clean-github-actions-caches.cjs",
|
|
45
|
+
"clean-nodemodule": "bin/clean-nodemodule",
|
|
46
|
+
"clean-nodemodules": "bin/clean-nodemodules",
|
|
47
|
+
"clear-gh-caches": "lib/clean-github-actions-caches.cjs",
|
|
48
|
+
"clear-github-actions-cache": "lib/clean-github-actions-caches.cjs",
|
|
49
|
+
"clear-github-actions-caches": "lib/clean-github-actions-caches.cjs",
|
|
50
|
+
"del-gradle": "lib/del-gradle.cjs",
|
|
51
|
+
"del-node-modules": "lib/del-node-modules.mjs",
|
|
52
|
+
"del-nodemodules": "lib/del-node-modules.cjs",
|
|
53
|
+
"del-ps": "lib/del-ps.cjs",
|
|
54
|
+
"del-yarn-caches": "lib/del-yarn-caches.mjs",
|
|
55
|
+
"del-yarncaches": "lib/del-yarn-caches.cjs",
|
|
56
|
+
"dev": "bin/dev",
|
|
57
|
+
"dir-tree": "lib/print-directory-tree.cjs",
|
|
58
|
+
"empty": "bin/empty",
|
|
59
|
+
"find-node-modules": "lib/find-node-modules.mjs",
|
|
60
|
+
"find-node-modules-cli": "lib/find-node-modules-cli.mjs",
|
|
61
|
+
"git-diff": "lib/git-diff.cjs",
|
|
62
|
+
"git-fix": "lib/git-fix.cjs",
|
|
63
|
+
"git-purge": "lib/git-purge.cjs",
|
|
64
|
+
"git-reduce-size": "bin/git-reduce-size",
|
|
65
|
+
"index": "lib/index.mjs",
|
|
66
|
+
"javakill": "bin/javakill.cmd",
|
|
67
|
+
"kill-process": "bin/kill-process",
|
|
68
|
+
"nodekill": "bin/nodekill.ps1",
|
|
69
|
+
"npm-run-series": "lib/npm-run-series.cjs",
|
|
70
|
+
"nrs": "lib/npm-run-series.cjs",
|
|
71
|
+
"package-resolutions-updater": "src/package-resolutions-updater.mjs",
|
|
72
|
+
"pkg-res-updater": "lib/package-resolutions-updater.cjs",
|
|
73
|
+
"pkg-resolutions-updater": "lib/package-resolutions-updater.cjs",
|
|
74
|
+
"print-directory-tree": "src/print-directory-tree.cjs",
|
|
75
|
+
"print-tree": "lib/print-directory-tree.cjs",
|
|
76
|
+
"prod": "bin/prod",
|
|
77
|
+
"rmfind": "bin/rmfind",
|
|
78
|
+
"rmpath": "bin/rmpath",
|
|
79
|
+
"rmx": "bin/rmx",
|
|
80
|
+
"run-s": "lib/npm-run-series.cjs",
|
|
81
|
+
"run-series": "lib/npm-run-series.cjs",
|
|
82
|
+
"submodule-install": "lib/submodule-install.cjs",
|
|
83
|
+
"submodule-remove": "bin/submodule-remove",
|
|
84
|
+
"submodule-token": "bin/submodule-token",
|
|
85
|
+
"yarn-reinstall": "src/yarn-reinstall.cjs"
|
|
29
86
|
},
|
|
30
87
|
"scripts": {
|
|
31
88
|
"update:packer": "curl -L https://github.com/dimaslanjaka/nodejs-package-types/raw/main/packer.js > packer.js",
|
|
32
89
|
"build": "node build.tsup.js && tsc -b tsconfig.build.json && npm run postbuild",
|
|
33
90
|
"postbuild": "node -r ts-node/register -r dotenv/config build.js && yarn run pack",
|
|
34
|
-
"
|
|
35
|
-
"test
|
|
36
|
-
"test:
|
|
91
|
+
"build:packages": "yarn workspaces foreach --worktree --no-private run build",
|
|
92
|
+
"test": "npx jest --runInBand --forceExit",
|
|
93
|
+
"test:watch": "npm test --watch",
|
|
94
|
+
"test:coverage": "npm test --coverage",
|
|
95
|
+
"test:debug": "npm test -- --detectOpenHandles",
|
|
37
96
|
"test:nrs": "npm test -- nrs build:**",
|
|
38
97
|
"pack": "node packer.js --yarn --filename=bin",
|
|
39
98
|
"update:ncu": "npx npm-check-updates -u -x jsdom,chalk,hexo,deepmerge-ts --enginesNode --root",
|
|
40
|
-
"clean": "rimraf lib"
|
|
41
|
-
|
|
42
|
-
"keywords": [
|
|
43
|
-
"cache",
|
|
44
|
-
"cleaner",
|
|
45
|
-
"utility"
|
|
46
|
-
],
|
|
47
|
-
"author": {
|
|
48
|
-
"email": "dimaslanjaka@gmail.com",
|
|
49
|
-
"name": "dimaslanjaka",
|
|
50
|
-
"url": "https://webmanajemen.com"
|
|
99
|
+
"clean": "rimraf lib",
|
|
100
|
+
"prepare": "husky"
|
|
51
101
|
},
|
|
52
102
|
"repository": {
|
|
53
103
|
"type": "git",
|
|
54
104
|
"url": "git+https://github.com/dimaslanjaka/bin"
|
|
55
105
|
},
|
|
56
|
-
"bugs": {
|
|
57
|
-
"url": "https://github.com/dimaslanjaka/bin/issues"
|
|
58
|
-
},
|
|
59
|
-
"homepage": "https://www.webmanajemen.com/",
|
|
60
|
-
"license": "MIT",
|
|
61
106
|
"dependencies": {
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
107
|
+
"axios": "^1.10.0",
|
|
108
|
+
"dotenv": "^17.2.0",
|
|
109
|
+
"execa": "^9.6.0",
|
|
110
|
+
"fs-extra": "^11.3.0",
|
|
111
|
+
"git-command-helper": "^2.0.2",
|
|
112
|
+
"glob": "^11.0.3",
|
|
113
|
+
"minimatch": "^10.0.3",
|
|
67
114
|
"minimist": "^1.2.8",
|
|
68
115
|
"ps-node": "^0.1.6",
|
|
69
116
|
"remove": "^0.1.5",
|
|
70
|
-
"sbg-utility": "^
|
|
117
|
+
"sbg-utility": "^2.0.8",
|
|
71
118
|
"upath": "^2.0.1",
|
|
72
|
-
"yaml": "^2.
|
|
119
|
+
"yaml": "^2.8.0",
|
|
73
120
|
"yarn": "^1.22.22"
|
|
74
121
|
},
|
|
75
|
-
"packageManager": "yarn@4.9.2",
|
|
76
122
|
"devDependencies": {
|
|
123
|
+
"@babel/core": "^7.28.0",
|
|
124
|
+
"@babel/preset-env": "^7.28.0",
|
|
125
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
126
|
+
"@eslint/js": "^9.30.1",
|
|
127
|
+
"@types/babel__core": "^7",
|
|
128
|
+
"@types/babel__preset-env": "^7",
|
|
77
129
|
"@types/eslint": "^9",
|
|
78
130
|
"@types/fs-extra": "^11.0.4",
|
|
79
131
|
"@types/jest": "^30.0.0",
|
|
80
132
|
"@types/minimist": "^1",
|
|
81
|
-
"@types/node": "^
|
|
133
|
+
"@types/node": "^24.0.10",
|
|
82
134
|
"@types/prettier": "^3",
|
|
83
135
|
"@types/ps-node": "^0",
|
|
84
136
|
"@types/yargs": "^17",
|
|
85
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
86
|
-
"@typescript-eslint/parser": "^8.
|
|
137
|
+
"@typescript-eslint/eslint-plugin": "^8.36.0",
|
|
138
|
+
"@typescript-eslint/parser": "^8.36.0",
|
|
139
|
+
"babel-jest": "^30.0.4",
|
|
140
|
+
"cross-env": "^7.0.3",
|
|
87
141
|
"cross-spawn": "https://github.com/dimaslanjaka/node-cross-spawn/raw/private/release/cross-spawn.tgz",
|
|
88
|
-
"eslint": "^9.
|
|
89
|
-
"eslint-config-prettier": "^
|
|
90
|
-
"eslint-plugin-prettier": "^5.
|
|
91
|
-
"
|
|
92
|
-
"
|
|
142
|
+
"eslint": "^9.30.1",
|
|
143
|
+
"eslint-config-prettier": "^10.1.5",
|
|
144
|
+
"eslint-plugin-prettier": "^5.5.1",
|
|
145
|
+
"globals": "^16.3.0",
|
|
146
|
+
"husky": "^9.1.7",
|
|
93
147
|
"jest": "^30.0.4",
|
|
94
|
-
"
|
|
148
|
+
"lint-staged": "^16.1.2",
|
|
149
|
+
"prettier": "^3.6.2",
|
|
95
150
|
"rimraf": "^6.0.1",
|
|
96
151
|
"ts-jest": "^29.4.0",
|
|
97
152
|
"ts-node": "^10.9.2",
|
|
98
|
-
"tsup": "^8.
|
|
99
|
-
"typescript": "^5.
|
|
153
|
+
"tsup": "^8.5.0",
|
|
154
|
+
"typescript": "^5.8.3"
|
|
100
155
|
},
|
|
101
156
|
"optionalDependencies": {
|
|
102
157
|
"ansi-colors": "^4.1.3"
|
|
103
158
|
},
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"find-node-modules": "lib/find-node-modules.cjs",
|
|
116
|
-
"find-node-modules-cli": "lib/find-node-modules-cli.cjs",
|
|
117
|
-
"find-nodemodules": "lib/find-node-modules-cli.cjs",
|
|
118
|
-
"git-diff": "lib/git-diff.cjs",
|
|
119
|
-
"git-fix-encoding": "bin/git-fix-encoding",
|
|
120
|
-
"git-purge": "lib/git-purge.cjs",
|
|
121
|
-
"git-reduce-size": "bin/git-reduce-size",
|
|
122
|
-
"index": "lib/index.cjs",
|
|
123
|
-
"javakill": "bin/javakill.cmd",
|
|
124
|
-
"kill-process": "bin/kill-process",
|
|
125
|
-
"nodekill": "bin/nodekill",
|
|
126
|
-
"npm-run-series": "lib/npm-run-series.cjs",
|
|
127
|
-
"nrs": "lib/npm-run-series.cjs",
|
|
128
|
-
"package-resolutions": "lib/package-resolutions.cjs",
|
|
129
|
-
"prod": "bin/prod",
|
|
130
|
-
"rmfind": "bin/rmfind",
|
|
131
|
-
"rmpath": "bin/rmpath",
|
|
132
|
-
"rmx": "bin/rmx",
|
|
133
|
-
"run-s": "lib/npm-run-series.cjs",
|
|
134
|
-
"run-series": "lib/npm-run-series.cjs",
|
|
135
|
-
"submodule": "bin/submodule",
|
|
136
|
-
"submodule-install": "lib/submodule-install.cjs",
|
|
137
|
-
"submodule-remove": "bin/submodule-remove",
|
|
138
|
-
"submodule-token": "bin/submodule-token",
|
|
139
|
-
"utils": "lib/utils.cjs",
|
|
140
|
-
"yarn-reinstall": "lib/yarn-reinstall.cjs"
|
|
159
|
+
"workspaces": [
|
|
160
|
+
"packages/*"
|
|
161
|
+
],
|
|
162
|
+
"directories": {
|
|
163
|
+
"lib": "lib",
|
|
164
|
+
"bin": "bin"
|
|
165
|
+
},
|
|
166
|
+
"packageManager": "yarn@4.9.2",
|
|
167
|
+
"resolutions": {
|
|
168
|
+
"sbg-utility": "https://github.com/dimaslanjaka/static-blog-generator/raw/7696e66ab84f319909c5dab9054303e91f898454/packages/sbg-utility/release/sbg-utility.tgz",
|
|
169
|
+
"cross-spawn": "https://github.com/dimaslanjaka/node-cross-spawn/raw/80999ac7a7031a81e11ddb5fab0f8ba433041c98/release/cross-spawn.tgz"
|
|
141
170
|
}
|
|
142
171
|
}
|