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

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 (57) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +81 -0
  3. package/changelog.json +24 -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/{compile-30m09382.js → compile-ckn6epbb.js} +1 -1
  15. package/dist/cli/config/server.js +125 -112
  16. package/dist/cli/{index-vkba3289.js → index-8ez1ccm0.js} +1 -1
  17. package/dist/cli/index.js +6 -6
  18. package/dist/cli/{islands-rq6wx0kh.js → islands-8sgky9gh.js} +1 -1
  19. package/dist/cli/{mobile-41sev6v0.js → mobile-ddggpe53.js} +2 -2
  20. package/dist/cli/{start-0ebxkwga.js → start-qj7664zr.js} +2 -2
  21. package/dist/cli/{typecheck-7yhekrc0.js → typecheck-8sdrcjz8.js} +208 -42
  22. package/dist/client/index.js +8 -3
  23. package/dist/client/index.js.map +4 -4
  24. package/dist/index.js +1402 -1075
  25. package/dist/index.js.map +14 -10
  26. package/dist/islands/browser.js +3 -3
  27. package/dist/islands/browser.js.map +3 -3
  28. package/dist/islands/index.js +3 -3
  29. package/dist/islands/index.js.map +3 -3
  30. package/dist/react/browser.js +3 -3
  31. package/dist/react/browser.js.map +3 -3
  32. package/dist/react/index.js +231 -217
  33. package/dist/react/index.js.map +9 -9
  34. package/dist/react/server.js +231 -191
  35. package/dist/react/server.js.map +9 -8
  36. package/dist/src/build/islandBootstrap.d.ts +22 -0
  37. package/dist/src/build/missingClientFrameworks.d.ts +29 -0
  38. package/dist/src/build/svelteDeclarations.d.ts +27 -0
  39. package/dist/src/client/islandResolver.d.ts +3 -1
  40. package/dist/src/core/build.d.ts +1 -1
  41. package/dist/src/core/islandManifest.d.ts +10 -0
  42. package/dist/src/core/islandPageContext.d.ts +2 -0
  43. package/dist/src/dev/svelteDeclarationRefresher.d.ts +6 -0
  44. package/dist/svelte/browser.js +3 -3
  45. package/dist/svelte/browser.js.map +3 -3
  46. package/dist/svelte/index.js +211 -197
  47. package/dist/svelte/index.js.map +8 -8
  48. package/dist/svelte/server.js +211 -171
  49. package/dist/svelte/server.js.map +8 -7
  50. package/dist/vue/browser.js +3 -3
  51. package/dist/vue/browser.js.map +3 -3
  52. package/dist/vue/index.js +231 -217
  53. package/dist/vue/index.js.map +9 -9
  54. package/dist/vue/server.js +231 -191
  55. package/dist/vue/server.js.map +9 -8
  56. package/package.json +6 -1
  57. /package/dist/cli/{index-e6ysp900.js → index-z794p5qg.js} +0 -0
@@ -72,11 +72,230 @@ var __esm = (fn, res, err) => () => {
72
72
  };
73
73
  var __require = import.meta.require;
74
74
 
