@maizzle/framework 6.0.0-rc.21 → 6.0.0-rc.23

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 (242) hide show
  1. package/dist/build.d.ts.map +1 -1
  2. package/dist/build.js +11 -0
  3. package/dist/build.js.map +1 -1
  4. package/dist/components/Body.vue +1 -1
  5. package/dist/components/CodeBlock.vue +1 -1
  6. package/dist/components/CodeInline.vue +72 -2
  7. package/dist/components/Column.vue +2 -1
  8. package/dist/components/Container.vue +1 -11
  9. package/dist/components/Heading.vue +1 -1
  10. package/dist/components/Img.vue +252 -7
  11. package/dist/components/Link.vue +1 -1
  12. package/dist/components/Preheader.vue +35 -5
  13. package/dist/components/Section.vue +9 -14
  14. package/dist/components/Tailwind.vue +4 -2
  15. package/dist/components/Text.vue +2 -2
  16. package/dist/components/Vml.vue +354 -0
  17. package/dist/components/utils.d.ts.map +1 -1
  18. package/dist/components/utils.js.map +1 -1
  19. package/dist/composables/defineConfig.d.ts +3 -4
  20. package/dist/composables/defineConfig.d.ts.map +1 -1
  21. package/dist/composables/defineConfig.js +3 -4
  22. package/dist/composables/defineConfig.js.map +1 -1
  23. package/dist/composables/renderContext.d.ts +0 -1
  24. package/dist/composables/renderContext.d.ts.map +1 -1
  25. package/dist/composables/renderContext.js.map +1 -1
  26. package/dist/composables/useBaseUrl.d.ts.map +1 -1
  27. package/dist/composables/useBaseUrl.js.map +1 -1
  28. package/dist/composables/useConfig.d.ts.map +1 -1
  29. package/dist/composables/useConfig.js.map +1 -1
  30. package/dist/composables/useCurrentTemplate.d.ts.map +1 -1
  31. package/dist/composables/useCurrentTemplate.js +10 -3
  32. package/dist/composables/useCurrentTemplate.js.map +1 -1
  33. package/dist/composables/useDoctype.d.ts.map +1 -1
  34. package/dist/composables/useDoctype.js.map +1 -1
  35. package/dist/composables/useEvent.js.map +1 -1
  36. package/dist/composables/useFont.d.ts.map +1 -1
  37. package/dist/composables/useFont.js.map +1 -1
  38. package/dist/composables/useOutlookFallback.d.ts.map +1 -1
  39. package/dist/composables/useOutlookFallback.js.map +1 -1
  40. package/dist/composables/usePlaintext.d.ts.map +1 -1
  41. package/dist/composables/usePlaintext.js.map +1 -1
  42. package/dist/composables/usePreheader.d.ts +6 -5
  43. package/dist/composables/usePreheader.d.ts.map +1 -1
  44. package/dist/composables/usePreheader.js +3 -3
  45. package/dist/composables/usePreheader.js.map +1 -1
  46. package/dist/composables/useTransformers.d.ts +1 -1
  47. package/dist/composables/useTransformers.d.ts.map +1 -1
  48. package/dist/composables/useTransformers.js +1 -1
  49. package/dist/composables/useTransformers.js.map +1 -1
  50. package/dist/composables/useUrlQuery.d.ts.map +1 -1
  51. package/dist/composables/useUrlQuery.js.map +1 -1
  52. package/dist/config/defaults.d.ts.map +1 -1
  53. package/dist/config/defaults.js.map +1 -1
  54. package/dist/config/index.js +12 -0
  55. package/dist/config/index.js.map +1 -1
  56. package/dist/events/index.d.ts +5 -0
  57. package/dist/events/index.d.ts.map +1 -1
  58. package/dist/events/index.js +5 -0
  59. package/dist/events/index.js.map +1 -1
  60. package/dist/index.d.ts +2 -2
  61. package/dist/index.js +2 -2
  62. package/dist/plaintext.d.ts.map +1 -1
  63. package/dist/plaintext.js.map +1 -1
  64. package/dist/plugin.js.map +1 -1
  65. package/dist/plugins/postcss/mergeMediaQueries.d.ts.map +1 -1
  66. package/dist/plugins/postcss/mergeMediaQueries.js.map +1 -1
  67. package/dist/plugins/postcss/pruneVars.d.ts.map +1 -1
  68. package/dist/plugins/postcss/pruneVars.js.map +1 -1
  69. package/dist/plugins/postcss/quoteFontFamilies.d.ts.map +1 -1
  70. package/dist/plugins/postcss/quoteFontFamilies.js.map +1 -1
  71. package/dist/plugins/postcss/removeDeclarations.d.ts.map +1 -1
  72. package/dist/plugins/postcss/removeDeclarations.js.map +1 -1
  73. package/dist/plugins/postcss/resolveMaizzleImports.d.ts.map +1 -1
  74. package/dist/plugins/postcss/resolveMaizzleImports.js.map +1 -1
  75. package/dist/plugins/postcss/resolveProps.d.ts.map +1 -1
  76. package/dist/plugins/postcss/resolveProps.js +14 -0
  77. package/dist/plugins/postcss/resolveProps.js.map +1 -1
  78. package/dist/plugins/postcss/tailwindCleanup.d.ts.map +1 -1
  79. package/dist/plugins/postcss/tailwindCleanup.js.map +1 -1
  80. package/dist/prepare.d.ts.map +1 -1
  81. package/dist/prepare.js.map +1 -1
  82. package/dist/render/active.d.ts.map +1 -1
  83. package/dist/render/active.js.map +1 -1
  84. package/dist/render/createRenderer.d.ts.map +1 -1
  85. package/dist/render/createRenderer.js +91 -3
  86. package/dist/render/createRenderer.js.map +1 -1
  87. package/dist/render/index.d.ts.map +1 -1
  88. package/dist/render/index.js +6 -0
  89. package/dist/render/index.js.map +1 -1
  90. package/dist/render/injectFonts.js.map +1 -1
  91. package/dist/render/plugins/codeBlockExtract.d.ts.map +1 -1
  92. package/dist/render/plugins/codeBlockExtract.js +4 -0
  93. package/dist/render/plugins/codeBlockExtract.js.map +1 -1
  94. package/dist/render/plugins/markdownExtract.d.ts.map +1 -1
  95. package/dist/render/plugins/markdownExtract.js.map +1 -1
  96. package/dist/render/plugins/rawExtract.d.ts.map +1 -1
  97. package/dist/render/plugins/rawExtract.js.map +1 -1
  98. package/dist/render/plugins/rowSourceLocation.d.ts.map +1 -1
  99. package/dist/render/plugins/rowSourceLocation.js.map +1 -1
  100. package/dist/serve.d.ts.map +1 -1
  101. package/dist/serve.js +48 -15
  102. package/dist/serve.js.map +1 -1
  103. package/dist/server/compatibility.d.ts.map +1 -1
  104. package/dist/server/compatibility.js +48 -0
  105. package/dist/server/compatibility.js.map +1 -1
  106. package/dist/server/email.js.map +1 -1
  107. package/dist/server/linter.js +6 -0
  108. package/dist/server/linter.js.map +1 -1
  109. package/dist/server/sfc-utils.d.ts.map +1 -1
  110. package/dist/server/sfc-utils.js.map +1 -1
  111. package/dist/server/ui/App.vue +17 -16
  112. package/dist/server/ui/components/Markdown.vue +17 -0
  113. package/dist/server/ui/components/SidebarClose.vue +1 -1
  114. package/dist/server/ui/components/ui/checkbox/Checkbox.vue +1 -1
  115. package/dist/server/ui/components/ui/command/CommandInput.vue +2 -2
  116. package/dist/server/ui/components/ui/dialog/DialogContent.vue +1 -1
  117. package/dist/server/ui/components/ui/dialog/DialogScrollContent.vue +1 -1
  118. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +1 -1
  119. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +1 -1
  120. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +1 -1
  121. package/dist/server/ui/components/ui/sheet/SheetContent.vue +1 -1
  122. package/dist/server/ui/components/ui/sidebar/SidebarTrigger.vue +1 -1
  123. package/dist/server/ui/components/ui/tags-input/TagsInputItemDelete.vue +1 -1
  124. package/dist/server/ui/lib/emulated-dark-mode.ts +25 -10
  125. package/dist/server/ui/pages/Home.vue +1 -1
  126. package/dist/server/ui/pages/Preview.vue +32 -18
  127. package/dist/tests/render/_helpers.js.map +1 -1
  128. package/dist/transformers/addAttributes.d.ts +18 -8
  129. package/dist/transformers/addAttributes.d.ts.map +1 -1
  130. package/dist/transformers/addAttributes.js +22 -8
  131. package/dist/transformers/addAttributes.js.map +1 -1
  132. package/dist/transformers/attributeToStyle.d.ts.map +1 -1
  133. package/dist/transformers/attributeToStyle.js.map +1 -1
  134. package/dist/transformers/base.d.ts.map +1 -1
  135. package/dist/transformers/base.js +4 -0
  136. package/dist/transformers/base.js.map +1 -1
  137. package/dist/transformers/columnWidth.d.ts.map +1 -1
  138. package/dist/transformers/columnWidth.js +136 -150
  139. package/dist/transformers/columnWidth.js.map +1 -1
  140. package/dist/transformers/entities.d.ts.map +1 -1
  141. package/dist/transformers/entities.js +1 -0
  142. package/dist/transformers/entities.js.map +1 -1
  143. package/dist/transformers/filters/defaults.d.ts.map +1 -1
  144. package/dist/transformers/filters/defaults.js.map +1 -1
  145. package/dist/transformers/filters/index.d.ts.map +1 -1
  146. package/dist/transformers/filters/index.js.map +1 -1
  147. package/dist/transformers/format.d.ts.map +1 -1
  148. package/dist/transformers/format.js.map +1 -1
  149. package/dist/transformers/index.d.ts.map +1 -1
  150. package/dist/transformers/index.js +33 -5
  151. package/dist/transformers/index.js.map +1 -1
  152. package/dist/transformers/inlineCss.d.ts.map +1 -1
  153. package/dist/transformers/inlineCss.js +27 -9
  154. package/dist/transformers/inlineCss.js.map +1 -1
  155. package/dist/transformers/inlineLink.d.ts.map +1 -1
  156. package/dist/transformers/inlineLink.js.map +1 -1
  157. package/dist/transformers/minify.d.ts.map +1 -1
  158. package/dist/transformers/minify.js.map +1 -1
  159. package/dist/transformers/minifyCodeInline.d.ts +29 -0
  160. package/dist/transformers/minifyCodeInline.d.ts.map +1 -0
  161. package/dist/transformers/minifyCodeInline.js +36 -0
  162. package/dist/transformers/minifyCodeInline.js.map +1 -0
  163. package/dist/transformers/msoPlaceholders.d.ts +10 -5
  164. package/dist/transformers/msoPlaceholders.d.ts.map +1 -1
  165. package/dist/transformers/msoPlaceholders.js +38 -7
  166. package/dist/transformers/msoPlaceholders.js.map +1 -1
  167. package/dist/transformers/purgeCss.d.ts.map +1 -1
  168. package/dist/transformers/purgeCss.js +29 -3
  169. package/dist/transformers/purgeCss.js.map +1 -1
  170. package/dist/transformers/removeAttributes.d.ts.map +1 -1
  171. package/dist/transformers/removeAttributes.js.map +1 -1
  172. package/dist/transformers/replaceStrings.d.ts.map +1 -1
  173. package/dist/transformers/replaceStrings.js.map +1 -1
  174. package/dist/transformers/safeSelectors.d.ts +37 -0
  175. package/dist/transformers/safeSelectors.d.ts.map +1 -0
  176. package/dist/transformers/{safeClassNames.js → safeSelectors.js} +37 -6
  177. package/dist/transformers/safeSelectors.js.map +1 -0
  178. package/dist/transformers/shorthandCss.d.ts.map +1 -1
  179. package/dist/transformers/shorthandCss.js +38 -7
  180. package/dist/transformers/shorthandCss.js.map +1 -1
  181. package/dist/transformers/sixHex.d.ts.map +1 -1
  182. package/dist/transformers/sixHex.js.map +1 -1
  183. package/dist/transformers/tailwindComponent.js +9 -0
  184. package/dist/transformers/tailwindComponent.js.map +1 -1
  185. package/dist/transformers/tailwindcss.d.ts.map +1 -1
  186. package/dist/transformers/tailwindcss.js +22 -0
  187. package/dist/transformers/tailwindcss.js.map +1 -1
  188. package/dist/transformers/urlQuery.d.ts.map +1 -1
  189. package/dist/transformers/urlQuery.js.map +1 -1
  190. package/dist/types/config.d.ts +6 -10
  191. package/dist/types/config.d.ts.map +1 -1
  192. package/dist/types/index.d.ts +1 -1
  193. package/dist/utils/ast/parser.d.ts.map +1 -1
  194. package/dist/utils/ast/parser.js.map +1 -1
  195. package/dist/utils/ast/serializer.d.ts.map +1 -1
  196. package/dist/utils/ast/serializer.js +27 -17
  197. package/dist/utils/ast/serializer.js.map +1 -1
  198. package/dist/utils/ast/walker.d.ts.map +1 -1
  199. package/dist/utils/ast/walker.js.map +1 -1
  200. package/dist/utils/compileTailwindCss.d.ts.map +1 -1
  201. package/dist/utils/compileTailwindCss.js.map +1 -1
  202. package/dist/utils/componentSources.d.ts.map +1 -1
  203. package/dist/utils/componentSources.js.map +1 -1
  204. package/dist/utils/cssBox.d.ts +42 -0
  205. package/dist/utils/cssBox.d.ts.map +1 -0
  206. package/dist/utils/cssBox.js +156 -0
  207. package/dist/utils/cssBox.js.map +1 -0
  208. package/dist/utils/decodeStyleEntities.d.ts.map +1 -1
  209. package/dist/utils/decodeStyleEntities.js.map +1 -1
  210. package/dist/utils/detect.d.ts.map +1 -1
  211. package/dist/utils/detect.js.map +1 -1
  212. package/dist/utils/output-markers.d.ts.map +1 -1
  213. package/dist/utils/output-markers.js.map +1 -1
  214. package/dist/utils/url.d.ts.map +1 -1
  215. package/dist/utils/url.js.map +1 -1
  216. package/dist/utils/watchPaths.js.map +1 -1
  217. package/node_modules/@clack/core/CHANGELOG.md +6 -0
  218. package/node_modules/@clack/core/dist/index.d.mts +1 -1
  219. package/node_modules/@clack/core/dist/index.mjs +8 -8
  220. package/node_modules/@clack/core/dist/index.mjs.map +1 -1
  221. package/node_modules/@clack/core/package.json +1 -1
  222. package/node_modules/@clack/prompts/CHANGELOG.md +13 -0
  223. package/node_modules/@clack/prompts/README.md +2 -2
  224. package/node_modules/@clack/prompts/dist/index.d.mts +98 -0
  225. package/node_modules/@clack/prompts/dist/index.mjs +122 -121
  226. package/node_modules/@clack/prompts/dist/index.mjs.map +1 -1
  227. package/node_modules/@clack/prompts/package.json +2 -2
  228. package/node_modules/fast-wrap-ansi/lib/main.js +0 -1
  229. package/node_modules/fast-wrap-ansi/package.json +10 -10
  230. package/node_modules/maizzle/dist/commands/make/config.mjs +7 -6
  231. package/node_modules/maizzle/dist/commands/new.mjs +15 -84
  232. package/node_modules/maizzle/package.json +2 -2
  233. package/node_modules/tinyexec/README.md +8 -0
  234. package/node_modules/tinyexec/dist/main.d.mts +16 -1
  235. package/node_modules/tinyexec/dist/main.mjs +163 -457
  236. package/node_modules/tinyexec/package.json +12 -14
  237. package/package.json +3 -4
  238. package/dist/transformers/safeClassNames.d.ts +0 -22
  239. package/dist/transformers/safeClassNames.d.ts.map +0 -1
  240. package/dist/transformers/safeClassNames.js.map +0 -1
  241. package/node_modules/fast-wrap-ansi/lib/main.js.map +0 -1
  242. package/node_modules/tinyexec/dist/LICENSES.txt +0 -83
