@absolutejs/absolute 0.20.0-beta.167 → 0.20.0-beta.169

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 (89) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +81 -0
  3. package/changelog.json +35 -0
  4. package/dist/angular/browser.js +3 -3
  5. package/dist/angular/browser.js.map +3 -3
  6. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  7. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  8. package/dist/angular/index.js +211 -197
  9. package/dist/angular/index.js.map +8 -8
  10. package/dist/angular/server.js +211 -197
  11. package/dist/angular/server.js.map +8 -8
  12. package/dist/build.js +1324 -998
  13. package/dist/build.js.map +12 -8
  14. package/dist/cli/{add-kwyqxccz.js → add-7azr0c83.js} +5 -5
  15. package/dist/cli/{androidEmulatorController-3zn6a4j3.js → androidEmulatorController-68jjdxmx.js} +3 -3
  16. package/dist/cli/{androidNativeWatcher-wz7vhnkr.js → androidNativeWatcher-x032x9yr.js} +3 -3
  17. package/dist/cli/{api-m3n8xbcv.js → api-mshjr4ah.js} +1 -1
  18. package/dist/cli/{compile-30m09382.js → compile-4jnfxts9.js} +2 -2
  19. package/dist/cli/config/server.js +129 -115
  20. package/dist/cli/{dev-ny2vah78.js → dev-9tk5hn2e.js} +9 -9
  21. package/dist/cli/{emulatorDoctor-1m4rr9y3.js → emulatorDoctor-p3yt7140.js} +2 -2
  22. package/dist/cli/{emulatorInstaller-70v711bj.js → emulatorInstaller-4pm2kx9w.js} +3 -3
  23. package/dist/cli/{expoDevController-hen9sra5.js → expoDevController-0vj8dvkh.js} +3 -3
  24. package/dist/cli/{generate-vx6tz1y2.js → generate-v75p2fct.js} +4 -4
  25. package/dist/cli/{htmx-dym03fq5.js → htmx-427swtdz.js} +2 -2
  26. package/dist/cli/{index-j9yrhw7a.js → index-066qhc6n.js} +1 -1
  27. package/dist/cli/{index-x1swv7rw.js → index-3vmc30gf.js} +1 -1
  28. package/dist/cli/{index-g8489j4d.js → index-a4ws2jwd.js} +1 -1
  29. package/dist/cli/{index-xj68ep9n.js → index-b7hjgknf.js} +2 -2
  30. package/dist/cli/{index-vkba3289.js → index-bhbs6d5z.js} +2 -2
  31. package/dist/cli/{index-v4cg4dvm.js → index-exfkpjja.js} +4 -3
  32. package/dist/cli/{index-vy8zejts.js → index-eyzwc7gz.js} +1 -1
  33. package/dist/cli/{index-d3br7c47.js → index-k3y8cb6c.js} +1 -1
  34. package/dist/cli/{index-52a2csjm.js → index-ppphkyps.js} +1 -1
  35. package/dist/cli/{index-bvwkwgjw.js → index-s3xvccq3.js} +1 -1
  36. package/dist/cli/{index-6ps18fvr.js → index-t8cf0zj9.js} +2 -2
  37. package/dist/cli/{index-wwnnfhm6.js → index-w09fzs9f.js} +1 -1
  38. package/dist/cli/{index-px7fqsfk.js → index-zd3cna19.js} +1 -1
  39. package/dist/cli/index.js +16 -16
  40. package/dist/cli/{info-9ffx5h3h.js → info-mn125212.js} +1 -1
  41. package/dist/cli/{iosNativeWatcher-ntzec3hx.js → iosNativeWatcher-0nm6qad5.js} +4 -4
  42. package/dist/cli/{iosSimulatorController-hjzy6pq6.js → iosSimulatorController-hza2c3rv.js} +4 -4
  43. package/dist/cli/{islands-rq6wx0kh.js → islands-8sgky9gh.js} +1 -1
  44. package/dist/cli/{mobile-41sev6v0.js → mobile-hcxjr2gf.js} +10 -10
  45. package/dist/cli/{ps-0tryaye0.js → ps-ezmzyscn.js} +1 -1
  46. package/dist/cli/{psTui-0nx63pmr.js → psTui-3x3ykjve.js} +1 -1
  47. package/dist/cli/{remoteMacProtocol-2ej6fbnj.js → remoteMacProtocol-g09myqt5.js} +4 -4
  48. package/dist/cli/{remove-qgme4h2s.js → remove-1ycjx85k.js} +4 -4
  49. package/dist/cli/{start-0ebxkwga.js → start-mbaejxhm.js} +3 -3
  50. package/dist/cli/{typecheck-7yhekrc0.js → typecheck-dr068pmh.js} +209 -43
  51. package/dist/cli/{workspace-atcxzyee.js → workspace-1sycp9g1.js} +7 -4
  52. package/dist/client/index.js +8 -3
  53. package/dist/client/index.js.map +4 -4
  54. package/dist/index.js +1402 -1075
  55. package/dist/index.js.map +14 -10
  56. package/dist/islands/browser.js +3 -3
  57. package/dist/islands/browser.js.map +3 -3
  58. package/dist/islands/index.js +3 -3
  59. package/dist/islands/index.js.map +3 -3
  60. package/dist/mobile/index.js.map +1 -1
  61. package/dist/react/browser.js +3 -3
  62. package/dist/react/browser.js.map +3 -3
  63. package/dist/react/index.js +231 -217
  64. package/dist/react/index.js.map +9 -9
  65. package/dist/react/server.js +231 -191
  66. package/dist/react/server.js.map +9 -8
  67. package/dist/src/build/islandBootstrap.d.ts +22 -0
  68. package/dist/src/build/missingClientFrameworks.d.ts +29 -0
  69. package/dist/src/build/svelteDeclarations.d.ts +27 -0
  70. package/dist/src/cli/utils.d.ts +5 -1
  71. package/dist/src/client/islandResolver.d.ts +3 -1
  72. package/dist/src/core/build.d.ts +1 -1
  73. package/dist/src/core/islandManifest.d.ts +10 -0
  74. package/dist/src/core/islandPageContext.d.ts +2 -0
  75. package/dist/src/dev/svelteDeclarationRefresher.d.ts +6 -0
  76. package/dist/svelte/browser.js +3 -3
  77. package/dist/svelte/browser.js.map +3 -3
  78. package/dist/svelte/index.js +211 -197
  79. package/dist/svelte/index.js.map +8 -8
  80. package/dist/svelte/server.js +211 -171
  81. package/dist/svelte/server.js.map +8 -7
  82. package/dist/vue/browser.js +3 -3
  83. package/dist/vue/browser.js.map +3 -3
  84. package/dist/vue/index.js +231 -217
  85. package/dist/vue/index.js.map +9 -9
  86. package/dist/vue/server.js +231 -191
  87. package/dist/vue/server.js.map +9 -8
  88. package/package.json +6 -1
  89. /package/dist/cli/{index-e6ysp900.js → index-z794p5qg.js} +0 -0