75
+ // src/constants.ts
76
+ 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;
77
+ var init_constants = __esm(() => {
78
+ TAILWIND_BUN_CSS_WARNING_PATTERN = /invalid @ rule encountered: '@(theme|tailwind|source|utility|variant|custom-variant|apply|reference|plugin|config)'/;
79
+ IMAGE_DEFAULT_DEVICE_SIZES = [
80
+ 640,
81
+ 750,
82
+ 828,
83
+ 1080,
84
+ 1200,
85
+ 1920,
86
+ 2048,
87
+ 3840
88
+ ];
89
+ IMAGE_DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
90
+ MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;
91
+ MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_DAY;
92
+ TWO_THIRDS = 2 / 3;
93
+ });
94
+
95
+ // src/utils/getDurationString.ts
96
+ var getDurationString = (duration) => {
97
+ let durationString;
98
+ if (duration < MILLISECONDS_IN_A_SECOND) {
99
+ durationString = `${duration.toFixed(TIME_PRECISION)}ms`;
100
+ } else if (duration < MILLISECONDS_IN_A_MINUTE) {
101
+ durationString = `${(duration / MILLISECONDS_IN_A_SECOND).toFixed(TIME_PRECISION)}s`;
102
+ } else {
103
+ const totalSeconds = Math.round(duration / MILLISECONDS_IN_A_SECOND);
104
+ const minutes = Math.floor(totalSeconds / 60);
105
+ const seconds = totalSeconds % 60;
106
+ durationString = seconds === 0 ? `${minutes}m` : `${minutes}m ${seconds}s`;
107
+ }
108
+ return durationString;
109
+ };
110
+ var init_getDurationString = __esm(() => {
111
+ init_constants();
112
+ });
113
+
114
+ // src/utils/startupBanner.ts
115
+ var colors, MONTHS, formatTimestamp = () => {
116
+ const now = new Date;
117
+ const month = MONTHS[now.getMonth()];
118
+ const day = now.getDate().toString().padStart(2, "0");
119
+ let hours = now.getHours();
120
+ const minutes = now.getMinutes().toString().padStart(2, "0");
121
+ const seconds = now.getSeconds().toString().padStart(2, "0");
122
+ const ampm = hours >= HOURS_IN_HALF_DAY ? "PM" : "AM";
123
+ hours = hours % HOURS_IN_HALF_DAY || HOURS_IN_HALF_DAY;
124
+ return `${month} ${day} ${hours}:${minutes}:${seconds} ${ampm}`;
125
+ }, startupBanner = (options) => {
126
+ const {
127
+ version,
128
+ readyDuration,
129
+ buildDuration,
130
+ port,
131
+ host,
132
+ networkUrl,
133
+ mobilePreviewUrl,
134
+ protocol = "http"
135
+ } = options;
136
+ const name = `${colors.cyan}${colors.bold}ABSOLUTEJS${colors.reset}`;
137
+ const ver = `${colors.dim}v${version}${colors.reset}`;
138
+ const time = `${colors.dim}ready in${colors.reset} ${colors.bold}${getDurationString(readyDuration)}${colors.reset}`;
139
+ const build = typeof buildDuration === "number" && Number.isFinite(buildDuration) ? ` ${colors.dim}(build ${getDurationString(buildDuration)})${colors.reset}` : "";
140
+ console.log("");
141
+ console.log(` ${name} ${ver} ${time}${build}`);
142
+ console.log("");
143
+ console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Local:${colors.reset} ${protocol}://${host === "0.0.0.0" ? "localhost" : host}:${port}/`);
144
+ if (networkUrl) {
145
+ console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Network:${colors.reset} ${networkUrl}`);
146
+ }
147
+ if (mobilePreviewUrl) {
148
+ console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Mobile:${colors.reset} ${mobilePreviewUrl}`);
149
+ }
150
+ console.log("");
151
+ };
152
+ var init_startupBanner = __esm(() => {
153
+ init_constants();
154
+ init_getDurationString();
155
+ colors = {
156
+ bold: "\x1B[1m",
157
+ cyan: "\x1B[36m",
158
+ dim: "\x1B[2m",
159
+ green: "\x1B[32m",
160
+ reset: "\x1B[0m"
161
+ };
162
+ MONTHS = [
163
+ "Jan",
164
+ "Feb",
165
+ "Mar",
166
+ "Apr",
167
+ "May",
168
+ "Jun",
169
+ "Jul",
170
+ "Aug",
171
+ "Sep",
172
+ "Oct",
173
+ "Nov",
174
+ "Dec"
175
+ ];
176
+ });
177
+
178
+ // src/utils/logger.ts
179
+ var colors2, frameworkColors, formatPath = (filePath) => {
180
+ const cwd = process.cwd();
181
+ let relative = filePath.startsWith(cwd) ? filePath.slice(cwd.length + 1) : filePath;
182
+ relative = relative.replace(/\\/g, "/");
183
+ if (!relative.startsWith("/")) {
184
+ relative = `/${relative}`;
185
+ }
186
+ return relative;
187
+ }, getFrameworkColor = (framework) => frameworkColors[framework] || colors2.white, log = (action, options) => {
188
+ const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
189
+ const tag = `${colors2.cyan}[hmr]${colors2.reset}`;
190
+ let message = action;
191
+ if (options?.path) {
192
+ const pathColor = options.framework ? getFrameworkColor(options.framework) : colors2.white;
193
+ message += ` ${pathColor}${formatPath(options.path)}${colors2.reset}`;
194
+ }
195
+ if (options?.duration !== undefined) {
196
+ message += ` ${colors2.dim}(${options.duration}ms)${colors2.reset}`;
197
+ }
198
+ console.log(`${timestamp} ${tag} ${message}`);
199
+ }, logCssUpdate = (path, framework, duration) => {
200
+ log("css update", { duration, framework: framework ?? "css", path });
201
+ }, logError = (message, error) => {
202
+ const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
203
+ const tag = `${colors2.red}[hmr]${colors2.reset}`;
204
+ const errorMsg = error instanceof Error ? error.message : error;
205
+ const fullMessage = `${colors2.red}error${colors2.reset} ${message}${errorMsg ? `: ${errorMsg}` : ""}`;
206
+ console.error(`${timestamp} ${tag} ${fullMessage}`);
207
+ }, logHmrClientUpdate = (path, framework, duration, target, serverMs, clientMs, outcome = "applied", kind) => {
208
+ const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
209
+ const targetLabel = target.startsWith("capacitor-") ? target.slice("capacitor-".length) : target;
210
+ const tag = `${colors2.cyan}[hmr:${targetLabel}]${colors2.reset}`;
211
+ const pathColor = framework ? getFrameworkColor(framework) : colors2.white;
212
+ const breakdown = serverMs === undefined || clientMs === undefined ? "" : `; server ${serverMs}ms, client ${clientMs}ms`;
213
+ let action = "failed after";
214
+ if (outcome === "applied")
215
+ action = "applied in";
216
+ else if (outcome === "reloaded")
217
+ action = "falling back to reload after";
218
+ const kindLabel = kind ? `${kind} ` : "";
219
+ console.log(`${timestamp} ${tag} ${framework ?? "update"} ${kindLabel}${pathColor}${formatPath(path)}${colors2.reset} ${colors2.dim}${action} ${duration}ms${breakdown}${colors2.reset}`);
220
+ }, logHmrUpdate = (path, framework, duration) => {
221
+ log("hmr update", { duration, framework, path });
222
+ }, logInfo = (message) => {
223
+ log(message);
224
+ }, logPageBuild = (path, framework, duration) => {
225
+ log("page build", { duration, framework, path });
226
+ }, logScriptUpdate = (path, framework, duration) => {
227
+ log("script update", { duration, framework, path });
228
+ }, logServerReload = () => {
229
+ log(`${colors2.cyan}server module reloaded${colors2.reset}`);
230
+ }, logWarn = (message) => {
231
+ const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
232
+ const tag = `${colors2.yellow}[hmr]${colors2.reset}`;
233
+ console.log(`${timestamp} ${tag} ${colors2.yellow}warning ${message}${colors2.reset}`);
234
+ };
235
+ var init_logger = __esm(() => {
236
+ init_startupBanner();
237
+ colors2 = {
238
+ blue: "\x1B[34m",
239
+ bold: "\x1B[1m",
240
+ cyan: "\x1B[36m",
241
+ dim: "\x1B[2m",
242
+ green: "\x1B[32m",
243
+ magenta: "\x1B[35m",
244
+ red: "\x1B[31m",
245
+ reset: "\x1B[0m",
246
+ white: "\x1B[37m",
247
+ yellow: "\x1B[33m"
248
+ };
249
+ frameworkColors = {
250
+ angular: colors2.magenta,
251
+ assets: colors2.dim,
252
+ css: colors2.cyan,
253
+ html: colors2.white,
254
+ htmx: colors2.white,
255
+ react: colors2.blue,
256
+ svelte: colors2.yellow,
257
+ vue: colors2.green
258
+ };
259
+ });
260
+
261
+ // src/core/islandManifest.ts
262
+ var ISLAND_BOOTSTRAP_MANIFEST_KEY = "AbsoluteIslandBootstrap", LEGACY_ISLAND_BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", toIslandFrameworkSegment = (framework) => framework[0]?.toUpperCase() + framework.slice(1), collectFrameworkIslands = (manifest, prefix) => {
263
+ const entries = {};
264
+ let found = false;
265
+ for (const [key, value] of Object.entries(manifest)) {
266
+ if (!key.startsWith(prefix))
267
+ continue;
268
+ const component = key.slice(prefix.length);
269
+ if (!component)
270
+ continue;
271
+ entries[component] = value;
272
+ found = true;
273
+ }
274
+ return found ? entries : undefined;
275
+ }, getIslandBootstrapPath = (manifest) => manifest[ISLAND_BOOTSTRAP_MANIFEST_KEY] ?? manifest[LEGACY_ISLAND_BOOTSTRAP_MANIFEST_KEY], getIslandManifestEntries = (manifest) => {
276
+ const islands = {};
277
+ const frameworks = ["react", "svelte", "vue", "angular"];
278
+ for (const framework of frameworks) {
279
+ const prefix = `Island${toIslandFrameworkSegment(framework)}`;
280
+ const entries = collectFrameworkIslands(manifest, prefix);
281
+ if (entries)
282
+ islands[framework] = entries;
283
+ }
284
+ return islands;
285
+ }, getIslandManifestKey = (framework, component) => `Island${toIslandFrameworkSegment(framework)}${component}`;
286
+
75
287
  // src/core/islandPageContext.ts
