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
@@ -1,8 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
3
+ import {
4
+ require_executeScript
5
+ } from "./chunk-PXBMHE7O.mjs";
6
+ import {
7
+ require_findScript
8
+ } from "./chunk-NCZPTKDV.mjs";
9
+ import {
10
+ require_listScript
11
+ } from "./chunk-6PU7BAHB.mjs";
12
+ import "./chunk-ZOWVMII3.mjs";
3
13
  import {
4
14
  require_utils
5
- } from "./chunk-Z6JLYU2J.mjs";
15
+ } from "./chunk-5RTXZVCW.mjs";
6
16
  import {
7
17
  __commonJS,
8
18
  __dirname,
@@ -10,227 +20,14 @@ import {
10
20
  init_esm_shims
11
21
  } from "./chunk-QQ4A6DLD.mjs";
12
22
 
13
- // package.json
14
- var require_package = __commonJS({
15
- "package.json"(exports, module) {
16
- module.exports = {
17
- name: "binary-collections",
18
- version: "2.0.11",
19
- description: "Utility to clean any programming caches and more",
20
- keywords: [
21
- "cache",
22
- "cleaner",
23
- "utility"
24
- ],
25
- homepage: "https://www.webmanajemen.com/",
26
- bugs: {
27
- url: "https://github.com/dimaslanjaka/bin/issues"
28
- },
29
- license: "MIT",
30
- author: {
31
- name: "dimaslanjaka",
32
- email: "dimaslanjaka@gmail.com",
33
- url: "https://webmanajemen.com"
34
- },
35
- type: "module",
36
- main: "lib/index.js",
37
- exports: {
38
- ".": {
39
- require: {
40
- default: "./lib/index.cjs",
41
- types: "./lib/index.d.ts"
42
- },
43
- import: {
44
- default: "./lib/index.mjs",
45
- types: "./lib/index.d.mts"
46
- }
47
- },
48
- "./package.json": "./package.json"
49
- },
50
- types: "lib/index.d.ts",
51
- files: [
52
- "binaries",
53
- "lib",
54
- "package.json",
55
- "docs-src/**/*.md",
56
- "readme.md",
57
- ".puppeterrc.*",
58
- "requirements.txt"
59
- ],
60
- scripts: {
61
- build: "tsc -b tsconfig.build.json && npm run build:tsup && npm run postbuild",
62
- "build:packages": "yarn workspaces foreach --worktree --exclude=binary-collections --no-private run build",
63
- "build:rollup": "rollup -c rollup.config.js",
64
- "build:tsup": "node build.tsup.js",
65
- clean: "rimraf lib tmp/dist binaries",
66
- pack: "node packer.cjs --yarn --filename=bin",
67
- postbuild: "node -r ts-node/register -r dotenv/config build.exports.mjs && yarn run pack",
68
- prepare: "husky",
69
- test: 'npx jest --runInBand --forceExit --testTimeout=120000 --testPathIgnorePatterns="\\.mjs$"',
70
- "test:coverage": "npm test --coverage --detectOpenHandles",
71
- "test:esm": 'node --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand --forceExit --testTimeout=120000 --testPathIgnorePatterns="\\.(ts|js|cjs)$"',
72
- "test:nrs": "npm test -- nrs build:**",
73
- "test:watch": "npm test --watch",
74
- "update:ncu": "npx npm-check-updates -u -x jsdom,chalk,hexo,deepmerge-ts --enginesNode --root",
75
- "update:packer": "curl -L https://github.com/dimaslanjaka/nodejs-package-types/raw/main/packer.js > packer.cjs",
76
- "puppeteer:browser": "npx -y puppeteer browsers install chrome"
77
- },
78
- repository: {
79
- type: "git",
80
- url: "git+https://github.com/dimaslanjaka/bin"
81
- },
82
- dependencies: {
83
- "@yarnpkg/core": "^4.7.0",
84
- "ansi-colors": "^4.1.3",
85
- axios: "^1.15.2",
86
- dotenv: "^17.4.2",
87
- execa: "^9.6.1",
88
- "fs-extra": "^11.3.4",
89
- "git-command-helper": "https://github.com/dimaslanjaka/git-command-helper/raw/refs/heads/pre-release/release/git-command-helper.tgz",
90
- glob: "^13.0.6",
91
- minimatch: "^10.2.5",
92
- minimist: "^1.2.8",
93
- "ps-node": "^0.1.6",
94
- puppeteer: "^24.42.0",
95
- "puppeteer-extra": "^3.3.6",
96
- "puppeteer-extra-plugin-stealth": "^2.11.2",
97
- remove: "^0.1.5",
98
- "sbg-utility": "^2.0.11",
99
- upath: "^3.0.7",
100
- yaml: "^2.8.3",
101
- yarn: "^1.22.22"
102
- },
103
- devDependencies: {
104
- "@babel/core": "^7.29.0",
105
- "@babel/preset-env": "^7.29.2",
106
- "@babel/preset-typescript": "^7.28.5",
107
- "@eslint/eslintrc": "^3.3.5",
108
- "@eslint/js": "^10.0.1",
109
- "@rollup/plugin-babel": "^7.0.0",
110
- "@rollup/plugin-commonjs": "^29.0.2",
111
- "@rollup/plugin-json": "^6.1.0",
112
- "@rollup/plugin-node-resolve": "^16.0.3",
113
- "@types/babel__core": "^7",
114
- "@types/babel__preset-env": "^7",
115
- "@types/eslint": "^9",
116
- "@types/fs-extra": "^11",
117
- "@types/jest": "^30.0.0",
118
- "@types/minimist": "^1",
119
- "@types/node": "^25.6.0",
120
- "@types/prettier": "^3",
121
- "@types/ps-node": "^0",
122
- "@types/yargs": "^17",
123
- "@typescript-eslint/eslint-plugin": "^8.59.0",
124
- "@typescript-eslint/parser": "^8.59.0",
125
- "babel-jest": "^30.4.1",
126
- "browser-sync": "^3.0.4",
127
- "cross-env": "^10.1.0",
128
- "cross-spawn": "https://github.com/dimaslanjaka/node-cross-spawn/raw/80999ac7a7031a81e11ddb5fab0f8ba433041c98/release/cross-spawn.tgz",
129
- eslint: "^10.2.1",
130
- "eslint-config-prettier": "^10.1.8",
131
- "eslint-plugin-prettier": "^5.5.5",
132
- globals: "^17.5.0",
133
- gulp: "^5.0.1",
134
- husky: "^9.1.7",
135
- jest: "^30.4.2",
136
- "lint-staged": "^16.4.0",
137
- marked: "^18.0.3",
138
- prettier: "^3.8.3",
139
- rimraf: "^6.1.3",
140
- rollup: "^4.60.2",
141
- "ts-jest": "^29.4.9",
142
- "ts-node": "^10.9.2",
143
- tsup: "^8.5.1",
144
- typedoc: "^0.28.19",
145
- "typedoc-plugin-ga": "^1.1.1",
146
- typescript: "^6.0.3"
147
- },
148
- directories: {
149
- lib: "lib",
150
- bin: "binaries"
151
- },
152
- workspaces: [
153
- "packages/*"
154
- ],
155
- packageManager: "yarn@4.9.2",
156
- resolutions: {
157
- "cross-spawn": "https://github.com/dimaslanjaka/node-cross-spawn/raw/80999ac7a7031a81e11ddb5fab0f8ba433041c98/release/cross-spawn.tgz",
158
- "git-command-helper": "https://github.com/dimaslanjaka/git-command-helper/raw/0ec870a451241af4f7e16acee5474afe38918c77/release/git-command-helper.tgz",
159
- "sbg-utility": "https://github.com/dimaslanjaka/static-blog-generator/raw/1c6327117ab66a6ac7bac6df2b5c4f1cd9ef2785/packages/sbg-utility/release/sbg-utility.tgz"
160
- },
161
- bin: {
162
- "binary-collections": "lib/binary-collections.cjs",
163
- "binary-executor": "binaries/binary-executor.cjs",
164
- changelog: "lib/changelog.cjs",
165
- chatgpt: "lib/free-chatgpt.cjs",
166
- "clean-github-actions-cache": "lib/clean-github-actions-caches.cjs",
167
- "clean-github-actions-caches": "lib/clean-github-actions-caches.cjs",
168
- "clean-nodemodule": "binaries/clean-nodemodule.cjs",
169
- "clean-nodemodules": "binaries/clean-nodemodules.cjs",
170
- "clear-gh-caches": "lib/clean-github-actions-caches.cjs",
171
- "clear-github-actions-cache": "lib/clean-github-actions-caches.cjs",
172
- "clear-github-actions-caches": "lib/clean-github-actions-caches.cjs",
173
- "del-gradle": "lib/del-gradle.cjs",
174
- "del-node-modules": "lib/del-node-modules.cjs",
175
- "del-nodemodules": "lib/del-node-modules.cjs",
176
- "del-ps": "lib/del-ps.cjs",
177
- "del-yarn-caches": "lib/del-yarn-caches.cjs",
178
- "del-yarncaches": "lib/del-yarn-caches.cjs",
179
- dev: "binaries/dev.cjs",
180
- "dir-tree": "lib/print-directory-tree.cjs",
181
- empty: "binaries/empty.cjs",
182
- "find-node-modules": "lib/find-node-modules-cli.cjs",
183
- "free-chatgpt": "lib/free-chatgpt.cjs",
184
- "git-diff": "lib/git-diff-cli.cjs",
185
- "git-fix": "lib/git-fix.cjs",
186
- "git-purge": "lib/git-purge.cjs",
187
- "git-reduce-size": "binaries/git-reduce-size.cjs",
188
- "git-undo-commit": "lib/git/undo-commit.cjs",
189
- "git-undo-staged": "lib/git/undo-staged.cjs",
190
- javakill: "binaries/javakill.cjs",
191
- "kill-night-crows": "lib/kill-night-crows.cjs",
192
- "kill-process": "binaries/kill-process.cjs",
193
- nodekill: "binaries/nodekill.cjs",
194
- "npm-run-series": "lib/npm-run-series.cjs",
195
- nrs: "lib/npm-run-series.cjs",
196
- "package-resolutions-updater": "lib/package-resolutions-updater-cli.cjs",
197
- "php-cs-fixer-staged": "lib/php-cs-fixer-staged.cjs",
198
- "pkg-res-updater": "lib/package-resolutions-updater-cli.cjs",
199
- "pkg-resolutions-updater": "lib/package-resolutions-updater-cli.cjs",
200
- "print-directory-tree": "lib/print-directory-tree.cjs",
201
- "print-tree": "lib/print-directory-tree.cjs",
202
- prod: "binaries/prod.cjs",
203
- py: "binaries/py.cjs",
204
- "remove-module": "lib/remove-module.cjs",
205
- rmfind: "binaries/rmfind.cjs",
206
- rmpath: "lib/rmpath.cjs",
207
- rmx: "binaries/rmx.cjs",
208
- "run-s": "lib/npm-run-series.cjs",
209
- "run-series": "lib/npm-run-series.cjs",
210
- "submodule-install": "lib/submodule-install.cjs",
211
- "submodule-remove": "lib/submodule-remove-cli.cjs",
212
- "submodule-token": "binaries/submodule-token.cjs",
213
- "test-cjs": "binaries/test-cjs.cjs",
214
- "undo-commit": "lib/git/undo-commit.cjs",
215
- "undo-last-commit": "lib/git/undo-commit.cjs",
216
- "undo-staged": "lib/git/undo-staged.cjs",
217
- "yarn-clean": "binaries/yarn-clean.cjs",
218
- "yarn-reinstall": "lib/yarn-reinstall.cjs"
219
- }
220
- };
221
- }
222
- });
223
-
224
23
  // src/binary-collections.cjs
225
24
  var require_binary_collections = __commonJS({
226
25
  "src/binary-collections.cjs"() {
227
26
  init_esm_shims();
228
- var { spawn } = __require("child_process");
229
- var { glob } = __require("glob");
230
27
  var path = __require("upath");
231
28
  var { getArgs } = require_utils();
232
- var pkgJson = require_package();
233
- var fs = __require("fs-extra");
29
+ var findScript = require_findScript();
30
+ var executeScript = require_executeScript();
234
31
  function showHelp() {
235
32
  console.log("\u{1F680} Binary Collections - Dynamic Script Runner");
236
33
  console.log("\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550");
@@ -249,79 +46,22 @@ var require_binary_collections = __commonJS({
249
46
  console.log(" --help, -h Show this help message");
250
47
  process.exit(0);
251
48
  }
252
- function findScript(scriptName, searchDir = null) {
253
- if (!searchDir) searchDir = __dirname;
254
- let result;
255
- const ignorePatterns = [
256
- `**/*config*.{cjs,js,mjs}`,
257
- `**/utils.{cjs,js,mjs}`,
258
- `**/index.{cjs,js,mjs}`,
259
- `**/chunk-*.{cjs,js,mjs}`,
260
- `**/*.d.{ts,cts,mts}`
261
- // ignore TypeScript declaration files
262
- ];
263
- try {
264
- const pattern = `${scriptName}.{cjs,js,mjs}`;
265
- const files = glob.sync(pattern, {
266
- cwd: searchDir,
267
- ignore: ignorePatterns,
268
- absolute: true
269
- });
270
- if (files.length > 0) {
271
- result = files[0];
272
- } else {
273
- if (pkgJson.bin[scriptName]) {
274
- const find = [
275
- path.join(searchDir, pkgJson.bin[scriptName]),
276
- path.join(process.cwd(), "node_modules/binary-collections", pkgJson.bin[scriptName]),
277
- path.join(__dirname, pkgJson.bin[scriptName]),
278
- path.join(path.join(__dirname, ".."), pkgJson.bin[scriptName])
279
- ];
280
- const filtered = find.filter((file) => fs.existsSync(file));
281
- if (filtered.length > 0) {
282
- result = filtered[0];
283
- } else {
284
- console.warn(`\u26A0\uFE0F Script "${scriptName}" not found in ${searchDir}.`);
285
- console.warn(`\u{1F50D} Searched for: ${pattern} in ${searchDir}`);
286
- }
287
- }
288
- }
289
- } catch (error) {
290
- console.error(`\u{1F50D} Error searching for script: ${error.message}`);
291
- }
292
- if (result && !result.includes("-cli")) {
293
- const ext = path.extname(result);
294
- const filename = path.basename(result, ext);
295
- const cliFile = path.join(path.dirname(result), `${filename}-cli${ext}`);
296
- if (fs.existsSync(cliFile)) {
297
- result = cliFile;
298
- console.log(`\u{1F50D} Found CLI version: ${cliFile}`);
299
- }
300
- }
301
- return result;
302
- }
303
- function executeScript(scriptPath, args) {
304
- console.log(`\u{1F527} Executing script: ${scriptPath} args: ${args.join(" ")}`);
305
- const child = spawn("node", [scriptPath, ...args], {
306
- stdio: "inherit",
307
- shell: true
308
- });
309
- child.on("error", (error) => {
310
- console.error(`\u274C Error executing script: ${error.message}`);
311
- process.exit(1);
312
- });
313
- child.on("close", (code) => {
314
- process.exit(code);
315
- });
316
- }
317
49
  function main() {
318
50
  const args = getArgs();
319
51
  const positional = args._ || [];
320
- console.log(`\u{1F50D} Parsed arguments: ${JSON.stringify(args)}`);
321
52
  if (positional.length === 0) {
322
53
  return showHelp();
323
54
  }
324
55
  const scriptName = positional[0];
56
+ if (scriptName === "list") {
57
+ const listScript = require_listScript();
58
+ const scripts = listScript();
59
+ console.log("\u{1F4CB} Available scripts:");
60
+ scripts.forEach((script) => {
61
+ console.log(` - ${path.basename(script.name)} -> ${script.path}`);
62
+ });
63
+ process.exit(0);
64
+ }
325
65
  const scriptArgs = [];
326
66
  scriptArgs.push(...positional.slice(1));
327
67
  Object.keys(args).forEach((key) => {
package/lib/changelog.cjs CHANGED
@@ -88,7 +88,7 @@ var require_utils = __commonJS({
88
88
  try {
89
89
  fs2.rmdirSync(fullPath);
90
90
  console.log("deleted", fullPath);
91
- } catch (e) {
91
+ } catch (_e) {
92
92
  try {
93
93
  fs2.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
94
94
  console.log("deleted", fullPath);
@@ -101,7 +101,7 @@ var require_utils = __commonJS({
101
101
  try {
102
102
  fs2.unlinkSync(fullPath);
103
103
  console.log("deleted", fullPath);
104
- } catch (e) {
104
+ } catch (_e) {
105
105
  try {
106
106
  fs2.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
107
107
  console.log("deleted", fullPath);
package/lib/changelog.mjs CHANGED
@@ -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
  __commonJS,
7
7
  __dirname,
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-A3VUZEJK.mjs";
5
5
  import {
6
6
  require_utils
7
- } from "./chunk-Z6JLYU2J.mjs";
7
+ } from "./chunk-5RTXZVCW.mjs";
8
8
  import {
9
9
  __commonJS,
10
10
  __require,
@@ -80,7 +80,7 @@ var require_utils = __commonJS({
80
80
  try {
81
81
  fs.rmdirSync(fullPath);
82
82
  console.log("deleted", fullPath);
83
- } catch (e) {
83
+ } catch (_e) {
84
84
  try {
85
85
  fs.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
86
86
  console.log("deleted", fullPath);
@@ -93,7 +93,7 @@ var require_utils = __commonJS({
93
93
  try {
94
94
  fs.unlinkSync(fullPath);
95
95
  console.log("deleted", fullPath);
96
- } catch (e) {
96
+ } catch (_e) {
97
97
  try {
98
98
  fs.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
99
99
  console.log("deleted", fullPath);
@@ -1,10 +1,10 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
2
  import {
3
- findEnvFiles
4
- } from "./chunk-ID2WBTE2.mjs";
3
+ require_findEnvFiles
4
+ } from "./chunk-H44UWUFY.mjs";
5
5
  import {
6
6
  require_utils
7
- } from "./chunk-Z6JLYU2J.mjs";
7
+ } from "./chunk-5RTXZVCW.mjs";
8
8
  import {
9
9
  __toESM,
10
10
  init_esm_shims
@@ -13,17 +13,19 @@ import {
13
13
  // src/package-resolutions-updater.mjs
14
14
  init_esm_shims();
15
15
  var utils = __toESM(require_utils(), 1);
16
+ var import_findEnvFiles = __toESM(require_findEnvFiles(), 1);
16
17
  import * as dotenv from "dotenv";
17
18
  import fs from "fs";
18
19
  import https from "https";
19
20
  import os from "os";
20
21
  import path from "path";
21
22
  import { parseGitHubUrl } from "git-command-helper";
23
+ import axios from "axios";
22
24
  var projectDir = process.cwd();
23
25
  var envPath = path.join(projectDir, ".env");
24
26
  var args = utils.getArgs();
25
27
  if (!fs.existsSync(envPath)) {
26
- const envFiles = findEnvFiles(projectDir, (file) => {
28
+ const envFiles = (0, import_findEnvFiles.findEnvFiles)(projectDir, (file) => {
27
29
  const content = fs.readFileSync(file, "utf-8");
28
30
  return /GITHUB_TOKEN|ACCESS_TOKEN/.test(content);
29
31
  });
@@ -169,10 +171,91 @@ async function getLatestCommitAcrossBranches(owner, repo) {
169
171
  };
170
172
  }
171
173
  function replaceRawWithLatestHash(url, latestHash) {
172
- const match = url.match(/^https:\/\/github\.com\/([^/]+)\/([^/]+)\/raw\/([^/]+)\/(.+)$/);
173
- if (!match) throw new Error("Invalid GitHub raw URL");
174
- const [, owner, repo, _oldHash, path2] = match;
175
- return `https://github.com/${owner}/${repo}/raw/${latestHash}/${path2}`;
174
+ const parsed = parseGitHubUrl(url);
175
+ if (!parsed || !parsed.owner || !parsed.repo || !parsed.branch) {
176
+ throw new Error("Invalid GitHub raw URL");
177
+ }
178
+ const branchPrefix = `${parsed.branch}/`;
179
+ const rawPrefix = parsed.host === "github.com" ? `raw/${branchPrefix}` : branchPrefix;
180
+ const refsPrefix = `refs/heads/${branchPrefix}`;
181
+ const path2 = parsed.path.startsWith(rawPrefix) ? parsed.path.slice(rawPrefix.length) : parsed.path.startsWith(refsPrefix) ? parsed.path.slice(refsPrefix.length) : parsed.path.startsWith(branchPrefix) ? parsed.path.slice(branchPrefix.length) : parsed.path;
182
+ if (parsed.host === "github.com") {
183
+ return `https://github.com/${parsed.owner}/${parsed.repo}/raw/${latestHash}/${path2}`;
184
+ }
185
+ if (parsed.host === "raw.githubusercontent.com") {
186
+ return `https://raw.githubusercontent.com/${parsed.owner}/${parsed.repo}/${latestHash}/${path2}`;
187
+ }
188
+ throw new Error("Invalid GitHub raw URL");
189
+ }
190
+ async function resolvePackageResolutionUpdates(resolutions, specialPackageOverrides = []) {
191
+ const updates = [];
192
+ for (const [currentPkgName, url] of Object.entries(resolutions || {})) {
193
+ let repo;
194
+ try {
195
+ repo = parseGitHubUrl(url);
196
+ } catch (error) {
197
+ updates.push({
198
+ skipped: true,
199
+ currentPkgName,
200
+ url,
201
+ error
202
+ });
203
+ continue;
204
+ }
205
+ try {
206
+ const override = specialPackageOverrides.find((p) => p.pkg === currentPkgName);
207
+ const latest = override ? await getLatestCommit(override.owner, override.repo, override.branch) : await getLatestCommitAcrossBranches(repo.owner, repo.repo);
208
+ const new_url = replaceRawWithLatestHash(url, latest.sha);
209
+ await axios.head(new_url, {
210
+ headers: {
211
+ "User-Agent": selectedUserAgent,
212
+ Accept: "application/vnd.github.v3+json",
213
+ "X-GitHub-Api-Version": "2022-11-28",
214
+ ...ACCESS_TOKEN ? { Authorization: `token ${ACCESS_TOKEN}` } : {}
215
+ }
216
+ }).then((response) => {
217
+ if (response.status < 200 || response.status >= 300) {
218
+ updates.push({
219
+ failed: true,
220
+ currentPkgName,
221
+ url,
222
+ new_url,
223
+ repo,
224
+ latest,
225
+ error: new Error(`New URL is not accessible, status code: ${response.status}`)
226
+ });
227
+ return;
228
+ }
229
+ updates.push({
230
+ currentPkgName,
231
+ url,
232
+ new_url,
233
+ repo,
234
+ latest
235
+ });
236
+ }).catch((e) => {
237
+ updates.push({
238
+ failed: true,
239
+ currentPkgName,
240
+ url,
241
+ new_url,
242
+ repo,
243
+ latest,
244
+ error: new Error(`New URL is not accessible: ${e.message}`)
245
+ });
246
+ return null;
247
+ });
248
+ } catch (error) {
249
+ updates.push({
250
+ failed: true,
251
+ currentPkgName,
252
+ url,
253
+ repo,
254
+ error
255
+ });
256
+ }
257
+ }
258
+ return updates;
176
259
  }
177
260
 
178
261
  export {
@@ -180,5 +263,6 @@ export {
180
263
  fetchJson,
181
264
  getLatestCommit,
182
265
  getLatestCommitAcrossBranches,
183
- replaceRawWithLatestHash
266
+ replaceRawWithLatestHash,
267
+ resolvePackageResolutionUpdates
184
268
  };
@@ -0,0 +1,61 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import {
3
+ require_package
4
+ } from "./chunk-ZOWVMII3.mjs";
5
+ import {
6
+ __commonJS,
7
+ __dirname,
8
+ __require,
9
+ init_esm_shims
10
+ } from "./chunk-QQ4A6DLD.mjs";
11
+
12
+ // src/binary-collections/listScript.cjs
13
+ var require_listScript = __commonJS({
14
+ "src/binary-collections/listScript.cjs"(exports, module) {
15
+ init_esm_shims();
16
+ var pkgJson = require_package();
17
+ var path = __require("upath");
18
+ var fs = __require("fs-extra");
19
+ function listScript(verbose = false) {
20
+ const keys = Object.keys(pkgJson.bin);
21
+ const results = [];
22
+ for (const scriptName of keys) {
23
+ if (verbose) {
24
+ console.log(`\u{1F50D} Finding script "${scriptName}" -> "${pkgJson.bin[scriptName]}"`);
25
+ }
26
+ const searchDirs = [
27
+ path.join(__dirname, ".."),
28
+ path.join(__dirname, "../.."),
29
+ path.join(process.cwd(), "node_modules/binary-collections"),
30
+ __dirname
31
+ ];
32
+ let scriptPath;
33
+ for (const searchDir of searchDirs) {
34
+ scriptPath = path.join(searchDir, pkgJson.bin[scriptName]);
35
+ if (fs.existsSync(scriptPath)) {
36
+ break;
37
+ }
38
+ }
39
+ if (!fs.existsSync(scriptPath)) {
40
+ console.warn(`\u26A0\uFE0F Script "${scriptName}" defined in package.json not found at ${scriptPath}`);
41
+ } else {
42
+ if (verbose) {
43
+ console.log(`\u2705 Found script "${scriptName}" at ${scriptPath}`);
44
+ }
45
+ results.push({
46
+ name: scriptName,
47
+ path: path.relative(process.cwd(), scriptPath),
48
+ absolutePath: path.resolve(scriptPath)
49
+ });
50
+ }
51
+ }
52
+ return results;
53
+ }
54
+ module.exports = listScript;
55
+ module.exports.default = listScript;
56
+ }
57
+ });
58
+
59
+ export {
60
+ require_listScript
61
+ };
@@ -0,0 +1,32 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import {
3
+ isWindows
4
+ } from "./chunk-XPJGCDOD.mjs";
5
+ import {
6
+ init_esm_shims
7
+ } from "./chunk-QQ4A6DLD.mjs";
8
+
9
+ // src/cross-env/command.ts
10
+ init_esm_shims();
11
+ import path from "path";
12
+ function commandConvert(command, env, normalize = false) {
13
+ if (!isWindows()) {
14
+ return command;
15
+ }
16
+ const simpleEnvRegex = /\$(\w+)|\${(\w+)}/g;
17
+ const defaultValueRegex = /\$\{(\w+):-([^}]+)\}/g;
18
+ let convertedCmd = command;
19
+ convertedCmd = convertedCmd.replace(defaultValueRegex, (match, varName, defaultValue) => {
20
+ const value = env[varName] || defaultValue;
21
+ return value;
22
+ });
23
+ convertedCmd = convertedCmd.replace(simpleEnvRegex, (match, $1, $2) => {
24
+ const varName = $1 || $2;
25
+ return env[varName] ? `%${varName}%` : "";
26
+ });
27
+ return normalize === true ? path.normalize(convertedCmd) : convertedCmd;
28
+ }
29
+
30
+ export {
31
+ commandConvert
32
+ };