@@ -1027,11 +1027,210 @@ var init_svelteServerModule = __esm(() => {
1027
1027
  });
1028
1028
  });
1029
1029
 
1030
+ // src/utils/getDurationString.ts
1031
+ var getDurationString = (duration) => {
1032
+ let durationString;
1033
+ if (duration < MILLISECONDS_IN_A_SECOND) {
1034
+ durationString = `${duration.toFixed(TIME_PRECISION)}ms`;
1035
+ } else if (duration < MILLISECONDS_IN_A_MINUTE) {
1036
+ durationString = `${(duration / MILLISECONDS_IN_A_SECOND).toFixed(TIME_PRECISION)}s`;
1037
+ } else {
1038
+ const totalSeconds = Math.round(duration / MILLISECONDS_IN_A_SECOND);
1039
+ const minutes = Math.floor(totalSeconds / 60);
1040
+ const seconds = totalSeconds % 60;
1041
+ durationString = seconds === 0 ? `${minutes}m` : `${minutes}m ${seconds}s`;
1042
+ }
1043
+ return durationString;
1044
+ };
1045
+ var init_getDurationString = __esm(() => {
1046
+ init_constants();
1047
+ });
1048
+
1049
+ // src/utils/startupBanner.ts
1050
+ var colors, MONTHS, formatTimestamp = () => {
1051
+ const now = new Date;
1052
+ const month = MONTHS[now.getMonth()];
1053
+ const day = now.getDate().toString().padStart(2, "0");
1054
+ let hours = now.getHours();
1055
+ const minutes = now.getMinutes().toString().padStart(2, "0");
1056
+ const seconds = now.getSeconds().toString().padStart(2, "0");
1057
+ const ampm = hours >= HOURS_IN_HALF_DAY ? "PM" : "AM";
1058
+ hours = hours % HOURS_IN_HALF_DAY || HOURS_IN_HALF_DAY;
1059
+ return `${month} ${day} ${hours}:${minutes}:${seconds} ${ampm}`;
1060
+ }, startupBanner = (options) => {
1061
+ const {
1062
+ version,
1063
+ readyDuration,
1064
+ buildDuration,
1065
+ port,
1066
+ host,
1067
+ networkUrl,
1068
+ mobilePreviewUrl,
1069
+ protocol = "http"
1070
+ } = options;
1071
+ const name = `${colors.cyan}${colors.bold}ABSOLUTEJS${colors.reset}`;
1072
+ const ver = `${colors.dim}v${version}${colors.reset}`;
1073
+ const time = `${colors.dim}ready in${colors.reset} ${colors.bold}${getDurationString(readyDuration)}${colors.reset}`;
1074
+ const build = typeof buildDuration === "number" && Number.isFinite(buildDuration) ? ` ${colors.dim}(build ${getDurationString(buildDuration)})${colors.reset}` : "";
1075
+ console.log("");
1076
+ console.log(` ${name} ${ver} ${time}${build}`);
1077
+ console.log("");
1078
+ console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Local:${colors.reset} ${protocol}://${host === "0.0.0.0" ? "localhost" : host}:${port}/`);
1079
+ if (networkUrl) {
1080
+ console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Network:${colors.reset} ${networkUrl}`);
1081
+ }
1082
+ if (mobilePreviewUrl) {
1083
+ console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Mobile:${colors.reset} ${mobilePreviewUrl}`);
1084
+ }
1085
+ console.log("");
1086
+ };
1087
+ var init_startupBanner = __esm(() => {
1088
+ init_constants();
1089
+ init_getDurationString();
1090
+ colors = {
1091
+ bold: "\x1B[1m",
1092
+ cyan: "\x1B[36m",
1093
+ dim: "\x1B[2m",
1094
+ green: "\x1B[32m",
1095
+ reset: "\x1B[0m"
1096
+ };
1097
+ MONTHS = [
1098
+ "Jan",
1099
+ "Feb",
1100
+ "Mar",
1101
+ "Apr",
1102
+ "May",
1103
+ "Jun",
1104
+ "Jul",
1105
+ "Aug",
1106
+ "Sep",
1107
+ "Oct",
1108
+ "Nov",
1109
+ "Dec"
1110
+ ];
1111
+ });
1112
+
1113
+ // src/utils/logger.ts
1114
+ var colors2, frameworkColors, formatPath = (filePath) => {
1115
+ const cwd = process.cwd();
1116
+ let relative = filePath.startsWith(cwd) ? filePath.slice(cwd.length + 1) : filePath;
1117
+ relative = relative.replace(/\\/g, "/");
1118
+ if (!relative.startsWith("/")) {
1119
+ relative = `/${relative}`;
1120
+ }
1121
+ return relative;
1122
+ }, getFrameworkColor = (framework) => frameworkColors[framework] || colors2.white, log = (action, options) => {
1123
+ const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
1124
+ const tag = `${colors2.cyan}[hmr]${colors2.reset}`;
1125
+ let message = action;
1126
+ if (options?.path) {
1127
+ const pathColor = options.framework ? getFrameworkColor(options.framework) : colors2.white;
1128
+ message += ` ${pathColor}${formatPath(options.path)}${colors2.reset}`;
1129
+ }
1130
+ if (options?.duration !== undefined) {
1131
+ message += ` ${colors2.dim}(${options.duration}ms)${colors2.reset}`;
1132
+ }
1133
+ console.log(`${timestamp} ${tag} ${message}`);
1134
+ }, logCssUpdate = (path, framework, duration) => {
1135
+ log("css update", { duration, framework: framework ?? "css", path });
1136
+ }, logError = (message, error) => {
1137
+ const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
1138
+ const tag = `${colors2.red}[hmr]${colors2.reset}`;
1139
+ const errorMsg = error instanceof Error ? error.message : error;
1140
+ const fullMessage = `${colors2.red}error${colors2.reset} ${message}${errorMsg ? `: ${errorMsg}` : ""}`;
1141
+ console.error(`${timestamp} ${tag} ${fullMessage}`);
1142
+ }, logHmrClientUpdate = (path, framework, duration, target, serverMs, clientMs, outcome = "applied", kind) => {
1143
+ const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
1144
+ const targetLabel = target.startsWith("capacitor-") ? target.slice("capacitor-".length) : target;
1145
+ const tag = `${colors2.cyan}[hmr:${targetLabel}]${colors2.reset}`;
1146
+ const pathColor = framework ? getFrameworkColor(framework) : colors2.white;
1147
+ const breakdown = serverMs === undefined || clientMs === undefined ? "" : `; server ${serverMs}ms, client ${clientMs}ms`;
1148
+ let action = "failed after";
1149
+ if (outcome === "applied")
1150
+ action = "applied in";
1151
+ else if (outcome === "reloaded")
1152
+ action = "falling back to reload after";
1153
+ const kindLabel = kind ? `${kind} ` : "";
1154
+ console.log(`${timestamp} ${tag} ${framework ?? "update"} ${kindLabel}${pathColor}${formatPath(path)}${colors2.reset} ${colors2.dim}${action} ${duration}ms${breakdown}${colors2.reset}`);
1155
+ }, logHmrUpdate = (path, framework, duration) => {
1156
+ log("hmr update", { duration, framework, path });
1157
+ }, logInfo = (message) => {
1158
+ log(message);
1159
+ }, logPageBuild = (path, framework, duration) => {
1160
+ log("page build", { duration, framework, path });
1161
+ }, logScriptUpdate = (path, framework, duration) => {
1162
+ log("script update", { duration, framework, path });
1163
+ }, logServerReload = () => {
1164
+ log(`${colors2.cyan}server module reloaded${colors2.reset}`);
1165
+ }, logWarn = (message) => {
1166
+ const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
1167
+ const tag = `${colors2.yellow}[hmr]${colors2.reset}`;
1168
+ console.log(`${timestamp} ${tag} ${colors2.yellow}warning ${message}${colors2.reset}`);
1169
+ };
1170
+ var init_logger = __esm(() => {
1171
+ init_startupBanner();
1172
+ colors2 = {
1173
+ blue: "\x1B[34m",
1174
+ bold: "\x1B[1m",
1175
+ cyan: "\x1B[36m",
1176
+ dim: "\x1B[2m",
1177
+ green: "\x1B[32m",
1178
+ magenta: "\x1B[35m",
1179
+ red: "\x1B[31m",
1180
+ reset: "\x1B[0m",
1181
+ white: "\x1B[37m",
1182
+ yellow: "\x1B[33m"
1183
+ };
1184
+ frameworkColors = {
1185
+ angular: colors2.magenta,
1186
+ assets: colors2.dim,
1187
+ css: colors2.cyan,
1188
+ html: colors2.white,
1189
+ htmx: colors2.white,
1190
+ react: colors2.blue,
1191
+ svelte: colors2.yellow,
1192
+ vue: colors2.green
1193
+ };
1194
+ });
1195
+
1196
+ // src/core/islandManifest.ts
1197
+ var ISLAND_BOOTSTRAP_MANIFEST_KEY = "AbsoluteIslandBootstrap", LEGACY_ISLAND_BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", toIslandFrameworkSegment = (framework) => framework[0]?.toUpperCase() + framework.slice(1), collectFrameworkIslands = (manifest, prefix) => {
1198
+ const entries = {};
1199
+ let found = false;
1200
+ for (const [key, value] of Object.entries(manifest)) {
1201
+ if (!key.startsWith(prefix))
1202
+ continue;
1203
+ const component = key.slice(prefix.length);
1204
+ if (!component)
1205
+ continue;
1206
+ entries[component] = value;
1207
+ found = true;
1208
+ }
1209
+ return found ? entries : undefined;
1210
+ }, getIslandBootstrapPath = (manifest) => manifest[ISLAND_BOOTSTRAP_MANIFEST_KEY] ?? manifest[LEGACY_ISLAND_BOOTSTRAP_MANIFEST_KEY], getIslandManifestEntries = (manifest) => {
1211
+ const islands = {};
1212
+ const frameworks = ["react", "svelte", "vue", "angular"];
1213
+ for (const framework of frameworks) {
1214
+ const prefix = `Island${toIslandFrameworkSegment(framework)}`;
1215
+ const entries = collectFrameworkIslands(manifest, prefix);
1216
+ if (entries)
1217
+ islands[framework] = entries;
1218
+ }
1219
+ return islands;
1220
+ }, getIslandManifestKey = (framework, component) => `Island${toIslandFrameworkSegment(framework)}${component}`;
1221
+
1030
1222
  // src/core/islandPageContext.ts
