binary-collections 2.0.11 → 2.0.12

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 (225) hide show
  1. package/.opencode/package.json +5 -0
  2. package/binaries/rmx +15 -1
  3. package/binaries/rmx.cmd +12 -0
  4. package/binaries/test-cjs +9 -1
  5. package/binaries/test-cjs.cmd +16 -1
  6. package/binaries/test-esm +16 -0
  7. package/binaries/test-esm.cjs +178 -0
  8. package/binaries/test-esm.cmd +23 -0
  9. package/binaries/yarn-clean +1 -1
  10. package/binaries/yarn-clean.cmd +1 -1
  11. package/binaries/yarn-clean.py +33 -15
  12. package/binaries/yc +110 -0
  13. package/binaries/yc.cjs +178 -0
  14. package/lib/binary-collections/config.cjs +126 -0
  15. package/lib/binary-collections/config.mjs +7 -0
  16. package/lib/binary-collections/executeScript.cjs +19 -0
  17. package/lib/binary-collections/executeScript.d.cts +12 -0
  18. package/lib/binary-collections/executeScript.mjs +6 -0
  19. package/lib/binary-collections/findScript.cjs +284 -0
  20. package/lib/binary-collections/findScript.d.cts +12 -0
  21. package/lib/binary-collections/findScript.mjs +7 -0
  22. package/lib/binary-collections/listScript.cjs +266 -0
  23. package/lib/binary-collections/listScript.d.cts +19 -0
  24. package/lib/binary-collections/listScript.mjs +7 -0
  25. package/lib/binary-collections.cjs +224 -137
  26. package/lib/binary-collections.mjs +22 -282
  27. package/lib/changelog.cjs +2 -2
  28. package/lib/changelog.mjs +1 -1
  29. package/lib/{chunk-AJDD5DZM.mjs → chunk-2LSRSEXF.mjs} +1 -1
  30. package/lib/{chunk-Z6JLYU2J.mjs → chunk-5RTXZVCW.mjs} +2 -2
  31. package/lib/{chunk-XA3SNBPA.mjs → chunk-66KDU4TX.mjs} +93 -9
  32. package/lib/chunk-6PU7BAHB.mjs +61 -0
  33. package/lib/chunk-C6D2TTYU.mjs +32 -0
  34. package/lib/chunk-FB2WKVJD.mjs +158 -0
  35. package/lib/{chunk-NCXAP7AA.mjs → chunk-G5UUEWUO.mjs} +9 -5
  36. package/lib/{chunk-N436BNBK.mjs → chunk-GAGABICI.mjs} +19 -13
  37. package/lib/chunk-H44UWUFY.mjs +105 -0
  38. package/lib/chunk-NCZPTKDV.mjs +79 -0
  39. package/lib/chunk-NGFK3EYW.mjs +28 -0
  40. package/lib/chunk-NVEG3LEZ.mjs +143 -0
  41. package/lib/chunk-OGXVGBRI.mjs +29 -0
  42. package/lib/chunk-OXV52GD5.mjs +62 -0
  43. package/lib/chunk-PXBMHE7O.mjs +35 -0
  44. package/lib/chunk-R5FJOR63.mjs +47 -0
  45. package/lib/chunk-SPTECFE5.mjs +180 -0
  46. package/lib/chunk-UXCFNAR6.mjs +55 -0
  47. package/lib/chunk-V2IBPCEV.mjs +39 -0
  48. package/lib/chunk-XPJGCDOD.mjs +14 -0
  49. package/lib/chunk-ZOWVMII3.mjs +228 -0
  50. package/lib/clean-github-actions-caches-cli.cjs +465 -0
  51. package/lib/clean-github-actions-caches-cli.d.cts +1 -0
  52. package/lib/clean-github-actions-caches-cli.mjs +56 -0
  53. package/lib/clean-github-actions-caches.cjs +149 -205
  54. package/lib/clean-github-actions-caches.d.cts +15 -1
  55. package/lib/clean-github-actions-caches.mjs +4 -130
  56. package/lib/cross-env/command.cjs +63 -0
  57. package/lib/cross-env/command.d.ts +8 -0
  58. package/lib/cross-env/command.js +45 -0
  59. package/lib/cross-env/command.mjs +9 -0
  60. package/lib/cross-env/index.cjs +178 -0
  61. package/lib/cross-env/index.d.ts +8 -0
  62. package/lib/cross-env/index.js +102 -0
  63. package/lib/cross-env/index.mjs +101 -0
  64. package/lib/cross-env/variable.cjs +60 -0
  65. package/lib/cross-env/variable.d.ts +7 -0
  66. package/lib/cross-env/variable.js +59 -0
  67. package/lib/cross-env/variable.mjs +9 -0
  68. package/lib/del-gradle.cjs +2 -2
  69. package/lib/del-gradle.js +8 -8
  70. package/lib/del-gradle.mjs +1 -1
  71. package/lib/del-node-modules.js +24 -24
  72. package/lib/del-ps.cjs +2 -2
  73. package/lib/del-ps.js +8 -8
  74. package/lib/del-ps.mjs +1 -1
  75. package/lib/del-yarn-caches.cjs +2 -2
  76. package/lib/del-yarn-caches.js +2 -2
  77. package/lib/del-yarn-caches.mjs +1 -1
  78. package/lib/file/copy-cli.cjs +92 -0
  79. package/lib/file/copy-cli.d.mts +1 -0
  80. package/lib/file/copy-cli.mjs +55 -0
  81. package/lib/file/copy.cjs +56 -0
  82. package/lib/file/copy.d.mts +1 -0
  83. package/lib/file/copy.mjs +8 -0
  84. package/lib/file/move-cli.cjs +91 -0
  85. package/lib/file/move-cli.d.mts +1 -0
  86. package/lib/file/move-cli.mjs +55 -0
  87. package/lib/file/move.cjs +55 -0
  88. package/lib/file/move.d.mts +1 -0
  89. package/lib/file/move.mjs +8 -0
  90. package/lib/find-node-modules-cli.js +1 -1
  91. package/lib/free-chatgpt.cjs +21 -15
  92. package/lib/free-chatgpt.js +10 -10
  93. package/lib/free-chatgpt.mjs +2 -2
  94. package/lib/git/user-config.cjs +2 -2
  95. package/lib/git/user-config.mjs +2 -2
  96. package/lib/git-diff-cli.cjs +188 -42
  97. package/lib/git-diff-cli.mjs +5 -4
  98. package/lib/git-diff.cjs +188 -42
  99. package/lib/git-diff.d.ts +2 -1
  100. package/lib/git-diff.js +91 -34
  101. package/lib/git-diff.mjs +5 -4
  102. package/lib/git-fix.cjs +2 -2
  103. package/lib/git-fix.mjs +2 -2
  104. package/lib/git-purge.cjs +2 -2
  105. package/lib/git-purge.mjs +1 -1
  106. package/lib/index.d.ts +1 -1
  107. package/lib/kill-night-crows.cjs +7 -7
  108. package/lib/kill-night-crows.mjs +7 -7
  109. package/lib/node-cache-cleaner/npm.cjs +65 -0
  110. package/lib/node-cache-cleaner/npm.d.ts +2 -0
  111. package/lib/node-cache-cleaner/npm.js +41 -0
  112. package/lib/node-cache-cleaner/npm.mjs +10 -0
  113. package/lib/node-cache-cleaner/npx.cjs +89 -0
  114. package/lib/node-cache-cleaner/npx.d.ts +4 -0
  115. package/lib/node-cache-cleaner/npx.js +82 -0
  116. package/lib/{ps/index.d.mjs → node-cache-cleaner/npx.mjs} +6 -5
  117. package/lib/node-cache-cleaner/yarn.cjs +73 -0
  118. package/lib/node-cache-cleaner/yarn.d.ts +2 -0
  119. package/lib/node-cache-cleaner/yarn.js +62 -0
  120. package/lib/node-cache-cleaner/yarn.mjs +10 -0
  121. package/lib/node-cache-cleaner-cli.cjs +182 -0
  122. package/lib/node-cache-cleaner-cli.d.ts +2 -0
  123. package/lib/node-cache-cleaner-cli.js +60 -0
  124. package/lib/node-cache-cleaner-cli.mjs +56 -0
  125. package/lib/node-executor.cjs +91 -0
  126. package/lib/node-executor.d.cts +2 -0
  127. package/lib/node-executor.mjs +103 -0
  128. package/lib/npm-run-series.cjs +21 -28
  129. package/lib/npm-run-series.mjs +20 -6
  130. package/lib/package-resolutions-updater-cli.cjs +213 -128
  131. package/lib/package-resolutions-updater-cli.mjs +17 -39
  132. package/lib/package-resolutions-updater.cjs +204 -98
  133. package/lib/package-resolutions-updater.d.mts +20 -1
  134. package/lib/package-resolutions-updater.mjs +7 -5
  135. package/lib/print-directory-tree.cjs +2 -2
  136. package/lib/print-directory-tree.mjs +1 -1
  137. package/lib/ps/connected-domain.js +10 -10
  138. package/lib/ps/index.cjs +1 -1
  139. package/lib/ps/index.mjs +177 -171
  140. package/lib/ps/isWin.js +1 -1
  141. package/lib/ps/table-parser.js +6 -6
  142. package/lib/remove-module.cjs +2 -2
  143. package/lib/remove-module.mjs +1 -1
  144. package/lib/rm-node-module-cli.cjs +222 -0
  145. package/lib/rm-node-module-cli.d.cts +1 -0
  146. package/lib/rm-node-module-cli.mjs +89 -0
  147. package/lib/rm-node-modules.cjs +127 -0
  148. package/lib/rm-node-modules.d.cts +35 -0
  149. package/lib/{binary-collections-config.mjs → rm-node-modules.mjs} +3 -3
  150. package/lib/rmpath.cjs +2 -2
  151. package/lib/rmpath.mjs +1 -1
  152. package/lib/submodule-install.cjs +47 -34
  153. package/lib/submodule-install.mjs +46 -33
  154. package/lib/submodule-remove-cli.cjs +1 -2
  155. package/lib/submodule-remove-cli.js +3 -3
  156. package/lib/submodule-remove-cli.mjs +1 -2
  157. package/lib/utils/chatgpt.cjs +19 -13
  158. package/lib/utils/chatgpt.js +94 -94
  159. package/lib/utils/chatgpt.mjs +1 -1
  160. package/lib/utils/findEnvFiles.cjs +28 -46
  161. package/lib/utils/findEnvFiles.d.cts +19 -0
  162. package/lib/utils/findEnvFiles.mjs +3 -5
  163. package/lib/utils/findWorkspaceRoot.js +4 -4
  164. package/lib/utils/index.cjs +2 -2
  165. package/lib/utils/index.mjs +1 -1
  166. package/lib/utils/isGithubTokenValid.js +7 -7
  167. package/lib/{ps/index.d.cjs → utils/isWindows.cjs} +17 -3
  168. package/lib/utils/isWindows.d.ts +5 -0
  169. package/lib/utils/isWindows.js +10 -0
  170. package/lib/utils/isWindows.mjs +8 -0
  171. package/lib/utils/runBash.cjs +53 -0
  172. package/lib/utils/runBash.d.cts +12 -0
  173. package/lib/utils/runBash.mjs +66 -0
  174. package/lib/yarn-per-branch-lock-installer.cjs +97 -0
  175. package/lib/yarn-per-branch-lock-installer.d.cts +2 -0
  176. package/lib/yarn-per-branch-lock-installer.mjs +109 -0
  177. package/lib/yarn-reinstall.cjs +2 -2
  178. package/lib/yarn-reinstall.mjs +1 -1
  179. package/package.json +61 -52
  180. package/readme.html +784 -0
  181. package/readme.md +106 -218
  182. package/releases/readme.md +1 -1
  183. package/test/README.md +2 -2
  184. package/test-project/package.json +8 -2
  185. package/test-project/workspaces/workspace-a/package.json +135 -0
  186. package/test-project/workspaces/workspace-a/readme.md +20 -0
  187. package/test-project/workspaces/workspace-a/release/readme.md +42 -0
  188. package/test-project/workspaces/workspace-a/test/demo/package.json +25 -0
  189. package/test-project/workspaces/workspace-a/test/readme.md +12 -0
  190. package/test-project/workspaces/workspace-b/package.json +139 -0
  191. package/test-project/workspaces/workspace-b/readme.md +94 -0
  192. package/test-project/workspaces/workspace-b/requirements.txt +1 -0
  193. package/test-project/workspaces/workspace-b/test/sample-project/package.json +7 -0
  194. package/test-project/workspaces/workspace-b/themes/hexo-theme-flowbite/package.json +96 -0
  195. package/test-project/workspaces/workspace-b/themes/hexo-theme-flowbite/readme.md +156 -0
  196. package/tmp/rm-node-modules-test-project/package.json +17 -0
  197. package/tmp/rm-node-modules-test-project/packages/workspace-a/package.json +16 -0
  198. package/tmp/rm-node-modules-test-project/packages/workspace-b/package.json +16 -0
  199. package/tmp/test-repo/README.md +2 -35
  200. package/tmp/test-repo/package.json +13 -3
  201. package/docs-src/clean-github-actions-caches.md +0 -26
  202. package/docs-src/free-chatgpt.md +0 -26
  203. package/lib/binary-collections-config.cjs +0 -15
  204. package/lib/chunk-2CBJCW7E.mjs +0 -81
  205. package/lib/chunk-4UHL4WVN.mjs +0 -136
  206. package/lib/chunk-66PAU5PS.mjs +0 -31
  207. package/lib/chunk-6HHJRKFB.mjs +0 -59
  208. package/lib/chunk-7XTEJHOE.mjs +0 -193
  209. package/lib/chunk-FCDQGYBF.mjs +0 -136
  210. package/lib/chunk-GEYA2USY.mjs +0 -207
  211. package/lib/chunk-GJTGHXRA.mjs +0 -356
  212. package/lib/chunk-ID2WBTE2.mjs +0 -80
  213. package/lib/chunk-JXFOHKDM.mjs +0 -239
  214. package/lib/chunk-PDSXF5HY.mjs +0 -187
  215. package/lib/chunk-RWLXRTYP.mjs +0 -109
  216. package/lib/chunk-TOIVAQF7.mjs +0 -136
  217. package/lib/chunk-V5SKYJUB.mjs +0 -136
  218. package/lib/chunk-WSRETQCA.mjs +0 -59
  219. package/lib/chunk-YYLIQQKF.mjs +0 -31
  220. package/lib/ps/index.d.ts +0 -2
  221. package/lib/ps/index.js +0 -254
  222. package/lib/utils/findEnvFiles.d.ts +0 -8
  223. package/lib/utils/findEnvFiles.js +0 -121
  224. package/tmp/typedoc/readme.md +0 -320
  225. /package/lib/{binary-collections-config.d.cts → binary-collections/config.d.cts} +0 -0
