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.
Files changed (150) hide show
  1. package/bin/dir-tree.cmd +7 -0
  2. package/bin/git-diff +4 -0
  3. package/bin/git-diff.cmd +5 -2
  4. package/bin/{git-fix-encoding → git-fix} +1 -4
  5. package/bin/git-fix.cmd +7 -0
  6. package/bin/nodekill +0 -0
  7. package/bin/nodekill.ps1 +0 -0
  8. package/bin/{submodule → submodule.txt} +0 -0
  9. package/lib/binary-collections-config.cjs +14 -0
  10. package/lib/binary-collections-config.d.mts +18 -0
  11. package/lib/binary-collections-config.d.ts +16 -0
  12. package/lib/binary-collections-config.js +39 -0
  13. package/lib/binary-collections-config.mjs +6 -0
  14. package/lib/binary-collections.cjs +105 -0
  15. package/lib/binary-collections.d.cts +2 -0
  16. package/lib/binary-collections.d.mts +121 -0
  17. package/lib/binary-collections.d.ts +121 -0
  18. package/lib/binary-collections.mjs +108 -0
  19. package/lib/chunk-4BYBVEYC.mjs +30 -0
  20. package/lib/{chunk-FB6YIQYR.mjs → chunk-AASHBCRW.mjs} +17 -2
  21. package/lib/chunk-APBWENF6.mjs +135 -0
  22. package/lib/{chunk-4LEXWIIF.mjs → chunk-DPKAJKFO.mjs} +2 -4
  23. package/lib/chunk-EGSSKVDH.mjs +66 -0
  24. package/lib/{chunk-3LOB2P54.mjs → chunk-G3THLIDT.mjs} +3 -5
  25. package/lib/chunk-JGR2NW6D.mjs +187 -0
  26. package/lib/chunk-ONIBBBQ3.mjs +108 -0
  27. package/lib/chunk-SH3L6HHV.mjs +27 -0
  28. package/lib/chunk-VVEZVNIV.mjs +81 -0
  29. package/lib/{chunk-JL32QDSH.mjs → chunk-W3ENOM53.mjs} +2 -4
  30. package/lib/chunk-YV7DO3YV.mjs +48 -0
  31. package/lib/{chunk-BSD5CIRU.mjs → chunk-YX5U7XDR.mjs} +11 -5
  32. package/lib/chunk-ZYAQRPUL.mjs +28 -0
  33. package/lib/clean-github-actions-caches.cjs +162 -0
  34. package/lib/clean-github-actions-caches.d.cts +1 -0
  35. package/lib/clean-github-actions-caches.d.mts +169 -0
  36. package/lib/clean-github-actions-caches.d.ts +169 -0
  37. package/lib/clean-github-actions-caches.mjs +132 -0
  38. package/lib/del-gradle.cjs +87 -3
  39. package/lib/del-gradle.js +1 -1
  40. package/lib/del-gradle.mjs +4 -6
  41. package/lib/del-node-modules.cjs +86 -2
  42. package/lib/del-node-modules.mjs +3 -5
  43. package/lib/del-ps.cjs +89 -5
  44. package/lib/del-ps.js +2 -2
  45. package/lib/del-ps.mjs +6 -8
  46. package/lib/del-yarn-caches.cjs +86 -2
  47. package/lib/del-yarn-caches.mjs +3 -5
  48. package/lib/find-node-modules-cli.cjs +8 -0
  49. package/lib/find-node-modules-cli.mjs +2 -3
  50. package/lib/find-node-modules.cjs +8 -0
  51. package/lib/find-node-modules.d.mts +3 -0
  52. package/lib/find-node-modules.d.ts +3 -0
  53. package/lib/find-node-modules.js +12 -0
  54. package/lib/find-node-modules.mjs +2 -3
  55. package/lib/git/gitattributes.cjs +171 -0
  56. package/lib/git/gitattributes.d.mts +35 -0
  57. package/lib/git/gitattributes.d.ts +33 -0
  58. package/lib/git/gitattributes.js +223 -0
  59. package/lib/git/gitattributes.mjs +6 -0
  60. package/lib/git/line-endings.cjs +74 -0
  61. package/lib/git/line-endings.d.cts +7 -0
  62. package/lib/git/line-endings.d.mts +83 -0
  63. package/lib/git/line-endings.d.ts +83 -0
  64. package/lib/git/line-endings.mjs +8 -0
  65. package/lib/git/normalize.cjs +42 -0
  66. package/lib/git/normalize.d.cts +6 -0
  67. package/lib/git/normalize.d.mts +43 -0
  68. package/lib/git/normalize.d.ts +43 -0
  69. package/lib/git/normalize.mjs +6 -0
  70. package/lib/git/permissions.cjs +15 -0
  71. package/lib/git/permissions.d.cts +6 -0
  72. package/lib/git/permissions.d.mts +17 -0
  73. package/lib/git/permissions.d.ts +17 -0
  74. package/lib/git/permissions.mjs +7 -0
  75. package/lib/git/pull-strategy.cjs +13 -0
  76. package/lib/git/pull-strategy.d.cts +5 -0
  77. package/lib/git/pull-strategy.d.mts +15 -0
  78. package/lib/git/pull-strategy.d.ts +15 -0
  79. package/lib/git/pull-strategy.mjs +7 -0
  80. package/lib/git/user-config.cjs +100 -0
  81. package/lib/git/user-config.d.cts +10 -0
  82. package/lib/git/user-config.d.mts +105 -0
  83. package/lib/git/user-config.d.ts +105 -0
  84. package/lib/git/user-config.mjs +8 -0
  85. package/lib/git/utils.cjs +70 -0
  86. package/lib/git/utils.d.cts +20 -0
  87. package/lib/git/utils.d.mts +69 -0
  88. package/lib/git/utils.d.ts +69 -0
  89. package/lib/git/utils.mjs +6 -0
  90. package/lib/git-diff.cjs +23 -24
  91. package/lib/git-diff.d.mts +25 -28
  92. package/lib/git-diff.d.ts +25 -28
  93. package/lib/git-diff.mjs +32 -27
  94. package/lib/git-fix.cjs +129 -0
  95. package/lib/git-fix.d.cts +2 -0
  96. package/lib/git-fix.d.mts +141 -0
  97. package/lib/git-fix.d.ts +141 -0
  98. package/lib/git-fix.mjs +151 -0
  99. package/lib/git-purge.cjs +86 -2
  100. package/lib/git-purge.mjs +3 -5
  101. package/lib/index.cjs +8 -0
  102. package/lib/index.mjs +3 -5
  103. package/lib/npm-run-series.cjs +140 -1
  104. package/lib/npm-run-series.js +2 -1
  105. package/lib/npm-run-series.mjs +7 -5
  106. package/lib/package-resolutions-updater.cjs +274 -0
  107. package/lib/package-resolutions-updater.d.mts +1 -0
  108. package/lib/package-resolutions-updater.d.ts +326 -0
  109. package/lib/package-resolutions-updater.mjs +316 -0
  110. package/lib/print-directory-tree.cjs +241 -0
  111. package/lib/print-directory-tree.d.cts +1 -0
  112. package/lib/print-directory-tree.d.mts +234 -0
  113. package/lib/print-directory-tree.d.ts +234 -0
  114. package/lib/print-directory-tree.mjs +182 -0
  115. package/lib/ps/connected-domain.mjs +2 -3
  116. package/lib/ps/index.cjs +3 -3
  117. package/lib/ps/index.d.mjs +1 -2
  118. package/lib/ps/index.js +6 -3
  119. package/lib/ps/index.mjs +9 -11
  120. package/lib/ps/isWin.mjs +2 -3
  121. package/lib/ps/table-parser.mjs +3 -4
  122. package/lib/submodule-install.cjs +13 -31
  123. package/lib/submodule-install.d.mts +12 -32
  124. package/lib/submodule-install.d.ts +12 -32
  125. package/lib/submodule-install.mjs +16 -25
  126. package/lib/utils.cjs +86 -2
  127. package/lib/utils.d.mts +29 -9
  128. package/lib/utils.d.ts +28 -8
  129. package/lib/utils.js +139 -8
  130. package/lib/utils.mjs +2 -3
  131. package/lib/yarn-reinstall.cjs +9 -7
  132. package/lib/yarn-reinstall.d.mts +12 -8
  133. package/lib/yarn-reinstall.d.ts +12 -8
  134. package/lib/yarn-reinstall.mjs +14 -10
  135. package/package.json +109 -80
  136. package/readme.md +74 -11
  137. package/src/package-resolutions-updater.mjs +325 -0
  138. package/src/print-directory-tree.cjs +234 -0
  139. package/src/ps/index.js +4 -3
  140. package/src/yarn-reinstall.cjs +49 -0
  141. package/test-project/package.json +16 -0
  142. package/tmp/test-repo/package.json +7 -0
  143. package/bin/git-fix-encoding.cmd +0 -6
  144. package/lib/chunk-OKYLF2MU.mjs +0 -53
  145. package/lib/chunk-VXZQNLPU.mjs +0 -23
  146. package/lib/package-resolutions.cjs +0 -28
  147. package/lib/package-resolutions.d.mts +0 -25
  148. package/lib/package-resolutions.d.ts +0 -25
  149. package/lib/package-resolutions.mjs +0 -31
  150. /package/bin/{submodule-install → submodule-install.txt} +0 -0
