@timber-js/app 0.2.0-alpha.237 → 0.2.0-alpha.239

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 (97) hide show
  1. package/dist/_chunks/chains-CmzbpG-6.js +1 -0
  2. package/dist/_chunks/{chains-BsGKkMTK.js → chains-DMoHX4yH.js} +2 -2
  3. package/dist/_chunks/{chains-BsGKkMTK.js.map → chains-DMoHX4yH.js.map} +1 -1
  4. package/dist/_chunks/{classify-cmE0Gins.js → classify-BwyAd-dZ.js} +3 -3
  5. package/dist/_chunks/{classify-cmE0Gins.js.map → classify-BwyAd-dZ.js.map} +1 -1
  6. package/dist/_chunks/{cli-check-BwiahbTC.js → cli-check-DQAD9MLo.js} +3 -3
  7. package/dist/_chunks/{cli-check-BwiahbTC.js.map → cli-check-DQAD9MLo.js.map} +1 -1
  8. package/dist/_chunks/{cli-schema-sync-Brw7kTmm.js → cli-schema-sync-C_xNLqBj.js} +1 -1
  9. package/dist/_chunks/{cli-schema-sync-B2ldclRO.js → cli-schema-sync-CmGls3dc.js} +2 -2
  10. package/dist/_chunks/{cli-schema-sync-B2ldclRO.js.map → cli-schema-sync-CmGls3dc.js.map} +1 -1
  11. package/dist/_chunks/{client-dep-entries-C1nMlLKV.js → client-dep-entries-C5BTQtFS.js} +2 -2
  12. package/dist/_chunks/{client-dep-entries-C1nMlLKV.js.map → client-dep-entries-C5BTQtFS.js.map} +1 -1
  13. package/dist/_chunks/{convention-lint-CLpuzY5h.js → convention-lint-GQA6WTRo.js} +2 -2
  14. package/dist/_chunks/{convention-lint-CLpuzY5h.js.map → convention-lint-GQA6WTRo.js.map} +1 -1
  15. package/dist/_chunks/dev-server--4_Ogy_6.js +1 -0
  16. package/dist/_chunks/{dev-server-lrdpD7Ws.js → dev-server-Cr3_Fu5A.js} +244 -26
  17. package/dist/_chunks/dev-server-Cr3_Fu5A.js.map +1 -0
  18. package/dist/_chunks/dev-span-RsVeYYc_.js.map +1 -1
  19. package/dist/_chunks/{scanner-CrB_h6FA.js → interception-CtNt9jPt.js} +169 -1043
  20. package/dist/_chunks/interception-CtNt9jPt.js.map +1 -0
  21. package/dist/_chunks/{live-graph-ChuFfmLi.js → live-graph-HcLScfiV.js} +4 -4
  22. package/dist/_chunks/{live-graph-ChuFfmLi.js.map → live-graph-HcLScfiV.js.map} +1 -1
  23. package/dist/_chunks/{metadata-routes-BL26HCDd.js → metadata-routes-MXNjWOt5.js} +60 -2
  24. package/dist/_chunks/metadata-routes-MXNjWOt5.js.map +1 -0
  25. package/dist/_chunks/{poison-scan-CJ9QfJWb.js → poison-scan-DONdiCGX.js} +2 -2
  26. package/dist/_chunks/{poison-scan-CJ9QfJWb.js.map → poison-scan-DONdiCGX.js.map} +1 -1
  27. package/dist/_chunks/scanner-DSAJjH0x.js +1043 -0
  28. package/dist/_chunks/scanner-DSAJjH0x.js.map +1 -0
  29. package/dist/_chunks/{walkers-BUvpsb2Q.js → walkers-96YopJds.js} +3 -3
  30. package/dist/_chunks/{walkers-BUvpsb2Q.js.map → walkers-96YopJds.js.map} +1 -1
  31. package/dist/analyze/crawl-entry.js +3 -3
  32. package/dist/analyze/graph-command.js +2 -2
  33. package/dist/cli.js +3 -3
  34. package/dist/config-types.d.ts +11 -0
  35. package/dist/config-types.d.ts.map +1 -1
  36. package/dist/config-validation.d.ts.map +1 -1
  37. package/dist/dev-tools/instrumentation.d.ts.map +1 -1
  38. package/dist/dev-tools/log-columns.d.ts +50 -0
  39. package/dist/dev-tools/log-columns.d.ts.map +1 -0
  40. package/dist/dev-tools/logger.d.ts +5 -0
  41. package/dist/dev-tools/logger.d.ts.map +1 -1
  42. package/dist/index.js +6 -155
  43. package/dist/index.js.map +1 -1
  44. package/dist/native/rsc/dev-tools/instrumentation.js +5 -1
  45. package/dist/native/rsc/dev-tools/instrumentation.js.map +1 -1
  46. package/dist/native/rsc/dev-tools/log-columns.js +69 -0
  47. package/dist/native/rsc/dev-tools/log-columns.js.map +1 -0
  48. package/dist/native/rsc/dev-tools/logger.js +60 -33
  49. package/dist/native/rsc/dev-tools/logger.js.map +1 -1
  50. package/dist/native/rsc/manifest.json +1 -0
  51. package/dist/native/rsc/shared/dev-span.js +5 -2
  52. package/dist/native/rsc/shared/dev-span.js.map +1 -1
  53. package/dist/native/rsc/shared/span-waterfall.js +13 -2
  54. package/dist/native/rsc/shared/span-waterfall.js.map +1 -1
  55. package/dist/native/ssr/dev-tools/instrumentation.js +5 -1
  56. package/dist/native/ssr/dev-tools/instrumentation.js.map +1 -1
  57. package/dist/native/ssr/dev-tools/log-columns.js +69 -0
  58. package/dist/native/ssr/dev-tools/log-columns.js.map +1 -0
  59. package/dist/native/ssr/dev-tools/logger.js +60 -33
  60. package/dist/native/ssr/dev-tools/logger.js.map +1 -1
  61. package/dist/native/ssr/manifest.json +1 -0
  62. package/dist/native/ssr/shared/dev-span.js +5 -2
  63. package/dist/native/ssr/shared/dev-span.js.map +1 -1
  64. package/dist/native/ssr/shared/span-waterfall.js +13 -2
  65. package/dist/native/ssr/shared/span-waterfall.js.map +1 -1
  66. package/dist/plugins/dev-precompile.d.ts +42 -14
  67. package/dist/plugins/dev-precompile.d.ts.map +1 -1
  68. package/dist/plugins/dev-server.d.ts.map +1 -1
  69. package/dist/routing/index.js +3 -2
  70. package/dist/routing/manifest-codegen.d.ts +2 -0
  71. package/dist/routing/manifest-codegen.d.ts.map +1 -1
  72. package/dist/server/internal.js +1 -2
  73. package/dist/server/internal.js.map +1 -1
  74. package/dist/shared/dev-span.d.ts +6 -0
  75. package/dist/shared/dev-span.d.ts.map +1 -1
  76. package/dist/shared/span-waterfall.d.ts.map +1 -1
  77. package/docs/api/34-api-config.mdx +18 -0
  78. package/package.json +1 -1
  79. package/src/config-types.ts +11 -0
  80. package/src/config-validation.ts +15 -8
  81. package/src/dev-tools/instrumentation.ts +4 -1
  82. package/src/dev-tools/log-columns.ts +156 -0
  83. package/src/dev-tools/logger.ts +107 -63
  84. package/src/plugins/dev-precompile.ts +108 -20
  85. package/src/plugins/dev-server.ts +12 -11
  86. package/src/routing/manifest-codegen.ts +2 -2
  87. package/src/shared/dev-span.ts +13 -1
  88. package/src/shared/span-waterfall.ts +36 -4
  89. package/dist/_chunks/chains-DHmoKxkO.js +0 -1
  90. package/dist/_chunks/dev-server-BGGGhHXx.js +0 -1
  91. package/dist/_chunks/dev-server-lrdpD7Ws.js.map +0 -1
  92. package/dist/_chunks/metadata-routes-BL26HCDd.js.map +0 -1
  93. package/dist/_chunks/scanner-CrB_h6FA.js.map +0 -1
  94. package/dist/_chunks/segment-keys-Y60KNc8C.js +0 -61
  95. package/dist/_chunks/segment-keys-Y60KNc8C.js.map +0 -1
  96. package/dist/_chunks/tree-match-Bqdr9szG.js +0 -168
  97. package/dist/_chunks/tree-match-Bqdr9szG.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { a as checkPeerDependencies, c as validateConfig, i as VIRTUAL_IDS, n as timberDevServer, o as formatMissingPeers, s as reportConfigErrors } from "./_chunks/dev-server-lrdpD7Ws.js";
