@absolutejs/absolute 0.19.0-beta.1095 → 0.19.0-beta.1096

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/build.js CHANGED
@@ -4746,6 +4746,10 @@ var init_devRouteRegistrationCallsite = __esm(() => {
4746
4746
  });
4747
4747
 
4748
4748
  // src/angular/staticAnalyzeSpaRoutes.ts
4749
+ var exports_staticAnalyzeSpaRoutes = {};
4750
+ __export(exports_staticAnalyzeSpaRoutes, {
4751
+ analyzeAngularSpaRoutes: () => analyzeAngularSpaRoutes
4752
+ });
4749
4753
  import { existsSync as existsSync8, promises as fs } from "fs";
4750
4754
  import { join as join11 } from "path";
4751
4755
  import ts3 from "typescript";
@@ -4844,8 +4848,6 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
4844
4848
  extractRoutePaths(childrenLiteral, joined, sitemapExcluded, out);
4845
4849
  continue;
4846
4850
  }
4847
- if (redirected)
4848
- continue;
4849
4851
  if (joined === "")
4850
4852
  continue;
4851
4853
  out.push({
@@ -4974,6 +4976,10 @@ var init_staticAnalyzeSpaRoutes = __esm(() => {
4974
4976
  });
4975
4977
 
4976
4978
  // src/react/staticAnalyzeSpaRoutes.ts
4979
+ var exports_staticAnalyzeSpaRoutes2 = {};
4980
+ __export(exports_staticAnalyzeSpaRoutes2, {
4981
+ analyzeReactSpaRoutes: () => analyzeReactSpaRoutes
4982
+ });
4977
4983
  import { existsSync as existsSync9, promises as fs2 } from "fs";
4978
4984
  import { join as join12 } from "path";
4979
4985
  import ts4 from "typescript";
@@ -5070,8 +5076,6 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
5070
5076
  extractRouteEntries(childrenLiteral, joined, out);
5071
5077
  continue;
5072
5078
  }
5073
- if (redirected)
5074
- continue;
5075
5079
  if (!isIndex && pathSegment === null)
5076
5080
  continue;
5077
5081
  if (joined === "")
@@ -5184,6 +5188,10 @@ var init_staticAnalyzeSpaRoutes2 = __esm(() => {
5184
5188
  });
5185
5189
 
5186
5190
  // src/svelte/staticAnalyzeSpaRoutes.ts
5191
+ var exports_staticAnalyzeSpaRoutes3 = {};
5192
+ __export(exports_staticAnalyzeSpaRoutes3, {
5193
+ analyzeSvelteSpaRoutes: () => analyzeSvelteSpaRoutes
5194
+ });
5187
5195
  import { existsSync as existsSync10, promises as fs3 } from "fs";
5188
5196
  import { join as join13 } from "path";
5189
5197
  var DYNAMIC_SEGMENT_PATTERN3, pathHasDynamic3 = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN3.test(seg) || seg === "**"), joinSegments3 = (parent, child) => {
@@ -5288,6 +5296,10 @@ var init_staticAnalyzeSpaRoutes3 = __esm(() => {
5288
5296
  });
5289
5297
 
5290
5298
  // src/vue/staticAnalyzeSpaRoutes.ts
5299
+ var exports_staticAnalyzeSpaRoutes4 = {};
5300
+ __export(exports_staticAnalyzeSpaRoutes4, {
5301
+ analyzeVueSpaRoutes: () => analyzeVueSpaRoutes
5302
+ });
5291
5303
  import { existsSync as existsSync11, promises as fs4 } from "fs";
5292
5304
  import { join as join14 } from "path";
5293
5305
  import ts5 from "typescript";
@@ -5349,6 +5361,7 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
5349
5361
  let pathSegment = null;
5350
5362
  let redirected = false;
5351
5363
  let sitemapExcluded = false;
5364
+ let alias = null;
5352
5365
  let childrenLiteral = null;
5353
5366
  for (const property of element.properties) {
5354
5367
  const key = readPropertyKey3(property);
@@ -5358,6 +5371,8 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
5358
5371
  continue;
5359
5372
  if (key === "path") {
5360
5373
  pathSegment = readStringLiteral3(property.initializer);
5374
+ } else if (key === "alias") {
5375
+ alias = readStringLiteral3(property.initializer);
5361
5376
  } else if (key === "redirect") {
5362
5377
  redirected = true;
5363
5378
  } else if (key === "children" && ts5.isArrayLiteralExpression(property.initializer)) {
@@ -5382,8 +5397,6 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
5382
5397
  extractRouteEntries2(childrenLiteral, joined, out);
5383
5398
  continue;
5384
5399
  }
5385
- if (redirected)
5386
- continue;
5387
5400
  if (joined === "")
5388
5401
  continue;
5389
5402
  out.push({
@@ -5392,7 +5405,34 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
5392
5405
  redirected,
5393
5406
  sitemapExcluded
5394
5407
  });
5408
+ if (alias) {
5409
+ out.push({
5410
+ dynamic: pathHasDynamic4(alias),
5411
+ path: alias,
5412
+ redirected: false,
5413
+ sitemapExcluded: true
5414
+ });
5415
+ }
5395
5416
  }
5417
+ }, findDefineRoutesArray = (sf) => {
5418
+ let found = null;
5419
+ const visit = (node) => {
5420
+ if (found)
5421
+ return;
5422
+ if (ts5.isCallExpression(node) && ts5.isIdentifier(node.expression) && node.expression.text === "defineRoutes" && node.arguments[0] && ts5.isArrayLiteralExpression(node.arguments[0])) {
5423
+ found = node.arguments[0];
5424
+ return;
5425
+ }
5426
+ ts5.forEachChild(node, visit);
5427
+ };
5428
+ ts5.forEachChild(sf, visit);
5429
+ return found;
5430
+ }, inferBaseHref = (routes) => {
5431
+ const firstSegments = routes.map((route) => route.path.split("/").filter(Boolean)[0]).filter((segment) => Boolean(segment));
5432
+ const first = firstSegments[0];
5433
+ if (!first || firstSegments.some((segment) => segment !== first))
5434
+ return "/";
5435
+ return `/${first}/`;
5396
5436
  }, findCreateRouterCall = (sf) => {
5397
5437
  let found = null;
5398
5438
  const visit = (node) => {
@@ -5466,24 +5506,19 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
5466
5506
  return null;
5467
5507
  analysisSource = script;
5468
5508
  }
5469
- if (!analysisSource.includes("createRouter"))
5509
+ if (!analysisSource.includes("createRouter") && !analysisSource.includes("defineRoutes"))
5470
5510
  return null;
5471
5511
  const sf = ts5.createSourceFile(filePath, analysisSource, ts5.ScriptTarget.Latest, true, ts5.ScriptKind.TS);
5472
- if (!importsSymbolFrom2(sf, "createRouter", "vue-router"))
5473
- return null;
5474
- const call = findCreateRouterCall(sf);
5475
- if (!call)
5476
- return null;
5477
- const optionsArg = call.arguments[0];
5478
- if (!optionsArg)
5479
- return null;
5480
- const routesArray = readRoutesFromCreateRouterOptions(sf, optionsArg);
5512
+ const defineRoutesArray = findDefineRoutesArray(sf);
5513
+ const call = importsSymbolFrom2(sf, "createRouter", "vue-router") ? findCreateRouterCall(sf) : null;
5514
+ const optionsArg = call?.arguments[0];
5515
+ const routesArray = defineRoutesArray ?? (optionsArg ? readRoutesFromCreateRouterOptions(sf, optionsArg) : null);
5481
5516
  if (!routesArray)
5482
5517
  return null;
5483
- const base = findCreateWebHistoryBase(sf) ?? "/";
5484
- const baseHref = base.endsWith("/") ? base : `${base}/`;
5485
5518
  const routes = [];
5486
5519
  extractRouteEntries2(routesArray, "", routes);
5520
+ const base = findCreateWebHistoryBase(sf) ?? inferBaseHref(routes);
5521
+ const baseHref = base.endsWith("/") ? base : `${base}/`;
5487
5522
  return { baseHref, routes, sourceFile: filePath };
5488
5523
  }, walkSourceFiles2 = async (dir, out) => {
5489
5524
  let items;
@@ -12854,6 +12889,343 @@ var validateSafePath = (targetPath, baseDirectory) => {
12854
12889
  };
12855
12890
  var init_validateSafePath = () => {};
12856
12891
 
12892
+ // src/utils/resolveConvention.ts
12893
+ import { basename as basename6 } from "path";
12894
+ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boolean(value) && typeof value === "object", getMap = () => {
12895
+ const value = Reflect.get(globalThis, CONVENTIONS_KEY);
12896
+ if (isConventionsMap(value))
12897
+ return value;
12898
+ const empty = {};
12899
+ return empty;
12900
+ }, derivePageName = (pagePath) => {
12901
+ const base = basename6(pagePath);
12902
+ const dotIndex = base.indexOf(".");
12903
+ const name = dotIndex > 0 ? base.slice(0, dotIndex) : base;
12904
+ return toPascal(name);
12905
+ }, normalizeConventionPageName = (name) => toPascal(name).replace(/\d+$/, ""), hasErrorConvention = (framework) => {
12906
+ const conventions = getMap()[framework];
12907
+ if (!conventions)
12908
+ return false;
12909
+ if (conventions.defaults?.error)
12910
+ return true;
12911
+ return Object.values(conventions.pages ?? {}).some((page) => Boolean(page.error));
12912
+ }, resolveErrorConventionPath = (framework, pageName) => {
12913
+ const conventions = getMap()[framework];
12914
+ if (!conventions)
12915
+ return;
12916
+ const exact = conventions.pages?.[pageName]?.error;
12917
+ if (exact)
12918
+ return exact;
12919
+ const normalizedPageName = normalizeConventionPageName(pageName);
12920
+ for (const [candidate, page] of Object.entries(conventions.pages ?? {})) {
12921
+ if (normalizeConventionPageName(candidate) === normalizedPageName) {
12922
+ return page.error ?? conventions.defaults?.error;
12923
+ }
12924
+ }
12925
+ return conventions.defaults?.error;
12926
+ }, resolveNotFoundConventionPath = (framework) => getMap()[framework]?.defaults?.notFound, setConventions = (map) => {
12927
+ Reflect.set(globalThis, CONVENTIONS_KEY, map);
12928
+ }, isDev = () => true, buildErrorProps = (error) => {
12929
+ if (error instanceof Error) {
12930
+ return {
12931
+ name: error.name,
12932
+ message: error.message,
12933
+ ...isDev() && error.stack ? { stack: error.stack } : {}
12934
+ };
12935
+ }
12936
+ return { message: String(error), name: "Error" };
12937
+ }, renderReactError = async (conventionPath, errorProps) => {
12938
+ const { createElement } = await import("react");
12939
+ const { renderToReadableStream } = await import("react-dom/server");
12940
+ const mod = await import(conventionPath);
12941
+ const ErrorComponent = mod.default;
12942
+ if (typeof ErrorComponent !== "function")
12943
+ return null;
12944
+ const element = createElement(ErrorComponent, errorProps);
12945
+ const stream = await renderToReadableStream(element);
12946
+ return new Response(stream, {
12947
+ headers: { "Content-Type": "text/html" },
12948
+ status: 500
12949
+ });
12950
+ }, renderSvelteError = async (conventionPath, errorProps) => {
12951
+ const { render } = await import("svelte/server");
12952
+ const mod = await import(conventionPath);
12953
+ const ErrorComponent = mod.default;
12954
+ if (!ErrorComponent)
12955
+ return null;
12956
+ const { head, body } = render(ErrorComponent, {
12957
+ props: errorProps
12958
+ });
12959
+ const html = `<!DOCTYPE html><html><head>${head}</head><body>${body}</body></html>`;
12960
+ return new Response(html, {
12961
+ headers: { "Content-Type": "text/html" },
12962
+ status: 500
12963
+ });
12964
+ }, unescapeVueStyles = (ssrBody) => {
12965
+ let styles = "";
12966
+ const body = ssrBody.replace(/<style>([\s\S]*?)<\/style>/g, (_2, css) => {
12967
+ styles += `<style>${css.replace(/&quot;/g, '"').replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">")}</style>`;
12968
+ return "";
12969
+ });
12970
+ return { body, styles };
12971
+ }, renderVueError = async (conventionPath, errorProps) => {
12972
+ const { createSSRApp, h: h2 } = await import("vue");
12973
+ const { renderToString } = await import("vue/server-renderer");
12974
+ const mod = await import(conventionPath);
12975
+ const ErrorComponent = mod.default;
12976
+ if (!ErrorComponent)
12977
+ return null;
12978
+ const app = createSSRApp({
12979
+ render: () => h2(ErrorComponent, errorProps)
12980
+ });
12981
+ const rawBody = await renderToString(app);
12982
+ const { styles, body } = unescapeVueStyles(rawBody);
12983
+ const html = `<!DOCTYPE html><html><head>${styles}</head><body><div id="root">${body}</div></body></html>`;
12984
+ return new Response(html, {
12985
+ headers: { "Content-Type": "text/html" },
12986
+ status: 500
12987
+ });
12988
+ }, renderAngularError = async (conventionPath, errorProps) => {
12989
+ const mod = await import(conventionPath);
12990
+ const renderFn = mod.default;
12991
+ if (typeof renderFn !== "function")
12992
+ return null;
12993
+ const html = renderFn(errorProps);
12994
+ return new Response(html, {
12995
+ headers: { "Content-Type": "text/html" },
12996
+ status: 500
12997
+ });
12998
+ }, escapeHtml = (value) => value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), replaceErrorTokens = (template, errorProps) => template.replace(/\{\{\s*name\s*\}\}/g, escapeHtml(errorProps.name)).replace(/\{\{\s*message\s*\}\}/g, escapeHtml(errorProps.message)).replace(/\{\{\s*stack\s*\}\}/g, errorProps.stack ? escapeHtml(errorProps.stack) : ""), renderHtmlError = async (conventionPath, errorProps) => {
12999
+ const template = await Bun.file(conventionPath).text();
13000
+ const html = replaceErrorTokens(template, errorProps);
13001
+ return new Response(html, {
13002
+ headers: { "Content-Type": "text/html" },
13003
+ status: 500
13004
+ });
13005
+ }, logConventionRenderError = (framework, label, renderError) => {
13006
+ const message = renderError instanceof Error ? renderError.message : "";
13007
+ if (message.includes("Cannot find module") || message.includes("Cannot find package") || message.includes("not found in module")) {
13008
+ console.error(`[SSR] Convention ${label} page for ${framework} failed: missing framework package. Ensure the ${framework} runtime is installed (e.g. bun add ${framework === "react" ? "react react-dom" : framework}).`);
13009
+ return;
13010
+ }
13011
+ console.error(`[SSR] Failed to render ${framework} convention ${label} page:`, renderError);
13012
+ }, renderEmberError = async () => null, renderEmberNotFound = async () => null, ERROR_RENDERERS, tryFrameworkErrorConvention = async (framework, pageName, errorProps, error) => {
13013
+ let conventionPath = resolveErrorConventionPath(framework, pageName);
13014
+ if (!conventionPath && error instanceof Error && error.stack) {
13015
+ for (const match of error.stack.matchAll(/^\s*at\s+([A-Za-z_$][\w$]*)/gm)) {
13016
+ const candidate = match[1];
13017
+ if (!candidate)
13018
+ continue;
13019
+ conventionPath = resolveErrorConventionPath(framework, candidate);
13020
+ if (conventionPath)
13021
+ break;
13022
+ }
13023
+ }
13024
+ if (!conventionPath)
13025
+ return null;
13026
+ const renderer = ERROR_RENDERERS[framework];
13027
+ if (!renderer)
13028
+ return null;
13029
+ try {
13030
+ return await renderer(conventionPath, errorProps);
13031
+ } catch (renderError) {
13032
+ logConventionRenderError(framework, "error", renderError);
13033
+ }
13034
+ return null;
13035
+ }, renderConventionError = async (framework, pageName, error) => {
13036
+ const errorProps = buildErrorProps(error);
13037
+ const frameworkResponse = await tryFrameworkErrorConvention(framework, pageName, errorProps, error);
13038
+ if (frameworkResponse)
13039
+ return frameworkResponse;
13040
+ if (framework !== "html") {
13041
+ const htmlResponse = await tryFrameworkErrorConvention("html", pageName, errorProps, error);
13042
+ if (htmlResponse)
13043
+ return htmlResponse;
13044
+ }
13045
+ return null;
13046
+ }, renderReactNotFound = async (conventionPath) => {
13047
+ const { createElement } = await import("react");
13048
+ const { renderToReadableStream } = await import("react-dom/server");
13049
+ const mod = await import(conventionPath);
13050
+ const NotFoundComponent = mod.default;
13051
+ if (typeof NotFoundComponent !== "function")
13052
+ return null;
13053
+ const element = createElement(NotFoundComponent);
13054
+ const stream = await renderToReadableStream(element);
13055
+ return new Response(stream, {
13056
+ headers: { "Content-Type": "text/html" },
13057
+ status: 404
13058
+ });
13059
+ }, renderSvelteNotFound = async (conventionPath) => {
13060
+ const { render } = await import("svelte/server");
13061
+ const mod = await import(conventionPath);
13062
+ const NotFoundComponent = mod.default;
13063
+ if (!NotFoundComponent)
13064
+ return null;
13065
+ const { head, body } = render(NotFoundComponent);
13066
+ const html = `<!DOCTYPE html><html><head>${head}</head><body>${body}</body></html>`;
13067
+ return new Response(html, {
13068
+ headers: { "Content-Type": "text/html" },
13069
+ status: 404
13070
+ });
13071
+ }, renderVueNotFound = async (conventionPath) => {
13072
+ const { createSSRApp, h: h2 } = await import("vue");
13073
+ const { renderToString } = await import("vue/server-renderer");
13074
+ const mod = await import(conventionPath);
13075
+ const NotFoundComponent = mod.default;
13076
+ if (!NotFoundComponent)
13077
+ return null;
13078
+ const app = createSSRApp({
13079
+ render: () => h2(NotFoundComponent)
13080
+ });
13081
+ const rawBody = await renderToString(app);
13082
+ const { styles, body } = unescapeVueStyles(rawBody);
13083
+ const html = `<!DOCTYPE html><html><head>${styles}</head><body><div id="root">${body}</div></body></html>`;
13084
+ return new Response(html, {
13085
+ headers: { "Content-Type": "text/html" },
13086
+ status: 404
13087
+ });
13088
+ }, renderAngularNotFound = async (conventionPath) => {
13089
+ const mod = await import(conventionPath);
13090
+ const renderFn = mod.default;
13091
+ if (typeof renderFn !== "function")
13092
+ return null;
13093
+ const html = renderFn();
13094
+ return new Response(html, {
13095
+ headers: { "Content-Type": "text/html" },
13096
+ status: 404
13097
+ });
13098
+ }, renderHtmlNotFound = async (conventionPath) => {
13099
+ const html = await Bun.file(conventionPath).text();
13100
+ return new Response(html, {
13101
+ headers: { "Content-Type": "text/html" },
13102
+ status: 404
13103
+ });
13104
+ }, NOT_FOUND_RENDERERS, renderConventionNotFound = async (framework) => {
13105
+ const conventionPath = resolveNotFoundConventionPath(framework);
13106
+ if (!conventionPath)
13107
+ return null;
13108
+ const renderer = NOT_FOUND_RENDERERS[framework];
13109
+ if (!renderer)
13110
+ return null;
13111
+ try {
13112
+ return await renderer(conventionPath);
13113
+ } catch (renderError) {
13114
+ logConventionRenderError(framework, "not-found", renderError);
13115
+ }
13116
+ return null;
13117
+ }, NOT_FOUND_PRIORITY, renderFirstNotFound = async () => {
13118
+ const renderNext = async (frameworks2) => {
13119
+ const [framework, ...remaining] = frameworks2;
13120
+ if (!framework) {
13121
+ return null;
13122
+ }
13123
+ if (!getMap()[framework]?.defaults?.notFound) {
13124
+ return renderNext(remaining);
13125
+ }
13126
+ const response = await renderConventionNotFound(framework);
13127
+ if (response) {
13128
+ return response;
13129
+ }
13130
+ return renderNext(remaining);
13131
+ };
13132
+ return renderNext(NOT_FOUND_PRIORITY);
13133
+ };
13134
+ var init_resolveConvention = __esm(() => {
13135
+ ERROR_RENDERERS = {
13136
+ angular: renderAngularError,
13137
+ ember: renderEmberError,
13138
+ html: renderHtmlError,
13139
+ react: renderReactError,
13140
+ svelte: renderSvelteError,
13141
+ vue: renderVueError
13142
+ };
13143
+ NOT_FOUND_RENDERERS = {
13144
+ angular: renderAngularNotFound,
13145
+ ember: renderEmberNotFound,
13146
+ html: renderHtmlNotFound,
13147
+ react: renderReactNotFound,
13148
+ svelte: renderSvelteNotFound,
13149
+ vue: renderVueNotFound
13150
+ };
13151
+ NOT_FOUND_PRIORITY = [
13152
+ "react",
13153
+ "svelte",
13154
+ "vue",
13155
+ "angular",
13156
+ "html"
13157
+ ];
13158
+ });
13159
+
13160
+ // src/utils/spaRouteManifest.ts
13161
+ import { basename as basename7 } from "path";
13162
+ var SPA_ROUTES_KEY = "__absoluteSpaRoutes", setSpaRouteManifest = (hosts) => {
13163
+ Reflect.set(globalThis, SPA_ROUTES_KEY, hosts);
13164
+ }, getSpaRouteManifest = () => {
13165
+ const value = Reflect.get(globalThis, SPA_ROUTES_KEY);
13166
+ return Array.isArray(value) ? value : [];
13167
+ }, normalizePath2 = (path) => {
13168
+ const withLeadingSlash = path.startsWith("/") ? path : `/${path}`;
13169
+ const trimmed = withLeadingSlash.replace(/\/+$/, "");
13170
+ return trimmed || "/";
13171
+ }, fullRoutePath = (baseHref, routePath) => {
13172
+ const base = normalizePath2(baseHref);
13173
+ const route = normalizePath2(routePath);
13174
+ if (base !== "/" && (route === base || route.startsWith(`${base}/`))) {
13175
+ return route;
13176
+ }
13177
+ if (base === "/")
13178
+ return route;
13179
+ return normalizePath2(`${base}/${route.replace(/^\/+/, "")}`);
13180
+ }, routePattern = (path) => {
13181
+ const segments = normalizePath2(path).split("/").filter(Boolean);
13182
+ let expression = "^";
13183
+ for (const segment of segments) {
13184
+ if (segment === "*" || segment === "**") {
13185
+ expression += "(?:/.*)?";
13186
+ continue;
13187
+ }
13188
+ const parameter = /^:[A-Za-z_$][A-Za-z0-9_$]*(?:\((.*)\))?(\?)?$/.exec(segment);
13189
+ if (parameter) {
13190
+ const valuePattern = parameter[1] || "[^/]+";
13191
+ expression += parameter[2] ? `(?:/${valuePattern})?` : `/${valuePattern}`;
13192
+ continue;
13193
+ }
13194
+ expression += `/${segment.replace(/[.+?^${}()|[\]\\]/g, "\\$&")}`;
13195
+ }
13196
+ return new RegExp(`${expression || "^/"}/?$`);
13197
+ }, sourcePageName = (sourceFile) => basename7(sourceFile).replace(/\.[^.]+$/, "").toLowerCase(), isKnownSpaRoute = (framework, pageName, request) => {
13198
+ if (!request)
13199
+ return true;
13200
+ let pathname;
13201
+ try {
13202
+ pathname = normalizePath2(new URL(request.url).pathname);
13203
+ } catch {
13204
+ return true;
13205
+ }
13206
+ const hosts = getSpaRouteManifest().filter((host) => {
13207
+ if (host.framework !== framework)
13208
+ return false;
13209
+ if (sourcePageName(host.sourceFile) !== pageName.toLowerCase())
13210
+ return false;
13211
+ const base = normalizePath2(host.baseHref);
13212
+ return base === "/" || pathname === base || pathname.startsWith(`${base}/`);
13213
+ });
13214
+ if (hosts.length === 0)
13215
+ return true;
13216
+ return hosts.some((host) => host.routes.some((route) => routePattern(fullRoutePath(host.baseHref, route.path)).test(pathname)));
13217
+ }, renderSpaNotFound = async (framework, pageName, request) => {
13218
+ if (isKnownSpaRoute(framework, pageName, request))
13219
+ return null;
13220
+ return await renderFirstNotFound() ?? new Response("Not found", {
13221
+ headers: { "Content-Type": "text/plain" },
13222
+ status: 404
13223
+ });
13224
+ };
13225
+ var init_spaRouteManifest = __esm(() => {
13226
+ init_resolveConvention();
13227
+ });
13228
+
12857
13229
  // src/build/scanVueSsrOnlyPages.ts
