@timber-js/app 0.2.0-alpha.4 → 0.2.0-alpha.5

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 (33) hide show
  1. package/dist/_chunks/debug-gwlJkDuf.js +108 -0
  2. package/dist/_chunks/debug-gwlJkDuf.js.map +1 -0
  3. package/dist/_chunks/{format-CwdaB0_2.js → format-DviM89f0.js} +2 -2
  4. package/dist/_chunks/{format-CwdaB0_2.js.map → format-DviM89f0.js.map} +1 -1
  5. package/dist/_chunks/{request-context-CZJi4CuK.js → request-context-DIkVh_jG.js} +2 -2
  6. package/dist/_chunks/{request-context-CZJi4CuK.js.map → request-context-DIkVh_jG.js.map} +1 -1
  7. package/dist/cookies/index.js +1 -1
  8. package/dist/fonts/local.d.ts +4 -2
  9. package/dist/fonts/local.d.ts.map +1 -1
  10. package/dist/index.js +190 -9
  11. package/dist/index.js.map +1 -1
  12. package/dist/plugins/entries.d.ts +7 -0
  13. package/dist/plugins/entries.d.ts.map +1 -1
  14. package/dist/plugins/fonts.d.ts +2 -1
  15. package/dist/plugins/fonts.d.ts.map +1 -1
  16. package/dist/plugins/mdx.d.ts +6 -0
  17. package/dist/plugins/mdx.d.ts.map +1 -1
  18. package/dist/server/action-client.d.ts.map +1 -1
  19. package/dist/server/debug.d.ts +46 -15
  20. package/dist/server/debug.d.ts.map +1 -1
  21. package/dist/server/index.js +4 -4
  22. package/dist/server/index.js.map +1 -1
  23. package/dist/server/rsc-entry/index.d.ts.map +1 -1
  24. package/package.json +1 -1
  25. package/src/fonts/local.ts +7 -3
  26. package/src/plugins/entries.ts +7 -4
  27. package/src/plugins/fonts.ts +106 -5
  28. package/src/plugins/mdx.ts +9 -5
  29. package/src/server/action-client.ts +7 -4
  30. package/src/server/debug.ts +55 -17
  31. package/src/server/rsc-entry/index.ts +17 -6
  32. package/dist/_chunks/debug-B4WUeqJ-.js +0 -75
  33. package/dist/_chunks/debug-B4WUeqJ-.js.map +0 -1
@@ -12,6 +12,13 @@
12
12
  */
13
13
  import type { Plugin } from 'vite';
14
14
  import type { PluginContext } from '#/index.js';
15
+ /**
16
+ * Detect the user's instrumentation.ts file at the project root.
17
+ *
18
+ * Checks for instrumentation.ts, .js, and .mjs — matching the same
19
+ * extensions as timber.config.ts detection.
20
+ */
21
+ export declare function detectInstrumentationFile(root: string): string | null;
15
22
  /**
16
23
  * Generate the virtual:timber-instrumentation module source.
17
24
  *
@@ -1 +1 @@
1
- {"version":3,"file":"entries.d.ts","sourceRoot":"","sources":["../../src/plugins/entries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAInC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AA4HhD;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAAC,mBAAmB,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAwBxF;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAwExD"}
1
+ {"version":3,"file":"entries.d.ts","sourceRoot":"","sources":["../../src/plugins/entries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAInC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AA6GhD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUrE;AAED;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAAC,mBAAmB,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAwBxF;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAwExD"}
@@ -59,7 +59,8 @@ export declare function parseGoogleFontFamilies(source: string): Map<string, str
59
59
  /**
60
60
  * Generate the CSS output for all extracted fonts.
61
61
  *
62
- * Includes @font-face rules, fallback @font-face rules, and scoped classes.
62
+ * Includes @font-face rules for local fonts, fallback @font-face rules,
63
+ * and scoped classes.
63
64
  */
64
65
  export declare function generateAllFontCss(registry: FontRegistry): string;
65
66
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../src/plugins/fonts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAkBxE;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AA4CtD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAE7E;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAE5F;AAUD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAkB/D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAqB3E;AAwED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAiBjE;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKtE;AAqED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAoOtD"}
1
+ {"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../src/plugins/fonts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,MAAM,CAAC;AAGlD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAoBxE;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AA4CtD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAE7E;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAE5F;AAUD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAkB/D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAqB3E;AAwED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAwBjE;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKtE;AAqED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CA6TtD"}
@@ -9,6 +9,12 @@
9
9
  */
10
10
  import type { Plugin } from 'vite';
11
11
  import type { PluginContext } from '#/index.js';