1
+ import { a as generateManifestModule, c as formatMissingPeers, i as VIRTUAL_IDS, l as reportConfigErrors, n as timberDevServer, o as generateSchemaModule, s as checkPeerDependencies, u as validateConfig } from "./_chunks/dev-server-Cr3_Fu5A.js";
2
2
  import { i as resolveRenderTimeoutMs } from "./_chunks/render-timeout-MrrqD1wd.js";
3
- import { d as collectInterceptionRewrites, l as getPrerenderExport, n as scanRoutes } from "./_chunks/scanner-CrB_h6FA.js";
4
- import { c as buildDirToRouteMap, n as formatConventionWarnings, o as flushCodegenWrites, r as lintConventions, s as writeRouteCodegen, t as checkAppDirExists } from "./_chunks/convention-lint-CLpuzY5h.js";
5
- import { r as validateSchemaAgainstRoutes, t as collectLeafRoutes } from "./_chunks/walkers-BUvpsb2Q.js";
3
+ import { l as getPrerenderExport, n as scanRoutes } from "./_chunks/scanner-DSAJjH0x.js";
4
+ import { c as buildDirToRouteMap, n as formatConventionWarnings, o as flushCodegenWrites, r as lintConventions, s as writeRouteCodegen, t as checkAppDirExists } from "./_chunks/convention-lint-GQA6WTRo.js";
5
+ import { r as validateSchemaAgainstRoutes, t as collectLeafRoutes } from "./_chunks/walkers-96YopJds.js";
6
6
  import { i as poisonPillSource, r as markerFor, t as EXPLICIT_MARKERS } from "./_chunks/poison-rules-Bmz-lCPi.js";