12858
13230
  var exports_scanVueSsrOnlyPages = {};
12859
13231
  __export(exports_scanVueSsrOnlyPages, {
@@ -13157,7 +13529,7 @@ var init_scanAngularHandlerCalls = __esm(() => {
13157
13529
 
13158
13530
  // src/build/scanAngularPageRoutes.ts
13159
13531
  import { readdirSync as readdirSync4, readFileSync as readFileSync15 } from "fs";
13160
- import { basename as basename6, join as join26 } from "path";
13532
+ import { basename as basename8, join as join26 } from "path";
13161
13533
  import ts9 from "typescript";
13162
13534
  var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
13163
13535
  const idx = filePath.lastIndexOf(".");
@@ -13167,7 +13539,7 @@ var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
13167
13539
  }, isPageFile = (filePath) => {
13168
13540
  if (!hasSourceExtension4(filePath))
13169
13541
  return false;
13170
- const base = basename6(filePath);
13542
+ const base = basename8(filePath);
13171
13543
  if (base.endsWith(".d.ts"))
13172
13544
  return false;
13173
13545
  if (base.endsWith(".test.ts"))
@@ -13233,7 +13605,7 @@ var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
13233
13605
  continue;
13234
13606
  }
13235
13607
  const hasRoutes = hasTopLevelRoutesExport(source, file);
13236
- const base = basename6(file).replace(/\.[cm]?[tj]sx?$/, "");
13608
+ const base = basename8(file).replace(/\.[cm]?[tj]sx?$/, "");
13237
13609
  const manifestKey = toPascal(base);
13238
13610
  out.push({
13239
13611
  hasRoutes,
@@ -13525,7 +13897,7 @@ import { mkdir as mkdir5, stat as stat2 } from "fs/promises";
13525
13897
  import {
13526
13898
  dirname as dirname13,
13527
13899
  join as join28,
13528
- basename as basename7,
13900
+ basename as basename9,
13529
13901
  extname as extname6,
13530
13902
  resolve as resolve19,
13531
13903
  relative as relative10,
@@ -13626,7 +13998,7 @@ var resolveDevClientDir2 = () => {
13626
13998
  client: toClient.startsWith(".") || toClient.startsWith("/") ? toClient : `./${toClient}`,
13627
13999
  server: toServer.startsWith(".") ? toServer : `./${toServer}`
13628
14000
  });
13629
- }, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev = false, stylePreprocessors) => {
14001
+ }, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev2 = false, stylePreprocessors) => {
13630
14002
  const { compile, compileModule, preprocess } = await import("svelte/compiler");
13631
14003
  const generatedDir = getFrameworkGeneratedDir("svelte");
13632
14004
  const clientDir = join28(generatedDir, "client");
@@ -13661,7 +14033,7 @@ var resolveDevClientDir2 = () => {
13661
14033
  const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedClient) : preprocessedClient;
13662
14034
  const rawRel = dirname13(relative10(svelteRoot, src)).replace(/\\/g, "/");
13663
14035
  const relDir = rawRel.startsWith("..") ? `_ext/${relative10(process.cwd(), dirname13(src)).replace(/\\/g, "/")}` : rawRel;
13664
- const baseName = basename7(src).replace(/\.svelte(\.(ts|js))?$/, "");
14036
+ const baseName = basename9(src).replace(/\.svelte(\.(ts|js))?$/, "");
13665
14037
  const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
13666
14038
  const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
13667
14039
  const resolvedImports = await Promise.all(importPaths.map((importPath) => resolveSvelte(importPath, src)));
@@ -13719,10 +14091,10 @@ var resolveDevClientDir2 = () => {
13719
14091
  },
13720
14092
  filename: src,
13721
14093
  generate: mode,
13722
- hmr: mode === "client" && isDev
14094
+ hmr: mode === "client" && isDev2
13723
14095
  }).js;
13724
14096
  let code = compiledJs.code.replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
13725
- if (mode === "client" && isDev) {
14097
+ if (mode === "client" && isDev2) {
13726
14098
  const moduleKey = `/@src/${relative10(process.cwd(), src).replace(/\\/g, "/")}`;
13727
14099
  code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
13728
14100
  if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
@@ -13773,11 +14145,11 @@ var resolveDevClientDir2 = () => {
13773
14145
  const roots = await Promise.all(entryPoints.map(build));
13774
14146
  await Promise.all(roots.map(async ({ client, hasAwaitSlot }) => {
13775
14147
  const relClientDir = dirname13(relative10(clientDir, client));
13776
- const name = basename7(client, extname6(client));
14148
+ const name = basename9(client, extname6(client));
13777
14149
  const indexPath = join28(indexDir, relClientDir, `${name}.js`);
13778
14150
  const importRaw = relative10(dirname13(indexPath), client).split(sep2).join("/");
13779
14151
  const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
13780
- const hmrImports = isDev ? `window.__HMR_FRAMEWORK__ = "svelte";
14152
+ const hmrImports = isDev2 ? `window.__HMR_FRAMEWORK__ = "svelte";
13781
14153
  import "${hmrClientPath3}";
13782
14154
  ` : "";
13783
14155
  const bootstrap = `${hmrImports}import Component from "${importPath}";
@@ -13861,7 +14233,7 @@ if (typeof window !== "undefined") {
13861
14233
  svelteClientPaths: roots.map(({ client }) => client),
13862
14234
  svelteIndexPaths: roots.map(({ client }) => {
13863
14235
  const rel = dirname13(relative10(clientDir, client));
13864
- return join28(indexDir, rel, basename7(client));
14236
+ return join28(indexDir, rel, basename9(client));
13865
14237
  }),
13866
14238
  svelteServerPaths: roots.map(({ ssr }) => ssr)
13867
14239
  };
@@ -14356,7 +14728,7 @@ __export(exports_compileVue, {
14356
14728
  import { existsSync as existsSync22, readFileSync as readFileSync18, realpathSync as realpathSync2 } from "fs";
14357
14729
  import { mkdir as mkdir6 } from "fs/promises";
14358
14730
  import {
14359
- basename as basename8,
14731
+ basename as basename10,
14360
14732
  dirname as dirname14,
14361
14733
  isAbsolute as isAbsolute4,
14362
14734
  join as join29,
@@ -14478,7 +14850,7 @@ var resolveDevClientDir3 = () => {
14478
14850
  return cachedResult;
14479
14851
  const relativeFilePath = relative11(vueRootDir, sourceFilePath).replace(/\\/g, "/");
14480
14852
  const relativeWithoutExtension = relativeFilePath.replace(/\.vue$/, "");
14481
- const fileBaseName = basename8(sourceFilePath, ".vue");
14853
+ const fileBaseName = basename10(sourceFilePath, ".vue");
14482
14854
  const componentId = toKebab(fileBaseName);
14483
14855
  const rawSourceContent = await file2(sourceFilePath).text();
14484
14856
  const sourceContent = isEntryPoint ? addAutoRouterSetupApp(rawSourceContent) : rawSourceContent;
@@ -14655,7 +15027,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
14655
15027
  cacheMap.set(sourceFilePath, result);
14656
15028
  persistentBuildCache.set(sourceFilePath, result);
14657
15029
  return result;
14658
- }, compileVue = async (entryPoints, vueRootDir, isDev = false, stylePreprocessors, ssrOnlyEntries) => {
15030
+ }, compileVue = async (entryPoints, vueRootDir, isDev2 = false, stylePreprocessors, ssrOnlyEntries) => {
14659
15031
  const compiler = await import("@vue/compiler-sfc");
14660
15032
  const generatedDir = getFrameworkGeneratedDir("vue");
14661
15033
  const clientOutputDir = join29(generatedDir, "client");
@@ -14688,11 +15060,11 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
14688
15060
  spaRoutes: result.spaRoutes
14689
15061
  };
14690
15062
  }
14691
- const entryBaseName = basename8(entryPath, ".vue");
15063
+ const entryBaseName = basename10(entryPath, ".vue");
14692
15064
  const indexOutputFile = join29(indexOutputDir, `${entryBaseName}.js`);
14693
15065
  const clientOutputFile = join29(clientOutputDir, relative11(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
14694
15066
  await mkdir6(dirname14(indexOutputFile), { recursive: true });
14695
- const vueHmrImports = isDev ? [
15067
+ const vueHmrImports = isDev2 ? [
14696
15068
  `window.__HMR_FRAMEWORK__ = "vue";`,
14697
15069
  `import "${hmrClientPath4}";`
14698
15070
  ] : [];
@@ -15387,7 +15759,7 @@ __export(exports_compileAngular, {
15387
15759
  compileAngular: () => compileAngular
15388
15760
  });
15389
15761
  import { existsSync as existsSync23, readFileSync as readFileSync19, promises as fs5 } from "fs";
15390
- import { join as join30, basename as basename9, sep as sep3, dirname as dirname15, resolve as resolve21, relative as relative12 } from "path";
15762
+ import { join as join30, basename as basename11, sep as sep3, dirname as dirname15, resolve as resolve21, relative as relative12 } from "path";
15391
15763
  var {Glob: Glob6 } = globalThis.Bun;
15392
15764
  import ts12 from "typescript";
15393
15765
  var traceAngularPhase = async (name, fn2, metadata) => {
@@ -15762,7 +16134,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
15762
16134
  const originalGetDefaultLibFileName = host.getDefaultLibFileName;
15763
16135
  host.getDefaultLibFileName = (opts) => {
15764
16136
  const fileName = originalGetDefaultLibFileName ? originalGetDefaultLibFileName(opts) : "lib.d.ts";
15765
- return basename9(fileName);
16137
+ return basename11(fileName);
15766
16138
  };
15767
16139
  const originalGetSourceFile = host.getSourceFile;
15768
16140
  host.getSourceFile = (fileName, languageVersion, onError) => {
@@ -16195,7 +16567,7 @@ ${fields}
16195
16567
  };
16196
16568
  const toOutputPath = (sourcePath) => {
16197
16569
  const inputDir = dirname15(sourcePath);
16198
- const fileBase = basename9(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
16570
+ const fileBase = basename11(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
16199
16571
  if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep3}`)) {
16200
16572
  return join30(inputDir, fileBase);
16201
16573
  }
@@ -16251,7 +16623,7 @@ ${fields}
16251
16623
  const inputDir2 = dirname15(resolved);
16252
16624
  const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
16253
16625
  const targetDir2 = join30(outDir, relativeDir2);
16254
- const targetPath2 = join30(targetDir2, basename9(resolved));
16626
+ const targetPath2 = join30(targetDir2, basename11(resolved));
16255
16627
  await fs5.mkdir(targetDir2, { recursive: true });
16256
16628
  await fs5.copyFile(resolved, targetPath2);
16257
16629
  allOutputs.push(targetPath2);
@@ -16266,7 +16638,7 @@ ${fields}
16266
16638
  const inlined = await inlineResources(sourceCode, dirname15(actualPath), stylePreprocessors);
16267
16639
  sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname15(actualPath)).source;
16268
16640
  const inputDir = dirname15(actualPath);
16269
- const fileBase = basename9(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
16641
+ const fileBase = basename11(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
16270
16642
  const targetPath = toOutputPath(actualPath);
16271
16643
  const targetDir = dirname15(targetPath);
16272
16644
  const relativeDir = relative12(outDir, targetDir).replace(/\\/g, "/");
@@ -16359,7 +16731,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
16359
16731
  let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
16360
16732
  entry: resolvedEntry
16361
16733
  }) : aotOutputs;
16362
- const fileBase = basename9(resolvedEntry).replace(/\.[tj]s$/, "");
16734
+ const fileBase = basename11(resolvedEntry).replace(/\.[tj]s$/, "");
16363
16735
  const jsName = `${fileBase}.js`;
16364
16736
  const compiledFallbackPaths = [
16365
16737
  join30(compiledRoot, relativeEntry),
@@ -19882,11 +20254,11 @@ __export(exports_compileEmber, {
19882
20254
  compileEmberFile: () => compileEmberFile,
19883
20255
  compileEmber: () => compileEmber,
19884
20256
  clearEmberCompilerCache: () => clearEmberCompilerCache,
19885
- basename: () => basename10
20257
+ basename: () => basename12
19886
20258
  });
19887
20259
  import { existsSync as existsSync25 } from "fs";
19888
20260
  import { mkdir as mkdir7, rm as rm4 } from "fs/promises";
19889
- import { basename as basename10, dirname as dirname17, extname as extname8, join as join31, resolve as resolve23 } from "path";
20261
+ import { basename as basename12, dirname as dirname17, extname as extname8, join as join31, resolve as resolve23 } from "path";
19890
20262
  var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file3 } = globalThis.Bun;
19891
20263
  var cachedPreprocessor = null, getPreprocessor = async () => {
19892
20264
  if (cachedPreprocessor)
@@ -20052,7 +20424,7 @@ export default PageComponent;
20052
20424
  preprocessed = rewriteTemplateEvalToScope(result.code);
20053
20425
  }
20054
20426
  const transpiled = transpiler5.transformSync(preprocessed);
20055
- const baseName = basename10(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
20427
+ const baseName = basename12(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
20056
20428
  const tmpDir = join31(compiledRoot, "_tmp");
20057
20429
  const serverDir = join31(compiledRoot, "server");
20058
20430
  const clientDir = join31(compiledRoot, "client");
@@ -20621,10 +20993,10 @@ import {
20621
20993
  statSync as statSync3,
20622
20994
  writeFileSync as writeFileSync8
20623
20995
  } from "fs";
20624
- import { basename as basename11, dirname as dirname18, extname as extname9, join as join36, relative as relative14, resolve as resolve25 } from "path";
20996
+ import { basename as basename13, dirname as dirname18, extname as extname9, join as join36, relative as relative14, resolve as resolve25 } from "path";
20625
20997
  import { cwd, env as env2, exit } from "process";
20626
20998
  var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
20627
- var isDev, isBuildTraceEnabled = () => {
20999
+ var isDev2, isBuildTraceEnabled = () => {
20628
21000
  const value = env2.ABSOLUTE_BUILD_TRACE?.toLowerCase();
20629
21001
  return value === "1" || value === "true" || value === "yes";
20630
21002
  }, collectConventionSourceFiles = (entry) => {
@@ -20801,7 +21173,7 @@ var isDev, isBuildTraceEnabled = () => {
20801
21173
  const svelteIndexDir = join36(getFrameworkGeneratedDir("svelte"), "indexes");
20802
21174
  const sveltePageEntries = svelteEntries.filter((file4) => resolve25(file4).startsWith(resolve25(sveltePagesPath)));
20803
21175
  for (const entry of sveltePageEntries) {
20804
- const name = basename11(entry).replace(/\.svelte(\.(ts|js))?$/, "");
21176
+ const name = basename13(entry).replace(/\.svelte(\.(ts|js))?$/, "");
20805
21177
  const indexFile = join36(svelteIndexDir, "pages", `${name}.js`);
20806
21178
  if (!existsSync27(indexFile))
20807
21179
  continue;
@@ -20814,7 +21186,7 @@ var isDev, isBuildTraceEnabled = () => {
20814
21186
  const vueIndexDir = join36(getFrameworkGeneratedDir("vue"), "indexes");
20815
21187
  const vuePageEntries = vueEntries.filter((file4) => resolve25(file4).startsWith(resolve25(vuePagesPath)));
20816
21188
  for (const entry of vuePageEntries) {
20817
- const name = basename11(entry, ".vue");
21189
+ const name = basename13(entry, ".vue");
20818
21190
  const indexFile = join36(vueIndexDir, `${name}.js`);
20819
21191
  if (!existsSync27(indexFile))
20820
21192
  continue;
@@ -20895,7 +21267,7 @@ ${content.slice(firstUseIdx)}`;
20895
21267
  const urlFileMap = new Map;
20896
21268
  for (const srcPath of urlReferencedFiles) {
20897
21269
  const rel = relative14(projectRoot, srcPath).replace(/\\/g, "/");
20898
- const name = basename11(srcPath);
21270
+ const name = basename13(srcPath);
20899
21271
  const mtime = Math.round(statSync3(srcPath).mtimeMs);
20900
21272
  const url = `/@src/${rel}?v=${mtime}`;
20901
21273
  urlFileMap.set(name, url);
@@ -20905,11 +21277,11 @@ ${content.slice(firstUseIdx)}`;
20905
21277
  }, buildProdUrlFileMap = (urlReferencedFiles, buildPath, nonReactClientOutputs) => {
20906
21278
  const urlFileMap = new Map;
20907
21279
  for (const srcPath of urlReferencedFiles) {
20908
- const srcBase = basename11(srcPath).replace(/\.[^.]+$/, "");
20909
- const output = nonReactClientOutputs.find((artifact) => basename11(artifact.path).startsWith(`${srcBase}.`));
21280
+ const srcBase = basename13(srcPath).replace(/\.[^.]+$/, "");
21281
+ const output = nonReactClientOutputs.find((artifact) => basename13(artifact.path).startsWith(`${srcBase}.`));
20910
21282
  if (!output)
20911
21283
  continue;
20912
- urlFileMap.set(basename11(srcPath), `/${relative14(buildPath, output.path).replace(/\\/g, "/")}`);
21284
+ urlFileMap.set(basename13(srcPath), `/${relative14(buildPath, output.path).replace(/\\/g, "/")}`);
20913
21285
  }
20914
21286
  return urlFileMap;
20915
21287
  }, buildUrlFileMap = (urlReferencedFiles, hmr, projectRoot, buildPath, nonReactClientOutputs) => {
@@ -20922,7 +21294,7 @@ ${content.slice(firstUseIdx)}`;
20922
21294
  let content = readFileSync21(outputPath, "utf-8");
20923
21295
  let changed = false;
20924
21296
  content = content.replace(urlPattern, (_match, relPath) => {
20925
- const targetName = basename11(relPath);
21297
+ const targetName = basename13(relPath);
20926
21298
  const resolvedPath = urlFileMap.get(targetName);
20927
21299
  if (!resolvedPath)
20928
21300
  return _match;
@@ -20954,8 +21326,8 @@ ${content.slice(firstUseIdx)}`;
20954
21326
  ...config.default ?? {},
20955
21327
  ...config[pass] ?? {}
20956
21328
  }, locked);
20957
- }, resolveClientSourcemap = (sourcemaps, isDev2) => {
20958
- if (isDev2)
21329
+ }, resolveClientSourcemap = (sourcemaps, isDev3) => {
21330
+ if (isDev3)
20959
21331
  return sourcemaps === false ? "none" : "inline";
20960
21332
  if (sourcemaps === "external" || sourcemaps === true)
20961
21333
  return "external";
@@ -21060,7 +21432,7 @@ ${content.slice(firstUseIdx)}`;
21060
21432
  events: traceEvents,
21061
21433
  frameworks: traceFrameworkNames,
21062
21434
  generatedAt: new Date().toISOString(),
21063
- mode: mode ?? (isDev ? "development" : "production"),
21435
+ mode: mode ?? (isDev2 ? "development" : "production"),
21064
21436
  totalDurationMs: performance.now() - buildStart,
21065
21437
  version: 1
21066
21438
  }, null, 2));
@@ -21119,7 +21491,7 @@ ${content.slice(firstUseIdx)}`;
21119
21491
  sendTelemetryEvent("build:start", {
21120
21492
  framework: frameworkNames[0],
21121
21493
  frameworks: frameworkNames,
21122
- mode: mode ?? (isDev ? "development" : "production"),
21494
+ mode: mode ?? (isDev2 ? "development" : "production"),
21123
21495
  tailwind: Boolean(tailwind)
21124
21496
  });
21125
21497
  const generatedRoot = getGeneratedRoot(projectRoot);
@@ -21155,7 +21527,7 @@ ${content.slice(firstUseIdx)}`;
21155
21527
  if (!firstEntry)
21156
21528
  throw new Error("Expected at least one server directory entry");
21157
21529
  serverRoot = join36(firstEntry.dir, firstEntry.subdir);
21158
- serverOutDir = join36(buildPath, basename11(firstEntry.dir));
21530
+ serverOutDir = join36(buildPath, basename13(firstEntry.dir));
21159
21531
  } else if (serverDirMap.length > 1) {
21160
21532
  serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
21161
21533
  serverOutDir = buildPath;
@@ -21297,7 +21669,7 @@ ${content.slice(firstUseIdx)}`;
21297
21669
  mkdirSync12(htmlConventionsOutDir, { recursive: true });
21298
21670
  const htmlPathRemap = new Map;
21299
21671
  for (const sourcePath of htmlConventionSources) {
21300
- const dest = join36(htmlConventionsOutDir, basename11(sourcePath));
21672
+ const dest = join36(htmlConventionsOutDir, basename13(sourcePath));
21301
21673
  cpSync(sourcePath, dest, { force: true });
21302
21674
  htmlPathRemap.set(sourcePath, dest);
21303
21675
  }
@@ -21339,7 +21711,7 @@ ${content.slice(firstUseIdx)}`;
21339
21711
  const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
21340
21712
  const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
21341
21713
  if (entry.startsWith(resolve25(reactIndexesPath))) {
21342
- const pageName = basename11(entry, ".tsx");
21714
+ const pageName = basename13(entry, ".tsx");
21343
21715
  return join36(reactPagesPath, `${pageName}.tsx`);
21344
21716
  }
21345
21717
  return null;
@@ -21370,7 +21742,7 @@ ${content.slice(firstUseIdx)}`;
21370
21742
  return new Set;
21371
21743
  const resolved = new Set;
21372
21744
  for (const entry of vueEntries) {
21373
- const name = basename11(entry, ".vue");
21745
+ const name = basename13(entry, ".vue");
21374
21746
  if (ssrOnlyPageNames.has(name)) {
21375
21747
  resolved.add(resolve25(entry));
21376
21748
  }
@@ -21543,7 +21915,7 @@ ${content.slice(firstUseIdx)}`;
21543
21915
  entrypoints: [source],
21544
21916
  format: "esm",
21545
21917
  jsx: { development: false },
21546
- minify: !isDev,
21918
+ minify: !isDev2,
21547
21919
  naming: `${idx}-[name].[ext]`,
21548
21920
  outdir: destDir,
21549
21921
  plugins: [stylePreprocessorPlugin2],
@@ -21583,11 +21955,11 @@ ${content.slice(firstUseIdx)}`;
21583
21955
  const compiledPath = compiledPaths[idx];
21584
21956
  if (!compiledPath)
21585
21957
  continue;
21586
- const name = basename11(compiledPath).replace(/\.[^.]+$/, "");
21958
+ const name = basename13(compiledPath).replace(/\.[^.]+$/, "");
21587
21959
  const result = await bunBuild7({
21588
21960
  entrypoints: [compiledPath],
21589
21961
  format: "esm",
21590
- minify: !isDev,
21962
+ minify: !isDev2,
21591
21963
  naming: `${idx}-${name}.[ext]`,
21592
21964
  outdir: destDir,
21593
21965
  splitting: false,
@@ -21672,7 +22044,7 @@ ${content.slice(firstUseIdx)}`;
21672
22044
  },
21673
22045
  frameworks: frameworkNames,
21674
22046
  incremental: Boolean(isIncremental),
21675
- mode: mode ?? (isDev ? "development" : "production"),
22047
+ mode: mode ?? (isDev2 ? "development" : "production"),
21676
22048
  scannedEntries: {
21677
22049
  angular: allAngularEntries.length,
21678
22050
  html: allHtmlEntries.length,
@@ -21792,7 +22164,7 @@ ${content.slice(firstUseIdx)}`;
21792
22164
  entrypoints: reactClientEntryPoints,
21793
22165
  ...Object.keys(reactExternalPaths).length > 0 ? { external: Object.keys(reactExternalPaths) } : {},
21794
22166
  format: "esm",
21795
- minify: !isDev,
22167
+ minify: !isDev2,
21796
22168
  naming: `[dir]/[name].[hash].[ext]`,
21797
22169
  outdir: buildPath,
21798
22170
  ...hmr ? {
@@ -21804,7 +22176,7 @@ ${content.slice(firstUseIdx)}`;
21804
22176
  ...islandRegistryPlugins
21805
22177
  ],
21806
22178
  root: clientRoot,
21807
- sourcemap: resolveClientSourcemap(sourcemaps, isDev),
22179
+ sourcemap: resolveClientSourcemap(sourcemaps, isDev2),
21808
22180
  splitting: true,
21809
22181
  target: "browser",
21810
22182
  throw: false
@@ -21850,7 +22222,7 @@ ${content.slice(firstUseIdx)}`;
21850
22222
  ] : []
21851
22223
  ],
21852
22224
  root: serverRoot,
21853
- sourcemap: isDev ? "inline" : "none",
22225
+ sourcemap: isDev2 ? "inline" : "none",
21854
22226
  target: "bun",
21855
22227
  throw: false,
21856
22228
  tsconfig: "./tsconfig.json"
@@ -21862,7 +22234,7 @@ ${content.slice(firstUseIdx)}`;
21862
22234
  entrypoints: nonReactClientEntryPoints,
21863
22235
  external: Object.keys(nonReactExternalPaths),
21864
22236
  format: "esm",
21865
- minify: !isDev,
22237
+ minify: !isDev2,
21866
22238
  naming: `[dir]/[name].[hash].[ext]`,
21867
22239
  outdir: buildPath,
21868
22240
  plugins: [
@@ -21879,8 +22251,8 @@ ${content.slice(firstUseIdx)}`;
21879
22251
  ...htmlScriptPlugin ? [htmlScriptPlugin] : []
21880
22252
  ],
21881
22253
  root: clientRoot,
21882
- sourcemap: resolveClientSourcemap(sourcemaps, isDev),
21883
- splitting: !isDev,
22254
+ sourcemap: resolveClientSourcemap(sourcemaps, isDev2),
22255
+ splitting: !isDev2,
21884
22256
  target: "browser",
21885
22257
  throw: false,
21886
22258
  tsconfig: "./tsconfig.json"
@@ -21891,7 +22263,7 @@ ${content.slice(firstUseIdx)}`;
21891
22263
  entrypoints: islandClientEntryPoints,
21892
22264
  external: Object.keys(nonReactExternalPaths),
21893
22265
  format: "esm",
21894
- minify: !isDev,
22266
+ minify: !isDev2,
21895
22267
  naming: `[dir]/[name].[hash].[ext]`,
21896
22268
  outdir: buildPath,
21897
22269
  plugins: [
@@ -21907,8 +22279,8 @@ ${content.slice(firstUseIdx)}`;
21907
22279
  ...angularDir ? [createAngularLinkerPlugin(hmr)] : []
21908
22280
  ],
21909
22281
  root: islandEntryResult.generatedRoot,
21910
- sourcemap: resolveClientSourcemap(sourcemaps, isDev),
21911
- splitting: !isDev,
22282
+ sourcemap: resolveClientSourcemap(sourcemaps, isDev2),
22283
+ splitting: !isDev2,
21912
22284
  target: "browser",
21913
22285
  throw: false,
21914
22286
  tsconfig: "./tsconfig.json"
@@ -21916,7 +22288,7 @@ ${content.slice(firstUseIdx)}`;
21916
22288
  globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
21917
22289
  entrypoints: globalCssEntries,
21918
22290
  naming: `[dir]/[name].[hash].[ext]`,
21919
- outdir: stylesDir ? join36(buildPath, basename11(stylesDir)) : buildPath,
22291
+ outdir: stylesDir ? join36(buildPath, basename13(stylesDir)) : buildPath,
21920
22292
  plugins: [stylePreprocessorPlugin2],
21921
22293
  root: stylesDir || clientRoot,
21922
22294
  target: "browser",
@@ -21925,28 +22297,28 @@ ${content.slice(firstUseIdx)}`;
21925
22297
  vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
21926
22298
  entrypoints: vueCssPaths,
21927
22299
  naming: `[name].[hash].[ext]`,
21928
- outdir: join36(buildPath, assetsPath ? basename11(assetsPath) : "assets", "css"),
22300
+ outdir: join36(buildPath, assetsPath ? basename13(assetsPath) : "assets", "css"),
21929
22301
  target: "browser",
21930
22302
  throw: false
21931
22303
  }, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
21932
22304
  ]);
21933
22305
  const serverLogs = serverResult?.logs ?? [];
21934
22306
  const serverOutputs = serverResult?.outputs ?? [];
21935
- if (isDev && serverResult?.success) {
22307
+ if (isDev2 && serverResult?.success) {
21936
22308
  const { chainBundleInlineSourcemap: chainBundleInlineSourcemap2 } = await Promise.resolve().then(() => (init_chainInlineSourcemaps(), exports_chainInlineSourcemaps));
21937
22309
  for (const out of serverOutputs) {
21938
22310
  if (out.path.endsWith(".js"))
21939
22311
  chainBundleInlineSourcemap2(out.path);
21940
22312
  }
21941
22313
  }
21942
- if (!isDev && resolveClientSourcemap(sourcemaps, isDev) === "external") {
22314
+ if (!isDev2 && resolveClientSourcemap(sourcemaps, isDev2) === "external") {
21943
22315
  const { chainExternalSourcemap: chainExternalSourcemap2 } = await Promise.resolve().then(() => (init_chainInlineSourcemaps(), exports_chainInlineSourcemaps));
21944
22316
  const sourcemapDir = join36(projectRoot, "sourcemaps");
21945
22317
  mkdirSync12(sourcemapDir, { recursive: true });
21946
22318
  const mapFiles = readdirSync5(buildPath, { recursive: true }).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) => join36(buildPath, entry));
21947
22319
  for (const mapPath of mapFiles) {
21948
22320
  chainExternalSourcemap2(mapPath);
21949
- renameSync(mapPath, join36(sourcemapDir, basename11(mapPath)));
22321
+ renameSync(mapPath, join36(sourcemapDir, basename13(mapPath)));
21950
22322
  const jsPath = mapPath.slice(0, -4);
21951
22323
  try {
21952
22324
  const js = readFileSync21(jsPath, "utf-8").replace(/\n?\/\/# sourceMappingURL=[^\n]*\s*$/, `
@@ -22075,7 +22447,7 @@ ${content.slice(firstUseIdx)}`;
22075
22447
  for (const artifact of serverOutputs) {
22076
22448
  if (extname9(artifact.path) !== ".js")
22077
22449
  continue;
22078
- const fileWithHash = basename11(artifact.path);
22450
+ const fileWithHash = basename13(artifact.path);
22079
22451
  const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
22080
22452
  if (!baseName)
22081
22453
  continue;
@@ -22095,7 +22467,7 @@ ${content.slice(firstUseIdx)}`;
22095
22467
  for (const artifact of cssOutputs) {
22096
22468
  if (extname9(artifact.path) !== ".css")
22097
22469
  continue;
22098
- const cssName = stripHash(basename11(artifact.path), artifact.hash);
22470
+ const cssName = stripHash(basename13(artifact.path), artifact.hash);
22099
22471
  if (cssName)
22100
22472
  cssByName.set(cssName, artifact);
22101
22473
  }
@@ -22105,7 +22477,7 @@ ${content.slice(firstUseIdx)}`;
22105
22477
  await Promise.all(serverOutputs.map(async (artifact) => {
22106
22478
  if (extname9(artifact.path) !== ".js")
22107
22479
  return;
22108
- const pascalName = stripHash(basename11(artifact.path), artifact.hash);
22480
+ const pascalName = stripHash(basename13(artifact.path), artifact.hash);
22109
22481
  if (!pascalName)
22110
22482
  return;
22111
22483
  serverJsByPascalName.set(pascalName, artifact);
@@ -22120,14 +22492,14 @@ ${content.slice(firstUseIdx)}`;
22120
22492
  const spaSideManifestPaths = [];
22121
22493
  if (vueSpaRoutesBySource && vueSpaRoutesBySource.size > 0) {
22122
22494
  await Promise.all([...vueSpaRoutesBySource.entries()].map(async ([source, routes]) => {
22123
- const parentName = basename11(source, ".vue");
22495
+ const parentName = basename13(source, ".vue");
22124
22496
  const parentArtifact = serverJsByPascalName.get(parentName);
22125
22497
  if (!parentArtifact)
22126
22498
  return;
22127
22499
  const sourceDir = dirname18(source);
22128
22500
  const entries = routes.flatMap(({ path, importPath }) => {
22129
22501
  const childSourcePath = resolve25(sourceDir, importPath);
22130
- const childName = basename11(childSourcePath, ".vue");
22502
+ const childName = basename13(childSourcePath, ".vue");
22131
22503
  const childArtifact = serverJsByPascalName.get(childName);
22132
22504
  if (!childArtifact)
22133
22505
  return [];
@@ -22144,12 +22516,12 @@ ${content.slice(firstUseIdx)}`;
22144
22516
  }));
22145
22517
  }
22146
22518
  for (const serverPath of emberServerPaths) {
22147
- const fileBase = basename11(serverPath, ".js");
22519
+ const fileBase = basename13(serverPath, ".js");
22148
22520
  manifest[toPascal(fileBase)] = serverPath;
22149
22521
  }
22150
22522
  if (skipAngularClientBundle) {
22151
22523
  for (const clientPath of angularClientPaths) {
22152
- const fileBase = basename11(clientPath, ".js");
22524
+ const fileBase = basename13(clientPath, ".js");
22153
22525
  const relFromCwd = relative14(projectRoot, clientPath).replace(/\\/g, "/");
22154
22526
  manifest[`${toPascal(fileBase)}Index`] = `/@src/${relFromCwd}`;
22155
22527
  }
@@ -22175,7 +22547,7 @@ ${content.slice(firstUseIdx)}`;
22175
22547
  const processHtmlPages = async () => {
22176
22548
  if (!(htmlDir && htmlPagesPath))
22177
22549
  return;
22178
- const outputHtmlPages = isSingle ? join36(buildPath, "pages") : join36(buildPath, basename11(htmlDir), "pages");
22550
+ const outputHtmlPages = isSingle ? join36(buildPath, "pages") : join36(buildPath, basename13(htmlDir), "pages");
22179
22551
  mkdirSync12(outputHtmlPages, { recursive: true });
22180
22552
  cpSync(htmlPagesPath, outputHtmlPages, {
22181
22553
  force: true,
@@ -22190,7 +22562,7 @@ ${content.slice(firstUseIdx)}`;
22190
22562
  for (const htmlFile of htmlPageFiles) {
22191
22563
  if (hmr)
22192
22564
  injectHMRIntoHTMLFile(htmlFile, "html");
22193
- const fileName = basename11(htmlFile, ".html");
22565
+ const fileName = basename13(htmlFile, ".html");
22194
22566
  if (manifest[fileName] && manifest[fileName] !== htmlFile) {
22195
22567
  warnManifestKeyCollision(fileName, manifest[fileName], htmlFile);
22196
22568
  }
@@ -22200,14 +22572,14 @@ ${content.slice(firstUseIdx)}`;
22200
22572
  const processHtmxPages = async () => {
22201
22573
  if (!(htmxDir && htmxPagesPath))
22202
22574
  return;
22203
- const outputHtmxPages = isSingle ? join36(buildPath, "pages") : join36(buildPath, basename11(htmxDir), "pages");
22575
+ const outputHtmxPages = isSingle ? join36(buildPath, "pages") : join36(buildPath, basename13(htmxDir), "pages");
22204
22576
  mkdirSync12(outputHtmxPages, { recursive: true });
22205
22577
  cpSync(htmxPagesPath, outputHtmxPages, {
22206
22578
  force: true,
22207
22579
  recursive: true
22208
22580
  });
22209
22581
  if (shouldCopyHtmx) {
22210
- const htmxDestDir = isSingle ? buildPath : join36(buildPath, basename11(htmxDir));
22582
+ const htmxDestDir = isSingle ? buildPath : join36(buildPath, basename13(htmxDir));
22211
22583
  copyHtmxVendor(htmxDir, htmxDestDir);
22212
22584
  }
22213
22585
  if (shouldUpdateHtmxAssetPaths) {
@@ -22219,7 +22591,7 @@ ${content.slice(firstUseIdx)}`;
22219
22591
  for (const htmxFile of htmxPageFiles) {
22220
22592
  if (hmr)
22221
22593
  injectHMRIntoHTMLFile(htmxFile, "htmx");
22222
- const fileName = basename11(htmxFile, ".html");
22594
+ const fileName = basename13(htmxFile, ".html");
22223
22595
  if (manifest[fileName] && manifest[fileName] !== htmxFile) {
22224
22596
  warnManifestKeyCollision(fileName, manifest[fileName], htmxFile);
22225
22597
  }
@@ -22268,8 +22640,31 @@ ${content.slice(firstUseIdx)}`;
22268
22640
  sendTelemetryEvent("build:complete", {
22269
22641
  durationMs: Math.round(performance.now() - buildStart),
22270
22642
  frameworks: frameworkNames,
22271
- mode: mode ?? (isDev ? "development" : "production")
22643
+ mode: mode ?? (isDev2 ? "development" : "production")
22272
22644
  });
22645
+ const [reactSpaHosts, svelteSpaHosts, vueSpaHosts, angularSpaHosts] = await Promise.all([
22646
+ reactDir ? Promise.resolve().then(() => (init_staticAnalyzeSpaRoutes2(), exports_staticAnalyzeSpaRoutes2)).then((module) => module.analyzeReactSpaRoutes(reactDir)) : [],
22647
+ svelteDir ? Promise.resolve().then(() => (init_staticAnalyzeSpaRoutes3(), exports_staticAnalyzeSpaRoutes3)).then((module) => module.analyzeSvelteSpaRoutes(svelteDir)) : [],
22648
+ vueDir ? Promise.resolve().then(() => (init_staticAnalyzeSpaRoutes4(), exports_staticAnalyzeSpaRoutes4)).then((module) => module.analyzeVueSpaRoutes(vueDir)) : [],
22649
+ angularDir ? Promise.resolve().then(() => (init_staticAnalyzeSpaRoutes(), exports_staticAnalyzeSpaRoutes)).then((module) => module.analyzeAngularSpaRoutes(angularDir)) : []
22650
+ ]);
22651
+ const spaRouteHosts = [
22652
+ ...reactSpaHosts.map((host) => ({
22653
+ ...host,
22654
+ framework: "react"
22655
+ })),
22656
+ ...svelteSpaHosts.map((host) => ({
22657
+ ...host,
22658
+ framework: "svelte"
22659
+ })),
22660
+ ...vueSpaHosts.map((host) => ({ ...host, framework: "vue" })),
22661
+ ...angularSpaHosts.map((host) => ({
22662
+ ...host,
22663
+ framework: "angular"
22664
+ }))
22665
+ ];
22666
+ setSpaRouteManifest(spaRouteHosts);
22667
+ writeFileSync8(join36(buildPath, "spa-routes.json"), JSON.stringify(spaRouteHosts, null, "\t"));
22273
22668
  if (isIncremental) {
22274
22669
  writeBuildTrace(buildPath);
22275
22670
  return { conventions: conventionsMap, manifest };
@@ -22339,7 +22734,8 @@ var init_build = __esm(() => {
22339
22734
  init_buildDirectoryLock();
22340
22735
  init_logger();
22341
22736
  init_validateSafePath();
22342
- isDev = env2.NODE_ENV === "development";
22737
+ init_spaRouteManifest();
22738
+ isDev2 = env2.NODE_ENV === "development";
22343
22739
  SKIP_DIRS5 = new Set([
22344
22740
  "build",
22345
22741
  "node_modules",
@@ -22370,8 +22766,8 @@ var init_build = __esm(() => {
22370
22766
  ].join("");
22371
22767
  vueFeatureFlags = {
22372
22768
  __VUE_OPTIONS_API__: "true",
22373
- __VUE_PROD_DEVTOOLS__: isDev ? "true" : "false",
22374
- __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: isDev ? "true" : "false"
22769
+ __VUE_PROD_DEVTOOLS__: isDev2 ? "true" : "false",
22770
+ __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: isDev2 ? "true" : "false"
22375
22771
  };
22376
22772
  bunBuildPassKeys = [
22377
22773
  "server",
@@ -23652,7 +24048,7 @@ var classifyComponent = (filePath) => {
23652
24048
  var init_reactComponentClassifier = () => {};
23653
24049
 
23654
24050
  // src/dev/moduleMapper.ts
23655
- import { basename as basename12, resolve as resolve33 } from "path";
24051
+ import { basename as basename14, resolve as resolve33 } from "path";
23656
24052
  var buildModulePaths = (moduleKeys, manifest) => {
23657
24053
  const modulePaths = {};
23658
24054
  moduleKeys.forEach((key) => {
@@ -23699,7 +24095,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
23699
24095
  return grouped;
23700
24096
  }, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
23701
24097
  const normalizedFile = resolve33(sourceFile);
23702
- const fileName = basename12(normalizedFile);
24098
+ const fileName = basename14(normalizedFile);
23703
24099
  const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
23704
24100
  const pascalName = toPascal(baseName);
23705
24101
  const keys = [];
@@ -24275,7 +24671,7 @@ __export(exports_moduleServer, {
24275
24671
  SRC_URL_PREFIX: () => SRC_URL_PREFIX
24276
24672
  });
24277
24673
  import { existsSync as existsSync32, readFileSync as readFileSync27, realpathSync as realpathSync3, statSync as statSync6 } from "fs";
24278
- import { basename as basename13, dirname as dirname23, extname as extname11, join as join40, resolve as resolve36, relative as relative15 } from "path";
24674
+ import { basename as basename15, dirname as dirname23, extname as extname11, join as join40, resolve as resolve36, relative as relative15 } from "path";
24279
24675
  var SRC_PREFIX = "/@src/", jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
24280
24676
  const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
24281
24677
  const allExports = [];
@@ -24708,7 +25104,7 @@ ${code}`;
24708
25104
  if (!vueCompiler) {
24709
25105
  vueCompiler = await import("@vue/compiler-sfc");
24710
25106
  }
24711
- const fileName = basename13(filePath, ".vue");
25107
+ const fileName = basename15(filePath, ".vue");
24712
25108
  const componentId = toKebab(fileName);
24713
25109
  const { descriptor } = vueCompiler.parse(raw, { filename: filePath });
24714
25110
  const hasScript = descriptor.script || descriptor.scriptSetup;
@@ -25473,7 +25869,7 @@ var init_simpleHTMXHMR = () => {};
25473
25869
 
25474
25870
  // src/dev/rebuildTrigger.ts
25475
25871
  import { existsSync as existsSync33, rmSync as rmSync3 } from "fs";
25476
- import { basename as basename14, dirname as dirname25, join as join41, relative as relative17, resolve as resolve40, sep as sep4 } from "path";
25872
+ import { basename as basename16, dirname as dirname25, join as join41, relative as relative17, resolve as resolve40, sep as sep4 } from "path";
25477
25873
  var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequentially = (items, action) => items.reduce((chain, item) => chain.then(() => action(item)), Promise.resolve()), getStyleTransformConfig = (config) => createStyleTransformConfig(config.stylePreprocessors, config.postcss), recompileTailwindForFastPath = async (state, config, files) => {
25478
25874
  if (!config.tailwind)
25479
25875
  return;
@@ -25974,7 +26370,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
25974
26370
  if (serverDirs.length <= 1) {
25975
26371
  const dir = getFrameworkGeneratedDir2(framework, projectRoot);
25976
26372
  return {
25977
- serverOutDir: resolve40(resolvedPaths.buildDir, basename14(dir)),
26373
+ serverOutDir: resolve40(resolvedPaths.buildDir, basename16(dir)),
25978
26374
  serverRoot: resolve40(dir, "server")
25979
26375
  };
25980
26376
  }
@@ -25983,7 +26379,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
25983
26379
  serverRoot: commonAncestor2(serverDirs.map((entry) => entry.dir), projectRoot)
25984
26380
  };
25985
26381
  }, updateServerManifestEntry = (state, artifact) => {
25986
- const fileWithHash = basename14(artifact.path);
26382
+ const fileWithHash = basename16(artifact.path);
25987
26383
  const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
25988
26384
  if (!baseName) {
25989
26385
  return;
@@ -25997,7 +26393,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
25997
26393
  const prefixByDir = new Map;
25998
26394
  for (const artifact of freshOutputs) {
25999
26395
  const dir = dirname25(artifact.path);
26000
- const name = basename14(artifact.path);
26396
+ const name = basename16(artifact.path);
26001
26397
  const [prefix] = name.split(".");
26002
26398
  if (!prefix)
26003
26399
  continue;
@@ -26483,7 +26879,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
26483
26879
  await rewriteImports3(ssrPaths, angServerVendorPaths);
26484
26880
  }
26485
26881
  serverPaths.forEach((serverPath, idx) => {
26486
- const fileBase = basename14(serverPath, ".js");
26882
+ const fileBase = basename16(serverPath, ".js");
26487
26883
  const ssrPath = ssrPaths[idx] ?? serverPath;
26488
26884
  state.manifest[toPascal(fileBase)] = resolve40(ssrPath);
26489
26885
  });
@@ -26846,7 +27242,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
26846
27242
  const duration = Date.now() - startTime;
26847
27243
  const broadcastFiles = svelteFiles.length > 0 ? svelteFiles : filesToRebuild;
26848
27244
  broadcastFiles.forEach((sveltePagePath) => {
26849
- const fileName = basename14(sveltePagePath);
27245
+ const fileName = basename16(sveltePagePath);
26850
27246
  const baseName = fileName.replace(/\.svelte$/, "");
26851
27247
  const pascalName = toPascal(baseName);
26852
27248
  const cssKey = `${pascalName}CSS`;
@@ -26926,7 +27322,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
26926
27322
  const { vueServerPaths, vueIndexPaths, vueClientPaths, vueCssPaths } = await compileVue2(vueFiles, vueDir, true, getStyleTransformConfig(state.config));
26927
27323
  const serverEntries = [...vueServerPaths];
26928
27324
  const clientEntries = [...vueIndexPaths, ...vueClientPaths];
26929
- const cssOutDir = join41(buildDir, state.resolvedPaths.assetsDir ? basename14(state.resolvedPaths.assetsDir) : "assets", "css");
27325
+ const cssOutDir = join41(buildDir, state.resolvedPaths.assetsDir ? basename16(state.resolvedPaths.assetsDir) : "assets", "css");
26930
27326
  const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "vue");
26931
27327
  const [serverResult, clientResult, cssResult] = await Promise.all([
26932
27328
  serverEntries.length > 0 ? bunBuild9({
@@ -27074,7 +27470,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
27074
27470
  const { compileEmber: compileEmber2 } = await Promise.resolve().then(() => (init_compileEmber(), exports_compileEmber));
27075
27471
  const { serverPaths } = await compileEmber2(allPageEntries, emberDir, process.cwd(), true);
27076
27472
  for (const serverPath of serverPaths) {
27077
- const fileBase = basename14(serverPath, ".js");
27473
+ const fileBase = basename16(serverPath, ".js");
27078
27474
  state.manifest[toPascal(fileBase)] = resolve40(serverPath);
27079
27475
  }
27080
27476
  const { invalidateEmberSsrCache: invalidateEmberSsrCache2 } = await Promise.resolve().then(() => (init_ember(), exports_ember));
@@ -27145,7 +27541,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
27145
27541
  });
27146
27542
  }
27147
27543
  }, handleScriptUpdate = (state, scriptFile, manifest, framework, duration) => {
27148
- const scriptBaseName = basename14(scriptFile).replace(/\.(ts|js|tsx|jsx)$/, "");
27544
+ const scriptBaseName = basename16(scriptFile).replace(/\.(ts|js|tsx|jsx)$/, "");
27149
27545
  const pascalName = toPascal(scriptBaseName);
27150
27546
  const scriptPath = manifest[pascalName] || null;
27151
27547
  if (!scriptPath) {
@@ -27224,7 +27620,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
27224
27620
  if (isSingle) {
27225
27621
  return resolve40(state.resolvedPaths.buildDir, "pages");
27226
27622
  }
27227
- const dirName = framework === "html" ? basename14(config.htmlDirectory ?? "html") : basename14(config.htmxDirectory ?? "htmx");
27623
+ const dirName = framework === "html" ? basename16(config.htmlDirectory ?? "html") : basename16(config.htmxDirectory ?? "htmx");
27228
27624
  return resolve40(state.resolvedPaths.buildDir, dirName, "pages");
27229
27625
  }, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
27230
27626
  try {
@@ -27263,7 +27659,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
27263
27659
  const shouldRefreshAllPages = htmlPageFiles.length === 0 && shouldRefreshFromIslandChange;
27264
27660
  const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
27265
27661
  await runSequentially(pageFilesToUpdate, async (pageFile) => {
27266
- const htmlPageName = basename14(pageFile);
27662
+ const htmlPageName = basename16(pageFile);
27267
27663
  const builtHtmlPagePath = resolve40(outputHtmlPages, htmlPageName);
27268
27664
  await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
27269
27665
  });
@@ -27272,7 +27668,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
27272
27668
  if (!cssFile) {
27273
27669
  return;
27274
27670
  }
27275
- const cssBaseName = basename14(getStyleBaseName(cssFile));
27671
+ const cssBaseName = basename16(getStyleBaseName(cssFile));
27276
27672
  const cssPascalName = toPascal(cssBaseName);
27277
27673
  const cssKey = `${cssPascalName}CSS`;
27278
27674
  const cssUrl = manifest[cssKey] || null;
@@ -27321,7 +27717,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
27321
27717
  type: "vue-update"
27322
27718
  });
27323
27719
  }, broadcastVuePageChange = async (state, config, vuePagePath, manifest, duration) => {
27324
- const fileName = basename14(vuePagePath);
27720
+ const fileName = basename16(vuePagePath);
27325
27721
  const baseName = fileName.replace(/\.vue$/, "");
27326
27722
  const pascalName = toPascal(baseName);
27327
27723
  const vueRoot = config.vueDirectory;
@@ -27367,7 +27763,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
27367
27763
  if (!cssFile) {
27368
27764
  return;
27369
27765
  }
27370
- const cssBaseName = basename14(getStyleBaseName(cssFile));
27766
+ const cssBaseName = basename16(getStyleBaseName(cssFile));
27371
27767
  const cssPascalName = toPascal(cssBaseName);
27372
27768
  const cssKey = `${cssPascalName}CSS`;
27373
27769
  const cssUrl = manifest[cssKey] || null;
@@ -27385,7 +27781,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
27385
27781
  });
27386
27782
  }, broadcastSveltePageUpdate = (state, sveltePagePath, manifest, duration) => {
27387
27783
  try {
27388
- const fileName = basename14(sveltePagePath);
27784
+ const fileName = basename16(sveltePagePath);
27389
27785
  const baseName = fileName.replace(/\.svelte$/, "");
27390
27786
  const pascalName = toPascal(baseName);
27391
27787
  const cssKey = `${pascalName}CSS`;
@@ -27434,7 +27830,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
27434
27830
  if (!cssFile) {
27435
27831
  return;
27436
27832
  }
27437
- const cssBaseName = basename14(getStyleBaseName(cssFile));
27833
+ const cssBaseName = basename16(getStyleBaseName(cssFile));
27438
27834
  const cssPascalName = toPascal(cssBaseName);
27439
27835
  const cssKey = `${cssPascalName}CSS`;
27440
27836
  const cssUrl = manifest[cssKey] || null;
@@ -27514,7 +27910,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
27514
27910
  const shouldRefreshAllPages = htmxPageFiles.length === 0 && shouldRefreshFromIslandChange;
27515
27911
  const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
27516
27912
  await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
27517
- const htmxPageName = basename14(htmxPageFile);
27913
+ const htmxPageName = basename16(htmxPageFile);
27518
27914
  const builtHtmxPagePath = resolve40(outputHtmxPages, htmxPageName);
27519
27915
  await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
27520
27916
  });
@@ -27624,7 +28020,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
27624
28020
  html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
27625
28021
  writeFs(destPath, html);
27626
28022
  }, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
27627
- const destPath = resolve40(outputDir, basename14(sourceFile));
28023
+ const destPath = resolve40(outputDir, basename16(sourceFile));
27628
28024
  const hmrScript = extractHmrScript(destPath, readFs);
27629
28025
  const source = await Bun.file(sourceFile).text();
27630
28026
  await Bun.write(destPath, source);
@@ -28699,5 +29095,5 @@ export {
28699
29095
  build
28700
29096
  };
28701
29097
 
28702
- //# debugId=801F8C678931957464756E2164756E21
29098
+ //# debugId=43AB0E9B045691AA64756E2164756E21
28703
29099
  //# sourceMappingURL=build.js.map