@pandacss/studio 0.21.0 → 0.22.1

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 (64) hide show
  1. package/astro.config.mjs +3 -9
  2. package/dist/studio.d.mts +1 -1
  3. package/dist/studio.d.ts +1 -1
  4. package/dist/studio.js +38 -2050
  5. package/dist/studio.mjs +42 -2080
  6. package/package.json +11 -14
  7. package/src/components/sizes.tsx +4 -3
  8. package/styled-system/helpers.mjs +3 -1
  9. package/styled-system/jsx/aspect-ratio.mjs +2 -5
  10. package/styled-system/jsx/bleed.mjs +2 -5
  11. package/styled-system/jsx/box.mjs +3 -7
  12. package/styled-system/jsx/center.mjs +2 -5
  13. package/styled-system/jsx/circle.mjs +2 -5
  14. package/styled-system/jsx/container.mjs +3 -7
  15. package/styled-system/jsx/divider.mjs +2 -5
  16. package/styled-system/jsx/factory.mjs +1 -2
  17. package/styled-system/jsx/flex.mjs +2 -5
  18. package/styled-system/jsx/float.mjs +2 -5
  19. package/styled-system/jsx/grid-item.mjs +2 -5
  20. package/styled-system/jsx/grid.mjs +2 -5
  21. package/styled-system/jsx/hstack.mjs +2 -5
  22. package/styled-system/jsx/index.d.ts +0 -3
  23. package/styled-system/jsx/link-box.mjs +3 -7
  24. package/styled-system/jsx/link-overlay.mjs +3 -7
  25. package/styled-system/jsx/spacer.mjs +2 -5
  26. package/styled-system/jsx/square.mjs +2 -5
  27. package/styled-system/jsx/stack.mjs +2 -5
  28. package/styled-system/jsx/styled-link.mjs +3 -7
  29. package/styled-system/jsx/visually-hidden.mjs +3 -7
  30. package/styled-system/jsx/vstack.mjs +2 -5
  31. package/styled-system/jsx/wrap.mjs +2 -5
  32. package/styled-system/styles.css +1277 -542
  33. package/styled-system/types/conditions.d.ts +1 -1
  34. package/styled-system/types/csstype.d.ts +1270 -721
  35. package/styled-system/types/recipe.d.ts +9 -0
  36. package/styled-system/types/static-css.d.ts +39 -0
  37. package/styled-system/chunks/src__components__color-constrast.css +0 -106
  38. package/styled-system/chunks/src__components__color-wrapper.css +0 -58
  39. package/styled-system/chunks/src__components__colors.css +0 -106
  40. package/styled-system/chunks/src__components__empty-state.css +0 -46
  41. package/styled-system/chunks/src__components__font-family.css +0 -86
  42. package/styled-system/chunks/src__components__font-tokens.css +0 -62
  43. package/styled-system/chunks/src__components__input.css +0 -58
  44. package/styled-system/chunks/src__components__layer-styles.css +0 -63
  45. package/styled-system/chunks/src__components__nav-item.css +0 -57
  46. package/styled-system/chunks/src__components__overview.css +0 -122
  47. package/styled-system/chunks/src__components__radii.css +0 -50
  48. package/styled-system/chunks/src__components__semantic-color.css +0 -70
  49. package/styled-system/chunks/src__components__side-nav-item.css +0 -30
  50. package/styled-system/chunks/src__components__side-nav.css +0 -50
  51. package/styled-system/chunks/src__components__sizes.css +0 -42
  52. package/styled-system/chunks/src__components__text-styles.css +0 -32
  53. package/styled-system/chunks/src__components__theme-toggle.css +0 -62
  54. package/styled-system/chunks/src__components__token-content.css +0 -14
  55. package/styled-system/chunks/src__components__token-group.css +0 -22
  56. package/styled-system/chunks/src__components__typography-playground.css +0 -62
  57. package/styled-system/chunks/src__layouts__Sidebar.css +0 -114
  58. package/styled-system/global.css +0 -58
  59. package/styled-system/reset.css +0 -214
  60. package/styled-system/static.css +0 -5
  61. package/styled-system/tokens/index.css +0 -437
  62. package/styled-system/tokens/keyframes.css +0 -28
  63. package/styled-system/types/helpers.d.ts +0 -2
  64. package/virtual-panda.ts +0 -62
package/dist/studio.js CHANGED
@@ -5,12 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __esm = (fn, res) => function __init() {
9
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
- };
11
- var __commonJS = (cb, mod) => function __require() {
12
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13
- };
14
8
  var __export = (target, all) => {
15
9
  for (var name in all)
16
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -33,873 +27,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
27
  ));
34
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
29
 