@@ -0,0 +1,151 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
3
+ import {
4
+ require_user_config
5
+ } from "./chunk-ONIBBBQ3.mjs";
6
+ import {
7
+ require_line_endings
8
+ } from "./chunk-VVEZVNIV.mjs";
9
+ import "./chunk-JGR2NW6D.mjs";
10
+ import {
11
+ require_normalize
12
+ } from "./chunk-YV7DO3YV.mjs";
13
+ import {
14
+ require_permissions
15
+ } from "./chunk-ZYAQRPUL.mjs";
16
+ import {
17
+ require_pull_strategy
18
+ } from "./chunk-SH3L6HHV.mjs";
19
+ import {
20
+ require_utils as require_utils2
21
+ } from "./chunk-EGSSKVDH.mjs";
22
+ import {
23
+ require_utils
24
+ } from "./chunk-APBWENF6.mjs";
25
+ import {
26
+ __commonJS,
27
+ __require,
28
+ init_esm_shims
29
+ } from "./chunk-AASHBCRW.mjs";
30
+
31
+ // src/git-fix.cjs
32
+ var require_git_fix = __commonJS({
33
+ "src/git-fix.cjs"() {
34
+ init_esm_shims();
35
+ var { isGitRepository } = require_utils2();
36
+ var { forceLfLineEndings } = require_line_endings();
37
+ var { ignoreFilePermissions } = require_permissions();
38
+ var { setPullStrategy } = require_pull_strategy();
39
+ var { configureGitUser } = require_user_config();
40
+ var { normalizeLineEndings } = require_normalize();
41
+ var { getArgs } = require_utils();
42
+ var path = __require("upath");
43
+ function showHelp() {
44
+ console.log("Git Fix Utility");
45
+ console.log("----------------------------");
46
+ console.log("Fixes common Git configuration issues:");
47
+ console.log("\u2022 Forces LF line endings (core.autocrlf = false)");
48
+ console.log("\u2022 Ignores file permission changes (core.filemode = false)");
49
+ console.log("\u2022 Sets pull strategy to false (prevents auto-rebase)");
50
+ console.log("\u2022 Normalizes existing line endings");
51
+ console.log("\u2022 Configures Git user from environment variables");
52
+ console.log("");
53
+ console.log("Usage:");
54
+ console.log(" git-fix Apply all fixes");
55
+ console.log(" git-fix --lf-only Force LF line endings only");
56
+ console.log(" git-fix --permissions Ignore file permissions only");
57
+ console.log(" git-fix --normalize Normalize existing files only");
58
+ console.log(" git-fix --user Configure Git user from environment");
59
+ console.log(" git-fix --user NAME EMAIL Configure Git user with specified name and email");
60
+ console.log(" git-fix --help | -h Show this help message");
61
+ console.log("");
62
+ console.log("Options can be combined: git-fix --lf-only --permissions");
63
+ console.log("");
64
+ console.log("User configuration precedence:");
65
+ console.log(" 1. CLI arguments (--user NAME EMAIL)");
66
+ console.log(" 2. Environment variables (GITHUB_USER, GITHUB_EMAIL)");
67
+ console.log(" 3. Skip if neither provided");
68
+ console.log("");
69
+ console.log("Environment variables for --user option:");
70
+ console.log(" GITHUB_USER - Git username (for user.name)");
71
+ console.log(" GITHUB_EMAIL - Git email (for user.email)");
72
+ process.exit(0);
73
+ }
74
+ var args = getArgs();
75
+ var userConfig = { hasUserFlag: false, cliUser: null, cliEmail: null };
76
+ if (Object.prototype.hasOwnProperty.call(args, "user")) {
77
+ userConfig.hasUserFlag = true;
78
+ if (Array.isArray(args.user)) {
79
+ if (args.user.length === 2) {
80
+ userConfig.cliUser = args.user[0];
81
+ userConfig.cliEmail = args.user[1];
82
+ } else if (args.user.length === 1) {
83
+ console.error("[\u2717] Error: --user requires both NAME and EMAIL or no arguments");
84
+ console.error("Usage: --user (uses environment variables) or --user NAME EMAIL");
85
+ process.exit(1);
86
+ }
87
+ } else if (typeof args.user === "string") {
88
+ console.error("[\u2717] Error: --user requires both NAME and EMAIL or no arguments");
89
+ console.error("Usage: --user (uses environment variables) or --user NAME EMAIL");
90
+ process.exit(1);
91
+ }
92
+ }
93
+ if (args.help || args.h) {
94
+ showHelp();
95
+ process.exit(0);
96
+ }
97
+ console.log("[i] Current working directory:", path.toUnix(process.cwd()));
98
+ if (!isGitRepository(process.cwd())) {
99
+ console.error("[\u2717] Error: Not in a git repository");
100
+ console.error("Please run this command from within a git repository");
101
+ process.exit(1);
102
+ } else {
103
+ console.log("[\u2713] Detected git repository");
104
+ }
105
+ console.log("Git Fix Utility");
106
+ console.log("===============");
107
+ var options = {
108
+ lfOnly: args["lf-only"] === true,
109
+ permissions: args["permissions"] === true,
110
+ normalize: args["normalize"] === true,
111
+ user: userConfig.hasUserFlag,
112
+ updateRemote: args["update-remote"] === true,
113
+ all: Object.keys(args).filter((k) => k !== "_" && args[k] === true).length === 0 && !userConfig.hasUserFlag
114
+ };
115
+ if (options.all || options.lfOnly) {
116
+ forceLfLineEndings();
117
+ }
118
+ if (options.all || options.permissions) {
119
+ ignoreFilePermissions();
120
+ }
121
+ if (options.all) {
122
+ setPullStrategy();
123
+ }
124
+ if (options.all || options.user) {
125
+ configureGitUser(userConfig.cliUser, userConfig.cliEmail, { updateRemote: options.updateRemote });
126
+ } else if (options.updateRemote) {
127
+ configureGitUser(null, null, { updateRemote: true });
128
+ }
129
+ if (options.all || options.normalize) {
130
+ normalizeLineEndings();
131
+ }
132
+ console.log("\n=== Summary ===");
133
+ console.log("[\u2713] Git fix utility completed successfully");
134
+ if (options.all || options.lfOnly || options.normalize) {
135
+ console.log("[i] Line endings are now configured for LF");
136
+ }
137
+ if (options.all || options.permissions) {
138
+ console.log("[i] File permission changes will be ignored");
139
+ }
140
+ var _a, _b;
141
+ if (options.all || options.user) {
142
+ const username = userConfig.cliUser || ((_a = process.env.GITHUB_USER) == null ? void 0 : _a.trim());
143
+ const email = userConfig.cliEmail || ((_b = process.env.GITHUB_EMAIL) == null ? void 0 : _b.trim());
144
+ if (username || email) {
145
+ console.log("[i] Git user configuration has been applied");
146
+ }
147
+ }
148
+ console.log("[i] Repository is ready for cross-platform development");
149
+ }
150
+ });
151
+ export default require_git_fix();
package/lib/git-purge.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 { fs, path: path2 } = require("sbg-utility");
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 del(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 = del;
39
85
  function delStream(globStream) {
40
86
  globStream.stream().on("data", (result) => {
41
87
  const fullPath = path2.resolve(process.cwd(), result);
@@ -48,8 +94,46 @@ var require_utils = __commonJS({
48
94
  del(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 delay2 = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
52
- module2.exports = { del, delStream, getArgs, delay: delay2 };
136
+ module2.exports.delay = delay2;
53
137
  }
54
138
  });
55
139
 
package/lib/git-purge.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-OKYLF2MU.mjs";
4
+ } from "./chunk-APBWENF6.mjs";
5
5
  import {
6
+ __require,
6
7
  init_esm_shims
7
- } from "./chunk-VXZQNLPU.mjs";
8
- import {
9
- __require
10
- } from "./chunk-FB6YIQYR.mjs";
8
+ } from "./chunk-AASHBCRW.mjs";
11
9
 
12
10
  // src/git-purge.js
13
11
  init_esm_shims();
package/lib/index.cjs CHANGED
@@ -74,7 +74,15 @@ var require_find_node_modules = __commonJS({
74
74
  });
75
75
  });