76
- 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) => {
288
+ var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST__", ISLAND_STATE_MARKER = "__ABS_ISLAND_STATE__", CLOSING_HEAD_TAG = "</head>", warnedMissingBootstrap = false, warnIfBootstrapMissing = (manifest) => {
289
+ if (warnedMissingBootstrap || getIslandBootstrapPath(manifest))
290
+ return;
291
+ if (false)
292
+ ;
293
+ warnedMissingBootstrap = true;
294
+ 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().");
295
+ }, buildIslandsHeadMarkup = (manifest) => {
77
296
  const manifestScript = `<script>window.__ABSOLUTE_MANIFEST__ = ${JSON.stringify(manifest)}</script>`;
78
297
  const islandStateScript = `<script>window.__ABS_ISLAND_STATE__ = ${JSON.stringify(globalThis.__ABS_ISLAND_STATE__ ?? {})}</script>`;
79
- const bootstrapPath = manifest[BOOTSTRAP_MANIFEST_KEY];
298
+ const bootstrapPath = getIslandBootstrapPath(manifest);
80
299
  const bootstrapScript = bootstrapPath ? `<script type="module" src="${bootstrapPath}"></script>` : "";
81
300
  return `${manifestScript}${islandStateScript}${bootstrapScript}`;
82
301
  }, injectHeadMarkup = (html, markup) => {
@@ -178,7 +397,7 @@ var BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", ISLAND_MARKER = 'data-island="tr
178
397
  }