36
- // ../../node_modules/.pnpm/tsup@7.1.0_typescript@5.2.2/node_modules/tsup/assets/cjs_shims.js
37
- var getImportMetaUrl, importMetaUrl;
38
- var init_cjs_shims = __esm({
39
- "../../node_modules/.pnpm/tsup@7.1.0_typescript@5.2.2/node_modules/tsup/assets/cjs_shims.js"() {
40
- "use strict";
41
- getImportMetaUrl = () => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
42
- importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
43
- }
44
- });
45
-
46
- // ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js
47
- var require_windows = __commonJS({
48
- "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports, module2) {
49
- "use strict";
50
- init_cjs_shims();
51
- module2.exports = isexe;
52
- isexe.sync = sync;
53
- var fs = require("fs");
54
- function checkPathExt(path3, options) {
55
- var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
56
- if (!pathext) {
57
- return true;
58
- }
59
- pathext = pathext.split(";");
60
- if (pathext.indexOf("") !== -1) {
61
- return true;
62
- }
63
- for (var i = 0; i < pathext.length; i++) {
64
- var p = pathext[i].toLowerCase();
65
- if (p && path3.substr(-p.length).toLowerCase() === p) {
66
- return true;
67
- }
68
- }
69
- return false;
70
- }
71
- function checkStat(stat, path3, options) {
72
- if (!stat.isSymbolicLink() && !stat.isFile()) {
73
- return false;
74
- }
75
- return checkPathExt(path3, options);
76
- }
77
- function isexe(path3, options, cb) {
78
- fs.stat(path3, function(er, stat) {
79
- cb(er, er ? false : checkStat(stat, path3, options));
80
- });
81
- }
82
- function sync(path3, options) {
83
- return checkStat(fs.statSync(path3), path3, options);
84
- }
85
- }
86
- });
87
-
88
- // ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js
89
- var require_mode = __commonJS({
90
- "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports, module2) {
91
- "use strict";
92
- init_cjs_shims();
93
- module2.exports = isexe;
94
- isexe.sync = sync;
95
- var fs = require("fs");
96
- function isexe(path3, options, cb) {
97
- fs.stat(path3, function(er, stat) {
98
- cb(er, er ? false : checkStat(stat, options));
99
- });
100
- }
101
- function sync(path3, options) {
102
- return checkStat(fs.statSync(path3), options);
103
- }
104
- function checkStat(stat, options) {
105
- return stat.isFile() && checkMode(stat, options);
106
- }
107
- function checkMode(stat, options) {
108
- var mod = stat.mode;
109
- var uid = stat.uid;
110
- var gid = stat.gid;
111
- var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
112
- var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
113
- var u = parseInt("100", 8);
114
- var g = parseInt("010", 8);
115
- var o = parseInt("001", 8);
116
- var ug = u | g;
117
- var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
118
- return ret;
119
- }
120
- }
121
- });
122
-
123
- // ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js
124
- var require_isexe = __commonJS({
125
- "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports, module2) {
126
- "use strict";
127
- init_cjs_shims();
128
- var fs = require("fs");
129
- var core;
130
- if (process.platform === "win32" || global.TESTING_WINDOWS) {
131
- core = require_windows();
132
- } else {
133
- core = require_mode();
134
- }
135
- module2.exports = isexe;
136
- isexe.sync = sync;
137
- function isexe(path3, options, cb) {
138
- if (typeof options === "function") {
139
- cb = options;
140
- options = {};
141
- }
142
- if (!cb) {
143
- if (typeof Promise !== "function") {
144
- throw new TypeError("callback not provided");
145
- }
146
- return new Promise(function(resolve, reject) {
147
- isexe(path3, options || {}, function(er, is) {
148
- if (er) {
149
- reject(er);
150
- } else {
151
- resolve(is);
152
- }
153
- });
154
- });
155
- }
156
- core(path3, options || {}, function(er, is) {
157
- if (er) {
158
- if (er.code === "EACCES" || options && options.ignoreErrors) {
159
- er = null;
160
- is = false;
161
- }
162
- }
163
- cb(er, is);
164
- });
165
- }
166
- function sync(path3, options) {
167
- try {
168
- return core.sync(path3, options || {});
169
- } catch (er) {
170
- if (options && options.ignoreErrors || er.code === "EACCES") {
171
- return false;
172
- } else {
173
- throw er;
174
- }
175
- }
176
- }
177
- }
178
- });
179
-
180
- // ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
181
- var require_which = __commonJS({
182
- "../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports, module2) {
183
- "use strict";
184
- init_cjs_shims();
185
- var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
186
- var path3 = require("path");
187
- var COLON = isWindows ? ";" : ":";
188
- var isexe = require_isexe();
189
- var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
190
- var getPathInfo = (cmd, opt) => {
191
- const colon = opt.colon || COLON;
192
- const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
193
- // windows always checks the cwd first
194
- ...isWindows ? [process.cwd()] : [],
195
- ...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
196
- "").split(colon)
197
- ];
198
- const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
199
- const pathExt = isWindows ? pathExtExe.split(colon) : [""];
200
- if (isWindows) {
201
- if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
202
- pathExt.unshift("");
203
- }
204
- return {
205
- pathEnv,
206
- pathExt,
207
- pathExtExe
208
- };
209
- };
210
- var which = (cmd, opt, cb) => {
211
- if (typeof opt === "function") {
212
- cb = opt;
213
- opt = {};
214
- }
215
- if (!opt)
216
- opt = {};
217
- const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
218
- const found = [];
219
- const step = (i) => new Promise((resolve, reject) => {
220
- if (i === pathEnv.length)
221
- return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
222
- const ppRaw = pathEnv[i];
223
- const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
224
- const pCmd = path3.join(pathPart, cmd);
225
- const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
226
- resolve(subStep(p, i, 0));
227
- });
228
- const subStep = (p, i, ii) => new Promise((resolve, reject) => {
229
- if (ii === pathExt.length)
230
- return resolve(step(i + 1));
231
- const ext = pathExt[ii];
232
- isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
233
- if (!er && is) {
234
- if (opt.all)
235
- found.push(p + ext);
236
- else
237
- return resolve(p + ext);
238
- }
239
- return resolve(subStep(p, i, ii + 1));
240
- });
241
- });
242
- return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
243
- };
244
- var whichSync = (cmd, opt) => {
245
- opt = opt || {};
246
- const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
247
- const found = [];
248
- for (let i = 0; i < pathEnv.length; i++) {
249
- const ppRaw = pathEnv[i];
250
- const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
251
- const pCmd = path3.join(pathPart, cmd);
252
- const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
253
- for (let j = 0; j < pathExt.length; j++) {
254
- const cur = p + pathExt[j];
255
- try {
256
- const is = isexe.sync(cur, { pathExt: pathExtExe });
257
- if (is) {
258
- if (opt.all)
259
- found.push(cur);
260
- else
261
- return cur;
262
- }
263
- } catch (ex) {
264
- }
265
- }
266
- }
267
- if (opt.all && found.length)
268
- return found;
269
- if (opt.nothrow)
270
- return null;
271
- throw getNotFoundError(cmd);
272
- };
273
- module2.exports = which;
274
- which.sync = whichSync;
275
- }
276
- });
277
-
278
- // ../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js
279
- var require_path_key = __commonJS({
280
- "../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js"(exports, module2) {
281
- "use strict";
282
- init_cjs_shims();
283
- var pathKey2 = (options = {}) => {
284
- const environment = options.env || process.env;
285
- const platform = options.platform || process.platform;
286
- if (platform !== "win32") {
287
- return "PATH";
288
- }
289
- return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
290
- };
291
- module2.exports = pathKey2;
292
- module2.exports.default = pathKey2;
293
- }
294
- });
295
-
296
- // ../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/resolveCommand.js
297
- var require_resolveCommand = __commonJS({
298
- "../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module2) {
299
- "use strict";
300
- init_cjs_shims();
301
- var path3 = require("path");
302
- var which = require_which();
303
- var getPathKey = require_path_key();
304
- function resolveCommandAttempt(parsed, withoutPathExt) {
305
- const env = parsed.options.env || process.env;
306
- const cwd = process.cwd();
307
- const hasCustomCwd = parsed.options.cwd != null;
308
- const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
309
- if (shouldSwitchCwd) {
310
- try {
311
- process.chdir(parsed.options.cwd);
312
- } catch (err) {
313
- }
314
- }
315
- let resolved;
316
- try {
317
- resolved = which.sync(parsed.command, {
318
- path: env[getPathKey({ env })],
319
- pathExt: withoutPathExt ? path3.delimiter : void 0
320
- });
321
- } catch (e) {
322
- } finally {
323
- if (shouldSwitchCwd) {
324
- process.chdir(cwd);
325
- }
326
- }
327
- if (resolved) {
328
- resolved = path3.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
329
- }
330
- return resolved;
331
- }
332
- function resolveCommand(parsed) {
333
- return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
334
- }
335
- module2.exports = resolveCommand;
336
- }
337
- });
338
-
339
- // ../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/escape.js
340
- var require_escape = __commonJS({
341
- "../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/escape.js"(exports, module2) {
342
- "use strict";
343
- init_cjs_shims();
344
- var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
345
- function escapeCommand(arg) {
346
- arg = arg.replace(metaCharsRegExp, "^$1");
347
- return arg;
348
- }
349
- function escapeArgument(arg, doubleEscapeMetaChars) {
350
- arg = `${arg}`;
351
- arg = arg.replace(/(\\*)"/g, '$1$1\\"');
352
- arg = arg.replace(/(\\*)$/, "$1$1");
353
- arg = `"${arg}"`;
354
- arg = arg.replace(metaCharsRegExp, "^$1");
355
- if (doubleEscapeMetaChars) {
356
- arg = arg.replace(metaCharsRegExp, "^$1");
357
- }
358
- return arg;
359
- }
360
- module2.exports.command = escapeCommand;
361
- module2.exports.argument = escapeArgument;
362
- }
363
- });
364
-
365
- // ../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js
366
- var require_shebang_regex = __commonJS({
367
- "../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"(exports, module2) {
368
- "use strict";
369
- init_cjs_shims();
370
- module2.exports = /^#!(.*)/;
371
- }
372
- });
373
-
374
- // ../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js
375
- var require_shebang_command = __commonJS({
376
- "../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"(exports, module2) {
377
- "use strict";
378
- init_cjs_shims();
379
- var shebangRegex = require_shebang_regex();
380
- module2.exports = (string = "") => {
381
- const match = string.match(shebangRegex);
382
- if (!match) {
383
- return null;
384
- }
385
- const [path3, argument] = match[0].replace(/#! ?/, "").split(" ");
386
- const binary = path3.split("/").pop();
387
- if (binary === "env") {
388
- return argument;
389
- }
390
- return argument ? `${binary} ${argument}` : binary;
391
- };
392
- }
393
- });
394
-
395
- // ../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/readShebang.js
396
- var require_readShebang = __commonJS({
397
- "../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module2) {
398
- "use strict";
399
- init_cjs_shims();
400
- var fs = require("fs");
401
- var shebangCommand = require_shebang_command();
402
- function readShebang(command) {
403
- const size = 150;
404
- const buffer = Buffer.alloc(size);
405
- let fd;
406
- try {
407
- fd = fs.openSync(command, "r");
408
- fs.readSync(fd, buffer, 0, size, 0);
409
- fs.closeSync(fd);
410
- } catch (e) {
411
- }
412
- return shebangCommand(buffer.toString());
413
- }
414
- module2.exports = readShebang;
415
- }
416
- });
417
-
418
- // ../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/parse.js
419
- var require_parse = __commonJS({
420
- "../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/parse.js"(exports, module2) {
421
- "use strict";
422
- init_cjs_shims();
423
- var path3 = require("path");
424
- var resolveCommand = require_resolveCommand();
425
- var escape = require_escape();
426
- var readShebang = require_readShebang();
427
- var isWin = process.platform === "win32";
428
- var isExecutableRegExp = /\.(?:com|exe)$/i;
429
- var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
430
- function detectShebang(parsed) {
431
- parsed.file = resolveCommand(parsed);
432
- const shebang = parsed.file && readShebang(parsed.file);
433
- if (shebang) {
434
- parsed.args.unshift(parsed.file);
435
- parsed.command = shebang;
436
- return resolveCommand(parsed);
437
- }
438
- return parsed.file;
439
- }
440
- function parseNonShell(parsed) {
441
- if (!isWin) {
442
- return parsed;
443
- }
444
- const commandFile = detectShebang(parsed);
445
- const needsShell = !isExecutableRegExp.test(commandFile);
446
- if (parsed.options.forceShell || needsShell) {
447
- const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
448
- parsed.command = path3.normalize(parsed.command);
449
- parsed.command = escape.command(parsed.command);
450
- parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
451
- const shellCommand = [parsed.command].concat(parsed.args).join(" ");
452
- parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
453
- parsed.command = process.env.comspec || "cmd.exe";
454
- parsed.options.windowsVerbatimArguments = true;
455
- }
456
- return parsed;
457
- }
458
- function parse(command, args, options) {
459
- if (args && !Array.isArray(args)) {
460
- options = args;
461
- args = null;
462
- }
463
- args = args ? args.slice(0) : [];
464
- options = Object.assign({}, options);
465
- const parsed = {
466
- command,
467
- args,
468
- options,
469
- file: void 0,
470
- original: {
471
- command,
472
- args
473
- }
474
- };
475
- return options.shell ? parsed : parseNonShell(parsed);
476
- }
477
- module2.exports = parse;
478
- }
479
- });
480
-
481
- // ../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/enoent.js
482
- var require_enoent = __commonJS({
483
- "../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/enoent.js"(exports, module2) {
484
- "use strict";
485
- init_cjs_shims();
486
- var isWin = process.platform === "win32";
487
- function notFoundError(original, syscall) {
488
- return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
489
- code: "ENOENT",
490
- errno: "ENOENT",
491
- syscall: `${syscall} ${original.command}`,
492
- path: original.command,
493
- spawnargs: original.args
494
- });
495
- }
496
- function hookChildProcess(cp, parsed) {
497
- if (!isWin) {
498
- return;
499
- }
500
- const originalEmit = cp.emit;
501
- cp.emit = function(name, arg1) {
502
- if (name === "exit") {
503
- const err = verifyENOENT(arg1, parsed, "spawn");
504
- if (err) {
505
- return originalEmit.call(cp, "error", err);
506
- }
507
- }
508
- return originalEmit.apply(cp, arguments);
509
- };
510
- }
511
- function verifyENOENT(status, parsed) {
512
- if (isWin && status === 1 && !parsed.file) {
513
- return notFoundError(parsed.original, "spawn");
514
- }
515
- return null;
516
- }
517
- function verifyENOENTSync(status, parsed) {
518
- if (isWin && status === 1 && !parsed.file) {
519
- return notFoundError(parsed.original, "spawnSync");
520
- }
521
- return null;
522
- }
523
- module2.exports = {
524
- hookChildProcess,
525
- verifyENOENT,
526
- verifyENOENTSync,
527
- notFoundError
528
- };
529
- }
530
- });
531
-
532
- // ../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/index.js
533
- var require_cross_spawn = __commonJS({
534
- "../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/index.js"(exports, module2) {
535
- "use strict";
536
- init_cjs_shims();
537
- var cp = require("child_process");
538
- var parse = require_parse();
539
- var enoent = require_enoent();
540
- function spawn(command, args, options) {
541
- const parsed = parse(command, args, options);
542
- const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
543
- enoent.hookChildProcess(spawned, parsed);
544
- return spawned;
545
- }
546
- function spawnSync(command, args, options) {
547
- const parsed = parse(command, args, options);
548
- const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
549
- result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
550
- return result;
551
- }
552
- module2.exports = spawn;
553
- module2.exports.spawn = spawn;
554
- module2.exports.sync = spawnSync;
555
- module2.exports._parse = parse;
556
- module2.exports._enoent = enoent;
557
- }
558
- });
559
-
560
- // ../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js
561
- var require_signals = __commonJS({
562
- "../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js"(exports, module2) {
563
- "use strict";
564
- init_cjs_shims();
565
- module2.exports = [
566
- "SIGABRT",
567
- "SIGALRM",
568
- "SIGHUP",
569
- "SIGINT",
570
- "SIGTERM"
571
- ];
572
- if (process.platform !== "win32") {
573
- module2.exports.push(
574
- "SIGVTALRM",
575
- "SIGXCPU",
576
- "SIGXFSZ",
577
- "SIGUSR2",
578
- "SIGTRAP",
579
- "SIGSYS",
580
- "SIGQUIT",
581
- "SIGIOT"
582
- // should detect profiler and enable/disable accordingly.
583
- // see #21
584
- // 'SIGPROF'
585
- );
586
- }
587
- if (process.platform === "linux") {
588
- module2.exports.push(
589
- "SIGIO",
590
- "SIGPOLL",
591
- "SIGPWR",
592
- "SIGSTKFLT",
593
- "SIGUNUSED"
594
- );
595
- }
596
- }
597
- });
598
-
599
- // ../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js
600
- var require_signal_exit = __commonJS({
601
- "../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js"(exports, module2) {
602
- "use strict";
603
- init_cjs_shims();
604
- var process6 = global.process;
605
- var processOk = function(process7) {
606
- return process7 && typeof process7 === "object" && typeof process7.removeListener === "function" && typeof process7.emit === "function" && typeof process7.reallyExit === "function" && typeof process7.listeners === "function" && typeof process7.kill === "function" && typeof process7.pid === "number" && typeof process7.on === "function";
607
- };
608
- if (!processOk(process6)) {
609
- module2.exports = function() {
610
- return function() {
611
- };
612
- };
613
- } else {
614
- assert = require("assert");
615
- signals = require_signals();
616
- isWin = /^win/i.test(process6.platform);
617
- EE = require("events");
618
- if (typeof EE !== "function") {
619
- EE = EE.EventEmitter;
620
- }
621
- if (process6.__signal_exit_emitter__) {
622
- emitter = process6.__signal_exit_emitter__;
623
- } else {
624
- emitter = process6.__signal_exit_emitter__ = new EE();
625
- emitter.count = 0;
626
- emitter.emitted = {};
627
- }
628
- if (!emitter.infinite) {
629
- emitter.setMaxListeners(Infinity);
630
- emitter.infinite = true;
631
- }
632
- module2.exports = function(cb, opts) {
633
- if (!processOk(global.process)) {
634
- return function() {
635
- };
636
- }
637
- assert.equal(typeof cb, "function", "a callback must be provided for exit handler");
638
- if (loaded === false) {
639
- load();
640
- }
641
- var ev = "exit";
642
- if (opts && opts.alwaysLast) {
643
- ev = "afterexit";
644
- }
645
- var remove = function() {
646
- emitter.removeListener(ev, cb);
647
- if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) {
648
- unload();
649
- }
650
- };
651
- emitter.on(ev, cb);
652
- return remove;
653
- };
654
- unload = function unload2() {
655
- if (!loaded || !processOk(global.process)) {
656
- return;
657
- }
658
- loaded = false;
659
- signals.forEach(function(sig) {
660
- try {
661
- process6.removeListener(sig, sigListeners[sig]);
662
- } catch (er) {
663
- }
664
- });
665
- process6.emit = originalProcessEmit;
666
- process6.reallyExit = originalProcessReallyExit;
667
- emitter.count -= 1;
668
- };
669
- module2.exports.unload = unload;
670
- emit = function emit2(event, code, signal) {
671
- if (emitter.emitted[event]) {
672
- return;
673
- }
674
- emitter.emitted[event] = true;
675
- emitter.emit(event, code, signal);
676
- };
677
- sigListeners = {};
678
- signals.forEach(function(sig) {
679
- sigListeners[sig] = function listener() {
680
- if (!processOk(global.process)) {
681
- return;
682
- }
683
- var listeners = process6.listeners(sig);
684
- if (listeners.length === emitter.count) {
685
- unload();
686
- emit("exit", null, sig);
687
- emit("afterexit", null, sig);
688
- if (isWin && sig === "SIGHUP") {
689
- sig = "SIGINT";
690
- }
691
- process6.kill(process6.pid, sig);
692
- }
693
- };
694
- });
695
- module2.exports.signals = function() {
696
- return signals;
697
- };
698
- loaded = false;
699
- load = function load2() {
700
- if (loaded || !processOk(global.process)) {
701
- return;
702
- }
703
- loaded = true;
704
- emitter.count += 1;
705
- signals = signals.filter(function(sig) {
706
- try {
707
- process6.on(sig, sigListeners[sig]);
708
- return true;
709
- } catch (er) {
710
- return false;
711
- }
712
- });
713
- process6.emit = processEmit;
714
- process6.reallyExit = processReallyExit;
715
- };
716
- module2.exports.load = load;
717
- originalProcessReallyExit = process6.reallyExit;
718
- processReallyExit = function processReallyExit2(code) {
719
- if (!processOk(global.process)) {
720
- return;
721
- }
722
- process6.exitCode = code || /* istanbul ignore next */
723
- 0;
724
- emit("exit", process6.exitCode, null);
725
- emit("afterexit", process6.exitCode, null);
726
- originalProcessReallyExit.call(process6, process6.exitCode);
727
- };
728
- originalProcessEmit = process6.emit;
729
- processEmit = function processEmit2(ev, arg) {
730
- if (ev === "exit" && processOk(global.process)) {
731
- if (arg !== void 0) {
732
- process6.exitCode = arg;
733
- }
734
- var ret = originalProcessEmit.apply(this, arguments);
735
- emit("exit", process6.exitCode, null);
736
- emit("afterexit", process6.exitCode, null);
737
- return ret;
738
- } else {
739
- return originalProcessEmit.apply(this, arguments);
740
- }
741
- };
742
- }
743
- var assert;
744
- var signals;
745
- var isWin;
746
- var EE;
747
- var emitter;
748
- var unload;
749
- var emit;
750
- var sigListeners;
751
- var loaded;
752
- var load;
753
- var originalProcessReallyExit;
754
- var processReallyExit;
755
- var originalProcessEmit;
756
- var processEmit;
757
- }
758
- });
759
-
760
- // ../../node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js
761
- var require_buffer_stream = __commonJS({
762
- "../../node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js"(exports, module2) {
763
- "use strict";
764
- init_cjs_shims();
765
- var { PassThrough: PassThroughStream } = require("stream");
766
- module2.exports = (options) => {
767
- options = { ...options };
768
- const { array } = options;
769
- let { encoding } = options;
770
- const isBuffer = encoding === "buffer";
771
- let objectMode = false;
772
- if (array) {
773
- objectMode = !(encoding || isBuffer);
774
- } else {
775
- encoding = encoding || "utf8";
776
- }
777
- if (isBuffer) {
778
- encoding = null;
779
- }
780
- const stream = new PassThroughStream({ objectMode });
781
- if (encoding) {
782
- stream.setEncoding(encoding);
783
- }
784
- let length = 0;
785
- const chunks = [];
786
- stream.on("data", (chunk) => {
787
- chunks.push(chunk);
788
- if (objectMode) {
789
- length = chunks.length;
790
- } else {
791
- length += chunk.length;
792
- }
793
- });
794
- stream.getBufferedValue = () => {
795
- if (array) {
796
- return chunks;
797
- }
798
- return isBuffer ? Buffer.concat(chunks, length) : chunks.join("");
799
- };
800
- stream.getBufferedLength = () => length;
801
- return stream;
802
- };
803
- }
804
- });
805
-
806
- // ../../node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js
807
- var require_get_stream = __commonJS({
808
- "../../node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js"(exports, module2) {
809
- "use strict";
810
- init_cjs_shims();
811
- var { constants: BufferConstants } = require("buffer");
812
- var stream = require("stream");
813
- var { promisify } = require("util");
814
- var bufferStream = require_buffer_stream();
815
- var streamPipelinePromisified = promisify(stream.pipeline);
816
- var MaxBufferError = class extends Error {
817
- constructor() {
818
- super("maxBuffer exceeded");
819
- this.name = "MaxBufferError";
820
- }
821
- };
822
- async function getStream2(inputStream, options) {
823
- if (!inputStream) {
824
- throw new Error("Expected a stream");
825
- }
826
- options = {
827
- maxBuffer: Infinity,
828
- ...options
829
- };
830
- const { maxBuffer } = options;
831
- const stream2 = bufferStream(options);
832
- await new Promise((resolve, reject) => {
833
- const rejectPromise = (error) => {
834
- if (error && stream2.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
835
- error.bufferedData = stream2.getBufferedValue();
836
- }
837
- reject(error);
838
- };
839
- (async () => {
840
- try {
841
- await streamPipelinePromisified(inputStream, stream2);
842
- resolve();
843
- } catch (error) {
844
- rejectPromise(error);
845
- }
846
- })();
847
- stream2.on("data", () => {
848
- if (stream2.getBufferedLength() > maxBuffer) {
849
- rejectPromise(new MaxBufferError());
850
- }
851
- });
852
- });
853
- return stream2.getBufferedValue();
854
- }
855
- module2.exports = getStream2;
856
- module2.exports.buffer = (stream2, options) => getStream2(stream2, { ...options, encoding: "buffer" });
857
- module2.exports.array = (stream2, options) => getStream2(stream2, { ...options, array: true });
858
- module2.exports.MaxBufferError = MaxBufferError;
859
- }
860
- });
861
-
862
- // ../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js
863
- var require_merge_stream = __commonJS({
864
- "../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js"(exports, module2) {
865
- "use strict";
866
- init_cjs_shims();
867
- var { PassThrough } = require("stream");
868
- module2.exports = function() {
869
- var sources = [];
870
- var output = new PassThrough({ objectMode: true });
871
- output.setMaxListeners(0);
872
- output.add = add;
873
- output.isEmpty = isEmpty;
874
- output.on("unpipe", remove);
875
- Array.prototype.slice.call(arguments).forEach(add);
876
- return output;
877
- function add(source) {
878
- if (Array.isArray(source)) {
879
- source.forEach(add);
880
- return this;
881
- }
882
- sources.push(source);
883
- source.once("end", remove.bind(null, source));
884
- source.once("error", output.emit.bind(output, "error"));
885
- source.pipe(output, { end: false });
886
- return this;
887
- }
888
- function isEmpty() {
889
- return sources.length == 0;
890
- }
891
- function remove(source) {
892
- sources = sources.filter(function(it) {
893
- return it !== source;
894
- });
895
- if (!sources.length && output.readable) {
896
- output.end();
897
- }
898
- }
899
- };
900
- }
901
- });
902
-
903
30
  // scripts/studio.ts