76
76
  }
77
+ if (typeof module2 !== "undefined" && require.main === module2) {
78
+ findNodeModules2(null, console.log).then((dirs) => {
79
+ console.log(`Found ${dirs.length} node_modules directories.`);
80
+ }).catch((err) => {
81
+ console.error("Error finding node_modules directories:", err);
82
+ });
83
+ }
77
84
  module2.exports = findNodeModules2;
85
+ module2.exports.default = findNodeModules2;
78
86
  }
79
87
  });
80
88
 
package/lib/index.mjs CHANGED
@@ -1,13 +1,11 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
2
  import {
3
3
  require_find_node_modules
4
- } from "./chunk-BSD5CIRU.mjs";
4
+ } from "./chunk-YX5U7XDR.mjs";
5
5
  import {
6
+ __toESM,
6
7
  init_esm_shims
7
- } from "./chunk-VXZQNLPU.mjs";
8
- import {
9
- __toESM
10
- } from "./chunk-FB6YIQYR.mjs";
8
+ } from "./chunk-AASHBCRW.mjs";
11
9
 
12
10
  // src/index.ts
13
11
  init_esm_shims();
@@ -5,6 +5,12 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __esm = (fn, res) => function __init() {
9
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
+ };
11
+ var __commonJS = (cb, mod) => function __require() {
12
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13
+ };
8
14
  var __copyProps = (to, from, except, desc) => {
9
15
  if (from && typeof from === "object" || typeof from === "function") {
10
16
  for (let key of __getOwnPropNames(from))
@@ -22,11 +28,144 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
22
28
  mod
23
29
  ));