179
398
  }
180
399
  });
181
- }, pipeStreamWithIslandMarkerDetection = (stream, markup) => {
400
+ }, pipeStreamWithIslandMarkerDetection = (stream, markup, onIslandsDetected) => {
182
401
  const encoder = new TextEncoder;
183
402
  const decoder = new TextDecoder;
184
403
  const headLookbehind = CLOSING_HEAD_TAG.length - 1;
@@ -191,6 +410,7 @@ var BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", ISLAND_MARKER = 'data-island="tr
191
410
  if (!held.includes(ISLAND_MARKER)) {
192
411
  return { held, injected: false, pending: "", sawHead: true };
193
412
  }
413
+ onIslandsDetected();
194
414
  enqueue(controller, `${markup}${held}`);
195
415
  return { held: "", injected: true, pending: "", sawHead: true };
196
416
  };
@@ -258,6 +478,7 @@ var BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", ISLAND_MARKER = 'data-island="tr
258
478
  if (html.includes(MANIFEST_MARKER) || html.includes(ISLAND_STATE_MARKER)) {
259
479
  return html;
260
480
  }
481
+ warnIfBootstrapMissing(manifest);
261
482
  return injectHeadMarkup(html, buildIslandsHeadMarkup(manifest));
262
483
  }, injectIslandPageContextStream = (stream, options) => {
263
484
  const manifest = globalThis.__absoluteManifest;
@@ -265,15 +486,19 @@ var BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", ISLAND_MARKER = 'data-island="tr
265
486
  return stream;
266
487
  const markup = buildIslandsHeadMarkup(manifest);
267
488
  if (options?.hasIslands === true) {
489
+ warnIfBootstrapMissing(manifest);
268
490
  return pipeStreamWithHeadInjection(stream, markup);
269
491
  }
270
492
  if (options?.hasIslands === false) {
271
493
  return stream;
272
494
  }
273
- return pipeStreamWithIslandMarkerDetection(stream, markup);
495
+ return pipeStreamWithIslandMarkerDetection(stream, markup, () => warnIfBootstrapMissing(manifest));
274
496
  }, setCurrentIslandManifest = (manifest) => {
275
497
  globalThis.__absoluteManifest = manifest;
276
498
  };