1031
- var BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST__", ISLAND_STATE_MARKER = "__ABS_ISLAND_STATE__", CLOSING_HEAD_TAG = "</head>", buildIslandsHeadMarkup = (manifest) => {
1223
+ var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST__", ISLAND_STATE_MARKER = "__ABS_ISLAND_STATE__", CLOSING_HEAD_TAG = "</head>", warnedMissingBootstrap = false, warnIfBootstrapMissing = (manifest) => {
1224
+ if (warnedMissingBootstrap || getIslandBootstrapPath(manifest))
1225
+ return;
1226
+ if (false)
1227
+ ;
1228
+ warnedMissingBootstrap = true;
1229
+ 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().");
1230
+ }, buildIslandsHeadMarkup = (manifest) => {
1032
1231
  const manifestScript = `<script>window.__ABSOLUTE_MANIFEST__ = ${JSON.stringify(manifest)}</script>`;
1033
1232
  const islandStateScript = `<script>window.__ABS_ISLAND_STATE__ = ${JSON.stringify(globalThis.__ABS_ISLAND_STATE__ ?? {})}</script>`;
1034
- const bootstrapPath = manifest[BOOTSTRAP_MANIFEST_KEY];
1233
+ const bootstrapPath = getIslandBootstrapPath(manifest);
1035
1234
  const bootstrapScript = bootstrapPath ? `<script type="module" src="${bootstrapPath}"></script>` : "";
1036
1235
  return `${manifestScript}${islandStateScript}${bootstrapScript}`;
1037
1236
  }, injectHeadMarkup = (html, markup) => {
@@ -1133,7 +1332,7 @@ var BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", ISLAND_MARKER = 'data-island="tr
1133
1332
  }
