@absolutejs/absolute 0.20.0-beta.177 → 0.20.0-beta.179

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/changelog.json +72 -0
  3. package/dist/angular/browser.js +17 -2
  4. package/dist/angular/browser.js.map +4 -4
  5. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  6. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  7. package/dist/angular/index.js +100 -54
  8. package/dist/angular/index.js.map +10 -9
  9. package/dist/angular/server.js +100 -54
  10. package/dist/angular/server.js.map +10 -9
  11. package/dist/build/buildWorker.js +6 -5
  12. package/dist/build.js +595 -454
  13. package/dist/build.js.map +20 -20
  14. package/dist/cli/{add-ntg96znk.js → add-8gw9mk2b.js} +1 -1
  15. package/dist/cli/{compile-w2z6c9vt.js → compile-p5yv6ecp.js} +2 -2
  16. package/dist/cli/config/server.js +45 -12
  17. package/dist/cli/{dev-8br5mr7t.js → dev-2hbcsvkp.js} +1 -1
  18. package/dist/cli/{index-420h9hq7.js → index-1ewba8ye.js} +32 -3
  19. package/dist/cli/index-5q6k5mvr.js +86 -0
  20. package/dist/cli/{index-7z1hh3fg.js → index-9dzdbbfc.js} +1 -1
  21. package/dist/cli/index.js +9 -9
  22. package/dist/cli/{islands-bx67g15t.js → islands-6zgb7501.js} +1 -1
  23. package/dist/cli/{mobile-we5q51ey.js → mobile-93vaawcz.js} +3 -3
  24. package/dist/cli/{remove-4jh862qa.js → remove-x987pvd3.js} +1 -1
  25. package/dist/cli/{start-srs11bm8.js → start-asxb79rc.js} +2 -2
  26. package/dist/cli/{typecheck-7fvww3b7.js → typecheck-m2j4tkdk.js} +165 -35
  27. package/dist/client/chunks/{index-8m2qq61n.js → index-58svs66p.js} +13 -3
  28. package/dist/client/chunks/{index-8m2qq61n.js.map → index-58svs66p.js.map} +5 -4
  29. package/dist/client/chunks/{islands-mfjmdwnb.js → islands-tcadmgcx.js} +3 -6
  30. package/dist/client/chunks/{islands-mfjmdwnb.js.map → islands-tcadmgcx.js.map} +3 -4
  31. package/dist/client/chunks/{react-sprprqzs.js → react-khr6ewhr.js} +2 -2
  32. package/dist/client/index.js +82 -6
  33. package/dist/client/index.js.map +7 -6
  34. package/dist/dev/client/handlers/islands.ts +2 -0
  35. package/dist/dev/client/handlers/react.ts +92 -111
  36. package/dist/dev/client/handlers/reactUpdateQueue.ts +153 -0
  37. package/dist/index.js +568 -427
  38. package/dist/index.js.map +20 -20
  39. package/dist/islands/browser.js +2 -2
  40. package/dist/islands/browser.js.map +3 -3
  41. package/dist/islands/index.js +56 -27
  42. package/dist/islands/index.js.map +7 -6
  43. package/dist/react/browser.js +113 -12
  44. package/dist/react/browser.js.map +10 -7
  45. package/dist/react/components/index.js +31 -7
  46. package/dist/react/components/index.js.map +5 -4
  47. package/dist/react/components/server/index.js +22 -6
  48. package/dist/react/index.js +233 -67
  49. package/dist/react/index.js.map +16 -12
  50. package/dist/react/server.js +82 -23
  51. package/dist/react/server.js.map +11 -9
  52. package/dist/src/build/compileSvelte.d.ts +12 -1
  53. package/dist/src/build/compileVue.d.ts +1 -0
  54. package/dist/src/build/islandEntries.d.ts +3 -1
  55. package/dist/src/cli/add/dependencies.d.ts +34 -6
  56. package/dist/src/cli/scripts/typecheck.d.ts +8 -0
  57. package/dist/src/cli/scripts/typecheckDiagnostics.d.ts +17 -0
  58. package/dist/src/client/preserveIslandMarkup.d.ts +4 -0
  59. package/dist/src/core/islandManifest.d.ts +6 -0
  60. package/dist/src/core/islandStylesheet.d.ts +17 -0
  61. package/dist/src/react/Island.d.ts +9 -2
  62. package/dist/src/react/IslandStyleLink.d.ts +11 -0
  63. package/dist/src/react/createIsland.d.ts +1 -1
  64. package/dist/src/react/serverComponents/nodeRendererRef.d.ts +13 -0
  65. package/dist/src/utils/requestRenderUrl.d.ts +1 -0
  66. package/dist/src/utils/resolveConvention.d.ts +1 -0
  67. package/dist/src/vue/Island.browser.d.ts +3 -1
  68. package/dist/src/vue/Island.d.ts +2 -2
  69. package/dist/src/vue/createIsland.browser.d.ts +2 -2
  70. package/dist/src/vue/createIsland.d.ts +2 -2
  71. package/dist/src/vue/islandStyleLink.d.ts +30 -0
  72. package/dist/svelte/browser.js +2 -2
  73. package/dist/svelte/browser.js.map +3 -3
  74. package/dist/svelte/index.js +94 -70
  75. package/dist/svelte/index.js.map +10 -9
  76. package/dist/svelte/server.js +65 -59
  77. package/dist/svelte/server.js.map +9 -8
  78. package/dist/types/globals.d.ts +3 -0
  79. package/dist/vue/browser.js +105 -10
  80. package/dist/vue/browser.js.map +10 -7
  81. package/dist/vue/index.js +213 -68
  82. package/dist/vue/index.js.map +15 -12
  83. package/dist/vue/server.js +81 -22
  84. package/dist/vue/server.js.map +9 -7
  85. package/package.json +1 -1
  86. package/dist/cli/index-jjfbjv1z.js +0 -65
  87. /package/dist/cli/{index-6522t968.js → index-yd672jyq.js} +0 -0
  88. /package/dist/client/chunks/{react-sprprqzs.js.map → react-khr6ewhr.js.map} +0 -0