499
+ var init_islandPageContext = __esm(() => {
500
+ init_logger();
501
+ });
277
502
 
278
503
  // src/core/devRouteRegistrationCallsite.ts
279
504
  import { AsyncLocalStorage } from "async_hooks";
@@ -1025,26 +1250,6 @@ var streamSwapRuntime = () => {
1025
1250
  return value.slice(start + 1, end);
1026
1251
  }, getStreamSwapRuntimeScript = () => `(function(){${stripFunctionWrapper(streamSwapRuntime.toString())}})();`;
1027
1252
 
1028
- // src/constants.ts
1029
- 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;
1030
- var init_constants = __esm(() => {
1031
- TAILWIND_BUN_CSS_WARNING_PATTERN = /invalid @ rule encountered: '@(theme|tailwind|source|utility|variant|custom-variant|apply|reference|plugin|config)'/;
1032
- IMAGE_DEFAULT_DEVICE_SIZES = [
1033
- 640,
1034
- 750,
1035
- 828,
1036
- 1080,
1037
- 1200,
1038
- 1920,
1039
- 2048,
1040
- 3840
1041
- ];
1042
- IMAGE_DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
1043
- MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;
1044
- MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_DAY;
1045
- TWO_THIRDS = 2 / 3;
1046
- });
1047
-
1048
1253
  // src/utils/escapeScriptContent.ts
