@maizzle/framework 6.0.0-rc.1 → 6.0.0-rc.3

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 (214) hide show
  1. package/bin/maizzle.mjs +1 -1
  2. package/dist/build.mjs +2 -1
  3. package/dist/build.mjs.map +1 -1
  4. package/dist/config/index.mjs +7 -0
  5. package/dist/config/index.mjs.map +1 -1
  6. package/dist/plugin.d.mts.map +1 -1
  7. package/dist/plugin.mjs +13 -0
  8. package/dist/plugin.mjs.map +1 -1
  9. package/dist/render/createRenderer.d.mts +2 -0
  10. package/dist/render/createRenderer.d.mts.map +1 -1
  11. package/dist/render/createRenderer.mjs +11 -4
  12. package/dist/render/createRenderer.mjs.map +1 -1
  13. package/dist/render/index.mjs +2 -1
  14. package/dist/render/index.mjs.map +1 -1
  15. package/dist/serve.mjs +2 -1
  16. package/dist/serve.mjs.map +1 -1
  17. package/dist/types/config.d.mts +3 -0
  18. package/dist/types/config.d.mts.map +1 -1
  19. package/dist/utils/detect.d.mts +5 -0
  20. package/dist/utils/detect.d.mts.map +1 -0
  21. package/dist/utils/detect.mjs +11 -0
  22. package/dist/utils/detect.mjs.map +1 -0
  23. package/node_modules/@clack/core/CHANGELOG.md +87 -4
  24. package/node_modules/@clack/core/README.md +1 -1
  25. package/node_modules/@clack/core/dist/index.d.mts +186 -48
  26. package/node_modules/@clack/core/dist/index.mjs +10 -14
  27. package/node_modules/@clack/core/dist/index.mjs.map +1 -1
  28. package/node_modules/@clack/core/package.json +7 -9
  29. package/node_modules/@clack/prompts/CHANGELOG.md +171 -7
  30. package/node_modules/@clack/prompts/README.md +66 -3
  31. package/node_modules/@clack/prompts/dist/index.d.mts +302 -76
  32. package/node_modules/@clack/prompts/dist/index.mjs +134 -84
  33. package/node_modules/@clack/prompts/dist/index.mjs.map +1 -1
  34. package/node_modules/@clack/prompts/package.json +14 -10
  35. package/node_modules/citty/LICENSE +0 -15
  36. package/node_modules/citty/README.md +166 -69
  37. package/node_modules/citty/dist/index.d.mts +88 -56
  38. package/node_modules/citty/dist/index.mjs +399 -437
  39. package/node_modules/citty/package.json +28 -35
  40. package/node_modules/giget/README.md +59 -11
  41. package/node_modules/giget/dist/THIRD-PARTY-LICENSES.md +205 -0
  42. package/node_modules/giget/dist/_chunks/giget.mjs +508 -0
  43. package/node_modules/giget/dist/_chunks/libs/citty.mjs +269 -0
  44. package/node_modules/giget/dist/_chunks/libs/nypm.d.mts +1 -0
  45. package/node_modules/giget/dist/_chunks/libs/nypm.mjs +669 -0
  46. package/node_modules/giget/dist/_chunks/libs/tar.mjs +2931 -0
  47. package/node_modules/giget/dist/_chunks/rolldown-runtime.mjs +14 -0
  48. package/node_modules/giget/dist/cli.d.mts +1 -0
  49. package/node_modules/giget/dist/cli.mjs +89 -111
  50. package/node_modules/giget/dist/index.d.mts +46 -35
  51. package/node_modules/giget/dist/index.mjs +2 -22
  52. package/node_modules/giget/package.json +32 -45
  53. package/node_modules/maizzle/README.md +140 -0
  54. package/node_modules/maizzle/bin/maizzle.mjs +5 -0
  55. package/node_modules/maizzle/dist/commands/new.d.mts +7 -0
  56. package/node_modules/maizzle/dist/commands/new.mjs +278 -0
  57. package/node_modules/{@maizzle/cli → maizzle}/dist/index.d.mts +1 -1
  58. package/node_modules/maizzle/dist/index.mjs +44 -0
  59. package/node_modules/{commander → maizzle/node_modules/commander}/Readme.md +94 -67
  60. package/node_modules/{commander → maizzle/node_modules/commander}/lib/argument.js +5 -4
  61. package/node_modules/{commander → maizzle/node_modules/commander}/lib/command.js +154 -39
  62. package/node_modules/{commander → maizzle/node_modules/commander}/lib/help.js +77 -39
  63. package/node_modules/{commander → maizzle/node_modules/commander}/lib/option.js +16 -3
  64. package/node_modules/{commander → maizzle/node_modules/commander}/package-support.json +4 -1
  65. package/node_modules/{commander → maizzle/node_modules/commander}/package.json +8 -8
  66. package/node_modules/{commander → maizzle/node_modules/commander}/typings/index.d.ts +71 -3
  67. package/node_modules/{@maizzle/cli → maizzle}/package.json +13 -11
  68. package/node_modules/tinyexec/README.md +49 -3
  69. package/node_modules/tinyexec/dist/main.d.mts +25 -14
  70. package/node_modules/tinyexec/dist/main.mjs +148 -100
  71. package/node_modules/tinyexec/package.json +9 -8
  72. package/package.json +3 -3
  73. package/node_modules/@clack/core/dist/index.cjs +0 -15
  74. package/node_modules/@clack/core/dist/index.cjs.map +0 -1
  75. package/node_modules/@clack/core/dist/index.d.cts +0 -211
  76. package/node_modules/@clack/core/dist/index.d.ts +0 -211
  77. package/node_modules/@clack/prompts/dist/index.cjs +0 -87
  78. package/node_modules/@clack/prompts/dist/index.cjs.map +0 -1
  79. package/node_modules/@clack/prompts/dist/index.d.cts +0 -165
  80. package/node_modules/@clack/prompts/dist/index.d.ts +0 -165
  81. package/node_modules/@maizzle/cli/README.md +0 -58
  82. package/node_modules/@maizzle/cli/dist/index.mjs +0 -42
  83. package/node_modules/citty/dist/index.cjs +0 -475
  84. package/node_modules/citty/dist/index.d.cts +0 -80
  85. package/node_modules/citty/dist/index.d.ts +0 -80
  86. package/node_modules/consola/LICENSE +0 -47
  87. package/node_modules/consola/README.md +0 -352
  88. package/node_modules/consola/basic.d.ts +0 -1
  89. package/node_modules/consola/browser.d.ts +0 -1
  90. package/node_modules/consola/core.d.ts +0 -1
  91. package/node_modules/consola/dist/basic.cjs +0 -32
  92. package/node_modules/consola/dist/basic.d.cts +0 -23
  93. package/node_modules/consola/dist/basic.d.mts +0 -21
  94. package/node_modules/consola/dist/basic.d.ts +0 -23
  95. package/node_modules/consola/dist/basic.mjs +0 -24
  96. package/node_modules/consola/dist/browser.cjs +0 -84
  97. package/node_modules/consola/dist/browser.d.cts +0 -23
  98. package/node_modules/consola/dist/browser.d.mts +0 -21
  99. package/node_modules/consola/dist/browser.d.ts +0 -23
  100. package/node_modules/consola/dist/browser.mjs +0 -76
  101. package/node_modules/consola/dist/chunks/prompt.cjs +0 -288
  102. package/node_modules/consola/dist/chunks/prompt.mjs +0 -280
  103. package/node_modules/consola/dist/core.cjs +0 -517
  104. package/node_modules/consola/dist/core.d.cts +0 -459
  105. package/node_modules/consola/dist/core.d.mts +0 -459
  106. package/node_modules/consola/dist/core.d.ts +0 -459
  107. package/node_modules/consola/dist/core.mjs +0 -512
  108. package/node_modules/consola/dist/index.cjs +0 -663
  109. package/node_modules/consola/dist/index.d.cts +0 -24
  110. package/node_modules/consola/dist/index.d.mts +0 -22
  111. package/node_modules/consola/dist/index.d.ts +0 -24
  112. package/node_modules/consola/dist/index.mjs +0 -651
  113. package/node_modules/consola/dist/shared/consola.DCGIlDNP.cjs +0 -75
  114. package/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +0 -72
  115. package/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +0 -288
  116. package/node_modules/consola/dist/shared/consola.DwRq1yyg.cjs +0 -312
  117. package/node_modules/consola/dist/utils.cjs +0 -64
  118. package/node_modules/consola/dist/utils.d.cts +0 -286
  119. package/node_modules/consola/dist/utils.d.mts +0 -286
  120. package/node_modules/consola/dist/utils.d.ts +0 -286
  121. package/node_modules/consola/dist/utils.mjs +0 -54
  122. package/node_modules/consola/lib/index.cjs +0 -10
  123. package/node_modules/consola/package.json +0 -136
  124. package/node_modules/consola/utils.d.ts +0 -1
  125. package/node_modules/create-maizzle/README.md +0 -86
  126. package/node_modules/create-maizzle/bin/create-maizzle.mjs +0 -4
  127. package/node_modules/create-maizzle/node_modules/@clack/core/CHANGELOG.md +0 -340
  128. package/node_modules/create-maizzle/node_modules/@clack/core/LICENSE +0 -9
  129. package/node_modules/create-maizzle/node_modules/@clack/core/README.md +0 -22
  130. package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.d.mts +0 -349
  131. package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.mjs +0 -11
  132. package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.mjs.map +0 -1
  133. package/node_modules/create-maizzle/node_modules/@clack/core/package.json +0 -60
  134. package/node_modules/create-maizzle/node_modules/@clack/prompts/CHANGELOG.md +0 -576
  135. package/node_modules/create-maizzle/node_modules/@clack/prompts/LICENSE +0 -9
  136. package/node_modules/create-maizzle/node_modules/@clack/prompts/README.md +0 -270
  137. package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.d.mts +0 -391
  138. package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.mjs +0 -137
  139. package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.mjs.map +0 -1
  140. package/node_modules/create-maizzle/node_modules/@clack/prompts/package.json +0 -65
  141. package/node_modules/create-maizzle/package.json +0 -47
  142. package/node_modules/create-maizzle/src/index.js +0 -242
  143. package/node_modules/defu/LICENSE +0 -21
  144. package/node_modules/defu/README.md +0 -171
  145. package/node_modules/defu/dist/defu.cjs +0 -77
  146. package/node_modules/defu/dist/defu.d.cts +0 -31
  147. package/node_modules/defu/dist/defu.d.mts +0 -29
  148. package/node_modules/defu/dist/defu.d.ts +0 -31
  149. package/node_modules/defu/dist/defu.mjs +0 -69
  150. package/node_modules/defu/lib/defu.cjs +0 -10
  151. package/node_modules/defu/lib/defu.d.cts +0 -12
  152. package/node_modules/defu/package.json +0 -48
  153. package/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs +0 -468
  154. package/node_modules/node-fetch-native/LICENSE +0 -114
  155. package/node_modules/node-fetch-native/README.md +0 -225
  156. package/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +0 -2
  157. package/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +0 -2
  158. package/node_modules/node-fetch-native/dist/index.cjs +0 -1
  159. package/node_modules/node-fetch-native/dist/index.mjs +0 -1
  160. package/node_modules/node-fetch-native/dist/native.cjs +0 -1
  161. package/node_modules/node-fetch-native/dist/native.mjs +0 -1
  162. package/node_modules/node-fetch-native/dist/node.cjs +0 -19
  163. package/node_modules/node-fetch-native/dist/node.mjs +0 -19
  164. package/node_modules/node-fetch-native/dist/polyfill.cjs +0 -1
  165. package/node_modules/node-fetch-native/dist/polyfill.mjs +0 -1
  166. package/node_modules/node-fetch-native/dist/proxy-stub.cjs +0 -1
  167. package/node_modules/node-fetch-native/dist/proxy-stub.mjs +0 -1
  168. package/node_modules/node-fetch-native/dist/proxy.cjs +0 -58
  169. package/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs +0 -1
  170. package/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs +0 -1
  171. package/node_modules/node-fetch-native/index.d.ts +0 -1
  172. package/node_modules/node-fetch-native/lib/empty.cjs +0 -0
  173. package/node_modules/node-fetch-native/lib/empty.mjs +0 -0
  174. package/node_modules/node-fetch-native/lib/index.cjs +0 -11
  175. package/node_modules/node-fetch-native/lib/index.d.cts +0 -10
  176. package/node_modules/node-fetch-native/lib/index.d.mts +0 -10
  177. package/node_modules/node-fetch-native/lib/index.d.ts +0 -10
  178. package/node_modules/node-fetch-native/lib/native.cjs +0 -11
  179. package/node_modules/node-fetch-native/lib/polyfill.d.cts +0 -1
  180. package/node_modules/node-fetch-native/lib/polyfill.d.mts +0 -1
  181. package/node_modules/node-fetch-native/lib/polyfill.d.ts +0 -1
  182. package/node_modules/node-fetch-native/lib/proxy.d.ts +0 -32
  183. package/node_modules/node-fetch-native/node.d.ts +0 -1
  184. package/node_modules/node-fetch-native/package.json +0 -138
  185. package/node_modules/node-fetch-native/polyfill.d.ts +0 -1
  186. package/node_modules/node-fetch-native/proxy.d.ts +0 -1
  187. package/node_modules/nypm/node_modules/citty/LICENSE +0 -21
  188. package/node_modules/nypm/node_modules/citty/README.md +0 -231
  189. package/node_modules/nypm/node_modules/citty/dist/index.d.mts +0 -112
  190. package/node_modules/nypm/node_modules/citty/dist/index.mjs +0 -425
  191. package/node_modules/nypm/node_modules/citty/package.json +0 -42
  192. /package/node_modules/{nypm/node_modules/citty → citty}/dist/THIRD-PARTY-LICENSES.md +0 -0
  193. /package/node_modules/{nypm/node_modules/citty → citty}/dist/_chunks/libs/scule.mjs +0 -0
  194. /package/node_modules/{@maizzle/cli → maizzle}/LICENSE +0 -0
  195. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/component.d.mts +0 -0
  196. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/component.mjs +0 -0
  197. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/config.d.mts +0 -0
  198. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/config.mjs +0 -0
  199. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/layout.d.mts +0 -0
  200. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/layout.mjs +0 -0
  201. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/scaffold.d.mts +0 -0
  202. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/scaffold.mjs +0 -0
  203. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/component.vue +0 -0
  204. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/config.ts +0 -0
  205. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/layout.vue +0 -0
  206. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/template.vue +0 -0
  207. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/template.d.mts +0 -0
  208. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/template.mjs +0 -0
  209. /package/node_modules/{commander → maizzle/node_modules/commander}/LICENSE +0 -0
  210. /package/node_modules/{commander → maizzle/node_modules/commander}/esm.mjs +0 -0
  211. /package/node_modules/{commander → maizzle/node_modules/commander}/index.js +0 -0
  212. /package/node_modules/{commander → maizzle/node_modules/commander}/lib/error.js +0 -0
  213. /package/node_modules/{commander → maizzle/node_modules/commander}/lib/suggestSimilar.js +0 -0
  214. /package/node_modules/{commander → maizzle/node_modules/commander}/typings/esm.d.mts +0 -0