1134
1333
  }
1135
1334
  });
1136
- }, pipeStreamWithIslandMarkerDetection = (stream, markup) => {
1335
+ }, pipeStreamWithIslandMarkerDetection = (stream, markup, onIslandsDetected) => {
1137
1336
  const encoder = new TextEncoder;
1138
1337
  const decoder = new TextDecoder;
1139
1338
  const headLookbehind = CLOSING_HEAD_TAG.length - 1;
@@ -1146,6 +1345,7 @@ var BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", ISLAND_MARKER = 'data-island="tr
1146
1345
  if (!held.includes(ISLAND_MARKER)) {
1147
1346
  return { held, injected: false, pending: "", sawHead: true };
1148
1347
  }
1348
+ onIslandsDetected();
1149
1349
  enqueue(controller, `${markup}${held}`);
1150
1350
  return { held: "", injected: true, pending: "", sawHead: true };
1151
1351
  };
@@ -1213,6 +1413,7 @@ var BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", ISLAND_MARKER = 'data-island="tr
1213
1413
  if (html.includes(MANIFEST_MARKER) || html.includes(ISLAND_STATE_MARKER)) {
1214
1414
  return html;
1215
1415
  }
1416
+ warnIfBootstrapMissing(manifest);
1216
1417
  return injectHeadMarkup(html, buildIslandsHeadMarkup(manifest));