@@ -328,7 +328,7 @@ var ISLAND_BOOTSTRAP_MANIFEST_KEY = "AbsoluteIslandBootstrap", LEGACY_ISLAND_BOO
328
328
  islands[framework] = entries;
329
329
  }
330
330
  return islands;
331
- }, getIslandManifestKey = (framework, component) => `Island${toIslandFrameworkSegment(framework)}${component}`;
331
+ }, getIslandManifestKey = (framework, component) => `Island${toIslandFrameworkSegment(framework)}${component}`, ISLAND_STYLE_PREFIX = "IslandStyle", getIslandStyleManifestEntries = (manifest) => Object.entries(manifest).filter(([key]) => key.startsWith(ISLAND_STYLE_PREFIX)), getIslandStyleManifestKey = (framework, component) => `${ISLAND_STYLE_PREFIX}${toIslandFrameworkSegment(framework)}${component}`;
332
332
 
333
333
  // src/core/islandPageContext.ts
334
334
  var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST__", ISLAND_STATE_MARKER = "__ABS_ISLAND_STATE__", CLOSING_HEAD_TAG = "</head>", warnedMissingBootstrap = false, warnIfBootstrapMissing = (manifest) => {
@@ -365,12 +365,27 @@ var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST
365
365
  browserManifest[key] = value;
366
366
  }
367
367
  return browserManifest;
