@absolutejs/absolute 0.20.0-beta.182 → 0.20.0-beta.183

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 (38) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/changelog.json +21 -0
  3. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  4. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  5. package/dist/angular/index.js +177 -37
  6. package/dist/angular/index.js.map +6 -5
  7. package/dist/angular/server.js +177 -37
  8. package/dist/angular/server.js.map +6 -5
  9. package/dist/build.js +22 -8
  10. package/dist/build.js.map +5 -5
  11. package/dist/cli/{build-p3qra1nj.js → build-df81wh71.js} +5 -2
  12. package/dist/cli/{buildReactServerComponents-vc9hh2rd.js → buildReactServerComponents-k6amghrj.js} +1 -1
  13. package/dist/cli/config/server.js +19 -1
  14. package/dist/cli/{index-mmm6d3k5.js → index-3dz754hk.js} +2 -2
  15. package/dist/cli/{index-7zwzyymv.js → index-pq4qqz0r.js} +1 -1
  16. package/dist/cli/index.js +1 -1
  17. package/dist/cli/{typecheck-yjme4fv1.js → typecheck-bvm0ndq4.js} +153 -62
  18. package/dist/dev/serverBootstrap.js +8 -2
  19. package/dist/index.js +24 -10
  20. package/dist/index.js.map +5 -5
  21. package/dist/react/index.js +10 -2
  22. package/dist/react/index.js.map +3 -3
  23. package/dist/react/server.js +10 -2
  24. package/dist/react/server.js.map +3 -3
  25. package/dist/src/angular/colocatedRouteMatch.d.ts +23 -0
  26. package/dist/src/cli/scripts/typecheck.d.ts +1 -0
  27. package/dist/src/cli/scripts/typecheckDiagnostics.d.ts +41 -0
  28. package/dist/src/dev/hot/analyze.d.ts +1 -1
  29. package/dist/src/utils/spaRouteManifest.d.ts +1 -0
  30. package/dist/svelte/index.js +10 -2
  31. package/dist/svelte/index.js.map +3 -3
  32. package/dist/svelte/server.js +10 -2
  33. package/dist/svelte/server.js.map +3 -3
  34. package/dist/vue/index.js +10 -2
  35. package/dist/vue/index.js.map +3 -3
  36. package/dist/vue/server.js +10 -2
  37. package/dist/vue/server.js.map +3 -3
  38. package/package.json +1 -1
@@ -3,8 +3,8 @@ import"./index-fm9x6sjs.js";
3
3
  import"./index-zeeep92g.js";
4
4
  import"./index-47e8fwha.js";
5
5
  import"./index-4j1twret.js";
6
- import"./index-mmm6d3k5.js";
7
- import"./index-7zwzyymv.js";
6
+ import"./index-3dz754hk.js";
7
+ import"./index-pq4qqz0r.js";
8
8
  import {
9
9
  SENTINEL
10
10
  } from "./index-jyap0bhv.js";
@@ -451,6 +451,9 @@ var VUE_HMR_RUNTIME = [
451
451
  ].join("");
452
452
  var LINE_TERMINATOR = new RegExp(`;\\s*(?://${SENTINEL}\\d+${SENTINEL})?\\s*$`);
453
453
 
454
+ // src/utils/spaRouteManifest.ts
455
+ import { NotFound } from "elysia";
456
+
454
457
  // src/core/precompressed.ts
455
458
  import { promisify } from "util";
456
459
  import { brotliCompress, constants, gzip } from "zlib";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  buildReactServerComponentsPass2,
4
4
  reactServerPageManifestKeys2
5
- } from "./index-7zwzyymv.js";
5
+ } from "./index-pq4qqz0r.js";
6
6
  import"./index-zeeep92g.js";
7
7
  import"./index-yhkg5by0.js";
8
8
  import"./index-akseq9ps.js";
@@ -48170,6 +48170,9 @@ var runWithStreamingSlotWarningScope = (task, metadata) => ensureWarningStorage(
48170
48170
  hasWarned: false
48171
48171
  }, task);
48172
48172
 
48173
+ // src/utils/spaRouteManifest.ts
48174
+ import { NotFound } from "elysia";
48175
+
48173
48176
  // src/utils/stringModifiers.ts
48174
48177
  var normalizeSlug = (str) => str.trim().replace(/\s+/g, "-").replace(/[^A-Za-z0-9\-_]+/g, "").replace(/[-_]{2,}/g, "-");
48175
48178
  var toPascal = (str) => {
@@ -48364,6 +48367,13 @@ var tryFrameworkErrorConvention = async (framework, pageName, errorProps, error)
48364
48367
  }
48365
48368
  return null;
48366
48369
  };