@@ -0,0 +1,669 @@
1
+ import { t as e } from "../rolldown-runtime.mjs";
2
+ import { createRequire as t } from "node:module";
3
+ import { existsSync as n } from "node:fs";
4
+ import { readFile as r } from "node:fs/promises";
5
+ import { PassThrough as i } from "node:stream";
6
+ import { spawn as a } from "node:child_process";
7
+ import { delimiter as o, dirname as s, normalize as c, resolve as l } from "node:path";
8
+ import { cwd as u } from "node:process";
9
+ import d from "node:readline";
10
+ const f = /^[A-Za-z]:\//;
11
+ function p(e = ``) {
12
+ return e && e.replace(/\\/g, `/`).replace(f, (e) => e.toUpperCase());
13
+ }
14
+ const ee = /^[/\\]{2}/, te = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, m = /^[A-Za-z]:$/, h = /^\/([A-Za-z]:)?$/, g = function(e) {
15
+ if (e.length === 0) return `.`;
16
+ e = p(e);
17
+ let t = e.match(ee), n = x(e), r = e[e.length - 1] === `/`;
18
+ return e = b(e, !n), e.length === 0 ? n ? `/` : r ? `./` : `.` : (r && (e += `/`), m.test(e) && (e += `/`), t ? n ? `//${e}` : `//./${e}` : n && !x(e) ? `/${e}` : e);
19
+ }, _ = function(...e) {
20
+ let t = ``;
21
+ for (let n of e) if (n) if (t.length > 0) {
22
+ let e = t[t.length - 1] === `/`, r = n[0] === `/`;
23
+ e && r ? t += n.slice(1) : t += e || r ? n : `/${n}`;
24
+ } else t += n;
25
+ return g(t);
26
+ };
27
+ function v() {
28
+ return typeof process < `u` && typeof process.cwd == `function` ? process.cwd().replace(/\\/g, `/`) : `/`;
29
+ }
30
+ const y = function(...e) {
31
+ e = e.map((e) => p(e));
32
+ let t = ``, n = !1;
33
+ for (let r = e.length - 1; r >= -1 && !n; r--) {
34
+ let i = r >= 0 ? e[r] : v();
35
+ !i || i.length === 0 || (t = `${i}/${t}`, n = x(i));
36
+ }
37
+ return t = b(t, !n), n && !x(t) ? `/${t}` : t.length > 0 ? t : `.`;
38
+ };
39
+ function b(e, t) {
40
+ let n = ``, r = 0, i = -1, a = 0, o = null;
41
+ for (let s = 0; s <= e.length; ++s) {
42
+ if (s < e.length) o = e[s];
43
+ else if (o === `/`) break;
44
+ else o = `/`;
45
+ if (o === `/`) {
46
+ if (!(i === s - 1 || a === 1)) if (a === 2) {
47
+ if (n.length < 2 || r !== 2 || n[n.length - 1] !== `.` || n[n.length - 2] !== `.`) {
48
+ if (n.length > 2) {
49
+ let e = n.lastIndexOf(`/`);
50
+ e === -1 ? (n = ``, r = 0) : (n = n.slice(0, e), r = n.length - 1 - n.lastIndexOf(`/`)), i = s, a = 0;
51
+ continue;
52
+ } else if (n.length > 0) {
53
+ n = ``, r = 0, i = s, a = 0;
54
+ continue;
55
+ }
56
+ }
57
+ t && (n += n.length > 0 ? `/..` : `..`, r = 2);
58
+ } else n.length > 0 ? n += `/${e.slice(i + 1, s)}` : n = e.slice(i + 1, s), r = s - i - 1;
59
+ i = s, a = 0;
60
+ } else o === `.` && a !== -1 ? ++a : a = -1;
61
+ }
62
+ return n;
63
+ }
64
+ const x = function(e) {
65
+ return te.test(e);
66
+ }, S = function(e, t) {
67
+ let n = y(e).replace(h, `$1`).split(`/`), r = y(t).replace(h, `$1`).split(`/`);
68
+ if (r[0][1] === `:` && n[0][1] === `:` && n[0] !== r[0]) return r.join(`/`);
69
+ let i = [...n];
70
+ for (let e of i) {
71
+ if (r[0] !== e) break;
72
+ n.shift(), r.shift();
73
+ }
74
+ return [...n.map(() => `..`), ...r].join(`/`);
75
+ }, C = function(e) {
76
+ let t = p(e).replace(/\/$/, ``).split(`/`).slice(0, -1);
77
+ return t.length === 1 && m.test(t[0]) && (t[0] += `/`), t.join(`/`) || (x(e) ? `/` : `.`);
78
+ }, ne = function(e, t) {
79
+ let n = p(e).split(`/`), r = ``;
80
+ for (let e = n.length - 1; e >= 0; e--) {
81
+ let t = n[e];
82
+ if (t) {
83
+ r = t;
84
+ break;
85
+ }
86
+ }
87
+ return t && r.endsWith(t) ? r.slice(0, -t.length) : r;
88
+ };
89
+ globalThis.process?.platform;
90
+ var w = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), T = t(import.meta.url);
91
+ const re = /^path$/i, E = {
92
+ key: `PATH`,
93
+ value: ``
94
+ };
95
+ function D(e) {
96
+ for (let t in e) {
97
+ if (!Object.prototype.hasOwnProperty.call(e, t) || !re.test(t)) continue;
98
+ let n = e[t];
99
+ return n ? {
100
+ key: t,
101
+ value: n
102
+ } : E;
103
+ }
104
+ return E;
105
+ }
106
+ function O(e, t) {
107
+ let n = t.value.split(o), r = [], i = e, a;
108
+ do
109
+ r.push(l(i, `node_modules`, `.bin`)), a = i, i = s(i);
110
+ while (i !== a);
111
+ let c = r.concat(n).join(o);
112
+ return {
113
+ key: t.key,
114
+ value: c
115
+ };
116
+ }
117
+ function k(e, t) {
118
+ let n = {
119
+ ...process.env,
120
+ ...t
121
+ }, r = O(e, D(n));
122
+ return n[r.key] = r.value, n;
123
+ }
124
+ const A = (e) => {
125
+ let t = e.length, n = new i(), r = () => {
126
+ --t === 0 && n.emit(`end`);
127
+ };
128
+ for (let t of e) t.pipe(n, { end: !1 }), t.on(`end`, r);
129
+ return n;
130
+ };
131
+ var j = w(((e, t) => {
132
+ t.exports = a, a.sync = o;
133
+ var n = T(`fs`);
134
+ function r(e, t) {
135
+ var n = t.pathExt === void 0 ? process.env.PATHEXT : t.pathExt;
136
+ if (!n || (n = n.split(`;`), n.indexOf(``) !== -1)) return !0;
137
+ for (var r = 0; r < n.length; r++) {
138
+ var i = n[r].toLowerCase();
139
+ if (i && e.substr(-i.length).toLowerCase() === i) return !0;
140
+ }
141
+ return !1;
142
+ }
143
+ function i(e, t, n) {
144
+ return !e.isSymbolicLink() && !e.isFile() ? !1 : r(t, n);
145
+ }
146
+ function a(e, t, r) {
147
+ n.stat(e, function(n, a) {
148
+ r(n, n ? !1 : i(a, e, t));
149
+ });
150
+ }
151
+ function o(e, t) {
152
+ return i(n.statSync(e), e, t);
153
+ }
154
+ })), M = w(((e, t) => {
155
+ t.exports = r, r.sync = i;
156
+ var n = T(`fs`);
157
+ function r(e, t, r) {
158
+ n.stat(e, function(e, n) {
159
+ r(e, e ? !1 : a(n, t));
160
+ });
161
+ }
162
+ function i(e, t) {
163
+ return a(n.statSync(e), t);
164
+ }
165
+ function a(e, t) {
166
+ return e.isFile() && o(e, t);
167
+ }
168
+ function o(e, t) {
169
+ var n = e.mode, r = e.uid, i = e.gid, a = t.uid === void 0 ? process.getuid && process.getuid() : t.uid, o = t.gid === void 0 ? process.getgid && process.getgid() : t.gid, s = 64, c = 8, l = 1, u = s | c;
170
+ return n & l || n & c && i === o || n & s && r === a || n & u && a === 0;
171
+ }
172
+ })), N = w(((e, t) => {
173
+ T(`fs`);
174
+ var n = process.platform === `win32` || global.TESTING_WINDOWS ? j() : M();
175
+ t.exports = r, r.sync = i;
176
+ function r(e, t, i) {
177
+ if (typeof t == `function` && (i = t, t = {}), !i) {
178
+ if (typeof Promise != `function`) throw TypeError(`callback not provided`);
179
+ return new Promise(function(n, i) {
180
+ r(e, t || {}, function(e, t) {
181
+ e ? i(e) : n(t);
182
+ });
183
+ });
184
+ }
185
+ n(e, t || {}, function(e, n) {
186
+ e && (e.code === `EACCES` || t && t.ignoreErrors) && (e = null, n = !1), i(e, n);
187
+ });
188
+ }
189
+ function i(e, t) {
190
+ try {
191
+ return n.sync(e, t || {});
192
+ } catch (e) {
193
+ if (t && t.ignoreErrors || e.code === `EACCES`) return !1;
194
+ throw e;
195
+ }
196
+ }
197
+ })), P = w(((e, t) => {
198
+ let n = process.platform === `win32` || process.env.OSTYPE === `cygwin` || process.env.OSTYPE === `msys`, r = T(`path`), i = n ? `;` : `:`, a = N(), o = (e) => Object.assign(Error(`not found: ${e}`), { code: `ENOENT` }), s = (e, t) => {
199
+ let r = t.colon || i, a = e.match(/\//) || n && e.match(/\\/) ? [``] : [...n ? [process.cwd()] : [], ...(t.path || process.env.PATH || ``).split(r)], o = n ? t.pathExt || process.env.PATHEXT || `.EXE;.CMD;.BAT;.COM` : ``, s = n ? o.split(r) : [``];
200
+ return n && e.indexOf(`.`) !== -1 && s[0] !== `` && s.unshift(``), {
201
+ pathEnv: a,
202
+ pathExt: s,
203
+ pathExtExe: o
204
+ };
205
+ }, c = (e, t, n) => {
206
+ typeof t == `function` && (n = t, t = {}), t ||= {};
207
+ let { pathEnv: i, pathExt: c, pathExtExe: l } = s(e, t), u = [], d = (n) => new Promise((a, s) => {
208
+ if (n === i.length) return t.all && u.length ? a(u) : s(o(e));
209
+ let c = i[n], l = /^".*"$/.test(c) ? c.slice(1, -1) : c, d = r.join(l, e);
210
+ a(f(!l && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + d : d, n, 0));
211
+ }), f = (e, n, r) => new Promise((i, o) => {
212
+ if (r === c.length) return i(d(n + 1));
213
+ let s = c[r];
214
+ a(e + s, { pathExt: l }, (a, o) => {
215
+ if (!a && o) if (t.all) u.push(e + s);
216
+ else return i(e + s);
217
+ return i(f(e, n, r + 1));
218
+ });
219
+ });
220
+ return n ? d(0).then((e) => n(null, e), n) : d(0);
221
+ };
222
+ t.exports = c, c.sync = (e, t) => {
223
+ t ||= {};
224
+ let { pathEnv: n, pathExt: i, pathExtExe: c } = s(e, t), l = [];
225
+ for (let o = 0; o < n.length; o++) {
226
+ let s = n[o], u = /^".*"$/.test(s) ? s.slice(1, -1) : s, d = r.join(u, e), f = !u && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + d : d;
227
+ for (let e = 0; e < i.length; e++) {
228
+ let n = f + i[e];
229
+ try {
230
+ if (a.sync(n, { pathExt: c })) if (t.all) l.push(n);
231
+ else return n;
232
+ } catch {}
233
+ }
234
+ }
235
+ if (t.all && l.length) return l;
236
+ if (t.nothrow) return null;
237
+ throw o(e);
238
+ };
239
+ })), F = w(((e, t) => {
240
+ let n = (e = {}) => {
241
+ let t = e.env || process.env;
242
+ return (e.platform || process.platform) === `win32` ? Object.keys(t).reverse().find((e) => e.toUpperCase() === `PATH`) || `Path` : `PATH`;
243
+ };
244
+ t.exports = n, t.exports.default = n;
245
+ })), I = w(((e, t) => {
246
+ let n = T(`path`), r = P(), i = F();
247
+ function a(e, t) {
248
+ let a = e.options.env || process.env, o = process.cwd(), s = e.options.cwd != null, c = s && process.chdir !== void 0 && !process.chdir.disabled;
249
+ if (c) try {
250
+ process.chdir(e.options.cwd);
251
+ } catch {}
252
+ let l;
253
+ try {
254
+ l = r.sync(e.command, {
255
+ path: a[i({ env: a })],
256
+ pathExt: t ? n.delimiter : void 0
257
+ });
258
+ } catch {} finally {
259
+ c && process.chdir(o);
260
+ }
261
+ return l &&= n.resolve(s ? e.options.cwd : ``, l), l;
262
+ }
263
+ function o(e) {
264
+ return a(e) || a(e, !0);
265
+ }
266
+ t.exports = o;
267
+ })), L = w(((e, t) => {
268
+ let n = /([()\][%!^"`<>&|;, *?])/g;
269
+ function r(e) {
270
+ return e = e.replace(n, `^$1`), e;
271
+ }
272
+ function i(e, t) {
273
+ return e = `${e}`, e = e.replace(/(?=(\\+?)?)\1"/g, `$1$1\\"`), e = e.replace(/(?=(\\+?)?)\1$/, `$1$1`), e = `"${e}"`, e = e.replace(n, `^$1`), t && (e = e.replace(n, `^$1`)), e;
274
+ }
275
+ t.exports.command = r, t.exports.argument = i;
276
+ })), R = w(((e, t) => {
277
+ t.exports = /^#!(.*)/;
278
+ })), z = w(((e, t) => {
279
+ let n = R();
280
+ t.exports = (e = ``) => {
281
+ let t = e.match(n);
282
+ if (!t) return null;
283
+ let [r, i] = t[0].replace(/#! ?/, ``).split(` `), a = r.split(`/`).pop();
284
+ return a === `env` ? i : i ? `${a} ${i}` : a;
285
+ };
286
+ })), B = w(((e, t) => {
287
+ let n = T(`fs`), r = z();
288
+ function i(e) {
289
+ let t = Buffer.alloc(150), i;
290
+ try {
291
+ i = n.openSync(e, `r`), n.readSync(i, t, 0, 150, 0), n.closeSync(i);
292
+ } catch {}
293
+ return r(t.toString());
294
+ }
295
+ t.exports = i;
296
+ })), V = w(((e, t) => {
297
+ let n = T(`path`), r = I(), i = L(), a = B(), o = process.platform === `win32`, s = /\.(?:com|exe)$/i, c = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
298
+ function l(e) {
299
+ e.file = r(e);
300
+ let t = e.file && a(e.file);
301
+ return t ? (e.args.unshift(e.file), e.command = t, r(e)) : e.file;
302
+ }
303
+ function u(e) {
304
+ if (!o) return e;
305
+ let t = l(e), r = !s.test(t);
306
+ if (e.options.forceShell || r) {
307
+ let r = c.test(t);
308
+ e.command = n.normalize(e.command), e.command = i.command(e.command), e.args = e.args.map((e) => i.argument(e, r)), e.args = [
309
+ `/d`,
310
+ `/s`,
311
+ `/c`,
312
+ `"${[e.command].concat(e.args).join(` `)}"`
313
+ ], e.command = process.env.comspec || `cmd.exe`, e.options.windowsVerbatimArguments = !0;
314
+ }
315
+ return e;
316
+ }
317
+ function d(e, t, n) {
318
+ t && !Array.isArray(t) && (n = t, t = null), t = t ? t.slice(0) : [], n = Object.assign({}, n);
319
+ let r = {
320
+ command: e,
321
+ args: t,
322
+ options: n,
323
+ file: void 0,
324
+ original: {
325
+ command: e,
326
+ args: t
327
+ }
328
+ };
329
+ return n.shell ? r : u(r);
330
+ }
331
+ t.exports = d;
332
+ })), ie = w(((e, t) => {
333
+ let n = process.platform === `win32`;
334
+ function r(e, t) {
335
+ return Object.assign(Error(`${t} ${e.command} ENOENT`), {
336
+ code: `ENOENT`,
337
+ errno: `ENOENT`,
338
+ syscall: `${t} ${e.command}`,
339
+ path: e.command,
340
+ spawnargs: e.args
341
+ });
342
+ }
343
+ function i(e, t) {
344
+ if (!n) return;
345
+ let r = e.emit;
346
+ e.emit = function(n, i) {
347
+ if (n === `exit`) {
348
+ let n = a(i, t);
349
+ if (n) return r.call(e, `error`, n);
350
+ }
351
+ return r.apply(e, arguments);
352
+ };
353
+ }
354
+ function a(e, t) {
355
+ return n && e === 1 && !t.file ? r(t.original, `spawn`) : null;
356
+ }
357
+ function o(e, t) {
358
+ return n && e === 1 && !t.file ? r(t.original, `spawnSync`) : null;
359
+ }
360
+ t.exports = {
361
+ hookChildProcess: i,
362
+ verifyENOENT: a,
363
+ verifyENOENTSync: o,
364
+ notFoundError: r
365
+ };
366
+ })), H = w(((e, t) => {
367
+ let n = T(`child_process`), r = V(), i = ie();
368
+ function a(e, t, a) {
369
+ let o = r(e, t, a), s = n.spawn(o.command, o.args, o.options);
370
+ return i.hookChildProcess(s, o), s;
371
+ }
372
+ function o(e, t, a) {
373
+ let o = r(e, t, a), s = n.spawnSync(o.command, o.args, o.options);
374
+ return s.error = s.error || i.verifyENOENTSync(s.status, o), s;
375
+ }
376
+ t.exports = a, t.exports.spawn = a, t.exports.sync = o, t.exports._parse = r, t.exports._enoent = i;
377
+ }))(), U = class extends Error {
378
+ result;
379
+ output;
380
+ get exitCode() {
381
+ if (this.result.exitCode !== null) return this.result.exitCode;
382
+ }
383
+ constructor(e, t) {
384
+ super(`Process exited with non-zero status (${e.exitCode})`), this.result = e, this.output = t;
385
+ }
386
+ };
387
+ const W = {
388
+ timeout: void 0,
389
+ persist: !1
390
+ }, G = { windowsHide: !0 };
391
+ function K(e, t) {
392
+ return {
393
+ command: c(e),
394
+ args: t ?? []
395
+ };
396
+ }
397
+ function q(e) {
398
+ let t = new AbortController();
399
+ for (let n of e) {
400
+ if (n.aborted) return t.abort(), n;
401
+ n.addEventListener(`abort`, () => {
402
+ t.abort(n.reason);
403
+ }, { signal: t.signal });
404
+ }
405
+ return t.signal;
406
+ }
407
+ async function J(e) {
408
+ let t = ``;
409
+ for await (let n of e) t += n.toString();
410
+ return t;
411
+ }
412
+ var Y = class {
413
+ _process;
414
+ _aborted = !1;
415
+ _options;
416
+ _command;
417
+ _args;
418
+ _resolveClose;
419
+ _processClosed;
420
+ _thrownError;
421
+ get process() {
422
+ return this._process;
423
+ }
424
+ get pid() {
425
+ return this._process?.pid;
426
+ }
427
+ get exitCode() {
428
+ if (this._process && this._process.exitCode !== null) return this._process.exitCode;
429
+ }
430
+ constructor(e, t, n) {
431
+ this._options = {
432
+ ...W,
433
+ ...n
434
+ }, this._command = e, this._args = t ?? [], this._processClosed = new Promise((e) => {
435
+ this._resolveClose = e;
436
+ });
437
+ }
438
+ kill(e) {
439
+ return this._process?.kill(e) === !0;
440
+ }
441
+ get aborted() {
442
+ return this._aborted;
443
+ }
444
+ get killed() {
445
+ return this._process?.killed === !0;
446
+ }
447
+ pipe(e, t, n) {
448
+ return ae(e, t, {
449
+ ...n,
450
+ stdin: this
451
+ });
452
+ }
453
+ async *[Symbol.asyncIterator]() {
454
+ let e = this._process;
455
+ if (!e) return;
456
+ let t = [];
457
+ this._streamErr && t.push(this._streamErr), this._streamOut && t.push(this._streamOut);
458
+ let n = A(t), r = d.createInterface({ input: n });
459
+ for await (let e of r) yield e.toString();
460
+ if (await this._processClosed, e.removeAllListeners(), this._thrownError) throw this._thrownError;
461
+ if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new U(this);
462
+ }
463
+ async _waitForOutput() {
464
+ let e = this._process;
465
+ if (!e) throw Error(`No process was started`);
466
+ let [t, n] = await Promise.all([this._streamOut ? J(this._streamOut) : ``, this._streamErr ? J(this._streamErr) : ``]);
467
+ if (await this._processClosed, this._options?.stdin && await this._options.stdin, e.removeAllListeners(), this._thrownError) throw this._thrownError;
468
+ let r = {
469
+ stderr: n,
470
+ stdout: t,
471
+ exitCode: this.exitCode
472
+ };
473
+ if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new U(this, r);
474
+ return r;
475
+ }
476
+ then(e, t) {
477
+ return this._waitForOutput().then(e, t);
478
+ }
479
+ _streamOut;
480
+ _streamErr;
481
+ spawn() {
482
+ let e = u(), t = this._options, n = {
483
+ ...G,
484
+ ...t.nodeOptions
485
+ }, r = [];
486
+ this._resetState(), t.timeout !== void 0 && r.push(AbortSignal.timeout(t.timeout)), t.signal !== void 0 && r.push(t.signal), t.persist === !0 && (n.detached = !0), r.length > 0 && (n.signal = q(r)), n.env = k(e, n.env);
487
+ let { command: i, args: o } = K(this._command, this._args), s = (0, H._parse)(i, o, n), c = a(s.command, s.args, s.options);
488
+ if (c.stderr && (this._streamErr = c.stderr), c.stdout && (this._streamOut = c.stdout), this._process = c, c.once(`error`, this._onError), c.once(`close`, this._onClose), t.stdin !== void 0 && c.stdin && t.stdin.process) {
489
+ let { stdout: e } = t.stdin.process;
490
+ e && e.pipe(c.stdin);
491
+ }
492
+ }
493
+ _resetState() {
494
+ this._aborted = !1, this._processClosed = new Promise((e) => {
495
+ this._resolveClose = e;
496
+ }), this._thrownError = void 0;
497
+ }
498
+ _onError = (e) => {
499
+ if (e.name === `AbortError` && (!(e.cause instanceof Error) || e.cause.name !== `TimeoutError`)) {
500
+ this._aborted = !0;
501
+ return;
502
+ }
503
+ this._thrownError = e;
504
+ };
505
+ _onClose = () => {
506
+ this._resolveClose && this._resolveClose();
507
+ };
508
+ };
509
+ const X = (e, t, n) => {
510
+ let r = new Y(e, t, n);
511
+ return r.spawn(), r;
512
+ }, ae = X;
513
+ var oe = e({
514
+ detectPackageManager: () => $,
515
+ installDependencies: () => fe,
516
+ packageManagers: () => Q
517
+ });
518
+ async function se(e, t, n = {}) {
519
+ let r = g(e).split(`/`);
520
+ for (; r.length > 0;) {
521
+ let e = await t(r.join(`/`) || `/`);
522
+ if (e || !n.includeParentDirs) return e;
523
+ r.pop();
524
+ }
525
+ }
526
+ function ce(e) {
527
+ let t;
528
+ return () => (t === void 0 && (t = e().then((e) => (t = e, t))), t);
529
+ }
530
+ const Z = ce(async () => {
531
+ if (globalThis.process?.versions?.webcontainer) return !1;
532
+ try {
533
+ let { exitCode: e } = await X(`corepack`, [`--version`]);
534
+ return e === 0;
535
+ } catch {
536
+ return !1;
537
+ }
538
+ });
539
+ async function le(e, t, n = {}) {
540
+ let r = e !== `npm` && e !== `bun` && e !== `deno` && n.corepack !== !1 && await Z() ? [`corepack`, [e, ...t]] : [e, t], { exitCode: i, stdout: a, stderr: o } = await X(r[0], r[1], { nodeOptions: {
541
+ cwd: y(n.cwd || process.cwd()),
542
+ env: n.env,
543
+ stdio: n.silent ? `pipe` : `inherit`
544
+ } });
545
+ if (i !== 0) throw Error(`\`${r.flat().join(` `)}\` failed.${n.silent ? [
546
+ ``,
547
+ a,
548
+ o
549
+ ].join(`
550
+ `) : ``}`);
551
+ }
552
+ async function ue(e = {}) {
553
+ let t = e.cwd || process.cwd(), n = {
554
+ ...process.env,
555
+ ...e.env
556
+ }, r = (typeof e.packageManager == `string` ? Q.find((t) => t.name === e.packageManager) : e.packageManager) || await $(e.cwd || process.cwd());
557
+ if (!r) throw Error(`No package manager auto-detected.`);
558
+ return {
559
+ cwd: t,
560
+ env: n,
561
+ silent: e.silent ?? !1,
562
+ packageManager: r,
563
+ dev: e.dev ?? !1,
564
+ workspace: e.workspace,
565
+ global: e.global ?? !1,
566
+ dry: e.dry ?? !1,
567
+ corepack: e.corepack ?? !0
568
+ };
569
+ }
570
+ function de(e) {
571
+ let [t, n] = (e || ``).split(`@`), [r, i] = n?.split(`+`) || [];
572
+ if (t && t !== `-` && /^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(t)) return {
573
+ name: t,
574
+ version: r,
575
+ buildMeta: i
576
+ };
577
+ let a = (t || ``).replace(/\W+/g, ``);
578
+ return {
579
+ name: a,
580
+ version: r,
581
+ buildMeta: i,
582
+ warnings: [`Abnormal characters found in \`packageManager\` field, sanitizing from \`${t}\` to \`${a}\``]
583
+ };
584
+ }
585
+ const Q = [
586
+ {
587
+ name: `npm`,
588
+ command: `npm`,
589
+ lockFile: `package-lock.json`
590
+ },
591
+ {
592
+ name: `pnpm`,
593
+ command: `pnpm`,
594
+ lockFile: `pnpm-lock.yaml`,
595
+ files: [`pnpm-workspace.yaml`]
596
+ },
597
+ {
598
+ name: `bun`,
599
+ command: `bun`,
600
+ lockFile: [`bun.lockb`, `bun.lock`]
601
+ },
602
+ {
603
+ name: `yarn`,
604
+ command: `yarn`,
605
+ lockFile: `yarn.lock`,
606
+ files: [`.yarnrc.yml`]
607
+ },
608
+ {
609
+ name: `deno`,
610
+ command: `deno`,
611
+ lockFile: `deno.lock`,
612
+ files: [`deno.json`]
613
+ }
614
+ ];
615
+ async function $(e, t = {}) {
616
+ let i = await se(y(e || `.`), async (e) => {
617
+ if (!t.ignorePackageJSON) {
618
+ let t = _(e, `package.json`);
619
+ if (n(t)) {
620
+ let e = JSON.parse(await r(t, `utf8`));
621
+ if (e?.packageManager) {
622
+ let { name: t, version: n = `0.0.0`, buildMeta: r, warnings: i } = de(e.packageManager);
623
+ if (t) {
624
+ let e = n.split(`.`)[0], a = Q.find((n) => n.name === t && n.majorVersion === e) || Q.find((e) => e.name === t);
625
+ return {
626
+ name: t,
627
+ command: t,
628
+ version: n,
629
+ majorVersion: e,
630
+ buildMeta: r,
631
+ warnings: i,
632
+ files: a?.files,
633
+ lockFile: a?.lockFile
634
+ };
635
+ }
636
+ }
637
+ }
638
+ if (n(_(e, `deno.json`))) return Q.find((e) => e.name === `deno`);
639
+ }
640
+ if (!t.ignoreLockFile) {
641
+ for (let t of Q) if ([t.lockFile, t.files].flat().filter(Boolean).some((t) => n(y(e, t)))) return { ...t };
642
+ }
643
+ }, { includeParentDirs: t.includeParentDirs ?? !0 });
644
+ if (!i && !t.ignoreArgv) {
645
+ let e = process.argv[1];
646
+ if (e) {
647
+ for (let t of Q) if (RegExp(`[/\\\\]\\.?${t.command}`).test(e)) return t;
648
+ }
649
+ }
650
+ return i;
651
+ }
652
+ async function fe(e = {}) {
653
+ let t = await ue(e), n = e.frozenLockFile ? {
654
+ npm: [`ci`],
655
+ yarn: [`install`, `--immutable`],
656
+ bun: [`install`, `--frozen-lockfile`],
657
+ pnpm: [`install`, `--frozen-lockfile`],
658
+ deno: [`install`, `--frozen`]
659
+ }[t.packageManager.name] : [`install`];
660
+ return e.ignoreWorkspace && t.packageManager.name === `pnpm` && n.push(`--ignore-workspace`), t.dry || await le(t.packageManager.command, n, {
661
+ cwd: t.cwd,
662
+ silent: t.silent,
663
+ corepack: t.corepack
664
+ }), { exec: {
665
+ command: t.packageManager.command,
666
+ args: n
667
+ } };
668
+ }
669
+ export { y as a, S as i, ne as n, C as r, oe as t };