904
31
  var studio_exports = {};
905
32
  __export(studio_exports, {
@@ -909,1195 +36,56 @@ __export(studio_exports, {
909
36
  serveStudio: () => serveStudio
910
37
  });
911
38
  module.exports = __toCommonJS(studio_exports);
912
- init_cjs_shims();
913
39
  var import_logger = require("@pandacss/logger");
914
-
915
- // ../../node_modules/.pnpm/execa@7.2.0/node_modules/execa/index.js
916
- init_cjs_shims();
917
- var import_node_buffer2 = require("buffer");
918
- var import_node_path2 = __toESM(require("path"), 1);
919
- var import_node_child_process3 = __toESM(require("child_process"), 1);
920
- var import_node_process4 = __toESM(require("process"), 1);
921
- var import_cross_spawn = __toESM(require_cross_spawn(), 1);
922
-
923
- // ../../node_modules/.pnpm/strip-final-newline@3.0.0/node_modules/strip-final-newline/index.js
924
- init_cjs_shims();
925
- function stripFinalNewline(input) {
926
- const LF = typeof input === "string" ? "\n" : "\n".charCodeAt();
927
- const CR = typeof input === "string" ? "\r" : "\r".charCodeAt();
928
- if (input[input.length - 1] === LF) {
929
- input = input.slice(0, -1);
930
- }
931
- if (input[input.length - 1] === CR) {
932
- input = input.slice(0, -1);
933
- }
934
- return input;
935
- }
936
-
937
- // ../../node_modules/.pnpm/npm-run-path@5.1.0/node_modules/npm-run-path/index.js
938
- init_cjs_shims();
939
- var import_node_process = __toESM(require("process"), 1);
940
- var import_node_path = __toESM(require("path"), 1);
941
- var import_node_url = __toESM(require("url"), 1);
942
-
943
- // ../../node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js
944
- init_cjs_shims();
945
- function pathKey(options = {}) {
946
- const {
947
- env = process.env,
948
- platform = process.platform
949
- } = options;
950
- if (platform !== "win32") {
951
- return "PATH";
952
- }
953
- return Object.keys(env).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
954
- }
955
-
956
- // ../../node_modules/.pnpm/npm-run-path@5.1.0/node_modules/npm-run-path/index.js
957
- function npmRunPath(options = {}) {
958
- const {
959
- cwd = import_node_process.default.cwd(),
960
- path: path_ = import_node_process.default.env[pathKey()],
961
- execPath = import_node_process.default.execPath
962
- } = options;
963
- let previous;
964
- const cwdString = cwd instanceof URL ? import_node_url.default.fileURLToPath(cwd) : cwd;
965
- let cwdPath = import_node_path.default.resolve(cwdString);
966
- const result = [];
967
- while (previous !== cwdPath) {
968
- result.push(import_node_path.default.join(cwdPath, "node_modules/.bin"));
969
- previous = cwdPath;
970
- cwdPath = import_node_path.default.resolve(cwdPath, "..");
971
- }
972
- result.push(import_node_path.default.resolve(cwdString, execPath, ".."));
973
- return [...result, path_].join(import_node_path.default.delimiter);
974
- }
975
- function npmRunPathEnv({ env = import_node_process.default.env, ...options } = {}) {
976
- env = { ...env };
977
- const path3 = pathKey({ env });
978
- options.path = env[path3];
979
- env[path3] = npmRunPath(options);
980
- return env;
981
- }
982
-
983
- // ../../node_modules/.pnpm/onetime@6.0.0/node_modules/onetime/index.js
984
- init_cjs_shims();
985
-
986
- // ../../node_modules/.pnpm/mimic-fn@4.0.0/node_modules/mimic-fn/index.js
987
- init_cjs_shims();
988
- var copyProperty = (to, from, property, ignoreNonConfigurable) => {
989
- if (property === "length" || property === "prototype") {
990
- return;
991
- }
992
- if (property === "arguments" || property === "caller") {
993
- return;
994
- }
995
- const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
996
- const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
997
- if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
998
- return;
999
- }
1000
- Object.defineProperty(to, property, fromDescriptor);
1001
- };
1002
- var canCopyProperty = function(toDescriptor, fromDescriptor) {
1003
- return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
1004
- };
1005
- var changePrototype = (to, from) => {
1006
- const fromPrototype = Object.getPrototypeOf(from);
1007
- if (fromPrototype === Object.getPrototypeOf(to)) {
1008
- return;
1009
- }
1010
- Object.setPrototypeOf(to, fromPrototype);
1011
- };
1012
- var wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/
1013
- ${fromBody}`;
1014
- var toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString");
1015
- var toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name");
1016
- var changeToString = (to, from, name) => {
1017
- const withName = name === "" ? "" : `with ${name.trim()}() `;
1018
- const newToString = wrappedToString.bind(null, withName, from.toString());
1019
- Object.defineProperty(newToString, "name", toStringName);
1020
- Object.defineProperty(to, "toString", { ...toStringDescriptor, value: newToString });
1021
- };
1022
- function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
1023
- const { name } = to;
1024
- for (const property of Reflect.ownKeys(from)) {
1025
- copyProperty(to, from, property, ignoreNonConfigurable);
1026
- }
1027
- changePrototype(to, from);
1028
- changeToString(to, from, name);
1029
- return to;
1030
- }
1031
-
1032
- // ../../node_modules/.pnpm/onetime@6.0.0/node_modules/onetime/index.js
1033
- var calledFunctions = /* @__PURE__ */ new WeakMap();
1034
- var onetime = (function_, options = {}) => {
1035
- if (typeof function_ !== "function") {
1036
- throw new TypeError("Expected a function");
1037
- }
1038
- let returnValue;
1039
- let callCount = 0;
1040
- const functionName = function_.displayName || function_.name || "<anonymous>";
1041
- const onetime2 = function(...arguments_) {
1042
- calledFunctions.set(onetime2, ++callCount);
1043
- if (callCount === 1) {
1044
- returnValue = function_.apply(this, arguments_);
1045
- function_ = null;
1046
- } else if (options.throw === true) {
1047
- throw new Error(`Function \`${functionName}\` can only be called once`);
1048
- }
1049
- return returnValue;
1050
- };
1051
- mimicFunction(onetime2, function_);
1052
- calledFunctions.set(onetime2, callCount);
1053
- return onetime2;
1054
- };
1055
- onetime.callCount = (function_) => {
1056
- if (!calledFunctions.has(function_)) {
1057
- throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
1058
- }
1059
- return calledFunctions.get(function_);
1060
- };
1061
- var onetime_default = onetime;
1062
-
1063
- // ../../node_modules/.pnpm/execa@7.2.0/node_modules/execa/lib/error.js
1064
- init_cjs_shims();
1065
- var import_node_process2 = __toESM(require("process"), 1);
1066
-
1067
- // ../../node_modules/.pnpm/human-signals@4.3.1/node_modules/human-signals/build/src/main.js
1068
- init_cjs_shims();
1069
- var import_node_os2 = require("os");
1070
-
1071
- // ../../node_modules/.pnpm/human-signals@4.3.1/node_modules/human-signals/build/src/realtime.js
1072
- init_cjs_shims();
1073
- var getRealtimeSignals = () => {
1074
- const length = SIGRTMAX - SIGRTMIN + 1;
1075
- return Array.from({ length }, getRealtimeSignal);
1076
- };
1077
- var getRealtimeSignal = (value, index) => ({
1078
- name: `SIGRT${index + 1}`,
1079
- number: SIGRTMIN + index,
1080
- action: "terminate",
1081
- description: "Application-specific signal (realtime)",
1082
- standard: "posix"
1083
- });
1084
- var SIGRTMIN = 34;
1085
- var SIGRTMAX = 64;
1086
-
1087
- // ../../node_modules/.pnpm/human-signals@4.3.1/node_modules/human-signals/build/src/signals.js
1088
- init_cjs_shims();
1089
- var import_node_os = require("os");
1090
-
1091
- // ../../node_modules/.pnpm/human-signals@4.3.1/node_modules/human-signals/build/src/core.js
1092
- init_cjs_shims();
1093
- var SIGNALS = [
1094
- {
1095
- name: "SIGHUP",
1096
- number: 1,
1097
- action: "terminate",
1098
- description: "Terminal closed",
1099
- standard: "posix"
1100
- },
1101
- {
1102
- name: "SIGINT",
1103
- number: 2,
1104
- action: "terminate",
1105
- description: "User interruption with CTRL-C",
1106
- standard: "ansi"
1107
- },
1108
- {
1109
- name: "SIGQUIT",
1110
- number: 3,
1111
- action: "core",
1112
- description: "User interruption with CTRL-\\",
1113
- standard: "posix"
1114
- },
1115
- {
1116
- name: "SIGILL",
1117
- number: 4,
1118
- action: "core",
1119
- description: "Invalid machine instruction",
1120
- standard: "ansi"
1121
- },
1122
- {
1123
- name: "SIGTRAP",
1124
- number: 5,
1125
- action: "core",
1126
- description: "Debugger breakpoint",
1127
- standard: "posix"
1128
- },
1129
- {
1130
- name: "SIGABRT",
1131
- number: 6,
1132
- action: "core",
1133
- description: "Aborted",
1134
- standard: "ansi"
1135
- },
1136
- {
1137
- name: "SIGIOT",
1138
- number: 6,
1139
- action: "core",
1140
- description: "Aborted",
1141
- standard: "bsd"
1142
- },
1143
- {
1144
- name: "SIGBUS",
1145
- number: 7,
1146
- action: "core",
1147
- description: "Bus error due to misaligned, non-existing address or paging error",
1148
- standard: "bsd"
1149
- },
1150
- {
1151
- name: "SIGEMT",
1152
- number: 7,
1153
- action: "terminate",
1154
- description: "Command should be emulated but is not implemented",
1155
- standard: "other"
1156
- },
1157
- {
1158
- name: "SIGFPE",
1159
- number: 8,
1160
- action: "core",
1161
- description: "Floating point arithmetic error",
1162
- standard: "ansi"
1163
- },
1164
- {
1165
- name: "SIGKILL",
1166
- number: 9,
1167
- action: "terminate",
1168
- description: "Forced termination",
1169
- standard: "posix",
1170
- forced: true
1171
- },
1172
- {
1173
- name: "SIGUSR1",
1174
- number: 10,
1175
- action: "terminate",
1176
- description: "Application-specific signal",
1177
- standard: "posix"
1178
- },
1179
- {
1180
- name: "SIGSEGV",
1181
- number: 11,
1182
- action: "core",
1183
- description: "Segmentation fault",
1184
- standard: "ansi"
1185
- },
1186
- {
1187
- name: "SIGUSR2",
1188
- number: 12,
1189
- action: "terminate",
1190
- description: "Application-specific signal",
1191
- standard: "posix"
1192
- },
1193
- {
1194
- name: "SIGPIPE",
1195
- number: 13,
1196
- action: "terminate",
1197
- description: "Broken pipe or socket",
1198
- standard: "posix"
1199
- },
1200
- {
1201
- name: "SIGALRM",
1202
- number: 14,
1203
- action: "terminate",
1204
- description: "Timeout or timer",
1205
- standard: "posix"
1206
- },
1207
- {
1208
- name: "SIGTERM",
1209
- number: 15,
1210
- action: "terminate",
1211
- description: "Termination",
1212
- standard: "ansi"
1213
- },
1214
- {
1215
- name: "SIGSTKFLT",
1216
- number: 16,
1217
- action: "terminate",
1218
- description: "Stack is empty or overflowed",
1219
- standard: "other"
1220
- },
1221
- {
1222
- name: "SIGCHLD",
1223
- number: 17,
1224
- action: "ignore",
1225
- description: "Child process terminated, paused or unpaused",
1226
- standard: "posix"
1227
- },
1228
- {
1229
- name: "SIGCLD",
1230
- number: 17,
1231
- action: "ignore",
1232
- description: "Child process terminated, paused or unpaused",
1233
- standard: "other"
1234
- },
1235
- {
1236
- name: "SIGCONT",
1237
- number: 18,
1238
- action: "unpause",
1239
- description: "Unpaused",
1240
- standard: "posix",
1241
- forced: true
1242
- },
1243
- {
1244
- name: "SIGSTOP",
1245
- number: 19,
1246
- action: "pause",
1247
- description: "Paused",
1248
- standard: "posix",
1249
- forced: true
1250
- },
1251
- {
1252
- name: "SIGTSTP",
1253
- number: 20,
1254
- action: "pause",
1255
- description: 'Paused using CTRL-Z or "suspend"',
1256
- standard: "posix"
1257
- },
1258
- {
1259
- name: "SIGTTIN",
1260
- number: 21,
1261
- action: "pause",
1262
- description: "Background process cannot read terminal input",
1263
- standard: "posix"
1264
- },
1265
- {
1266
- name: "SIGBREAK",
1267
- number: 21,
1268
- action: "terminate",
1269
- description: "User interruption with CTRL-BREAK",
1270
- standard: "other"
1271
- },
1272
- {
1273
- name: "SIGTTOU",
1274
- number: 22,
1275
- action: "pause",
1276
- description: "Background process cannot write to terminal output",
1277
- standard: "posix"
1278
- },
1279
- {
1280
- name: "SIGURG",
1281
- number: 23,
1282
- action: "ignore",
1283
- description: "Socket received out-of-band data",
1284
- standard: "bsd"
1285
- },
1286
- {
1287
- name: "SIGXCPU",
1288
- number: 24,
1289
- action: "core",
1290
- description: "Process timed out",
1291
- standard: "bsd"
1292
- },
1293
- {
1294
- name: "SIGXFSZ",
1295
- number: 25,
1296
- action: "core",
1297
- description: "File too big",
1298
- standard: "bsd"
1299
- },
1300
- {
1301
- name: "SIGVTALRM",
1302
- number: 26,
1303
- action: "terminate",
1304
- description: "Timeout or timer",
1305
- standard: "bsd"
1306
- },
1307
- {
1308
- name: "SIGPROF",
1309
- number: 27,
1310
- action: "terminate",
1311
- description: "Timeout or timer",
1312
- standard: "bsd"
1313
- },
1314
- {
1315
- name: "SIGWINCH",
1316
- number: 28,
1317
- action: "ignore",
1318
- description: "Terminal window size changed",
1319
- standard: "bsd"
1320
- },
1321
- {
1322
- name: "SIGIO",
1323
- number: 29,
1324
- action: "terminate",
1325
- description: "I/O is available",
1326
- standard: "other"
1327
- },
1328
- {
1329
- name: "SIGPOLL",
1330
- number: 29,
1331
- action: "terminate",
1332
- description: "Watched event",
1333
- standard: "other"
1334
- },
1335
- {
1336
- name: "SIGINFO",
1337
- number: 29,
1338
- action: "ignore",
1339
- description: "Request for process information",
1340
- standard: "other"
1341
- },
1342
- {
1343
- name: "SIGPWR",
1344
- number: 30,
1345
- action: "terminate",
1346
- description: "Device running out of power",
1347
- standard: "systemv"
1348
- },
1349
- {
1350
- name: "SIGSYS",
1351
- number: 31,
1352
- action: "core",
1353
- description: "Invalid system call",
1354
- standard: "other"
1355
- },
1356
- {
1357
- name: "SIGUNUSED",
1358
- number: 31,
1359
- action: "terminate",
1360
- description: "Invalid system call",
1361
- standard: "other"
1362
- }
1363
- ];
1364
-
1365
- // ../../node_modules/.pnpm/human-signals@4.3.1/node_modules/human-signals/build/src/signals.js
1366
- var getSignals = () => {
1367
- const realtimeSignals = getRealtimeSignals();
1368
- const signals = [...SIGNALS, ...realtimeSignals].map(normalizeSignal);
1369
- return signals;
1370
- };
1371
- var normalizeSignal = ({
1372
- name,
1373
- number: defaultNumber,
1374
- description,
1375
- action,
1376
- forced = false,
1377
- standard
1378
- }) => {
1379
- const {
1380
- signals: { [name]: constantSignal }
1381
- } = import_node_os.constants;
1382
- const supported = constantSignal !== void 0;
1383
- const number = supported ? constantSignal : defaultNumber;
1384
- return { name, number, description, supported, action, forced, standard };
1385
- };
1386
-
1387
- // ../../node_modules/.pnpm/human-signals@4.3.1/node_modules/human-signals/build/src/main.js
1388
- var getSignalsByName = () => {
1389
- const signals = getSignals();
1390
- return Object.fromEntries(signals.map(getSignalByName));
1391
- };
1392
- var getSignalByName = ({
1393
- name,
1394
- number,
1395
- description,
1396
- supported,
1397
- action,
1398
- forced,
1399
- standard
1400
- }) => [name, { name, number, description, supported, action, forced, standard }];
1401
- var signalsByName = getSignalsByName();
1402
- var getSignalsByNumber = () => {
1403
- const signals = getSignals();
1404
- const length = SIGRTMAX + 1;
1405
- const signalsA = Array.from({ length }, (value, number) => getSignalByNumber(number, signals));
1406
- return Object.assign({}, ...signalsA);
1407
- };
1408
- var getSignalByNumber = (number, signals) => {
1409
- const signal = findSignalByNumber(number, signals);
1410
- if (signal === void 0) {
1411
- return {};
1412
- }
1413
- const { name, description, supported, action, forced, standard } = signal;
1414
- return {
1415
- [number]: {
1416
- name,
1417
- number,
1418
- description,
1419
- supported,
1420
- action,
1421
- forced,
1422
- standard
1423
- }
1424
- };
1425
- };
1426
- var findSignalByNumber = (number, signals) => {
1427
- const signal = signals.find(({ name }) => import_node_os2.constants.signals[name] === number);
1428
- if (signal !== void 0) {
1429
- return signal;
1430
- }
1431
- return signals.find((signalA) => signalA.number === number);
1432
- };
1433
- var signalsByNumber = getSignalsByNumber();
1434
-
1435
- // ../../node_modules/.pnpm/execa@7.2.0/node_modules/execa/lib/error.js
1436
- var getErrorPrefix = ({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled }) => {
1437
- if (timedOut) {
1438
- return `timed out after ${timeout} milliseconds`;
1439
- }
1440
- if (isCanceled) {
1441
- return "was canceled";
1442
- }
1443
- if (errorCode !== void 0) {
1444
- return `failed with ${errorCode}`;
1445
- }
1446
- if (signal !== void 0) {
1447
- return `was killed with ${signal} (${signalDescription})`;
1448
- }
1449
- if (exitCode !== void 0) {
1450
- return `failed with exit code ${exitCode}`;
1451
- }
1452
- return "failed";
1453
- };
1454
- var makeError = ({
1455
- stdout,
1456
- stderr,
1457
- all,
1458
- error,
1459
- signal,
1460
- exitCode,
1461
- command,
1462
- escapedCommand,
1463
- timedOut,
1464
- isCanceled,
1465
- killed,
1466
- parsed: { options: { timeout, cwd = import_node_process2.default.cwd() } }
1467
- }) => {
1468
- exitCode = exitCode === null ? void 0 : exitCode;
1469
- signal = signal === null ? void 0 : signal;
1470
- const signalDescription = signal === void 0 ? void 0 : signalsByName[signal].description;
1471
- const errorCode = error && error.code;
1472
- const prefix = getErrorPrefix({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled });
1473
- const execaMessage = `Command ${prefix}: ${command}`;
1474
- const isError = Object.prototype.toString.call(error) === "[object Error]";
1475
- const shortMessage = isError ? `${execaMessage}
1476
- ${error.message}` : execaMessage;
1477
- const message = [shortMessage, stderr, stdout].filter(Boolean).join("\n");
1478
- if (isError) {
1479
- error.originalMessage = error.message;
1480
- error.message = message;
1481
- } else {
1482
- error = new Error(message);
1483
- }
1484
- error.shortMessage = shortMessage;
1485
- error.command = command;
1486
- error.escapedCommand = escapedCommand;
1487
- error.exitCode = exitCode;
1488
- error.signal = signal;
1489
- error.signalDescription = signalDescription;
1490
- error.stdout = stdout;
1491
- error.stderr = stderr;
1492
- error.cwd = cwd;
1493
- if (all !== void 0) {
1494
- error.all = all;
1495
- }
1496
- if ("bufferedData" in error) {
1497
- delete error.bufferedData;
1498
- }
1499
- error.failed = true;
1500
- error.timedOut = Boolean(timedOut);
1501
- error.isCanceled = isCanceled;
1502
- error.killed = killed && !timedOut;
1503
- return error;
1504
- };
1505
-
1506
- // ../../node_modules/.pnpm/execa@7.2.0/node_modules/execa/lib/stdio.js
1507
- init_cjs_shims();
1508
- var aliases = ["stdin", "stdout", "stderr"];
1509
- var hasAlias = (options) => aliases.some((alias) => options[alias] !== void 0);
1510
- var normalizeStdio = (options) => {
1511
- if (!options) {
1512
- return;
1513
- }
1514
- const { stdio } = options;
1515
- if (stdio === void 0) {
1516
- return aliases.map((alias) => options[alias]);
1517
- }
1518
- if (hasAlias(options)) {
1519
- throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map((alias) => `\`${alias}\``).join(", ")}`);
1520
- }
1521
- if (typeof stdio === "string") {
1522
- return stdio;
1523
- }
1524
- if (!Array.isArray(stdio)) {
1525
- throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
1526
- }
1527
- const length = Math.max(stdio.length, aliases.length);
1528
- return Array.from({ length }, (value, index) => stdio[index]);
1529
- };
1530
-
1531
- // ../../node_modules/.pnpm/execa@7.2.0/node_modules/execa/lib/kill.js
1532
- init_cjs_shims();
1533
- var import_node_os3 = __toESM(require("os"), 1);
1534
- var import_signal_exit = __toESM(require_signal_exit(), 1);
1535
- var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5;
1536
- var spawnedKill = (kill, signal = "SIGTERM", options = {}) => {
1537
- const killResult = kill(signal);
1538
- setKillTimeout(kill, signal, options, killResult);
1539
- return killResult;
1540
- };
1541
- var setKillTimeout = (kill, signal, options, killResult) => {
1542
- if (!shouldForceKill(signal, options, killResult)) {
1543
- return;
1544
- }
1545
- const timeout = getForceKillAfterTimeout(options);
1546
- const t = setTimeout(() => {
1547
- kill("SIGKILL");
1548
- }, timeout);
1549
- if (t.unref) {
1550
- t.unref();
1551
- }
1552
- };
1553
- var shouldForceKill = (signal, { forceKillAfterTimeout }, killResult) => isSigterm(signal) && forceKillAfterTimeout !== false && killResult;
1554
- var isSigterm = (signal) => signal === import_node_os3.default.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM";
1555
- var getForceKillAfterTimeout = ({ forceKillAfterTimeout = true }) => {
1556
- if (forceKillAfterTimeout === true) {
1557
- return DEFAULT_FORCE_KILL_TIMEOUT;
1558
- }
1559
- if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) {
1560
- throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`);
1561
- }
1562
- return forceKillAfterTimeout;
1563
- };
1564
- var spawnedCancel = (spawned, context) => {
1565
- const killResult = spawned.kill();
1566
- if (killResult) {
1567
- context.isCanceled = true;
1568
- }
1569
- };
1570
- var timeoutKill = (spawned, signal, reject) => {
1571
- spawned.kill(signal);
1572
- reject(Object.assign(new Error("Timed out"), { timedOut: true, signal }));
1573
- };
1574
- var setupTimeout = (spawned, { timeout, killSignal = "SIGTERM" }, spawnedPromise) => {
1575
- if (timeout === 0 || timeout === void 0) {
1576
- return spawnedPromise;
1577
- }
1578
- let timeoutId;
1579
- const timeoutPromise = new Promise((resolve, reject) => {
1580
- timeoutId = setTimeout(() => {
1581
- timeoutKill(spawned, killSignal, reject);
1582
- }, timeout);
1583
- });
1584
- const safeSpawnedPromise = spawnedPromise.finally(() => {
1585
- clearTimeout(timeoutId);
1586
- });
1587
- return Promise.race([timeoutPromise, safeSpawnedPromise]);
1588
- };
1589
- var validateTimeout = ({ timeout }) => {
1590
- if (timeout !== void 0 && (!Number.isFinite(timeout) || timeout < 0)) {
1591
- throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`);
1592
- }
1593
- };
1594
- var setExitHandler = async (spawned, { cleanup, detached }, timedPromise) => {
1595
- if (!cleanup || detached) {
1596
- return timedPromise;
1597
- }
1598
- const removeExitHandler = (0, import_signal_exit.default)(() => {
1599
- spawned.kill();
1600
- });
1601
- return timedPromise.finally(() => {
1602
- removeExitHandler();
1603
- });
1604
- };
1605
-
1606
- // ../../node_modules/.pnpm/execa@7.2.0/node_modules/execa/lib/pipe.js
1607
- init_cjs_shims();
1608
- var import_node_fs = require("fs");
1609
- var import_node_child_process = require("child_process");
1610
-
1611
- // ../../node_modules/.pnpm/is-stream@3.0.0/node_modules/is-stream/index.js
1612
- init_cjs_shims();
1613
- function isStream(stream) {
1614
- return stream !== null && typeof stream === "object" && typeof stream.pipe === "function";
1615
- }
1616
- function isWritableStream(stream) {
1617
- return isStream(stream) && stream.writable !== false && typeof stream._write === "function" && typeof stream._writableState === "object";
1618
- }
1619
-
1620
- // ../../node_modules/.pnpm/execa@7.2.0/node_modules/execa/lib/pipe.js
1621
- var isExecaChildProcess = (target) => target instanceof import_node_child_process.ChildProcess && typeof target.then === "function";
1622
- var pipeToTarget = (spawned, streamName, target) => {
1623
- if (typeof target === "string") {
1624
- spawned[streamName].pipe((0, import_node_fs.createWriteStream)(target));
1625
- return spawned;
1626
- }
1627
- if (isWritableStream(target)) {
1628
- spawned[streamName].pipe(target);
1629
- return spawned;
1630
- }
1631
- if (!isExecaChildProcess(target)) {
1632
- throw new TypeError("The second argument must be a string, a stream or an Execa child process.");
1633
- }
1634
- if (!isWritableStream(target.stdin)) {
1635
- throw new TypeError("The target child process's stdin must be available.");
1636
- }
1637
- spawned[streamName].pipe(target.stdin);
1638
- return target;
1639
- };
1640
- var addPipeMethods = (spawned) => {
1641
- if (spawned.stdout !== null) {
1642
- spawned.pipeStdout = pipeToTarget.bind(void 0, spawned, "stdout");
1643
- }
1644
- if (spawned.stderr !== null) {
1645
- spawned.pipeStderr = pipeToTarget.bind(void 0, spawned, "stderr");
1646
- }
1647
- if (spawned.all !== void 0) {
1648
- spawned.pipeAll = pipeToTarget.bind(void 0, spawned, "all");
1649
- }
1650
- };
1651
-
1652
- // ../../node_modules/.pnpm/execa@7.2.0/node_modules/execa/lib/stream.js
1653
- init_cjs_shims();
1654
- var import_node_fs2 = require("fs");
1655
- var import_get_stream = __toESM(require_get_stream(), 1);
1656
- var import_merge_stream = __toESM(require_merge_stream(), 1);
1657
- var validateInputOptions = (input) => {
1658
- if (input !== void 0) {
1659
- throw new TypeError("The `input` and `inputFile` options cannot be both set.");
1660
- }
1661
- };
1662
- var getInputSync = ({ input, inputFile }) => {
1663
- if (typeof inputFile !== "string") {
1664
- return input;
1665
- }
1666
- validateInputOptions(input);
1667
- return (0, import_node_fs2.readFileSync)(inputFile);
1668
- };
1669
- var handleInputSync = (options) => {
1670
- const input = getInputSync(options);
1671
- if (isStream(input)) {
1672
- throw new TypeError("The `input` option cannot be a stream in sync mode");
1673
- }
1674
- return input;
1675
- };
1676
- var getInput = ({ input, inputFile }) => {
1677
- if (typeof inputFile !== "string") {
1678
- return input;
1679
- }
1680
- validateInputOptions(input);
1681
- return (0, import_node_fs2.createReadStream)(inputFile);
1682
- };
1683
- var handleInput = (spawned, options) => {
1684
- const input = getInput(options);
1685
- if (input === void 0) {
1686
- return;
1687
- }
1688
- if (isStream(input)) {
1689
- input.pipe(spawned.stdin);
1690
- } else {
1691
- spawned.stdin.end(input);
1692
- }
1693
- };
1694
- var makeAllStream = (spawned, { all }) => {
1695
- if (!all || !spawned.stdout && !spawned.stderr) {
1696
- return;
1697
- }
1698
- const mixed = (0, import_merge_stream.default)();
1699
- if (spawned.stdout) {
1700
- mixed.add(spawned.stdout);
1701
- }
1702
- if (spawned.stderr) {
1703
- mixed.add(spawned.stderr);
1704
- }
1705
- return mixed;
1706
- };
1707
- var getBufferedData = async (stream, streamPromise) => {
1708
- if (!stream || streamPromise === void 0) {
1709
- return;
1710
- }
1711
- stream.destroy();
40
+ var import_node_path = require("path");
41
+ var appPath = (0, import_node_path.join)(__dirname, "..");
42
+ async function buildStudio({ outDir, configPath }) {
43
+ const astro = await import("astro");
44
+ const { default: react } = await import("@astrojs/react");
45
+ const { default: studio } = await import("@pandacss/astro-plugin-studio");
1712
46
  try {
1713
- return await streamPromise;
47
+ process.env.PUBLIC_CONFIG_PATH = configPath;
48
+ await astro.build({
49
+ outDir,
50
+ root: appPath,
51
+ integrations: [react(), studio()]
52
+ });
1714
53
  } catch (error) {
1715
- return error.bufferedData;
1716
- }
1717
- };
1718
- var getStreamPromise = (stream, { encoding, buffer, maxBuffer }) => {
1719
- if (!stream || !buffer) {
1720
- return;
54
+ console.log(error);
1721
55
  }
1722
- if (encoding) {
1723
- return (0, import_get_stream.default)(stream, { encoding, maxBuffer });
1724
- }
1725
- return import_get_stream.default.buffer(stream, { maxBuffer });
1726
- };
1727
- var getSpawnedResult = async ({ stdout, stderr, all }, { encoding, buffer, maxBuffer }, processDone) => {
1728
- const stdoutPromise = getStreamPromise(stdout, { encoding, buffer, maxBuffer });
1729
- const stderrPromise = getStreamPromise(stderr, { encoding, buffer, maxBuffer });
1730
- const allPromise = getStreamPromise(all, { encoding, buffer, maxBuffer: maxBuffer * 2 });
56
+ }
57
+ async function serveStudio({ configPath, port, host, outDir }) {
58
+ const astro = await import("astro");
59
+ const { default: react } = await import("@astrojs/react");
60
+ const { default: studio } = await import("@pandacss/astro-plugin-studio");
1731
61
  try {
1732
- return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]);
1733
- } catch (error) {
1734
- return Promise.all([
1735
- { error, signal: error.signal, timedOut: error.timedOut },
1736
- getBufferedData(stdout, stdoutPromise),
1737
- getBufferedData(stderr, stderrPromise),
1738
- getBufferedData(all, allPromise)
1739
- ]);
1740
- }
1741
- };
1742
-
1743
- // ../../node_modules/.pnpm/execa@7.2.0/node_modules/execa/lib/promise.js
1744
- init_cjs_shims();
1745
- var nativePromisePrototype = (/* @__PURE__ */ (async () => {
1746
- })()).constructor.prototype;
1747
- var descriptors = ["then", "catch", "finally"].map((property) => [
1748
- property,
1749
- Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property)
1750
- ]);
1751
- var mergePromise = (spawned, promise) => {
1752
- for (const [property, descriptor] of descriptors) {
1753
- const value = typeof promise === "function" ? (...args) => Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise);
1754
- Reflect.defineProperty(spawned, property, { ...descriptor, value });
1755
- }
1756
- };
1757
- var getSpawnedPromise = (spawned) => new Promise((resolve, reject) => {
1758
- spawned.on("exit", (exitCode, signal) => {
1759
- resolve({ exitCode, signal });
1760
- });
1761
- spawned.on("error", (error) => {
1762
- reject(error);
1763
- });
1764
- if (spawned.stdin) {
1765
- spawned.stdin.on("error", (error) => {
1766
- reject(error);
62
+ process.env.PUBLIC_CONFIG_PATH = configPath;
63
+ await astro.dev({
64
+ outDir,
65
+ root: appPath,
66
+ integrations: [react(), studio()],
67
+ server: {
68
+ port: port ? Number(port) : void 0,
69
+ host
70
+ }
1767
71
  });
1768
- }
1769
- });
1770
-
1771
- // ../../node_modules/.pnpm/execa@7.2.0/node_modules/execa/lib/command.js
1772
- init_cjs_shims();
1773
- var import_node_buffer = require("buffer");
1774
- var import_node_child_process2 = require("child_process");
1775
- var normalizeArgs = (file, args = []) => {
1776
- if (!Array.isArray(args)) {
1777
- return [file];
1778
- }
1779
- return [file, ...args];
1780
- };
1781
- var NO_ESCAPE_REGEXP = /^[\w.-]+$/;
1782
- var DOUBLE_QUOTES_REGEXP = /"/g;
1783
- var escapeArg = (arg) => {
1784
- if (typeof arg !== "string" || NO_ESCAPE_REGEXP.test(arg)) {
1785
- return arg;
1786
- }
1787
- return `"${arg.replace(DOUBLE_QUOTES_REGEXP, '\\"')}"`;
1788
- };
1789
- var joinCommand = (file, args) => normalizeArgs(file, args).join(" ");
1790
- var getEscapedCommand = (file, args) => normalizeArgs(file, args).map((arg) => escapeArg(arg)).join(" ");
1791
- var SPACES_REGEXP = / +/g;
1792
- var parseExpression = (expression) => {
1793
- const typeOfExpression = typeof expression;
1794
- if (typeOfExpression === "string") {
1795
- return expression;
1796
- }
1797
- if (typeOfExpression === "number") {
1798
- return String(expression);
1799
- }
1800
- if (typeOfExpression === "object" && expression !== null && !(expression instanceof import_node_child_process2.ChildProcess) && "stdout" in expression) {
1801
- const typeOfStdout = typeof expression.stdout;
1802
- if (typeOfStdout === "string") {
1803
- return expression.stdout;
1804
- }
1805
- if (import_node_buffer.Buffer.isBuffer(expression.stdout)) {
1806
- return expression.stdout.toString();
1807
- }
1808
- throw new TypeError(`Unexpected "${typeOfStdout}" stdout in template expression`);
1809
- }
1810
- throw new TypeError(`Unexpected "${typeOfExpression}" in template expression`);
1811
- };
1812
- var concatTokens = (tokens, nextTokens, isNew) => isNew || tokens.length === 0 || nextTokens.length === 0 ? [...tokens, ...nextTokens] : [
1813
- ...tokens.slice(0, -1),
1814
- `${tokens[tokens.length - 1]}${nextTokens[0]}`,
1815
- ...nextTokens.slice(1)
1816
- ];
1817
- var parseTemplate = ({ templates, expressions, tokens, index, template }) => {
1818
- const templateString = template ?? templates.raw[index];
1819
- const templateTokens = templateString.split(SPACES_REGEXP).filter(Boolean);
1820
- const newTokens = concatTokens(
1821
- tokens,
1822
- templateTokens,
1823
- templateString.startsWith(" ")
1824
- );
1825
- if (index === expressions.length) {
1826
- return newTokens;
1827
- }
1828
- const expression = expressions[index];
1829
- const expressionTokens = Array.isArray(expression) ? expression.map((expression2) => parseExpression(expression2)) : [parseExpression(expression)];
1830
- return concatTokens(
1831
- newTokens,
1832
- expressionTokens,
1833
- templateString.endsWith(" ")
1834
- );
1835
- };
1836
- var parseTemplates = (templates, expressions) => {
1837
- let tokens = [];
1838
- for (const [index, template] of templates.entries()) {
1839
- tokens = parseTemplate({ templates, expressions, tokens, index, template });
1840
- }
1841
- return tokens;
1842
- };
1843
-
1844
- // ../../node_modules/.pnpm/execa@7.2.0/node_modules/execa/lib/verbose.js
1845
- init_cjs_shims();
1846
- var import_node_util = require("util");
1847
- var import_node_process3 = __toESM(require("process"), 1);
1848
- var verboseDefault = (0, import_node_util.debuglog)("execa").enabled;
1849
- var padField = (field, padding) => String(field).padStart(padding, "0");
1850
- var getTimestamp = () => {
1851
- const date = /* @__PURE__ */ new Date();
1852
- return `${padField(date.getHours(), 2)}:${padField(date.getMinutes(), 2)}:${padField(date.getSeconds(), 2)}.${padField(date.getMilliseconds(), 3)}`;
1853
- };
1854
- var logCommand = (escapedCommand, { verbose }) => {
1855
- if (!verbose) {
1856
- return;
1857
- }
1858
- import_node_process3.default.stderr.write(`[${getTimestamp()}] ${escapedCommand}
1859
- `);
1860
- };
1861
-
1862
- // ../../node_modules/.pnpm/execa@7.2.0/node_modules/execa/index.js
1863
- var DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100;
1864
- var getEnv = ({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => {
1865
- const env = extendEnv ? { ...import_node_process4.default.env, ...envOption } : envOption;
1866
- if (preferLocal) {
1867
- return npmRunPathEnv({ env, cwd: localDir, execPath });
1868
- }
1869
- return env;
1870
- };
1871
- var handleArguments = (file, args, options = {}) => {
1872
- const parsed = import_cross_spawn.default._parse(file, args, options);
1873
- file = parsed.command;
1874
- args = parsed.args;
1875
- options = parsed.options;
1876
- options = {
1877
- maxBuffer: DEFAULT_MAX_BUFFER,
1878
- buffer: true,
1879
- stripFinalNewline: true,
1880
- extendEnv: true,
1881
- preferLocal: false,
1882
- localDir: options.cwd || import_node_process4.default.cwd(),
1883
- execPath: import_node_process4.default.execPath,
1884
- encoding: "utf8",
1885
- reject: true,
1886
- cleanup: true,
1887
- all: false,
1888
- windowsHide: true,
1889
- verbose: verboseDefault,
1890
- ...options
1891
- };
1892
- options.env = getEnv(options);
1893
- options.stdio = normalizeStdio(options);
1894
- if (import_node_process4.default.platform === "win32" && import_node_path2.default.basename(file, ".exe") === "cmd") {
1895
- args.unshift("/q");
1896
- }
1897
- return { file, args, options, parsed };
1898
- };
1899
- var handleOutput = (options, value, error) => {
1900
- if (typeof value !== "string" && !import_node_buffer2.Buffer.isBuffer(value)) {
1901
- return error === void 0 ? void 0 : "";
1902
- }
1903
- if (options.stripFinalNewline) {
1904
- return stripFinalNewline(value);
1905
- }
1906
- return value;
1907
- };
1908
- function execa(file, args, options) {
1909
- const parsed = handleArguments(file, args, options);
1910
- const command = joinCommand(file, args);
1911
- const escapedCommand = getEscapedCommand(file, args);
1912
- logCommand(escapedCommand, parsed.options);
1913
- validateTimeout(parsed.options);
1914
- let spawned;
1915
- try {
1916
- spawned = import_node_child_process3.default.spawn(parsed.file, parsed.args, parsed.options);
1917
72
  } catch (error) {
1918
- const dummySpawned = new import_node_child_process3.default.ChildProcess();
1919
- const errorPromise = Promise.reject(makeError({
1920
- error,
1921
- stdout: "",
1922
- stderr: "",
1923
- all: "",
1924
- command,
1925
- escapedCommand,
1926
- parsed,
1927
- timedOut: false,
1928
- isCanceled: false,
1929
- killed: false
1930
- }));
1931
- mergePromise(dummySpawned, errorPromise);
1932
- return dummySpawned;
73
+ console.log(error);
1933
74
  }
1934
- const spawnedPromise = getSpawnedPromise(spawned);
1935
- const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise);
1936
- const processDone = setExitHandler(spawned, parsed.options, timedPromise);
1937
- const context = { isCanceled: false };
1938
- spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned));
1939
- spawned.cancel = spawnedCancel.bind(null, spawned, context);
1940
- const handlePromise = async () => {
1941
- const [{ error, exitCode, signal, timedOut }, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone);
1942
- const stdout = handleOutput(parsed.options, stdoutResult);
1943
- const stderr = handleOutput(parsed.options, stderrResult);
1944
- const all = handleOutput(parsed.options, allResult);
1945
- if (error || exitCode !== 0 || signal !== null) {
1946
- const returnedError = makeError({
1947
- error,
1948
- exitCode,
1949
- signal,
1950
- stdout,
1951
- stderr,
1952
- all,
1953
- command,
1954
- escapedCommand,
1955
- parsed,
1956
- timedOut,
1957
- isCanceled: context.isCanceled || (parsed.options.signal ? parsed.options.signal.aborted : false),
1958
- killed: spawned.killed
1959
- });
1960
- if (!parsed.options.reject) {
1961
- return returnedError;
1962
- }
1963
- throw returnedError;
1964
- }
1965
- return {
1966
- command,
1967
- escapedCommand,
1968
- exitCode: 0,
1969
- stdout,
1970
- stderr,
1971
- all,
1972
- failed: false,
1973
- timedOut: false,
1974
- isCanceled: false,
1975
- killed: false
1976
- };
1977
- };
1978
- const handlePromiseOnce = onetime_default(handlePromise);
1979
- handleInput(spawned, parsed.options);
1980
- spawned.all = makeAllStream(spawned, parsed.options);
1981
- addPipeMethods(spawned);
1982
- mergePromise(spawned, handlePromiseOnce);
1983
- return spawned;
1984
75
  }