48370
+ var isPageRequest = (request) => {
48371
+ if (request.headers.get("hx-request") === "true")
48372
+ return true;
48373
+ if (request.headers.get("sec-fetch-dest") === "document")
48374
+ return true;
48375
+ return (request.headers.get("accept") ?? "").includes("text/html");
48376
+ };
48367
48377
  var renderConventionError = async (framework, pageName, error) => {
48368
48378
  const errorProps = buildErrorProps(error);
48369
48379
  const frameworkResponse = await tryFrameworkErrorConvention(framework, pageName, errorProps, error);
@@ -48557,7 +48567,15 @@ var isKnownSpaRoute = (framework, pageName, request) => {
48557
48567
  var renderSpaNotFound = async (framework, pageName, request) => {
48558
48568
  if (isKnownSpaRoute(framework, pageName, request))
48559
48569
  return null;
48560
- return await renderFirstNotFound() ?? new Response("Not found", {
48570
+ return renderSpaNotFoundResponse(request);
48571
+ };
48572
+ var renderSpaNotFoundResponse = async (request) => {
48573
+ if (request && !isPageRequest(request)) {
48574
+ return new NotFound().toResponse();
48575
+ }
48576
+ return await renderFirstNotFound({
48577
+ preferHtmx: request?.headers.get("hx-request") === "true"
48578
+ }) ?? new Response("Not found", {
48561
48579
  headers: { "Content-Type": "text/plain" },
48562
48580
  status: 404
48563
48581
  });
@@ -666,7 +666,7 @@ var deriveManifestKeys = async (config, projectRoot = process.cwd()) => {
666
666
  }
667
667
  const rscDir = at(config.reactServerComponentsDirectory);
668
668
  if (rscDir && existsSync3(join2(rscDir, "pages"))) {
669
- const { reactServerPageManifestKeys } = await import("./buildReactServerComponents-vc9hh2rd.js");
669
+ const { reactServerPageManifestKeys } = await import("./buildReactServerComponents-k6amghrj.js");
670
670
  const names = (await scanEntryPoints(join2(rscDir, "pages"), "*.{tsx,jsx,ts,js}")).map((page) => toPascal(stemOf(page)));
671
671
  if (names.length > 0) {
672
672
  definite.add(REACT_SERVER_CLIENT_MANIFEST_KEY);
@@ -769,7 +769,7 @@ var deriveManifestKeys = async (config, projectRoot = process.cwd()) => {
769
769
  htmxDir
770
770
  ].filter((dir) => dir !== undefined && existsSync3(dir));
771
771
  if (frameworkDirs.length > 0) {
772
- const { scanWorkerReferences } = await import("./build-p3qra1nj.js");
772
+ const { scanWorkerReferences } = await import("./build-df81wh71.js");
773
773
  for (const worker of await scanWorkerReferences(frameworkDirs))
774
774
  possible.add(toPascal(stemOf(worker)));
775
775
  }
@@ -8,7 +8,7 @@ import {
8
8
  REACT_SERVER_PAYLOAD_GLOBAL,
9
9
  REACT_SERVER_RENDERER_MANIFEST_KEY,
10
10
  REACT_SERVER_RUNTIME_FILE
11
- } from "./index-mmm6d3k5.js";
11
+ } from "./index-3dz754hk.js";
12
12
  import {
13
13
  toPascal
14
14
  } from "./index-dw44xa4x.js";
package/dist/cli/index.js CHANGED
@@ -222,7 +222,7 @@ if (command === "dev") {
222
222
  } else if (command === "typecheck") {
223
223
  sendTelemetryEvent("cli:command", { command });
224
224
  const configPath = parseNamedArg("--config");
225
- const { typecheck } = await import("./typecheck-yjme4fv1.js");
225
+ const { typecheck } = await import("./typecheck-bvm0ndq4.js");
226
226
  await typecheck(configPath);
227
227
  } else if (command === "migrate") {
228
228
  sendTelemetryEvent("cli:command", { command });
@@ -18,7 +18,7 @@ import"./index-zeeep92g.js";
18
18
  import {
19
19
  MANIFEST_KEYS_DECLARATION,
20
20
  writeManifestKeysDeclaration
21
- } from "./index-mmm6d3k5.js";
21
+ } from "./index-3dz754hk.js";
22
22
  import {
23
23
  getString,
24
24
  isRecord
@@ -31,7 +31,7 @@ import"./index-yhkg5by0.js";
31
31
  import"./index-akseq9ps.js";
32
32
 
33
33
  // src/cli/scripts/typecheck.ts
34
- import { dirname as dirname3, join as join2, parse as parse3, relative as relative2, resolve as resolve4 } from "path";
34
+ import { dirname as dirname3, join as join2, parse as parse3, relative as relative3, resolve as resolve4 } from "path";
35
35
  import { existsSync as existsSync3, readdirSync as readdirSync2, readFileSync as readFileSync3 } from "fs";
36
36
  import { mkdir as mkdir2, rm as rm2, writeFile as writeFile2 } from "fs/promises";
37
37
 
@@ -1267,7 +1267,7 @@ var manifestKeysEditorHint = (config) => {
1267
1267
  };
1268
1268
 
1269
1269
  // src/cli/scripts/typecheckDiagnostics.ts
1270
- import { resolve as resolve3 } from "path";
1270
+ import { relative as relative2, resolve as resolve3 } from "path";
1271
1271
  var ANSI_COLOR_REGEX = new RegExp(`${String.fromCharCode(ANSI_ESCAPE_CODE)}\\[[0-9;]*m`, "g");
1272
1272
  var stripAnsi = (text) => text.replace(ANSI_COLOR_REGEX, "");
1273
1273
  var PAREN_FORMAT = /^(.+?)\((\d+),(\d+)\): error ((?:TS|NG)\d+)/;
@@ -1337,6 +1337,130 @@ var withoutReported = (output, reported, cwd = process.cwd()) => {
1337
1337
  remaining
1338
1338
  };
1339
1339
  };
1340
+ var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
1341
+ var toPosition = (value) => isObject(value) && typeof value.line === "number" && typeof value.character === "number" ? { character: value.character, line: value.line } : null;
1342
+ var toDiagnostic = (value) => {
1343
+ if (!isObject(value))
1344
+ return null;
1345
+ const { code, filename, message, source, type } = value;
1346
+ const start = toPosition(value.start);
1347
+ const end = toPosition(value.end) ?? start;
1348
+ if (type !== "ERROR" && type !== "WARNING" || typeof filename !== "string" || typeof message !== "string" || start === null || end === null)
1349
+ return null;
1350
+ return {
1351
+ code: typeof code === "number" || typeof code === "string" ? code : undefined,
1352
+ end,
1353
+ filename,
1354
+ message,
1355
+ source: typeof source === "string" ? source : undefined,
1356
+ start,
1357
+ type
1358
+ };
1359
+ };
1360
+ var parseJson = (text) => {
1361
+ try {
1362
+ return JSON.parse(text);
1363
+ } catch {
1364
+ return null;
1365
+ }
1366
+ };
1367
+ var parseFailure = (text) => {
1368
+ const parsed = parseJson(text);
1369
+ return typeof parsed === "string" ? parsed : text;
1370
+ };
1371
+ var MACHINE_LINE = /^\d+ (.*)$/;
1372
+ var IGNORED_EVENTS = ["START ", "COMPLETED "];
1373
+ var parseSvelteCheckOutput = (output) => {
1374
+ const diagnostics = [];
1375
+ const failures = [];
1376
+ const other = [];
1377
+ for (const line of stripAnsi(output).split(`
1378
+ `)) {
1379
+ if (line.trim() === "")
1380
+ continue;
1381
+ const event = MACHINE_LINE.exec(line)?.[1] ?? "";
1382
+ const diagnostic = event.startsWith("{") ? toDiagnostic(parseJson(event)) : null;
1383
+ if (diagnostic?.type === "ERROR")
1384
+ diagnostics.push(diagnostic);
1385
+ else if (diagnostic !== null)
1386
+ continue;
1387
+ else if (event.startsWith("FAILURE "))
1388
+ failures.push(parseFailure(event.slice("FAILURE ".length)));
1389
+ else if (!IGNORED_EVENTS.some((prefix) => event.startsWith(prefix)))
1390
+ other.push(line);
1391
+ }
1392
+ return { diagnostics, failures, other };
1393
+ };
1394
+ var TS_SOURCES = new Set([undefined, "js", "ts"]);
1395
+ var isTypeScriptDiagnostic = ({ code, source }) => typeof code === "number" && TS_SOURCES.has(source);
1396
+ var svelteDiagnosticKey = (diagnostic, cwd = process.cwd()) => isTypeScriptDiagnostic(diagnostic) ? keyOf({
1397
+ code: `TS${diagnostic.code}`,
1398
+ column: String(diagnostic.start.character + 1),
1399
+ file: diagnostic.filename,
1400
+ line: String(diagnostic.start.line + 1)
1401
+ }, cwd) : null;
1402
+ var codeLabel = (diagnostic) => {
1403
+ if (diagnostic.code === undefined)
1404
+ return "";
1405
+ if (isTypeScriptDiagnostic(diagnostic))
1406
+ return ` TS${diagnostic.code}`;
1407
+ return ` ${diagnostic.code}`;
1408
+ };
1409
+ var codeFrame = (diagnostic, sourceText) => {
1410
+ const text = sourceText?.split(`
1411
+ `)[diagnostic.start.line];
1412
+ if (text === undefined)
1413
+ return [];
1414
+ const line = text.replace(/\r$/, "");
1415
+ const { end, start } = diagnostic;
1416
+ const from = Math.min(start.character, line.length);
1417
+ const until = end.line === start.line ? end.character : line.length;
1418
+ const width = Math.max(1, Math.min(until, line.length) - from);
1419
+ const gutter = String(start.line + 1);
1420
+ const indent = line.slice(0, from).replace(/[^\t]/g, " ");
1421
+ return [
1422
+ `\x1B[7m${gutter}\x1B[0m ${line}`,
1423
+ `\x1B[7m${" ".repeat(gutter.length)}\x1B[0m ${indent}\x1B[91m${"~".repeat(width)}\x1B[0m`
1424
+ ];
1425
+ };
1426
+ var formatSvelteDiagnostics = (diagnostics, readSource, cwd = process.cwd()) => {
1427
+ const blocks = diagnostics.map((diagnostic) => {
1428
+ const absolute = resolve3(cwd, diagnostic.filename);
1429
+ const file = relative2(cwd, absolute) || diagnostic.filename;
1430
+ const line = diagnostic.start.line + 1;
1431
+ const column = diagnostic.start.character + 1;
1432
+ const header = `\x1B[96m${file}\x1B[0m:\x1B[93m${line}\x1B[0m:\x1B[93m${column}\x1B[0m - \x1B[91merror\x1B[0m\x1B[90m${codeLabel(diagnostic)}: \x1B[0m${diagnostic.message}`;
1433
+ const frame = codeFrame(diagnostic, readSource(absolute));
1434
+ return [header, ...frame.length > 0 ? ["", ...frame] : []].join(`
1435
+ `);
1436
+ });
1437
+ if (blocks.length === 0)
1438
+ return "";
1439
+ const suffix = blocks.length === 1 ? "" : "s";
1440
+ return `${blocks.join(`
1441
+
1442
+ `)}
1443
+
1444
+ Found ${blocks.length} error${suffix}.`;
1445
+ };
1446
+ var svelteCheckReport = (output, reported, readSource, cwd = process.cwd()) => {
1447
+ const { diagnostics, failures, other } = parseSvelteCheckOutput(output);
1448
+ const kept = diagnostics.filter((diagnostic) => {
1449
+ const key = svelteDiagnosticKey(diagnostic, cwd);
1450
+ return key === null || !reported.has(key);
1451
+ });
1452
+ const sections = [
1453
+ ...other,
1454
+ ...failures.map((failure) => `\x1B[91merror\x1B[0m svelte-check failed: ${failure}`),
1455
+ formatSvelteDiagnostics(kept, readSource, cwd)
1456
+ ].filter((section) => section.length > 0);
1457
+ return {
1458
+ dropped: diagnostics.length - kept.length,
1459
+ output: sections.join(`
1460
+ `),
1461
+ remaining: kept.length + failures.length + other.length
1462
+ };
1463
+ };
1340
1464
 
1341
1465
  // src/cli/scripts/typecheck.ts
1342
1466
  var isCommandService = (service) => service.kind === "command" || Array.isArray(service.command);
@@ -1387,56 +1511,6 @@ var findBin = (name) => {
1387
1511
  const local = resolve4("node_modules", ".bin", name);
1388
1512
  return existsSync3(local) ? local : null;
1389
1513
  };
1390
- var ANSI_COLOR_REGEX2 = new RegExp(`${String.fromCharCode(ANSI_ESCAPE_CODE)}\\[[0-9;]*m`, "g");
1391
- var ANSI_PURPLE_REGEX = `${String.fromCharCode(ANSI_ESCAPE_CODE)}[35m`;
1392
- var ANSI_CYAN_REGEX = new RegExp(`^${String.fromCharCode(ANSI_ESCAPE_CODE)}\\[36m|\\t`);
1393
- var ANSI_TOKEN_END_REGEX = new RegExp(`${String.fromCharCode(ANSI_ESCAPE_CODE)}\\[3[69]m`);
1394
- var stripAnsi2 = (str) => str.replace(ANSI_COLOR_REGEX2, "");
1395
- var formatSvelteOutput = (output) => {
1396
- const cwd = `${process.cwd()}/`;
1397
- const summaryMatch = stripAnsi2(output).match(/svelte-check found (\d+) error/);
1398
- const errorCount = summaryMatch ? parseInt(summaryMatch[1] ?? "0", 10) : 0;
1399
- const formatted = output.split(`
1400
- `).filter((line) => {
1401
- const plain = stripAnsi2(line);
1402
- return !plain.startsWith("Loading svelte-check") && !plain.startsWith("Getting Svelte") && !plain.startsWith("====") && !plain.startsWith("svelte-check found") && !/^\d+ (START|COMPLETED)/.test(plain) && plain.trim() !== "";
1403
- }).flatMap((line) => {
1404
- const result = line.replaceAll(cwd, "");
1405
- const plain = stripAnsi2(result);
1406
- const pathMatch = plain.match(/^(\S+\.svelte):(\d+:\d+)$/);
1407
- if (pathMatch) {
1408
- return [
1409
- `\x1B[96m${pathMatch[1]}\x1B[0m:\x1B[93m${pathMatch[2]}\x1B[0m`
1410
- ];
1411
- }
1412
- if (result.includes(ANSI_PURPLE_REGEX)) {
1413
- const plainLine = stripAnsi2(result);
1414
- const before = stripAnsi2(result.split(ANSI_PURPLE_REGEX)[0] ?? "");
1415
- const token = stripAnsi2((result.split(ANSI_PURPLE_REGEX)[1] ?? "").split(ANSI_TOKEN_END_REGEX)[0] ?? "");
1416
- if (!token)
1417
- return [result];
1418
- const expanded = before.replace(/\t/g, " ");
1419
- const expandedLine = plainLine.replace(/\t/g, " ");
1420
- const underline = "~".repeat(token.length);
1421
- return [
1422
- `\x1B[0m${expandedLine}`,
1423
- `${" ".repeat(expanded.length)}\x1B[91m${underline}\x1B[0m`
1424
- ];
1425
- }
1426
- if (ANSI_CYAN_REGEX.test(result) && !result.includes("Error") && !result.includes(ANSI_PURPLE_REGEX)) {
1427
- return [];
1428
- }
1429
- return [result];
1430
- }).join(`
1431
- `);
1432
- if (errorCount > 0) {
1433
- const suffix = errorCount === 1 ? "" : "s";
1434
- return `${formatted}
1435
-
1436
- Found ${errorCount} error${suffix}.`;
1437
- }
1438
- return formatted;
1439
- };
1440
1514
  var ABSOLUTE_INTERNAL_EXCLUDES = [
1441
1515
  ".absolutejs/**/*",
1442
1516
  "**/build/**/*",
@@ -1547,7 +1621,7 @@ var prepareSvelteShim = async (cacheDir, svelteFiles) => {
1547
1621
  svelteShimPath = shimPath;
1548
1622
  };
1549
1623
  var isWithin = (dir, path) => {
1550
- const rel = relative2(dir, path);
1624
+ const rel = relative3(dir, path);
1551
1625
  return rel === "" || !rel.startsWith("..") && !rel.startsWith("/");
1552
1626
  };
1553
1627
  var svelteRoots = (projectRoot, svelteDirs, svelteFiles) => {
@@ -1555,7 +1629,7 @@ var svelteRoots = (projectRoot, svelteDirs, svelteFiles) => {
1555
1629
  const strays = svelteFiles.filter((file) => !configured.some((dir) => isWithin(dir, file))).map((file) => dirname3(file));
1556
1630
  const candidates = [...new Set([...configured, ...strays])].sort((left, right) => left.length - right.length);
1557
1631
  const roots = candidates.reduce((kept, dir) => kept.some((root) => isWithin(root, dir)) ? kept : [...kept, dir], []);
1558
- return roots.map((dir) => relative2(projectRoot, dir) || ".");
1632
+ return roots.map((dir) => relative3(projectRoot, dir) || ".");
1559
1633
  };
1560
1634
  var manifestKeyDeclarations = [];
1561
1635
  var prepareManifestKeys = async (targets) => {
@@ -1738,7 +1812,7 @@ var svelteCheckIncludes = (projectRoot, configuredDirs, roots) => {
1738
1812
  const configured = configuredDirs.map((dir) => resolve4(projectRoot, dir));
1739
1813
  const strays = roots.filter((root) => !configured.some((dir) => isWithin(dir, resolve4(projectRoot, root))));
1740
1814
  return [
1741
- ...configured.map((dir) => `../${relative2(projectRoot, dir) || "."}/**/*`),
1815
+ ...configured.map((dir) => `../${relative3(projectRoot, dir) || "."}/**/*`),
1742
1816
  ...strays.map((root) => `../${root}/**/*.svelte`)
1743
1817
  ];
1744
1818
  };
@@ -1768,8 +1842,7 @@ var buildSvelteCheck = async (cacheDir, includes) => {
1768
1842
  "--compiler-warnings",
1769
1843
  "css-unused-selector:ignore",
1770
1844
  "--output",
1771
- "human-verbose",
1772
- "--color"
1845
+ "machine-verbose"
1773
1846
  ]);
1774
1847
  };
1775
1848
  var IMPORT_ADVICE_FLAG = "--import-advice";
@@ -1778,7 +1851,7 @@ var serverEntryPaths = (targets) => [
1778
1851
  ...new Set(targets.map((target) => resolve4(target.cwd ?? ".", target.entry ?? DEFAULT_SERVER_ENTRY)).filter((path) => existsSync3(path)))
1779
1852
  ];
1780
1853
  var adviceFor = (path, detailed) => {
1781
- const label = relative2(process.cwd(), path) || path;
1854
+ const label = relative3(process.cwd(), path) || path;
1782
1855
  const entries = deferrableEntryImports(readFileSync3(path, "utf-8"), path);
1783
1856
  return detailed ? formatImportAdvice(entries, label) : summarizeImportAdvice(entries, label);
1784
1857
  };
@@ -1833,6 +1906,25 @@ var dedupeAgainstPlain = (results, checkers, checkerCwd = process.cwd()) => {
1833
1906
  };
1834
1907
  var dedupeAngularResult = (results, cacheDir) => dedupeAgainstPlain(results, ANGULAR_CHECKERS, resolve4(cacheDir));
1835
1908
  var dedupeVueResult = (results) => dedupeAgainstPlain(results, VUE_CHECKERS);
1909
+ var readSource = (file) => {
1910
+ try {
1911
+ return readFileSync3(file, "utf-8");
1912
+ } catch {
1913
+ return null;
1914
+ }
1915
+ };
1916
+ var dedupeSvelteResult = (results, read = readSource) => {
1917
+ const plain = results.find((res) => PLAIN_CHECKERS.has(res.name));
1918
+ const reported = plain && plain.exitCode !== 0 ? diagnosticKeys(plain.output) : new Set;
1919
+ return results.map((res) => {
1920
+ if (res.name !== "svelte-check" || res.exitCode === 0)
1921
+ return res;
1922
+ const { dropped, output, remaining } = svelteCheckReport(res.output, reported, read);
1923
+ if (remaining === 0 && dropped === 0)
1924
+ return res;
1925
+ return { ...res, exitCode: remaining === 0 ? 0 : res.exitCode, output };
1926
+ });
1927
+ };
1836
1928
  var typecheck = async (configPath) => {
1837
1929
  const targets = await getTypecheckTargets(configPath);
1838
1930
  const hasAngular = targets.some((config) => Boolean(config.angularDirectory));
@@ -1872,7 +1964,7 @@ var typecheck = async (configPath) => {
1872
1964
  checks.push(buildSvelteCheck(cacheDir, svelteCheckIncludes(resolve4("."), configuredSvelteDirs, svelteDirs)));
1873
1965
  if (hasAngular && angularDirs.length > 0)
1874
1966
  checks.push(buildAngularCheck(cacheDir, angularDirs));
1875
- const results = dedupeAngularResult(dedupeVueResult(await Promise.all(checks)), cacheDir);
1967
+ const results = dedupeAngularResult(dedupeSvelteResult(dedupeVueResult(await Promise.all(checks))), cacheDir);
1876
1968
  const failed = results.filter((res) => res.exitCode !== 0);
1877
1969
  const detailedAdvice = importAdviceRequested();
1878
1970
  if (failed.length === 0) {
@@ -1885,8 +1977,7 @@ var typecheck = async (configPath) => {
1885
1977
  for (const result of failed) {
1886
1978
  console.error(`
1887
1979
  \x1B[31m[${result.name}]\x1B[0m`);
1888
- const output = result.name === "svelte-check" ? formatSvelteOutput(result.output) : result.output;
1889
- console.error(output);
1980
+ console.error(result.output);
1890
1981
  }
1891
1982
  console.error(`
1892
1983
  \x1B[31m\u2717\x1B[0m Typecheck failed: ${failed.map((res) => res.name).join(", ")}`);
@@ -739,7 +739,7 @@ var init_workspacePackages = __esm(() => {
739
739
 
740
740
  // src/dev/hot/analyze.ts
741
741
  import { dirname, extname } from "path";
742
- var ANALYZER_VERSION = 2, hashText = (text) => Bun.hash(text).toString(36), scriptKindFor = (tsc, path) => {
742
+ var ANALYZER_VERSION = 3, hashText = (text) => Bun.hash(text).toString(36), scriptKindFor = (tsc, path) => {
743
743
  switch (extname(path)) {
744
744
  case ".tsx":
745
745
  return tsc.ScriptKind.TSX;
@@ -1245,6 +1245,12 @@ var ANALYZER_VERSION = 2, hashText = (text) => Bun.hash(text).toString(36), scri
1245
1245
  return statement.declares.map((name) => `${statement.id}:${name}`);
1246
1246
  return [statement.id];
1247
1247
  };
1248
+ const bindingsOf = (statement) => [...new Set(statement.refs.map((reference) => reference.name))].sort().map((name) => {
1249
+ const imported = imports.get(name);
1250
+ if (!imported)
1251
+ return `${name}=local`;
1252
+ return `${name}=${imported.module ?? imported.specifier ?? ""}#${imported.name}`;
1253
+ }).join("\x00");
1248
1254
  const plan = planned.map((statement) => {
1249
1255
  const deps = new Set;
1250
1256
  for (const reference of statement.refs) {
@@ -1257,7 +1263,7 @@ var ANALYZER_VERSION = 2, hashText = (text) => Bun.hash(text).toString(36), scri
1257
1263
  always: statement.kind === "untouched",
1258
1264
  cell: statement.kind === "let",
1259
1265
  deps: [...deps].sort((left, right) => left - right),
1260
- hash: statement.ownHash,
1266
+ hash: hashText(`${statement.ownHash}\x00${bindingsOf(statement)}`),
1261
1267
  ids: idsOf(statement),
1262
1268
  imports: evalImports(statement).map((use) => [
1263
1269
  use.module,
package/dist/index.js CHANGED
@@ -11554,6 +11554,7 @@ var init_pageMetadata = __esm(() => {
11554
11554
  });
11555
11555
 
11556
11556
  // src/utils/spaRouteManifest.ts
11557
+ import { NotFound as NotFound2 } from "elysia";
11557
11558
  import { basename as basename4 } from "path";
11558
11559
  var SPA_ROUTES_KEY = "__absoluteSpaRoutes", setSpaRouteManifest = (hosts) => {
11559
11560
  Reflect.set(globalThis, SPA_ROUTES_KEY, hosts);
@@ -11618,7 +11619,14 @@ var SPA_ROUTES_KEY = "__absoluteSpaRoutes", setSpaRouteManifest = (hosts) => {
11618
11619
  }, renderSpaNotFound = async (framework, pageName, request) => {
11619
11620
  if (isKnownSpaRoute(framework, pageName, request))
11620
11621
  return null;
11621
- return await renderFirstNotFound() ?? new Response("Not found", {
11622
+ return renderSpaNotFoundResponse(request);
11623
+ }, renderSpaNotFoundResponse = async (request) => {
11624
+ if (request && !isPageRequest(request)) {
11625
+ return new NotFound2().toResponse();
11626
+ }
11627
+ return await renderFirstNotFound({
11628
+ preferHtmx: request?.headers.get("hx-request") === "true"
11629
+ }) ?? new Response("Not found", {
11622
11630
  headers: { "Content-Type": "text/plain" },
11623
11631
  status: 404
11624
11632
  });
@@ -35959,7 +35967,7 @@ var init_backendGraph = __esm(() => {
35959
35967
 
35960
35968
  // src/dev/hot/analyze.ts
35961
35969
  import { dirname as dirname45, extname as extname23 } from "path";
35962
- var ANALYZER_VERSION = 2, hashText = (text) => Bun.hash(text).toString(36), scriptKindFor = (tsc, path) => {
35970
+ var ANALYZER_VERSION = 3, hashText = (text) => Bun.hash(text).toString(36), scriptKindFor = (tsc, path) => {
35963
35971
  switch (extname23(path)) {
35964
35972
  case ".tsx":
35965
35973
  return tsc.ScriptKind.TSX;
@@ -36465,6 +36473,12 @@ var ANALYZER_VERSION = 2, hashText = (text) => Bun.hash(text).toString(36), scri
36465
36473
  return statement.declares.map((name) => `${statement.id}:${name}`);
36466
36474
  return [statement.id];
36467
36475
  };
36476
+ const bindingsOf = (statement) => [...new Set(statement.refs.map((reference) => reference.name))].sort().map((name) => {
36477
+ const imported = imports.get(name);
36478
+ if (!imported)
36479
+ return `${name}=local`;
36480
+ return `${name}=${imported.module ?? imported.specifier ?? ""}#${imported.name}`;
36481
+ }).join("\x00");
36468
36482
  const plan = planned.map((statement) => {
36469
36483
  const deps = new Set;
36470
36484
  for (const reference of statement.refs) {
@@ -36477,7 +36491,7 @@ var ANALYZER_VERSION = 2, hashText = (text) => Bun.hash(text).toString(36), scri
36477
36491
  always: statement.kind === "untouched",
36478
36492
  cell: statement.kind === "let",
36479
36493
  deps: [...deps].sort((left, right) => left - right),
36480
- hash: statement.ownHash,
36494
+ hash: hashText(`${statement.ownHash}\x00${bindingsOf(statement)}`),
36481
36495
  ids: idsOf(statement),
36482
36496
  imports: evalImports(statement).map((use) => [
36483
36497
  use.module,
@@ -37431,6 +37445,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
37431
37445
  state.fileHashes.set(normalizePath2(filePath), currentHash);
37432
37446
  return;
37433
37447
  }
37448
+ if (framework === "react" && globalThis.__absoluteBackendHmr === true)
37449
+ applyBackendEdit(resolvePath(filePath)).catch((error) => console.error("[hmr] server update for a React file failed:", error));
37434
37450
  if (!hasFileChanged(filePath, currentHash, state.fileHashes)) {
37435
37451
  return;
37436
37452
  }
@@ -37477,8 +37493,6 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
37477
37493
  return;
37478
37494
  if (await rebuildReactServerComponents(state, config, filePath, currentHash))
37479
37495
  return;
37480
- if (framework === "react" && globalThis.__absoluteBackendHmr === true)
37481
- applyBackendEdit(resolvePath(filePath)).catch((error) => console.error("[hmr] server update for a React file failed:", error));
37482
37496
  if (framework === "unknown") {
37483
37497
  invalidate(resolvePath(filePath));
37484
37498
  const relPath = relative35(process.cwd(), filePath);
@@ -42550,7 +42564,7 @@ var init_partialPrerenderServe = __esm(() => {
42550
42564
  import { createHash as createHash13 } from "crypto";
42551
42565
  import { existsSync as existsSync63, readdirSync as readdirSync15, readFileSync as readFileSync59 } from "fs";
42552
42566
  import { basename as basename26, join as join81, relative as relative37, resolve as resolvePath4 } from "path";
42553
- import { Elysia as Elysia16, ElysiaError, InternalServerError, NotFound as NotFound2 } from "elysia";
42567
+ import { Elysia as Elysia16, ElysiaError, InternalServerError, NotFound as NotFound3 } from "elysia";
42554
42568
  var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_PLUGIN_RETRY_DELAY_MS = 50, waitForStaticPluginRetry = () => new Promise((resolve) => {
42555
42569
  setTimeout(resolve, STATIC_PLUGIN_RETRY_DELAY_MS);
42556
42570
  }), retryStaticPlugin = async (createStaticPlugin, options) => {
@@ -42857,7 +42871,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
42857
42871
  return new Elysia16({ name: "absolutejs-vitals-disabled" });
42858
42872
  const { endpoint } = resolveVitalsConfig(config.vitals);
42859
42873
  return endpoint.startsWith("/") ? createVitalsPlugin(endpoint) : new Elysia16({ name: "absolutejs-vitals-remote" });
42860
- }, createNotFoundPlugin = () => new Elysia16({ name: "absolutejs-not-found" }).onError("global", NotFound2, async ({ request }) => {
42874
+ }, createNotFoundPlugin = () => new Elysia16({ name: "absolutejs-not-found" }).onError("global", NotFound3, async ({ request }) => {
42861
42875
  if (!isPageRequest(request))
42862
42876
  return;
42863
42877
  const response = await renderFirstNotFound({
@@ -44758,7 +44772,7 @@ init_devtoolsJson();
44758
44772
  // src/plugins/lazyPlugin.ts
44759
44773
  init_constants();
44760
44774
  var {env: env5 } = globalThis.Bun;
44761
- import { Elysia as Elysia18, NotFound as NotFound3 } from "elysia";
44775
+ import { Elysia as Elysia18, NotFound as NotFound4 } from "elysia";
44762
44776
  import { buildGlobalWSHandler as buildGlobalWSHandler2 } from "elysia/ws";
44763
44777
  var MAX_MODULE_UNWRAP_DEPTH = 8;
44764
44778
  var MODULE_META_KEYS = new Set(["__esModule"]);
@@ -44854,7 +44868,7 @@ var lazyPlugin = (options) => {
44854
44868
  };
44855
44869
  const dispatch = async (request) => {
44856
44870
  if (mounted)
44857
- throw new NotFound3;
44871
+ throw new NotFound4;
44858
44872
  loading ??= loadPlugin(options, prefix);
44859
44873
  let plugin;
44860
44874
  try {
@@ -50493,5 +50507,5 @@ export {
50493
50507
  wrapPageHandlerWithStreamingSlots
50494
50508
  };
50495
50509
 
50496
- //# debugId=02D6FDFF9A463B1864756E2164756E21
50510
+ //# debugId=16437D806FE96BF764756E2164756E21
50497
50511
  //# sourceMappingURL=index.js.map