1217
1418
  }, injectIslandPageContextStream = (stream, options) => {
1218
1419
  const manifest = globalThis.__absoluteManifest;
@@ -1220,15 +1421,19 @@ var BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", ISLAND_MARKER = 'data-island="tr
1220
1421
  return stream;
1221
1422
  const markup = buildIslandsHeadMarkup(manifest);
1222
1423
  if (options?.hasIslands === true) {
1424
+ warnIfBootstrapMissing(manifest);
1223
1425
  return pipeStreamWithHeadInjection(stream, markup);
1224
1426
  }
1225
1427
  if (options?.hasIslands === false) {
1226
1428
  return stream;
1227
1429
  }
1228
- return pipeStreamWithIslandMarkerDetection(stream, markup);
1430
+ return pipeStreamWithIslandMarkerDetection(stream, markup, () => warnIfBootstrapMissing(manifest));
1229
1431
  }, setCurrentIslandManifest = (manifest) => {
1230
1432
  globalThis.__absoluteManifest = manifest;
1231
1433
  };
1434
+ var init_islandPageContext = __esm(() => {
1435
+ init_logger();
1436
+ });
1232
1437
 
1233
1438
  // src/core/devRouteRegistrationCallsite.ts
1234
1439
  import { AsyncLocalStorage } from "async_hooks";