1985
- function execaSync(file, args, options) {
1986
- const parsed = handleArguments(file, args, options);
1987
- const command = joinCommand(file, args);
1988
- const escapedCommand = getEscapedCommand(file, args);
1989
- logCommand(escapedCommand, parsed.options);
1990
- const input = handleInputSync(parsed.options);
1991
- let result;
76
+ async function previewStudio({ outDir }) {
77
+ const astro = await import("astro");
78
+ const { default: react } = await import("@astrojs/react");
79
+ const { default: studio } = await import("@pandacss/astro-plugin-studio");
1992
80
  try {
1993
- result = import_node_child_process3.default.spawnSync(parsed.file, parsed.args, { ...parsed.options, input });
1994
- } catch (error) {
1995
- throw makeError({
1996
- error,
1997
- stdout: "",
1998
- stderr: "",
1999
- all: "",
2000
- command,
2001
- escapedCommand,
2002
- parsed,
2003
- timedOut: false,
2004
- isCanceled: false,
2005
- killed: false
2006
- });
2007
- }
2008
- const stdout = handleOutput(parsed.options, result.stdout, result.error);
2009
- const stderr = handleOutput(parsed.options, result.stderr, result.error);
2010
- if (result.error || result.status !== 0 || result.signal !== null) {
2011
- const error = makeError({
2012
- stdout,
2013
- stderr,
2014
- error: result.error,
2015
- signal: result.signal,
2016
- exitCode: result.status,
2017
- command,
2018
- escapedCommand,
2019
- parsed,
2020
- timedOut: result.error && result.error.code === "ETIMEDOUT",
2021
- isCanceled: false,
2022
- killed: result.signal !== null
81
+ await astro.preview({
82
+ outDir,
83
+ root: appPath,
84
+ integrations: [react(), studio()]
2023
85
  });
2024
- if (!parsed.options.reject) {
2025
- return error;
2026
- }
2027
- throw error;
2028
- }
2029
- return {
2030
- command,
2031
- escapedCommand,
2032
- exitCode: 0,
2033
- stdout,
2034
- stderr,
2035
- failed: false,
2036
- timedOut: false,
2037
- isCanceled: false,
2038
- killed: false
2039
- };
2040
- }
2041
- var normalizeScriptStdin = ({ input, inputFile, stdio }) => input === void 0 && inputFile === void 0 && stdio === void 0 ? { stdin: "inherit" } : {};
2042
- var normalizeScriptOptions = (options = {}) => ({
2043
- preferLocal: true,
2044
- ...normalizeScriptStdin(options),
2045
- ...options
2046
- });
2047
- function create$(options) {
2048
- function $2(templatesOrOptions, ...expressions) {
2049
- if (!Array.isArray(templatesOrOptions)) {
2050
- return create$({ ...options, ...templatesOrOptions });
2051
- }
2052
- const [file, ...args] = parseTemplates(templatesOrOptions, expressions);
2053
- return execa(file, args, normalizeScriptOptions(options));
86
+ } catch (error) {
87
+ console.log(error);
2054
88
  }
2055
- $2.sync = (templates, ...expressions) => {
2056
- if (!Array.isArray(templates)) {
2057
- throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");
2058
- }
2059
- const [file, ...args] = parseTemplates(templates, expressions);
2060
- return execaSync(file, args, normalizeScriptOptions(options));
2061
- };
2062
- return $2;
2063
- }
2064
- var $ = create$();
2065
-
2066
- // scripts/studio.ts
2067
- var import_node_path3 = require("path");
2068
- var import_node_module = require("module");
2069
- var require2 = (0, import_node_module.createRequire)(importMetaUrl);
2070
- var astroBin = require2.resolve("astro");
2071
- var appPath = (0, import_node_path3.join)(__dirname, "..");
2072
- async function buildStudio({ outDir, configPath }) {
2073
- process.env.ASTRO_OUT_DIR = outDir;
2074
- const { stdout } = await execa(astroBin, ["build", "--root", appPath], {
2075
- cwd: appPath,
2076
- env: {
2077
- PUBLIC_CONFIG_PATH: configPath
2078
- }
2079
- });
2080
- import_logger.logger.log(stdout);
2081
- }
2082
- async function serveStudio({ configPath, port, host }) {
2083
- const result = execa(astroBin, ["dev", "--root", appPath, "--port", port ?? "", host ? "--host" : ""], {
2084
- stdio: "inherit",
2085
- cwd: appPath,
2086
- env: {
2087
- PUBLIC_CONFIG_PATH: configPath
2088
- }
2089
- });
2090
- result.stdout?.pipe(process.stdout);
2091
- result.stderr?.pipe(process.stderr);
2092
- }
2093
- async function previewStudio({ outDir }) {
2094
- process.env.ASTRO_OUT_DIR = outDir;
2095
- const result = execa(astroBin, ["preview", "--root", appPath], {
2096
- stdio: "inherit",
2097
- cwd: appPath
2098
- });
2099
- result.stdout?.pipe(process.stdout);
2100
- result.stderr?.pipe(process.stderr);
2101
89
  }
2102
90
  function printUrls(options) {
2103
91
  const protocol = options.https ? "https" : "http";