1049
1254
  var ESCAPE_LOOKUP, ESCAPE_REGEX, escapeScriptContent = (content) => content.replace(ESCAPE_REGEX, (char) => {
1050
1255
  const escaped = ESCAPE_LOOKUP[char];
@@ -1613,172 +1818,6 @@ var init_streamingSlots = __esm(() => {
1613
1818
  };
1614
1819
  });
1615
1820
 
1616
- // src/utils/getDurationString.ts
1617
- var getDurationString = (duration) => {
1618
- let durationString;
1619
- if (duration < MILLISECONDS_IN_A_SECOND) {
1620
- durationString = `${duration.toFixed(TIME_PRECISION)}ms`;
1621
- } else if (duration < MILLISECONDS_IN_A_MINUTE) {
1622
- durationString = `${(duration / MILLISECONDS_IN_A_SECOND).toFixed(TIME_PRECISION)}s`;
1623
- } else {
1624
- const totalSeconds = Math.round(duration / MILLISECONDS_IN_A_SECOND);
1625
- const minutes = Math.floor(totalSeconds / 60);
1626
- const seconds = totalSeconds % 60;
1627
- durationString = seconds === 0 ? `${minutes}m` : `${minutes}m ${seconds}s`;
1628
- }
1629
- return durationString;
1630
- };
1631
- var init_getDurationString = __esm(() => {
1632
- init_constants();
1633
- });
1634
-
1635
- // src/utils/startupBanner.ts
1636
- var colors, MONTHS, formatTimestamp = () => {
1637
- const now = new Date;
1638
- const month = MONTHS[now.getMonth()];
1639
- const day = now.getDate().toString().padStart(2, "0");
1640
- let hours = now.getHours();
1641
- const minutes = now.getMinutes().toString().padStart(2, "0");
1642
- const seconds = now.getSeconds().toString().padStart(2, "0");
1643
- const ampm = hours >= HOURS_IN_HALF_DAY ? "PM" : "AM";
1644
- hours = hours % HOURS_IN_HALF_DAY || HOURS_IN_HALF_DAY;
1645
- return `${month} ${day} ${hours}:${minutes}:${seconds} ${ampm}`;
1646
- }, startupBanner = (options) => {
1647
- const {
1648
- version,
1649
- readyDuration,
1650
- buildDuration,
1651
- port,
1652
- host,
1653
- networkUrl,
1654
- mobilePreviewUrl,
1655
- protocol = "http"
1656
- } = options;
1657
- const name = `${colors.cyan}${colors.bold}ABSOLUTEJS${colors.reset}`;
1658
- const ver = `${colors.dim}v${version}${colors.reset}`;
1659
- const time = `${colors.dim}ready in${colors.reset} ${colors.bold}${getDurationString(readyDuration)}${colors.reset}`;
1660
- const build = typeof buildDuration === "number" && Number.isFinite(buildDuration) ? ` ${colors.dim}(build ${getDurationString(buildDuration)})${colors.reset}` : "";
1661
- console.log("");
1662
- console.log(` ${name} ${ver} ${time}${build}`);
1663
- console.log("");
1664
- console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Local:${colors.reset} ${protocol}://${host === "0.0.0.0" ? "localhost" : host}:${port}/`);
1665
- if (networkUrl) {
1666
- console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Network:${colors.reset} ${networkUrl}`);
1667
- }
1668
- if (mobilePreviewUrl) {
1669
- console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Mobile:${colors.reset} ${mobilePreviewUrl}`);
1670
- }
1671
- console.log("");
1672
- };
1673
- var init_startupBanner = __esm(() => {
1674
- init_constants();
1675
- init_getDurationString();
1676
- colors = {
1677
- bold: "\x1B[1m",
1678
- cyan: "\x1B[36m",
1679
- dim: "\x1B[2m",
1680
- green: "\x1B[32m",
1681
- reset: "\x1B[0m"
1682
- };
1683
- MONTHS = [
1684
- "Jan",
1685
- "Feb",
1686
- "Mar",
1687
- "Apr",
1688
- "May",
1689
- "Jun",
1690
- "Jul",
1691
- "Aug",
1692
- "Sep",
1693
- "Oct",
1694
- "Nov",
1695
- "Dec"
1696
- ];
1697
- });
1698
-
1699
- // src/utils/logger.ts
1700
- var colors2, frameworkColors, formatPath = (filePath) => {
1701
- const cwd = process.cwd();
1702
- let relative = filePath.startsWith(cwd) ? filePath.slice(cwd.length + 1) : filePath;
1703
- relative = relative.replace(/\\/g, "/");
1704
- if (!relative.startsWith("/")) {
1705
- relative = `/${relative}`;
1706
- }
1707
- return relative;
1708
- }, getFrameworkColor = (framework) => frameworkColors[framework] || colors2.white, log = (action, options) => {
1709
- const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
1710
- const tag = `${colors2.cyan}[hmr]${colors2.reset}`;
1711
- let message = action;
1712
- if (options?.path) {
1713
- const pathColor = options.framework ? getFrameworkColor(options.framework) : colors2.white;
1714
- message += ` ${pathColor}${formatPath(options.path)}${colors2.reset}`;
1715
- }
1716
- if (options?.duration !== undefined) {
1717
- message += ` ${colors2.dim}(${options.duration}ms)${colors2.reset}`;
1718
- }
1719
- console.log(`${timestamp} ${tag} ${message}`);
1720
- }, logCssUpdate = (path, framework, duration) => {
1721
- log("css update", { duration, framework: framework ?? "css", path });
1722
- }, logError = (message, error) => {
1723
- const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
1724
- const tag = `${colors2.red}[hmr]${colors2.reset}`;
1725
- const errorMsg = error instanceof Error ? error.message : error;
1726
- const fullMessage = `${colors2.red}error${colors2.reset} ${message}${errorMsg ? `: ${errorMsg}` : ""}`;
1727
- console.error(`${timestamp} ${tag} ${fullMessage}`);
1728
- }, logHmrClientUpdate = (path, framework, duration, target, serverMs, clientMs, outcome = "applied", kind) => {
1729
- const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
1730
- const targetLabel = target.startsWith("capacitor-") ? target.slice("capacitor-".length) : target;
1731
- const tag = `${colors2.cyan}[hmr:${targetLabel}]${colors2.reset}`;
1732
- const pathColor = framework ? getFrameworkColor(framework) : colors2.white;
1733
- const breakdown = serverMs === undefined || clientMs === undefined ? "" : `; server ${serverMs}ms, client ${clientMs}ms`;
1734
- let action = "failed after";
1735
- if (outcome === "applied")
1736
- action = "applied in";
1737
- else if (outcome === "reloaded")
1738
- action = "falling back to reload after";
1739
- const kindLabel = kind ? `${kind} ` : "";
1740
- console.log(`${timestamp} ${tag} ${framework ?? "update"} ${kindLabel}${pathColor}${formatPath(path)}${colors2.reset} ${colors2.dim}${action} ${duration}ms${breakdown}${colors2.reset}`);
1741
- }, logHmrUpdate = (path, framework, duration) => {
1742
- log("hmr update", { duration, framework, path });
1743
- }, logInfo = (message) => {
1744
- log(message);
1745
- }, logPageBuild = (path, framework, duration) => {
1746
- log("page build", { duration, framework, path });
1747
- }, logScriptUpdate = (path, framework, duration) => {
1748
- log("script update", { duration, framework, path });
1749
- }, logServerReload = () => {
1750
- log(`${colors2.cyan}server module reloaded${colors2.reset}`);
1751
- }, logWarn = (message) => {
1752
- const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
1753
- const tag = `${colors2.yellow}[hmr]${colors2.reset}`;
1754
- console.log(`${timestamp} ${tag} ${colors2.yellow}warning ${message}${colors2.reset}`);
1755
- };
1756
- var init_logger = __esm(() => {
1757
- init_startupBanner();
1758
- colors2 = {
1759
- blue: "\x1B[34m",
1760
- bold: "\x1B[1m",
1761
- cyan: "\x1B[36m",
1762
- dim: "\x1B[2m",
1763
- green: "\x1B[32m",
1764
- magenta: "\x1B[35m",
1765
- red: "\x1B[31m",
1766
- reset: "\x1B[0m",
1767
- white: "\x1B[37m",
1768
- yellow: "\x1B[33m"
1769
- };
1770
- frameworkColors = {
1771
- angular: colors2.magenta,
1772
- assets: colors2.dim,
1773
- css: colors2.cyan,
1774
- html: colors2.white,
1775
- htmx: colors2.white,
1776
- react: colors2.blue,
1777
- svelte: colors2.yellow,
1778
- vue: colors2.green
1779
- };
1780
- });
1781
-
1782
1821
  // src/utils/stringModifiers.ts
1783
1822
  var normalizeSlug = (str) => str.trim().replace(/\s+/g, "-").replace(/[^A-Za-z0-9\-_]+/g, "").replace(/[-_]{2,}/g, "-"), toKebab = (str) => normalizeSlug(str).replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), toPascal = (str) => {
1784
1823
  if (!str.includes("-") && !str.includes("_")) {
@@ -2151,6 +2190,7 @@ var init_browserTranslation = __esm(() => {
2151
2190
  });
2152
2191
 
2153
2192
  // src/react/pageHandler.ts
2193
+ init_islandPageContext();
2154
2194
  init_devRouteRegistrationCallsite();
2155
2195
  init_requestContext();
2156
2196
  init_pageProtocol();
@@ -2482,5 +2522,5 @@ export {
2482
2522
  handleReactPageRequest
2483
2523
  };
2484
2524
 
2485
- //# debugId=62A8C5AB3BF952DC64756E2164756E21
2525
+ //# debugId=D81C9C0FCE9C30E864756E2164756E21
2486
2526
  //# sourceMappingURL=server.js.map