@absolutejs/absolute 0.19.0-beta.675 → 0.19.0-beta.677

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -242,9 +242,9 @@ var RESERVED_TOP_LEVEL_KEYS, isObject = (value) => typeof value === "object" &&
242
242
  cwd: _cwd,
243
243
  dependsOn: _dependsOn,
244
244
  env: _env,
245
- healthcheck: _healthcheck,
246
245
  kind: _kind,
247
246
  port: _port,
247
+ ready: _ready,
248
248
  visibility: _visibility,
249
249
  ...serviceConfig
250
250
  } = service;
@@ -284,7 +284,6 @@ var init_loadConfig = __esm(() => {
284
284
  "dev",
285
285
  "entry",
286
286
  "env",
287
- "healthcheck",
288
287
  "htmlDirectory",
289
288
  "htmxDirectory",
290
289
  "images",
@@ -301,6 +300,7 @@ var init_loadConfig = __esm(() => {
301
300
  "stylesConfig",
302
301
  "svelteDirectory",
303
302
  "tailwind",
303
+ "ready",
304
304
  "visibility",
305
305
  "vueDirectory"
306
306
  ]);
@@ -2482,6 +2482,7 @@ init_constants();
2482
2482
  init_loadConfig();
2483
2483
  init_getDurationString();
2484
2484
  import { existsSync as existsSync8, readFileSync as readFileSync8 } from "fs";
2485
+ import { createConnection } from "net";
2485
2486
  import { resolve as resolve6 } from "path";
2486
2487
 
2487
2488
  // src/cli/workspaceTui.ts
@@ -3051,50 +3052,164 @@ var getServiceUrl = (service) => {
3051
3052
  if (!service.port) {
3052
3053
  return null;
3053
3054
  }
3054
- return `http://localhost:${service.port}/`;
3055
+ return `${getServiceProtocol(service)}://${getServicePublicHost(service)}:${service.port}/`;
3055
3056
  };
3056
- var getHealthcheckUrl = (service) => {
3057
- if (service.healthcheck) {
3058
- return service.healthcheck;
3059
- }
3057
+ var getDefaultReadyConfig = (service) => {
3060
3058
  if (isAbsoluteService(service) && service.port) {
3061
- return `http://127.0.0.1:${service.port}/hmr-status`;
3059
+ return "/hmr-status";
3062
3060
  }
3063
3061
  return;
3064
3062
  };
3065
- var resolveHealthcheck = (healthcheck) => {
3066
- if (!healthcheck) {
3067
- return null;
3063
+ var normalizeExpectedStatuses = (value) => Array.isArray(value) ? value : [value ?? 200];
3064
+ var resolveServiceHttpUrl = (service, path) => {
3065
+ if (!path.startsWith("/")) {
3066
+ throw new Error(`ready path must start with "/" for service probes. Received "${path}".`);
3068
3067
  }
3069
- if (typeof healthcheck === "string") {
3068
+ if (!service.port) {
3069
+ throw new Error(`ready path "${path}" requires the service to define a port.`);
3070
+ }
3071
+ return `${getServiceProtocol(service)}://${getServicePublicHost(service)}:${service.port}${path}`;
3072
+ };
3073
+ var resolveHttpReadyProbe = (service, ready) => {
3074
+ if (typeof ready === "string") {
3075
+ if (isAbsoluteService(service)) {
3076
+ return {
3077
+ type: "http",
3078
+ url: resolveServiceHttpUrl(service, ready),
3079
+ method: "GET",
3080
+ expectStatus: [200],
3081
+ headers: {},
3082
+ intervalMs: 250,
3083
+ timeoutMs: 30000
3084
+ };
3085
+ }
3070
3086
  return {
3087
+ type: "http",
3088
+ url: ready,
3089
+ method: "GET",
3090
+ expectStatus: [200],
3091
+ headers: {},
3071
3092
  intervalMs: 250,
3072
- timeoutMs: 30000,
3073
- url: healthcheck
3093
+ timeoutMs: 30000
3074
3094
  };
3075
3095
  }
3096
+ if (ready.path && ready.url) {
3097
+ throw new Error('ready HTTP probe cannot define both "path" and "url".');
3098
+ }
3099
+ const url = ready.path ? resolveServiceHttpUrl(service, ready.path) : ready.url ? ready.url : isAbsoluteService(service) ? resolveServiceHttpUrl(service, "/hmr-status") : null;
3100
+ if (!url) {
3101
+ throw new Error('ready HTTP probe requires either "url" or "path".');
3102
+ }
3076
3103
  return {
3077
- intervalMs: healthcheck.intervalMs ?? 250,
3078
- timeoutMs: healthcheck.timeoutMs ?? 30000,
3079
- url: healthcheck.url
3104
+ type: "http",
3105
+ url,
3106
+ method: ready.method ?? "GET",
3107
+ expectStatus: normalizeExpectedStatuses(ready.expectStatus),
3108
+ headers: ready.headers ?? {},
3109
+ intervalMs: ready.intervalMs ?? 250,
3110
+ timeoutMs: ready.timeoutMs ?? 30000
3080
3111
  };
3081
3112
  };
3082
- var waitForHealthcheck = async (healthcheck) => {
3083
- const resolved = resolveHealthcheck(healthcheck);
3113
+ var resolveReadyProbe = (service, ready = service.ready ?? getDefaultReadyConfig(service)) => {
3114
+ if (ready === false || !ready) {
3115
+ return null;
3116
+ }
3117
+ if (typeof ready === "string") {
3118
+ return resolveHttpReadyProbe(service, ready);
3119
+ }
3120
+ if (ready.type === "tcp") {
3121
+ return {
3122
+ type: "tcp",
3123
+ host: ready.host ?? getServicePublicHost(service),
3124
+ port: ready.port,
3125
+ intervalMs: ready.intervalMs ?? 250,
3126
+ timeoutMs: ready.timeoutMs ?? 30000
3127
+ };
3128
+ }
3129
+ if (ready.type === "command") {
3130
+ return {
3131
+ type: "command",
3132
+ command: ready.command,
3133
+ intervalMs: ready.intervalMs ?? 250,
3134
+ timeoutMs: ready.timeoutMs ?? 30000
3135
+ };
3136
+ }
3137
+ if (ready.type === "delay") {
3138
+ return {
3139
+ type: "delay",
3140
+ ms: ready.ms
3141
+ };
3142
+ }
3143
+ return resolveHttpReadyProbe(service, ready);
3144
+ };
3145
+ var probeHttpReady = async (ready) => {
3146
+ const response = await fetch(ready.url, {
3147
+ method: ready.method,
3148
+ headers: ready.headers,
3149
+ signal: AbortSignal.timeout(Math.min(ready.timeoutMs, 5000))
3150
+ });
3151
+ return ready.expectStatus.includes(response.status);
3152
+ };
3153
+ var probeTcpReady = async (ready) => new Promise((resolveProbe) => {
3154
+ const socket = createConnection({
3155
+ host: ready.host,
3156
+ port: ready.port
3157
+ });
3158
+ const timeout = setTimeout(() => {
3159
+ socket.destroy();
3160
+ resolveProbe(false);
3161
+ }, Math.min(ready.timeoutMs, 5000));
3162
+ socket.once("connect", () => {
3163
+ clearTimeout(timeout);
3164
+ socket.end();
3165
+ resolveProbe(true);
3166
+ });
3167
+ socket.once("error", () => {
3168
+ clearTimeout(timeout);
3169
+ socket.destroy();
3170
+ resolveProbe(false);
3171
+ });
3172
+ });
3173
+ var probeCommandReady = async (ready, service) => {
3174
+ const processHandle = Bun.spawn(ready.command, {
3175
+ cwd: service.cwd,
3176
+ env: service.env,
3177
+ stderr: "ignore",
3178
+ stdin: "ignore",
3179
+ stdout: "ignore"
3180
+ });
3181
+ const timeout = setTimeout(() => {
3182
+ try {
3183
+ processHandle.kill();
3184
+ } catch {}
3185
+ }, Math.min(ready.timeoutMs, 5000));
3186
+ try {
3187
+ const exitCode = await processHandle.exited;
3188
+ return exitCode === 0;
3189
+ } finally {
3190
+ clearTimeout(timeout);
3191
+ }
3192
+ };
3193
+ var waitForReady = async (service) => {
3194
+ const resolved = resolveReadyProbe(service.service);
3084
3195
  if (!resolved) {
3085
3196
  return;
3086
3197
  }
3198
+ if (resolved.type === "delay") {
3199
+ await sleep(resolved.ms);
3200
+ return;
3201
+ }
3087
3202
  const startedAt = Date.now();
3088
3203
  while (Date.now() - startedAt < resolved.timeoutMs) {
3089
3204
  try {
3090
- const response = await fetch(resolved.url);
3091
- if (response.ok) {
3205
+ const isReady = resolved.type === "http" ? await probeHttpReady(resolved) : resolved.type === "tcp" ? await probeTcpReady(resolved) : await probeCommandReady(resolved, service);
3206
+ if (isReady) {
3092
3207
  return;
3093
3208
  }
3094
3209
  } catch {}
3095
3210
  await sleep(resolved.intervalMs);
3096
3211
  }
3097
- throw new Error(`service did not become healthy within ${resolved.timeoutMs}ms (${resolved.url})`);
3212
+ throw new Error(resolved.type === "http" ? `service did not become ready within ${resolved.timeoutMs}ms (${resolved.url})` : resolved.type === "tcp" ? `service did not become ready within ${resolved.timeoutMs}ms (tcp://${resolved.host}:${resolved.port})` : `service did not become ready within ${resolved.timeoutMs}ms (${resolved.command.join(" ")})`);
3098
3213
  };
3099
3214
  var topologicallySortServices = (services) => {
3100
3215
  const ordered = [];
@@ -3341,7 +3456,7 @@ var workspace = async (subcommand, options) => {
3341
3456
  tui.addLog("workspace", `${name} exited with code ${exitCode || 1}. Shutting down workspace.`, "error");
3342
3457
  shutdown(exitCode || 1);
3343
3458
  });
3344
- await waitForHealthcheck(getHealthcheckUrl(resolved.service));
3459
+ await waitForReady(resolved);
3345
3460
  const startedAt = serviceBootStartedAt.get(name);
3346
3461
  const readyDuration = typeof startedAt === "number" ? `ready in ${getDurationString(performance.now() - startedAt)}` : undefined;
3347
3462
  tui.setServiceStatus(name, "ready", readyDuration);
package/dist/index.js CHANGED
@@ -172153,6 +172153,26 @@ var init_pageMetadata = __esm(() => {
172153
172153
  };
172154
172154
  });
172155
172155
 
172156
+ // src/utils/startupTimings.ts
172157
+ var startupTimingsEnabled, formatStartupTimingBlock = (title, steps) => {
172158
+ const totalDuration = steps.reduce((sum, step) => sum + step.durationMs, 0);
172159
+ return [
172160
+ title,
172161
+ ...steps.map((step) => ` - ${step.label}: ${getDurationString(step.durationMs)}`),
172162
+ ` Total: ${getDurationString(totalDuration)}`
172163
+ ].join(`
172164
+ `);
172165
+ }, logStartupTimingBlock = (title, steps) => {
172166
+ if (!startupTimingsEnabled || steps.length === 0) {
172167
+ return;
172168
+ }
172169
+ console.log(formatStartupTimingBlock(title, steps));
172170
+ };
172171
+ var init_startupTimings = __esm(() => {
172172
+ init_getDurationString();
172173
+ startupTimingsEnabled = process.env.ABSOLUTE_STARTUP_TIMINGS === "1" || process.env.ABSOLUTE_STARTUP_TIMINGS === "true";
172174
+ });
172175
+
172156
172176
  // src/utils/normalizePath.ts
172157
172177
  var normalizePath = (path) => path.replace(/\\/g, "/");
172158
172178
 
@@ -180967,9 +180987,21 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
180967
180987
  await handleCachedReload();
180968
180988
  return cached;
180969
180989
  }
180990
+ const startupSteps = [];
180991
+ const recordStep = (label, startedAt) => {
180992
+ startupSteps.push({
180993
+ label,
180994
+ durationMs: performance.now() - startedAt
180995
+ });
180996
+ };
180997
+ let stepStartedAt = performance.now();
180970
180998
  const state = createHMRState(config);
180999
+ recordStep("create HMR state", stepStartedAt);
181000
+ stepStartedAt = performance.now();
180971
181001
  const watchPaths = getWatchPaths(config, state.resolvedPaths);
180972
181002
  buildInitialDependencyGraph(state.dependencyGraph, watchPaths);
181003
+ recordStep("initialize dependency graph", stepStartedAt);
181004
+ stepStartedAt = performance.now();
180973
181005
  if (config.reactDirectory) {
180974
181006
  setDevVendorPaths(computeVendorPaths());
180975
181007
  }
@@ -180985,7 +181017,10 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
180985
181017
  const sourceDirs = collectDepVendorSourceDirs(config);
180986
181018
  const { computeDepVendorPaths: computeDepVendorPaths2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
180987
181019
  globalThis.__depVendorPaths = await computeDepVendorPaths2(sourceDirs);
181020
+ recordStep("prepare vendor paths", stepStartedAt);
181021
+ stepStartedAt = performance.now();
180988
181022
  await resolveAbsoluteVersion2();
181023
+ recordStep("resolve version", stepStartedAt);
180989
181024
  const buildStart = performance.now();
180990
181025
  const buildResult = await build2({
180991
181026
  ...config,
@@ -180997,11 +181032,15 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
180997
181032
  });
180998
181033
  const manifest = buildResult.manifest ?? {};
180999
181034
  const conventions2 = buildResult.conventions ?? {};
181035
+ recordStep("initial build", buildStart);
181000
181036
  if (Object.keys(manifest).length === 0) {
181001
181037
  console.log("\u26A0\uFE0F Manifest is empty - this is OK for HTML/HTMX-only projects");
181002
181038
  }
181039
+ stepStartedAt = performance.now();
181003
181040
  await populateAssetStore(state.assetStore, manifest, state.resolvedPaths.buildDir);
181004
181041
  cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
181042
+ recordStep("populate asset store", stepStartedAt);
181043
+ stepStartedAt = performance.now();
181005
181044
  const buildReactVendorTask = config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir).then(async () => {
181006
181045
  const vendorDir = resolve32(state.resolvedPaths.buildDir, "react", "vendor");
181007
181046
  await loadVendorFiles(state.assetStore, vendorDir, "react");
@@ -181039,19 +181078,25 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
181039
181078
  buildVueVendorTask,
181040
181079
  buildDepVendorTask
181041
181080
  ]);
181081
+ recordStep("build vendor bundles", stepStartedAt);
181082
+ stepStartedAt = performance.now();
181042
181083
  const { warmCompilers: warmCompilers2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
181043
181084
  await warmCompilers2({
181044
181085
  svelte: Boolean(config.svelteDirectory),
181045
181086
  vue: Boolean(config.vueDirectory)
181046
181087
  });
181088
+ recordStep("warm compilers", stepStartedAt);
181047
181089
  state.manifest = manifest;
181090
+ stepStartedAt = performance.now();
181048
181091
  startFileWatching(state, config, (filePath) => {
181049
181092
  queueFileChange(state, filePath, config, (newBuildResult) => {
181050
181093
  Object.assign(manifest, newBuildResult.manifest);
181051
181094
  state.manifest = manifest;
181052
181095
  });
181053
181096
  });
181097
+ recordStep("start file watching", stepStartedAt);
181054
181098
  globalThis.__hmrBuildDuration = performance.now() - buildStart;
181099
+ logStartupTimingBlock("AbsoluteJS devBuild timing", startupSteps);
181055
181100
  const result = {
181056
181101
  conventions: conventions2,
181057
181102
  hmrState: state,
@@ -181075,6 +181120,7 @@ var init_devBuild = __esm(() => {
181075
181120
  init_assetStore();
181076
181121
  init_rebuildTrigger();
181077
181122
  init_logger();
181123
+ init_startupTimings();
181078
181124
  FRAMEWORK_DIR_KEYS = [
181079
181125
  "reactDirectory",
181080
181126
  "svelteDirectory",
@@ -181936,7 +181982,6 @@ var RESERVED_TOP_LEVEL_KEYS = new Set([
181936
181982
  "dev",
181937
181983
  "entry",
181938
181984
  "env",
181939
- "healthcheck",
181940
181985
  "htmlDirectory",
181941
181986
  "htmxDirectory",
181942
181987
  "images",
@@ -181953,6 +181998,7 @@ var RESERVED_TOP_LEVEL_KEYS = new Set([
181953
181998
  "stylesConfig",
181954
181999
  "svelteDirectory",
181955
182000
  "tailwind",
182001
+ "ready",
181956
182002
  "visibility",
181957
182003
  "vueDirectory"
181958
182004
  ]);
@@ -181993,9 +182039,9 @@ var projectServiceConfig = (config, serviceName) => {
181993
182039
  cwd: _cwd,
181994
182040
  dependsOn: _dependsOn,
181995
182041
  env: _env,
181996
- healthcheck: _healthcheck,
181997
182042
  kind: _kind,
181998
182043
  port: _port,
182044
+ ready: _ready,
181999
182045
  visibility: _visibility,
182000
182046
  ...serviceConfig
182001
182047
  } = service;
@@ -182057,6 +182103,7 @@ var loadIslandRegistry = async (registryPath) => {
182057
182103
  // src/core/prepare.ts
182058
182104
  init_pageMetadata();
182059
182105
  init_resolveConvention();
182106
+ init_startupTimings();
182060
182107
  var MS_PER_SECOND2 = 1000;
182061
182108
  var DEFAULT_PORT2 = 3000;
182062
182109
  var MAX_STATIC_ROUTE_COUNT = Number.MAX_SAFE_INTEGER;
@@ -182129,10 +182176,22 @@ var patchManifestIndexes = (manifest, devIndexDir, SRC_URL_PREFIX2) => {
182129
182176
  }
182130
182177
  };
182131
182178
  var prepareDev = async (config, buildDir) => {
182179
+ const startupSteps = [];
182180
+ const recordStep = (label, startedAt) => {
182181
+ startupSteps.push({
182182
+ label,
182183
+ durationMs: performance.now() - startedAt
182184
+ });
182185
+ };
182186
+ let stepStartedAt = performance.now();
182132
182187
  const { patchElysiaRouteRegistrationCallsites: patchElysiaRouteRegistrationCallsites2 } = await Promise.resolve().then(() => (init_devRouteRegistrationCallsite(), exports_devRouteRegistrationCallsite));
182133
182188
  patchElysiaRouteRegistrationCallsites2();
182189
+ recordStep("patch route registration", stepStartedAt);
182190
+ stepStartedAt = performance.now();
182134
182191
  const { devBuild: devBuild2 } = await Promise.resolve().then(() => (init_devBuild(), exports_devBuild));
182135
182192
  const result = await devBuild2(config);
182193
+ recordStep("devBuild", stepStartedAt);
182194
+ stepStartedAt = performance.now();
182136
182195
  const { hmr: hmr2 } = await Promise.resolve().then(() => (init_hmr(), exports_hmr));
182137
182196
  const { staticPlugin } = await import("@elysiajs/static");
182138
182197
  const { createModuleServer: createModuleServer2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
@@ -182142,6 +182201,8 @@ var prepareDev = async (config, buildDir) => {
182142
182201
  getSvelteVendorPaths: getSvelteVendorPaths2,
182143
182202
  getVueVendorPaths: getVueVendorPaths2
182144
182203
  } = await Promise.resolve().then(() => exports_devVendorPaths);
182204
+ recordStep("load dev runtime modules", stepStartedAt);
182205
+ stepStartedAt = performance.now();
182145
182206
  const depVendorPaths = globalThis.__depVendorPaths ?? {};
182146
182207
  const allVendorPaths = {
182147
182208
  ...getDevVendorPaths2() ?? {},
@@ -182162,19 +182223,25 @@ var prepareDev = async (config, buildDir) => {
182162
182223
  vendorPaths: allVendorPaths
182163
182224
  });
182164
182225
  setGlobalModuleServer2(moduleHandler);
182226
+ recordStep("create module server", stepStartedAt);
182165
182227
  const { warmCache: warmCache2, SRC_URL_PREFIX: SRC_URL_PREFIX2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
182166
182228
  const prewarmDirs = buildPrewarmDirs(config);
182229
+ stepStartedAt = performance.now();
182167
182230
  await warmPrewarmDirs(prewarmDirs, warmCache2, SRC_URL_PREFIX2);
182231
+ recordStep("prewarm source modules", stepStartedAt);
182168
182232
  if (config.dev?.https) {
182169
182233
  globalThis.__http2Config = {
182170
182234
  hmrState: result.hmrState,
182171
182235
  manifest: result.manifest
182172
182236
  };
182173
182237
  }
182238
+ stepStartedAt = performance.now();
182174
182239
  const hmrPlugin = hmr2(result.hmrState, result.manifest, moduleHandler);
182175
182240
  const { devtoolsJson: devtoolsJson2 } = await Promise.resolve().then(() => (init_devtoolsJson(), exports_devtoolsJson));
182176
182241
  const devIndexDir = resolve35(buildDir, "_src_indexes");
182177
182242
  patchManifestIndexes(result.manifest, devIndexDir, SRC_URL_PREFIX2);
182243
+ recordStep("configure dev plugins", stepStartedAt);
182244
+ stepStartedAt = performance.now();
182178
182245
  if (result.conventions)
182179
182246
  setConventions(result.conventions);
182180
182247
  setCurrentIslandManifest(result.manifest);
@@ -182182,6 +182249,8 @@ var prepareDev = async (config, buildDir) => {
182182
182249
  setCurrentIslandRegistry(await loadIslandRegistry(config.islands.registry));
182183
182250
  }
182184
182251
  setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
182252
+ recordStep("load runtime metadata", stepStartedAt);
182253
+ stepStartedAt = performance.now();
182185
182254
  const { imageOptimizer: imageOptimizer2 } = await Promise.resolve().then(() => (init_imageOptimizer(), exports_imageOptimizer));
182186
182255
  const absolutejs = new Elysia5({ name: "absolutejs-runtime" }).use(devtoolsJson2(buildDir, {
182187
182256
  normalizeForWindowsContainer: config.dev?.devtools?.normalizeForWindowsContainer,
@@ -182196,6 +182265,8 @@ var prepareDev = async (config, buildDir) => {
182196
182265
  prefix: "",
182197
182266
  staticLimit: MAX_STATIC_ROUTE_COUNT
182198
182267
  })).use(hmrPlugin).use(createSitemapPlugin(buildDir, config.sitemap)).use(createNotFoundPlugin());
182268
+ recordStep("assemble dev runtime", stepStartedAt);
182269
+ logStartupTimingBlock("AbsoluteJS prepareDev timing", startupSteps);
182199
182270
  return {
182200
182271
  absolutejs,
182201
182272
  manifest: result.manifest
@@ -182235,23 +182306,42 @@ var createNotFoundPlugin = () => new Elysia5({ name: "absolutejs-not-found" }).o
182235
182306
  return;
182236
182307
  });
182237
182308
  var prepare = async (configOrPath) => {
182309
+ const startupSteps = [];
182310
+ const recordStep = (label, startedAt) => {
182311
+ startupSteps.push({
182312
+ label,
182313
+ durationMs: performance.now() - startedAt
182314
+ });
182315
+ };
182316
+ let stepStartedAt = performance.now();
182238
182317
  const config = await loadConfig(configOrPath);
182318
+ recordStep("load config", stepStartedAt);
182239
182319
  const nodeEnv = process.env["NODE_ENV"];
182240
182320
  const isDev3 = nodeEnv === "development";
182241
182321
  const buildDir = resolve35(process.env.ABSOLUTE_BUILD_DIR ?? config.buildDirectory ?? "build");
182242
- if (isDev3)
182243
- return prepareDev(config, buildDir);
182322
+ if (isDev3) {
182323
+ stepStartedAt = performance.now();
182324
+ const result = await prepareDev(config, buildDir);
182325
+ recordStep("prepare dev runtime", stepStartedAt);
182326
+ logStartupTimingBlock("AbsoluteJS prepare timing", startupSteps);
182327
+ return result;
182328
+ }
182329
+ stepStartedAt = performance.now();
182244
182330
  const manifest = JSON.parse(readFileSync16(`${buildDir}/manifest.json`, "utf-8"));
182245
182331
  setCurrentIslandManifest(manifest);
182246
182332
  if (config.islands?.registry) {
182247
182333
  setCurrentIslandRegistry(await loadIslandRegistry(config.islands.registry));
182248
182334
  }
182249
182335
  setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
182336
+ recordStep("load production manifest and island metadata", stepStartedAt);
182337
+ stepStartedAt = performance.now();
182250
182338
  const conventionsPath = join24(buildDir, "conventions.json");
182251
182339
  if (existsSync24(conventionsPath)) {
182252
182340
  const conventions2 = JSON.parse(readFileSync16(conventionsPath, "utf-8"));
182253
182341
  setConventions(conventions2);
182254
182342
  }
182343
+ recordStep("load production conventions", stepStartedAt);
182344
+ stepStartedAt = performance.now();
182255
182345
  const { staticPlugin } = await import("@elysiajs/static");
182256
182346
  const staticFiles = staticPlugin({
182257
182347
  assets: buildDir,
@@ -182259,8 +182349,11 @@ var prepare = async (configOrPath) => {
182259
182349
  prefix: "",
182260
182350
  staticLimit: MAX_STATIC_ROUTE_COUNT
182261
182351
  });
182352
+ recordStep("create static plugin", stepStartedAt);
182353
+ stepStartedAt = performance.now();
182262
182354
  const prerenderDir = join24(buildDir, "_prerendered");
182263
182355
  const prerenderMap = loadPrerenderMap(prerenderDir);
182356
+ recordStep("load prerender map", stepStartedAt);
182264
182357
  if (prerenderMap.size > 0) {
182265
182358
  const { PRERENDER_BYPASS_HEADER: PRERENDER_BYPASS_HEADER2, readTimestamp: readTimestamp2, rerenderRoute: rerenderRoute2 } = await Promise.resolve().then(() => (init_prerender(), exports_prerender));
182266
182359
  const revalidateMs = config.static?.revalidate ? config.static.revalidate * MS_PER_SECOND2 : 0;
@@ -182285,12 +182378,18 @@ var prepare = async (configOrPath) => {
182285
182378
  headers: { "content-type": "text/html; charset=utf-8" }
182286
182379
  });
182287
182380
  });
182381
+ stepStartedAt = performance.now();
182288
182382
  const { imageOptimizer: imageOptimizer3 } = await Promise.resolve().then(() => (init_imageOptimizer(), exports_imageOptimizer));
182289
182383
  const absolutejs2 = new Elysia5({ name: "absolutejs-runtime" }).use(imageOptimizer3(config.images, buildDir)).use(prerenderPlugin).use(staticFiles).use(createSitemapPlugin(buildDir, config.sitemap)).use(createNotFoundPlugin());
182384
+ recordStep("assemble production runtime", stepStartedAt);
182385
+ logStartupTimingBlock("AbsoluteJS prepare timing", startupSteps);
182290
182386
  return { absolutejs: absolutejs2, manifest };
182291
182387
  }
182388
+ stepStartedAt = performance.now();
182292
182389
  const { imageOptimizer: imageOptimizer2 } = await Promise.resolve().then(() => (init_imageOptimizer(), exports_imageOptimizer));
182293
182390
  const absolutejs = new Elysia5({ name: "absolutejs-runtime" }).use(imageOptimizer2(config.images, buildDir)).use(staticFiles).use(createSitemapPlugin(buildDir, config.sitemap)).use(createNotFoundPlugin());
182391
+ recordStep("assemble production runtime", stepStartedAt);
182392
+ logStartupTimingBlock("AbsoluteJS prepare timing", startupSteps);
182294
182393
  return { absolutejs, manifest };
182295
182394
  };
182296
182395
 
@@ -188898,5 +188997,5 @@ export {
188898
188997
  ANGULAR_INIT_TIMEOUT_MS
188899
188998
  };
188900
188999
 
188901
- //# debugId=5420DB14363AEF7064756E2164756E21
189000
+ //# debugId=34F91B1BAA5BDB1464756E2164756E21
188902
189001
  //# sourceMappingURL=index.js.map