@@ -1,42 +1,38 @@
1
- import { createRequire as e } from "node:module";
2
- import { spawn as t, spawnSync as n } from "node:child_process";
3
- import { cwd as r } from "node:process";
4
- import { delimiter as i, dirname as a, resolve as o } from "node:path";
5
- import { pipeline as s } from "node:stream/promises";
6
- import { PassThrough as c } from "node:stream";
7
- import l from "node:readline";
8
- //#region \0rolldown/runtime.js
9
- var u = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports);
10
- var d = /* @__PURE__ */ e(import.meta.url);
11
- //#endregion
1
+ import { spawn as e, spawnSync as t } from "node:child_process";
2
+ import { cwd as n } from "node:process";
3
+ import { basename as r, delimiter as i, dirname as a, normalize as o, resolve as s } from "node:path";
4
+ import { pipeline as c } from "node:stream/promises";
5
+ import { PassThrough as l } from "node:stream";
6
+ import u from "node:readline";
7
+ import { closeSync as d, openSync as f, readSync as p, statSync as m } from "node:fs";
12
8
  //#region src/env.ts
13
- const f = /^path$/i;
14
- const p = {
9
+ const h = /^path$/i;
10
+ const g = {
15
11
  key: "PATH",
16
12
  value: ""
17
13
  };
18
- function m(e) {
14
+ function _(e) {
19
15
  for (const t in e) {
20
- if (!Object.prototype.hasOwnProperty.call(e, t) || !f.test(t)) continue;
16
+ if (!Object.prototype.hasOwnProperty.call(e, t) || !h.test(t)) continue;
21
17
  const n = e[t];
22
- if (!n) return p;
18
+ if (!n) return g;
23
19
  return {
24
20
  key: t,
25
21
  value: n
26
22
  };
27
23
  }
28
- return p;
24
+ return g;
29
25
  }
30
- function h(e, t) {
26
+ function v(e, t) {
31
27
  const n = t.value.split(i);
32
28
  const r = [];
33
- let s = e;
29
+ let o = e;
34
30
  let c;
35
31
  do {
36
- r.push(o(s, "node_modules", ".bin"));
37
- c = s;
38
- s = a(s);
39
- } while (s !== c);
32
+ r.push(s(o, "node_modules", ".bin"));
33
+ c = o;
34
+ o = a(o);
35
+ } while (o !== c);
40
36
  r.push(a(process.execPath));
41
37
  const l = r.concat(n).join(i);
42
38
  return {
@@ -44,426 +40,136 @@ function h(e, t) {
44
40
  value: l
45
41
  };
46
42
  }
47
- function g(e, t) {
48
- const n = {
43
+ function y(e, t, n = true) {
44
+ const r = {
49
45
  ...process.env,
50
46
  ...t
51
47
  };
52
- const r = h(e, m(n));
53
- n[r.key] = r.value;
54
- return n;
48
+ if (!n) return r;
49
+ const i = v(e, _(r));
50
+ r[i.key] = i.value;
51
+ return r;
55
52
  }
56
53
  //#endregion
57
54
  //#region src/stream.ts
58
- const _ = (e) => {
55
+ const b = (e) => {
59
56
  let t = e.length;
60
- const n = new c();
57
+ const n = new l();
61
58
  const r = () => {
62
59
  if (--t === 0) n.end();
63
60
  };
64
- for (const t of e) s(t, n, { end: false }).then(r).catch(r);
61
+ for (const t of e) c(t, n, { end: false }).then(r).catch(r);
65
62
  return n;
66
63
  };
67
64
  //#endregion
68
- //#region node_modules/isexe/windows.js
69
- var v = /* @__PURE__ */ u(((e, t) => {
70
- t.exports = a;
71
- a.sync = o;
72
- var n = d("fs");
73
- function r(e, t) {
74
- var n = t.pathExt !== void 0 ? t.pathExt : process.env.PATHEXT;
75
- if (!n) return true;
76
- n = n.split(";");
77
- if (n.indexOf("") !== -1) return true;
78
- for (var r = 0; r < n.length; r++) {
79
- var i = n[r].toLowerCase();
80
- if (i && e.substr(-i.length).toLowerCase() === i) return true;
81
- }
82
- return false;
83
- }
84
- function i(e, t, n) {
85
- if (!e.isSymbolicLink() && !e.isFile()) return false;
86
- return r(t, n);
87
- }
88
- function a(e, t, r) {
89
- n.stat(e, function(n, a) {
90
- r(n, n ? false : i(a, e, t));
91
- });
92
- }
93
- function o(e, t) {
94
- return i(n.statSync(e), e, t);
95
- }
96
- }));
97
- //#endregion
98
- //#region node_modules/isexe/mode.js
99
- var y = /* @__PURE__ */ u(((e, t) => {
100
- t.exports = r;
101
- r.sync = i;
102
- var n = d("fs");
103
- function r(e, t, r) {
104
- n.stat(e, function(e, n) {
105
- r(e, e ? false : a(n, t));
106
- });
107
- }
108
- function i(e, t) {
109
- return a(n.statSync(e), t);
110
- }
111
- function a(e, t) {
112
- return e.isFile() && o(e, t);
113
- }
114
- function o(e, t) {
115
- var n = e.mode;
116
- var r = e.uid;
117
- var i = e.gid;
118
- var a = t.uid !== void 0 ? t.uid : process.getuid && process.getuid();
119
- var o = t.gid !== void 0 ? t.gid : process.getgid && process.getgid();
120
- var s = parseInt("100", 8);
121
- var c = parseInt("010", 8);
122
- var l = parseInt("001", 8);
123
- var u = s | c;
124
- return n & l || n & c && i === o || n & s && r === a || n & u && a === 0;
125
- }
126
- }));
127
- //#endregion
128
- //#region node_modules/isexe/index.js
129
- var b = /* @__PURE__ */ u(((e, t) => {
130
- d("fs");
131
- var n;
132
- if (process.platform === "win32" || global.TESTING_WINDOWS) n = v();
133
- else n = y();
134
- t.exports = r;
135
- r.sync = i;
136
- function r(e, t, i) {
137
- if (typeof t === "function") {
138
- i = t;
139
- t = {};
140
- }
141
- if (!i) {
142
- if (typeof Promise !== "function") throw new TypeError("callback not provided");
143
- return new Promise(function(n, i) {
144
- r(e, t || {}, function(e, t) {
145
- if (e) i(e);
146
- else n(t);
147
- });
148
- });
149
- }
150
- n(e, t || {}, function(e, n) {
151
- if (e) {
152
- if (e.code === "EACCES" || t && t.ignoreErrors) {
153
- e = null;
154
- n = false;
155
- }
156
- }
157
- i(e, n);
158
- });
159
- }
160
- function i(e, t) {
161
- try {
162
- return n.sync(e, t || {});
163
- } catch (e) {
164
- if (t && t.ignoreErrors || e.code === "EACCES") return false;
165
- else throw e;
166
- }
167
- }
168
- }));
169
- //#endregion
170
- //#region node_modules/which/which.js
171
- var x = /* @__PURE__ */ u(((e, t) => {
172
- const n = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
173
- const r = d("path");
174
- const i = n ? ";" : ":";
175
- const a = b();
176
- const o = (e) => Object.assign(/* @__PURE__ */ new Error(`not found: ${e}`), { code: "ENOENT" });
177
- const s = (e, t) => {
178
- const r = t.colon || i;
179
- const a = e.match(/\//) || n && e.match(/\\/) ? [""] : [...n ? [process.cwd()] : [], ...(t.path || process.env.PATH || "").split(r)];
180
- const o = n ? t.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
181
- const s = n ? o.split(r) : [""];
182
- if (n) {
183
- if (e.indexOf(".") !== -1 && s[0] !== "") s.unshift("");
184
- }
185
- return {
186
- pathEnv: a,
187
- pathExt: s,
188
- pathExtExe: o
189
- };
190
- };
191
- const c = (e, t, n) => {
192
- if (typeof t === "function") {
193
- n = t;
194
- t = {};
195
- }
196
- if (!t) t = {};
197
- const { pathEnv: i, pathExt: c, pathExtExe: l } = s(e, t);
198
- const u = [];
199
- const d = (n) => new Promise((a, s) => {
200
- if (n === i.length) return t.all && u.length ? a(u) : s(o(e));
201
- const c = i[n];
202
- const l = /^".*"$/.test(c) ? c.slice(1, -1) : c;
203
- const d = r.join(l, e);
204
- a(f(!l && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + d : d, n, 0));
205
- });
206
- const f = (e, n, r) => new Promise((i, o) => {
207
- if (r === c.length) return i(d(n + 1));
208
- const s = c[r];
209
- a(e + s, { pathExt: l }, (a, o) => {
210
- if (!a && o) if (t.all) u.push(e + s);
211
- else return i(e + s);
212
- return i(f(e, n, r + 1));
213
- });
214
- });
215
- return n ? d(0).then((e) => n(null, e), n) : d(0);
216
- };
217
- const l = (e, t) => {
218
- t = t || {};
219
- const { pathEnv: n, pathExt: i, pathExtExe: c } = s(e, t);
220
- const l = [];
221
- for (let o = 0; o < n.length; o++) {
222
- const s = n[o];
223
- const u = /^".*"$/.test(s) ? s.slice(1, -1) : s;
224
- const d = r.join(u, e);
225
- const f = !u && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + d : d;
226
- for (let e = 0; e < i.length; e++) {
227
- const n = f + i[e];
228
- try {
229
- if (a.sync(n, { pathExt: c })) if (t.all) l.push(n);
230
- else return n;
231
- } catch (e) {}
232
- }
233
- }
234
- if (t.all && l.length) return l;
235
- if (t.nothrow) return null;
236
- throw o(e);
237
- };
238
- t.exports = c;
239
- c.sync = l;
240
- }));
241
- //#endregion
242
- //#region node_modules/path-key/index.js
243
- var S = /* @__PURE__ */ u(((e, t) => {
244
- const n = (e = {}) => {
245
- const t = e.env || process.env;
246
- if ((e.platform || process.platform) !== "win32") return "PATH";
247
- return Object.keys(t).reverse().find((e) => e.toUpperCase() === "PATH") || "Path";
65
+ //#region src/normalize.ts
66
+ const x = /([()\][%!^"`<>&|;, *?])/g;
67
+ const S = /^#!\s*(.+)/;
68
+ const C = /\.(?:com|exe)$/i;
69
+ const w = /node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i;
70
+ const T = process.platform === "win32";
71
+ const E = [
72
+ ".EXE",
73
+ ".CMD",
74
+ ".BAT",
75
+ ".COM"
76
+ ];
77
+ /**
78
+ * Normalizes the command and arguments to work cross-platform.
79
+ * On Windows, this basically handles things like shebangs, calling
80
+ * `node_modules/.bin` commands, and escaping meta characters.
81
+ * On other platforms, it just returns the command and arguments as-is.
82
+ */
83
+ function D(e, t = [], n = {}) {
84
+ if (n.shell === true || !T) return {
85
+ command: e,
86
+ args: t,
87
+ options: n
248
88
  };
249
- t.exports = n;
250
- t.exports.default = n;
251
- }));
252
- //#endregion
253
- //#region node_modules/cross-spawn/lib/util/resolveCommand.js
254
- var C = /* @__PURE__ */ u(((e, t) => {
255
- const n = d("path");
256
- const r = x();
257
- const i = S();
258
- function a(e, t) {
259
- const a = e.options.env || process.env;
260
- const o = process.cwd();
261
- const s = e.options.cwd != null;
262
- const c = s && process.chdir !== void 0 && !process.chdir.disabled;
263
- if (c) try {
264
- process.chdir(e.options.cwd);
265
- } catch (e) {}
266
- let l;
89
+ let i = O(e, n);
90
+ let a = null;
91
+ if (i !== null) {
92
+ const e = 150;
93
+ const t = Buffer.alloc(e);
94
+ let n = null;
267
95
  try {
268
- l = r.sync(e.command, {
269
- path: a[i({ env: a })],
270
- pathExt: t ? n.delimiter : void 0
271
- });
272
- } catch (e) {} finally {
273
- if (c) process.chdir(o);
274
- }
275
- if (l) l = n.resolve(s ? e.options.cwd : "", l);
276
- return l;
277
- }
278
- function o(e) {
279
- return a(e) || a(e, true);
280
- }
281
- t.exports = o;
282
- }));
283
- //#endregion
284
- //#region node_modules/cross-spawn/lib/util/escape.js
285
- var w = /* @__PURE__ */ u(((e, t) => {
286
- const n = /([()\][%!^"`<>&|;, *?])/g;
287
- function r(e) {
288
- e = e.replace(n, "^$1");
289
- return e;
290
- }
291
- function i(e, t) {
292
- e = `${e}`;
293
- e = e.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
294
- e = e.replace(/(?=(\\+?)?)\1$/, "$1$1");
295
- e = `"${e}"`;
296
- e = e.replace(n, "^$1");
297
- if (t) e = e.replace(n, "^$1");
298
- return e;
299
- }
300
- t.exports.command = r;
301
- t.exports.argument = i;
302
- }));
303
- //#endregion
304
- //#region node_modules/shebang-regex/index.js
305
- var T = /* @__PURE__ */ u(((e, t) => {
306
- t.exports = /^#!(.*)/;
307
- }));
308
- //#endregion
309
- //#region node_modules/shebang-command/index.js
310
- var E = /* @__PURE__ */ u(((e, t) => {
311
- const n = T();
312
- t.exports = (e = "") => {
313
- const t = e.match(n);
314
- if (!t) return null;
315
- const [r, i] = t[0].replace(/#! ?/, "").split(" ");
316
- const a = r.split("/").pop();
317
- if (a === "env") return i;
318
- return i ? `${a} ${i}` : a;
319
- };
320
- }));
321
- //#endregion
322
- //#region node_modules/cross-spawn/lib/util/readShebang.js
323
- var D = /* @__PURE__ */ u(((e, t) => {
324
- const n = d("fs");
325
- const r = E();
326
- function i(e) {
327
- const t = 150;
328
- const i = Buffer.alloc(t);
329
- let a;
330
- try {
331
- a = n.openSync(e, "r");
332
- n.readSync(a, i, 0, t, 0);
333
- n.closeSync(a);
334
- } catch (e) {}
335
- return r(i.toString());
336
- }
337
- t.exports = i;
338
- }));
339
- //#endregion
340
- //#region node_modules/cross-spawn/lib/parse.js
341
- var O = /* @__PURE__ */ u(((e, t) => {
342
- const n = d("path");
343
- const r = C();
344
- const i = w();
345
- const a = D();
346
- const o = process.platform === "win32";
347
- const s = /\.(?:com|exe)$/i;
348
- const c = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
349
- function l(e) {
350
- e.file = r(e);
351
- const t = e.file && a(e.file);
352
- if (t) {
353
- e.args.unshift(e.file);
354
- e.command = t;
355
- return r(e);
96
+ n = f(i, "r");
97
+ p(n, t, 0, e, 0);
98
+ } catch {} finally {
99
+ if (n !== null) d(n);
356
100
  }
357
- return e.file;
358
- }
359
- function u(e) {
360
- if (!o) return e;
361
- const t = l(e);
362
- const r = !s.test(t);
363
- if (e.options.forceShell || r) {
364
- const r = c.test(t);
365
- e.command = n.normalize(e.command);
366
- e.command = i.command(e.command);
367
- e.args = e.args.map((e) => i.argument(e, r));
368
- e.args = [
369
- "/d",
370
- "/s",
371
- "/c",
372
- `"${[e.command].concat(e.args).join(" ")}"`
373
- ];
374
- e.command = process.env.comspec || "cmd.exe";
375
- e.options.windowsVerbatimArguments = true;
376
- }
377
- return e;
378
- }
379
- function f(e, t, n) {
380
- if (t && !Array.isArray(t)) {
381
- n = t;
382
- t = null;
101
+ const o = t.toString().match(S);
102
+ if (o !== null) {
103
+ const e = o[1].trim();
104
+ const t = e.indexOf(" ");
105
+ const n = t !== -1 ? e.slice(0, t) : e;
106
+ const i = t !== -1 ? e.slice(t + 1) : "";
107
+ const s = r(n);
108
+ a = s === "env" ? i || null : s;
383
109
  }
384
- t = t ? t.slice(0) : [];
385
- n = Object.assign({}, n);
386
- const r = {
387
- command: e,
388
- args: t,
389
- options: n,
390
- file: void 0,
391
- original: {
392
- command: e,
393
- args: t
394
- }
395
- };
396
- return n.shell ? r : u(r);
397
110
  }
398
- t.exports = f;
399
- }));
400
- //#endregion
401
- //#region node_modules/cross-spawn/lib/enoent.js
402
- var k = /* @__PURE__ */ u(((e, t) => {
403
- const n = process.platform === "win32";
404
- function r(e, t) {
405
- return Object.assign(/* @__PURE__ */ new Error(`${t} ${e.command} ENOENT`), {
406
- code: "ENOENT",
407
- errno: "ENOENT",
408
- syscall: `${t} ${e.command}`,
409
- path: e.command,
410
- spawnargs: e.args
111
+ if (a !== null && i !== null) {
112
+ t = [i, ...t];
113
+ e = a;
114
+ i = O(e, n);
115
+ }
116
+ if (i === null || !C.test(i)) {
117
+ const r = i !== null && w.test(i);
118
+ e = o(e);
119
+ e = e.replace(x, "^$1");
120
+ t = t.map((e) => {
121
+ e = e.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
122
+ e = e.replace(/(?=(\\+?)?)\1$/, "$1$1");
123
+ e = `"${e}"`;
124
+ e = e.replace(x, "^$1");
125
+ if (r) e = e.replace(x, "^$1");
126
+ return e;
411
127
  });
412
- }
413
- function i(e, t) {
414
- if (!n) return;
415
- const r = e.emit;
416
- e.emit = function(n, i) {
417
- if (n === "exit") {
418
- const n = a(i, t);
419
- if (n) return r.call(e, "error", n);
420
- }
421
- return r.apply(e, arguments);
128
+ t = [
129
+ "/d",
130
+ "/s",
131
+ "/c",
132
+ `"${[e, ...t].join(" ")}"`
133
+ ];
134
+ e = n.env?.comspec ?? "cmd.exe";
135
+ n = {
136
+ ...n,
137
+ windowsVerbatimArguments: true
422
138
  };
423
139
  }
424
- function a(e, t) {
425
- if (n && e === 1 && !t.file) return r(t.original, "spawn");
426
- return null;
427
- }
428
- function o(e, t) {
429
- if (n && e === 1 && !t.file) return r(t.original, "spawnSync");
430
- return null;
431
- }
432
- t.exports = {
433
- hookChildProcess: i,
434
- verifyENOENT: a,
435
- verifyENOENTSync: o,
436
- notFoundError: r
140
+ return {
141
+ command: e,
142
+ args: t,
143
+ options: n
437
144
  };
438
- }));
439
- //#endregion
440
- //#region node_modules/cross-spawn/index.js
441
- var A = /* @__PURE__ */ u(((e, t) => {
442
- const n = d("child_process");
443
- const r = O();
444
- const i = k();
445
- function a(e, t, a) {
446
- const o = r(e, t, a);
447
- const s = n.spawn(o.command, o.args, o.options);
448
- i.hookChildProcess(s, o);
449
- return s;
450
- }
451
- function o(e, t, a) {
452
- const o = r(e, t, a);
453
- const s = n.spawnSync(o.command, o.args, o.options);
454
- s.error = s.error || i.verifyENOENTSync(s.status, o);
455
- return s;
145
+ }
146
+ /**
147
+ * Resolves the command to an absolute path if possible.
148
+ * Handles things like traversing PATH and adding extensions from PATHEXT
149
+ */
150
+ function O(e, t) {
151
+ const r = (t.cwd ?? n()).toString();
152
+ const a = t.env ?? process.env;
153
+ const o = _(a).value;
154
+ const c = e.includes("/") || e.includes("\\") ? [""] : [r, ...o.split(i)];
155
+ const l = a.PATHEXT ? a.PATHEXT.split(i) : E;
156
+ if (e.includes(".") && l[0] !== "") l.unshift("");
157
+ for (const t of c) {
158
+ const n = s(r, t.startsWith("\"") && t.endsWith("\"") && t.length > 1 ? t.slice(1, -1) : t, e);
159
+ for (const e of l) {
160
+ const t = n + e;
161
+ try {
162
+ if (m(t).isFile()) return t;
163
+ } catch {}
164
+ }
456
165
  }
457
- t.exports = a;
458
- t.exports.spawn = a;
459
- t.exports.sync = o;
460
- t.exports._parse = r;
461
- t.exports._enoent = i;
462
- }));
166
+ return null;
167
+ }
463
168
  //#endregion
464
169
  //#region src/non-zero-exit-error.ts
465
- var j = A();
466
- var M = class extends Error {
170
+ var k = class extends Error {
171
+ result;
172
+ output;
467
173
  get exitCode() {
468
174
  if (this.result.exitCode !== null) return this.result.exitCode;
469
175
  }
@@ -475,14 +181,14 @@ var M = class extends Error {
475
181
  };
476
182
  //#endregion
477
183
  //#region src/main.ts
478
- const N = /\r?\n/;
479
- const P = {
184
+ const A = /\r?\n/;
185
+ const j = {
480
186
  timeout: void 0,
481
187
  persist: false
482
188
  };
483
- const F = { timeout: void 0 };
484
- const I = { windowsHide: true };
485
- function L(e) {
189
+ const M = { timeout: void 0 };
190
+ const N = { windowsHide: true };
191
+ function P(e) {
486
192
  const t = new AbortController();
487
193
  for (const n of e) {
488
194
  if (n.aborted) {
@@ -496,14 +202,14 @@ function L(e) {
496
202
  }
497
203
  return t.signal;
498
204
  }
499
- async function R(e) {
205
+ async function F(e) {
500
206
  let t = "";
501
207
  try {
502
208
  for await (const n of e) t += n.toString();
503
209
  } catch {}
504
210
  return t;
505
211
  }
506
- var z = class {
212
+ var I = class {
507
213
  _process;
508
214
  _aborted = false;
509
215
  _options;
@@ -523,7 +229,7 @@ var z = class {
523
229
  }
524
230
  constructor(e, t, n) {
525
231
  this._options = {
526
- ...P,
232
+ ...j,
527
233
  ...n
528
234
  };
529
235
  this._command = e;
@@ -542,7 +248,7 @@ var z = class {
542
248
  return this._process?.killed === true;
543
249
  }
544
250
  pipe(e, t, n) {
545
- return H(e, t, {
251
+ return z(e, t, {
546
252
  ...n,
547
253
  stdin: this
548
254
  });
@@ -553,18 +259,18 @@ var z = class {
553
259
  const t = [];
554
260
  if (this._streamErr) t.push(this._streamErr);
555
261
  if (this._streamOut) t.push(this._streamOut);
556
- const n = _(t);
557
- const r = l.createInterface({ input: n });
262
+ const n = b(t);
263
+ const r = u.createInterface({ input: n });
558
264
  for await (const e of r) yield e.toString();
559
265
  await this._processClosed;
560
266
  e.removeAllListeners();
561
267
  if (this._thrownError) throw this._thrownError;
562
- if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new M(this);
268
+ if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new k(this);
563
269
  }
564
270
  async _waitForOutput() {
565
271
  const e = this._process;
566
272
  if (!e) throw new Error("No process was started");
567
- const [t, n] = await Promise.all([this._streamOut ? R(this._streamOut) : "", this._streamErr ? R(this._streamErr) : ""]);
273
+ const [t, n] = await Promise.all([this._streamOut ? F(this._streamOut) : "", this._streamErr ? F(this._streamErr) : ""]);
568
274
  await this._processClosed;
569
275
  const { stdin: r } = this._options;
570
276
  if (r && typeof r !== "string") await r;
@@ -575,7 +281,7 @@ var z = class {
575
281
  stdout: t,
576
282
  exitCode: this.exitCode
577
283
  };
578
- if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new M(this, i);
284
+ if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new k(this, i);
579
285
  return i;
580
286
  }
581
287
  then(e, t) {
@@ -584,28 +290,28 @@ var z = class {
584
290
  _streamOut;
585
291
  _streamErr;
586
292
  spawn() {
587
- const e = r();
588
- const n = this._options;
293
+ const t = n();
294
+ const r = this._options;
589
295
  const i = {
590
- ...I,
591
- ...n.nodeOptions
296
+ ...N,
297
+ ...r.nodeOptions
592
298
  };
593
299
  const a = [];
594
300
  this._resetState();
595
- if (n.timeout !== void 0) a.push(AbortSignal.timeout(n.timeout));
596
- if (n.signal !== void 0) a.push(n.signal);
597
- if (n.persist === true) i.detached = true;
598
- if (a.length > 0) i.signal = L(a);
599
- i.env = g(e, i.env);
600
- const o = (0, j._parse)(this._command, this._args, i);
601
- const s = t(o.command, o.args, o.options);
301
+ if (r.timeout !== void 0) a.push(AbortSignal.timeout(r.timeout));
302
+ if (r.signal !== void 0) a.push(r.signal);
303
+ if (r.persist === true) i.detached = true;
304
+ if (a.length > 0) i.signal = P(a);
305
+ i.env = y(t, i.env, r.nodePath);
306
+ const o = D(this._command, this._args, i);
307
+ const s = e(o.command, o.args, o.options);
602
308
  if (s.stderr) this._streamErr = s.stderr;
603
309
  if (s.stdout) this._streamOut = s.stdout;
604
310
  this._process = s;
605
311
  s.once("error", this._onError);
606
312
  s.once("close", this._onClose);
607
313
  if (s.stdin) {
608
- const { stdin: e } = n;
314
+ const { stdin: e } = r;
609
315
  if (typeof e === "string") s.stdin.end(e);
610
316
  else e?.process?.stdout?.pipe(s.stdin);
611
317
  }
@@ -628,20 +334,20 @@ var z = class {
628
334
  if (this._resolveClose) this._resolveClose();
629
335
  };
630
336
  };
631
- function B(e, t, i) {
337
+ function L(e, r, i) {
632
338
  const a = {
633
- ...F,
339
+ ...M,
634
340
  ...i
635
341
  };
636
- const o = r();
342
+ const o = n();
637
343
  const s = {
638
344
  windowsHide: true,
639
345
  ...a.nodeOptions
640
346
  };
641
347
  if (a.timeout !== void 0) s.timeout = a.timeout;
642
- s.env = g(o, s.env);
643
- const c = (0, j._parse)(e, t ?? [], s);
644
- const l = n(c.command, c.args, c.options);
348
+ s.env = y(o, s.env, a.nodePath);
349
+ const c = D(e, r ?? [], s);
350
+ const l = t(c.command, c.args, c.options);
645
351
  if (l.error) throw l.error;
646
352
  const u = l.stdout?.toString() ?? "";
647
353
  const d = l.stderr?.toString() ?? "";
@@ -662,21 +368,21 @@ function B(e, t, i) {
662
368
  *[Symbol.iterator]() {
663
369
  for (const e of [u, d]) {
664
370
  if (!e) continue;
665
- const t = e.split(N);
371
+ const t = e.split(A);
666
372
  if (t[t.length - 1] === "") t.pop();
667
373
  yield* t;
668
374
  }
669
375
  }
670
376
  };
671
- if (a.throwOnError && f !== 0 && f !== void 0) throw new M(m, m);
377
+ if (a.throwOnError && f !== 0 && f !== void 0) throw new k(m, m);
672
378
  return m;
673
379
  }
674
- const V = (e, t, n) => {
675
- const r = new z(e, t, n);
380
+ const R = (e, t, n) => {
381
+ const r = new I(e, t, n);
676
382
  r.spawn();
677
383
  return r;
678
384
  };
679
- const H = V;
680
- const U = B;
385
+ const z = R;
386
+ const B = L;
681
387
  //#endregion
682
- export { z as ExecProcess, M as NonZeroExitError, H as exec, U as execSync, V as x, B as xSync };
388
+ export { I as ExecProcess, k as NonZeroExitError, z as exec, B as execSync, D as normalizeSpawnCommand, R as x, L as xSync };