368
- }, buildIslandsHeadMarkup = (manifest) => {
368
+ }, ISLAND_MARKER_TAG, ISLAND_FRAMEWORKS, readMarkerAttribute = (tag, name) => new RegExp(`\\b${name}="([^"]*)"`).exec(tag)?.[1]?.replaceAll("&quot;", '"').replaceAll("&lt;", "<").replaceAll("&gt;", ">").replaceAll("&amp;", "&"), toIslandFramework = (value) => ISLAND_FRAMEWORKS.find((framework) => framework === value), collectRenderedIslandStyleKeys = (html) => {
369
+ const keys = new Set;
370
+ for (const [tag] of html.matchAll(ISLAND_MARKER_TAG)) {
371
+ const framework = toIslandFramework(readMarkerAttribute(tag, "data-framework"));
372
+ const component = readMarkerAttribute(tag, "data-component");
373
+ if (framework && component)
374
+ keys.add(getIslandStyleManifestKey(framework, component));
375
+ }
376
+ return keys;
377
+ }, buildIslandStyleLinks = (manifest, html) => {
378
+ if (html === undefined)
379
+ return "";
380
+ const renderedKeys = collectRenderedIslandStyleKeys(html);
381
+ return getIslandStyleManifestEntries(manifest).filter(([key]) => renderedKeys.has(key)).filter(([, href]) => !html.includes(`href="${href}"`)).map(([key, href]) => `<link rel="stylesheet" href="${href}" data-island-style="${key}"${nonceAttr()}>`).join("");
382
+ }, buildIslandsHeadMarkup = (manifest, html) => {
383
+ const styleLinks = buildIslandStyleLinks(manifest, html);
369
384
  const manifestScript = `<script${nonceAttr()}>window.__ABSOLUTE_MANIFEST__ = ${escapeScriptContent(JSON.stringify(toBrowserManifest(manifest)))}</script>`;
370
385
  const islandStateScript = `<script${nonceAttr()}>window.__ABS_ISLAND_STATE__ = ${escapeScriptContent(JSON.stringify(globalThis.__ABS_ISLAND_STATE__ ?? {}))}</script>`;
371
386
  const bootstrapPath = getIslandBootstrapPath(manifest);
372
387
  const bootstrapScript = bootstrapPath ? `<script${nonceAttr()} type="module" src="${bootstrapPath}"></script>` : "";
373
- return `${manifestScript}${islandStateScript}${bootstrapScript}`;
388
+ return `${styleLinks}${manifestScript}${islandStateScript}${bootstrapScript}`;
374
389
  }, injectHeadMarkup = (html, markup) => {
375
390
  const closingHeadIndex = html.indexOf("</head>");
376
391
  if (closingHeadIndex >= 0) {
@@ -552,7 +567,7 @@ var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST
552
567
  return html;
553
568
  }
554
569
  warnIfBootstrapMissing(manifest);
555
- return injectHeadMarkup(html, buildIslandsHeadMarkup(manifest));
570
+ return injectHeadMarkup(html, buildIslandsHeadMarkup(manifest, html));
556
571
  }, injectIslandPageContextStream = (stream, options) => {
557
572
  const manifest = globalThis.__absoluteManifest;
558
573
  if (!manifest)
@@ -576,6 +591,13 @@ var init_islandPageContext = __esm(() => {
576
591
  init_logger();
577
592
  MANIFEST_BUILD_DIR_KEY = Symbol.for("absolutejs.islandManifestBuildDir");
578
593
  WINDOWS_ABSOLUTE_PATH = /^[A-Za-z]:[\\/]|^\\\\/;
594
+ ISLAND_MARKER_TAG = /<[^>]*\bdata-island="true"[^>]*>/g;
595
+ ISLAND_FRAMEWORKS = [
596
+ "react",
597
+ "svelte",
598
+ "vue",
599
+ "angular"
600
+ ];
579
601
  });
580
602
 
581
603
  // src/core/routeAssets.ts
@@ -918,6 +940,12 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
918
940
  logConventionRenderError(framework, "error", renderError);
919
941
  }
920
942
  return null;
943
+ }, isPageRequest = (request) => {
944
+ if (request.headers.get("hx-request") === "true")
945
+ return true;
946
+ if (request.headers.get("sec-fetch-dest") === "document")
947
+ return true;
948
+ return (request.headers.get("accept") ?? "").includes("text/html");
921
949
  }, renderConventionError = async (framework, pageName, error) => {
922
950
  const errorProps = buildErrorProps(error);
923
951
  const frameworkResponse = await tryFrameworkErrorConvention(framework, pageName, errorProps, error);
@@ -929,12 +957,6 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
929
957
  return htmlResponse;
930
958
  }
931
959
  return null;