@@ -2548,172 +2753,6 @@ var init_streamingSlots = __esm(() => {
2548
2753
  };
2549
2754
  });
2550
2755
 
2551
- // src/utils/getDurationString.ts
2552
- var getDurationString = (duration) => {
2553
- let durationString;
2554
- if (duration < MILLISECONDS_IN_A_SECOND) {
2555
- durationString = `${duration.toFixed(TIME_PRECISION)}ms`;
2556
- } else if (duration < MILLISECONDS_IN_A_MINUTE) {
2557
- durationString = `${(duration / MILLISECONDS_IN_A_SECOND).toFixed(TIME_PRECISION)}s`;
2558
- } else {
2559
- const totalSeconds = Math.round(duration / MILLISECONDS_IN_A_SECOND);
2560
- const minutes = Math.floor(totalSeconds / 60);
2561
- const seconds = totalSeconds % 60;
2562
- durationString = seconds === 0 ? `${minutes}m` : `${minutes}m ${seconds}s`;
2563
- }
2564
- return durationString;
2565
- };
2566
- var init_getDurationString = __esm(() => {
2567
- init_constants();
2568
- });
2569
-
2570
- // src/utils/startupBanner.ts
2571
- var colors, MONTHS, formatTimestamp = () => {
2572
- const now = new Date;
2573
- const month = MONTHS[now.getMonth()];
2574
- const day = now.getDate().toString().padStart(2, "0");
2575
- let hours = now.getHours();
2576
- const minutes = now.getMinutes().toString().padStart(2, "0");
2577
- const seconds = now.getSeconds().toString().padStart(2, "0");
2578
- const ampm = hours >= HOURS_IN_HALF_DAY ? "PM" : "AM";
2579
- hours = hours % HOURS_IN_HALF_DAY || HOURS_IN_HALF_DAY;
2580
- return `${month} ${day} ${hours}:${minutes}:${seconds} ${ampm}`;
2581
- }, startupBanner = (options) => {
2582
- const {
2583
- version,
2584
- readyDuration,
2585
- buildDuration,
2586
- port,
2587
- host,
2588
- networkUrl,
2589
- mobilePreviewUrl,
2590
- protocol = "http"
2591
- } = options;
2592
- const name = `${colors.cyan}${colors.bold}ABSOLUTEJS${colors.reset}`;
2593
- const ver = `${colors.dim}v${version}${colors.reset}`;
2594
- const time = `${colors.dim}ready in${colors.reset} ${colors.bold}${getDurationString(readyDuration)}${colors.reset}`;
2595
- const build = typeof buildDuration === "number" && Number.isFinite(buildDuration) ? ` ${colors.dim}(build ${getDurationString(buildDuration)})${colors.reset}` : "";
2596
- console.log("");
2597
- console.log(` ${name} ${ver} ${time}${build}`);
2598
- console.log("");
2599
- console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Local:${colors.reset} ${protocol}://${host === "0.0.0.0" ? "localhost" : host}:${port}/`);
2600
- if (networkUrl) {
2601
- console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Network:${colors.reset} ${networkUrl}`);
2602
- }
2603
- if (mobilePreviewUrl) {
2604
- console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Mobile:${colors.reset} ${mobilePreviewUrl}`);
2605
- }
2606
- console.log("");
2607
- };
2608
- var init_startupBanner = __esm(() => {
2609
- init_constants();
2610
- init_getDurationString();
2611
- colors = {
2612
- bold: "\x1B[1m",
2613
- cyan: "\x1B[36m",
2614
- dim: "\x1B[2m",
2615
- green: "\x1B[32m",
2616
- reset: "\x1B[0m"
2617
- };
2618
- MONTHS = [
2619
- "Jan",
2620
- "Feb",
2621
- "Mar",
2622
- "Apr",
2623
- "May",
2624
- "Jun",
2625
- "Jul",
2626
- "Aug",
2627
- "Sep",
2628
- "Oct",
2629
- "Nov",
2630
- "Dec"
2631
- ];
2632
- });
2633
-
2634
- // src/utils/logger.ts
2635
- var colors2, frameworkColors, formatPath = (filePath) => {
2636
- const cwd = process.cwd();
2637
- let relative = filePath.startsWith(cwd) ? filePath.slice(cwd.length + 1) : filePath;
2638
- relative = relative.replace(/\\/g, "/");
2639
- if (!relative.startsWith("/")) {
2640
- relative = `/${relative}`;
2641
- }
2642
- return relative;
2643
- }, getFrameworkColor = (framework) => frameworkColors[framework] || colors2.white, log = (action, options) => {
2644
- const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
2645
- const tag = `${colors2.cyan}[hmr]${colors2.reset}`;
2646
- let message = action;
2647
- if (options?.path) {
2648
- const pathColor = options.framework ? getFrameworkColor(options.framework) : colors2.white;
2649
- message += ` ${pathColor}${formatPath(options.path)}${colors2.reset}`;
2650
- }
2651
- if (options?.duration !== undefined) {
2652
- message += ` ${colors2.dim}(${options.duration}ms)${colors2.reset}`;
2653
- }
2654
- console.log(`${timestamp} ${tag} ${message}`);
2655
- }, logCssUpdate = (path, framework, duration) => {
2656
- log("css update", { duration, framework: framework ?? "css", path });
2657
- }, logError = (message, error) => {
2658
- const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
2659
- const tag = `${colors2.red}[hmr]${colors2.reset}`;
2660
- const errorMsg = error instanceof Error ? error.message : error;
2661
- const fullMessage = `${colors2.red}error${colors2.reset} ${message}${errorMsg ? `: ${errorMsg}` : ""}`;
2662
- console.error(`${timestamp} ${tag} ${fullMessage}`);
2663
- }, logHmrClientUpdate = (path, framework, duration, target, serverMs, clientMs, outcome = "applied", kind) => {
2664
- const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
2665
- const targetLabel = target.startsWith("capacitor-") ? target.slice("capacitor-".length) : target;
2666
- const tag = `${colors2.cyan}[hmr:${targetLabel}]${colors2.reset}`;
2667
- const pathColor = framework ? getFrameworkColor(framework) : colors2.white;
2668
- const breakdown = serverMs === undefined || clientMs === undefined ? "" : `; server ${serverMs}ms, client ${clientMs}ms`;
2669
- let action = "failed after";
2670
- if (outcome === "applied")
2671
- action = "applied in";
2672
- else if (outcome === "reloaded")
2673
- action = "falling back to reload after";
2674
- const kindLabel = kind ? `${kind} ` : "";
2675
- console.log(`${timestamp} ${tag} ${framework ?? "update"} ${kindLabel}${pathColor}${formatPath(path)}${colors2.reset} ${colors2.dim}${action} ${duration}ms${breakdown}${colors2.reset}`);
2676
- }, logHmrUpdate = (path, framework, duration) => {
2677
- log("hmr update", { duration, framework, path });
2678
- }, logInfo = (message) => {
2679
- log(message);
2680
- }, logPageBuild = (path, framework, duration) => {
2681
- log("page build", { duration, framework, path });
2682
- }, logScriptUpdate = (path, framework, duration) => {
2683
- log("script update", { duration, framework, path });
2684
- }, logServerReload = () => {
2685
- log(`${colors2.cyan}server module reloaded${colors2.reset}`);
2686
- }, logWarn = (message) => {
2687
- const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
2688
- const tag = `${colors2.yellow}[hmr]${colors2.reset}`;
2689
- console.log(`${timestamp} ${tag} ${colors2.yellow}warning ${message}${colors2.reset}`);
2690
- };
2691
- var init_logger = __esm(() => {
2692
- init_startupBanner();
2693
- colors2 = {
2694
- blue: "\x1B[34m",
2695
- bold: "\x1B[1m",
2696
- cyan: "\x1B[36m",
2697
- dim: "\x1B[2m",
2698
- green: "\x1B[32m",
2699
- magenta: "\x1B[35m",
2700
- red: "\x1B[31m",
2701
- reset: "\x1B[0m",
2702
- white: "\x1B[37m",
2703
- yellow: "\x1B[33m"
2704
- };
2705
- frameworkColors = {
2706
- angular: colors2.magenta,
2707
- assets: colors2.dim,
2708
- css: colors2.cyan,
2709
- html: colors2.white,
2710
- htmx: colors2.white,
2711
- react: colors2.blue,
2712
- svelte: colors2.yellow,
2713
- vue: colors2.green
2714
- };
2715
- });
2716
-
2717
2756
  // src/core/routeAssets.ts