7
7
  import { t as writeFileAtomic } from "./_chunks/write-file-atomic-DW8m_Atv.js";
8
8
  import { i as withBasePath, n as normalizeBasePath, t as isRelativeBase } from "./_chunks/base-path-DDIx0FXe.js";
@@ -10,7 +10,7 @@ import { n as rscPayloadPath, t as RSC_PAYLOAD_DIR } from "./_chunks/rsc-payload
10
10
  import { a as REDIRECTS_FILE, n as detectFsIdentity, o as RESERVED_OUTPUT_PATHS, r as fsKey, t as EXACT_FS_IDENTITY } from "./_chunks/fs-identity-BmQ_Agg-.js";
11
11
  import { a as EMPTY_BUILD_MANIFEST, n as DEV_SPAN_REPLAY_EVENT, r as DEV_SPAN_SINK_KEY, t as DEV_SPAN_EVENT } from "./_chunks/dev-span-RsVeYYc_.js";
12
12
  import { t as fnv1aHash } from "./_chunks/fast-hash-DddxkU5Y.js";
13
- import { i as detectDirective } from "./_chunks/classify-cmE0Gins.js";
13
+ import { i as detectDirective } from "./_chunks/classify-BwyAd-dZ.js";
14
14
  import { a as contextAdapter, c as loadTimberConfigFile, d as resolveBuildDir, f as resolveClientJavascript, l as mergeFileConfig, m as createNoopTimer, o as createPluginContext, r as adapterConfig, u as resolveAppDir } from "./_chunks/plugin-context-BtaQcMuh.js";
15
15
  import { b as swallow } from "./_chunks/logger-DDLtp5e-.js";
16
16
  import { t as formatSize } from "./_chunks/format-DuPOoXUP.js";
@@ -526,155 +526,6 @@ function timberMdx(ctx) {
526
526
  }
527
527
  };
528
528
  }
