binary-collections 2.0.11 → 2.0.13

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 (330) hide show
  1. package/binaries/binary-executor.cjs +89 -13
  2. package/binaries/clean-nodemodule.cjs +89 -13
  3. package/binaries/clean-nodemodules.cjs +89 -13
  4. package/binaries/dev.cjs +89 -13
  5. package/binaries/empty.cjs +89 -13
  6. package/binaries/git-reduce-size.cjs +89 -13
  7. package/binaries/javakill.cjs +89 -13
  8. package/binaries/kill-process.cjs +89 -13
  9. package/binaries/nodekill.cjs +89 -13
  10. package/binaries/prod.cjs +89 -13
  11. package/binaries/py.cjs +89 -13
  12. package/binaries/rmfind.cjs +89 -13
  13. package/binaries/rmx +15 -1
  14. package/binaries/rmx.cjs +89 -13
  15. package/binaries/rmx.cmd +12 -0
  16. package/binaries/submodule-token.cjs +89 -13
  17. package/binaries/test-cjs +9 -1
  18. package/binaries/test-cjs.cjs +89 -13
  19. package/binaries/test-cjs.cmd +16 -1
  20. package/binaries/test-esm +16 -0
  21. package/binaries/test-esm.cjs +254 -0
  22. package/binaries/test-esm.cmd +23 -0
  23. package/binaries/yarn-clean +1 -1
  24. package/binaries/yarn-clean.cjs +89 -13
  25. package/binaries/yarn-clean.cmd +1 -1
  26. package/binaries/yarn-clean.py +33 -15
  27. package/binaries/yc +131 -0
  28. package/binaries/yc.cjs +254 -0
  29. package/binaries/ycw +256 -0
  30. package/binaries/ycw.cjs +254 -0
  31. package/docs-src/binary-collections.md +34 -0
  32. package/docs-src/changelog.md +26 -0
  33. package/docs-src/clean-github-actions-caches.md +91 -2
  34. package/docs-src/copy-move-file.md +59 -0
  35. package/docs-src/del-gradle.md +17 -0
  36. package/docs-src/del-ps.md +28 -0
  37. package/docs-src/downloader.md +62 -0
  38. package/docs-src/env-helpers.md +29 -0
  39. package/docs-src/find-node-modules.md +17 -0
  40. package/docs-src/git-diff.md +33 -0
  41. package/docs-src/git-fix.md +34 -0
  42. package/docs-src/git-purge.md +17 -0
  43. package/docs-src/git-reduce-size.md +17 -0
  44. package/docs-src/git-undo.md +21 -0
  45. package/docs-src/kill-night-crows.md +26 -0
  46. package/docs-src/node-cache-cleaner.md +182 -0
  47. package/docs-src/node-executor.md +50 -0
  48. package/docs-src/node-package-packer.md +48 -0
  49. package/docs-src/npm-run-series.md +43 -0
  50. package/docs-src/package-resolutions-updater.md +22 -0
  51. package/docs-src/php-cs-fixer-staged.md +19 -0
  52. package/docs-src/print-directory-tree.md +35 -0
  53. package/docs-src/print-tarball-tree.md +55 -0
  54. package/docs-src/py.md +19 -0
  55. package/docs-src/remove-module.md +32 -0
  56. package/docs-src/rmfind-rmx.md +21 -0
  57. package/docs-src/rmpath.md +38 -0
  58. package/docs-src/run-by-checksum.md +87 -0
  59. package/docs-src/submodule-install.md +31 -0
  60. package/docs-src/submodule-remove.md +22 -0
  61. package/docs-src/submodule-token.md +17 -0
  62. package/docs-src/test-runners.md +21 -0
  63. package/docs-src/yarn-install.md +31 -0
  64. package/docs-src/yarn-reinstall.md +27 -0
  65. package/lib/binary-collections/config.cjs +126 -0
  66. package/lib/binary-collections/config.mjs +7 -0
  67. package/lib/binary-collections/executeScript.cjs +19 -0
  68. package/lib/binary-collections/executeScript.d.cts +12 -0
  69. package/lib/binary-collections/executeScript.mjs +6 -0
  70. package/lib/binary-collections/findScript.cjs +309 -0
  71. package/lib/binary-collections/findScript.d.cts +12 -0
  72. package/lib/binary-collections/findScript.mjs +7 -0
  73. package/lib/binary-collections/listScript.cjs +291 -0
  74. package/lib/binary-collections/listScript.d.cts +19 -0
  75. package/lib/binary-collections/listScript.mjs +7 -0
  76. package/lib/binary-collections.cjs +264 -157
  77. package/lib/binary-collections.mjs +26 -286
  78. package/lib/changelog.cjs +9 -14
  79. package/lib/changelog.mjs +2 -2
  80. package/lib/chunk-2MN4VPV2.mjs +246 -0
  81. package/lib/chunk-6C7KTYGZ.mjs +41 -0
  82. package/lib/{chunk-Z6JLYU2J.mjs → chunk-6RK5UCTP.mjs} +7 -12
  83. package/lib/chunk-CD3HF3LK.mjs +190 -0
  84. package/lib/chunk-FLYSZFLW.mjs +61 -0
  85. package/lib/{chunk-N436BNBK.mjs → chunk-GAGABICI.mjs} +19 -13
  86. package/lib/chunk-H44UWUFY.mjs +105 -0
  87. package/lib/chunk-KLKAIFKI.mjs +40 -0
  88. package/lib/chunk-LVSPEFU2.mjs +86 -0
  89. package/lib/{chunk-RWLXRTYP.mjs → chunk-MGPYPKIE.mjs} +2 -2
  90. package/lib/chunk-NGFK3EYW.mjs +28 -0
  91. package/lib/chunk-NQXUYO67.mjs +253 -0
  92. package/lib/chunk-NVEG3LEZ.mjs +143 -0
  93. package/lib/chunk-OBXLTXFJ.mjs +34 -0
  94. package/lib/chunk-OGXVGBRI.mjs +29 -0
  95. package/lib/chunk-OXV52GD5.mjs +62 -0
  96. package/lib/chunk-PXBMHE7O.mjs +35 -0
  97. package/lib/chunk-QD4T255Z.mjs +40 -0
  98. package/lib/chunk-QII2EKCS.mjs +26 -0
  99. package/lib/chunk-R5FJOR63.mjs +47 -0
  100. package/lib/chunk-RDGDLSPD.mjs +76 -0
  101. package/lib/chunk-RDN6HF5Z.mjs +79 -0
  102. package/lib/chunk-RJKTSUAX.mjs +123 -0
  103. package/lib/{chunk-XA3SNBPA.mjs → chunk-TBWXE7ST.mjs} +97 -38
  104. package/lib/chunk-UXCFNAR6.mjs +55 -0
  105. package/lib/{chunk-M3YIYRHT.mjs → chunk-UY5VUEA3.mjs} +1 -1
  106. package/lib/chunk-WSHVPGNM.mjs +44 -0
  107. package/lib/{chunk-66PAU5PS.mjs → chunk-X2B3X7D4.mjs} +10 -6
  108. package/lib/clean-github-actions-caches-cli.cjs +507 -0
  109. package/lib/clean-github-actions-caches-cli.mjs +74 -0
  110. package/lib/clean-github-actions-caches.cjs +246 -106
  111. package/lib/clean-github-actions-caches.d.cts +53 -1
  112. package/lib/clean-github-actions-caches.mjs +5 -130
  113. package/lib/cross-env/command.cjs +63 -0
  114. package/lib/cross-env/command.d.ts +8 -0
  115. package/lib/cross-env/command.js +45 -0
  116. package/lib/{ps/isWin.mjs → cross-env/command.mjs} +4 -5
  117. package/lib/cross-env/index.cjs +178 -0
  118. package/lib/cross-env/index.d.ts +8 -0
  119. package/lib/cross-env/index.js +102 -0
  120. package/lib/cross-env/index.mjs +101 -0
  121. package/lib/cross-env/variable.cjs +60 -0
  122. package/lib/cross-env/variable.d.ts +7 -0
  123. package/lib/cross-env/variable.js +59 -0
  124. package/lib/cross-env/variable.mjs +9 -0
  125. package/lib/del-gradle.cjs +8 -13
  126. package/lib/del-gradle.js +8 -8
  127. package/lib/del-gradle.mjs +1 -1
  128. package/lib/del-node-modules.cjs +185 -3
  129. package/lib/del-node-modules.js +25 -25
  130. package/lib/del-node-modules.mjs +6 -3
  131. package/lib/{del-ps.cjs → del-ps-cli.cjs} +38 -43
  132. package/lib/del-ps-cli.d.mts +1 -0
  133. package/lib/del-ps-cli.mjs +44 -0
  134. package/lib/del-yarn-caches.cjs +8 -13
  135. package/lib/del-yarn-caches.js +2 -2
  136. package/lib/del-yarn-caches.mjs +1 -1
  137. package/lib/downloader-cli.cjs +256 -0
  138. package/lib/downloader-cli.d.cts +2 -0
  139. package/lib/downloader-cli.mjs +90 -0
  140. package/lib/file/copy-cli.cjs +273 -0
  141. package/lib/file/copy-cli.d.mts +1 -0
  142. package/lib/file/copy-cli.mjs +59 -0
  143. package/lib/file/copy.cjs +56 -0
  144. package/lib/file/copy.d.mts +1 -0
  145. package/lib/file/copy.mjs +8 -0
  146. package/lib/file/move-cli.cjs +272 -0
  147. package/lib/file/move-cli.d.mts +1 -0
  148. package/lib/file/move-cli.mjs +59 -0
  149. package/lib/file/move.cjs +55 -0
  150. package/lib/file/move.d.mts +1 -0
  151. package/lib/file/move.mjs +8 -0
  152. package/lib/find-node-modules-cli.cjs +1 -1
  153. package/lib/find-node-modules-cli.js +1 -1
  154. package/lib/find-node-modules-cli.mjs +1 -1
  155. package/lib/find-node-modules.cjs +1 -1
  156. package/lib/find-node-modules.mjs +1 -1
  157. package/lib/free-chatgpt.cjs +27 -26
  158. package/lib/free-chatgpt.js +10 -10
  159. package/lib/free-chatgpt.mjs +2 -2
  160. package/lib/git/user-config.cjs +9 -14
  161. package/lib/git/user-config.mjs +2 -2
  162. package/lib/git-diff-cli.cjs +273 -66
  163. package/lib/git-diff-cli.mjs +5 -4
  164. package/lib/git-diff.cjs +273 -66
  165. package/lib/git-diff.d.ts +2 -1
  166. package/lib/git-diff.js +153 -39
  167. package/lib/git-diff.mjs +5 -4
  168. package/lib/git-fix.cjs +9 -14
  169. package/lib/git-fix.mjs +2 -2
  170. package/lib/git-purge.cjs +9 -14
  171. package/lib/git-purge.mjs +2 -2
  172. package/lib/index.cjs +1 -1
  173. package/lib/index.d.ts +1 -1
  174. package/lib/index.mjs +1 -1
  175. package/lib/kill-night-crows.cjs +7 -7
  176. package/lib/kill-night-crows.mjs +7 -7
  177. package/lib/node-cache-cleaner/npm.cjs +65 -0
  178. package/lib/node-cache-cleaner/npm.d.ts +2 -0
  179. package/lib/node-cache-cleaner/npm.js +41 -0
  180. package/lib/node-cache-cleaner/npm.mjs +10 -0
  181. package/lib/node-cache-cleaner/npx.cjs +89 -0
  182. package/lib/node-cache-cleaner/npx.d.ts +4 -0
  183. package/lib/node-cache-cleaner/npx.js +82 -0
  184. package/lib/{ps/index.d.mjs → node-cache-cleaner/npx.mjs} +6 -5
  185. package/lib/node-cache-cleaner/yarn.cjs +73 -0
  186. package/lib/node-cache-cleaner/yarn.d.ts +2 -0
  187. package/lib/node-cache-cleaner/yarn.js +62 -0
  188. package/lib/node-cache-cleaner/yarn.mjs +10 -0
  189. package/lib/node-cache-cleaner-cli.cjs +365 -0
  190. package/lib/node-cache-cleaner-cli.d.ts +2 -0
  191. package/lib/node-cache-cleaner-cli.js +57 -0
  192. package/lib/node-cache-cleaner-cli.mjs +60 -0
  193. package/lib/node-executor.cjs +272 -0
  194. package/lib/node-executor.d.cts +2 -0
  195. package/lib/node-executor.mjs +106 -0
  196. package/lib/node-package-packer/build-readme.cjs +150 -0
  197. package/lib/node-package-packer/build-readme.d.mts +10 -0
  198. package/lib/node-package-packer/build-readme.mjs +10 -0
  199. package/lib/node-package-packer/build-tarball.cjs +495 -0
  200. package/lib/node-package-packer/build-tarball.d.mts +33 -0
  201. package/lib/node-package-packer/build-tarball.mjs +175 -0
  202. package/lib/node-package-packer-cli.cjs +525 -0
  203. package/lib/node-package-packer-cli.d.mts +1 -0
  204. package/lib/node-package-packer-cli.mjs +34 -0
  205. package/lib/npm-run-series.cjs +28 -40
  206. package/lib/npm-run-series.mjs +21 -7
  207. package/lib/package-resolutions-updater-cli.cjs +255 -173
  208. package/lib/package-resolutions-updater-cli.mjs +19 -40
  209. package/lib/package-resolutions-updater.cjs +244 -141
  210. package/lib/package-resolutions-updater.d.mts +54 -1
  211. package/lib/package-resolutions-updater.mjs +8 -5
  212. package/lib/php-cs-fixer-staged.cjs +1 -1
  213. package/lib/php-cs-fixer-staged.mjs +1 -1
  214. package/lib/print-directory-tree.cjs +18 -20
  215. package/lib/print-directory-tree.mjs +11 -8
  216. package/lib/print-tarball-tree.cjs +262 -0
  217. package/lib/print-tarball-tree.d.mts +1 -0
  218. package/lib/print-tarball-tree.mjs +68 -0
  219. package/lib/ps/connected-domain.js +10 -10
  220. package/lib/ps/index.cjs +11 -11
  221. package/lib/ps/index.mjs +180 -174
  222. package/lib/ps/table-parser.d.ts +3 -4
  223. package/lib/ps/table-parser.js +15 -22
  224. package/lib/remove-module.cjs +19 -24
  225. package/lib/remove-module.mjs +2 -2
  226. package/lib/rm-node-module-cli.cjs +389 -0
  227. package/lib/rm-node-module-cli.d.cts +1 -0
  228. package/lib/rm-node-module-cli.mjs +92 -0
  229. package/lib/rm-node-modules.cjs +127 -0
  230. package/lib/rm-node-modules.d.cts +35 -0
  231. package/lib/{binary-collections-config.mjs → rm-node-modules.mjs} +3 -3
  232. package/lib/rmpath-cli.cjs +285 -0
  233. package/lib/rmpath-cli.d.mts +1 -0
  234. package/lib/rmpath-cli.mjs +23 -0
  235. package/lib/rmpath.cjs +6 -217
  236. package/lib/rmpath.mjs +5 -101
  237. package/lib/run-by-checksum/cache.cjs +69 -0
  238. package/lib/run-by-checksum/cache.d.ts +19 -0
  239. package/lib/run-by-checksum/cache.js +50 -0
  240. package/lib/run-by-checksum/cache.mjs +12 -0
  241. package/lib/run-by-checksum/hash.cjs +72 -0
  242. package/lib/run-by-checksum/hash.d.ts +14 -0
  243. package/lib/run-by-checksum/hash.js +85 -0
  244. package/lib/run-by-checksum/hash.mjs +10 -0
  245. package/lib/run-by-checksum/run.cjs +169 -0
  246. package/lib/run-by-checksum/run.d.ts +22 -0
  247. package/lib/run-by-checksum/run.js +93 -0
  248. package/lib/run-by-checksum/run.mjs +10 -0
  249. package/lib/run-by-checksum-cli.cjs +382 -0
  250. package/lib/run-by-checksum-cli.d.ts +2 -0
  251. package/lib/run-by-checksum-cli.js +43 -0
  252. package/lib/run-by-checksum-cli.mjs +56 -0
  253. package/lib/submodule-install.cjs +55 -47
  254. package/lib/submodule-install.mjs +48 -35
  255. package/lib/submodule-remove-cli.cjs +170 -4
  256. package/lib/submodule-remove-cli.js +5 -5
  257. package/lib/submodule-remove-cli.mjs +6 -4
  258. package/lib/utils/chatgpt.cjs +19 -13
  259. package/lib/utils/chatgpt.js +94 -94
  260. package/lib/utils/chatgpt.mjs +1 -1
  261. package/lib/utils/fetchResponse.cjs +24 -0
  262. package/lib/utils/fetchResponse.d.cts +25 -0
  263. package/lib/utils/fetchResponse.mjs +6 -0
  264. package/lib/utils/findEnvFiles.cjs +28 -46
  265. package/lib/utils/findEnvFiles.d.cts +19 -0
  266. package/lib/utils/findEnvFiles.mjs +3 -5
  267. package/lib/utils/findWorkspaceRoot.js +4 -4
  268. package/lib/utils/index.cjs +7 -12
  269. package/lib/utils/index.d.cts +2 -9
  270. package/lib/utils/index.mjs +1 -1
  271. package/lib/utils/isGithubTokenValid.js +7 -7
  272. package/lib/{ps/isWin.cjs → utils/isWindows.cjs} +12 -7
  273. package/lib/utils/isWindows.d.ts +5 -0
  274. package/lib/utils/isWindows.js +10 -0
  275. package/lib/utils/isWindows.mjs +10 -0
  276. package/lib/utils/runBash.cjs +53 -0
  277. package/lib/utils/runBash.d.cts +12 -0
  278. package/lib/utils/runBash.mjs +66 -0
  279. package/lib/yarn-per-branch-lock-installer.cjs +288 -0
  280. package/lib/yarn-per-branch-lock-installer.d.cts +2 -0
  281. package/lib/yarn-per-branch-lock-installer.mjs +122 -0
  282. package/lib/yarn-reinstall.cjs +8 -13
  283. package/lib/yarn-reinstall.mjs +1 -1
  284. package/package.json +91 -57
  285. package/readme.html +784 -0
  286. package/readme.md +107 -219
  287. package/releases/readme.md +6 -3
  288. package/test/README.md +2 -2
  289. package/test-project/workspaces/workspace-a/readme.md +20 -0
  290. package/test-project/workspaces/workspace-a/release/readme.md +42 -0
  291. package/test-project/workspaces/workspace-a/test/readme.md +12 -0
  292. package/test-project/workspaces/workspace-b/readme.md +94 -0
  293. package/test-project/workspaces/workspace-b/requirements.txt +1 -0
  294. package/test-project/workspaces/workspace-b/themes/hexo-theme-flowbite/readme.md +156 -0
  295. package/tmp/test-repo/README.md +2 -35
  296. package/tmp/test-repo-runChecksum/test-complex-glob/README.md +1 -0
  297. package/tmp/test-repo-runChecksum/test-mixed-args/README.md +1 -0
  298. package/lib/binary-collections-config.cjs +0 -15
  299. package/lib/chunk-2CBJCW7E.mjs +0 -81
  300. package/lib/chunk-4UHL4WVN.mjs +0 -136
  301. package/lib/chunk-6HHJRKFB.mjs +0 -59
  302. package/lib/chunk-6S4NXESK.mjs +0 -26
  303. package/lib/chunk-7XTEJHOE.mjs +0 -193
  304. package/lib/chunk-AJDD5DZM.mjs +0 -109
  305. package/lib/chunk-FCDQGYBF.mjs +0 -136
  306. package/lib/chunk-GEYA2USY.mjs +0 -207
  307. package/lib/chunk-GJTGHXRA.mjs +0 -356
  308. package/lib/chunk-ID2WBTE2.mjs +0 -80
  309. package/lib/chunk-JXFOHKDM.mjs +0 -239
  310. package/lib/chunk-NCXAP7AA.mjs +0 -31
  311. package/lib/chunk-PDSXF5HY.mjs +0 -187
  312. package/lib/chunk-TOIVAQF7.mjs +0 -136
  313. package/lib/chunk-V5SKYJUB.mjs +0 -136
  314. package/lib/chunk-WSRETQCA.mjs +0 -59
  315. package/lib/chunk-YYLIQQKF.mjs +0 -31
  316. package/lib/del-ps.js +0 -32
  317. package/lib/del-ps.mjs +0 -43
  318. package/lib/ps/index.d.cjs +0 -17
  319. package/lib/ps/index.d.ts +0 -2
  320. package/lib/ps/index.js +0 -254
  321. package/lib/ps/isWin.d.ts +0 -2
  322. package/lib/ps/isWin.js +0 -4
  323. package/lib/utils/findEnvFiles.d.ts +0 -8
  324. package/lib/utils/findEnvFiles.js +0 -121
  325. package/test/package.json +0 -20
  326. package/test-project/package.json +0 -16
  327. package/tmp/test-repo/package.json +0 -7
  328. package/tmp/typedoc/readme.md +0 -320
  329. /package/lib/{binary-collections-config.d.cts → binary-collections/config.d.cts} +0 -0
  330. /package/lib/{del-ps.d.ts → clean-github-actions-caches-cli.d.cts} +0 -0