2718
2757
  var LINK_TAG_RE, REL_STYLESHEET_RE, HREF_RE, TITLE_RE, ENTITIES, ENTITY_RE, decodeEntities = (value) => value.replace(ENTITY_RE, (match) => ENTITIES[match] ?? match), readHeadStylesheets = (head) => {
2719
2758
  if (!head)
@@ -4352,32 +4391,6 @@ var init_vueServerModule = __esm(() => {
4352
4391
  transpiler2 = new Transpiler({ loader: "ts", target: "browser" });
4353
4392
  });
4354
4393
 
4355
- // src/core/islandManifest.ts
4356
- var toIslandFrameworkSegment = (framework) => framework[0]?.toUpperCase() + framework.slice(1), collectFrameworkIslands = (manifest, prefix) => {
4357
- const entries = {};
4358
- let found = false;
4359
- for (const [key, value] of Object.entries(manifest)) {
4360
- if (!key.startsWith(prefix))
4361
- continue;
4362
- const component = key.slice(prefix.length);
4363
- if (!component)
4364
- continue;
4365
- entries[component] = value;
4366
- found = true;
4367
- }
4368
- return found ? entries : undefined;
4369
- }, getIslandManifestEntries = (manifest) => {
4370
- const islands = {};
4371
- const frameworks = ["react", "svelte", "vue", "angular"];
4372
- for (const framework of frameworks) {
4373
- const prefix = `Island${toIslandFrameworkSegment(framework)}`;
4374
- const entries = collectFrameworkIslands(manifest, prefix);
4375
- if (entries)
4376
- islands[framework] = entries;
4377
- }
4378
- return islands;
4379
- }, getIslandManifestKey = (framework, component) => `Island${toIslandFrameworkSegment(framework)}${component}`;
4380
-
4381
4394
  // src/core/islands.ts
4382
4395
  function getIslandComponent(component) {
4383
4396
  if (isIslandComponentDefinition(component)) {
@@ -4582,6 +4595,7 @@ var requireCurrentIslandRegistry = () => {
4582
4595
 
4583
4596
  // src/svelte/pageHandler.ts
4584
4597
  init_svelteServerModule();
4598
+ init_islandPageContext();
4585
4599
  init_devRouteRegistrationCallsite();
4586
4600
  init_requestContext();
4587
4601
  init_pageProtocol();
@@ -5093,5 +5107,5 @@ export {
5093
5107
  useIslandStore
5094
5108
  };
5095
5109
 
5096
- //# debugId=AA35F99AD271EA8664756E2164756E21
5110
+ //# debugId=AC27A68B02DE194B64756E2164756E21
5097
5111
  //# sourceMappingURL=index.js.map