@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
package/dist/vue/index.js CHANGED
@@ -533,11 +533,230 @@ var init_spaRouteManifest = __esm(() => {
533
533
  init_resolveConvention();
534
534
  });
535
535
 
536
+ // src/constants.ts
537
+ var ANGULAR_INIT_TIMEOUT_MS = 500, ANSI_ESCAPE_CODE = 27, ANSI_ESCAPE_LENGTH = 3, ASCII_SPACE = 32, BASE_36_RADIX = 36, BUN_BUILD_WARNING_SUPPRESSION = "wildcard sideEffects are not supported yet", TAILWIND_BUN_CSS_WARNING_PATTERN, BODY_SLICE_LENGTH = 2000, BYTES_PER_KILOBYTE = 1024, CLI_ARGS_OFFSET = 3, CSS_ERROR_RESOLVE_DELAY_MS = 50, CSS_MAX_CHECK_ATTEMPTS = 10, CSS_MAX_PARSE_TIMEOUT_MS = 500, CSS_RELOAD_BACKOFF_BASE_MS = 1000, CSS_RELOAD_BACKOFF_MAX_MS = 60000, CSS_SHEET_READY_TIMEOUT_MS = 100, DEFAULT_CHUNK_SIZE = 16384, DEFAULT_DEBOUNCE_MS = 15, DEFAULT_PORT = 3000, DEV_SERVER_RESTART_DEBOUNCE_MS = 100, DOM_UPDATE_DELAY_MS = 50, FILE_PROTOCOL_PREFIX_LENGTH = 7, FOCUS_ID_PREFIX_LENGTH = 3, FOCUS_IDX_PREFIX_LENGTH = 4, FOCUS_NAME_PREFIX_LENGTH = 5, ESLINT_STUDIO_DEFAULT_HOST = "eslint.absolute.localhost", ESLINT_STUDIO_DEFAULT_PORT = 4099, CONFIG_DEFAULT_HOST = "config.absolute.localhost", CONFIG_DEFAULT_PORT = 4099, HMR_UPDATE_TIMEOUT_MS = 2000, HOOK_SIGNATURE_LENGTH = 12, EXCLUDE_LAST_OFFSET = -1, HTTP_STATUS_OK = 200, HTTP_STATUS_BAD_REQUEST = 400, HTTP_STATUS_NOT_FOUND = 404, HTTP_STATUS_GONE = 410, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, IMAGE_DEFAULT_DEVICE_SIZES, IMAGE_DEFAULT_IMAGE_SIZES, IMAGE_DEFAULT_QUALITY = 75, IMAGE_GLOB_SUFFIX_LENGTH = 2, INSTANCE_PROBE_TIMEOUT_MS = 250, MAX_ERROR_LENGTH = 200, MAX_RECONNECT_ATTEMPTS = 60, MILLISECONDS_IN_A_SECOND = 1000, MINUTES_IN_AN_HOUR = 60, SECONDS_IN_A_MINUTE = 60, MILLISECONDS_IN_A_MINUTE, MILLISECONDS_IN_A_DAY, OVERLAY_FADE_DURATION_MS = 150, PING_INTERVAL_MS = 30000, LIST_LOG_TAIL_MAX_BYTES = 65536, LIST_TUI_COLUMN_GAP = 2, LIST_TUI_DEFAULT_HEIGHT = 28, LIST_TUI_DEFAULT_WIDTH = 100, LIST_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, LIST_TUI_FOOTER_LINE_COUNT = 2, LIST_TUI_MARKER_WIDTH = 2, LIST_TUI_MIN_LOG_HEIGHT = 3, LIST_TUI_MIN_URL_WIDTH = 16, LIST_TUI_RENDER_DEBOUNCE_MS = 16, LIST_TUI_STATUS_MESSAGE_TIMEOUT_MS = 4000, LIST_WATCH_REFRESH_MS = 1000, RAF_BATCH_COUNT = 3, RANDOM_ID_END_INDEX = 11, REBUILD_BATCH_DELAY_MS = 10, REBUILD_RELOAD_DELAY_MS = 200, RECONNECT_INITIAL_DELAY_MS = 500, RECONNECT_POLL_INTERVAL_MS = 300, REACT_STREAM_SLOT_FAST_DELAY_MS = 5, REACT_STREAM_SLOT_SLOW_DELAY_MS = 20, SIGINT_EXIT_CODE = 130, SIGTERM_EXIT_CODE = 143, SVELTE_CSS_LOAD_TIMEOUT_MS = 500, TIME_PRECISION = 2, TWO_THIRDS, UNFOUND_INDEX = -1, WEBSOCKET_NORMAL_CLOSURE = 1000, DEFAULT_WEBSOCKET_IDLE_TIMEOUT_SECONDS = 240, DEFAULT_HTTP_IDLE_TIMEOUT_SECONDS = 240, MAX_HTTP_IDLE_TIMEOUT_SECONDS = 255, WORKSPACE_COMMAND_ARGS_OFFSET = 3, WORKSPACE_FAILURE_LOG_PRINT_LIMIT = 30, WORKSPACE_FAILURE_RECENT_LOG_LIMIT = 60, WORKSPACE_READY_ATTEMPT_TIMEOUT_MS = 5000, WORKSPACE_READY_PROBE_INTERVAL_MS = 250, WORKSPACE_READY_TIMEOUT_MS = 30000, WORKSPACE_SHUTDOWN_TIMEOUT_MS = 1e4, WORKSPACE_TUI_DEFAULT_HEIGHT = 28, WORKSPACE_TUI_DEFAULT_WIDTH = 100, WORKSPACE_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, WORKSPACE_TUI_FOOTER_LINE_COUNT = 3, WORKSPACE_TUI_MIN_LOG_HEIGHT = 3, WORKSPACE_TUI_MIN_SERVICE_NAME_WIDTH = 7, WORKSPACE_TUI_MIN_TARGET_WIDTH = 8, WORKSPACE_TUI_MIN_WRAP_WIDTH = 12, WORKSPACE_TUI_PROMPT_CURSOR_OFFSET = 3, WORKSPACE_TUI_RECENT_LOG_LIMIT = 40, WORKSPACE_TUI_RENDER_DEBOUNCE_MS = 16, WORKSPACE_TUI_STATUS_WIDTH = 10, WORKSPACE_TUI_TARGET_PADDING_WIDTH = 6, WORKSPACE_TUI_VISIBILITY_WIDTH = 8;
538
+ var init_constants = __esm(() => {
539
+ TAILWIND_BUN_CSS_WARNING_PATTERN = /invalid @ rule encountered: '@(theme|tailwind|source|utility|variant|custom-variant|apply|reference|plugin|config)'/;
540
+ IMAGE_DEFAULT_DEVICE_SIZES = [
541
+ 640,
542
+ 750,
543
+ 828,
544
+ 1080,
545
+ 1200,
546
+ 1920,
547
+ 2048,
548
+ 3840
549
+ ];
550
+ IMAGE_DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
551
+ MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;
552
+ MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_DAY;
553
+ TWO_THIRDS = 2 / 3;
554
+ });
555
+
556
+ // src/utils/getDurationString.ts
557
+ var getDurationString = (duration) => {
558
+ let durationString;
559
+ if (duration < MILLISECONDS_IN_A_SECOND) {
560
+ durationString = `${duration.toFixed(TIME_PRECISION)}ms`;
561
+ } else if (duration < MILLISECONDS_IN_A_MINUTE) {
562
+ durationString = `${(duration / MILLISECONDS_IN_A_SECOND).toFixed(TIME_PRECISION)}s`;
563
+ } else {
564
+ const totalSeconds = Math.round(duration / MILLISECONDS_IN_A_SECOND);
565
+ const minutes = Math.floor(totalSeconds / 60);
566
+ const seconds = totalSeconds % 60;
567
+ durationString = seconds === 0 ? `${minutes}m` : `${minutes}m ${seconds}s`;
568
+ }
569
+ return durationString;
570
+ };
571
+ var init_getDurationString = __esm(() => {
572
+ init_constants();
573
+ });
574
+
575
+ // src/utils/startupBanner.ts
576
+ var colors, MONTHS, formatTimestamp = () => {
577
+ const now = new Date;
578
+ const month = MONTHS[now.getMonth()];
579
+ const day = now.getDate().toString().padStart(2, "0");
580
+ let hours = now.getHours();
581
+ const minutes = now.getMinutes().toString().padStart(2, "0");
582
+ const seconds = now.getSeconds().toString().padStart(2, "0");
583
+ const ampm = hours >= HOURS_IN_HALF_DAY ? "PM" : "AM";
584
+ hours = hours % HOURS_IN_HALF_DAY || HOURS_IN_HALF_DAY;
585
+ return `${month} ${day} ${hours}:${minutes}:${seconds} ${ampm}`;
586
+ }, startupBanner = (options) => {
587
+ const {
588
+ version,
589
+ readyDuration,
590
+ buildDuration,
591
+ port,
592
+ host,
593
+ networkUrl,
594
+ mobilePreviewUrl,
595
+ protocol = "http"
596
+ } = options;
597
+ const name = `${colors.cyan}${colors.bold}ABSOLUTEJS${colors.reset}`;
598
+ const ver = `${colors.dim}v${version}${colors.reset}`;
599
+ const time = `${colors.dim}ready in${colors.reset} ${colors.bold}${getDurationString(readyDuration)}${colors.reset}`;
600
+ const build = typeof buildDuration === "number" && Number.isFinite(buildDuration) ? ` ${colors.dim}(build ${getDurationString(buildDuration)})${colors.reset}` : "";
601
+ console.log("");
602
+ console.log(` ${name} ${ver} ${time}${build}`);
603
+ console.log("");
604
+ console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Local:${colors.reset} ${protocol}://${host === "0.0.0.0" ? "localhost" : host}:${port}/`);
605
+ if (networkUrl) {
606
+ console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Network:${colors.reset} ${networkUrl}`);
607
+ }
608
+ if (mobilePreviewUrl) {
609
+ console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Mobile:${colors.reset} ${mobilePreviewUrl}`);
610
+ }
611
+ console.log("");
612
+ };
613
+ var init_startupBanner = __esm(() => {
614
+ init_constants();
615
+ init_getDurationString();
616
+ colors = {
617
+ bold: "\x1B[1m",
618
+ cyan: "\x1B[36m",
619
+ dim: "\x1B[2m",
620
+ green: "\x1B[32m",
621
+ reset: "\x1B[0m"
622
+ };
623
+ MONTHS = [
624
+ "Jan",
625
+ "Feb",
626
+ "Mar",
627
+ "Apr",
628
+ "May",
629
+ "Jun",
630
+ "Jul",
631
+ "Aug",
632
+ "Sep",
633
+ "Oct",
634
+ "Nov",
635
+ "Dec"
636
+ ];
637
+ });
638
+
639
+ // src/utils/logger.ts
640
+ var colors2, frameworkColors, formatPath = (filePath) => {
641
+ const cwd = process.cwd();
642
+ let relative = filePath.startsWith(cwd) ? filePath.slice(cwd.length + 1) : filePath;
643
+ relative = relative.replace(/\\/g, "/");
644
+ if (!relative.startsWith("/")) {
645
+ relative = `/${relative}`;
646
+ }
647
+ return relative;
648
+ }, getFrameworkColor = (framework) => frameworkColors[framework] || colors2.white, log = (action, options) => {
649
+ const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
650
+ const tag = `${colors2.cyan}[hmr]${colors2.reset}`;
651
+ let message = action;
652
+ if (options?.path) {
653
+ const pathColor = options.framework ? getFrameworkColor(options.framework) : colors2.white;
654
+ message += ` ${pathColor}${formatPath(options.path)}${colors2.reset}`;
655
+ }
656
+ if (options?.duration !== undefined) {
657
+ message += ` ${colors2.dim}(${options.duration}ms)${colors2.reset}`;
658
+ }
659
+ console.log(`${timestamp} ${tag} ${message}`);
660
+ }, logCssUpdate = (path, framework, duration) => {
661
+ log("css update", { duration, framework: framework ?? "css", path });
662
+ }, logError = (message, error) => {
663
+ const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
664
+ const tag = `${colors2.red}[hmr]${colors2.reset}`;
665
+ const errorMsg = error instanceof Error ? error.message : error;
666
+ const fullMessage = `${colors2.red}error${colors2.reset} ${message}${errorMsg ? `: ${errorMsg}` : ""}`;
667
+ console.error(`${timestamp} ${tag} ${fullMessage}`);
668
+ }, logHmrClientUpdate = (path, framework, duration, target, serverMs, clientMs, outcome = "applied", kind) => {
669
+ const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
670
+ const targetLabel = target.startsWith("capacitor-") ? target.slice("capacitor-".length) : target;
671
+ const tag = `${colors2.cyan}[hmr:${targetLabel}]${colors2.reset}`;
672
+ const pathColor = framework ? getFrameworkColor(framework) : colors2.white;
673
+ const breakdown = serverMs === undefined || clientMs === undefined ? "" : `; server ${serverMs}ms, client ${clientMs}ms`;
674
+ let action = "failed after";
675
+ if (outcome === "applied")
676
+ action = "applied in";
677
+ else if (outcome === "reloaded")
678
+ action = "falling back to reload after";
679
+ const kindLabel = kind ? `${kind} ` : "";
680
+ console.log(`${timestamp} ${tag} ${framework ?? "update"} ${kindLabel}${pathColor}${formatPath(path)}${colors2.reset} ${colors2.dim}${action} ${duration}ms${breakdown}${colors2.reset}`);
681
+ }, logHmrUpdate = (path, framework, duration) => {
682
+ log("hmr update", { duration, framework, path });
683
+ }, logInfo = (message) => {
684
+ log(message);
685
+ }, logPageBuild = (path, framework, duration) => {
686
+ log("page build", { duration, framework, path });
687
+ }, logScriptUpdate = (path, framework, duration) => {
688
+ log("script update", { duration, framework, path });
689
+ }, logServerReload = () => {
690
+ log(`${colors2.cyan}server module reloaded${colors2.reset}`);
691
+ }, logWarn = (message) => {
692
+ const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
693
+ const tag = `${colors2.yellow}[hmr]${colors2.reset}`;
694
+ console.log(`${timestamp} ${tag} ${colors2.yellow}warning ${message}${colors2.reset}`);
695
+ };
696
+ var init_logger = __esm(() => {
697
+ init_startupBanner();
698
+ colors2 = {
699
+ blue: "\x1B[34m",
700
+ bold: "\x1B[1m",
701
+ cyan: "\x1B[36m",
702
+ dim: "\x1B[2m",
703
+ green: "\x1B[32m",
704
+ magenta: "\x1B[35m",
705
+ red: "\x1B[31m",
706
+ reset: "\x1B[0m",
707
+ white: "\x1B[37m",
708
+ yellow: "\x1B[33m"
709
+ };
710
+ frameworkColors = {
711
+ angular: colors2.magenta,
712
+ assets: colors2.dim,
713
+ css: colors2.cyan,
714
+ html: colors2.white,
715
+ htmx: colors2.white,
716
+ react: colors2.blue,
717
+ svelte: colors2.yellow,
718
+ vue: colors2.green
719
+ };
720
+ });
721
+
722
+ // src/core/islandManifest.ts
723
+ var ISLAND_BOOTSTRAP_MANIFEST_KEY = "AbsoluteIslandBootstrap", LEGACY_ISLAND_BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", toIslandFrameworkSegment = (framework) => framework[0]?.toUpperCase() + framework.slice(1), collectFrameworkIslands = (manifest, prefix) => {
724
+ const entries = {};
725
+ let found = false;
726
+ for (const [key, value] of Object.entries(manifest)) {
727
+ if (!key.startsWith(prefix))
728
+ continue;
729
+ const component = key.slice(prefix.length);
730
+ if (!component)
731
+ continue;
732
+ entries[component] = value;
733
+ found = true;
734
+ }
735
+ return found ? entries : undefined;
736
+ }, getIslandBootstrapPath = (manifest) => manifest[ISLAND_BOOTSTRAP_MANIFEST_KEY] ?? manifest[LEGACY_ISLAND_BOOTSTRAP_MANIFEST_KEY], getIslandManifestEntries = (manifest) => {
737
+ const islands = {};
738
+ const frameworks = ["react", "svelte", "vue", "angular"];
739
+ for (const framework of frameworks) {
740
+ const prefix = `Island${toIslandFrameworkSegment(framework)}`;
741
+ const entries = collectFrameworkIslands(manifest, prefix);
742
+ if (entries)
743
+ islands[framework] = entries;
744
+ }
745
+ return islands;
746
+ }, getIslandManifestKey = (framework, component) => `Island${toIslandFrameworkSegment(framework)}${component}`;
747
+
536
748
  // src/core/islandPageContext.ts
