binary-collections 2.0.6 → 2.0.7
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/git-diff.cmd +4 -0
- package/bin/git-fix-encoding.cmd +0 -0
- package/bin/nodekill.cmd +0 -0
- package/bin/nodekill.ps1 +0 -0
- package/bin/submodule-install +0 -0
- package/lib/{chunk-GA4DDV65.mjs → chunk-3LOB2P54.mjs} +3 -3
- package/lib/{chunk-M4IBUK4H.mjs → chunk-4LEXWIIF.mjs} +2 -2
- package/lib/chunk-BSD5CIRU.mjs +52 -0
- package/lib/chunk-FB6YIQYR.mjs +42 -0
- package/lib/{chunk-E75HJFJO.mjs → chunk-JL32QDSH.mjs} +2 -2
- package/lib/{chunk-LPLPQBYP.mjs → chunk-OKYLF2MU.mjs} +14 -14
- package/lib/chunk-VXZQNLPU.mjs +23 -0
- package/lib/del-gradle.cjs +12 -12
- package/lib/del-gradle.d.ts +1 -2
- package/lib/del-gradle.js +12 -69
- package/lib/del-gradle.mjs +3 -3
- package/lib/del-node-modules.cjs +12 -12
- package/lib/del-node-modules.d.ts +1 -2
- package/lib/del-node-modules.js +11 -68
- package/lib/del-node-modules.mjs +3 -3
- package/lib/del-ps.cjs +13 -626
- package/lib/del-ps.d.ts +1 -2
- package/lib/del-ps.js +27 -702
- package/lib/del-ps.mjs +5 -8
- package/lib/del-yarn-caches.cjs +12 -12
- package/lib/del-yarn-caches.d.ts +1 -2
- package/lib/del-yarn-caches.js +6 -63
- package/lib/del-yarn-caches.mjs +3 -3
- package/lib/find-node-modules-cli.cjs +59 -0
- package/lib/find-node-modules-cli.d.mts +1 -0
- package/lib/find-node-modules-cli.d.ts +2 -0
- package/lib/find-node-modules-cli.js +3 -0
- package/lib/find-node-modules-cli.mjs +14 -0
- package/lib/find-node-modules.cjs +31 -9
- package/lib/find-node-modules.d.mts +9 -1
- package/lib/find-node-modules.d.ts +9 -2
- package/lib/find-node-modules.js +41 -12
- package/lib/find-node-modules.mjs +5 -19
- package/lib/git-diff.cjs +74 -0
- package/lib/git-diff.d.cts +2 -0
- package/lib/git-diff.d.mts +87 -0
- package/lib/git-diff.d.ts +87 -0
- package/lib/git-diff.mjs +83 -0
- package/lib/git-purge.cjs +13 -626
- package/lib/git-purge.d.ts +1 -2
- package/lib/git-purge.js +53 -698
- package/lib/git-purge.mjs +4 -7
- package/lib/index.cjs +91 -1
- package/lib/index.d.mts +1 -2
- package/lib/index.d.ts +2 -2
- package/lib/index.js +8 -2
- package/lib/index.mjs +12 -3
- package/lib/npm-run-series.d.ts +1 -0
- package/lib/npm-run-series.js +80 -56
- package/lib/npm-run-series.mjs +2 -2
- package/lib/package-resolutions.mjs +1 -1
- package/lib/ps/connected-domain.cjs +0 -0
- package/lib/ps/connected-domain.d.ts +1 -2
- package/lib/ps/connected-domain.js +196 -150
- package/lib/ps/connected-domain.mjs +3 -3
- package/lib/ps/index.cjs +0 -0
- package/lib/ps/index.d.mjs +2 -2
- package/lib/ps/index.d.ts +2 -26
- package/lib/ps/index.js +230 -535
- package/lib/ps/index.mjs +5 -5
- package/lib/ps/isWin.cjs +0 -0
- package/lib/ps/isWin.d.ts +1 -2
- package/lib/ps/isWin.js +1 -2
- package/lib/ps/isWin.mjs +3 -3
- package/lib/ps/table-parser.cjs +0 -0
- package/lib/ps/table-parser.d.ts +1 -3
- package/lib/ps/table-parser.js +254 -345
- package/lib/ps/table-parser.mjs +4 -4
- package/lib/submodule-install.cjs +118 -0
- package/lib/submodule-install.d.cts +2 -0
- package/lib/submodule-install.d.mts +141 -0
- package/lib/submodule-install.d.ts +141 -0
- package/lib/submodule-install.mjs +116 -0
- package/lib/utils.cjs +12 -12
- package/lib/utils.d.ts +4 -8
- package/lib/utils.js +43 -28
- package/lib/utils.mjs +3 -3
- package/lib/yarn-reinstall.cjs +42 -0
- package/lib/yarn-reinstall.d.cts +1 -0
- package/lib/yarn-reinstall.d.mts +45 -0
- package/lib/yarn-reinstall.d.ts +45 -0
- package/lib/yarn-reinstall.mjs +50 -0
- package/package.json +37 -39
- package/readme.md +174 -49
- package/eslint.config.cjs +0 -97
- package/lib/chunk-7MSZ52XC.mjs +0 -14
- package/lib/chunk-AVDT32AY.mjs +0 -20
- package/lib/chunk-S4SJ7SDW.mjs +0 -625
- package/lib/package-resolutions.js +0 -28
- package/lib/ps/index.d.js +0 -17
package/lib/del-ps.mjs
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
require_isWin
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
require_dist
|
|
7
|
-
} from "./chunk-S4SJ7SDW.mjs";
|
|
4
|
+
} from "./chunk-JL32QDSH.mjs";
|
|
8
5
|
import {
|
|
9
6
|
require_utils
|
|
10
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OKYLF2MU.mjs";
|
|
11
8
|
import {
|
|
12
9
|
init_esm_shims
|
|
13
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VXZQNLPU.mjs";
|
|
14
11
|
import {
|
|
15
12
|
__require
|
|
16
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-FB6YIQYR.mjs";
|
|
17
14
|
|
|
18
15
|
// src/del-ps.js
|
|
19
16
|
init_esm_shims();
|
|
20
|
-
var crossSpawn =
|
|
17
|
+
var crossSpawn = __require("cross-spawn");
|
|
21
18
|
var ps = __require("ps-node");
|
|
22
19
|
var isWin = require_isWin();
|
|
23
20
|
var utils = require_utils();
|
package/lib/del-yarn-caches.cjs
CHANGED
|
@@ -21,18 +21,6 @@ var require_utils = __commonJS({
|
|
|
21
21
|
function getArgs() {
|
|
22
22
|
return argv;
|
|
23
23
|
}
|
|
24
|
-
function delStream2(globStream) {
|
|
25
|
-
globStream.stream().on("data", (result) => {
|
|
26
|
-
const fullPath = path.resolve(process.cwd(), result);
|
|
27
|
-
if (fs.statSync(fullPath).isDirectory()) {
|
|
28
|
-
const subdir = fs.readdirSync(fullPath).map((dirPath) => path.resolve(fullPath, dirPath));
|
|
29
|
-
for (let i = 0; i < subdir.length; i++) {
|
|
30
|
-
del(subdir[i]);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
del(fullPath);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
24
|
function del(fullPath) {
|
|
37
25
|
if (fs.statSync(fullPath).isDirectory()) {
|
|
38
26
|
const subdir = fs.readdirSync(fullPath).map((dirPath) => path.resolve(fullPath, dirPath));
|
|
@@ -48,6 +36,18 @@ var require_utils = __commonJS({
|
|
|
48
36
|
}
|
|
49
37
|
}
|
|
50
38
|
}
|
|
39
|
+
function delStream2(globStream) {
|
|
40
|
+
globStream.stream().on("data", (result) => {
|
|
41
|
+
const fullPath = path.resolve(process.cwd(), result);
|
|
42
|
+
if (fs.statSync(fullPath).isDirectory()) {
|
|
43
|
+
const subdir = fs.readdirSync(fullPath).map((dirPath) => path.resolve(fullPath, dirPath));
|
|
44
|
+
for (let i = 0; i < subdir.length; i++) {
|
|
45
|
+
del(subdir[i]);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
del(fullPath);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
51
|
var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
52
52
|
module2.exports = { del, delStream: delStream2, getArgs, delay };
|
|
53
53
|
}
|
package/lib/del-yarn-caches.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { }
|
|
1
|
+
export {};
|
package/lib/del-yarn-caches.js
CHANGED
|
@@ -1,65 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
// node_modules/tsup/assets/cjs_shims.js
|
|
10
|
-
var init_cjs_shims = __esm({
|
|
11
|
-
"node_modules/tsup/assets/cjs_shims.js"() {
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
// src/utils.js
|
|
16
|
-
var require_utils = __commonJS({
|
|
17
|
-
"src/utils.js"(exports2, module2) {
|
|
18
|
-
init_cjs_shims();
|
|
19
|
-
var { fs, path } = require("sbg-utility");
|
|
20
|
-
var argv = require("minimist")(process.argv.slice(2));
|
|
21
|
-
function getArgs() {
|
|
22
|
-
return argv;
|
|
23
|
-
}
|
|
24
|
-
function delStream2(globStream) {
|
|
25
|
-
globStream.stream().on("data", (result) => {
|
|
26
|
-
const fullPath = path.resolve(process.cwd(), result);
|
|
27
|
-
if (fs.statSync(fullPath).isDirectory()) {
|
|
28
|
-
const subdir = fs.readdirSync(fullPath).map((dirPath) => path.resolve(fullPath, dirPath));
|
|
29
|
-
for (let i = 0; i < subdir.length; i++) {
|
|
30
|
-
del(subdir[i]);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
del(fullPath);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
function del(fullPath) {
|
|
37
|
-
if (fs.statSync(fullPath).isDirectory()) {
|
|
38
|
-
const subdir = fs.readdirSync(fullPath).map((dirPath) => path.resolve(fullPath, dirPath));
|
|
39
|
-
for (let i = 0; i < subdir.length; i++) {
|
|
40
|
-
del(subdir[i]);
|
|
41
|
-
}
|
|
42
|
-
} else {
|
|
43
|
-
try {
|
|
44
|
-
fs.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
|
|
45
|
-
console.log("deleted", fullPath);
|
|
46
|
-
} catch (_) {
|
|
47
|
-
console.log("failed delete", fullPath);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
52
|
-
module2.exports = { del, delStream: delStream2, getArgs, delay };
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
// src/del-yarn-caches.js
|
|
57
|
-
init_cjs_shims();
|
|
58
|
-
var glob = require("glob");
|
|
59
|
-
var { delStream } = require_utils();
|
|
60
|
-
var g3 = new glob.Glob(["**/.yarn/cache*", "**/.yarn/*.gz"], {
|
|
61
|
-
withFileTypes: false,
|
|
62
|
-
cwd: process.cwd(),
|
|
63
|
-
ignore: ["**/.git*", "**/vendor/**"]
|
|
1
|
+
const glob = require("glob");
|
|
2
|
+
const { delStream } = require("./utils");
|
|
3
|
+
const g3 = new glob.Glob(["**/.yarn/cache*", "**/.yarn/*.gz"], {
|
|
4
|
+
withFileTypes: false,
|
|
5
|
+
cwd: process.cwd(),
|
|
6
|
+
ignore: ["**/.git*", "**/vendor/**"]
|
|
64
7
|
});
|
|
65
8
|
delStream(g3);
|
package/lib/del-yarn-caches.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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-OKYLF2MU.mjs";
|
|
5
5
|
import {
|
|
6
6
|
init_esm_shims
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VXZQNLPU.mjs";
|
|
8
8
|
import {
|
|
9
9
|
__require
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FB6YIQYR.mjs";
|
|
11
11
|
|
|
12
12
|
// src/del-yarn-caches.js
|
|
13
13
|
init_esm_shims();
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
+
var __esm = (fn, res) => function __init() {
|
|
4
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
5
|
+
};
|
|
6
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
7
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
// node_modules/tsup/assets/cjs_shims.js
|
|
11
|
+
var init_cjs_shims = __esm({
|
|
12
|
+
"node_modules/tsup/assets/cjs_shims.js"() {
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
// src/find-node-modules.js
|
|
17
|
+
var require_find_node_modules = __commonJS({
|
|
18
|
+
"src/find-node-modules.js"(exports2, module2) {
|
|
19
|
+
init_cjs_shims();
|
|
20
|
+
var glob = require("glob");
|
|
21
|
+
var path = require("path");
|
|
22
|
+
function findNodeModules2(dir = process.cwd(), callback = null) {
|
|
23
|
+
const finalDir = typeof dir === "string" ? dir : process.cwd();
|
|
24
|
+
return new Promise((resolve, reject) => {
|
|
25
|
+
const results = [];
|
|
26
|
+
const g3 = new glob.Glob("**/node_modules", {
|
|
27
|
+
withFileTypes: false,
|
|
28
|
+
cwd: finalDir,
|
|
29
|
+
ignore: ["**/.git*", "**/vendor/**"]
|
|
30
|
+
});
|
|
31
|
+
const stream = g3.stream();
|
|
32
|
+
stream.on("data", (result) => {
|
|
33
|
+
const fullPath = path.resolve(finalDir, result);
|
|
34
|
+
if (typeof callback === "function") {
|
|
35
|
+
try {
|
|
36
|
+
callback(fullPath);
|
|
37
|
+
} catch (err) {
|
|
38
|
+
console.error("findNodeModules callback error:", err);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
results.push(fullPath);
|
|
42
|
+
});
|
|
43
|
+
stream.on("error", (err) => reject(err));
|
|
44
|
+
stream.on("end", () => {
|
|
45
|
+
if (results.length === 0) {
|
|
46
|
+
console.log("No node_modules directories found.");
|
|
47
|
+
}
|
|
48
|
+
resolve(results);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
module2.exports = findNodeModules2;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
// src/find-node-modules-cli.js
|
|
57
|
+
init_cjs_shims();
|
|
58
|
+
var findNodeModules = require_find_node_modules();
|
|
59
|
+
findNodeModules(null, console.log);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
require_find_node_modules
|
|
5
|
+
} from "./chunk-BSD5CIRU.mjs";
|
|
6
|
+
import {
|
|
7
|
+
init_esm_shims
|
|
8
|
+
} from "./chunk-VXZQNLPU.mjs";
|
|
9
|
+
import "./chunk-FB6YIQYR.mjs";
|
|
10
|
+
|
|
11
|
+
// src/find-node-modules-cli.js
|
|
12
|
+
init_esm_shims();
|
|
13
|
+
var findNodeModules = require_find_node_modules();
|
|
14
|
+
findNodeModules(null, console.log);
|
|
@@ -1,12 +1,34 @@
|
|
|
1
1
|
// src/find-node-modules.js
|
|
2
2
|
var glob = require("glob");
|
|
3
3
|
var path = require("path");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
});
|
|
4
|
+
function findNodeModules(dir = process.cwd(), callback = null) {
|
|
5
|
+
const finalDir = typeof dir === "string" ? dir : process.cwd();
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
const results = [];
|
|
8
|
+
const g3 = new glob.Glob("**/node_modules", {
|
|
9
|
+
withFileTypes: false,
|
|
10
|
+
cwd: finalDir,
|
|
11
|
+
ignore: ["**/.git*", "**/vendor/**"]
|
|
12
|
+
});
|
|
13
|
+
const stream = g3.stream();
|
|
14
|
+
stream.on("data", (result) => {
|
|
15
|
+
const fullPath = path.resolve(finalDir, result);
|
|
16
|
+
if (typeof callback === "function") {
|
|
17
|
+
try {
|
|
18
|
+
callback(fullPath);
|
|
19
|
+
} catch (err) {
|
|
20
|
+
console.error("findNodeModules callback error:", err);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
results.push(fullPath);
|
|
24
|
+
});
|
|
25
|
+
stream.on("error", (err) => reject(err));
|
|
26
|
+
stream.on("end", () => {
|
|
27
|
+
if (results.length === 0) {
|
|
28
|
+
console.log("No node_modules directories found.");
|
|
29
|
+
}
|
|
30
|
+
resolve(results);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
module.exports = findNodeModules;
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asynchronously finds all "node_modules" directories within the given directory.
|
|
3
|
+
*
|
|
4
|
+
* @param {string} [dir=process.cwd()] - The directory to start the search from. Defaults to the current working directory.
|
|
5
|
+
* @param {function} [callback=null] - Optional callback function that gets called with each found "node_modules" path.
|
|
6
|
+
* @returns {Promise<string[]>} - A promise that resolves to an array of full paths to "node_modules" directories.
|
|
7
|
+
*/
|
|
8
|
+
declare function findNodeModules(dir?: string, callback?: Function): Promise<string[]>;
|
|
1
9
|
|
|
2
|
-
export {
|
|
10
|
+
export { findNodeModules as default };
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export = findNodeModules;
|
|
2
|
+
/**
|
|
3
|
+
* Asynchronously finds all "node_modules" directories within the given directory.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} [dir=process.cwd()] - The directory to start the search from. Defaults to the current working directory.
|
|
6
|
+
* @param {function} [callback=null] - Optional callback function that gets called with each found "node_modules" path.
|
|
7
|
+
* @returns {Promise<string[]>} - A promise that resolves to an array of full paths to "node_modules" directories.
|
|
8
|
+
*/
|
|
9
|
+
declare function findNodeModules(dir?: string, callback?: Function): Promise<string[]>;
|
package/lib/find-node-modules.js
CHANGED
|
@@ -1,12 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
const glob = require("glob");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
/**
|
|
4
|
+
* Asynchronously finds all "node_modules" directories within the given directory.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} [dir=process.cwd()] - The directory to start the search from. Defaults to the current working directory.
|
|
7
|
+
* @param {function} [callback=null] - Optional callback function that gets called with each found "node_modules" path.
|
|
8
|
+
* @returns {Promise<string[]>} - A promise that resolves to an array of full paths to "node_modules" directories.
|
|
9
|
+
*/
|
|
10
|
+
function findNodeModules(dir = process.cwd(), callback = null) {
|
|
11
|
+
const finalDir = typeof dir === "string" ? dir : process.cwd();
|
|
12
|
+
return new Promise((resolve, reject) => {
|
|
13
|
+
const results = [];
|
|
14
|
+
const g3 = new glob.Glob("**/node_modules", {
|
|
15
|
+
withFileTypes: false,
|
|
16
|
+
cwd: finalDir,
|
|
17
|
+
ignore: ["**/.git*", "**/vendor/**"]
|
|
18
|
+
});
|
|
19
|
+
const stream = g3.stream();
|
|
20
|
+
stream.on("data", (result) => {
|
|
21
|
+
const fullPath = path.resolve(finalDir, result);
|
|
22
|
+
if (typeof callback === "function") {
|
|
23
|
+
try {
|
|
24
|
+
callback(fullPath); // Safely invoke callback
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
console.error("findNodeModules callback error:", err);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
results.push(fullPath);
|
|
31
|
+
});
|
|
32
|
+
stream.on("error", (err) => reject(err)); // Handle errors
|
|
33
|
+
stream.on("end", () => {
|
|
34
|
+
if (results.length === 0) {
|
|
35
|
+
console.log("No node_modules directories found.");
|
|
36
|
+
}
|
|
37
|
+
resolve(results); // Resolve the full array when the stream ends
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
module.exports = findNodeModules;
|
|
@@ -1,21 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// src/find-node-modules.js
|
|
10
|
-
init_esm_shims();
|
|
11
|
-
var glob = __require("glob");
|
|
12
|
-
var path = __require("path");
|
|
13
|
-
var g3 = new glob.Glob("**/node_modules", {
|
|
14
|
-
withFileTypes: false,
|
|
15
|
-
cwd: process.cwd(),
|
|
16
|
-
ignore: ["**/.git*", "**/vendor/**"]
|
|
17
|
-
});
|
|
18
|
-
g3.stream().on("data", (result) => {
|
|
19
|
-
const fullPath = path.resolve(process.cwd(), result);
|
|
20
|
-
console.log(fullPath);
|
|
21
|
-
});
|
|
3
|
+
require_find_node_modules
|
|
4
|
+
} from "./chunk-BSD5CIRU.mjs";
|
|
5
|
+
import "./chunk-VXZQNLPU.mjs";
|
|
6
|
+
import "./chunk-FB6YIQYR.mjs";
|
|
7
|
+
export default require_find_node_modules();
|
package/lib/git-diff.cjs
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
const { execSync } = require("child_process");
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
// Output path
|
|
7
|
+
const CACHE_DIR = ".cache/git";
|
|
8
|
+
const OUTPUT = path.join(CACHE_DIR, "diff.txt");
|
|
9
|
+
// Ensure output directory exists
|
|
10
|
+
if (!fs.existsSync(CACHE_DIR)) {
|
|
11
|
+
fs.mkdirSync(CACHE_DIR, { recursive: true });
|
|
12
|
+
}
|
|
13
|
+
function showHelp() {
|
|
14
|
+
console.log("Git Diff Helper");
|
|
15
|
+
console.log("----------------------------");
|
|
16
|
+
console.log("Usage:");
|
|
17
|
+
console.log(" git-diff FILE Show staged diff of specified file");
|
|
18
|
+
console.log(" git-diff --staged-only Show staged diff of all files");
|
|
19
|
+
console.log(" git-diff -s | -S Same as --staged-only");
|
|
20
|
+
console.log(" git-diff --help | -h Show this help message");
|
|
21
|
+
console.log("");
|
|
22
|
+
console.log(`Output is saved to: ${OUTPUT}`);
|
|
23
|
+
process.exit(0);
|
|
24
|
+
}
|
|
25
|
+
function runGitDiff(command, successMessage, errorMessage) {
|
|
26
|
+
try {
|
|
27
|
+
console.log(`[i] Running command: ${command}`);
|
|
28
|
+
const result = execSync(command, { encoding: "utf8" });
|
|
29
|
+
// If result is empty, inform user but don't treat as error
|
|
30
|
+
if (!result || result.trim() === "") {
|
|
31
|
+
console.log(`[i] No changes found for the specified criteria`);
|
|
32
|
+
fs.writeFileSync(OUTPUT, "# No changes found\n");
|
|
33
|
+
console.log(`[✓] Empty diff saved to "${OUTPUT}"`);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
fs.writeFileSync(OUTPUT, result);
|
|
37
|
+
console.log(`[✓] ${successMessage}`);
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
console.error(`[✗] ${errorMessage}`);
|
|
41
|
+
console.error(`Command: ${command}`);
|
|
42
|
+
console.error(`Error: ${error.message}`);
|
|
43
|
+
// Check if it's a git-related error
|
|
44
|
+
if (error.message.includes("not a git repository")) {
|
|
45
|
+
console.error("Make sure you are in a git repository");
|
|
46
|
+
}
|
|
47
|
+
process.exit(1);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// Parse command line arguments
|
|
51
|
+
const args = process.argv.slice(2);
|
|
52
|
+
// Show help if no arguments or --help/-h is passed
|
|
53
|
+
if (args[0] === "--help" || args[0] === "-h") {
|
|
54
|
+
showHelp();
|
|
55
|
+
}
|
|
56
|
+
// Parse options
|
|
57
|
+
switch (args[0]) {
|
|
58
|
+
case "--staged-only":
|
|
59
|
+
case "-s":
|
|
60
|
+
case "-S":
|
|
61
|
+
runGitDiff("git --no-pager diff --staged", `Full staged diff saved to "${OUTPUT}"`, "Failed to save staged diff");
|
|
62
|
+
break;
|
|
63
|
+
default: {
|
|
64
|
+
// Handle specific file diff
|
|
65
|
+
const file = args[0];
|
|
66
|
+
if (!file) {
|
|
67
|
+
runGitDiff("git --no-pager diff", `Full staged diff saved to "${OUTPUT}"`, "Failed to save all diff's");
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
runGitDiff(`git --no-pager diff --cached -- "${file}"`, `Staged diff of "${file}" saved to "${OUTPUT}"`, `Failed to generate diff for "${file}"`);
|
|
71
|
+
}
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { execSync } = require("child_process");
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
|
|
6
|
+
// Output path
|
|
7
|
+
const CACHE_DIR = ".cache/git";
|
|
8
|
+
const OUTPUT = path.join(CACHE_DIR, "diff.txt");
|
|
9
|
+
|
|
10
|
+
// Ensure output directory exists
|
|
11
|
+
if (!fs.existsSync(CACHE_DIR)) {
|
|
12
|
+
fs.mkdirSync(CACHE_DIR, { recursive: true });
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function showHelp() {
|
|
16
|
+
console.log("Git Diff Helper");
|
|
17
|
+
console.log("----------------------------");
|
|
18
|
+
console.log("Usage:");
|
|
19
|
+
console.log(" git-diff FILE Show staged diff of specified file");
|
|
20
|
+
console.log(" git-diff --staged-only Show staged diff of all files");
|
|
21
|
+
console.log(" git-diff -s | -S Same as --staged-only");
|
|
22
|
+
console.log(" git-diff --help | -h Show this help message");
|
|
23
|
+
console.log("");
|
|
24
|
+
console.log(`Output is saved to: ${OUTPUT}`);
|
|
25
|
+
process.exit(0);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function runGitDiff(command, successMessage, errorMessage) {
|
|
29
|
+
try {
|
|
30
|
+
console.log(`[i] Running command: ${command}`);
|
|
31
|
+
const result = execSync(command, { encoding: "utf8" });
|
|
32
|
+
|
|
33
|
+
// If result is empty, inform user but don't treat as error
|
|
34
|
+
if (!result || result.trim() === "") {
|
|
35
|
+
console.log(`[i] No changes found for the specified criteria`);
|
|
36
|
+
fs.writeFileSync(OUTPUT, "# No changes found\n");
|
|
37
|
+
console.log(`[✓] Empty diff saved to "${OUTPUT}"`);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
fs.writeFileSync(OUTPUT, result);
|
|
42
|
+
console.log(`[✓] ${successMessage}`);
|
|
43
|
+
} catch (error) {
|
|
44
|
+
console.error(`[✗] ${errorMessage}`);
|
|
45
|
+
console.error(`Command: ${command}`);
|
|
46
|
+
console.error(`Error: ${error.message}`);
|
|
47
|
+
|
|
48
|
+
// Check if it's a git-related error
|
|
49
|
+
if (error.message.includes("not a git repository")) {
|
|
50
|
+
console.error("Make sure you are in a git repository");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Parse command line arguments
|
|
58
|
+
const args = process.argv.slice(2);
|
|
59
|
+
|
|
60
|
+
// Show help if no arguments or --help/-h is passed
|
|
61
|
+
if (args[0] === "--help" || args[0] === "-h") {
|
|
62
|
+
showHelp();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Parse options
|
|
66
|
+
switch (args[0]) {
|
|
67
|
+
case "--staged-only":
|
|
68
|
+
case "-s":
|
|
69
|
+
case "-S":
|
|
70
|
+
runGitDiff("git --no-pager diff --staged", `Full staged diff saved to "${OUTPUT}"`, "Failed to save staged diff");
|
|
71
|
+
break;
|
|
72
|
+
|
|
73
|
+
default: {
|
|
74
|
+
// Handle specific file diff
|
|
75
|
+
const file = args[0];
|
|
76
|
+
if (!file) {
|
|
77
|
+
runGitDiff("git --no-pager diff", `Full staged diff saved to "${OUTPUT}"`, "Failed to save all diff's");
|
|
78
|
+
} else {
|
|
79
|
+
runGitDiff(
|
|
80
|
+
`git --no-pager diff --cached -- "${file}"`,
|
|
81
|
+
`Staged diff of "${file}" saved to "${OUTPUT}"`,
|
|
82
|
+
`Failed to generate diff for "${file}"`
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { execSync } = require("child_process");
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
|
|
6
|
+
// Output path
|
|
7
|
+
const CACHE_DIR = ".cache/git";
|
|
8
|
+
const OUTPUT = path.join(CACHE_DIR, "diff.txt");
|
|
9
|
+
|
|
10
|
+
// Ensure output directory exists
|
|
11
|
+
if (!fs.existsSync(CACHE_DIR)) {
|
|
12
|
+
fs.mkdirSync(CACHE_DIR, { recursive: true });
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function showHelp() {
|
|
16
|
+
console.log("Git Diff Helper");
|
|
17
|
+
console.log("----------------------------");
|
|
18
|
+
console.log("Usage:");
|
|
19
|
+
console.log(" git-diff FILE Show staged diff of specified file");
|
|
20
|
+
console.log(" git-diff --staged-only Show staged diff of all files");
|
|
21
|
+
console.log(" git-diff -s | -S Same as --staged-only");
|
|
22
|
+
console.log(" git-diff --help | -h Show this help message");
|
|
23
|
+
console.log("");
|
|
24
|
+
console.log(`Output is saved to: ${OUTPUT}`);
|
|
25
|
+
process.exit(0);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function runGitDiff(command, successMessage, errorMessage) {
|
|
29
|
+
try {
|
|
30
|
+
console.log(`[i] Running command: ${command}`);
|
|
31
|
+
const result = execSync(command, { encoding: "utf8" });
|
|
32
|
+
|
|
33
|
+
// If result is empty, inform user but don't treat as error
|
|
34
|
+
if (!result || result.trim() === "") {
|
|
35
|
+
console.log(`[i] No changes found for the specified criteria`);
|
|
36
|
+
fs.writeFileSync(OUTPUT, "# No changes found\n");
|
|
37
|
+
console.log(`[✓] Empty diff saved to "${OUTPUT}"`);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
fs.writeFileSync(OUTPUT, result);
|
|
42
|
+
console.log(`[✓] ${successMessage}`);
|
|
43
|
+
} catch (error) {
|
|
44
|
+
console.error(`[✗] ${errorMessage}`);
|
|
45
|
+
console.error(`Command: ${command}`);
|
|
46
|
+
console.error(`Error: ${error.message}`);
|
|
47
|
+
|
|
48
|
+
// Check if it's a git-related error
|
|
49
|
+
if (error.message.includes("not a git repository")) {
|
|
50
|
+
console.error("Make sure you are in a git repository");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Parse command line arguments
|
|
58
|
+
const args = process.argv.slice(2);
|
|
59
|
+
|
|
60
|
+
// Show help if no arguments or --help/-h is passed
|
|
61
|
+
if (args[0] === "--help" || args[0] === "-h") {
|
|
62
|
+
showHelp();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Parse options
|
|
66
|
+
switch (args[0]) {
|
|
67
|
+
case "--staged-only":
|
|
68
|
+
case "-s":
|
|
69
|
+
case "-S":
|
|
70
|
+
runGitDiff("git --no-pager diff --staged", `Full staged diff saved to "${OUTPUT}"`, "Failed to save staged diff");
|
|
71
|
+
break;
|
|
72
|
+
|
|
73
|
+
default: {
|
|
74
|
+
// Handle specific file diff
|
|
75
|
+
const file = args[0];
|
|
76
|
+
if (!file) {
|
|
77
|
+
runGitDiff("git --no-pager diff", `Full staged diff saved to "${OUTPUT}"`, "Failed to save all diff's");
|
|
78
|
+
} else {
|
|
79
|
+
runGitDiff(
|
|
80
|
+
`git --no-pager diff --cached -- "${file}"`,
|
|
81
|
+
`Staged diff of "${file}" saved to "${OUTPUT}"`,
|
|
82
|
+
`Failed to generate diff for "${file}"`
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
}
|