@timber-js/app 0.2.0-alpha.85 → 0.2.0-alpha.86

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.
@@ -70,6 +70,17 @@ export interface RscDebugComponentInfo {
70
70
  * Returns an empty string if no components are provided.
71
71
  */
72
72
  export declare function formatRscDebugContext(components: RscDebugComponentInfo[]): string;
73
+ /**
74
+ * Source-map an error's stack trace using the Vite dev server's module graph.
75
+ *
76
+ * Exported so that the fallback error renderer (fallback-error.ts) can
77
+ * source-map errors before rendering the dev error page. Without this,
78
+ * the dev error page shows transpiled positions (e.g. page.tsx:1:1 instead
79
+ * of page.tsx:4:9).
80
+ *
81
+ * See TIM-811.
82
+ */
83
+ export declare function fixErrorStacktrace(server: ViteDevServer, error: Error, phase?: ErrorPhase): void;
73
84
  /**
74
85
  * Send an error to Vite's browser overlay and log it to stderr.
75
86
  *
@@ -1 +1 @@
1
- {"version":3,"file":"dev-error-overlay.d.ts","sourceRoot":"","sources":["../../src/plugins/dev-error-overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,MAAM,CAAC;AAoC1D,0DAA0D;AAC1D,MAAM,MAAM,UAAU,GAClB,kBAAkB,GAClB,OAAO,GACP,YAAY,GACZ,QAAQ,GACR,QAAQ,GACR,SAAS,CAAC;AAEd,kCAAkC;AAClC,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAOnD,CAAC;AAIF,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,WAAW,GAAG,UAAU,CAAC;AAEzD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,CAU/E;AAID;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAUnE;AAID,UAAU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AK,EACZ,KAAK,EAAE,UAAU,EACjB,WAAW,EAAE,MAAM,EACnB,kBAAkB,CAAC,EAAE,qBAAqB,EAAE,GAC3C,IAAI,CA0CN"}
@@ -1 +1 @@
1
- {"version":3,"file":"dev-server.d.ts","sourceRoot":"","sources":["../../src/plugins/dev-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAiC,MAAM,MAAM,CAAC;AAGlE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AA6C1D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAkE1D"}
1
+ {"version":3,"file":"dev-server.d.ts","sourceRoot":"","sources":["../../src/plugins/dev-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAiC,MAAM,MAAM,CAAC;AAGlE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AA8C1D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAkE1D"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Dev-only error source-mapping bridge.
3
+ *
4
+ * Stores a callback that rewrites an error's stack trace using the Vite
5
+ * dev server's module graph. Set by the RSC entry on startup (via
6
+ * setDevSourceMapHandler), consumed by error renderers before generating
7
+ * error pages.
8
+ *
9
+ * In production, the callback is never set — all calls are no-ops.
10
+ *
11
+ * See TIM-811.
12
+ */
13
+ /**
14
+ * Set the source-map callback. Called once during dev server initialization.
15
+ */
16
+ export declare function setSourceMapCallback(fn: (error: Error) => void): void;
17
+ /**
18
+ * Source-map an error's stack trace in-place if the callback is available.
19
+ * No-op in production or before the dev server initializes.
20
+ */
21
+ export declare function sourceMapError(error: unknown): void;
22
+ //# sourceMappingURL=dev-source-map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-source-map.d.ts","sourceRoot":"","sources":["../../src/server/dev-source-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI,CAErE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAInD"}
@@ -1 +1 @@
1
- {"version":3,"file":"fallback-error.d.ts","sourceRoot":"","sources":["../../src/server/fallback-error.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAIrE;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,OAAO,EACd,GAAG,EAAE,OAAO,EACZ,eAAe,EAAE,OAAO,EACxB,KAAK,EAAE,OAAO,EACd,WAAW,EAAE,mBAAmB,EAChC,eAAe,EAAE,qBAAqB,EACtC,WAAW,CAAC,EAAE,eAAe,EAC7B,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,QAAQ,CAAC,CAwCnB;AAED;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAyBhG"}
1
+ {"version":3,"file":"fallback-error.d.ts","sourceRoot":"","sources":["../../src/server/fallback-error.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAKrE;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,OAAO,EACd,GAAG,EAAE,OAAO,EACZ,eAAe,EAAE,OAAO,EACxB,KAAK,EAAE,OAAO,EACd,WAAW,EAAE,mBAAmB,EAChC,eAAe,EAAE,qBAAqB,EACtC,WAAW,CAAC,EAAE,eAAe,EAC7B,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,QAAQ,CAAC,CA4CnB;AAED;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAyBhG"}
@@ -1918,7 +1918,16 @@ function createPipeline(config) {
1918
1918
  applyCookieJar(responseHeaders);
1919
1919
  return buildRedirectResponse(error, req, responseHeaders);
1920
1920
  }
1921
- if (error instanceof DenySignal) return new Response(null, { status: error.status });
1921
+ if (error instanceof DenySignal) {
1922
+ applyCookieJar(responseHeaders);
1923
+ if (config.renderDenyFallback) try {
1924
+ return await config.renderDenyFallback(error, req, responseHeaders);
1925
+ } catch {}
1926
+ return new Response(null, {
1927
+ status: error.status,
1928
+ headers: responseHeaders
1929
+ });
1930
+ }
1922
1931
  logMiddlewareError({
1923
1932
  method,
1924
1933
  path,
@@ -1936,7 +1945,15 @@ function createPipeline(config) {
1936
1945
  markResponseFlushed();
1937
1946
  return response;
1938
1947
  } catch (error) {
1939
- if (error instanceof DenySignal) return new Response(null, { status: error.status });
1948
+ if (error instanceof DenySignal) {
1949
+ if (config.renderDenyFallback) try {
1950
+ return await config.renderDenyFallback(error, req, responseHeaders);
1951
+ } catch {}
1952
+ return new Response(null, {
1953
+ status: error.status,
1954
+ headers: responseHeaders
1955
+ });
1956
+ }
1940
1957
  if (error instanceof RedirectSignal) return buildRedirectResponse(error, req, responseHeaders);
1941
1958
  logRenderError({
1942
1959
  method,