537
- 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) => {
749
+ var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST__", ISLAND_STATE_MARKER = "__ABS_ISLAND_STATE__", CLOSING_HEAD_TAG = "</head>", warnedMissingBootstrap = false, warnIfBootstrapMissing = (manifest) => {
750
+ if (warnedMissingBootstrap || getIslandBootstrapPath(manifest))
751
+ return;
752
+ if (false)
753
+ ;
754
+ warnedMissingBootstrap = true;
755
+ 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().");
756
+ }, buildIslandsHeadMarkup = (manifest) => {
538
757
  const manifestScript = `<script>window.__ABSOLUTE_MANIFEST__ = ${JSON.stringify(manifest)}</script>`;
539
758
  const islandStateScript = `<script>window.__ABS_ISLAND_STATE__ = ${JSON.stringify(globalThis.__ABS_ISLAND_STATE__ ?? {})}</script>`;
540
- const bootstrapPath = manifest[BOOTSTRAP_MANIFEST_KEY];
759
+ const bootstrapPath = getIslandBootstrapPath(manifest);
541
760
  const bootstrapScript = bootstrapPath ? `<script type="module" src="${bootstrapPath}"></script>` : "";
542
761
  return `${manifestScript}${islandStateScript}${bootstrapScript}`;
543
762
  }, injectHeadMarkup = (html, markup) => {
@@ -639,7 +858,7 @@ var BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", ISLAND_MARKER = 'data-island="tr
639
858
  }