12
+ /**
13
+ * Check if mdx-components.tsx (or .ts, .jsx, .js) exists at the project root
14
+ * or in src/. Root takes precedence, matching Next.js behavior.
15
+ * Returns the absolute path if found, otherwise undefined.
16
+ */
17
+ export declare function findMdxComponents(root: string): string | undefined;
12
18
  /**
13
19
  * Create the timber-mdx Vite plugin.
14
20
  *
@@ -1 +1 @@
1
- {"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../../src/plugins/mdx.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAmDhD;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CA0GpD"}
1
+ {"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../../src/plugins/mdx.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAIhD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAelE;AA+BD;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CA0GpD"}
@@ -1 +1 @@
1
- {"version":3,"file":"action-client.d.ts","sourceRoot":"","sources":["../../src/server/action-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH;;;;;;;GAOG;AACH,qBAAa,WAAW,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,KAAK;IACnE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;gBAEvC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OA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
2
  * Runtime debug flag for timber.js.
3
3
  *
4
- * Provides `isDebug()` a runtime check that returns true when timber's
5
- * debug/warning logging should be active. This is true in two cases:
4
+ * Two distinct functions for two distinct security levels:
6
5
  *
7
- * 1. Development mode: `process.env.NODE_ENV !== 'production'`
8
- * (statically replaced and tree-shaken in production builds — zero cost)
6
+ * ## `isDebug()` server-side logging only
9
7
  *
10
- * 2. TIMBER_DEBUG flag: A runtime environment variable that survives
11
- * production builds. When set to any truthy value ("1", "true", etc.),
12
- * timber's own diagnostics are re-enabled without affecting React's mode.
8
+ * Returns true when timber's debug/warning messages should be written to
9
+ * stderr / the server console. This NEVER affects what is sent to the
10
+ * client (no error details, no timing headers, no stack traces).
13
11
  *
14
- * The TIMBER_DEBUG check uses a dynamic property access pattern that
15
- * prevents the bundler from statically replacing or eliminating it.
12
+ * Active when any of:
13
+ * - `NODE_ENV !== 'production'` (standard dev mode)
14
+ * - `TIMBER_DEBUG` env var is set to a truthy value at runtime
15
+ * - `timber.config.ts` has `debug: true`
16
+ *
17
+ * ## `isDevMode()` — client-visible dev behavior
18
+ *
19
+ * Returns true ONLY when `NODE_ENV !== 'production'`. This gates anything
20
+ * that changes what clients can observe:
21
+ * - Dev error pages with stack traces (fallback-error.ts)
22
+ * - Detailed Server-Timing headers (pipeline.ts)
23
+ * - Error messages in action INTERNAL_ERROR payloads (action-client.ts)
24
+ * - Pipeline error handler wiring (Vite overlay)
25
+ *
26
+ * `isDevMode()` is statically replaced in production builds → the guarded
27
+ * code is tree-shaken to zero bytes. TIMBER_DEBUG cannot enable it.
16
28
  *
17
29
  * Usage:
18
30
  * In Cloudflare Workers wrangler.toml:
@@ -25,27 +37,46 @@
25
37
  * In timber.config.ts:
26
38
  * export default { debug: true }
27
39
  *
40
+ * See design/13-security.md for the security taxonomy.
28
41
  * See design/18-build-system.md for build pipeline details.
29
42
  */
43
+ /**
44
+ * Check if the application is running in development mode.
45
+ *
46
+ * This is the ONLY function that should gate client-visible dev behavior:
47
+ * - Dev error pages with stack traces
48
+ * - Detailed Server-Timing response headers
49
+ * - Error messages in action `INTERNAL_ERROR` payloads
50
+ * - Pipeline error handler wiring (Vite overlay)
51
+ *
52
+ * Returns `process.env.NODE_ENV !== 'production'`, which is statically
53
+ * replaced by the bundler in production builds. Code guarded by this
54
+ * function is tree-shaken to zero bytes in production.
55
+ *
56
+ * TIMBER_DEBUG does NOT enable this — that would leak server internals
57
+ * to clients. Use `isDebug()` for server-side-only logging.
58
+ */
59
+ export declare function isDevMode(): boolean;
30
60
  /**
31
61
  * Set the debug flag from timber.config.ts.
32
62
  * Called during handler initialization.
33
63
  */
34
64
  export declare function setDebugFromConfig(debug: boolean): void;
