@absolutejs/absolute 0.20.0-beta.171 → 0.20.0-beta.173

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 (65) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +3 -2
  3. package/changelog.json +73 -0
  4. package/dist/angular/browser.js +12 -12
  5. package/dist/angular/browser.js.map +6 -7
  6. package/dist/angular/components/core/streamingSlotRegistrar.js +2 -6
  7. package/dist/angular/components/core/streamingSlotRegistry.js +3 -7
  8. package/dist/angular/components/defer-slot.component.js +12 -7
  9. package/dist/angular/components/stream-slot.component.js +3 -1
  10. package/dist/angular/index.js +40 -13
  11. package/dist/angular/index.js.map +7 -7
  12. package/dist/angular/server.js +39 -12
  13. package/dist/angular/server.js.map +6 -6
  14. package/dist/build/buildWorker.js +135 -57
  15. package/dist/build.js +1183 -1011
  16. package/dist/build.js.map +16 -15
  17. package/dist/cli/config/server.js +43 -12
  18. package/dist/cli/{doctor-repprx92.js → doctor-m36tmx4d.js} +70 -15
  19. package/dist/cli/index.js +2 -2
  20. package/dist/cli/{typecheck-209bemxm.js → typecheck-fag7djt5.js} +21 -6
  21. package/dist/core/streamingSlotRegistrar.js +2 -5
  22. package/dist/core/streamingSlotRegistrar.js.map +4 -5
  23. package/dist/core/streamingSlotRegistry.js +2 -5
  24. package/dist/core/streamingSlotRegistry.js.map +4 -5
  25. package/dist/dev/serverBootstrap.js +2 -1
  26. package/dist/index.js +1116 -940
  27. package/dist/index.js.map +18 -17
  28. package/dist/islands/index.js +2 -2
  29. package/dist/islands/index.js.map +3 -3
  30. package/dist/mobile/browser.js +2 -2
  31. package/dist/mobile/browser.js.map +3 -3
  32. package/dist/mobile/index.js +2 -2
  33. package/dist/mobile/index.js.map +3 -3
  34. package/dist/react/components/index.js +2 -5
  35. package/dist/react/components/index.js.map +5 -6
  36. package/dist/react/index.js +45 -16
  37. package/dist/react/index.js.map +8 -8
  38. package/dist/react/router/browser.js.map +2 -2
  39. package/dist/react/router/index.js.map +2 -2
  40. package/dist/react/server.js +45 -16
  41. package/dist/react/server.js.map +8 -8
  42. package/dist/src/angular/components/defer-slot.component.d.ts +1 -0
  43. package/dist/src/build/missingReactRouter.d.ts +8 -0
  44. package/dist/src/build/vueModuleOutputPath.d.ts +10 -6
  45. package/dist/src/cli/scripts/bunCheck.d.ts +3 -1
  46. package/dist/src/cli/scripts/doctor.d.ts +10 -0
  47. package/dist/src/core/streamingSlotWarningScope.d.ts +3 -0
  48. package/dist/src/dev/hot/reload.d.ts +5 -0
  49. package/dist/src/dev/hot/runtime.d.ts +2 -0
  50. package/dist/src/dev/srcPath.d.ts +2 -1
  51. package/dist/src/react/pageHandler.d.ts +5 -0
  52. package/dist/src/react/router/Link.d.ts +6 -1
  53. package/dist/src/react/serverComponents/pageHandler.d.ts +2 -0
  54. package/dist/src/utils/portInUse.d.ts +16 -0
  55. package/dist/svelte/index.js +39 -12
  56. package/dist/svelte/index.js.map +6 -6
  57. package/dist/svelte/server.js +39 -12
  58. package/dist/svelte/server.js.map +6 -6
  59. package/dist/vue/components/index.js +2 -5
  60. package/dist/vue/components/index.js.map +4 -5
  61. package/dist/vue/index.js +39 -12
  62. package/dist/vue/index.js.map +6 -6
  63. package/dist/vue/server.js +39 -12
  64. package/dist/vue/server.js.map +6 -6
  65. package/package.json +2 -1