640
859
  }
641
860
  });
642
- }, pipeStreamWithIslandMarkerDetection = (stream, markup) => {
861
+ }, pipeStreamWithIslandMarkerDetection = (stream, markup, onIslandsDetected) => {
643
862
  const encoder = new TextEncoder;
644
863
  const decoder = new TextDecoder;
645
864
  const headLookbehind = CLOSING_HEAD_TAG.length - 1;
@@ -652,6 +871,7 @@ var BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", ISLAND_MARKER = 'data-island="tr
652
871
  if (!held.includes(ISLAND_MARKER)) {
653
872
  return { held, injected: false, pending: "", sawHead: true };
654
873
  }
874
+ onIslandsDetected();
655
875
  enqueue(controller, `${markup}${held}`);
656
876
  return { held: "", injected: true, pending: "", sawHead: true };
657
877
  };
@@ -719,6 +939,7 @@ var BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", ISLAND_MARKER = 'data-island="tr
719
939
  if (html.includes(MANIFEST_MARKER) || html.includes(ISLAND_STATE_MARKER)) {
720
940
  return html;
721
941
  }
942
+ warnIfBootstrapMissing(manifest);
722
943
  return injectHeadMarkup(html, buildIslandsHeadMarkup(manifest));
723
944
  }, injectIslandPageContextStream = (stream, options) => {
724
945
  const manifest = globalThis.__absoluteManifest;
@@ -726,15 +947,19 @@ var BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", ISLAND_MARKER = 'data-island="tr
726
947
  return stream;
727
948
  const markup = buildIslandsHeadMarkup(manifest);
728
949
  if (options?.hasIslands === true) {
950
+ warnIfBootstrapMissing(manifest);
729
951
  return pipeStreamWithHeadInjection(stream, markup);
730
952
  }
731
953
  if (options?.hasIslands === false) {
732
954
  return stream;
733
955
  }
734
- return pipeStreamWithIslandMarkerDetection(stream, markup);
956
+ return pipeStreamWithIslandMarkerDetection(stream, markup, () => warnIfBootstrapMissing(manifest));
735
957
  }, setCurrentIslandManifest = (manifest) => {
736
958
  globalThis.__absoluteManifest = manifest;
737
959
  };