package/lib/ps/index.mjs CHANGED
@@ -5,194 +5,200 @@ import {
5
5
  } from "../chunk-XVBFFVCJ.mjs";
6
6
  import "../chunk-FKI7IEB5.mjs";
7
7
  import {
8
- init_isWin,
9
- isWin_exports
10
- } from "../chunk-6S4NXESK.mjs";
8
+ init_isWindows,
9
+ isWindows_exports
10
+ } from "../chunk-QII2EKCS.mjs";
11
11
  import {
12
+ __commonJS,
12
13
  __require,
13
14
  __toCommonJS,
14
15
  init_esm_shims
15
16
  } from "../chunk-QQ4A6DLD.mjs";
16
17
 
17
- // src/ps/index.js
18
- init_esm_shims();
19
- var ChildProcess = __require("child_process");
20
- var IS_WIN = (init_isWin(), __toCommonJS(isWin_exports)).default;
21
- var TableParser = (init_table_parser(), __toCommonJS(table_parser_exports));
22
- var EOL = /(\r\n)|(\n\r)|\n|\r/;
23
- var SystemEOL = __require("os").EOL;
24
- var Exec = module.exports = exports = function(args, callback) {
25
- var spawn = ChildProcess.spawn;
26
- if (IS_WIN) {
27
- var CMD = spawn("cmd");
28
- var stdout = "";
29
- var stderr = null;
30
- CMD.stdout.on("data", function(data) {
31
- stdout += data.toString();
32
- });
33
- CMD.stderr.on("data", function(data) {
34
- if (stderr === null) {
35
- stderr = data.toString();
18
+ // src/ps/index.cjs
19
+ var require_ps = __commonJS({
20
+ "src/ps/index.cjs"(exports, module) {
21
+ init_esm_shims();
22
+ var ChildProcess = __require("child_process");
23
+ var IS_WIN = (init_isWindows(), __toCommonJS(isWindows_exports)).isWindows();
24
+ var TableParser = (init_table_parser(), __toCommonJS(table_parser_exports));
25
+ var EOL = /(\r\n)|(\n\r)|\n|\r/;
26
+ var SystemEOL = __require("os").EOL;
27
+ var Exec = module.exports = exports = function(args, callback) {
28
+ var spawn = ChildProcess.spawn;
29
+ if (IS_WIN) {
30
+ var CMD = spawn("cmd");
31
+ var stdout = "";
32
+ var stderr = null;
33
+ CMD.stdout.on("data", function(data) {
34
+ stdout += data.toString();
35
+ });
36
+ CMD.stderr.on("data", function(data) {
37
+ if (stderr === null) {
38
+ stderr = data.toString();
39
+ } else {
40
+ stderr += data.toString();
41
+ }
42
+ });
43
+ CMD.on("exit", function() {
44
+ var beginRow;
45
+ stdout = stdout.split(EOL);
46
+ stdout.forEach(function(out, index) {
47
+ if (out && typeof beginRow == "undefined" && out.indexOf("CommandLine") === 0) {
48
+ beginRow = index;
49
+ }
50
+ });
51
+ stdout.splice(stdout.length - 1, 1);
52
+ stdout.splice(0, beginRow);
53
+ callback(stderr, stdout.join(SystemEOL) || false);
54
+ });
55
+ CMD.stdin.write("wmic process get ProcessId,ParentProcessId,CommandLine \n");
56
+ CMD.stdin.end();
36
57
  } else {
37
- stderr += data.toString();
58
+ if (typeof args === "string") {
59
+ args = args.split(/\s+/);
60
+ }
61
+ const child = spawn("ps", args);
62
+ stdout = "";
63
+ stderr = null;
64
+ child.stdout.on("data", function(data) {
65
+ stdout += data.toString();
66
+ });
67
+ child.stderr.on("data", function(data) {
68
+ if (stderr === null) {
69
+ stderr = data.toString();
70
+ } else {
71
+ stderr += data.toString();
72
+ }
73
+ });
74
+ child.on("exit", function() {
75
+ if (stderr) {
76
+ return callback(stderr.toString());
77
+ } else {
78
+ callback(null, stdout || false);
79
+ }
80
+ });
38
81
  }
39
- });
40
- CMD.on("exit", function() {
41
- var beginRow;
42
- stdout = stdout.split(EOL);
43
- stdout.forEach(function(out, index) {
44
- if (out && typeof beginRow == "undefined" && out.indexOf("CommandLine") === 0) {
45
- beginRow = index;
82
+ };
83
+ exports.lookup = function(query, callback) {
84
+ var exeArgs = query.psargs || ["lx"];
85
+ var filter = {};
86
+ var idList;
87
+ if (query.pid) {
88
+ if (Array.isArray(query.pid)) {
89
+ idList = query.pid;
90
+ } else {
91
+ idList = [query.pid];
46
92
  }
47
- });
48
- stdout.splice(stdout.length - 1, 1);
49
- stdout.splice(0, beginRow);
50
- callback(stderr, stdout.join(SystemEOL) || false);
51
- });
52
- CMD.stdin.write("wmic process get ProcessId,ParentProcessId,CommandLine \n");
53
- CMD.stdin.end();
54
- } else {
55
- if (typeof args === "string") {
56
- args = args.split(/\s+/);
57
- }
58
- const child = spawn("ps", args);
59
- stdout = "";
60
- stderr = null;
61
- child.stdout.on("data", function(data) {
62
- stdout += data.toString();
63
- });
64
- child.stderr.on("data", function(data) {
65
- if (stderr === null) {
66
- stderr = data.toString();
67
- } else {
68
- stderr += data.toString();
93
+ idList = idList.map(function(v) {
94
+ return String(v);
95
+ });
69
96
  }
70
- });
71
- child.on("exit", function() {
72
- if (stderr) {
73
- return callback(stderr.toString());
74
- } else {
75
- callback(null, stdout || false);
97
+ if (query.command) {
98
+ filter["command"] = new RegExp(query.command, "i");
76
99
  }
77
- });
78
- }
79
- };
80
- exports.lookup = function(query, callback) {
81
- var exeArgs = query.psargs || ["lx"];
82
- var filter = {};
83
- var idList;
84
- if (query.pid) {
85
- if (Array.isArray(query.pid)) {
86
- idList = query.pid;
87
- } else {
88
- idList = [query.pid];
89
- }
90
- idList = idList.map(function(v) {
91
- return String(v);
92
- });
93
- }
94
- if (query.command) {
95
- filter["command"] = new RegExp(query.command, "i");
96
- }
97
- if (query.arguments) {
98
- filter["arguments"] = new RegExp(query.arguments, "i");
99
- }
100
- if (query.ppid) {
101
- filter["ppid"] = new RegExp(query.ppid);
102
- }
103
- return Exec(exeArgs, function(err, output) {
104
- if (err) {
105
- return callback(err);
106
- } else {
107
- var processList = parseGrid(output);
108
- var resultList = [];
109
- processList.forEach(function(p) {
110
- var flt;
111
- var type;
112
- var result = true;
113
- if (idList && idList.indexOf(String(p.pid)) < 0) {
114
- return;
115
- }
116
- for (type in filter) {
117
- flt = filter[type];
118
- result = flt.test(p[type]) ? result : false;
119
- }
120
- if (result) {
121
- resultList.push(p);
122
- }
123
- });
124
- callback(null, resultList);
125
- }
126
- });
127
- };
128
- exports.kill = function(pid, signal, next) {
129
- if (arguments.length == 2 && typeof signal == "function") {
130
- next = signal;
131
- signal = void 0;
132
- }
133
- var checkTimeoutSeconds = signal && signal.timeout || 30;
134
- if (typeof signal === "object") {
135
- signal = signal.signal;
136
- }
137
- try {
138
- process.kill(pid, signal);
139
- } catch (e) {
140
- return next && next(e);
141
- }
142
- var checkConfident = 0;
143
- var checkTimeoutTimer = null;
144
- var checkIsTimeout = false;
145
- function checkKilled(finishCallback) {
146
- exports.lookup({ pid }, function(err, list) {
147
- if (checkIsTimeout) return;
148
- if (err) {
149
- clearTimeout(checkTimeoutTimer);
150
- if (finishCallback) finishCallback(err);
151
- } else if (list.length > 0) {
152
- checkConfident = checkConfident - 1 || 0;
153
- checkKilled(finishCallback);
154
- } else {
155
- checkConfident++;
156
- if (checkConfident === 5) {
157
- clearTimeout(checkTimeoutTimer);
158
- if (finishCallback) finishCallback();
100
+ if (query.arguments) {
101
+ filter["arguments"] = new RegExp(query.arguments, "i");
102
+ }
103
+ if (query.ppid) {
104
+ filter["ppid"] = new RegExp(query.ppid);
105
+ }
106
+ return Exec(exeArgs, function(err, output) {
107
+ if (err) {
108
+ return callback(err);
159
109
  } else {
160
- checkKilled(finishCallback);
110
+ var processList = parseGrid(output);
111
+ var resultList = [];
112
+ processList.forEach(function(p) {
113
+ var flt;
114
+ var type;
115
+ var result = true;
116
+ if (idList && idList.indexOf(String(p.pid)) < 0) {
117
+ return;
118
+ }
119
+ for (type in filter) {
120
+ flt = filter[type];
121
+ result = flt.test(p[type]) ? result : false;
122
+ }
123
+ if (result) {
124
+ resultList.push(p);
125
+ }
126
+ });
127
+ callback(null, resultList);
161
128
  }
129
+ });
130
+ };
131
+ exports.kill = function(pid, signal, next) {
132
+ if (arguments.length == 2 && typeof signal == "function") {
133
+ next = signal;
134
+ signal = void 0;
162
135
  }
163
- });
164
- }
165
- if (next) checkKilled(next);
166
- checkTimeoutTimer = next && setTimeout(function() {
167
- checkIsTimeout = true;
168
- next(new Error("Kill process timeout"));
169
- }, checkTimeoutSeconds * 1e3);
170
- };
171
- function parseGrid(output) {
172
- if (!output) {
173
- return [];
174
- }
175
- return formatOutput(TableParser.parse(output));
176
- }
177
- function formatOutput(data) {
178
- var formatedData = [];
179
- data.forEach(function(d) {
180
- var pid = d.PID && d.PID[0] || d.ProcessId && d.ProcessId[0] || void 0;
181
- var cmd = d.CMD || d.CommandLine || d.COMMAND || void 0;
182
- var ppid = d.PPID && d.PPID[0] || d.ParentProcessId && d.ParentProcessId[0] || void 0;
183
- if (pid && cmd) {
184
- var command = cmd[0];
185
- var args = "";
186
- if (cmd.length > 1) {
187
- args = cmd.slice(1);
136
+ var checkTimeoutSeconds = signal && signal.timeout || 30;
137
+ if (typeof signal === "object") {
138
+ signal = signal.signal;
139
+ }
140
+ try {
141
+ process.kill(pid, signal);
142
+ } catch (e) {
143
+ return next && next(e);
144
+ }
145
+ var checkConfident = 0;
146
+ var checkTimeoutTimer = null;
147
+ var checkIsTimeout = false;
148
+ function checkKilled(finishCallback) {
149
+ exports.lookup({ pid }, function(err, list) {
150
+ if (checkIsTimeout) return;
151
+ if (err) {
152
+ clearTimeout(checkTimeoutTimer);
153
+ if (finishCallback) finishCallback(err);
154
+ } else if (list.length > 0) {
155
+ checkConfident = checkConfident - 1 || 0;
156
+ checkKilled(finishCallback);
157
+ } else {
158
+ checkConfident++;
159
+ if (checkConfident === 5) {
160
+ clearTimeout(checkTimeoutTimer);
161
+ if (finishCallback) finishCallback();
162
+ } else {
163
+ checkKilled(finishCallback);
164
+ }
165
+ }
166
+ });
188
167
  }
189
- formatedData.push({
190
- pid,
191
- command,
192
- arguments: args,
193
- ppid
168
+ if (next) checkKilled(next);
169
+ checkTimeoutTimer = next && setTimeout(function() {
170
+ checkIsTimeout = true;
171
+ next(new Error("Kill process timeout"));
172
+ }, checkTimeoutSeconds * 1e3);
173
+ };
174
+ function parseGrid(output) {
175
+ if (!output) {
176
+ return [];
177
+ }
178
+ return formatOutput(TableParser.parse(output));
179
+ }
180
+ function formatOutput(data) {
181
+ var formatedData = [];
182
+ data.forEach(function(d) {
183
+ var pid = d.PID && d.PID[0] || d.ProcessId && d.ProcessId[0] || void 0;
184
+ var cmd = d.CMD || d.CommandLine || d.COMMAND || void 0;
185
+ var ppid = d.PPID && d.PPID[0] || d.ParentProcessId && d.ParentProcessId[0] || void 0;
186
+ if (pid && cmd) {
187
+ var command = cmd[0];
188
+ var args = "";
189
+ if (cmd.length > 1) {
190
+ args = cmd.slice(1);
191
+ }
192
+ formatedData.push({
193
+ pid,
194
+ command,
195
+ arguments: args,
196
+ ppid
197
+ });
198
+ }
194
199
  });
200
+ return formatedData;
195
201
  }
196
- });
197
- return formatedData;
198
- }
202
+ }
203
+ });
204
+ export default require_ps();
@@ -1,6 +1,5 @@
1
1
  /**
2
- * The output sting of cmd to parse
3
- * @param output
4
- * @returns {Array}
2
+ * @param {string} output
3
+ * @returns {Array<Object>}
5
4
  */
6
- export function parse(output: any): any[];
5
+ export function parse(output: string): Array<Object>;
@@ -4,8 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.parse = parse;
7
- /**
8
- *
7
+ /*
9
8
  * 1, define the edge ( begin and end ) of every title field
10
9
  * 2, parse all the lines except the title line, get all the connected-domains
11
10
  * 3, group all the connected-domains vertically overlapped.
@@ -15,9 +14,8 @@ exports.parse = parse;
15
14
  const connected_domain_1 = __importDefault(require("./connected-domain"));
16
15
  var EMPTY_EX = /\s/;
17
16
  /**
18
- * The output sting of cmd to parse
19
- * @param output
20
- * @returns {Array}
17
+ * @param {string} output
18
+ * @returns {Array<Object>}
21
19
  */
22
20
  function parse(output) {
23
21
  // Split into lines
@@ -67,7 +65,7 @@ function parse(output) {
67
65
  });
68
66
  }
69
67
  else {
70
- twoDimArray[index - 1] = line.split("");
68
+ twoDimArray[index - 1] = line.split('');
71
69
  }
72
70
  });
73
71
  // In the connected-domain aspect of view, all the blanks are connected, and all the non-blanks are connected.
@@ -175,11 +173,10 @@ function parse(output) {
175
173
  return result;
176
174
  }
177
175
  /**
178
- * Test if two bounding overlapped vertically
179
- * @param begin1
180
- * @param end1
181
- * @param begin2
182
- * @param end2
176
+ * @param {number} begin1
177
+ * @param {number} end1
178
+ * @param {number} begin2
179
+ * @param {number} end2
183
180
  * @returns {boolean}
184
181
  */
185
182
  function overlap(begin1, end1, begin2, end2) {
@@ -188,12 +185,8 @@ function overlap(begin1, end1, begin2, end2) {
188
185
  (begin1 <= begin2 && end1 >= end2)); // 21--12 or 1--2--2--1
189
186
  }
190
187
  /**
191
- * transform a string value into array. It's not just split(), but also to consider some chunk that wrapped with `"`, like below:
192
- * "C:\Program Files\Google\Chrome\Application\chrome.exe" --type=renderer --lang=zh-CN, `C:\Program Files\Google\Chrome\Application\chrome.exe` should be treated as a whole,
193
- * also, be careful don't be mislead by format like `--name="neekey"`, even more complicated: `--name="Neekey Ni"`
194
- * so, `"C:\Program Files\Internet Explorer\iexplore.exe" --name="Jack Neekey"` should split into:
195
- * - C:\Program Files\Internet Explorer\iexplore.exe // without `"`
196
- * - --name="Jack Neekey" // with `"`
188
+ * @param {string} value
189
+ * @returns {string[]}
197
190
  */
198
191
  function splitValue(value) {
199
192
  var match = value.match(/"/g);
@@ -210,18 +203,18 @@ function splitValue(value) {
210
203
  // If the match length is a even, than nothing special, if a odd, ignore the last one.
211
204
  var maxQuotaCount = match.length % 2 == 0 ? match.length : match.length - 1;
212
205
  var previousItem = null;
213
- var values = value.split("");
206
+ var values = value.split('');
214
207
  values.forEach(function (item, index) {
215
- if (item !== " ") {
208
+ if (item !== ' ') {
216
209
  if (item === '"') {
217
210
  // quota chunk begin
218
211
  if (ifInWrappedChunk === false && quotaCount <= maxQuotaCount) {
219
212
  ifInWrappedChunk = true;
220
213
  quotaCount++;
221
214
  // pure quota chunk begin
222
- if (previousItem === " " || previousItem === null) {
215
+ if (previousItem === ' ' || previousItem === null) {
223
216
  ifInPureWrappedChunk = true;
224
- chunk = "";
217
+ chunk = '';
225
218
  }
226
219
  // normal continue
227
220
  else {
@@ -245,7 +238,7 @@ function splitValue(value) {
245
238
  }
246
239
  }
247
240
  // normal begin
248
- else if (ifInWrappedChunk === false && (previousItem === " " || previousItem === null)) {
241
+ else if (ifInWrappedChunk === false && (previousItem === ' ' || previousItem === null)) {
249
242
  chunk = item;
250
243
  }
251
244
  // normal or quota chunk continue.
@@ -40,9 +40,9 @@ var require_utils = __commonJS({
40
40
  init_cjs_shims();
41
41
  var fs2 = require("fs");
42
42
  var path2 = require("upath");
43
- var argv2 = require("minimist")(process.argv.slice(2));
43
+ var minimistLib = require("minimist");
44
+ var argv2 = minimistLib(process.argv.slice(2));
44
45
  var { exec } = require("child_process");
45
- var { URL: URL2 } = require("url");
46
46
  var { promisify } = require("util");
47
47
  var execAsync = promisify(exec);
48
48
  async function parseGitRemotes() {
@@ -55,7 +55,7 @@ var require_utils = __commonJS({
55
55
  if (name && url) {
56
56
  const [repoUrl] = url.split(" ");
57
57
  try {
58
- const parsedUrl = new URL2(repoUrl);
58
+ const parsedUrl = new URL(repoUrl);
59
59
  const pathParts = parsedUrl.pathname.split("/").filter(Boolean);
60
60
  if (parsedUrl.hostname === "github.com" && pathParts.length === 2) {
61
61
  let repoPath = pathParts.join("/");
@@ -76,15 +76,10 @@ var require_utils = __commonJS({
76
76
  }
77
77
  }
78
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);
79
+ function getArgs2(opts) {
80
+ if (opts) {
81
+ return minimistLib(process.argv.slice(2), opts);
83
82
  }
84
- return fullPath;
85
- }
86
- module2.exports.joinPathPreserveDriveLetter = joinPathPreserveDriveLetter;
87
- function getArgs2() {
88
83
  return argv2;
89
84
  }
90
85
  module2.exports.getArgs = getArgs2;
@@ -109,7 +104,7 @@ var require_utils = __commonJS({
109
104
  try {
110
105
  fs2.rmdirSync(fullPath);
111
106
  console.log("deleted", fullPath);
112
- } catch (e) {
107
+ } catch (_e) {
113
108
  try {
114
109
  fs2.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
115
110
  console.log("deleted", fullPath);
@@ -122,7 +117,7 @@ var require_utils = __commonJS({
122
117
  try {
123
118
  fs2.unlinkSync(fullPath);
124
119
  console.log("deleted", fullPath);
125
- } catch (e) {
120
+ } catch (_e) {
126
121
  try {
127
122
  fs2.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
128
123
  console.log("deleted", fullPath);
@@ -210,7 +205,7 @@ var require_utils = __commonJS({
210
205
  init_cjs_shims();
211
206
  var import_utils = __toESM(require_utils(), 1);
212
207
  var import_fs = __toESM(require("fs"), 1);
213
- var import_path = __toESM(require("path"), 1);
208
+ var import_upath = __toESM(require("upath"), 1);
214
209
  var glob = __toESM(require("glob"), 1);
215
210
  var argv = (0, import_utils.getArgs)();
216
211
  var positional = argv._ || [];
@@ -243,7 +238,7 @@ if (positional.length === 0) {
243
238
  }
244
239
  for (const moduleName of positional) {
245
240
  if (argv.node) {
246
- const modulePath = import_path.default.resolve("node_modules", moduleName);
241
+ const modulePath = import_upath.default.resolve("node_modules", moduleName);
247
242
  if (import_fs.default.existsSync(modulePath)) {
248
243
  try {
249
244
  import_fs.default.rmSync(modulePath, { recursive: true, force: true });
@@ -258,7 +253,7 @@ for (const moduleName of positional) {
258
253
  }
259
254
  }
260
255
  if (argv.composer) {
261
- const vendorPath = import_path.default.resolve("vendor", "composer", moduleName);
256
+ const vendorPath = import_upath.default.resolve("vendor", "composer", moduleName);
262
257
  if (import_fs.default.existsSync(vendorPath)) {
263
258
  try {
264
259
  import_fs.default.rmSync(vendorPath, { recursive: true, force: true });
@@ -275,21 +270,21 @@ for (const moduleName of positional) {
275
270
  if (argv.venv) {
276
271
  const venvs = [".venv", "venv"];
277
272
  for (const venv of venvs) {
278
- const sitePackages = import_path.default.resolve(venv, "Lib", "site-packages");
273
+ const sitePackages = import_upath.default.resolve(venv, "Lib", "site-packages");
279
274
  const venvModulePaths = [
280
275
  // main package directory (for packages)
281
- import_path.default.resolve(sitePackages, moduleName),
276
+ import_upath.default.resolve(sitePackages, moduleName),
282
277
  // main module file (for single-file modules)
283
- import_path.default.resolve(sitePackages, moduleName + ".py"),
278
+ import_upath.default.resolve(sitePackages, moduleName + ".py"),
284
279
  // dist-info metadata directories
285
- ...glob.sync(`${moduleName}-*.dist-info`, { cwd: sitePackages }).map((p) => import_path.default.resolve(sitePackages, p)),
280
+ ...glob.sync(`${moduleName}-*.dist-info`, { cwd: sitePackages }).map((p) => import_upath.default.resolve(sitePackages, p)),
286
281
  // egg-info metadata directories
287
- ...glob.sync(`${moduleName}-*.egg-info`, { cwd: sitePackages }).map((p) => import_path.default.resolve(sitePackages, p)),
282
+ ...glob.sync(`${moduleName}-*.egg-info`, { cwd: sitePackages }).map((p) => import_upath.default.resolve(sitePackages, p)),
288
283
  // compiled extension files (.pyd for Windows, .so for Linux)
289
- ...glob.sync(`${moduleName}*.pyd`, { cwd: sitePackages }).map((p) => import_path.default.resolve(sitePackages, p)),
290
- ...glob.sync(`${moduleName}*.so`, { cwd: sitePackages }).map((p) => import_path.default.resolve(sitePackages, p)),
284
+ ...glob.sync(`${moduleName}*.pyd`, { cwd: sitePackages }).map((p) => import_upath.default.resolve(sitePackages, p)),
285
+ ...glob.sync(`${moduleName}*.so`, { cwd: sitePackages }).map((p) => import_upath.default.resolve(sitePackages, p)),
291
286
  // editable install directories (legacy pattern)
292
- ...glob.sync(`_*editable_*${moduleName}*`, { cwd: sitePackages }).map((p) => import_path.default.resolve(sitePackages, p))
287
+ ...glob.sync(`_*editable_*${moduleName}*`, { cwd: sitePackages }).map((p) => import_upath.default.resolve(sitePackages, p))
293
288
  ];
294
289
  for (const venvModulePath of venvModulePaths) {
295
290
  if (import_fs.default.existsSync(venvModulePath)) {
@@ -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-6RK5UCTP.mjs";
5
5
  import {
6
6
  __toESM,
7
7
  init_esm_shims
@@ -11,7 +11,7 @@ import {
11
11
  init_esm_shims();
12
12
  var import_utils = __toESM(require_utils(), 1);
13
13
  import fs from "fs";
14
- import path from "path";
14
+ import path from "upath";
15
15
  import * as glob from "glob";
16
16
  var argv = (0, import_utils.getArgs)();
17
17
  var positional = argv._ || [];