@timber-js/app 0.2.0-alpha.71 → 0.2.0-alpha.73
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.
- package/dist/_chunks/actions-Dg-ANYHb.js +421 -0
- package/dist/_chunks/actions-Dg-ANYHb.js.map +1 -0
- package/dist/_chunks/{als-registry-BJARkOcu.js → als-registry-HS0LGUl2.js} +1 -1
- package/dist/_chunks/als-registry-HS0LGUl2.js.map +1 -0
- package/dist/_chunks/{define-Dz1bqwaS.js → define-C77ScO0m.js} +14 -14
- package/dist/_chunks/define-C77ScO0m.js.map +1 -0
- package/dist/_chunks/{define-CGuYoRHU.js → define-CZqDwhSu.js} +15 -15
- package/dist/_chunks/define-CZqDwhSu.js.map +1 -0
- package/dist/_chunks/{define-cookie-B5mewxwM.js → define-cookie-C2IkoFGN.js} +9 -8
- package/dist/_chunks/{define-cookie-B5mewxwM.js.map → define-cookie-C2IkoFGN.js.map} +1 -1
- package/dist/_chunks/{format-Rn922VH2.js → dev-warnings-DpGRGoDi.js} +4 -26
- package/dist/_chunks/dev-warnings-DpGRGoDi.js.map +1 -0
- package/dist/_chunks/format-CYBGxKtc.js +14 -0
- package/dist/_chunks/format-CYBGxKtc.js.map +1 -0
- package/dist/_chunks/{interception-CEdHHviP.js → interception-Dpn_UfAD.js} +2 -2
- package/dist/_chunks/{interception-CEdHHviP.js.map → interception-Dpn_UfAD.js.map} +1 -1
- package/dist/_chunks/{segment-context-hzuJ048X.js → merge-search-params-Cm_KIWDX.js} +2 -33
- package/dist/_chunks/merge-search-params-Cm_KIWDX.js.map +1 -0
- package/dist/_chunks/{request-context-CywiO4jV.js → request-context-qMsWgy9C.js} +72 -36
- package/dist/_chunks/request-context-qMsWgy9C.js.map +1 -0
- package/dist/_chunks/{schema-bridge-C4SwjCQD.js → schema-bridge-C3xl_vfb.js} +1 -1
- package/dist/_chunks/{schema-bridge-C4SwjCQD.js.map → schema-bridge-C3xl_vfb.js.map} +1 -1
- package/dist/_chunks/segment-context-fHFLF1PE.js +34 -0
- package/dist/_chunks/segment-context-fHFLF1PE.js.map +1 -0
- package/dist/_chunks/ssr-data-DzuI0bIV.js +88 -0
- package/dist/_chunks/ssr-data-DzuI0bIV.js.map +1 -0
- package/dist/_chunks/{stale-reload-BLUC_Pl_.js → stale-reload-C2plcNtG.js} +1 -1
- package/dist/_chunks/{stale-reload-BLUC_Pl_.js.map → stale-reload-C2plcNtG.js.map} +1 -1
- package/dist/_chunks/{handler-store-BVePM7hp.js → tracing-CCYbKn5n.js} +60 -60
- package/dist/_chunks/tracing-CCYbKn5n.js.map +1 -0
- package/dist/_chunks/use-params-B1AuhI1p.js +307 -0
- package/dist/_chunks/use-params-B1AuhI1p.js.map +1 -0
- package/dist/_chunks/{use-query-states-DAhgj8Gx.js → use-query-states-Lo_s_pw2.js} +4 -4
- package/dist/_chunks/use-query-states-Lo_s_pw2.js.map +1 -0
- package/dist/_chunks/{wrappers-LZbghvn0.js → wrappers-_DTmImGt.js} +1 -1
- package/dist/_chunks/{wrappers-LZbghvn0.js.map → wrappers-_DTmImGt.js.map} +1 -1
- package/dist/adapters/cloudflare-kv-cache.d.ts +64 -0
- package/dist/adapters/cloudflare-kv-cache.d.ts.map +1 -0
- package/dist/adapters/cloudflare-kv-cache.js +95 -0
- package/dist/adapters/cloudflare-kv-cache.js.map +1 -0
- package/dist/cache/index.d.ts +18 -4
- package/dist/cache/index.d.ts.map +1 -1
- package/dist/cache/index.js +78 -12
- package/dist/cache/index.js.map +1 -1
- package/dist/cache/sizeof.d.ts +22 -0
- package/dist/cache/sizeof.d.ts.map +1 -0
- package/dist/cli.d.ts +6 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +6 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/browser-dev.d.ts +27 -1
- package/dist/client/browser-dev.d.ts.map +1 -1
- package/dist/client/browser-entry/action-dispatch.d.ts +17 -0
- package/dist/client/browser-entry/action-dispatch.d.ts.map +1 -0
- package/dist/client/browser-entry/hmr.d.ts +21 -0
- package/dist/client/browser-entry/hmr.d.ts.map +1 -0
- package/dist/client/browser-entry/hydrate.d.ts +46 -0
- package/dist/client/browser-entry/hydrate.d.ts.map +1 -0
- package/dist/client/browser-entry/index.d.ts +30 -0
- package/dist/client/browser-entry/index.d.ts.map +1 -0
- package/dist/client/browser-entry/post-hydration.d.ts +26 -0
- package/dist/client/browser-entry/post-hydration.d.ts.map +1 -0
- package/dist/client/browser-entry/router-init.d.ts +23 -0
- package/dist/client/browser-entry/router-init.d.ts.map +1 -0
- package/dist/client/browser-entry/rsc-stream.d.ts +24 -0
- package/dist/client/browser-entry/rsc-stream.d.ts.map +1 -0
- package/dist/client/browser-entry/scroll.d.ts +19 -0
- package/dist/client/browser-entry/scroll.d.ts.map +1 -0
- package/dist/client/error-boundary.js +131 -1
- package/dist/client/error-boundary.js.map +1 -0
- package/dist/client/index.d.ts +4 -19
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +14 -1191
- package/dist/client/index.js.map +1 -1
- package/dist/client/internal.d.ts +18 -0
- package/dist/client/internal.d.ts.map +1 -0
- package/dist/client/internal.js +890 -0
- package/dist/client/internal.js.map +1 -0
- package/dist/client/navigation-context.d.ts.map +1 -1
- package/dist/client/router-ref.d.ts +1 -1
- package/dist/client/top-loader.d.ts +2 -2
- package/dist/client/use-link-status.d.ts +1 -1
- package/dist/client/{use-navigation-pending.d.ts → use-pending-navigation.d.ts} +4 -4
- package/dist/client/use-pending-navigation.d.ts.map +1 -0
- package/dist/client/use-router.d.ts +1 -1
- package/dist/codec.d.ts +10 -0
- package/dist/codec.d.ts.map +1 -1
- package/dist/codec.js +1 -1
- package/dist/config-types.d.ts +210 -0
- package/dist/config-types.d.ts.map +1 -0
- package/dist/content/index.d.ts +1 -10
- package/dist/content/index.d.ts.map +1 -1
- package/dist/content/index.js +0 -2
- package/dist/cookies/define-cookie.d.ts.map +1 -1
- package/dist/cookies/index.d.ts +0 -2
- package/dist/cookies/index.d.ts.map +1 -1
- package/dist/cookies/index.js +2 -3
- package/dist/index.d.ts +25 -288
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +261 -43
- package/dist/index.js.map +1 -1
- package/dist/plugin-context.d.ts +84 -0
- package/dist/plugin-context.d.ts.map +1 -0
- package/dist/plugins/adapter-build.d.ts +1 -1
- package/dist/plugins/adapter-build.d.ts.map +1 -1
- package/dist/plugins/build-manifest.d.ts +1 -1
- package/dist/plugins/build-manifest.d.ts.map +1 -1
- package/dist/plugins/build-report.d.ts +1 -1
- package/dist/plugins/build-report.d.ts.map +1 -1
- package/dist/plugins/content.d.ts +1 -1
- package/dist/plugins/content.d.ts.map +1 -1
- package/dist/plugins/dev-browser-logs.d.ts +1 -1
- package/dist/plugins/dev-browser-logs.d.ts.map +1 -1
- package/dist/plugins/dev-logs.d.ts +1 -1
- package/dist/plugins/dev-logs.d.ts.map +1 -1
- package/dist/plugins/dev-server.d.ts +1 -1
- package/dist/plugins/dev-server.d.ts.map +1 -1
- package/dist/plugins/entries.d.ts +1 -1
- package/dist/plugins/entries.d.ts.map +1 -1
- package/dist/plugins/fonts.d.ts +1 -1
- package/dist/plugins/fonts.d.ts.map +1 -1
- package/dist/plugins/mdx.d.ts +1 -1
- package/dist/plugins/mdx.d.ts.map +1 -1
- package/dist/plugins/routing.d.ts +1 -1
- package/dist/plugins/routing.d.ts.map +1 -1
- package/dist/plugins/shims.d.ts +1 -1
- package/dist/plugins/shims.d.ts.map +1 -1
- package/dist/plugins/static-build.d.ts +4 -4
- package/dist/plugins/static-build.d.ts.map +1 -1
- package/dist/routing/index.js +1 -1
- package/dist/search-params/define.d.ts +6 -6
- package/dist/search-params/define.d.ts.map +1 -1
- package/dist/search-params/index.d.ts +1 -2
- package/dist/search-params/index.d.ts.map +1 -1
- package/dist/search-params/index.js +4 -4
- package/dist/search-params/registry.d.ts +1 -1
- package/dist/search-params/registry.d.ts.map +1 -1
- package/dist/segment-params/define.d.ts +6 -6
- package/dist/segment-params/define.d.ts.map +1 -1
- package/dist/segment-params/index.d.ts +0 -1
- package/dist/segment-params/index.d.ts.map +1 -1
- package/dist/segment-params/index.js +3 -3
- package/dist/server/als-registry.d.ts +1 -1
- package/dist/server/dev-holding-server.d.ts +52 -0
- package/dist/server/dev-holding-server.d.ts.map +1 -0
- package/dist/server/dev-warnings.d.ts +1 -7
- package/dist/server/dev-warnings.d.ts.map +1 -1
- package/dist/server/index.d.ts +6 -45
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +7 -3272
- package/dist/server/index.js.map +1 -1
- package/dist/server/internal.d.ts +46 -0
- package/dist/server/internal.d.ts.map +1 -0
- package/dist/server/internal.js +2865 -0
- package/dist/server/internal.js.map +1 -0
- package/dist/server/pipeline.d.ts.map +1 -1
- package/dist/server/primitives.d.ts +41 -17
- package/dist/server/primitives.d.ts.map +1 -1
- package/dist/server/request-context.d.ts +45 -15
- package/dist/server/request-context.d.ts.map +1 -1
- package/dist/server/tracing.d.ts +4 -4
- package/dist/server/tracing.d.ts.map +1 -1
- package/dist/shims/headers.d.ts +2 -1
- package/dist/shims/headers.d.ts.map +1 -1
- package/dist/shims/navigation.d.ts +2 -1
- package/dist/shims/navigation.d.ts.map +1 -1
- package/package.json +19 -13
- package/src/adapters/cloudflare-kv-cache.ts +142 -0
- package/src/cache/handler-store.ts +2 -2
- package/src/cache/index.ts +74 -15
- package/src/cache/sizeof.ts +31 -0
- package/src/cli.ts +6 -1
- package/src/client/browser-dev.ts +128 -1
- package/src/client/browser-entry/action-dispatch.ts +116 -0
- package/src/client/browser-entry/hmr.ts +81 -0
- package/src/client/browser-entry/hydrate.ts +145 -0
- package/src/client/browser-entry/index.ts +138 -0
- package/src/client/browser-entry/post-hydration.ts +119 -0
- package/src/client/browser-entry/router-init.ts +184 -0
- package/src/client/browser-entry/rsc-stream.ts +157 -0
- package/src/client/browser-entry/scroll.ts +27 -0
- package/src/client/index.ts +10 -38
- package/src/client/internal.ts +57 -0
- package/src/client/navigation-context.ts +6 -2
- package/src/client/navigation-root.tsx +1 -1
- package/src/client/router-ref.ts +1 -1
- package/src/client/top-loader.tsx +2 -2
- package/src/client/use-link-status.ts +1 -1
- package/src/client/{use-navigation-pending.ts → use-pending-navigation.ts} +5 -5
- package/src/client/use-query-states.ts +2 -2
- package/src/client/use-router.ts +1 -1
- package/src/codec.ts +15 -0
- package/src/config-types.ts +208 -0
- package/src/content/index.ts +5 -13
- package/src/cookies/define-cookie.ts +9 -7
- package/src/cookies/index.ts +6 -5
- package/src/index.ts +84 -416
- package/src/plugin-context.ts +200 -0
- package/src/plugins/adapter-build.ts +1 -1
- package/src/plugins/build-manifest.ts +1 -1
- package/src/plugins/build-report.ts +1 -1
- package/src/plugins/content.ts +1 -1
- package/src/plugins/dev-browser-logs.ts +1 -1
- package/src/plugins/dev-logs.ts +1 -1
- package/src/plugins/dev-server.ts +16 -1
- package/src/plugins/entries.ts +2 -2
- package/src/plugins/fonts.ts +4 -3
- package/src/plugins/mdx.ts +1 -1
- package/src/plugins/routing.ts +1 -1
- package/src/plugins/shims.ts +53 -5
- package/src/plugins/static-build.ts +8 -6
- package/src/search-params/define.ts +22 -22
- package/src/search-params/index.ts +3 -3
- package/src/search-params/registry.ts +1 -1
- package/src/segment-params/define.ts +18 -18
- package/src/segment-params/index.ts +2 -1
- package/src/server/action-handler.ts +1 -1
- package/src/server/als-registry.ts +3 -3
- package/src/server/dev-holding-server.ts +185 -0
- package/src/server/dev-warnings.ts +2 -21
- package/src/server/html-injectors.ts +3 -3
- package/src/server/index.ts +25 -180
- package/src/server/internal.ts +169 -0
- package/src/server/pipeline.ts +12 -7
- package/src/server/primitives.ts +71 -30
- package/src/server/request-context.ts +77 -39
- package/src/server/route-element-builder.ts +1 -1
- package/src/server/rsc-entry/index.ts +2 -2
- package/src/server/rsc-entry/ssr-renderer.ts +1 -1
- package/src/server/slot-resolver.ts +1 -1
- package/src/server/tracing.ts +6 -6
- package/src/server/tree-builder.ts +1 -1
- package/src/shims/headers.ts +5 -1
- package/src/shims/navigation.ts +5 -1
- package/dist/_chunks/als-registry-BJARkOcu.js.map +0 -1
- package/dist/_chunks/define-CGuYoRHU.js.map +0 -1
- package/dist/_chunks/define-Dz1bqwaS.js.map +0 -1
- package/dist/_chunks/error-boundary-D9hzsveV.js +0 -216
- package/dist/_chunks/error-boundary-D9hzsveV.js.map +0 -1
- package/dist/_chunks/format-Rn922VH2.js.map +0 -1
- package/dist/_chunks/handler-store-BVePM7hp.js.map +0 -1
- package/dist/_chunks/request-context-CywiO4jV.js.map +0 -1
- package/dist/_chunks/segment-context-hzuJ048X.js.map +0 -1
- package/dist/_chunks/use-query-states-DAhgj8Gx.js.map +0 -1
- package/dist/client/browser-entry.d.ts +0 -21
- package/dist/client/browser-entry.d.ts.map +0 -1
- package/dist/client/use-navigation-pending.d.ts.map +0 -1
- package/src/client/browser-entry.ts +0 -846
package/dist/index.d.ts
CHANGED
|
@@ -1,296 +1,17 @@
|
|
|
1
|
-
import type { PluginOption } from 'vite';
|
|
2
|
-
import type { RouteTree } from './routing/types';
|
|
3
|
-
import type { BuildManifest } from './server/build-manifest';
|
|
4
|
-
import type { StartupTimer } from './utils/startup-timer';
|
|
5
|
-
/** Configuration for client-side JavaScript output. */
|
|
6
|
-
export interface ClientJavascriptConfig {
|
|
7
|
-
/** When true, no client JS bundles are emitted or referenced in HTML. */
|
|
8
|
-
disabled: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* When `disabled` is true, still inject the Vite HMR client in dev mode
|
|
11
|
-
* so hot reloading works during development. Default: true.
|
|
12
|
-
*/
|
|
13
|
-
enableHMRInDev?: boolean;
|
|
14
|
-
}
|
|
15
|
-
/** Fully resolved client JavaScript configuration (no optionals). */
|
|
16
|
-
export interface ResolvedClientJavascript {
|
|
17
|
-
disabled: boolean;
|
|
18
|
-
enableHMRInDev: boolean;
|
|
19
|
-
}
|
|
20
|
-
export interface TimberUserConfig {
|
|
21
|
-
output?: 'server' | 'static';
|
|
22
|
-
/**
|
|
23
|
-
* Enable timber debug logging in production builds.
|
|
24
|
-
*
|
|
25
|
-
* When `true`, timber's own diagnostics (dev warnings, verbose logging)
|
|
26
|
-
* are active even in production mode. React stays in production mode —
|
|
27
|
-
* only timber's logs are affected.
|
|
28
|
-
*
|
|
29
|
-
* Can also be enabled at runtime via the `TIMBER_DEBUG` environment variable.
|
|
30
|
-
*
|
|
31
|
-
* Default: `false`.
|
|
32
|
-
*/
|
|
33
|
-
debug?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Control client-side JavaScript output.
|
|
36
|
-
*
|
|
37
|
-
* Boolean shorthand:
|
|
38
|
-
* `clientJavascript: false` disables all client JS (equivalent to `{ disabled: true }`).
|
|
39
|
-
* `clientJavascript: true` enables client JS (the default).
|
|
40
|
-
*
|
|
41
|
-
* Object form:
|
|
42
|
-
* `clientJavascript: { disabled: true, enableHMRInDev: true }` disables client JS
|
|
43
|
-
* in production but preserves Vite HMR in dev mode.
|
|
44
|
-
*
|
|
45
|
-
* When `disabled` is true, `enableHMRInDev` defaults to `true`.
|
|
46
|
-
* Server-side JS still runs — this only affects what is sent to the browser.
|
|
47
|
-
*/
|
|
48
|
-
clientJavascript?: boolean | ClientJavascriptConfig;
|
|
49
|
-
adapter?: unknown;
|
|
50
|
-
cacheHandler?: unknown;
|
|
51
|
-
allowedOrigins?: string[];
|
|
52
|
-
csrf?: boolean;
|
|
53
|
-
limits?: {
|
|
54
|
-
actionBodySize?: string;
|
|
55
|
-
uploadBodySize?: string;
|
|
56
|
-
maxFields?: number;
|
|
57
|
-
};
|
|
58
|
-
pageExtensions?: string[];
|
|
59
|
-
/**
|
|
60
|
-
* Slow request threshold in milliseconds. Requests exceeding this emit
|
|
61
|
-
* a warning via the logger. Set to 0 to disable. Default: 3000.
|
|
62
|
-
*
|
|
63
|
-
* See design/17-logging.md §"slowRequestMs".
|
|
64
|
-
*/
|
|
65
|
-
slowRequestMs?: number;
|
|
66
|
-
/**
|
|
67
|
-
* Render timeout in milliseconds. If an SSR render or RSC stream read
|
|
68
|
-
* does not complete within this duration, the render is aborted and
|
|
69
|
-
* the connection is closed. Protects against hung fetches and Suspense
|
|
70
|
-
* components that never resolve.
|
|
71
|
-
*
|
|
72
|
-
* Set to 0 to disable (not recommended in production).
|
|
73
|
-
* Default: 30000 (30 seconds).
|
|
74
|
-
*
|
|
75
|
-
* See design/02-rendering-pipeline.md §"Streaming Constraints".
|
|
76
|
-
*/
|
|
77
|
-
renderTimeoutMs?: number;
|
|
78
|
-
/**
|
|
79
|
-
* Forward browser console output to the server terminal in dev mode.
|
|
80
|
-
*
|
|
81
|
-
* Sets the minimum log level to forward:
|
|
82
|
-
* - `'error'` — only `console.error`
|
|
83
|
-
* - `'warn'` — `console.error` + `console.warn` (default)
|
|
84
|
-
* - `'info'` — `console.error` + `console.warn` + `console.info`
|
|
85
|
-
* - `'none'` — disabled
|
|
86
|
-
*
|
|
87
|
-
* Does not intercept `console.log` or `console.debug` (too noisy).
|
|
88
|
-
* No effect in production builds.
|
|
89
|
-
*
|
|
90
|
-
* See TIM-513.
|
|
91
|
-
*/
|
|
92
|
-
devBrowserLogs?: 'error' | 'warn' | 'info' | 'none';
|
|
93
|
-
/** Dev-mode options. These have no effect in production builds. */
|
|
94
|
-
dev?: {
|
|
95
|
-
/** Threshold in ms to highlight slow phases in dev logging output. Default: 200. */
|
|
96
|
-
slowPhaseMs?: number;
|
|
97
|
-
};
|
|
98
|
-
/**
|
|
99
|
-
* Control Server-Timing header output.
|
|
100
|
-
*
|
|
101
|
-
* - `'detailed'` — per-phase breakdown (proxy, middleware, render). Useful
|
|
102
|
-
* for APM / network monitoring. Exposes phase names to clients.
|
|
103
|
-
* - `'total'` — single `total;dur=N` entry. Safe to expose, gives
|
|
104
|
-
* browser DevTools useful timing without internal details.
|
|
105
|
-
* - `false` — no Server-Timing header at all.
|
|
106
|
-
*
|
|
107
|
-
* Default: `'detailed'` in dev, `'total'` in production.
|
|
108
|
-
*
|
|
109
|
-
* This is separate from `debug` / `TIMBER_DEBUG` — it's an intentional
|
|
110
|
-
* decision to expose timing data to clients, not a side effect of debug
|
|
111
|
-
* logging.
|
|
112
|
-
*/
|
|
113
|
-
serverTiming?: 'detailed' | 'total' | false;
|
|
114
|
-
/**
|
|
115
|
-
* Override the app directory location. By default, timber auto-detects
|
|
116
|
-
* `app/` at the project root, falling back to `src/app/`.
|
|
117
|
-
*
|
|
118
|
-
* Set this to a relative path from the project root (e.g. `'src/app'`)
|
|
119
|
-
* to use a custom location.
|
|
120
|
-
*/
|
|
121
|
-
appDir?: string;
|
|
122
|
-
/** MDX compilation options passed to @mdx-js/rollup. See design/20-content-collections.md. */
|
|
123
|
-
mdx?: {
|
|
124
|
-
remarkPlugins?: unknown[];
|
|
125
|
-
rehypePlugins?: unknown[];
|
|
126
|
-
recmaPlugins?: unknown[];
|
|
127
|
-
remarkRehypeOptions?: Record<string, unknown>;
|
|
128
|
-
};
|
|
129
|
-
/**
|
|
130
|
-
* Built-in top-loader progress bar for client navigations.
|
|
131
|
-
* Shows an animated bar at the top of the viewport during RSC navigations.
|
|
132
|
-
* Enabled by default — set `enabled: false` to opt out.
|
|
133
|
-
*
|
|
134
|
-
* Users who want a fully custom progress indicator should disable this
|
|
135
|
-
* and use `useNavigationPending()` directly.
|
|
136
|
-
*
|
|
137
|
-
* See LOCAL-336 for design decisions.
|
|
138
|
-
*/
|
|
139
|
-
/**
|
|
140
|
-
* Server action bound args encryption configuration.
|
|
141
|
-
*
|
|
142
|
-
* The RSC plugin encrypts closure variables captured by 'use server' functions
|
|
143
|
-
* using AES-256-GCM so they are opaque and tamper-proof in the Flight payload.
|
|
144
|
-
* Encryption is always enabled in production.
|
|
145
|
-
*
|
|
146
|
-
* The encryption key is auto-generated at build time and embedded in the server bundle,
|
|
147
|
-
* so all instances running the same build share the same key automatically.
|
|
148
|
-
* For rolling/blue-green deployments where multiple builds coexist, set
|
|
149
|
-
* `TIMBER_ACTIONS_ENCRYPTION_KEY` env var to share a key across builds.
|
|
150
|
-
*
|
|
151
|
-
* See design/08-forms-and-actions.md §"Security"
|
|
152
|
-
*/
|
|
153
|
-
actionEncryption?: {
|
|
154
|
-
/**
|
|
155
|
-
* Disable encryption in dev mode for easier debugging of bound args.
|
|
156
|
-
* Has no effect in production — encryption is always enabled.
|
|
157
|
-
* Default: false (encryption is on in dev too).
|
|
158
|
-
*/
|
|
159
|
-
disableInDev?: boolean;
|
|
160
|
-
};
|
|
161
|
-
/**
|
|
162
|
-
* Enable the React Compiler (babel-plugin-react-compiler) for automatic
|
|
163
|
-
* memoization of components and hooks at build time.
|
|
164
|
-
*
|
|
165
|
-
* - `true` — enable with default options
|
|
166
|
-
* - `{ compilationMode, target }` — enable with custom options
|
|
167
|
-
* - `compilationMode: 'annotation'` — only compile files with `'use memo'`
|
|
168
|
-
* - `target: '18'` — target React 18 (uses react-compiler-runtime package)
|
|
169
|
-
* - `false` or omitted — disabled (default)
|
|
170
|
-
*
|
|
171
|
-
* Uses `@vitejs/plugin-react`'s built-in `reactCompilerPreset`, which:
|
|
172
|
-
* - Applies Babel only for the compiler pass (OXC handles JSX)
|
|
173
|
-
* - Automatically scopes to client environment only
|
|
174
|
-
* - Uses `react/compiler-runtime` built into React 19
|
|
175
|
-
*
|
|
176
|
-
* Requires `babel-plugin-react-compiler` as a peer dependency.
|
|
177
|
-
*/
|
|
178
|
-
reactCompiler?: boolean | {
|
|
179
|
-
compilationMode?: string;
|
|
180
|
-
target?: string;
|
|
181
|
-
};
|
|
182
|
-
/**
|
|
183
|
-
* Auto-generate sitemap.xml from the route tree.
|
|
184
|
-
*
|
|
185
|
-
* When enabled, timber walks the file-system route tree and produces a sitemap
|
|
186
|
-
* for all discoverable pages. Dynamic routes with `generateStaticParams()` are
|
|
187
|
-
* enumerated. Routes protected by `access.ts` are excluded by default.
|
|
188
|
-
*
|
|
189
|
-
* If a user-authored `sitemap.ts` or `sitemap.xml` exists at the app root,
|
|
190
|
-
* auto-generation is disabled — the user takes full control.
|
|
191
|
-
*
|
|
192
|
-
* Supports automatic pagination (sitemap index) for sites with > 50,000 URLs.
|
|
193
|
-
*
|
|
194
|
-
* See design/16-metadata.md §"Auto-generated Sitemap"
|
|
195
|
-
*/
|
|
196
|
-
sitemap?: {
|
|
197
|
-
/** Must be explicitly `true` to enable auto-generation. Default: false. */
|
|
198
|
-
enabled?: boolean;
|
|
199
|
-
/** Base URL for absolute URLs in the sitemap. Required when enabled. e.g., 'https://example.com' */
|
|
200
|
-
baseUrl?: string;
|
|
201
|
-
/** Default `<changefreq>` for all entries. Optional. */
|
|
202
|
-
defaultChangeFrequency?: string;
|
|
203
|
-
/** Default `<priority>` for all entries (0.0–1.0). Optional. */
|
|
204
|
-
defaultPriority?: number;
|
|
205
|
-
/** Include routes protected by `access.ts`. Default: false. */
|
|
206
|
-
includeProtected?: boolean;
|
|
207
|
-
};
|
|
208
|
-
topLoader?: {
|
|
209
|
-
/** Whether the top-loader is enabled. Default: true. */
|
|
210
|
-
enabled?: boolean;
|
|
211
|
-
/** Bar color. Default: '#2299DD'. */
|
|
212
|
-
color?: string;
|
|
213
|
-
/** Bar height in pixels. Default: 3. */
|
|
214
|
-
height?: number;
|
|
215
|
-
/** Show subtle glow/shadow effect. Default: true. */
|
|
216
|
-
shadow?: boolean;
|
|
217
|
-
/** Delay in ms before showing the bar (avoids flash on fast navs). Default: 0. */
|
|
218
|
-
delay?: number;
|
|
219
|
-
/** CSS z-index. Default: 1600. */
|
|
220
|
-
zIndex?: number;
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Resolve `clientJavascript` into a fully resolved config.
|
|
225
|
-
*/
|
|
226
|
-
export declare function resolveClientJavascript(config: TimberUserConfig): ResolvedClientJavascript;
|
|
227
1
|
/**
|
|
228
|
-
*
|
|
2
|
+
* @timber-js/app — Root entry point (public API).
|
|
229
3
|
*
|
|
230
|
-
*
|
|
231
|
-
* plugin API or global state.
|
|
232
|
-
* See design/18-build-system.md §"Shared Plugin Context".
|
|
233
|
-
*/
|
|
234
|
-
export interface PluginContext {
|
|
235
|
-
config: TimberUserConfig;
|
|
236
|
-
/** Resolved client JavaScript configuration */
|
|
237
|
-
clientJavascript: ResolvedClientJavascript;
|
|
238
|
-
/** The scanned route tree (populated by timber-routing, consumed by timber-entries) */
|
|
239
|
-
routeTree: RouteTree | null;
|
|
240
|
-
/** Absolute path to the app/ directory */
|
|
241
|
-
appDir: string;
|
|
242
|
-
/** Absolute path to the project root */
|
|
243
|
-
root: string;
|
|
244
|
-
/** Whether the dev server is running (set by timber-root-sync in configResolved) */
|
|
245
|
-
dev: boolean;
|
|
246
|
-
/** CSS build manifest (populated by adapter after client build, null in dev) */
|
|
247
|
-
buildManifest: BuildManifest | null;
|
|
248
|
-
/** Per-build deployment ID for version skew detection (null in dev) */
|
|
249
|
-
deploymentId: string | null;
|
|
250
|
-
/** Startup timer for profiling cold start phases (active in dev, no-op in prod) */
|
|
251
|
-
timer: StartupTimer;
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* Resolve the app directory. Checks (in order):
|
|
255
|
-
* 1. Explicit `configAppDir` from timber.config.ts
|
|
256
|
-
* 2. `<root>/app`
|
|
257
|
-
* 3. `<root>/src/app`
|
|
258
|
-
*
|
|
259
|
-
* Throws if none exist.
|
|
260
|
-
*/
|
|
261
|
-
export declare function resolveAppDir(root: string, configAppDir?: string): string;
|
|
262
|
-
/**
|
|
263
|
-
* Load timber.config.ts (or .js, .mjs) from the project root.
|
|
264
|
-
* Returns the config object or null if no config file is found.
|
|
4
|
+
* User-facing exports: timber(), defineConfig(), TimberUserConfig, Routes.
|
|
265
5
|
*
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
|
|
269
|
-
export declare function loadTimberConfigFile(root: string): TimberUserConfig | null;
|
|
270
|
-
/**
|
|
271
|
-
* Detect config keys set in both inline (vite.config.ts) and file (timber.config.ts)
|
|
272
|
-
* and warn the user. The `output` key is excluded because it defaults to 'server'
|
|
273
|
-
* in createPluginContext and would always appear as an inline key.
|
|
6
|
+
* Internal helpers (PluginContext, resolveAppDir, loadTimberConfigFile,
|
|
7
|
+
* warnConfigConflicts, resolveClientJavascript) live in plugin-context.ts
|
|
8
|
+
* and are NOT re-exported here. Sub-plugins import them via relative paths.
|
|
274
9
|
*
|
|
275
|
-
*
|
|
10
|
+
* Design doc: 18-build-system.md §"Plugin Architecture"
|
|
276
11
|
*/
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
*
|
|
281
|
-
* Loads timber.config.ts and all dependencies synchronously before
|
|
282
|
-
* constructing the plugin array. This ensures ALL plugins — including
|
|
283
|
-
* the RSC plugin and React Compiler — see the fully merged config
|
|
284
|
-
* (inline + file-based). No async, no deferred config, no stale reads.
|
|
285
|
-
*
|
|
286
|
-
* Requires Node >= 22.12 for synchronous require() of ESM modules
|
|
287
|
-
* (@vitejs/plugin-rsc is ESM-only).
|
|
288
|
-
*
|
|
289
|
-
* Previous versions used async loading and deferred config merging,
|
|
290
|
-
* causing file-based config for reactCompiler, actionEncryption, and
|
|
291
|
-
* output mode to be silently ignored. See TIM-451.
|
|
292
|
-
*/
|
|
293
|
-
export declare function timber(config?: TimberUserConfig): PluginOption[];
|
|
12
|
+
import type { PluginOption } from 'vite';
|
|
13
|
+
import type { TimberUserConfig } from './config-types.js';
|
|
14
|
+
export type { TimberUserConfig } from './config-types.js';
|
|
294
15
|
/**
|
|
295
16
|
* Route map interface — augmented by the generated timber-routes.d.ts.
|
|
296
17
|
*
|
|
@@ -322,5 +43,21 @@ export interface Routes {
|
|
|
322
43
|
* ```
|
|
323
44
|
*/
|
|
324
45
|
export declare function defineConfig(config: TimberUserConfig): TimberUserConfig;
|
|
46
|
+
/**
|
|
47
|
+
* Create the timber Vite plugin array.
|
|
48
|
+
*
|
|
49
|
+
* Loads timber.config.ts and all dependencies synchronously before
|
|
50
|
+
* constructing the plugin array. This ensures ALL plugins — including
|
|
51
|
+
* the RSC plugin and React Compiler — see the fully merged config
|
|
52
|
+
* (inline + file-based). No async, no deferred config, no stale reads.
|
|
53
|
+
*
|
|
54
|
+
* Requires Node >= 22.12 for synchronous require() of ESM modules
|
|
55
|
+
* (@vitejs/plugin-rsc is ESM-only).
|
|
56
|
+
*
|
|
57
|
+
* Previous versions used async loading and deferred config merging,
|
|
58
|
+
* causing file-based config for reactCompiler, actionEncryption, and
|
|
59
|
+
* output mode to be silently ignored. See TIM-451.
|
|
60
|
+
*/
|
|
61
|
+
export declare function timber(config?: TimberUserConfig): PluginOption[];
|
|
325
62
|
export default timber;
|
|
326
63
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,YAAY,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAU,YAAY,EAAE,MAAM,MAAM,CAAC;AAyBjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAY1D,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;GASG;AAEH,MAAM,WAAW,MAAM;CAAG;AAE1B;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,CAEvE;AAgGD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,MAAM,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,YAAY,EAAE,CAuMhE;AAED,eAAe,MAAM,CAAC"}
|