960
+ var init_islandPageContext = __esm(() => {
961
+ init_logger();
962
+ });
738
963
 
739
964
  // src/core/devRouteRegistrationCallsite.ts
740
965
  import { AsyncLocalStorage } from "async_hooks";
@@ -1486,26 +1711,6 @@ var streamSwapRuntime = () => {
1486
1711
  return value.slice(start + 1, end);
1487
1712
  }, getStreamSwapRuntimeScript = () => `(function(){${stripFunctionWrapper(streamSwapRuntime.toString())}})();`;
1488
1713
 
1489
- // src/constants.ts
1490
- var ANGULAR_INIT_TIMEOUT_MS = 500, ANSI_ESCAPE_CODE = 27, ANSI_ESCAPE_LENGTH = 3, ASCII_SPACE = 32, BASE_36_RADIX = 36, BUN_BUILD_WARNING_SUPPRESSION = "wildcard sideEffects are not supported yet", TAILWIND_BUN_CSS_WARNING_PATTERN, BODY_SLICE_LENGTH = 2000, BYTES_PER_KILOBYTE = 1024, CLI_ARGS_OFFSET = 3, CSS_ERROR_RESOLVE_DELAY_MS = 50, CSS_MAX_CHECK_ATTEMPTS = 10, CSS_MAX_PARSE_TIMEOUT_MS = 500, CSS_RELOAD_BACKOFF_BASE_MS = 1000, CSS_RELOAD_BACKOFF_MAX_MS = 60000, CSS_SHEET_READY_TIMEOUT_MS = 100, DEFAULT_CHUNK_SIZE = 16384, DEFAULT_DEBOUNCE_MS = 15, DEFAULT_PORT = 3000, DEV_SERVER_RESTART_DEBOUNCE_MS = 100, DOM_UPDATE_DELAY_MS = 50, FILE_PROTOCOL_PREFIX_LENGTH = 7, FOCUS_ID_PREFIX_LENGTH = 3, FOCUS_IDX_PREFIX_LENGTH = 4, FOCUS_NAME_PREFIX_LENGTH = 5, ESLINT_STUDIO_DEFAULT_HOST = "eslint.absolute.localhost", ESLINT_STUDIO_DEFAULT_PORT = 4099, CONFIG_DEFAULT_HOST = "config.absolute.localhost", CONFIG_DEFAULT_PORT = 4099, HMR_UPDATE_TIMEOUT_MS = 2000, HOOK_SIGNATURE_LENGTH = 12, EXCLUDE_LAST_OFFSET = -1, HTTP_STATUS_OK = 200, HTTP_STATUS_BAD_REQUEST = 400, HTTP_STATUS_NOT_FOUND = 404, HTTP_STATUS_GONE = 410, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, IMAGE_DEFAULT_DEVICE_SIZES, IMAGE_DEFAULT_IMAGE_SIZES, IMAGE_DEFAULT_QUALITY = 75, IMAGE_GLOB_SUFFIX_LENGTH = 2, INSTANCE_PROBE_TIMEOUT_MS = 250, MAX_ERROR_LENGTH = 200, MAX_RECONNECT_ATTEMPTS = 60, MILLISECONDS_IN_A_SECOND = 1000, MINUTES_IN_AN_HOUR = 60, SECONDS_IN_A_MINUTE = 60, MILLISECONDS_IN_A_MINUTE, MILLISECONDS_IN_A_DAY, OVERLAY_FADE_DURATION_MS = 150, PING_INTERVAL_MS = 30000, LIST_LOG_TAIL_MAX_BYTES = 65536, LIST_TUI_COLUMN_GAP = 2, LIST_TUI_DEFAULT_HEIGHT = 28, LIST_TUI_DEFAULT_WIDTH = 100, LIST_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, LIST_TUI_FOOTER_LINE_COUNT = 2, LIST_TUI_MARKER_WIDTH = 2, LIST_TUI_MIN_LOG_HEIGHT = 3, LIST_TUI_MIN_URL_WIDTH = 16, LIST_TUI_RENDER_DEBOUNCE_MS = 16, LIST_TUI_STATUS_MESSAGE_TIMEOUT_MS = 4000, LIST_WATCH_REFRESH_MS = 1000, RAF_BATCH_COUNT = 3, RANDOM_ID_END_INDEX = 11, REBUILD_BATCH_DELAY_MS = 10, REBUILD_RELOAD_DELAY_MS = 200, RECONNECT_INITIAL_DELAY_MS = 500, RECONNECT_POLL_INTERVAL_MS = 300, REACT_STREAM_SLOT_FAST_DELAY_MS = 5, REACT_STREAM_SLOT_SLOW_DELAY_MS = 20, SIGINT_EXIT_CODE = 130, SIGTERM_EXIT_CODE = 143, SVELTE_CSS_LOAD_TIMEOUT_MS = 500, TIME_PRECISION = 2, TWO_THIRDS, UNFOUND_INDEX = -1, WEBSOCKET_NORMAL_CLOSURE = 1000, DEFAULT_WEBSOCKET_IDLE_TIMEOUT_SECONDS = 240, DEFAULT_HTTP_IDLE_TIMEOUT_SECONDS = 240, MAX_HTTP_IDLE_TIMEOUT_SECONDS = 255, WORKSPACE_COMMAND_ARGS_OFFSET = 3, WORKSPACE_FAILURE_LOG_PRINT_LIMIT = 30, WORKSPACE_FAILURE_RECENT_LOG_LIMIT = 60, WORKSPACE_READY_ATTEMPT_TIMEOUT_MS = 5000, WORKSPACE_READY_PROBE_INTERVAL_MS = 250, WORKSPACE_READY_TIMEOUT_MS = 30000, WORKSPACE_SHUTDOWN_TIMEOUT_MS = 1e4, WORKSPACE_TUI_DEFAULT_HEIGHT = 28, WORKSPACE_TUI_DEFAULT_WIDTH = 100, WORKSPACE_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, WORKSPACE_TUI_FOOTER_LINE_COUNT = 3, WORKSPACE_TUI_MIN_LOG_HEIGHT = 3, WORKSPACE_TUI_MIN_SERVICE_NAME_WIDTH = 7, WORKSPACE_TUI_MIN_TARGET_WIDTH = 8, WORKSPACE_TUI_MIN_WRAP_WIDTH = 12, WORKSPACE_TUI_PROMPT_CURSOR_OFFSET = 3, WORKSPACE_TUI_RECENT_LOG_LIMIT = 40, WORKSPACE_TUI_RENDER_DEBOUNCE_MS = 16, WORKSPACE_TUI_STATUS_WIDTH = 10, WORKSPACE_TUI_TARGET_PADDING_WIDTH = 6, WORKSPACE_TUI_VISIBILITY_WIDTH = 8;
1491
- var init_constants = __esm(() => {
1492
- TAILWIND_BUN_CSS_WARNING_PATTERN = /invalid @ rule encountered: '@(theme|tailwind|source|utility|variant|custom-variant|apply|reference|plugin|config)'/;
1493
- IMAGE_DEFAULT_DEVICE_SIZES = [
1494
- 640,
1495
- 750,
1496
- 828,
1497
- 1080,
1498
- 1200,
1499
- 1920,
1500
- 2048,
1501
- 3840
1502
- ];
1503
- IMAGE_DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
1504
- MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;
1505
- MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_DAY;
1506
- TWO_THIRDS = 2 / 3;
1507
- });
1508
-
1509
1714
  // src/utils/escapeScriptContent.ts