24
30
 
31
+ // node_modules/tsup/assets/cjs_shims.js
32
+ var init_cjs_shims = __esm({
33
+ "node_modules/tsup/assets/cjs_shims.js"() {
34
+ }
35
+ });
36
+
37
+ // src/utils.js
38
+ var require_utils = __commonJS({
39
+ "src/utils.js"(exports2, module2) {
40
+ init_cjs_shims();
41
+ var fs2 = require("fs");
42
+ var path2 = require("upath");
43
+ var argv = require("minimist")(process.argv.slice(2));
44
+ var { exec } = require("child_process");
45
+ var { URL: URL2 } = require("url");
46
+ var { promisify } = require("util");
47
+ var execAsync = promisify(exec);
48
+ async function parseGitRemotes() {
49
+ try {
50
+ const { stdout } = await execAsync("git remote -v");
51
+ const lines = stdout.split("\n");
52
+ const remotes = {};
53
+ lines.forEach((line) => {
54
+ const [name, url] = line.split(" ");
55
+ if (name && url) {
56
+ const [repoUrl] = url.split(" ");
57
+ try {
58
+ const parsedUrl = new URL2(repoUrl);
59
+ const pathParts = parsedUrl.pathname.split("/").filter(Boolean);
60
+ if (parsedUrl.hostname === "github.com" && pathParts.length === 2) {
61
+ let repoPath = pathParts.join("/");
62
+ if (repoPath.endsWith(".git")) {
63
+ repoPath = repoPath.slice(0, -4);
64
+ }
65
+ remotes[name] = repoPath;
66
+ }
67
+ } catch (e) {
68
+ console.error("URL Parsing Error:", e.message);
69
+ }
70
+ }
71
+ });
72
+ return remotes;
73
+ } catch (error) {
74
+ console.error("Error:", error.message);
75
+ return {};
76
+ }
77
+ }
78
+ module2.exports.parseGitRemotes = parseGitRemotes;
79
+ function joinPathPreserveDriveLetter(...segments) {
80
+ let fullPath = require("path").join(...segments);
81
+ if (/^[a-z]:\\/.test(fullPath)) {
82
+ fullPath = fullPath.charAt(0).toUpperCase() + fullPath.slice(1);
83
+ }
84
+ return fullPath;
85
+ }
86
+ module2.exports.joinPathPreserveDriveLetter = joinPathPreserveDriveLetter;
87
+ function getArgs2() {
88
+ return argv;
89
+ }
90
+ module2.exports.getArgs = getArgs2;
91
+ function del(fullPath) {
92
+ if (fs2.statSync(fullPath).isDirectory()) {
93
+ const subdir = fs2.readdirSync(fullPath).map((dirPath) => path2.resolve(fullPath, dirPath));
94
+ for (let i = 0; i < subdir.length; i++) {
95
+ del(subdir[i]);
96
+ }
97
+ } else {
98
+ try {
99
+ fs2.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
100
+ console.log("deleted", fullPath);
101
+ } catch (_) {
102
+ console.log("failed delete", fullPath);
103
+ }
104
+ }
105
+ }
106
+ module2.exports.del = del;
107
+ function delStream(globStream) {
108
+ globStream.stream().on("data", (result) => {
109
+ const fullPath = path2.resolve(process.cwd(), result);
110
+ if (fs2.statSync(fullPath).isDirectory()) {
111
+ const subdir = fs2.readdirSync(fullPath).map((dirPath) => path2.resolve(fullPath, dirPath));
112
+ for (let i = 0; i < subdir.length; i++) {
113
+ del(subdir[i]);
114
+ }
115
+ }
116
+ del(fullPath);
117
+ });
118
+ }
119
+ module2.exports.delStream = delStream;
120
+ function getFileTreeString(hashArray) {
121
+ const tree = {};
122
+ const hashMap = {};
123
+ for (const entry of hashArray) {
124
+ const [filePath, hash] = entry.split(" ");
125
+ hashMap[filePath] = hash;
126
+ const parts = filePath.split("/");
127
+ let current = tree;
128
+ for (let i = 0; i < parts.length; i++) {
129
+ const part = parts[i];
130
+ if (i === parts.length - 1) {
131
+ current[part] = null;
132
+ } else {
133
+ current[part] = current[part] || {};
134
+ current = current[part];
135
+ }
136
+ }
137
+ }
138
+ function printNode(node, prefix = "", parentPath = "") {
139
+ const keys = Object.keys(node).sort();
140
+ let lines = [];
141
+ keys.forEach((key, idx) => {
142
+ const isLast = idx === keys.length - 1;
143
+ const branch = isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ";
144
+ const currentPath = parentPath ? parentPath + "/" + key : key;
145
+ if (node[key] === null) {
146
+ lines.push(prefix + branch + key + " [" + (hashMap[currentPath] || "") + "]");
147
+ } else {
148
+ lines.push(prefix + branch + key + "/");
149
+ lines = lines.concat(printNode(node[key], prefix + (isLast ? " " : "\u2502 "), currentPath));
150
+ }
151
+ });
152
+ return lines;
153
+ }
154
+ return printNode(tree, "", "").join("\n");
155
+ }
156
+ module2.exports.getFileTreeString = getFileTreeString;
157
+ var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
158
+ module2.exports.delay = delay;
159
+ }
160
+ });
161
+
25
162
  // src/npm-run-series.js