@@ -8,17 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- const fs = require("fs");
11
+ const fs = require('fs');
12
12
  const fsp = fs.promises;
13
- const path = require("path");
14
- const os = require("os");
15
- const minimist = require("minimist");
13
+ const path = require('path');
14
+ const os = require('os');
15
+ const minimist = require('minimist');
16
16
  // ----------------------
17
17
  // CLI
18
18
  // ----------------------
19
19
  const argv = minimist(process.argv.slice(2), {
20
- boolean: ["force", "help"],
21
- alias: { h: "help", f: "force", c: "concurrent" },
20
+ boolean: ['force', 'help'],
21
+ alias: { h: 'help', f: 'force', c: 'concurrent' },
22
22
  default: { force: false, concurrent: 2 }
23
23
  });
24
24
  if (argv.help) {
@@ -33,9 +33,9 @@ const CONCURRENCY = Math.max(1, Number(argv.concurrent || argv.c || defaultConcu
33
33
  // ----------------------
34
34
  // CONSTANTS
35
35
  // ----------------------
36
- const customChars = "@.";
37
- const vowels = "aeiouAEIOU";
38
- const alnum = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
36
+ const customChars = '@.';
37
+ const vowels = 'aeiouAEIOU';
38
+ const alnum = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
39
39
  const combined = alnum + vowels + customChars;
40
40
  const ROOT = process.cwd();
41
41
  // ----------------------
@@ -54,19 +54,19 @@ function isSymlinkAsync(p) {
54
54
  function removeAsync(target) {
55
55
  return __awaiter(this, void 0, void 0, function* () {
56
56
  if (yield isSymlinkAsync(target)) {
57
- console.log("Skipping symlink", target);
57
+ console.log('Skipping symlink', target);
58
58
  return;
59
59
  }
60
60
  if (DRY_RUN) {
61
- console.log("Would remove", target);
61
+ console.log('Would remove', target);
62
62
  return;
63
63
  }
64
64
  try {
65
65
  yield fsp.rm(target, { recursive: true, force: true });
66
- console.log("Deleting", target);
66
+ console.log('Deleting', target);
67
67
  }
68
68
  catch (e) {
69
- console.error("Failed:", target, e.message);
69
+ console.error('Failed:', target, e.message);
70
70
  }
71
71
  });
72
72
  }
@@ -117,11 +117,11 @@ function walk(dir, callback, { skipNodeModulesChildren = false } = {}) {
117
117
  if (entry.isSymbolicLink())
118
118
  continue;
119
119
  // skip inside node_modules/*
120
- if (skipNodeModulesChildren && dir.includes("node_modules"))
120
+ if (skipNodeModulesChildren && dir.includes('node_modules'))
121
121
  continue;
122
122
  callback(fullPath, entry);
123
123
  if (entry.isDirectory()) {
124
- if (skipNodeModulesChildren && entry.name === "node_modules") {
124
+ if (skipNodeModulesChildren && entry.name === 'node_modules') {
125
125
  continue;
126
126
  }
127
127
  walk(fullPath, callback, { skipNodeModulesChildren });
@@ -133,7 +133,7 @@ function walk(dir, callback, { skipNodeModulesChildren = false } = {}) {
133
133
  // ----------------------
134
134
  function processNodeModules(dir) {
135
135
  return __awaiter(this, void 0, void 0, function* () {
136
- console.log("Found:", dir);
136
+ console.log('Found:', dir);
137
137
  let items;
138
138
  try {
139
139
  items = fs.readdirSync(dir, { withFileTypes: true });
@@ -148,7 +148,7 @@ function processNodeModules(dir) {
148
148
  const target = path.join(dir, name);
149
149
  // 🚫 skip symlinks entirely (Dirent gives this cheaply)
150
150
  if (entry.isSymbolicLink && entry.isSymbolicLink()) {
151
- console.log("Skipping symlink", target);
151
+ console.log('Skipping symlink', target);
152
152
  return;
153
153
  }
154
154
  yield removeAsync(target);
@@ -166,7 +166,7 @@ function main() {
166
166
  const nodeModulesDirs = [];
167
167
  // find node_modules
168
168
  walk(ROOT, (fullPath, entry) => {
169
- if (entry.isDirectory() && entry.name === "node_modules") {
169
+ if (entry.isDirectory() && entry.name === 'node_modules') {
170
170
  nodeModulesDirs.push(fullPath);
171
171
  }
172
172
  });
@@ -181,21 +181,21 @@ function main() {
181
181
  const yarnCaches = [];
182
182
  walk(ROOT, (fullPath, entry) => {
183
183
  const base = path.basename(fullPath);
184
- if (base === "package-lock.json")
184
+ if (base === 'package-lock.json')
185
185
  packageLocks.push(fullPath);
186
- if (base === "yarn.lock")
186
+ if (base === 'yarn.lock')
187
187
  yarnLocks.push(fullPath);
188
- if (entry.isDirectory() && fullPath.endsWith(path.join(".yarn", "cache")))
188
+ if (entry.isDirectory() && fullPath.endsWith(path.join('.yarn', 'cache')))
189
189
  yarnCaches.push(fullPath);
190
190
  }, { skipNodeModulesChildren: true });
191
191
  if (DRY_RUN) {
192
- console.log("Would remove package-lock.json files:");
192
+ console.log('Would remove package-lock.json files:');
193
193
  for (const p of packageLocks)
194
194
  console.log(p);
195
- console.log("Would remove yarn.lock files:");
195
+ console.log('Would remove yarn.lock files:');
196
196
  for (const p of yarnLocks)
197
197
  console.log(p);
198
- console.log("Would remove .yarn/cache directories:");
198
+ console.log('Would remove .yarn/cache directories:');
199
199
  for (const p of yarnCaches)
200
200
  console.log(p);
201
201
  }
package/lib/del-ps.cjs CHANGED
@@ -118,7 +118,7 @@ var require_utils = __commonJS({
118
118
  try {
119
119
  fs.rmdirSync(fullPath);
120
120
  console.log("deleted", fullPath);
121
- } catch (e) {
121
+ } catch (_e) {
122
122
  try {
123
123
  fs.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
124
124
  console.log("deleted", fullPath);
@@ -131,7 +131,7 @@ var require_utils = __commonJS({
131
131
  try {
132
132
  fs.unlinkSync(fullPath);
133
133
  console.log("deleted", fullPath);
134
- } catch (e) {
134
+ } catch (_e) {
135
135
  try {
136
136
  fs.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
137
137
  console.log("deleted", fullPath);
package/lib/del-ps.js CHANGED
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
- const crossSpawn = require("cross-spawn");
3
- const ps = require("ps-node");
4
- const isWin = require("./ps/isWin.js").default;
5
- const { getArgs } = require("./utils/index.cjs");
2
+ const crossSpawn = require('cross-spawn');
3
+ const ps = require('ps-node');
4
+ const isWin = require('./ps/isWin.js').default;
5
+ const { getArgs } = require('./utils/index.cjs');
6
6
  getArgs()._.forEach((command) => {
7
7
  ps.lookup({
8
8
  command,
9
- psargs: "ux"
9
+ psargs: 'ux'
10
10
  }, function (err, resultList) {
11
11
  if (err) {
12
12
  throw new Error(err);
@@ -15,15 +15,15 @@ getArgs()._.forEach((command) => {
15
15
  if (process) {
16
16
  // console.log('PID: %s, COMMAND: %s, ARGUMENTS: %s', process.pid, process.command, process.arguments);
17
17
  if (!isWin) {
18
- crossSpawn.spawnAsync("kill", ["-9", process.pid]).catch((e) => console.log(`kill failed ${e.message}`));
18
+ crossSpawn.spawnAsync('kill', ['-9', process.pid]).catch((e) => console.log(`kill failed ${e.message}`));
19
19
  crossSpawn
20
- .spawnAsync("killall", ["-9", process.pid])
20
+ .spawnAsync('killall', ['-9', process.pid])
21
21
  .catch((e) => console.log(`killall failed ${e.message}`));
22
22
  }
23
23
  else {
24
24
  // wmic process where "name like 'java.exe'" delete
25
25
  crossSpawn
26
- .spawnAsync("wmic", ["process", "where", `"name like '${command}'" delete`])
26
+ .spawnAsync('wmic', ['process', 'where', `"name like '${command}'" delete`])
27
27
  .catch((e) => console.log(`wmic failed ${e.message}`));
28
28
  }
29
29
  }
package/lib/del-ps.mjs CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-6S4NXESK.mjs";
6
6
  import {
7
7
  require_utils
8
- } from "./chunk-Z6JLYU2J.mjs";
8
+ } from "./chunk-5RTXZVCW.mjs";
9
9
  import {
10
10
  __require,
11
11
  __toCommonJS,
@@ -109,7 +109,7 @@ var require_utils = __commonJS({
109
109
  try {
110
110
  fs.rmdirSync(fullPath);
111
111
  console.log("deleted", fullPath);
112
- } catch (e) {
112
+ } catch (_e) {
113
113
  try {
114
114
  fs.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
115
115
  console.log("deleted", fullPath);
@@ -122,7 +122,7 @@ var require_utils = __commonJS({
122
122
  try {
123
123
  fs.unlinkSync(fullPath);
124
124
  console.log("deleted", fullPath);
125
- } catch (e) {
125
+ } catch (_e) {
126
126
  try {
127
127
  fs.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
128
128
  console.log("deleted", fullPath);
@@ -35,9 +35,9 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  const glob = __importStar(require("glob"));
37
37
  const index_cjs_1 = require("./utils/index.cjs");
38
- const g3 = new glob.Glob(["**/.yarn/cache*", "**/.yarn/*.gz"], {
38
+ const g3 = new glob.Glob(['**/.yarn/cache*', '**/.yarn/*.gz'], {
39
39
  withFileTypes: false,
40
40
  cwd: process.cwd(),
41
- ignore: ["**/.git*", "**/vendor/**"]
41
+ ignore: ['**/.git*', '**/vendor/**']
42
42
  });
43
43
  (0, index_cjs_1.delStream)(g3);
@@ -1,7 +1,7 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
2
  import {
3
3
  require_utils
4
- } from "./chunk-Z6JLYU2J.mjs";
4
+ } from "./chunk-5RTXZVCW.mjs";
5
5
  import {
6
6
  __toESM,
7
7
  init_esm_shims
@@ -0,0 +1,92 @@
1
+ #!/usr/bin/env node
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+
25
+ // src/file/copy-cli.mjs
26
+ var import_minimist = __toESM(require("minimist"), 1);
27
+
28
+ // src/file/copy.mjs
29
+ var import_fs_extra = __toESM(require("fs-extra"), 1);
30
+ var import_upath = __toESM(require("upath"), 1);
31
+ async function copy(src, dest) {
32
+ if (!await import_fs_extra.default.pathExists(src)) {
33
+ throw new Error(`Source file does not exist: ${src}`);
34
+ }
35
+ const srcStat = await import_fs_extra.default.stat(src);
36
+ let finalDest = dest;
37
+ if (srcStat.isFile()) {
38
+ const destExists = await import_fs_extra.default.pathExists(dest);
39
+ const destStat = destExists ? await import_fs_extra.default.stat(dest) : null;
40
+ if (destStat && destStat.isDirectory()) {
41
+ finalDest = import_upath.default.join(dest, import_upath.default.basename(src));
42
+ }
43
+ }
44
+ await import_fs_extra.default.ensureDir(import_upath.default.dirname(finalDest));
45
+ await import_fs_extra.default.copy(src, finalDest, { overwrite: true });
46
+ }
47
+
48
+ // src/file/copy-cli.mjs
49
+ function showHelp(exitCode = 0) {
50
+ console.log(
51
+ `
52
+ Usage:
53
+ copy <src> <dest>
54
+
55
+ Options:
56
+ -h, --help Show this help message
57
+
58
+ Examples:
59
+ copy file.txt backup/file.txt
60
+ copy ./src ./dist
61
+ `.trim()
62
+ );
63
+ process.exit(exitCode);
64
+ }
65
+ async function main() {
66
+ const args = (0, import_minimist.default)(process.argv.slice(2), {
67
+ boolean: ["help", "h"],
68
+ alias: {
69
+ h: "help"
70
+ }
71
+ });
72
+ if (args.help) {
73
+ showHelp(0);
74
+ }
75
+ const [src, dest] = args._;
76
+ if (!src || !dest) {
77
+ console.error("Error: missing required arguments.\n");
78
+ showHelp(1);
79
+ }
80
+ try {
81
+ await copy(src, dest);
82
+ console.log(`Copied ${src} to ${dest}`);
83
+ } catch (err) {
84
+ console.error(`Error copying file: ${err instanceof Error ? err.message : String(err)}`);
85
+ process.exit(1);
86
+ }
87
+ }
88
+ function handleError(err) {
89
+ console.error(`Unexpected error: ${err instanceof Error ? err.message : String(err)}`);
90
+ process.exit(1);
91
+ }
92
+ main().catch(handleError);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,55 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import {
3
+ copy
4
+ } from "../chunk-OGXVGBRI.mjs";
5
+ import {
6
+ init_esm_shims
7
+ } from "../chunk-QQ4A6DLD.mjs";
8
+
9
+ // src/file/copy-cli.mjs
10
+ init_esm_shims();
11
+ import minimist from "minimist";
12
+ function showHelp(exitCode = 0) {
13
+ console.log(
14
+ `
15
+ Usage:
16
+ copy <src> <dest>
17
+
18
+ Options:
19
+ -h, --help Show this help message
20
+
21
+ Examples:
22
+ copy file.txt backup/file.txt
23
+ copy ./src ./dist
24
+ `.trim()
25
+ );
26
+ process.exit(exitCode);
27
+ }
28
+ async function main() {
29
+ const args = minimist(process.argv.slice(2), {
30
+ boolean: ["help", "h"],
31
+ alias: {
32
+ h: "help"
33
+ }
34
+ });
35
+ if (args.help) {
36
+ showHelp(0);
37
+ }
38
+ const [src, dest] = args._;
39
+ if (!src || !dest) {
40
+ console.error("Error: missing required arguments.\n");
41
+ showHelp(1);
42
+ }
43
+ try {
44
+ await copy(src, dest);
45
+ console.log(`Copied ${src} to ${dest}`);
46
+ } catch (err) {
47
+ console.error(`Error copying file: ${err instanceof Error ? err.message : String(err)}`);
48
+ process.exit(1);
49
+ }
50
+ }
51
+ function handleError(err) {
52
+ console.error(`Unexpected error: ${err instanceof Error ? err.message : String(err)}`);
53
+ process.exit(1);
54
+ }
55
+ main().catch(handleError);
@@ -0,0 +1,56 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/file/copy.mjs
30
+ var copy_exports = {};
31
+ __export(copy_exports, {
32
+ copy: () => copy
33
+ });
34
+ module.exports = __toCommonJS(copy_exports);
35
+ var import_fs_extra = __toESM(require("fs-extra"), 1);
36
+ var import_upath = __toESM(require("upath"), 1);
37
+ async function copy(src, dest) {
38
+ if (!await import_fs_extra.default.pathExists(src)) {
39
+ throw new Error(`Source file does not exist: ${src}`);
40
+ }
41
+ const srcStat = await import_fs_extra.default.stat(src);
42
+ let finalDest = dest;
43
+ if (srcStat.isFile()) {
44
+ const destExists = await import_fs_extra.default.pathExists(dest);
45
+ const destStat = destExists ? await import_fs_extra.default.stat(dest) : null;
46
+ if (destStat && destStat.isDirectory()) {
47
+ finalDest = import_upath.default.join(dest, import_upath.default.basename(src));
48
+ }
49
+ }
50
+ await import_fs_extra.default.ensureDir(import_upath.default.dirname(finalDest));
51
+ await import_fs_extra.default.copy(src, finalDest, { overwrite: true });
52
+ }
53
+ // Annotate the CommonJS export names for ESM import in node:
54
+ 0 && (module.exports = {
55
+ copy
56
+ });
@@ -0,0 +1 @@
1
+ export function copy(src: any, dest: any): Promise<void>;
@@ -0,0 +1,8 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import {
3
+ copy
4
+ } from "../chunk-OGXVGBRI.mjs";
5
+ import "../chunk-QQ4A6DLD.mjs";
6
+ export {
7
+ copy
8
+ };
@@ -0,0 +1,91 @@
1
+ #!/usr/bin/env node
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+
25
+ // src/file/move-cli.mjs
26
+ var import_minimist = __toESM(require("minimist"), 1);
27
+
28
+ // src/file/move.mjs
29
+ var import_fs_extra = __toESM(require("fs-extra"), 1);
30
+ var import_upath = __toESM(require("upath"), 1);
31
+ async function move(src, dest) {
32
+ if (!await import_fs_extra.default.pathExists(src)) {
33
+ throw new Error(`Source file does not exist: ${src}`);
34
+ }
35
+ const srcStat = await import_fs_extra.default.stat(src);
36
+ let finalDest = dest;
37
+ if (srcStat.isFile()) {
38
+ const destStat = await import_fs_extra.default.pathExists(dest) ? await import_fs_extra.default.stat(dest) : null;
39
+ if (destStat && destStat.isDirectory()) {
40
+ finalDest = import_upath.default.join(dest, import_upath.default.basename(src));
41
+ }
42
+ }
43
+ await import_fs_extra.default.ensureDir(import_upath.default.dirname(finalDest));
44
+ await import_fs_extra.default.move(src, finalDest, { overwrite: true });
45
+ }
46
+
47
+ // src/file/move-cli.mjs
48
+ function showHelp(exitCode = 0) {
49
+ console.log(
50
+ `
51
+ Usage:
52
+ move <src> <dest>
53
+
54
+ Options:
55
+ -h, --help Show this help message
56
+
57
+ Examples:
58
+ move file.txt backup/file.txt
59
+ move ./src ./dist
60
+ `.trim()
61
+ );
62
+ process.exit(exitCode);
63
+ }
64
+ async function main() {
65
+ const args = (0, import_minimist.default)(process.argv.slice(2), {
66
+ boolean: ["help", "h"],
67
+ alias: {
68
+ h: "help"
69
+ }
70
+ });
71
+ if (args.help) {
72
+ showHelp(0);
73
+ }
74
+ const [src, dest] = args._;
75
+ if (!src || !dest) {
76
+ console.error("Error: missing required arguments.\n");
77
+ showHelp(1);
78
+ }
79
+ try {
80
+ await move(src, dest);
81
+ console.log(`Moved ${src} to ${dest}`);
82
+ } catch (err) {
83
+ console.error(`Error moving file: ${err instanceof Error ? err.message : String(err)}`);
84
+ process.exit(1);
85
+ }
86
+ }
87
+ function handleError(err) {
88
+ console.error(`Unexpected error: ${err instanceof Error ? err.message : String(err)}`);
89
+ process.exit(1);
90
+ }
91
+ main().catch(handleError);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,55 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import {
3
+ move
4
+ } from "../chunk-NGFK3EYW.mjs";
5
+ import {
6
+ init_esm_shims
7
+ } from "../chunk-QQ4A6DLD.mjs";
8
+
9
+ // src/file/move-cli.mjs
10
+ init_esm_shims();
11
+ import minimist from "minimist";
12
+ function showHelp(exitCode = 0) {
13
+ console.log(
14
+ `
15
+ Usage:
16
+ move <src> <dest>
17
+
18
+ Options:
19
+ -h, --help Show this help message
20
+
21
+ Examples:
22
+ move file.txt backup/file.txt
23
+ move ./src ./dist
24
+ `.trim()
25
+ );
26
+ process.exit(exitCode);
27
+ }
28
+ async function main() {
29
+ const args = minimist(process.argv.slice(2), {
30
+ boolean: ["help", "h"],
31
+ alias: {
32
+ h: "help"
33
+ }
34
+ });
35
+ if (args.help) {
36
+ showHelp(0);
37
+ }
38
+ const [src, dest] = args._;
39
+ if (!src || !dest) {
40
+ console.error("Error: missing required arguments.\n");
41
+ showHelp(1);
42
+ }
43
+ try {
44
+ await move(src, dest);
45
+ console.log(`Moved ${src} to ${dest}`);
46
+ } catch (err) {
47
+ console.error(`Error moving file: ${err instanceof Error ? err.message : String(err)}`);
48
+ process.exit(1);
49
+ }
50
+ }
51
+ function handleError(err) {
52
+ console.error(`Unexpected error: ${err instanceof Error ? err.message : String(err)}`);
53
+ process.exit(1);
54
+ }
55
+ main().catch(handleError);
@@ -0,0 +1,55 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/file/move.mjs
30
+ var move_exports = {};
31
+ __export(move_exports, {
32
+ move: () => move
33
+ });
34
+ module.exports = __toCommonJS(move_exports);
35
+ var import_fs_extra = __toESM(require("fs-extra"), 1);
36
+ var import_upath = __toESM(require("upath"), 1);
37
+ async function move(src, dest) {
38
+ if (!await import_fs_extra.default.pathExists(src)) {
39
+ throw new Error(`Source file does not exist: ${src}`);
40
+ }
41
+ const srcStat = await import_fs_extra.default.stat(src);
42
+ let finalDest = dest;
43
+ if (srcStat.isFile()) {
44
+ const destStat = await import_fs_extra.default.pathExists(dest) ? await import_fs_extra.default.stat(dest) : null;
45
+ if (destStat && destStat.isDirectory()) {
46
+ finalDest = import_upath.default.join(dest, import_upath.default.basename(src));
47
+ }
48
+ }
49
+ await import_fs_extra.default.ensureDir(import_upath.default.dirname(finalDest));
50
+ await import_fs_extra.default.move(src, finalDest, { overwrite: true });
51
+ }
52
+ // Annotate the CommonJS export names for ESM import in node:
53
+ 0 && (module.exports = {
54
+ move
55
+ });
@@ -0,0 +1 @@
1
+ export function move(src: any, dest: any): Promise<void>;