1510
1715
  var ESCAPE_LOOKUP, ESCAPE_REGEX, escapeScriptContent = (content) => content.replace(ESCAPE_REGEX, (char) => {
1511
1716
  const escaped = ESCAPE_LOOKUP[char];
@@ -2074,172 +2279,6 @@ var init_streamingSlots = __esm(() => {
2074
2279
  };
2075
2280
  });
2076
2281
 
2077
- // src/utils/getDurationString.ts
2078
- var getDurationString = (duration) => {
2079
- let durationString;
2080
- if (duration < MILLISECONDS_IN_A_SECOND) {
2081
- durationString = `${duration.toFixed(TIME_PRECISION)}ms`;
2082
- } else if (duration < MILLISECONDS_IN_A_MINUTE) {
2083
- durationString = `${(duration / MILLISECONDS_IN_A_SECOND).toFixed(TIME_PRECISION)}s`;
2084
- } else {
2085
- const totalSeconds = Math.round(duration / MILLISECONDS_IN_A_SECOND);
2086
- const minutes = Math.floor(totalSeconds / 60);
2087
- const seconds = totalSeconds % 60;
2088
- durationString = seconds === 0 ? `${minutes}m` : `${minutes}m ${seconds}s`;
2089
- }
2090
- return durationString;
2091
- };
2092
- var init_getDurationString = __esm(() => {
2093
- init_constants();
2094
- });
2095
-
2096
- // src/utils/startupBanner.ts
2097
- var colors, MONTHS, formatTimestamp = () => {
2098
- const now = new Date;
2099
- const month = MONTHS[now.getMonth()];
2100
- const day = now.getDate().toString().padStart(2, "0");
2101
- let hours = now.getHours();
2102
- const minutes = now.getMinutes().toString().padStart(2, "0");
2103
- const seconds = now.getSeconds().toString().padStart(2, "0");
2104
- const ampm = hours >= HOURS_IN_HALF_DAY ? "PM" : "AM";
2105
- hours = hours % HOURS_IN_HALF_DAY || HOURS_IN_HALF_DAY;
2106
- return `${month} ${day} ${hours}:${minutes}:${seconds} ${ampm}`;
2107
- }, startupBanner = (options) => {
2108
- const {
2109
- version,
2110
- readyDuration,
2111
- buildDuration,
2112
- port,
2113
- host,
2114
- networkUrl,
2115
- mobilePreviewUrl,
2116
- protocol = "http"
2117
- } = options;
2118
- const name = `${colors.cyan}${colors.bold}ABSOLUTEJS${colors.reset}`;
2119
- const ver = `${colors.dim}v${version}${colors.reset}`;
2120
- const time = `${colors.dim}ready in${colors.reset} ${colors.bold}${getDurationString(readyDuration)}${colors.reset}`;
2121
- const build = typeof buildDuration === "number" && Number.isFinite(buildDuration) ? ` ${colors.dim}(build ${getDurationString(buildDuration)})${colors.reset}` : "";
2122
- console.log("");
2123
- console.log(` ${name} ${ver} ${time}${build}`);
2124
- console.log("");
2125
- console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Local:${colors.reset} ${protocol}://${host === "0.0.0.0" ? "localhost" : host}:${port}/`);
2126
- if (networkUrl) {
2127
- console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Network:${colors.reset} ${networkUrl}`);
2128
- }
2129
- if (mobilePreviewUrl) {
2130
- console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Mobile:${colors.reset} ${mobilePreviewUrl}`);
2131
- }
2132
- console.log("");
2133
- };
2134
- var init_startupBanner = __esm(() => {
2135
- init_constants();
2136
- init_getDurationString();
2137
- colors = {
2138
- bold: "\x1B[1m",
2139
- cyan: "\x1B[36m",
2140
- dim: "\x1B[2m",
2141
- green: "\x1B[32m",
2142
- reset: "\x1B[0m"
2143
- };
2144
- MONTHS = [
2145
- "Jan",
2146
- "Feb",
2147
- "Mar",
2148
- "Apr",
2149
- "May",
2150
- "Jun",
2151
- "Jul",
2152
- "Aug",
2153
- "Sep",
2154
- "Oct",
2155
- "Nov",
2156
- "Dec"
2157
- ];
2158
- });
2159
-
2160
- // src/utils/logger.ts
2161
- var colors2, frameworkColors, formatPath = (filePath) => {
2162
- const cwd = process.cwd();
2163
- let relative = filePath.startsWith(cwd) ? filePath.slice(cwd.length + 1) : filePath;
2164
- relative = relative.replace(/\\/g, "/");
2165
- if (!relative.startsWith("/")) {
2166
- relative = `/${relative}`;
2167
- }
2168
- return relative;
2169
- }, getFrameworkColor = (framework) => frameworkColors[framework] || colors2.white, log = (action, options) => {
2170
- const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
2171
- const tag = `${colors2.cyan}[hmr]${colors2.reset}`;
2172
- let message = action;
2173
- if (options?.path) {
2174
- const pathColor = options.framework ? getFrameworkColor(options.framework) : colors2.white;
2175
- message += ` ${pathColor}${formatPath(options.path)}${colors2.reset}`;
2176
- }
2177
- if (options?.duration !== undefined) {
2178
- message += ` ${colors2.dim}(${options.duration}ms)${colors2.reset}`;
2179
- }
2180
- console.log(`${timestamp} ${tag} ${message}`);
2181
- }, logCssUpdate = (path, framework, duration) => {
2182
- log("css update", { duration, framework: framework ?? "css", path });
2183
- }, logError = (message, error) => {
2184
- const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
2185
- const tag = `${colors2.red}[hmr]${colors2.reset}`;
2186
- const errorMsg = error instanceof Error ? error.message : error;
2187
- const fullMessage = `${colors2.red}error${colors2.reset} ${message}${errorMsg ? `: ${errorMsg}` : ""}`;
2188
- console.error(`${timestamp} ${tag} ${fullMessage}`);
2189
- }, logHmrClientUpdate = (path, framework, duration, target, serverMs, clientMs, outcome = "applied", kind) => {
2190
- const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
2191
- const targetLabel = target.startsWith("capacitor-") ? target.slice("capacitor-".length) : target;
2192
- const tag = `${colors2.cyan}[hmr:${targetLabel}]${colors2.reset}`;
2193
- const pathColor = framework ? getFrameworkColor(framework) : colors2.white;
2194
- const breakdown = serverMs === undefined || clientMs === undefined ? "" : `; server ${serverMs}ms, client ${clientMs}ms`;
2195
- let action = "failed after";
2196
- if (outcome === "applied")
2197
- action = "applied in";
2198
- else if (outcome === "reloaded")
2199
- action = "falling back to reload after";
2200
- const kindLabel = kind ? `${kind} ` : "";
2201
- console.log(`${timestamp} ${tag} ${framework ?? "update"} ${kindLabel}${pathColor}${formatPath(path)}${colors2.reset} ${colors2.dim}${action} ${duration}ms${breakdown}${colors2.reset}`);
2202
- }, logHmrUpdate = (path, framework, duration) => {
2203
- log("hmr update", { duration, framework, path });
2204
- }, logInfo = (message) => {
2205
- log(message);
2206
- }, logPageBuild = (path, framework, duration) => {
2207
- log("page build", { duration, framework, path });
2208
- }, logScriptUpdate = (path, framework, duration) => {
2209
- log("script update", { duration, framework, path });
2210
- }, logServerReload = () => {
2211
- log(`${colors2.cyan}server module reloaded${colors2.reset}`);
2212
- }, logWarn = (message) => {
2213
- const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
2214
- const tag = `${colors2.yellow}[hmr]${colors2.reset}`;
2215
- console.log(`${timestamp} ${tag} ${colors2.yellow}warning ${message}${colors2.reset}`);
2216
- };
2217
- var init_logger = __esm(() => {
2218
- init_startupBanner();
2219
- colors2 = {
2220
- blue: "\x1B[34m",
2221
- bold: "\x1B[1m",
2222
- cyan: "\x1B[36m",
2223
- dim: "\x1B[2m",
2224
- green: "\x1B[32m",
2225
- magenta: "\x1B[35m",
2226
- red: "\x1B[31m",
2227
- reset: "\x1B[0m",
2228
- white: "\x1B[37m",
2229
- yellow: "\x1B[33m"
2230
- };
2231
- frameworkColors = {
2232
- angular: colors2.magenta,
2233
- assets: colors2.dim,
2234
- css: colors2.cyan,
2235
- html: colors2.white,
2236
- htmx: colors2.white,
2237
- react: colors2.blue,
2238
- svelte: colors2.yellow,
2239
- vue: colors2.green
2240
- };
2241
- });
2242
-
2243
2282
  // src/core/routeAssets.ts