35
65
  /**
36
- * Check if timber debug logging is active.
66
+ * Check if timber debug logging is active (server-side only).
37
67
  *
38
68
  * Returns true if ANY of these conditions hold:
39
69
  * - NODE_ENV is not 'production' (standard dev mode)
40
70
  * - TIMBER_DEBUG environment variable is set to a truthy value at runtime
41
71
  * - timber.config.ts has `debug: true`
42
72
  *
43
- * The TIMBER_DEBUG check is deliberately written as a dynamic property
44
- * access so bundlers cannot statically replace it. The `_envKey` variable
45
- * prevents the bundler from seeing `process.env.TIMBER_DEBUG` as a
46
- * compile-time constant.
73
+ * This function controls ONLY server-side logging messages written to
74
+ * stderr or the server console. It NEVER affects client-visible behavior
75
+ * (error pages, response headers, action payloads). For client-visible
76
+ * behavior, use `isDevMode()`.
47
77
  *
48
- * This function is intentionally NOT inlineable it reads runtime state.
78
+ * The TIMBER_DEBUG check is deliberately written as a dynamic property
79
+ * access so bundlers cannot statically replace it.
49
80
  */
50
81
  export declare function isDebug(): boolean;
51
82
  //# sourceMappingURL=debug.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/server/debug.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAUH;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAEvD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,OAAO,IAAI,OAAO,CAYjC"}
1
+ {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/server/debug.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAIH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAEnC;AAUD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAEvD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,OAAO,IAAI,OAAO,CAYjC"}
@@ -1,8 +1,8 @@
1
- import { t as isDebug } from "../_chunks/debug-B4WUeqJ-.js";
2
- import { a as warnDenyAfterFlush, c as warnRedirectInAccess, d as warnSlowSlotWithoutSuspense, f as warnStaticRequestApi, i as warnCacheRequestProps, l as warnRedirectInSlotAccess, n as WarningId, o as warnDenyInSuspense, p as warnSuspenseWrappingChildren, r as setViteServer, s as warnDynamicApiInStaticBuild, t as formatSize, u as warnRedirectInSuspense } from "../_chunks/format-CwdaB0_2.js";
1
+ import { n as isDevMode, t as isDebug } from "../_chunks/debug-gwlJkDuf.js";
2
+ import { a as warnDenyAfterFlush, c as warnRedirectInAccess, d as warnSlowSlotWithoutSuspense, f as warnStaticRequestApi, i as warnCacheRequestProps, l as warnRedirectInSlotAccess, n as WarningId, o as warnDenyInSuspense, p as warnSuspenseWrappingChildren, r as setViteServer, s as warnDynamicApiInStaticBuild, t as formatSize, u as warnRedirectInSuspense } from "../_chunks/format-DviM89f0.js";
3
3
  import { i as getMetadataRouteServePath, n as classifyMetadataRoute, r as getMetadataRouteAutoLink, t as METADATA_ROUTE_CONVENTIONS } from "../_chunks/metadata-routes-Cjmvi3rQ.js";
4
4
  import { a as timingAls, i as revalidationAls, n as formFlashAls, s as waitUntilAls, t as earlyHintsSenderAls } from "../_chunks/als-registry-B7DbZ2hS.js";
5
- import { a as markResponseFlushed, c as setCookieSecrets, i as headers, l as setMutableCookieContext, n as cookies, o as runWithRequestContext, r as getSetCookieHeaders, s as searchParams, t as applyRequestHeaderOverlay, u as setParsedSearchParams } from "../_chunks/request-context-CZJi4CuK.js";
5
+ import { a as markResponseFlushed, c as setCookieSecrets, i as headers, l as setMutableCookieContext, n as cookies, o as runWithRequestContext, r as getSetCookieHeaders, s as searchParams, t as applyRequestHeaderOverlay, u as setParsedSearchParams } from "../_chunks/request-context-DIkVh_jG.js";
6
6
  import { a as replaceTraceId, c as spanId, i as getTraceStore, l as traceId, n as generateTraceId, o as runWithTraceId, r as getOtelTraceId, s as setSpanAttribute, t as addSpanEvent, u as withSpan } from "../_chunks/tracing-Cwn7697K.js";
7
7
  import { readFile } from "node:fs/promises";
8
8
  //#region src/server/waituntil-bridge.ts
@@ -2792,7 +2792,7 @@ function handleActionError(error) {
2792
2792
  } };
2793
2793
  return { serverError: {
2794
2794
  code: "INTERNAL_ERROR",
2795
- ...isDebug() && error instanceof Error ? { data: { message: error.message } } : {}
2795
+ ...isDevMode() && error instanceof Error ? { data: { message: error.message } } : {}
2796
2796
  } };
2797
2797
  }
2798
2798
  /**