163
+ init_cjs_shims();
26
164
  var fs = require("fs");
27
165
  var path = require("path");
28
166
  var { Minimatch } = require("minimatch");
29
- var args = require("minimist")(process.argv.slice(2));
167
+ var { getArgs } = require_utils();
168
+ var args = getArgs();
30
169
  var cwd = process.cwd();
31
170
  var packagejson = path.join(cwd, "package.json");
32
171
  var verbose = args["v"] || args["verbose"];
@@ -44,7 +44,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
44
44
  const fs = require("fs");
45
45
  const path = require("path");
46
46
  const { Minimatch } = require("minimatch");
47
- const args = require("minimist")(process.argv.slice(2));
47
+ const { getArgs } = require("./utils.js");
48
+ const args = getArgs();
48
49
  const cwd = process.cwd();
49
50
  const packagejson = path.join(cwd, "package.json");
50
51
  const verbose = args["v"] || args["verbose"];
@@ -1,18 +1,20 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
3
3
  import {
4
- init_esm_shims
5
- } from "./chunk-VXZQNLPU.mjs";
4
+ require_utils
5
+ } from "./chunk-APBWENF6.mjs";
6
6
  import {
7
- __require
8
- } from "./chunk-FB6YIQYR.mjs";
7
+ __require,
8
+ init_esm_shims
9
+ } from "./chunk-AASHBCRW.mjs";
9
10
 
10
11
  // src/npm-run-series.js
11
12
  init_esm_shims();
12
13
  var fs = __require("fs");
13
14
  var path = __require("path");
14
15
  var { Minimatch } = __require("minimatch");
15
- var args = __require("minimist")(process.argv.slice(2));
16
+ var { getArgs } = require_utils();
17
+ var args = getArgs();
16
18
  var cwd = process.cwd();
17
19
  var packagejson = path.join(cwd, "package.json");
18
20
  var verbose = args["v"] || args["verbose"];