@@ -46249,8 +46249,9 @@ var readCspNonce = () => {
46249
46249
 
46250
46250
  // src/utils/runtimeMode.ts
46251
46251
  var ENV_VAR = "NODE_ENV";
46252
- var isDevelopmentRuntime = () => process.env[ENV_VAR] === "development";
46253
- var isProductionRuntime = () => process.env[ENV_VAR] === "production";
46252
+ var readEnv = () => typeof process === "undefined" ? undefined : process.env?.[ENV_VAR];
46253
+ var isDevelopmentRuntime = () => readEnv() === "development";
46254
+ var isProductionRuntime = () => readEnv() === "production";
46254
46255
 
46255
46256
  // src/utils/escapeScriptContent.ts
46256
46257
  var ESCAPE_LOOKUP = {
@@ -46388,15 +46389,30 @@ var warnIfBootstrapMissing = (manifest) => {
46388
46389
  warnedMissingBootstrap = true;
46389
46390
  logWarn("A page contains islands, but the build manifest has no islands bootstrap, so they will render without hydrating. Set `islands.registry` in absolute.config.ts (a default bootstrap is generated from it) or point `islands.bootstrap` at a file that calls startIslands().");
46390
46391
  };
46391
- var manifestBuildDir;
46392
+ var MANIFEST_BUILD_DIR_KEY = Symbol.for("absolutejs.islandManifestBuildDir");
46393
+ var getManifestBuildDir = () => {
46394
+ const value = Reflect.get(globalThis, MANIFEST_BUILD_DIR_KEY);
46395
+ return typeof value === "string" ? value : undefined;
46396
+ };
46392
46397
  var WINDOWS_ABSOLUTE_PATH = /^[A-Za-z]:[\\/]|^\\\\/;
46398
+ var withTrailingSlash = (path) => path.endsWith("/") ? path : `${path}/`;
46399
+ var currentWorkingRoot = () => {
46400
+ try {
46401
+ return withTrailingSlash(process.cwd().replaceAll("\\", "/"));
46402
+ } catch {
46403
+ return;
46404
+ }
46405
+ };
46393
46406
  var isServerFilePath = (value) => {
46394
46407
  if (WINDOWS_ABSOLUTE_PATH.test(value))
46395
46408
  return true;
46396
- if (!manifestBuildDir)
46397
- return false;
46398
- const root = manifestBuildDir.endsWith("/") ? manifestBuildDir : `${manifestBuildDir}/`;
46399
- return value.startsWith(root);
46409
+ const buildDir = getManifestBuildDir();
46410
+ if (buildDir && value.startsWith(withTrailingSlash(buildDir)))
46411
+ return true;
46412
+ const root = currentWorkingRoot();
46413
+ if (root && root !== "/" && value.startsWith(root))
46414
+ return true;
46415
+ return false;
46400
46416
  };
46401
46417
  var toBrowserManifest = (manifest) => {
46402
46418
  const browserManifest = {};
@@ -48051,7 +48067,11 @@ var extractCallsiteFromStack = (stack) => {
48051
48067
  `).slice(1).map((line) => line.trim()).filter((frame) => !shouldIgnoreWarningFrame(frame)).map((frame) => getWarningLocation(frame)).find((frameLocation) => frameLocation !== undefined);
48052
48068
  return location ? normalizeCallsitePath(location) : undefined;
48053
48069
  };
48054
- var buildMissingCollectorWarning = (primitiveName, handlerCallsite) => `${primitiveName} rendered during SSR without streaming slot collection enabled. Add { collectStreamingSlots: true } to this page handler to enable out-of-order streaming for this route.${handlerCallsite ? ` Update ${formatWarningCallsite(handlerCallsite)}.` : ""}`;
48070
+ var buildMissingCollectorWarning = (primitiveName, { explicitlyDisabled, handlerCallsite }) => {
48071
+ const fix = explicitlyDisabled ? "This page handler sets { collectStreamingSlots: false }, so the slot stays on its fallback and never streams. Remove the option (or set it to true) to stream this route." : "The slot stays on its fallback and never streams. Add { collectStreamingSlots: true } to this page handler to enable out-of-order streaming for this route.";
48072
+ return `${primitiveName} rendered during SSR without streaming slot collection enabled. ${fix}${handlerCallsite ? ` Update ${formatWarningCallsite(handlerCallsite)}.` : ""}`;
48073
+ };
48074
+ var productionWarnings = new Set;
48055
48075
  setStreamingSlotWarningController({
48056
48076
  maybeWarn: (primitiveName) => {
48057
48077
  const store = getWarningStorage()?.getStore();
@@ -48059,7 +48079,13 @@ setStreamingSlotWarningController({
48059
48079
  return;
48060
48080
  }
48061
48081
  store.hasWarned = true;
48062
- logWarn(buildMissingCollectorWarning(primitiveName, store.handlerCallsite));
48082
+ const message = buildMissingCollectorWarning(primitiveName, store);
48083
+ if (isProductionRuntime()) {
48084
+ if (productionWarnings.has(message))
48085
+ return;
48086
+ productionWarnings.add(message);
48087
+ }
48088
+ logWarn(message);
48063
48089
  }
48064
48090
  });
48065
48091
  var captureStreamingSlotWarningCallsite = () => {
@@ -48072,7 +48098,11 @@ var captureStreamingSlotWarningCallsite = () => {
48072
48098
  }
48073
48099
  return extractCallsiteFromStack(stack);
48074
48100
  };
48075
- var runWithStreamingSlotWarningScope = (task, metadata) => ensureWarningStorage().run({ handlerCallsite: metadata?.handlerCallsite, hasWarned: false }, task);
48101
+ var runWithStreamingSlotWarningScope = (task, metadata) => ensureWarningStorage().run({
48102
+ explicitlyDisabled: metadata?.explicitlyDisabled === true,
48103
+ handlerCallsite: metadata?.handlerCallsite,
48104
+ hasWarned: false
48105
+ }, task);
48076
48106
 
48077
48107
  // src/utils/stringModifiers.ts
48078
48108
  var normalizeSlug = (str) => str.trim().replace(/\s+/g, "-").replace(/[^A-Za-z0-9\-_]+/g, "").replace(/[-_]{2,}/g, "-");
@@ -48538,7 +48568,8 @@ var handleReactPageRequest = async (input) => {
48538
48568
  const spaNotFound = await renderSpaNotFound("react", pageName, request);
48539
48569
  if (spaNotFound)
48540
48570
  return withPageCacheHeaders(spaNotFound, request);
48541
- const handlerCallsite = options?.collectStreamingSlots === true ? undefined : getCurrentRouteRegistrationCallsite() ?? captureStreamingSlotWarningCallsite();
48571
+ const collectStreamingSlots = options?.collectStreamingSlots !== false;
48572
+ const handlerCallsite = collectStreamingSlots ? undefined : getCurrentRouteRegistrationCallsite() ?? captureStreamingSlotWarningCallsite();
48542
48573
  const renderPageResponse = async () => {
48543
48574
  const { createElement } = await Promise.resolve().then(() => __toESM(require_react()));
48544
48575
  const { renderToReadableStream } = await Promise.resolve().then(() => __toESM((init_server_bun(), exports_server_bun)));
@@ -48564,7 +48595,7 @@ var handleReactPageRequest = async (input) => {
48564
48595
  headers: streamingPageHeaders()
48565
48596
  });
48566
48597
  };
48567
- const pageResponse = await runWithStreamingSlotWarningScope(() => options?.collectStreamingSlots === true ? withRegisteredStreamingSlots(renderPageResponse, options) : renderPageResponse(), { handlerCallsite });
48598
+ const pageResponse = await runWithStreamingSlotWarningScope(() => collectStreamingSlots ? withRegisteredStreamingSlots(renderPageResponse, options) : renderPageResponse(), { explicitlyDisabled: !collectStreamingSlots, handlerCallsite });
48568
48599
  return withPageCacheHeaders(pageResponse, request, {
48569
48600
  bufferStreamForEtag: input.bufferStreamForEtag
48570
48601
  });
@@ -14,15 +14,70 @@ import {
14
14
  import {
15
15
  isRecord
16
16
  } from "./index-tx0kx9zx.js";
17
- import {
18
- scanListeners
19
- } from "./index-x8x0f3ha.js";
20
17
 
21
18
  // src/cli/scripts/doctor.ts
22
19
  import { existsSync as existsSync2, mkdirSync, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
23
20
  import { createRequire as createRequire2 } from "module";
24
21
  import { join as join2 } from "path";
25
22
 
23
+ // src/utils/portInUse.ts
24
+ import { spawnSync } from "child_process";
25
+ import { createConnection, createServer } from "net";
26
+ var CONNECT_TIMEOUT_MS = 300;
27
+ var IPV4_LOOPBACK = "127.0.0.1";
28
+ var IPV6_LOOPBACK = "::1";
29
+ var IPV4_ANY = "0.0.0.0";
30
+ var IPV6_ANY = "::";
31
+ var acceptsConnection = (port, host) => new Promise((resolve) => {
32
+ const socket = createConnection({ host, port });
33
+ const finish = (accepted) => {
34
+ clearTimeout(timer);
35
+ socket.removeAllListeners();
36
+ socket.on("error", () => {
37
+ return;
38
+ });
39
+ socket.destroy();
40
+ resolve(accepted);
41
+ };
42
+ const timer = setTimeout(() => finish(false), CONNECT_TIMEOUT_MS);
43
+ socket.once("connect", () => finish(true));
44
+ socket.once("error", () => finish(false));
45
+ });
46
+ var bindConflicts = (port, host, ipv6Only) => new Promise((resolve) => {
47
+ const server = createServer();
48
+ server.unref();
49
+ server.once("error", (error) => {
50
+ server.close(() => {
51
+ return;
52
+ });
53
+ resolve(error.code === "EADDRINUSE");
54
+ });
55
+ server.listen({ exclusive: true, host, ipv6Only, port }, () => {
56
+ server.close(() => resolve(false));
57
+ });
58
+ });
59
+ var isPortInUse = async (port) => {
60
+ if (await acceptsConnection(port, IPV4_LOOPBACK))
61
+ return true;
62
+ if (await acceptsConnection(port, IPV6_LOOPBACK))
63
+ return true;
64
+ if (await bindConflicts(port, IPV4_ANY, false))
65
+ return true;
66
+ return bindConflicts(port, IPV6_ANY, true);
67
+ };
68
+ var portListenerPids = (port) => {
69
+ try {
70
+ const result = spawnSync("lsof", ["-nP", "-t", `-iTCP:${port}`, "-sTCP:LISTEN"], { encoding: "utf-8", timeout: 2000 });
71
+ const output = typeof result.stdout === "string" ? result.stdout : "";
72
+ return [
73
+ ...new Set(output.split(`
74
+ `).map(Number).filter((pid) => Number.isInteger(pid) && pid > 0 && pid !== process.pid))
75
+ ];
76
+ } catch {
77
+ return [];
78
+ }
79
+ };
80
+
26
81
  // src/cli/typeGraphCoherence.ts
27
82
  import {
28
83
  existsSync,
@@ -312,15 +367,18 @@ var envCheck = async () => {
312
367
  }
313
368
  return check("fail", "Env vars", `missing ${missing.map((entry) => entry.key).join(", ")}`);
314
369
  };
315
- var devPort = (config) => {
316
- const dev = Reflect.get(config, "dev");
317
- const port = dev && typeof dev === "object" ? Reflect.get(dev, "port") : undefined;
318
- return typeof port === "number" ? port : DEFAULT_PORT;
370
+ var devPort = (config, env = process.env) => {
371
+ const dev = config ? Reflect.get(config, "dev") : undefined;
372
+ const configured = dev && typeof dev === "object" ? Reflect.get(dev, "port") : undefined;
373
+ return Number(env.ABSOLUTE_PORT) || Number(env.PORT) || (typeof configured === "number" && configured > 0 ? configured : DEFAULT_PORT);
319
374
  };
320
- var portCheck = async (config) => {
321
- const port = devPort(config);
322
- const holder = (await scanListeners()).find((listener) => listener.port === port);
323
- return holder ? check("warn", "Dev port", `${port} in use by pid ${holder.pid}`) : check("ok", "Dev port", `${port} free`);
375
+ var portCheck = async (config, env = process.env) => {
376
+ const port = devPort(config, env);
377
+ if (!await isPortInUse(port)) {
378
+ return check("ok", "Dev port", `${port} free`);
379
+ }
380
+ const pids = portListenerPids(port);
381
+ return check("warn", "Dev port", pids.length > 0 ? `${port} in use by pid ${pids.join(", ")}` : `${port} in use`);
324
382
  };
325
383
  var typeGraphCheck = () => {
326
384
  const report = typeGraphCoherence.inspectTypeGraph(process.cwd());
@@ -364,10 +422,7 @@ ${colors.dim}${checks.length} checks \xB7 ${colors.reset}${summary}${colors.dim}
364
422
  var gatherChecks = async () => {
365
423
  const config = await loadConfigOrNull();
366
424
  const configCheck = config === null ? check("fail", "Config", "absolute.config.ts not found or invalid") : check("ok", "Config", "absolute.config.ts loaded");
367
- const [env, port] = await Promise.all([
368
- envCheck(),
369
- config === null ? check("warn", "Dev port", "skipped (no config)") : portCheck(config)
370
- ]);
425
+ const [env, port] = await Promise.all([envCheck(), portCheck(config)]);
371
426
  return [
372
427
  checkBun(),
373
428
  checkAbsolute(),
package/dist/cli/index.js CHANGED
@@ -176,7 +176,7 @@ if (command === "dev") {
176
176
  await runLogs(args);
177
177
  } else if (command === "doctor") {
178
178
  sendTelemetryEvent("cli:command", { command: "doctor" });
179
- const { runDoctor } = await import("./doctor-repprx92.js");
179
+ const { runDoctor } = await import("./doctor-m36tmx4d.js");
180
180
  await runDoctor(args);
181
181
  } else if (command === "routes") {
182
182
  sendTelemetryEvent("cli:command", { command: "routes" });
@@ -221,7 +221,7 @@ if (command === "dev") {
221
221
  } else if (command === "typecheck") {
222
222
  sendTelemetryEvent("cli:command", { command });
223
223
  const configPath = parseNamedArg("--config");
224
- const { typecheck } = await import("./typecheck-209bemxm.js");
224
+ const { typecheck } = await import("./typecheck-fag7djt5.js");
225
225
  await typecheck(configPath);
226
226
  } else if (command === "migrate") {
227
227
  sendTelemetryEvent("cli:command", { command });
@@ -22,7 +22,7 @@ import"./index-3ewt17wm.js";
22
22
  import"./index-pr1skxen.js";
23
23
 
24
24
  // src/cli/scripts/typecheck.ts
25
- import { join as join2, parse as parse3, relative as relative2, resolve as resolve3 } from "path";
25
+ import { dirname as dirname3, join as join2, parse as parse3, relative as relative2, resolve as resolve3 } from "path";
26
26
  import { existsSync as existsSync3, readFileSync as readFileSync3 } from "fs";
27
27
  import { mkdir as mkdir2, rm as rm2, writeFile as writeFile2 } from "fs/promises";
28
28
 
@@ -1036,12 +1036,13 @@ var summarizeImportAdvice = (entries, label) => {
1036
1036
  import { createHash } from "crypto";
1037
1037
  import { existsSync, readFileSync, statSync } from "fs";
1038
1038
  import { dirname, resolve } from "path";
1039
- var BUN_CHECK_MIN_VERSION = "1.4.3";
1039
+ var BUN_CHECK_MIN_VERSION = "1.4.4";
1040
1040
  var CHECKER_ENV = "ABSOLUTE_TYPECHECK_CHECKER";
1041
+ var NO_SCRIPT = "--no-script";
1041
1042
  var THREADS_ENV = "ABSOLUTE_TYPECHECK_THREADS";
1042
1043
  var bunCheckCommand = (configPath, env = process.env, bun = process.execPath, terminal = process.stdout.isTTY === true) => {
1043
1044
  const threads = Number(env[THREADS_ENV]);
1044
- const command = [bun, "check", "-p", configPath, "--all"];
1045
+ const command = [bun, "check", "-p", configPath, "--all", NO_SCRIPT];
1045
1046
  if (terminal)
1046
1047
  command.push("--pretty=true");
1047
1048
  if (Number.isSafeInteger(threads) && threads > 0)
@@ -1440,6 +1441,17 @@ var buildVueTscCheck = async (cacheDir) => {
1440
1441
  return cached;
1441
1442
  return run("vue-tsc", base);
1442
1443
  };
1444
+ var buildVueCheck = async (cacheDir) => {
1445
+ const configPath = await writeTypecheckConfig(cacheDir, "bun");
1446
+ const vueCheck = join2(dirname3(Bun.resolveSync("@absolutejs/vue-check/package.json", import.meta.dir)), "src/cli.ts");
1447
+ return run("vue-check", [
1448
+ process.execPath,
1449
+ vueCheck,
1450
+ "-p",
1451
+ configPath,
1452
+ `--out-dir=${resolve3(cacheDir, "vue-check")}`
1453
+ ]);
1454
+ };
1443
1455
  var buildAngularCheck = async (cacheDir, angularDir) => {
1444
1456
  const ngcBin = findBin("ngc");
1445
1457
  if (!ngcBin) {
@@ -1505,7 +1517,8 @@ var buildBunCheck = async (cacheDir) => {
1505
1517
  "check",
1506
1518
  "-p",
1507
1519
  configPath,
1508
- "--listFilesOnly"
1520
+ "--listFilesOnly",
1521
+ NO_SCRIPT
1509
1522
  ]);
1510
1523
  const fingerprint = listing.exitCode === 0 ? checkFingerprint(listing.output, configPath) : null;
1511
1524
  const lastPass = existsSync3(passFile) ? readFileSync3(passFile, "utf-8").trim() : null;
@@ -1607,8 +1620,10 @@ var typecheck = async (configPath) => {
1607
1620
  for (const config of targets)
1608
1621
  ensureFileRouteModule(config);
1609
1622
  const checks = [];
1610
- const plainCheck = bunCheckSupported() ? buildBunCheck : buildTscCheck;
1611
- checks.push(hasVue ? buildVueTscCheck(cacheDir) : plainCheck(cacheDir));
1623
+ const useBunCheck = bunCheckSupported();
1624
+ const plainCheck = useBunCheck ? buildBunCheck : buildTscCheck;
1625
+ const vueCheck = useBunCheck ? buildVueCheck : buildVueTscCheck;
1626
+ checks.push(hasVue ? vueCheck(cacheDir) : plainCheck(cacheDir));
1612
1627
  for (const svelteDir of hasSvelte ? svelteDirs : []) {
1613
1628
  checks.push(buildSvelteCheck(cacheDir, svelteDir));
1614
1629
  }
@@ -1,7 +1,4 @@
1
1
  // @bun
2
- // src/utils/runtimeMode.ts
3
- var ENV_VAR = "NODE_ENV", getNodeEnv = () => process.env[ENV_VAR], isDevelopmentRuntime = () => process.env[ENV_VAR] === "development", isProductionRuntime = () => process.env[ENV_VAR] === "production";
4
-
5
2
  // src/core/streamingSlotRegistrar.ts
6
3
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
7
4
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
@@ -43,7 +40,7 @@ var setStreamingSlotWarningController = (controller) => {
43
40
  Reflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, controller);
44
41
  };
45
42
  var warnMissingStreamingSlotCollector = (primitiveName) => {
46
- if (isProductionRuntime() || isStreamingSlotCollectionActive()) {
43
+ if (isStreamingSlotCollectionActive()) {
47
44
  return;
48
45
  }
49
46
  getWarningController()?.maybeWarn(primitiveName);
@@ -58,5 +55,5 @@ export {
58
55
  warnMissingStreamingSlotCollector
59
56
  };
60
57
 
61
- //# debugId=8D60BFFA24E01FAE64756E2164756E21
58
+ //# debugId=B814AB4D54EB8FE164756E2164756E21
62
59
  //# sourceMappingURL=streamingSlotRegistrar.js.map
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/utils/runtimeMode.ts", "../src/core/streamingSlotRegistrar.ts"],
3
+ "sources": ["../src/core/streamingSlotRegistrar.ts"],
4
4
  "sourcesContent": [
5
- "/* Bundler-safe NODE_ENV reader.\n *\n * Bun (like esbuild and most modern bundlers) statically replaces\n * `process.env.NODE_ENV` with the build-time string. When absolutejs\n * itself is bundled (`bun run scripts/build.ts`), NODE_ENV is unset,\n * so every `process.env.NODE_ENV === 'production'` site collapses to\n * `false` and the production branch is dead-code-eliminated from\n * `dist/`. That breaks `bun start`, `bun compile`, and the standalone\n * compiled binary — they all run with NODE_ENV=production but see the\n * dev branches baked in.\n *\n * Computed-property access (`process.env[KEY]`) is NOT constant-folded\n * by Bun, so we read NODE_ENV through a string variable. Both branches\n * stay live in `dist/`, and the consumer's actual runtime NODE_ENV\n * decides which one fires.\n *\n * Verified empirically: Bun's bundler matches the literal AST shape\n * `MemberExpression { object: process.env, property: NODE_ENV }` for\n * its replacement. Computed-key access uses\n * `MemberExpression { computed: true, property: Identifier(KEY) }`,\n * which doesn't match the pattern. */\n\nconst ENV_VAR = 'NODE_ENV';\n\nexport const getNodeEnv = () => process.env[ENV_VAR];\nexport const isDevelopmentRuntime = () =>\n\tprocess.env[ENV_VAR] === 'development';\nexport const isProductionRuntime = () => process.env[ENV_VAR] === 'production';\n",
6
- "import { isProductionRuntime } from '../utils/runtimeMode';\nimport type { StreamingSlot } from '../utils/streamingSlots';\n\ntype StreamingSlotRegistrar = (slot: StreamingSlot) => void;\ntype StreamingSlotWarningController = {\n\tmaybeWarn(primitiveName: string): void;\n};\ntype StreamingSlotCollectionController = {\n\tisCollecting(): boolean;\n};\n\nconst STREAMING_SLOT_REGISTRAR_KEY = Symbol.for(\n\t'absolutejs.streamingSlotRegistrar'\n);\nconst STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotWarningController'\n);\nconst STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotCollectionController'\n);\n\nconst getRegisteredStreamingSlotRegistrar = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_REGISTRAR_KEY);\n\tif (typeof value === 'function' || value === null) {\n\t\treturn value;\n\t}\n\n\treturn undefined;\n};\n\nconst isObjectRecord = (value: unknown): value is Record<string, unknown> =>\n\tBoolean(value) && typeof value === 'object';\n\nconst isStreamingSlotWarningController = (\n\tvalue: unknown\n): value is StreamingSlotWarningController =>\n\tisObjectRecord(value) &&\n\t'maybeWarn' in value &&\n\ttypeof value.maybeWarn === 'function';\n\nconst isStreamingSlotCollectionController = (\n\tvalue: unknown\n): value is StreamingSlotCollectionController =>\n\tisObjectRecord(value) &&\n\t'isCollecting' in value &&\n\ttypeof value.isCollecting === 'function';\n\nconst getWarningController = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY);\n\tif (value === null || typeof value === 'undefined') return undefined;\n\n\treturn isStreamingSlotWarningController(value) ? value : undefined;\n};\n\nconst getCollectionController = () => {\n\tconst value = Reflect.get(\n\t\tglobalThis,\n\t\tSTREAMING_SLOT_COLLECTION_STORAGE_KEY\n\t);\n\tif (value === null || typeof value === 'undefined') return undefined;\n\n\treturn isStreamingSlotCollectionController(value) ? value : undefined;\n};\n\nexport const hasRegisteredStreamingSlotRegistrar = () =>\n\ttypeof getRegisteredStreamingSlotRegistrar() === 'function';\nexport const isStreamingSlotCollectionActive = () =>\n\tgetCollectionController()?.isCollecting() === true;\nexport const registerStreamingSlot = (slot: StreamingSlot) => {\n\tgetRegisteredStreamingSlotRegistrar()?.(slot);\n};\nexport const setStreamingSlotCollectionController = (\n\tcontroller: StreamingSlotCollectionController | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_COLLECTION_STORAGE_KEY, controller);\n};\nexport const setStreamingSlotRegistrar = (\n\tnextRegistrar: StreamingSlotRegistrar | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_REGISTRAR_KEY, nextRegistrar);\n};\nexport const setStreamingSlotWarningController = (\n\tcontroller: StreamingSlotWarningController | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, controller);\n};\nexport const warnMissingStreamingSlotCollector = (primitiveName: string) => {\n\tif (isProductionRuntime() || isStreamingSlotCollectionActive()) {\n\t\treturn;\n\t}\n\n\tgetWarningController()?.maybeWarn(primitiveName);\n};\n"
5
+ "import type { StreamingSlot } from '../utils/streamingSlots';\n\ntype StreamingSlotRegistrar = (slot: StreamingSlot) => void;\ntype StreamingSlotWarningController = {\n\tmaybeWarn(primitiveName: string): void;\n};\ntype StreamingSlotCollectionController = {\n\tisCollecting(): boolean;\n};\n\nconst STREAMING_SLOT_REGISTRAR_KEY = Symbol.for(\n\t'absolutejs.streamingSlotRegistrar'\n);\nconst STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotWarningController'\n);\nconst STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotCollectionController'\n);\n\nconst getRegisteredStreamingSlotRegistrar = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_REGISTRAR_KEY);\n\tif (typeof value === 'function' || value === null) {\n\t\treturn value;\n\t}\n\n\treturn undefined;\n};\n\nconst isObjectRecord = (value: unknown): value is Record<string, unknown> =>\n\tBoolean(value) && typeof value === 'object';\n\nconst isStreamingSlotWarningController = (\n\tvalue: unknown\n): value is StreamingSlotWarningController =>\n\tisObjectRecord(value) &&\n\t'maybeWarn' in value &&\n\ttypeof value.maybeWarn === 'function';\n\nconst isStreamingSlotCollectionController = (\n\tvalue: unknown\n): value is StreamingSlotCollectionController =>\n\tisObjectRecord(value) &&\n\t'isCollecting' in value &&\n\ttypeof value.isCollecting === 'function';\n\nconst getWarningController = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY);\n\tif (value === null || typeof value === 'undefined') return undefined;\n\n\treturn isStreamingSlotWarningController(value) ? value : undefined;\n};\n\nconst getCollectionController = () => {\n\tconst value = Reflect.get(\n\t\tglobalThis,\n\t\tSTREAMING_SLOT_COLLECTION_STORAGE_KEY\n\t);\n\tif (value === null || typeof value === 'undefined') return undefined;\n\n\treturn isStreamingSlotCollectionController(value) ? value : undefined;\n};\n\nexport const hasRegisteredStreamingSlotRegistrar = () =>\n\ttypeof getRegisteredStreamingSlotRegistrar() === 'function';\nexport const isStreamingSlotCollectionActive = () =>\n\tgetCollectionController()?.isCollecting() === true;\nexport const registerStreamingSlot = (slot: StreamingSlot) => {\n\tgetRegisteredStreamingSlotRegistrar()?.(slot);\n};\nexport const setStreamingSlotCollectionController = (\n\tcontroller: StreamingSlotCollectionController | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_COLLECTION_STORAGE_KEY, controller);\n};\nexport const setStreamingSlotRegistrar = (\n\tnextRegistrar: StreamingSlotRegistrar | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_REGISTRAR_KEY, nextRegistrar);\n};\nexport const setStreamingSlotWarningController = (\n\tcontroller: StreamingSlotWarningController | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, controller);\n};\n/* Warns in production too: a slot that silently stays on its fallback is\n * worse there. The controller logs each distinct warning once per process\n * in production. */\nexport const warnMissingStreamingSlotCollector = (primitiveName: string) => {\n\tif (isStreamingSlotCollectionActive()) {\n\t\treturn;\n\t}\n\n\tgetWarningController()?.maybeWarn(primitiveName);\n};\n"
7
6
  ],
8
- "mappings": ";;IAsBM,UAAU,YAEH,aAAa,MAAM,QAAQ,IAAI,UAC/B,uBAAuB,MACnC,QAAQ,IAAI,aAAa,eACb,sBAAsB,MAAM,QAAQ,IAAI,aAAa;;;AChBlE,IAAM,+BAA+B,OAAO,IAC3C,mCACD;AACA,IAAM,qCAAqC,OAAO,IACjD,2CACD;AACA,IAAM,wCAAwC,OAAO,IACpD,8CACD;AAEA,IAAM,sCAAsC,MAAM;AAAA,EACjD,MAAM,QAAQ,QAAQ,IAAI,YAAY,4BAA4B;AAAA,EAClE,IAAI,OAAO,UAAU,cAAc,UAAU,MAAM;AAAA,IAClD,OAAO;AAAA,EACR;AAAA,EA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AI,YAAY,8BAA8B,aAAa;AAAA;AAE7D,IAAM,oCAAoC,CAChD,eACI;AAAA,EACJ,QAAQ,IAAI,YAAY,oCAAoC,UAAU;AAAA;AAKhE,IAAM,oCAAoC,CAAC,kBAA0B;AAAA,EAC3E,IAAI,gCAAgC,GAAG;AAAA,IACtC;AAAA,EACD;AAAA,EAEA,qBAAqB,GAAG,UAAU,aAAa;AAAA;",
8
+ "debugId": "B814AB4D54EB8FE164756E2164756E21",
10
9
  "names": []
11
10
  }
@@ -1,7 +1,4 @@
1
1
  // @bun
2
- // src/utils/runtimeMode.ts
3
- var ENV_VAR = "NODE_ENV", getNodeEnv = () => process.env[ENV_VAR], isDevelopmentRuntime = () => process.env[ENV_VAR] === "development", isProductionRuntime = () => process.env[ENV_VAR] === "production";
4
-
5
2
  // src/core/streamingSlotRegistrar.ts
6
3
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
7
4
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
@@ -43,7 +40,7 @@ var setStreamingSlotWarningController = (controller) => {
43
40
  Reflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, controller);
44
41
  };
45
42
  var warnMissingStreamingSlotCollector = (primitiveName) => {
46
- if (isProductionRuntime() || isStreamingSlotCollectionActive()) {
43
+ if (isStreamingSlotCollectionActive()) {
47
44
  return;
48
45
  }
49
46
  getWarningController()?.maybeWarn(primitiveName);
@@ -114,5 +111,5 @@ export {
114
111
  runWithStreamingSlotRegistry
115
112
  };
116
113
 
117
- //# debugId=3B31AEA3DCB5AEB464756E2164756E21
114
+ //# debugId=0132C30F715579BD64756E2164756E21
118
115
  //# sourceMappingURL=streamingSlotRegistry.js.map
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/utils/runtimeMode.ts", "../src/core/streamingSlotRegistrar.ts", "../src/core/streamingSlotRegistry.ts"],
3
+ "sources": ["../src/core/streamingSlotRegistrar.ts", "../src/core/streamingSlotRegistry.ts"],
4
4
  "sourcesContent": [
5
- "/* Bundler-safe NODE_ENV reader.\n *\n * Bun (like esbuild and most modern bundlers) statically replaces\n * `process.env.NODE_ENV` with the build-time string. When absolutejs\n * itself is bundled (`bun run scripts/build.ts`), NODE_ENV is unset,\n * so every `process.env.NODE_ENV === 'production'` site collapses to\n * `false` and the production branch is dead-code-eliminated from\n * `dist/`. That breaks `bun start`, `bun compile`, and the standalone\n * compiled binary — they all run with NODE_ENV=production but see the\n * dev branches baked in.\n *\n * Computed-property access (`process.env[KEY]`) is NOT constant-folded\n * by Bun, so we read NODE_ENV through a string variable. Both branches\n * stay live in `dist/`, and the consumer's actual runtime NODE_ENV\n * decides which one fires.\n *\n * Verified empirically: Bun's bundler matches the literal AST shape\n * `MemberExpression { object: process.env, property: NODE_ENV }` for\n * its replacement. Computed-key access uses\n * `MemberExpression { computed: true, property: Identifier(KEY) }`,\n * which doesn't match the pattern. */\n\nconst ENV_VAR = 'NODE_ENV';\n\nexport const getNodeEnv = () => process.env[ENV_VAR];\nexport const isDevelopmentRuntime = () =>\n\tprocess.env[ENV_VAR] === 'development';\nexport const isProductionRuntime = () => process.env[ENV_VAR] === 'production';\n",
6
- "import { isProductionRuntime } from '../utils/runtimeMode';\nimport type { StreamingSlot } from '../utils/streamingSlots';\n\ntype StreamingSlotRegistrar = (slot: StreamingSlot) => void;\ntype StreamingSlotWarningController = {\n\tmaybeWarn(primitiveName: string): void;\n};\ntype StreamingSlotCollectionController = {\n\tisCollecting(): boolean;\n};\n\nconst STREAMING_SLOT_REGISTRAR_KEY = Symbol.for(\n\t'absolutejs.streamingSlotRegistrar'\n);\nconst STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotWarningController'\n);\nconst STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotCollectionController'\n);\n\nconst getRegisteredStreamingSlotRegistrar = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_REGISTRAR_KEY);\n\tif (typeof value === 'function' || value === null) {\n\t\treturn value;\n\t}\n\n\treturn undefined;\n};\n\nconst isObjectRecord = (value: unknown): value is Record<string, unknown> =>\n\tBoolean(value) && typeof value === 'object';\n\nconst isStreamingSlotWarningController = (\n\tvalue: unknown\n): value is StreamingSlotWarningController =>\n\tisObjectRecord(value) &&\n\t'maybeWarn' in value &&\n\ttypeof value.maybeWarn === 'function';\n\nconst isStreamingSlotCollectionController = (\n\tvalue: unknown\n): value is StreamingSlotCollectionController =>\n\tisObjectRecord(value) &&\n\t'isCollecting' in value &&\n\ttypeof value.isCollecting === 'function';\n\nconst getWarningController = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY);\n\tif (value === null || typeof value === 'undefined') return undefined;\n\n\treturn isStreamingSlotWarningController(value) ? value : undefined;\n};\n\nconst getCollectionController = () => {\n\tconst value = Reflect.get(\n\t\tglobalThis,\n\t\tSTREAMING_SLOT_COLLECTION_STORAGE_KEY\n\t);\n\tif (value === null || typeof value === 'undefined') return undefined;\n\n\treturn isStreamingSlotCollectionController(value) ? value : undefined;\n};\n\nexport const hasRegisteredStreamingSlotRegistrar = () =>\n\ttypeof getRegisteredStreamingSlotRegistrar() === 'function';\nexport const isStreamingSlotCollectionActive = () =>\n\tgetCollectionController()?.isCollecting() === true;\nexport const registerStreamingSlot = (slot: StreamingSlot) => {\n\tgetRegisteredStreamingSlotRegistrar()?.(slot);\n};\nexport const setStreamingSlotCollectionController = (\n\tcontroller: StreamingSlotCollectionController | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_COLLECTION_STORAGE_KEY, controller);\n};\nexport const setStreamingSlotRegistrar = (\n\tnextRegistrar: StreamingSlotRegistrar | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_REGISTRAR_KEY, nextRegistrar);\n};\nexport const setStreamingSlotWarningController = (\n\tcontroller: StreamingSlotWarningController | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, controller);\n};\nexport const warnMissingStreamingSlotCollector = (primitiveName: string) => {\n\tif (isProductionRuntime() || isStreamingSlotCollectionActive()) {\n\t\treturn;\n\t}\n\n\tgetWarningController()?.maybeWarn(primitiveName);\n};\n",
5
+ "import type { StreamingSlot } from '../utils/streamingSlots';\n\ntype StreamingSlotRegistrar = (slot: StreamingSlot) => void;\ntype StreamingSlotWarningController = {\n\tmaybeWarn(primitiveName: string): void;\n};\ntype StreamingSlotCollectionController = {\n\tisCollecting(): boolean;\n};\n\nconst STREAMING_SLOT_REGISTRAR_KEY = Symbol.for(\n\t'absolutejs.streamingSlotRegistrar'\n);\nconst STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotWarningController'\n);\nconst STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotCollectionController'\n);\n\nconst getRegisteredStreamingSlotRegistrar = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_REGISTRAR_KEY);\n\tif (typeof value === 'function' || value === null) {\n\t\treturn value;\n\t}\n\n\treturn undefined;\n};\n\nconst isObjectRecord = (value: unknown): value is Record<string, unknown> =>\n\tBoolean(value) && typeof value === 'object';\n\nconst isStreamingSlotWarningController = (\n\tvalue: unknown\n): value is StreamingSlotWarningController =>\n\tisObjectRecord(value) &&\n\t'maybeWarn' in value &&\n\ttypeof value.maybeWarn === 'function';\n\nconst isStreamingSlotCollectionController = (\n\tvalue: unknown\n): value is StreamingSlotCollectionController =>\n\tisObjectRecord(value) &&\n\t'isCollecting' in value &&\n\ttypeof value.isCollecting === 'function';\n\nconst getWarningController = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY);\n\tif (value === null || typeof value === 'undefined') return undefined;\n\n\treturn isStreamingSlotWarningController(value) ? value : undefined;\n};\n\nconst getCollectionController = () => {\n\tconst value = Reflect.get(\n\t\tglobalThis,\n\t\tSTREAMING_SLOT_COLLECTION_STORAGE_KEY\n\t);\n\tif (value === null || typeof value === 'undefined') return undefined;\n\n\treturn isStreamingSlotCollectionController(value) ? value : undefined;\n};\n\nexport const hasRegisteredStreamingSlotRegistrar = () =>\n\ttypeof getRegisteredStreamingSlotRegistrar() === 'function';\nexport const isStreamingSlotCollectionActive = () =>\n\tgetCollectionController()?.isCollecting() === true;\nexport const registerStreamingSlot = (slot: StreamingSlot) => {\n\tgetRegisteredStreamingSlotRegistrar()?.(slot);\n};\nexport const setStreamingSlotCollectionController = (\n\tcontroller: StreamingSlotCollectionController | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_COLLECTION_STORAGE_KEY, controller);\n};\nexport const setStreamingSlotRegistrar = (\n\tnextRegistrar: StreamingSlotRegistrar | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_REGISTRAR_KEY, nextRegistrar);\n};\nexport const setStreamingSlotWarningController = (\n\tcontroller: StreamingSlotWarningController | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, controller);\n};\n/* Warns in production too: a slot that silently stays on its fallback is\n * worse there. The controller logs each distinct warning once per process\n * in production. */\nexport const warnMissingStreamingSlotCollector = (primitiveName: string) => {\n\tif (isStreamingSlotCollectionActive()) {\n\t\treturn;\n\t}\n\n\tgetWarningController()?.maybeWarn(primitiveName);\n};\n",
7
6
  "import type { StreamingSlot } from '../utils/streamingSlots';\nimport {\n\tsetStreamingSlotCollectionController,\n\tsetStreamingSlotRegistrar\n} from './streamingSlotRegistrar';\n\ntype SlotStore = Map<string, StreamingSlot>;\ntype AsyncLocalStorageType =\n\timport('node:async_hooks').AsyncLocalStorage<SlotStore>;\n\nconst STREAMING_SLOT_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotAsyncLocalStorage'\n);\n\nconst isObjectRecord = (value: unknown): value is Record<string, unknown> =>\n\tBoolean(value) && typeof value === 'object';\n\nconst isAsyncLocalStorage = (value: unknown): value is AsyncLocalStorageType =>\n\tisObjectRecord(value) &&\n\t'getStore' in value &&\n\ttypeof value.getStore === 'function' &&\n\t'run' in value &&\n\ttypeof value.run === 'function';\n\nconst getStorageGlobal = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_STORAGE_KEY);\n\tif (value === null || typeof value === 'undefined') {\n\t\treturn value;\n\t}\n\n\treturn isAsyncLocalStorage(value) ? value : undefined;\n};\n\nconst isServerRuntime = () =>\n\ttypeof process !== 'undefined' &&\n\ttypeof process.versions?.node === 'string';\n\nconst ensureAsyncLocalStorage = async () => {\n\tconst storage = getStorageGlobal();\n\tif (typeof storage !== 'undefined') {\n\t\treturn storage;\n\t}\n\tif (!isServerRuntime()) {\n\t\tReflect.set(globalThis, STREAMING_SLOT_STORAGE_KEY, null);\n\n\t\treturn getStorageGlobal();\n\t}\n\n\tconst mod = await import('node:async_hooks');\n\tReflect.set(\n\t\tglobalThis,\n\t\tSTREAMING_SLOT_STORAGE_KEY,\n\t\tnew mod.AsyncLocalStorage<SlotStore>()\n\t);\n\n\treturn getStorageGlobal();\n};\n\nconst getActiveSlotStore = () => {\n\tconst storage = getStorageGlobal();\n\tif (!storage) return undefined;\n\n\treturn storage.getStore();\n};\n\nconst registerStreamingSlot = (slot: StreamingSlot) => {\n\tconst store = getActiveSlotStore();\n\tif (!store) return;\n\tstore.set(slot.id, slot);\n};\n\nsetStreamingSlotRegistrar(registerStreamingSlot);\nsetStreamingSlotCollectionController({\n\tisCollecting: () => getActiveSlotStore() !== undefined\n});\n\nexport const hasActiveStreamingSlotRegistry = () =>\n\tgetActiveSlotStore() !== undefined;\n\nexport const runWithStreamingSlotRegistry = async <T>(\n\ttask: () => Promise<T> | T\n) => {\n\tconst storage = await ensureAsyncLocalStorage();\n\tif (!storage) {\n\t\tconst slots: StreamingSlot[] = [];\n\n\t\treturn {\n\t\t\tresult: await task(),\n\t\t\tslots\n\t\t};\n\t}\n\n\treturn storage.run(new Map<string, StreamingSlot>(), async () => {\n\t\tconst result = await task();\n\t\tconst store = storage.getStore();\n\n\t\treturn {\n\t\t\tresult,\n\t\t\tslots: store ? [...store.values()] : []\n\t\t};\n\t});\n};\n"
8
7
  ],
9
- "mappings": ";;IAsBM,UAAU,YAEH,aAAa,MAAM,QAAQ,IAAI,UAC/B,uBAAuB,MACnC,QAAQ,IAAI,aAAa,eACb,sBAAsB,MAAM,QAAQ,IAAI,aAAa;;;AChBlE,IAAM,+BAA+B,OAAO,IAC3C,mCACD;AACA,IAAM,qCAAqC,OAAO,IACjD,2CACD;AACA,IAAM,wCAAwC,OAAO,IACpD,8CACD;AAEA,IAAM,sCAAsC,MAAM;AAAA,EACjD,MAAM,QAAQ,QAAQ,IAAI,YAAY,4BAA4B;AAAA,EAClE,IAAI,OAAO,UAAU,cAAc,UAAU,MAAM;AAAA,IAClD,OAAO;AAAA,EACR;AAAA,EAEA;AAAA;AAGD,IAAM,iBAAiB,CAAC,UACvB,QAAQ,KAAK,KAAK,OAAO,UAAU;AAEpC,IAAM,mCAAmC,CACxC,UAEA,eAAe,KAAK,MACpB,eAAe,UACf,OAAO,MAAM,cAAc;AAE5B,IAAM,sCAAsC,CAC3C,UAEA,eAAe,KAAK,MACpB,kBAAkB,UAClB,OAAO,MAAM,iBAAiB;AAE/B,IAAM,uBAAuB,MAAM;AAAA,EAClC,MAAM,QAAQ,QAAQ,IAAI,YAAY,kCAAkC;AAAA,EACxE,IAAI,UAAU,QAAQ,OAAO,UAAU;AAAA,IAAa;AAAA,EAEpD,OAAO,iCAAiC,KAAK,IAAI,QAAQ;AAAA;AAG1D,IAAM,0BAA0B,MAAM;AAAA,EACrC,MAAM,QAAQ,QAAQ,IACrB,YACA,qCACD;AAAA,EACA,IAAI,UAAU,QAAQ,OAAO,UAAU;AAAA,IAAa;AAAA,EAEpD,OAAO,oCAAoC,KAAK,IAAI,QAAQ;AAAA;AAGtD,IAAM,sCAAsC,MAClD,OAAO,oCAAoC,MAAM;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,MAAM,IAAI,KAAK,IAAI,IAAI;AAAA;AAGxB,0BAA0B,sBAAqB;AAC/C,qCAAqC;AAAA,EACpC,cAAc,MAAM,mBAAmB,MAAM;AAC9C,CAAC;AAEM,IAAM,iCAAiC,MAC7C,mBAAmB,MAAM;AAEnB,IAAM,+BAA+B,OAC3C,SACI;AAAA,EACJ,MAAM,UAAU,MAAM,wBAAwB;AAAA,EAC9C,IAAI,CAAC,SAAS;AAAA,IACb,MAAM,QAAyB,CAAC;AAAA,IAEhC,OAAO;AAAA,MACN,QAAQ,MAAM,KAAK;AAAA,MACnB;AAAA,IACD;AAAA,EACD;AAAA,EAEA,OAAO,QAAQ,IAAI,IAAI,KAA8B,YAAY;AAAA,IAChE,MAAM,SAAS,MAAM,KAAK;AAAA,IAC1B,MAAM,QAAQ,QAAQ,SAAS;AAAA,IAE/B,OAAO;AAAA,MACN;AAAA,MACA,OAAO,QAAQ,CAAC,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC;AAAA,IACvC;AAAA,GACA;AAAA;",
9
+ "debugId": "0132C30F715579BD64756E2164756E21",
11
10
  "names": []
12
11
  }
@@ -172896,7 +172896,8 @@ var init_install = __esm(() => {
172896
172896
 
172897
172897
  // src/utils/runtimeMode.ts
172898
172898
  var ENV_VAR = "NODE_ENV";
172899
- var isDevelopmentRuntime = () => process.env[ENV_VAR] === "development";
172899
+ var readEnv = () => typeof process === "undefined" ? undefined : process.env?.[ENV_VAR];
172900
+ var isDevelopmentRuntime = () => readEnv() === "development";
172900
172901
 
172901
172902
  // src/dev/serverBootstrap.ts
172902
172903
  init_constants();