529
- // src/routing/manifest-codegen.ts
530
- /**
531
- * Route manifest codegen — generates virtual module source for the route
532
- * manifest and the global schema loader.
533
- *
534
- * Extracted from plugins/routing.ts to keep it under the 500-line budget.
535
- * See design/18-build-system.md §"Virtual Modules".
536
- *
537
- * Task: TIM-1071 item 8
538
- */
539
- var SINGLE_FILE_KEYS = [
540
- "page",
541
- "layout",
542
- "middleware",
543
- "access",
544
- "route",
545
- "error",
546
- "default",
547
- "denied"
548
- ];
549
- var RECORD_FILE_KEYS = [
550
- "statusFiles",
551
- "jsonStatusFiles",
552
- "metadataRoutes"
553
- ];
554
- var SCHEMA_EXTENSIONS = [
555
- ".ts",
556
- ".tsx",
557
- ".js",
558
- ".jsx"
559
- ];
560
- /**
561
- * Generate the virtual module source for the route manifest.
562
- *
563
- * The output is a default-exported object containing the serialized route tree.
564
- * All file references use absolute paths (required for virtual modules).
565
- */
566
- function generateManifestModule(tree, viteRoot) {
567
- const imports = [];
568
- let importIndex = 0;
569
- function addImport(file) {
570
- const varName = `_route${importIndex++}`;
571
- imports.push(`const ${varName} = () => import("${file.filePath}");`);
572
- return varName;
573
- }
574
- function serializeRouteFile(key, file, indent) {
575
- return `${indent}${key}: { load: ${addImport(file)}, filePath: ${JSON.stringify(file.filePath)} },`;
576
- }
577
- function serializeRouteFileRecord(key, record, indent) {
578
- const entries = Object.entries(record);
579
- if (entries.length === 0) return null;
580
- return `${indent}${key}: {\n${entries.map(([name, file]) => {
581
- const v = addImport(file);
582
- return `${indent} ${JSON.stringify(name)}: { load: ${v}, filePath: ${JSON.stringify(file.filePath)} }`;
583
- }).join(",\n")}\n${indent}},`;
584
- }
585
- function serializeNode(node, indent) {
586
- const nextIndent = indent + " ";
587
- const parts = [];
588
- parts.push(`${nextIndent}segmentName: ${JSON.stringify(node.segmentName)},`);
589
- parts.push(`${nextIndent}segmentType: ${JSON.stringify(node.segmentType)},`);
590
- parts.push(`${nextIndent}urlPath: ${JSON.stringify(node.urlPath)},`);
591
- if (node.paramName) parts.push(`${nextIndent}paramName: ${JSON.stringify(node.paramName)},`);
592
- if (node.paramPrefix) parts.push(`${nextIndent}paramPrefix: ${JSON.stringify(node.paramPrefix)},`);
593
- if (node.paramSuffix) parts.push(`${nextIndent}paramSuffix: ${JSON.stringify(node.paramSuffix)},`);
594
- if (node.interceptionMarker) parts.push(`${nextIndent}interceptionMarker: ${JSON.stringify(node.interceptionMarker)},`);
595
- if (node.interceptedSegmentName) parts.push(`${nextIndent}interceptedSegmentName: ${JSON.stringify(node.interceptedSegmentName)},`);
596
- for (const key of SINGLE_FILE_KEYS) {
597
- const file = node[key];
598
- if (file) parts.push(serializeRouteFile(key, file, nextIndent));
599
- }
600
- if (node.csrfExempt) parts.push(`${nextIndent}csrfExempt: true,`);
601
- for (const key of RECORD_FILE_KEYS) {
602
- const record = node[key];
603
- if (record) {
604
- const line = serializeRouteFileRecord(key, record, nextIndent);
605
- if (line) parts.push(line);
606
- }
607
- }
608
- if (node.children.length > 0) {
609
- const childNodes = node.children.map((c) => serializeNode(c, nextIndent));
610
- parts.push(`${nextIndent}children: [\n${childNodes.join(",\n")}\n${nextIndent}],`);
611
- } else parts.push(`${nextIndent}children: [],`);
612
- const slotKeys = Object.keys(node.slots);
613
- if (slotKeys.length > 0) {
614
- const slotEntries = [];
615
- for (const slotName of slotKeys) {
616
- const slotNode = node.slots[slotName];
617
- slotEntries.push(`${nextIndent} ${JSON.stringify(slotName)}: ${serializeNode(slotNode, nextIndent + " ")}`);
618
- }
619
- parts.push(`${nextIndent}slots: {\n${slotEntries.join(",\n")}\n${nextIndent}},`);
620
- } else parts.push(`${nextIndent}slots: {},`);
621
- return `${indent}{\n${parts.join("\n")}\n${indent}}`;
622
- }
623
- const rootSerialized = serializeNode(tree.root, " ");
624
- let proxyLine = "";
625
- if (tree.proxy) proxyLine = ` proxy: { load: ${addImport(tree.proxy)}, filePath: ${JSON.stringify(tree.proxy.filePath)} },`;
626
- let globalErrorLine = "";
627
- if (tree.globalError) globalErrorLine = ` globalError: { load: ${addImport(tree.globalError)}, filePath: ${JSON.stringify(tree.globalError.filePath)} },`;
628
- const rewrites = collectInterceptionRewrites(tree.root);
629
- const rewritesLine = rewrites.length > 0 ? ` interceptionRewrites: ${JSON.stringify(rewrites)},` : "";
630
- return [
631
- "// Auto-generated route manifest — do not edit.",
632
- "// Generated by timber-routing plugin.",
633
- "",
634
- ...imports,
635
- "",
636
- "const manifest = {",
637
- ` viteRoot: ${JSON.stringify(viteRoot)},`,
638
- proxyLine,
639
- globalErrorLine,
640
- rewritesLine,
641
- ` root: ${rootSerialized},`,
642
- "};",
643
- "",
644
- "export default manifest;"
645
- ].filter((line) => line !== void 0 && line !== "").join("\n");
646
- }
647
- /**
648
- * Generate the virtual:timber-schema module.
649
- *
650
- * When app/schema.{ts,tsx,js,jsx} exists, generates a module that
651
- * imports the schema and resolves its segmentParams codecs into a
652
- * bare-name codec map for runtime coercion.
653
- */
654
- function generateSchemaModule(appDir) {
655
- let schemaPath = null;
656
- for (const ext of SCHEMA_EXTENSIONS) {
657
- const candidate = join(appDir, `schema${ext}`);
658
- if (existsSync(candidate)) {
659
- schemaPath = candidate;
660
- break;
661
- }
662
- }
663
- if (!schemaPath) return ["// Auto-generated schema loader — no app/schema.ts found.", "export default null;"].join("\n");
664
- return [
665
- "// Auto-generated schema loader — do not edit.",
666
- "// Generated by timber-routing plugin (TIM-931).",
667
- "",
668
- `import schema from ${JSON.stringify(schemaPath)};`,
669
- `import { resolveSchemaCodecs } from '@timber-js/app/params';`,
670
- "",
671
- "const globalCodecs = schema?.segmentParams",
672
- " ? resolveSchemaCodecs(schema.segmentParams)",
673
- " : null;",
674
- "",
675
- "export default globalCodecs;"
676
- ].join("\n");
677
- }
678
529
  // src/plugins/orphaned-modules.ts
679
530
  /**
680
531
  * The update's modules with each orphan replaced by the RSC entry (whose
@@ -11152,7 +11003,7 @@ function timber(config) {
11152
11003
  console: originalConsole
11153
11004
  });
11154
11005
  ctx.timer.start("client-deps-scan");
11155
- const { clientOptimizeDepsEntries, skipUseServerScanPlugin } = await import("./_chunks/client-dep-entries-C1nMlLKV.js");
11006
+ const { clientOptimizeDepsEntries, skipUseServerScanPlugin } = await import("./_chunks/client-dep-entries-C5BTQtFS.js");
11156
11007
  const entries = await clientOptimizeDepsEntries(resolvedRoot, BROWSER_ENTRY_FILE, buildDir);
11157
11008
  ctx.timer.end("client-deps-scan");
11158
11009
  return {