932
- }, isPageRequest = (request) => {
933
- if (request.headers.get("hx-request") === "true")
934
- return true;
935
- if (request.headers.get("sec-fetch-dest") === "document")
936
- return true;
937
- return (request.headers.get("accept") ?? "").includes("text/html");
938
960
  }, renderStaticRouteError = async (request, error) => {
939
961
  if (!isPageRequest(request))
940
962
  return null;
@@ -3192,7 +3214,7 @@ import { basename as basename3, dirname as dirname3, extname as extname2, join a
3192
3214
  var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, syncIslandGeneration, transpiler, ensureRelativeImportPath = (from, target) => {
3193
3215
  const importPath = relative3(dirname3(from), target).replace(/\\/g, "/");
3194
3216
  return importPath.startsWith(".") ? importPath : `./${importPath}`;
3195
- }, processDirectoryEntries = (entries, dir, targetFileName, stack) => {
3217
+ }, escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), replaceQuotedSpecifier = (code, spec, target) => code.replace(new RegExp(`(['"])${escapeRegExp(spec)}\\1`, "g"), (_match, quote) => `${quote}${target}${quote}`), processDirectoryEntries = (entries, dir, targetFileName, stack) => {
3196
3218
  for (const entry of entries) {
3197
3219
  const entryPath = join6(dir, entry.name);
3198
3220
  if (entry.isDirectory())
@@ -3237,18 +3259,21 @@ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, syncIslandG
3237
3259
  return null;
3238
3260
  }
3239
3261
  const basePath = resolve4(dirname3(from), spec);
3262
+ const extensions = [
3263
+ ".ts",
3264
+ ".tsx",
3265
+ ".mts",
3266
+ ".cts",
3267
+ ".js",
3268
+ ".jsx",
3269
+ ".mjs",
3270
+ ".cjs",
3271
+ ".json"
3272
+ ];
3240
3273
  const candidates = [
3241
3274
  basePath,
3242
- `${basePath}.ts`,
3243
- `${basePath}.js`,
3244
- `${basePath}.mjs`,
3245
- `${basePath}.cjs`,
3246
- `${basePath}.json`,
3247
- join6(basePath, "index.ts"),
3248
- join6(basePath, "index.js"),
3249
- join6(basePath, "index.mjs"),
3250
- join6(basePath, "index.cjs"),
3251
- join6(basePath, "index.json")
3275
+ ...extensions.map((extension) => `${basePath}${extension}`),
3276
+ ...extensions.map((extension) => join6(basePath, `index${extension}`))
3252
3277
  ];
3253
3278
  const existResults = await Promise.all(candidates.map((candidate) => Bun.file(candidate).exists()));
3254
3279
  const foundIndex = existResults.indexOf(true);
@@ -3333,7 +3358,7 @@ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, syncIslandG
3333
3358
  rewrittenModulePaths.set(spec, ensureRelativeImportPath(getCachedModulePath2(sourcePath), resolvedModuleImport));
3334
3359
  }
3335
3360
  for (const [spec, resolvedModuleImport] of rewrittenModulePaths) {
3336
- transpiled = transpiled.replaceAll(spec, resolvedModuleImport);
3361
+ transpiled = replaceQuotedSpecifier(transpiled, spec, resolvedModuleImport);
3337
3362
  }
3338
3363
  let compiledCode = compile(transpiled, {
3339
3364
  css: "injected",
@@ -3345,10 +3370,10 @@ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, syncIslandG
3345
3370
  hmr: isDevelopmentRuntime()
3346
3371
  }).js.code;
3347
3372
  for (const [spec, compiledChildPath] of childModulePaths) {
3348
- compiledCode = compiledCode.replaceAll(spec, ensureRelativeImportPath(getCachedModulePath2(sourcePath), compiledChildPath));
3373
+ compiledCode = replaceQuotedSpecifier(compiledCode, spec, ensureRelativeImportPath(getCachedModulePath2(sourcePath), compiledChildPath));
3349
3374
  }
3350
3375
  for (const [spec, resolvedModuleImport] of rewrittenModulePaths) {
3351
- compiledCode = compiledCode.replaceAll(spec, resolvedModuleImport);
3376
+ compiledCode = replaceQuotedSpecifier(compiledCode, spec, resolvedModuleImport);
3352
3377
  }
3353
3378
  const sourceId = JSON.stringify(relative3(process.cwd(), resolutionSourcePath).replace(/\\/g, "/"));
3354
3379
  const componentName = /export default function ([\w$]+)\s*\(/.exec(compiledCode)?.[1];
@@ -3408,9 +3433,9 @@ var createVueCompiler = async () => {
3408
3433
  // src/core/vueServerModule.ts
3409
3434
  import { readFileSync as readFileSync4, realpathSync } from "fs";
3410
3435
  import { mkdir as mkdir3 } from "fs/promises";
3411
- import { dirname as dirname4, join as join7, relative as relative4, resolve as resolve5 } from "path";
3436
+ import { basename as basename4, dirname as dirname4, join as join7, relative as relative4, resolve as resolve5 } from "path";
3412
3437
  var {Transpiler } = globalThis.Bun;
3413
- var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, syncIslandGeneration2, transpiler2, ensureRelativeImportPath2 = (from, target) => {
3438
+ var serverCacheRoot3, compiledModuleCache3, syncIslandGeneration2, transpiler2, ensureRelativeImportPath2 = (from, target) => {
3414
3439
  const importPath = relative4(dirname4(from), target).replace(/\\/g, "/");
3415
3440
  return importPath.startsWith(".") ? importPath : `./${importPath}`;
3416
3441
  }, getCachedModulePath3 = (sourcePath) => {
@@ -3444,7 +3469,13 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, sync
3444
3469
  ].join(`
3445
3470
  `) : nonVueLines.join(`
3446
3471
  `);
3447
- }, extractRelativeVueImports = (sourceCode) => Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((importPath) => typeof importPath === "string" && importPath.startsWith(".") && importPath.endsWith(".vue")), compileVueServerModule = async (sourcePath) => {
3472
+ }, RELATIVE_SPECIFIER_PATTERN, extractRelativeImports = (code) => Array.from(new Set(Array.from(code.matchAll(RELATIVE_SPECIFIER_PATTERN), (match) => match.groups?.spec).filter((spec) => spec !== undefined))), resolveFromSource = (spec, sourcePath) => {
3473
+ try {
3474
+ return Bun.resolveSync(spec, dirname4(sourcePath));
3475
+ } catch {
3476
+ return null;
3477
+ }
3478
+ }, compileVueServerModule = async (sourcePath) => {
3448
3479
  syncIslandGeneration2();
3449
3480
  const cachedModulePath = compiledModuleCache3.get(sourcePath);
3450
3481
  if (cachedModulePath)
@@ -3452,7 +3483,7 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, sync
3452
3483
  const compiler = await loadVueCompiler();
3453
3484
  const source = await Bun.file(sourcePath).text();
3454
3485
  const { descriptor } = compiler.parse(source, { filename: sourcePath });
3455
- const componentId = Bun.hash(sourcePath).toString(BASE_36_RADIX).slice(0, ISLAND_COMPONENT_ID_LENGTH);
3486
+ const componentId = toKebab(basename4(sourcePath, ".vue"));
3456
3487
  const hasScript = descriptor.script || descriptor.scriptSetup;
3457
3488
  const compiledScript = hasScript ? compiler.compileScript(descriptor, {
3458
3489
  fs: {
@@ -3477,10 +3508,10 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, sync
3477
3508
  ssr: true,
3478
3509
  ssrCssVars: descriptor.cssVars
3479
3510
  }).code : "const ssrRender = () => {};";
3480
- const childImportPaths = extractRelativeVueImports(compiledScript.content);
3481
- const compiledChildren = await Promise.all(childImportPaths.map(async (relativeImport) => ({
3482
- compiledPath: await compileVueServerModule(resolve5(dirname4(sourcePath), relativeImport)),
3483
- spec: relativeImport
3511
+ const relativeImports = extractRelativeImports(compiledScript.content);
3512
+ const compiledChildren = await Promise.all(relativeImports.filter((spec) => spec.endsWith(".vue")).map(async (spec) => ({
3513
+ compiledPath: await compileVueServerModule(resolve5(dirname4(sourcePath), spec)),
3514
+ spec
3484
3515
  })));
3485
3516
  const strippedScript = stripExports(compiledScript.content);
3486
3517
  const transpiledScript = transpiler2.transformSync(strippedScript);
@@ -3492,17 +3523,28 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, sync
3492
3523
  ].join(`
3493
3524
  `));
3494
3525
  const compiledModulePath = getCachedModulePath3(sourcePath);
3495
- let rewritten = assembled;
3526
+ const rewrittenSpecifiers = new Map;
3496
3527
  for (const child of compiledChildren) {
3497
- rewritten = rewritten.replaceAll(child.spec, ensureRelativeImportPath2(compiledModulePath, child.compiledPath));
3528
+ rewrittenSpecifiers.set(child.spec, ensureRelativeImportPath2(compiledModulePath, child.compiledPath));
3529
+ }
3530
+ for (const spec of extractRelativeImports(assembled)) {
3531
+ if (rewrittenSpecifiers.has(spec))
3532
+ continue;
3533
+ const resolvedImport = resolveFromSource(spec, sourcePath);
3534
+ if (!resolvedImport)
3535
+ continue;
3536
+ rewrittenSpecifiers.set(spec, ensureRelativeImportPath2(compiledModulePath, resolvedImport));
3498
3537
  }
3538
+ const rewritten = assembled.replace(RELATIVE_SPECIFIER_PATTERN, (match, prefix, quote, spec) => {
3539
+ const target = rewrittenSpecifiers.get(spec);
3540
+ return target ? `${prefix}${quote}${target}${quote}` : match;
3541
+ });
3499
3542
  await mkdir3(dirname4(compiledModulePath), { recursive: true });
3500
3543
  await writeIfChanged2(compiledModulePath, rewritten);
3501
3544
  compiledModuleCache3.set(sourcePath, compiledModulePath);
3502
3545
  return compiledModulePath;
3503
3546
  };
3504
3547
  var init_vueServerModule = __esm(() => {
3505
- init_constants();
3506
3548
  init_isFile();
3507
3549
  serverCacheRoot3 = join7(process.cwd(), ".absolutejs", "islands", "vue");
3508
3550
  compiledModuleCache3 = new Map;
@@ -3510,6 +3552,7 @@ var init_vueServerModule = __esm(() => {
3510
3552
  compiledModuleCache3.clear();
3511
3553
  });
3512
3554
  transpiler2 = new Transpiler({ loader: "ts", target: "browser" });
3555
+ RELATIVE_SPECIFIER_PATTERN = /(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(?<spec>\.{1,2}\/[^'"]*)\2/g;
3513
3556
  });
3514
3557
 
3515
3558
  // src/core/islands.ts
@@ -5599,7 +5642,7 @@ __export(exports_compileAngular, {
5599
5642
  invalidateAngularJitCache: () => invalidateAngularJitCache
5600
5643
  });
5601
5644
  import { existsSync as existsSync5, readFileSync as readFileSync6, promises as fs } from "fs";
5602
- import { join as join9, basename as basename4, sep, dirname as dirname5, resolve as resolve6, relative as relative5 } from "path";
5645
+ import { join as join9, basename as basename5, sep, dirname as dirname5, resolve as resolve6, relative as relative5 } from "path";
5603
5646
  var {Glob } = globalThis.Bun;
5604
5647
  var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) => {
5605
5648
  const temporaryPath = `${path}.tmp.${process.pid}.${atomicWriteSequence++}`;
@@ -5981,7 +6024,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
5981
6024
  const originalGetDefaultLibFileName = host.getDefaultLibFileName;
5982
6025
  host.getDefaultLibFileName = (opts) => {
5983
6026
  const fileName = originalGetDefaultLibFileName ? originalGetDefaultLibFileName(opts) : "lib.d.ts";
5984
- return basename4(fileName);
6027
+ return basename5(fileName);
5985
6028
  };
5986
6029
  const originalGetSourceFile = host.getSourceFile;
5987
6030
  host.getSourceFile = (fileName, languageVersion, onError) => {
@@ -6422,7 +6465,7 @@ ${fields}
6422
6465
  };
6423
6466
  const toOutputPath = (sourcePath) => {
6424
6467
  const inputDir = dirname5(sourcePath);
6425
- const fileBase = basename4(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
6468
+ const fileBase = basename5(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
6426
6469
  if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep}`)) {
6427
6470
  return join9(inputDir, fileBase);
6428
6471
  }
@@ -6478,7 +6521,7 @@ ${fields}
6478
6521
  const inputDir = dirname5(resolved);
6479
6522
  const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
6480
6523
  const targetDir = join9(outDir, relativeDir);
6481
- const targetPath = join9(targetDir, basename4(resolved));
6524
+ const targetPath = join9(targetDir, basename5(resolved));
6482
6525
  await fs.mkdir(targetDir, { recursive: true });
6483
6526
  await fs.copyFile(resolved, targetPath);
6484
6527
  allOutputs.push(targetPath);
@@ -6493,7 +6536,7 @@ ${fields}
6493
6536
  const inlined = await inlineResources(sourceCode, dirname5(actualPath), stylePreprocessors);
6494
6537
  sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname5(actualPath)).source;
6495
6538
  const inputDir = dirname5(actualPath);
6496
- const fileBase = basename4(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
6539
+ const fileBase = basename5(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
6497
6540
  const targetPath = toOutputPath(actualPath);
6498
6541
  const targetDir = dirname5(targetPath);
6499
6542
  const relativeDir = relative5(outDir, targetDir).replace(/\\/g, "/");
@@ -6622,7 +6665,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
6622
6665
  let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
6623
6666
  entry: resolvedEntry
6624
6667
  }) : aotOutputs;
6625
- const fileBase = basename4(resolvedEntry).replace(/\.[tj]s$/, "");
6668
+ const fileBase = basename5(resolvedEntry).replace(/\.[tj]s$/, "");
6626
6669
  const jsName = `${fileBase}.js`;
6627
6670
  const compiledFallbackPaths = [
6628
6671
  join9(compiledRoot, relativeEntry),
@@ -7075,6 +7118,18 @@ var provideDeterministicEnv = (options = {}) => {
7075
7118
  }
7076
7119
  ];
7077
7120
  };
7121
+ // src/utils/requestRenderUrl.ts
7122
+ var requestRenderUrl = (request) => {
7123
+ if (!request)
7124
+ return;
7125
+ try {
7126
+ const parsed = new URL(request.url);
7127
+ return `${parsed.pathname.replace(/\/{2,}/g, "/")}${parsed.search}`;
7128
+ } catch {
7129
+ return;
7130
+ }
7131
+ };
7132
+
7078
7133
  // src/angular/pageHandler.ts
7079
7134
  init_constants();
7080
7135
  init_islandPageContext();
@@ -7086,7 +7141,7 @@ init_registerClientScript();
7086
7141
  init_angularDeps();
7087
7142
  import { AsyncLocalStorage as AsyncLocalStorage5 } from "async_hooks";
7088
7143
  import { lstat, mkdir as mkdir4, readlink, symlink } from "fs/promises";
7089
- import { basename as basename5, dirname as dirname6, join as join10, resolve as resolve7 } from "path";
7144
+ import { basename as basename6, dirname as dirname6, join as join10, resolve as resolve7 } from "path";
7090
7145
 
7091
7146
  // src/angular/animationProviders.ts
7092
7147
  init_resolveAngularPackage();
@@ -7728,7 +7783,7 @@ var resolveRuntimeAngularModulePath = async (pagePath) => {
7728
7783
  await Promise.resolve().then(() => init_compileAngular());
7729
7784
  const cacheBuster = createAngularRuntimeCacheBuster();
7730
7785
  const outputs = await compileAngularFileJIT(pagePath, outDir, process.cwd(), undefined, cacheBuster);
7731
- const expectedFileName = basename5(pagePath).replace(/\.ts$/, ".js");
7786
+ const expectedFileName = basename6(pagePath).replace(/\.ts$/, ".js");
7732
7787
  const runtimePagePath = outputs.find((output) => output.endsWith(`/${expectedFileName}`)) ?? outputs.find((output) => output.endsWith(`\\${expectedFileName}`)) ?? outputs[0] ?? pagePath;
7733
7788
  return {
7734
7789
  cacheBuster,
@@ -7748,16 +7803,7 @@ var withHtmlContentType = (responseInit = {}) => {
7748
7803
  }
7749
7804
  return { ...responseInit, headers };
7750
7805
  };
7751
- var resolveRequestRenderUrl = (request) => {
7752
- if (!request)
7753
- return "/";
7754
- try {
7755
- const parsed = new URL(request.url);
7756
- return `${parsed.pathname}${parsed.search}`;
7757
- } catch {
7758
- return "/";
7759
- }
7760
- };
7806
+ var resolveRequestRenderUrl = (request) => requestRenderUrl(request) ?? "/";
7761
7807
  var angularSsrContext = new AsyncLocalStorage5;
7762
7808
  setSsrContextGetter(() => angularSsrContext.getStore());
7763
7809
  var handleAngularPageRequest = async (input) => {
@@ -7902,5 +7948,5 @@ export {
7902
7948
  withPendingTask
7903
7949
  };
7904
7950
 
7905
- //# debugId=3FD4269B8E368DF764756E2164756E21
7951
+ //# debugId=985E5EB495A207FA64756E2164756E21
7906
7952
  //# sourceMappingURL=server.js.map