2244
2283
  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) => {
2245
2284
  if (!head)
@@ -2424,32 +2463,6 @@ var init_buildHMRClient = __esm(() => {
2424
2463
  hmrClientPath = resolveHmrClientPath();
2425
2464
  });
2426
2465
 
2427
- // src/core/islandManifest.ts
2428
- var toIslandFrameworkSegment = (framework) => framework[0]?.toUpperCase() + framework.slice(1), collectFrameworkIslands = (manifest, prefix) => {
2429
- const entries = {};
2430
- let found = false;
2431
- for (const [key, value] of Object.entries(manifest)) {
2432
- if (!key.startsWith(prefix))
2433
- continue;
2434
- const component = key.slice(prefix.length);
2435
- if (!component)
2436
- continue;
2437
- entries[component] = value;
2438
- found = true;
2439
- }
2440
- return found ? entries : undefined;
2441
- }, getIslandManifestEntries = (manifest) => {
2442
- const islands = {};
2443
- const frameworks = ["react", "svelte", "vue", "angular"];
2444
- for (const framework of frameworks) {
2445
- const prefix = `Island${toIslandFrameworkSegment(framework)}`;
2446
- const entries = collectFrameworkIslands(manifest, prefix);
2447
- if (entries)
2448
- islands[framework] = entries;
2449
- }
2450
- return islands;
2451
- }, getIslandManifestKey = (framework, component) => `Island${toIslandFrameworkSegment(framework)}${component}`;
2452
-
2453
2466
  // src/core/islands.ts
2454
2467
  function getIslandComponent(component) {
2455
2468
  if (isIslandComponentDefinition(component)) {
@@ -4739,6 +4752,7 @@ var init_renderIslandMarkup = __esm(() => {
4739
4752
  init_inlinePageCss();
4740
4753
  init_spaRouteCss();
4741
4754
  init_spaRouteManifest();
4755
+ init_islandPageContext();
4742
4756
  init_devRouteRegistrationCallsite();
4743
4757
  init_requestContext();
4744
4758
  init_pageProtocol();
@@ -6712,5 +6726,5 @@ export {
6712
6726
  useResource
6713
6727
  };
6714
6728
 
6715
- //# debugId=9CA60063D1D2624A64756E2164756E21
6729
+ //# debugId=83118B4CF9B1B53964756E2164756E21
6716
6730
  //# sourceMappingURL=index.js.map