@absolutejs/absolute 0.19.0-beta.110 → 0.19.0-beta.112

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.
package/dist/cli/index.js CHANGED
@@ -17,61 +17,6 @@ var __export = (target, all) => {
17
17
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
18
18
  var __require = import.meta.require;
19
19
 
20
- // src/constants.ts
21
- var ANSI_ESCAPE_LENGTH = 3, ASCII_SPACE = 32, BASE_36_RADIX = 36, BYTES_PER_KILOBYTE = 1024, CLI_ARGS_OFFSET = 3, DEFAULT_PORT = 3000, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, MAX_ERROR_LENGTH = 200, MILLISECONDS_IN_A_SECOND = 1000, MINUTES_IN_AN_HOUR = 60, SECONDS_IN_A_MINUTE = 60, MILLISECONDS_IN_A_MINUTE, MILLISECONDS_IN_A_DAY, SIGINT_EXIT_CODE = 130, SIGTERM_EXIT_CODE = 143, TIME_PRECISION = 2, TWO_THIRDS, UNFOUND_INDEX = -1;
22
- var init_constants = __esm(() => {
23
- MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;
24
- MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_DAY;
25
- TWO_THIRDS = 2 / 3;
26
- });
27
-
28
- // src/utils/getDurationString.ts
29
- var getDurationString = (duration) => {
30
- let durationString;
31
- if (duration < MILLISECONDS_IN_A_SECOND) {
32
- durationString = `${duration.toFixed(TIME_PRECISION)}ms`;
33
- } else if (duration < MILLISECONDS_IN_A_MINUTE) {
34
- durationString = `${(duration / MILLISECONDS_IN_A_SECOND).toFixed(TIME_PRECISION)}s`;
35
- } else {
36
- durationString = `${(duration / MILLISECONDS_IN_A_MINUTE).toFixed(TIME_PRECISION)}m`;
37
- }
38
- return durationString;
39
- };
40
- var init_getDurationString = __esm(() => {
41
- init_constants();
42
- });
43
-
44
- // src/utils/startupBanner.ts
45
- var MONTHS, formatTimestamp = () => {
46
- const now = new Date;
47
- const month = MONTHS[now.getMonth()];
48
- const day = now.getDate().toString().padStart(2, "0");
49
- let hours = now.getHours();
50
- const minutes = now.getMinutes().toString().padStart(2, "0");
51
- const seconds = now.getSeconds().toString().padStart(2, "0");
52
- const ampm = hours >= HOURS_IN_HALF_DAY ? "PM" : "AM";
53
- hours = hours % HOURS_IN_HALF_DAY || HOURS_IN_HALF_DAY;
54
- return `${month} ${day} ${hours}:${minutes}:${seconds} ${ampm}`;
55
- };
56
- var init_startupBanner = __esm(() => {
57
- init_constants();
58
- init_getDurationString();
59
- MONTHS = [
60
- "Jan",
61
- "Feb",
62
- "Mar",
63
- "Apr",
64
- "May",
65
- "Jun",
66
- "Jul",
67
- "Aug",
68
- "Sep",
69
- "Oct",
70
- "Nov",
71
- "Dec"
72
- ];
73
- });
74
-
75
20
  // src/utils/loadConfig.ts
76
21
  var exports_loadConfig = {};
77
22
  __export(exports_loadConfig, {
@@ -90,69 +35,18 @@ Expected: export default defineConfig({ ... })`);
90
35
  };
91
36
  var init_loadConfig = () => {};
92
37
 
93
- // src/utils/logger.ts
94
- var colors, frameworkColors, formatPath = (filePath) => {
95
- const cwd = process.cwd();
96
- let relative = filePath.startsWith(cwd) ? filePath.slice(cwd.length + 1) : filePath;
97
- relative = relative.replace(/\\/g, "/");
98
- if (!relative.startsWith("/")) {
99
- relative = `/${relative}`;
100
- }
101
- return relative;
102
- }, getFrameworkColor = (framework) => frameworkColors[framework] || colors.white, log = (action, options) => {
103
- const timestamp = `${colors.dim}${formatTimestamp()}${colors.reset}`;
104
- const tag = `${colors.cyan}[hmr]${colors.reset}`;
105
- let message = action;
106
- if (options?.path) {
107
- const pathColor = options.framework ? getFrameworkColor(options.framework) : colors.white;
108
- message += ` ${pathColor}${formatPath(options.path)}${colors.reset}`;
109
- }
110
- if (options?.duration !== undefined) {
111
- message += ` ${colors.dim}(${options.duration}ms)${colors.reset}`;
112
- }
113
- console.log(`${timestamp} ${tag} ${message}`);
114
- }, logInfo = (message) => {
115
- log(message);
116
- }, logWarn = (message) => {
117
- const timestamp = `${colors.dim}${formatTimestamp()}${colors.reset}`;
118
- const tag = `${colors.yellow}[hmr]${colors.reset}`;
119
- console.warn(`${timestamp} ${tag} ${colors.yellow}warning${colors.reset} ${message}`);
120
- };
121
- var init_logger = __esm(() => {
122
- init_startupBanner();
123
- colors = {
124
- blue: "\x1B[34m",
125
- bold: "\x1B[1m",
126
- cyan: "\x1B[36m",
127
- dim: "\x1B[2m",
128
- green: "\x1B[32m",
129
- magenta: "\x1B[35m",
130
- red: "\x1B[31m",
131
- reset: "\x1B[0m",
132
- white: "\x1B[37m",
133
- yellow: "\x1B[33m"
134
- };
135
- frameworkColors = {
136
- angular: colors.magenta,
137
- assets: colors.dim,
138
- css: colors.cyan,
139
- html: colors.white,
140
- htmx: colors.white,
141
- react: colors.blue,
142
- svelte: colors.yellow,
143
- vue: colors.green
144
- };
145
- });
146
-
147
38
  // src/dev/devCert.ts
148
39
  var exports_devCert = {};
149
40
  __export(exports_devCert, {
41
+ setupMkcert: () => setupMkcert,
150
42
  loadDevCert: () => loadDevCert,
43
+ hasMkcert: () => hasMkcert,
151
44
  ensureDevCert: () => ensureDevCert
152
45
  });
153
- import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync as readFileSync4 } from "fs";
46
+ import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync as readFileSync4, rmSync } from "fs";
47
+ import { platform as platform2 } from "os";
154
48
  import { join as join3 } from "path";
155
- var CERT_DIR, CERT_PATH, KEY_PATH, CERT_VALIDITY_DAYS = 365, certFilesExist = () => existsSync4(CERT_PATH) && existsSync4(KEY_PATH), isCertExpired = () => {
49
+ var CERT_DIR, CERT_PATH, KEY_PATH, CERT_VALIDITY_DAYS = 365, devLog = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[36m[dev]\x1B[0m ${msg}`), devWarn = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[33m[dev]\x1B[0m \x1B[33m${msg}\x1B[0m`), certFilesExist = () => existsSync4(CERT_PATH) && existsSync4(KEY_PATH), isCertExpired = () => {
156
50
  try {
157
51
  const certPem = readFileSync4(CERT_PATH, "utf-8");
158
52
  const proc = Bun.spawnSync(["openssl", "x509", "-enddate", "-noout"], {
@@ -176,7 +70,7 @@ var CERT_DIR, CERT_PATH, KEY_PATH, CERT_VALIDITY_DAYS = 365, certFilesExist = ()
176
70
  return false;
177
71
  }
178
72
  }, generateWithMkcert = () => {
179
- logInfo("Generating locally-trusted certificate with mkcert...");
73
+ devLog("Generating locally-trusted certificate with mkcert...");
180
74
  const result = Bun.spawnSync([
181
75
  "mkcert",
182
76
  "-cert-file",
@@ -191,9 +85,9 @@ var CERT_DIR, CERT_PATH, KEY_PATH, CERT_VALIDITY_DAYS = 365, certFilesExist = ()
191
85
  const err = new TextDecoder().decode(result.stderr);
192
86
  throw new Error(`mkcert failed: ${err}`);
193
87
  }
194
- logInfo("Certificate generated with mkcert (locally trusted, no browser warning)");
88
+ devLog("HTTPS enabled with locally-trusted certificate (mkcert)");
195
89
  }, generateSelfSigned = () => {
196
- logInfo("Generating self-signed certificate for HTTPS dev server...");
90
+ devLog("Generating self-signed certificate...");
197
91
  const proc = Bun.spawnSync([
198
92
  "openssl",
199
93
  "req",
@@ -218,14 +112,23 @@ var CERT_DIR, CERT_PATH, KEY_PATH, CERT_VALIDITY_DAYS = 365, certFilesExist = ()
218
112
  const err = new TextDecoder().decode(proc.stderr);
219
113
  throw new Error(`openssl failed: ${err}`);
220
114
  }
221
- logInfo("Self-signed certificate generated (one-time browser warning on first visit)");
115
+ devLog("HTTPS enabled with self-signed certificate");
116
+ devLog("For a trusted certificate (no browser warning), install mkcert:");
117
+ devLog(" brew install mkcert && mkcert -install (macOS)");
118
+ devLog(" sudo apt install mkcert && mkcert -install (Linux)");
119
+ devLog("Then restart the dev server.");
222
120
  }, ensureDevCert = () => {
223
121
  mkdirSync2(CERT_DIR, { recursive: true });
224
122
  if (certFilesExist() && !isCertExpired()) {
123
+ if (hasMkcert()) {
124
+ devLog("HTTPS enabled with locally-trusted certificate (mkcert)");
125
+ } else {
126
+ devLog("HTTPS enabled with self-signed certificate");
127
+ }
225
128
  return { cert: CERT_PATH, key: KEY_PATH };
226
129
  }
227
130
  if (certFilesExist()) {
228
- logWarn("Dev certificate expired, regenerating...");
131
+ devWarn("Dev certificate expired, regenerating...");
229
132
  }
230
133
  try {
231
134
  if (hasMkcert()) {
@@ -234,7 +137,7 @@ var CERT_DIR, CERT_PATH, KEY_PATH, CERT_VALIDITY_DAYS = 365, certFilesExist = ()
234
137
  generateSelfSigned();
235
138
  }
236
139
  } catch (err) {
237
- logWarn(`Failed to generate HTTPS certificate: ${err instanceof Error ? err.message : err}`);
140
+ devWarn(`Failed to generate certificate: ${err instanceof Error ? err.message : err}`);
238
141
  return null;
239
142
  }
240
143
  return { cert: CERT_PATH, key: KEY_PATH };
@@ -250,23 +153,187 @@ var CERT_DIR, CERT_PATH, KEY_PATH, CERT_VALIDITY_DAYS = 365, certFilesExist = ()
250
153
  } catch {
251
154
  return null;
252
155
  }
156
+ }, commandExists = (cmd) => {
157
+ try {
158
+ const check = platform2() === "win32" ? ["where", cmd] : ["command", "-v", cmd];
159
+ const result = Bun.spawnSync(check, {
160
+ stderr: "pipe",
161
+ stdout: "pipe"
162
+ });
163
+ return result.exitCode === 0;
164
+ } catch {
165
+ return false;
166
+ }
167
+ }, installMkcert = () => {
168
+ const os = platform2();
169
+ if (os === "darwin") {
170
+ if (commandExists("brew")) {
171
+ devLog("Installing mkcert with Homebrew...");
172
+ const r = Bun.spawnSync(["brew", "install", "mkcert"], {
173
+ stderr: "pipe",
174
+ stdout: "pipe"
175
+ });
176
+ if (r.exitCode === 0)
177
+ return true;
178
+ }
179
+ devWarn("Install Homebrew first: https://brew.sh");
180
+ return false;
181
+ }
182
+ if (os === "linux") {
183
+ if (commandExists("apt-get")) {
184
+ devLog("Installing mkcert with apt...");
185
+ const r = Bun.spawnSync(["sudo", "apt-get", "install", "-y", "mkcert"], { stderr: "pipe", stdout: "pipe" });
186
+ if (r.exitCode === 0)
187
+ return true;
188
+ }
189
+ if (commandExists("dnf")) {
190
+ devLog("Installing mkcert with dnf...");
191
+ const r = Bun.spawnSync(["sudo", "dnf", "install", "-y", "mkcert"], { stderr: "pipe", stdout: "pipe" });
192
+ if (r.exitCode === 0)
193
+ return true;
194
+ }
195
+ if (commandExists("pacman")) {
196
+ devLog("Installing mkcert with pacman...");
197
+ const r = Bun.spawnSync(["sudo", "pacman", "-S", "--noconfirm", "mkcert"], { stderr: "pipe", stdout: "pipe" });
198
+ if (r.exitCode === 0)
199
+ return true;
200
+ }
201
+ if (commandExists("go")) {
202
+ devLog("Installing mkcert with go install...");
203
+ const r = Bun.spawnSync([
204
+ "go",
205
+ "install",
206
+ "filippo.io/mkcert@latest"
207
+ ], { stderr: "pipe", stdout: "pipe" });
208
+ if (r.exitCode === 0)
209
+ return true;
210
+ }
211
+ devWarn("Could not install mkcert automatically.");
212
+ console.log(" See: https://github.com/FiloSottile/mkcert#installation");
213
+ return false;
214
+ }
215
+ if (os === "win32") {
216
+ if (commandExists("choco")) {
217
+ devLog("Installing mkcert with Chocolatey...");
218
+ const r = Bun.spawnSync(["choco", "install", "-y", "mkcert"], {
219
+ stderr: "pipe",
220
+ stdout: "pipe"
221
+ });
222
+ if (r.exitCode === 0)
223
+ return true;
224
+ }
225
+ if (commandExists("winget")) {
226
+ devLog("Installing mkcert with winget...");
227
+ const r = Bun.spawnSync(["winget", "install", "--id", "FiloSottile.mkcert", "-e"], { stderr: "pipe", stdout: "pipe" });
228
+ if (r.exitCode === 0)
229
+ return true;
230
+ }
231
+ devWarn("Could not install mkcert automatically.");
232
+ console.log(" See: https://github.com/FiloSottile/mkcert#installation");
233
+ return false;
234
+ }
235
+ return false;
236
+ }, setupMkcert = () => {
237
+ devLog("Setting up mkcert for locally-trusted HTTPS...");
238
+ if (!hasMkcert()) {
239
+ devLog("mkcert not found \u2014 installing...");
240
+ if (!installMkcert())
241
+ return false;
242
+ if (!hasMkcert()) {
243
+ devWarn("mkcert installed but not found in PATH. Restart your terminal and try again.");
244
+ return false;
245
+ }
246
+ }
247
+ devLog("Installing local certificate authority...");
248
+ const installResult = Bun.spawnSync(["mkcert", "-install"], {
249
+ stderr: "pipe",
250
+ stdout: "pipe"
251
+ });
252
+ if (installResult.exitCode !== 0) {
253
+ devWarn("Failed to install CA: " + new TextDecoder().decode(installResult.stderr));
254
+ return false;
255
+ }
256
+ rmSync(CERT_PATH, { force: true });
257
+ rmSync(KEY_PATH, { force: true });
258
+ mkdirSync2(CERT_DIR, { recursive: true });
259
+ generateWithMkcert();
260
+ console.log("");
261
+ devLog("Done! Restart your dev server \u2014 no more browser warnings.");
262
+ return true;
253
263
  };
254
264
  var init_devCert = __esm(() => {
255
- init_logger();
256
265
  CERT_DIR = join3(process.cwd(), ".absolutejs");
257
266
  CERT_PATH = join3(CERT_DIR, "cert.pem");
258
267
  KEY_PATH = join3(CERT_DIR, "key.pem");
259
268
  });
260
269
 
261
270
  // src/cli/scripts/dev.ts
262
- init_constants();
263
- init_startupBanner();
264
271
  var {$: $2, env } = globalThis.Bun;
265
272
  import { existsSync as existsSync5 } from "fs";
266
273
  import { resolve as resolve3 } from "path";
267
274
 
275
+ // src/constants.ts
276
+ var ANSI_ESCAPE_LENGTH = 3;
277
+ var ASCII_SPACE = 32;
278
+ var BASE_36_RADIX = 36;
279
+ var BYTES_PER_KILOBYTE = 1024;
280
+ var CLI_ARGS_OFFSET = 3;
281
+ var DEFAULT_PORT = 3000;
282
+ var HOURS_IN_DAY = 24;
283
+ var HOURS_IN_HALF_DAY = 12;
284
+ var MAX_ERROR_LENGTH = 200;
285
+ var MILLISECONDS_IN_A_SECOND = 1000;
286
+ var MINUTES_IN_AN_HOUR = 60;
287
+ var SECONDS_IN_A_MINUTE = 60;
288
+ var MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;
289
+ var MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_DAY;
290
+ var SIGINT_EXIT_CODE = 130;
291
+ var SIGTERM_EXIT_CODE = 143;
292
+ var TIME_PRECISION = 2;
293
+ var TWO_THIRDS = 2 / 3;
294
+ var UNFOUND_INDEX = -1;
295
+
296
+ // src/utils/getDurationString.ts
297
+ var getDurationString = (duration) => {
298
+ let durationString;
299
+ if (duration < MILLISECONDS_IN_A_SECOND) {
300
+ durationString = `${duration.toFixed(TIME_PRECISION)}ms`;
301
+ } else if (duration < MILLISECONDS_IN_A_MINUTE) {
302
+ durationString = `${(duration / MILLISECONDS_IN_A_SECOND).toFixed(TIME_PRECISION)}s`;
303
+ } else {
304
+ durationString = `${(duration / MILLISECONDS_IN_A_MINUTE).toFixed(TIME_PRECISION)}m`;
305
+ }
306
+ return durationString;
307
+ };
308
+
309
+ // src/utils/startupBanner.ts
310
+ var MONTHS = [
311
+ "Jan",
312
+ "Feb",
313
+ "Mar",
314
+ "Apr",
315
+ "May",
316
+ "Jun",
317
+ "Jul",
318
+ "Aug",
319
+ "Sep",
320
+ "Oct",
321
+ "Nov",
322
+ "Dec"
323
+ ];
324
+ var formatTimestamp = () => {
325
+ const now = new Date;
326
+ const month = MONTHS[now.getMonth()];
327
+ const day = now.getDate().toString().padStart(2, "0");
328
+ let hours = now.getHours();
329
+ const minutes = now.getMinutes().toString().padStart(2, "0");
330
+ const seconds = now.getSeconds().toString().padStart(2, "0");
331
+ const ampm = hours >= HOURS_IN_HALF_DAY ? "PM" : "AM";
332
+ hours = hours % HOURS_IN_HALF_DAY || HOURS_IN_HALF_DAY;
333
+ return `${month} ${day} ${hours}:${minutes}:${seconds} ${ampm}`;
334
+ };
335
+
268
336
  // src/cli/interactive.ts
269
- init_constants();
270
337
  import { openSync } from "fs";
271
338
  import { ReadStream } from "tty";
272
339
  var SHORTCUTS = {
@@ -671,8 +738,6 @@ var sendTelemetryEvent = (event, payload) => {
671
738
  init_loadConfig();
672
739
 
673
740
  // src/cli/utils.ts
674
- init_constants();
675
- init_startupBanner();
676
741
  var {$ } = globalThis.Bun;
677
742
  import { execSync } from "child_process";
678
743
  import { existsSync as existsSync3, readFileSync as readFileSync3 } from "fs";
@@ -951,14 +1016,14 @@ var dev = async (serverEntry, configPath2) => {
951
1016
  };
952
1017
  const openInBrowser = async () => {
953
1018
  const url = `http://localhost:${port}`;
954
- const { platform: platform2 } = process;
955
- const isWSL = platform2 === "linux" && isWSLEnvironment();
1019
+ const { platform: platform3 } = process;
1020
+ const isWSL = platform3 === "linux" && isWSLEnvironment();
956
1021
  let cmd;
957
1022
  if (isWSL) {
958
1023
  cmd = "cmd.exe";
959
- } else if (platform2 === "darwin") {
1024
+ } else if (platform3 === "darwin") {
960
1025
  cmd = "open";
961
- } else if (platform2 === "win32") {
1026
+ } else if (platform3 === "win32") {
962
1027
  cmd = "start";
963
1028
  } else {
964
1029
  cmd = "xdg-open";
@@ -1043,10 +1108,9 @@ var eslint = async (args) => {
1043
1108
  };
1044
1109
 
1045
1110
  // src/cli/scripts/info.ts
1046
- init_constants();
1047
1111
  import { execSync as execSync2 } from "child_process";
1048
1112
  import { existsSync as existsSync6, readFileSync as readFileSync5 } from "fs";
1049
- import { arch as arch2, cpus, platform as platform2, totalmem, version } from "os";
1113
+ import { arch as arch2, cpus, platform as platform3, totalmem, version } from "os";
1050
1114
  import { resolve as resolve4 } from "path";
1051
1115
  var __dirname = "/home/alexkahn/abs/absolutejs/src/cli/scripts";
1052
1116
  var bold = (str) => `\x1B[1m${str}\x1B[0m`;
@@ -1120,7 +1184,7 @@ var isDockerEnvironment = () => {
1120
1184
  };
1121
1185
  var getMemoryMB = () => Math.round(totalmem() / BYTES_PER_KILOBYTE / BYTES_PER_KILOBYTE);
1122
1186
  var getGlibcVersion = () => {
1123
- if (platform2() !== "linux")
1187
+ if (platform3() !== "linux")
1124
1188
  return null;
1125
1189
  try {
1126
1190
  const output = execSync2("ldd --version 2>&1 || true", {
@@ -1142,7 +1206,7 @@ var info = () => {
1142
1206
  lines.push(` ${key}: ${val}`);
1143
1207
  };
1144
1208
  section("Operating System:");
1145
- field("Platform", platform2());
1209
+ field("Platform", platform3());
1146
1210
  field("Arch", arch2());
1147
1211
  field("Version", version());
1148
1212
  field("Available memory (MB)", String(getMemoryMB()));
@@ -1182,7 +1246,6 @@ var info = () => {
1182
1246
  };
1183
1247
 
1184
1248
  // src/cli/cache.ts
1185
- init_constants();
1186
1249
  import { mkdir } from "fs/promises";
1187
1250
  import { join as join4 } from "path";
1188
1251
  var {Glob } = globalThis.Bun;
@@ -1318,13 +1381,10 @@ var prettier = async (args) => {
1318
1381
  };
1319
1382
 
1320
1383
  // src/cli/scripts/start.ts
1321
- init_constants();
1322
- init_getDurationString();
1323
- init_loadConfig();
1324
- init_startupBanner();
1325
1384
  var {env: env2 } = globalThis.Bun;
1326
1385
  import { existsSync as existsSync7, readFileSync as readFileSync6 } from "fs";
1327
1386
  import { basename, resolve as resolve5 } from "path";
1387
+ init_loadConfig();
1328
1388
  var cliTag2 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[cli]\x1B[0m ${color}${message}\x1B[0m`;
1329
1389
  var resolvePackageVersion = (candidates) => {
1330
1390
  for (const candidate of candidates) {
@@ -1364,13 +1424,13 @@ var tryImportBuild = async (candidate) => {
1364
1424
  }
1365
1425
  };
1366
1426
  var handleBundleFailure = (serverBundle, bundleStart, serverEntry) => {
1367
- serverBundle.logs.forEach((log2) => {
1368
- console.error(log2);
1427
+ serverBundle.logs.forEach((log) => {
1428
+ console.error(log);
1369
1429
  });
1370
1430
  sendTelemetryEvent("start:bundle-error", {
1371
1431
  durationMs: Math.round(performance.now() - bundleStart),
1372
1432
  entry: serverEntry,
1373
- message: serverBundle.logs.find((log2) => log2.level === "error")?.message?.toString().slice(0, MAX_ERROR_LENGTH) ?? "Unknown error"
1433
+ message: serverBundle.logs.find((log) => log.level === "error")?.message?.toString().slice(0, MAX_ERROR_LENGTH) ?? "Unknown error"
1374
1434
  });
1375
1435
  console.error(cliTag2("\x1B[31m", "Server bundle failed."));
1376
1436
  process.exit(1);
@@ -1570,7 +1630,6 @@ var start = async (serverEntry, outdir, configPath2) => {
1570
1630
  };
1571
1631
 
1572
1632
  // src/cli/index.ts
1573
- init_constants();
1574
1633
  var [command] = process.argv.slice(2);
1575
1634
  var args = process.argv.slice(CLI_ARGS_OFFSET);
1576
1635
  var parseNamedArg = (flag) => {
@@ -1610,6 +1669,10 @@ if (command === "dev") {
1610
1669
  } else if (command === "telemetry") {
1611
1670
  sendTelemetryEvent("cli:command", { command });
1612
1671
  telemetry(args);
1672
+ } else if (command === "mkcert") {
1673
+ sendTelemetryEvent("cli:command", { command });
1674
+ const { setupMkcert: setupMkcert2 } = await Promise.resolve().then(() => (init_devCert(), exports_devCert));
1675
+ setupMkcert2();
1613
1676
  } else {
1614
1677
  const message = command ? `Unknown command: ${command}` : "No command specified";
1615
1678
  console.error(message);