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
@@ -0,0 +1,9 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import {
3
+ commandConvert
4
+ } from "../chunk-C6D2TTYU.mjs";
5
+ import "../chunk-XPJGCDOD.mjs";
6
+ import "../chunk-QQ4A6DLD.mjs";
7
+ export {
8
+ commandConvert
9
+ };
@@ -0,0 +1,178 @@
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/cross-env/index.ts
30
+ var cross_env_exports = {};
31
+ __export(cross_env_exports, {
32
+ crossEnv: () => crossEnv
33
+ });
34
+ module.exports = __toCommonJS(cross_env_exports);
35
+ var import_cross_spawn = require("cross-spawn");
36
+
37
+ // src/cross-env/command.ts
38
+ var import_path = __toESM(require("path"), 1);
39
+
40
+ // src/utils/isWindows.js
41
+ function isWindows() {
42
+ return process.platform === "win32" || /^(msys|cygwin)$/.test(process.env.OSTYPE || "");
43
+ }
44
+
45
+ // src/cross-env/command.ts
46
+ function commandConvert(command, env, normalize = false) {
47
+ if (!isWindows()) {
48
+ return command;
49
+ }
50
+ const simpleEnvRegex = /\$(\w+)|\${(\w+)}/g;
51
+ const defaultValueRegex = /\$\{(\w+):-([^}]+)\}/g;
52
+ let convertedCmd = command;
53
+ convertedCmd = convertedCmd.replace(defaultValueRegex, (match, varName, defaultValue) => {
54
+ const value = env[varName] || defaultValue;
55
+ return value;
56
+ });
57
+ convertedCmd = convertedCmd.replace(simpleEnvRegex, (match, $1, $2) => {
58
+ const varName = $1 || $2;
59
+ return env[varName] ? `%${varName}%` : "";
60
+ });
61
+ return normalize === true ? import_path.default.normalize(convertedCmd) : convertedCmd;
62
+ }
63
+
64
+ // src/cross-env/variable.ts
65
+ var pathLikeEnvVarWhitelist = /* @__PURE__ */ new Set(["PATH", "NODE_PATH"]);
66
+ function replaceListDelimiters(varValue, varName = "") {
67
+ const targetSeparator = isWindows() ? ";" : ":";
68
+ if (!pathLikeEnvVarWhitelist.has(varName)) {
69
+ return varValue;
70
+ }
71
+ return varValue.replace(/(\\*):/g, (match, backslashes) => {
72
+ if (backslashes.length % 2) {
73
+ return match.substring(1);
74
+ }
75
+ return backslashes + targetSeparator;
76
+ });
77
+ }
78
+ function resolveEnvVars(varValue) {
79
+ const envUnixRegex = /(\\*)(\$(\w+)|\${(\w+)})/g;
80
+ return varValue.replace(envUnixRegex, (_, escapeChars, varNameWithDollarSign, varName, altVarName) => {
81
+ if (escapeChars.length % 2 === 1) {
82
+ return varNameWithDollarSign;
83
+ }
84
+ return escapeChars.substring(0, escapeChars.length / 2) + (process.env[varName || altVarName] || "");
85
+ });
86
+ }
87
+ function varValueConvert(originalValue, originalName) {
88
+ return resolveEnvVars(replaceListDelimiters(originalValue, originalName));
89
+ }
90
+
91
+ // src/cross-env/index.ts
92
+ var envSetterRegex = /(\w+)=('(.*)'|"(.*)"|(.*))/;
93
+ function crossEnv(args, options = {}) {
94
+ const [envSetters, command, commandArgs] = parseCommand(args);
95
+ const env = getEnvVars(envSetters);
96
+ if (command) {
97
+ const spawnOptions = {
98
+ stdio: "inherit",
99
+ shell: options.shell,
100
+ env
101
+ };
102
+ const proc = (0, import_cross_spawn.spawn)(
103
+ // run `path.normalize` for command(on windows)
104
+ commandConvert(command, env, true),
105
+ // by default normalize is `false`, so not run for cmd args
106
+ commandArgs.map((arg) => commandConvert(arg, env)),
107
+ spawnOptions
108
+ );
109
+ process.on("SIGTERM", () => proc.kill("SIGTERM"));
110
+ process.on("SIGINT", () => proc.kill("SIGINT"));
111
+ process.on("SIGBREAK", () => proc.kill("SIGBREAK"));
112
+ process.on("SIGHUP", () => proc.kill("SIGHUP"));
113
+ proc.on("exit", (code, signal) => {
114
+ let crossEnvExitCode = code;
115
+ if (crossEnvExitCode === null) {
116
+ crossEnvExitCode = signal === "SIGINT" ? 0 : 1;
117
+ }
118
+ process.exit(crossEnvExitCode);
119
+ });
120
+ return proc;
121
+ }
122
+ return null;
123
+ }
124
+ function parseCommand(args) {
125
+ const envSetters = {};
126
+ let command = null;
127
+ let commandArgs = [];
128
+ for (let i = 0; i < args.length; i++) {
129
+ const arg = args[i];
130
+ if (!arg) continue;
131
+ const match = envSetterRegex.exec(arg);
132
+ if (match && match[1]) {
133
+ let value;
134
+ if (typeof match[3] !== "undefined") {
135
+ value = match[3];
136
+ } else if (typeof match[4] === "undefined") {
137
+ value = match[5] || "";
138
+ } else {
139
+ value = match[4];
140
+ }
141
+ envSetters[match[1]] = value;
142
+ } else {
143
+ const cStart = args.slice(i).map((a) => {
144
+ const re = /\\\\|(\\)?'|([\\])(?=[$"\\])/g;
145
+ return a.replace(re, (m) => {
146
+ if (m === "\\\\") return "\\";
147
+ if (m === "\\'") return "'";
148
+ return "";
149
+ });
150
+ });
151
+ const parsedCommand = cStart[0];
152
+ if (!parsedCommand) {
153
+ throw new Error("Command is required");
154
+ }
155
+ command = parsedCommand;
156
+ commandArgs = cStart.slice(1).filter(Boolean);
157
+ break;
158
+ }
159
+ }
160
+ return [envSetters, command, commandArgs];
161
+ }
162
+ function getEnvVars(envSetters) {
163
+ const envVars = { ...process.env };
164
+ if (process.env.APPDATA) {
165
+ envVars.APPDATA = process.env.APPDATA;
166
+ }
167
+ Object.keys(envSetters).forEach((varName) => {
168
+ const value = envSetters[varName];
169
+ if (value !== void 0) {
170
+ envVars[varName] = varValueConvert(value, varName);
171
+ }
172
+ });
173
+ return envVars;
174
+ }
175
+ // Annotate the CommonJS export names for ESM import in node:
176
+ 0 && (module.exports = {
177
+ crossEnv
178
+ });
@@ -0,0 +1,8 @@
1
+ export type CrossEnvOptions = {
2
+ shell?: boolean;
3
+ };
4
+ export type ProcessResult = {
5
+ exitCode: number | null;
6
+ signal?: string | null;
7
+ };
8
+ export declare function crossEnv(args: string[], options?: CrossEnvOptions): ProcessResult | null;
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.crossEnv = crossEnv;
4
+ const cross_spawn_1 = require("cross-spawn");
5
+ const command_js_1 = require("./command.js");
6
+ const variable_js_1 = require("./variable.js");
7
+ const envSetterRegex = /(\w+)=('(.*)'|"(.*)"|(.*))/;
8
+ function crossEnv(args, options = {}) {
9
+ const [envSetters, command, commandArgs] = parseCommand(args);
10
+ const env = getEnvVars(envSetters);
11
+ if (command) {
12
+ const spawnOptions = {
13
+ stdio: 'inherit',
14
+ shell: options.shell,
15
+ env
16
+ };
17
+ const proc = (0, cross_spawn_1.spawn)(
18
+ // run `path.normalize` for command(on windows)
19
+ (0, command_js_1.commandConvert)(command, env, true),
20
+ // by default normalize is `false`, so not run for cmd args
21
+ commandArgs.map((arg) => (0, command_js_1.commandConvert)(arg, env)), spawnOptions);
22
+ process.on('SIGTERM', () => proc.kill('SIGTERM'));
23
+ process.on('SIGINT', () => proc.kill('SIGINT'));
24
+ process.on('SIGBREAK', () => proc.kill('SIGBREAK'));
25
+ process.on('SIGHUP', () => proc.kill('SIGHUP'));
26
+ proc.on('exit', (code, signal) => {
27
+ let crossEnvExitCode = code;
28
+ // exit code could be null when OS kills the process(out of memory, etc) or due to node handling it
29
+ // but if the signal is SIGINT the user exited the process so we want exit code 0
30
+ if (crossEnvExitCode === null) {
31
+ crossEnvExitCode = signal === 'SIGINT' ? 0 : 1;
32
+ }
33
+ process.exit(crossEnvExitCode);
34
+ });
35
+ return proc;
36
+ }
37
+ return null;
38
+ }
39
+ function parseCommand(args) {
40
+ const envSetters = {};
41
+ let command = null;
42
+ let commandArgs = [];
43
+ for (let i = 0; i < args.length; i++) {
44
+ const arg = args[i];
45
+ if (!arg)
46
+ continue;
47
+ const match = envSetterRegex.exec(arg);
48
+ if (match && match[1]) {
49
+ let value;
50
+ if (typeof match[3] !== 'undefined') {
51
+ value = match[3];
52
+ }
53
+ else if (typeof match[4] === 'undefined') {
54
+ value = match[5] || '';
55
+ }
56
+ else {
57
+ value = match[4];
58
+ }
59
+ envSetters[match[1]] = value;
60
+ }
61
+ else {
62
+ // No more env setters, the rest of the line must be the command and args
63
+ const cStart = args
64
+ .slice(i)
65
+ // Regex:
66
+ // match "\'" or "'"
67
+ // or match "\" if followed by [$"\] (lookahead)
68
+ .map((a) => {
69
+ const re = /\\\\|(\\)?'|([\\])(?=[$"\\])/g;
70
+ // Eliminate all matches except for "\'" => "'"
71
+ return a.replace(re, (m) => {
72
+ if (m === '\\\\')
73
+ return '\\';
74
+ if (m === "\\'")
75
+ return "'";
76
+ return '';
77
+ });
78
+ });
79
+ const parsedCommand = cStart[0];
80
+ if (!parsedCommand) {
81
+ throw new Error('Command is required');
82
+ }
83
+ command = parsedCommand;
84
+ commandArgs = cStart.slice(1).filter(Boolean);
85
+ break;
86
+ }
87
+ }
88
+ return [envSetters, command, commandArgs];
89
+ }
90
+ function getEnvVars(envSetters) {
91
+ const envVars = Object.assign({}, process.env);
92
+ if (process.env.APPDATA) {
93
+ envVars.APPDATA = process.env.APPDATA;
94
+ }
95
+ Object.keys(envSetters).forEach((varName) => {
96
+ const value = envSetters[varName];
97
+ if (value !== undefined) {
98
+ envVars[varName] = (0, variable_js_1.varValueConvert)(value, varName);
99
+ }
100
+ });
101
+ return envVars;
102
+ }
@@ -0,0 +1,101 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import {
3
+ commandConvert
4
+ } from "../chunk-C6D2TTYU.mjs";
5
+ import {
6
+ varValueConvert
7
+ } from "../chunk-V2IBPCEV.mjs";
8
+ import "../chunk-XPJGCDOD.mjs";
9
+ import {
10
+ init_esm_shims
11
+ } from "../chunk-QQ4A6DLD.mjs";
12
+
13
+ // src/cross-env/index.ts
14
+ init_esm_shims();
15
+ import { spawn } from "cross-spawn";
16
+ var envSetterRegex = /(\w+)=('(.*)'|"(.*)"|(.*))/;
17
+ function crossEnv(args, options = {}) {
18
+ const [envSetters, command, commandArgs] = parseCommand(args);
19
+ const env = getEnvVars(envSetters);
20
+ if (command) {
21
+ const spawnOptions = {
22
+ stdio: "inherit",
23
+ shell: options.shell,
24
+ env
25
+ };
26
+ const proc = spawn(
27
+ // run `path.normalize` for command(on windows)
28
+ commandConvert(command, env, true),
29
+ // by default normalize is `false`, so not run for cmd args
30
+ commandArgs.map((arg) => commandConvert(arg, env)),
31
+ spawnOptions
32
+ );
33
+ process.on("SIGTERM", () => proc.kill("SIGTERM"));
34
+ process.on("SIGINT", () => proc.kill("SIGINT"));
35
+ process.on("SIGBREAK", () => proc.kill("SIGBREAK"));
36
+ process.on("SIGHUP", () => proc.kill("SIGHUP"));
37
+ proc.on("exit", (code, signal) => {
38
+ let crossEnvExitCode = code;
39
+ if (crossEnvExitCode === null) {
40
+ crossEnvExitCode = signal === "SIGINT" ? 0 : 1;
41
+ }
42
+ process.exit(crossEnvExitCode);
43
+ });
44
+ return proc;
45
+ }
46
+ return null;
47
+ }
48
+ function parseCommand(args) {
49
+ const envSetters = {};
50
+ let command = null;
51
+ let commandArgs = [];
52
+ for (let i = 0; i < args.length; i++) {
53
+ const arg = args[i];
54
+ if (!arg) continue;
55
+ const match = envSetterRegex.exec(arg);
56
+ if (match && match[1]) {
57
+ let value;
58
+ if (typeof match[3] !== "undefined") {
59
+ value = match[3];
60
+ } else if (typeof match[4] === "undefined") {
61
+ value = match[5] || "";
62
+ } else {
63
+ value = match[4];
64
+ }
65
+ envSetters[match[1]] = value;
66
+ } else {
67
+ const cStart = args.slice(i).map((a) => {
68
+ const re = /\\\\|(\\)?'|([\\])(?=[$"\\])/g;
69
+ return a.replace(re, (m) => {
70
+ if (m === "\\\\") return "\\";
71
+ if (m === "\\'") return "'";
72
+ return "";
73
+ });
74
+ });
75
+ const parsedCommand = cStart[0];
76
+ if (!parsedCommand) {
77
+ throw new Error("Command is required");
78
+ }
79
+ command = parsedCommand;
80
+ commandArgs = cStart.slice(1).filter(Boolean);
81
+ break;
82
+ }
83
+ }
84
+ return [envSetters, command, commandArgs];
85
+ }
86
+ function getEnvVars(envSetters) {
87
+ const envVars = { ...process.env };
88
+ if (process.env.APPDATA) {
89
+ envVars.APPDATA = process.env.APPDATA;
90
+ }
91
+ Object.keys(envSetters).forEach((varName) => {
92
+ const value = envSetters[varName];
93
+ if (value !== void 0) {
94
+ envVars[varName] = varValueConvert(value, varName);
95
+ }
96
+ });
97
+ return envVars;
98
+ }
99
+ export {
100
+ crossEnv
101
+ };
@@ -0,0 +1,60 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/cross-env/variable.ts
20
+ var variable_exports = {};
21
+ __export(variable_exports, {
22
+ varValueConvert: () => varValueConvert
23
+ });
24
+ module.exports = __toCommonJS(variable_exports);
25
+
26
+ // src/utils/isWindows.js
27
+ function isWindows() {
28
+ return process.platform === "win32" || /^(msys|cygwin)$/.test(process.env.OSTYPE || "");
29
+ }
30
+
31
+ // src/cross-env/variable.ts
32
+ var pathLikeEnvVarWhitelist = /* @__PURE__ */ new Set(["PATH", "NODE_PATH"]);
33
+ function replaceListDelimiters(varValue, varName = "") {
34
+ const targetSeparator = isWindows() ? ";" : ":";
35
+ if (!pathLikeEnvVarWhitelist.has(varName)) {
36
+ return varValue;
37
+ }
38
+ return varValue.replace(/(\\*):/g, (match, backslashes) => {
39
+ if (backslashes.length % 2) {
40
+ return match.substring(1);
41
+ }
42
+ return backslashes + targetSeparator;
43
+ });
44
+ }
45
+ function resolveEnvVars(varValue) {
46
+ const envUnixRegex = /(\\*)(\$(\w+)|\${(\w+)})/g;
47
+ return varValue.replace(envUnixRegex, (_, escapeChars, varNameWithDollarSign, varName, altVarName) => {
48
+ if (escapeChars.length % 2 === 1) {
49
+ return varNameWithDollarSign;
50
+ }
51
+ return escapeChars.substring(0, escapeChars.length / 2) + (process.env[varName || altVarName] || "");
52
+ });
53
+ }
54
+ function varValueConvert(originalValue, originalName) {
55
+ return resolveEnvVars(replaceListDelimiters(originalValue, originalName));
56
+ }
57
+ // Annotate the CommonJS export names for ESM import in node:
58
+ 0 && (module.exports = {
59
+ varValueConvert
60
+ });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Converts an environment variable value to be appropriate for the current OS.
3
+ * @param originalValue Original value of the env variable
4
+ * @param originalName Original name of the env variable
5
+ * @returns Converted value
6
+ */
7
+ export declare function varValueConvert(originalValue: string, originalName: string): string;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.varValueConvert = varValueConvert;
4
+ const isWindows_js_1 = require("../utils/isWindows.js");
5
+ const pathLikeEnvVarWhitelist = new Set(['PATH', 'NODE_PATH']);
6
+ /**
7
+ * This will transform UNIX-style list values to Windows-style.
8
+ * For example, the value of the $PATH variable "/usr/bin:/usr/local/bin:."
9
+ * will become "/usr/bin;/usr/local/bin;." on Windows.
10
+ * @param varValue Original value of the env variable
11
+ * @param varName Original name of the env variable
12
+ * @returns Converted value
13
+ */
14
+ function replaceListDelimiters(varValue, varName = '') {
15
+ const targetSeparator = (0, isWindows_js_1.isWindows)() ? ';' : ':';
16
+ if (!pathLikeEnvVarWhitelist.has(varName)) {
17
+ return varValue;
18
+ }
19
+ return varValue.replace(/(\\*):/g, (match, backslashes) => {
20
+ if (backslashes.length % 2) {
21
+ // Odd number of backslashes preceding it means it's escaped,
22
+ // remove 1 backslash and return the rest as-is
23
+ return match.substring(1);
24
+ }
25
+ return backslashes + targetSeparator;
26
+ });
27
+ }
28
+ /**
29
+ * This will attempt to resolve the value of any env variables that are inside
30
+ * this string. For example, it will transform this:
31
+ * cross-env FOO=$NODE_ENV BAR=\\$NODE_ENV echo $FOO $BAR
32
+ * Into this:
33
+ * FOO=development BAR=$NODE_ENV echo $FOO
34
+ * (Or whatever value the variable NODE_ENV has)
35
+ * Note that this function is only called with the right-side portion of the
36
+ * env var assignment, so in that example, this function would transform
37
+ * the string "$NODE_ENV" into "development"
38
+ * @param varValue Original value of the env variable
39
+ * @returns Converted value
40
+ */
41
+ function resolveEnvVars(varValue) {
42
+ const envUnixRegex = /(\\*)(\$(\w+)|\${(\w+)})/g; // $my_var or ${my_var} or \$my_var
43
+ return varValue.replace(envUnixRegex, (_, escapeChars, varNameWithDollarSign, varName, altVarName) => {
44
+ // do not replace things preceded by a odd number of \
45
+ if (escapeChars.length % 2 === 1) {
46
+ return varNameWithDollarSign;
47
+ }
48
+ return escapeChars.substring(0, escapeChars.length / 2) + (process.env[varName || altVarName] || '');
49
+ });
50
+ }
51
+ /**
52
+ * Converts an environment variable value to be appropriate for the current OS.
53
+ * @param originalValue Original value of the env variable
54
+ * @param originalName Original name of the env variable
55
+ * @returns Converted value
56
+ */
57
+ function varValueConvert(originalValue, originalName) {
58
+ return resolveEnvVars(replaceListDelimiters(originalValue, originalName));
59
+ }
@@ -0,0 +1,9 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import {
3
+ varValueConvert
4
+ } from "../chunk-V2IBPCEV.mjs";
5
+ import "../chunk-XPJGCDOD.mjs";
6
+ import "../chunk-QQ4A6DLD.mjs";
7
+ export {
8
+ varValueConvert
9
+ };
@@ -88,7 +88,7 @@ var require_utils = __commonJS({
88
88
  try {
89
89
  fs.rmdirSync(fullPath);
90
90
  console.log("deleted", fullPath);
91
- } catch (e) {
91
+ } catch (_e) {
92
92
  try {
93
93
  fs.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
  fs.unlinkSync(fullPath);
103
103
  console.log("deleted", fullPath);
104
- } catch (e) {
104
+ } catch (_e) {
105
105
  try {
106
106
  fs.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
107
107
  console.log("deleted", fullPath);
package/lib/del-gradle.js CHANGED
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
- const glob = require("glob");
3
- const path = require("upath");
4
- const { del } = require("./utils/index.cjs");
5
- const globStream = new glob.Glob(["**/build.gradle"], {
2
+ const glob = require('glob');
3
+ const path = require('upath');
4
+ const { del } = require('./utils/index.cjs');
5
+ const globStream = new glob.Glob(['**/build.gradle'], {
6
6
  withFileTypes: false,
7
7
  cwd: process.cwd(),
8
- ignore: ["**/node_modules/**", "**/vendor/**"]
8
+ ignore: ['**/node_modules/**', '**/vendor/**']
9
9
  });
10
- globStream.stream().on("data", (result) => {
10
+ globStream.stream().on('data', (result) => {
11
11
  const fullPath = path.resolve(process.cwd(), result);
12
12
  const base = path.dirname(fullPath);
13
- const buildFolder = path.join(base, "build");
14
- console.log("delete build folder", buildFolder);
13
+ const buildFolder = path.join(base, 'build');
14
+ console.log('delete build folder', buildFolder);
15
15
  del(buildFolder);
16
16
  });
@@ -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
  __require,
7
7
  init_esm_shims