@timber-js/app 0.2.0-alpha.190 → 0.2.0-alpha.192
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-35jnMdeJ.js → actions-BjbbNRFN.js} +3 -3
- package/dist/_chunks/{actions-35jnMdeJ.js.map → actions-BjbbNRFN.js.map} +1 -1
- package/dist/_chunks/als-registry-C6kcfprT.js.map +1 -1
- package/dist/_chunks/als-slots-BEEIPKYm.js.map +1 -1
- package/dist/_chunks/{cache-api-DjNrIWRR.js → cache-api-DllJ-Lyw.js} +2 -2
- package/dist/_chunks/{cache-api-DjNrIWRR.js.map → cache-api-DllJ-Lyw.js.map} +1 -1
- package/dist/_chunks/{cli-check-CpmN7Nh-.js → cli-check-DJZDc22E.js} +3 -3
- package/dist/_chunks/{cli-check-CpmN7Nh-.js.map → cli-check-DJZDc22E.js.map} +1 -1
- package/dist/_chunks/{cli-schema-sync-CGMp_Psg.js → cli-schema-sync-D4_AZVUb.js} +2 -2
- package/dist/_chunks/{cli-schema-sync-CGMp_Psg.js.map → cli-schema-sync-D4_AZVUb.js.map} +1 -1
- package/dist/_chunks/{convention-lint-kXsgc_-7.js → convention-lint-CpteIpTm.js} +2 -2
- package/dist/_chunks/{convention-lint-kXsgc_-7.js.map → convention-lint-CpteIpTm.js.map} +1 -1
- package/dist/_chunks/{logger-D8xJZXIN.js → logger-CH7IcMmg.js} +1 -16
- package/dist/_chunks/{logger-D8xJZXIN.js.map → logger-CH7IcMmg.js.map} +1 -1
- package/dist/_chunks/{scanner-C8b0Gcw3.js → scanner-CAietmj4.js} +2 -2
- package/dist/_chunks/{scanner-C8b0Gcw3.js.map → scanner-CAietmj4.js.map} +1 -1
- package/dist/_chunks/segment-context-CjOlyB8Y.js.map +1 -1
- package/dist/_chunks/segment-keys-BawYuNFO.js.map +1 -1
- package/dist/_chunks/slot-params-BCTmZkQB.js.map +1 -1
- package/dist/_chunks/ssr-data-14MXm7Pj.js.map +1 -1
- package/dist/_chunks/use-segment-params-C4r4BD9T.js.map +1 -1
- package/dist/_chunks/{walkers-RzN6AFjr.js → walkers-BsVLmD1S.js} +2 -2
- package/dist/_chunks/{walkers-RzN6AFjr.js.map → walkers-BsVLmD1S.js.map} +1 -1
- package/dist/cache/index.js +1 -1
- package/dist/cli.js +2 -2
- package/dist/client/internal.js.map +1 -1
- package/dist/client/params-context.d.ts +2 -1
- package/dist/client/params-context.d.ts.map +1 -1
- package/dist/client/ssr-data.d.ts +2 -1
- package/dist/client/ssr-data.d.ts.map +1 -1
- package/dist/client/state.d.ts +3 -2
- package/dist/client/state.d.ts.map +1 -1
- package/dist/client/use-segment-params.d.ts +5 -4
- package/dist/client/use-segment-params.d.ts.map +1 -1
- package/dist/config-types.d.ts +24 -6
- package/dist/config-types.d.ts.map +1 -1
- package/dist/index.js +35 -32
- package/dist/index.js.map +1 -1
- package/dist/plugins/mdx.d.ts +17 -4
- package/dist/plugins/mdx.d.ts.map +1 -1
- package/dist/plugins/server-bundle.d.ts.map +1 -1
- package/dist/routing/index.js +2 -2
- package/dist/routing/segment-keys.d.ts +2 -1
- package/dist/routing/segment-keys.d.ts.map +1 -1
- package/dist/server/action-handler.d.ts.map +1 -1
- package/dist/server/als-registry.d.ts +10 -5
- package/dist/server/als-registry.d.ts.map +1 -1
- package/dist/server/chain-url-parts.d.ts +2 -1
- package/dist/server/chain-url-parts.d.ts.map +1 -1
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/internal.js +3 -3
- package/dist/server/internal.js.map +1 -1
- package/dist/server/metadata-collector.d.ts +40 -18
- package/dist/server/metadata-collector.d.ts.map +1 -1
- package/dist/server/param-coercion.d.ts +2 -1
- package/dist/server/param-coercion.d.ts.map +1 -1
- package/dist/server/pipeline-phases.d.ts.map +1 -1
- package/dist/server/pipeline.d.ts +3 -2
- package/dist/server/pipeline.d.ts.map +1 -1
- package/dist/server/prebuilt/cache-key.d.ts +2 -1
- package/dist/server/prebuilt/cache-key.d.ts.map +1 -1
- package/dist/server/prebuilt/payload-source.d.ts +2 -1
- package/dist/server/prebuilt/payload-source.d.ts.map +1 -1
- package/dist/server/prebuilt/synthetic-store.d.ts +2 -1
- package/dist/server/prebuilt/synthetic-store.d.ts.map +1 -1
- package/dist/server/prebuilt-builder.d.ts +4 -3
- package/dist/server/prebuilt-builder.d.ts.map +1 -1
- package/dist/server/prebuilt-runtime.d.ts.map +1 -1
- package/dist/server/request-context.d.ts +6 -5
- package/dist/server/request-context.d.ts.map +1 -1
- package/dist/server/route-element-builder.d.ts.map +1 -1
- package/dist/server/sitemap-generator.d.ts +2 -1
- package/dist/server/sitemap-generator.d.ts.map +1 -1
- package/dist/server/slot-resolver.d.ts +1 -1
- package/dist/server/slot-resolver.d.ts.map +1 -1
- package/dist/server/ssr-bridge-types.d.ts +5 -3
- package/dist/server/ssr-bridge-types.d.ts.map +1 -1
- package/dist/server/types.d.ts +2 -1
- package/dist/server/types.d.ts.map +1 -1
- package/dist/shared/als-slots.d.ts +3 -2
- package/dist/shared/als-slots.d.ts.map +1 -1
- package/dist/shared/param-value.d.ts +25 -1
- package/dist/shared/param-value.d.ts.map +1 -1
- package/dist/shared/payload-root.d.ts +2 -1
- package/dist/shared/payload-root.d.ts.map +1 -1
- package/dist/shared/slot-params.d.ts +4 -3
- package/dist/shared/slot-params.d.ts.map +1 -1
- package/docs/api/34-api-config.mdx +9 -8
- package/docs/more/04b-mdx.mdx +38 -18
- package/package.json +7 -3
- package/src/client/params-context.ts +2 -2
- package/src/client/ssr-data.ts +2 -1
- package/src/client/state.ts +3 -2
- package/src/client/use-segment-params.ts +6 -5
- package/src/config-types.ts +27 -7
- package/src/plugins/mdx.ts +69 -35
- package/src/plugins/server-bundle.ts +2 -1
- package/src/routing/segment-keys.ts +5 -2
- package/src/server/action-handler.ts +106 -8
- package/src/server/als-registry.ts +10 -5
- package/src/server/chain-url-parts.ts +2 -1
- package/src/server/index.ts +4 -0
- package/src/server/metadata-collector.ts +114 -40
- package/src/server/param-coercion.ts +7 -7
- package/src/server/pipeline-phases.ts +3 -1
- package/src/server/pipeline.ts +3 -2
- package/src/server/prebuilt/cache-key.ts +2 -1
- package/src/server/prebuilt/payload-source.ts +2 -1
- package/src/server/prebuilt/synthetic-store.ts +2 -1
- package/src/server/prebuilt-builder.ts +6 -5
- package/src/server/prebuilt-runtime.ts +5 -3
- package/src/server/request-context.ts +6 -8
- package/src/server/route-element-builder.ts +18 -40
- package/src/server/sitemap-generator.ts +7 -9
- package/src/server/slot-resolver.ts +2 -1
- package/src/server/ssr-bridge-types.ts +6 -3
- package/src/server/types.ts +2 -1
- package/src/shared/als-slots.ts +3 -1
- package/src/shared/param-value.ts +44 -7
- package/src/shared/payload-root.ts +2 -1
- package/src/shared/slot-params.ts +11 -12
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
* hydration without anything having to run before `hydrateRoot()`.
|
|
29
29
|
*/
|
|
30
30
|
import React from 'react';
|
|
31
|
+
import { type CoercedParams } from '../shared/param-value.js';
|
|
31
32
|
import { type PublishedParams } from '../shared/payload-root.js';
|
|
32
33
|
import type { SlotParamsRecord } from '../shared/slot-params.js';
|
|
33
34
|
export type ParamsContextValue = PublishedParams;
|
|
@@ -40,7 +41,7 @@ export type ParamsContextValue = PublishedParams;
|
|
|
40
41
|
*/
|
|
41
42
|
export declare function useParamsContext(): ParamsContextValue | null;
|
|
42
43
|
interface ParamsProviderProps {
|
|
43
|
-
params:
|
|
44
|
+
params: CoercedParams;
|
|
44
45
|
slotParams: SlotParamsRecord | null;
|
|
45
46
|
children?: React.ReactNode;
|
|
46
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"params-context.d.ts","sourceRoot":"","sources":["../../src/client/params-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,OAAO,KAAsC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"params-context.d.ts","sourceRoot":"","sources":["../../src/client/params-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAqB,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACjF,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAIjE,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAmDjD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,IAAI,kBAAkB,GAAG,IAAI,CAE5D;AAID,UAAU,mBAAmB;IAC3B,MAAM,EAAE,aAAa,CAAC;IACtB,UAAU,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AA0CD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,uDAIhG"}
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* All mutable state is delegated to client/state.ts for singleton guarantees.
|
|
22
22
|
* See design/18-build-system.md §"Singleton State Registry"
|
|
23
23
|
*/
|
|
24
|
+
import type { CoercedParams } from '../shared/param-value.js';
|
|
24
25
|
import type { SlotParamsRecord } from '../shared/slot-params.js';
|
|
25
26
|
export interface SsrData {
|
|
26
27
|
/** The request's URL pathname (e.g. '/dashboard/settings') */
|
|
@@ -30,7 +31,7 @@ export interface SsrData {
|
|
|
30
31
|
/** The request's cookies as name→value pairs */
|
|
31
32
|
cookies: Map<string, string>;
|
|
32
33
|
/** The request's route params (e.g. { id: '123' }) */
|
|
33
|
-
params:
|
|
34
|
+
params: CoercedParams;
|
|
34
35
|
/**
|
|
35
36
|
* Per-slot params keyed by slot tree path, absent when the request rendered
|
|
36
37
|
* no slot with params of its own (TIM-1285).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr-data.d.ts","sourceRoot":"","sources":["../../src/client/ssr-data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAQH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAIjE,MAAM,WAAW,OAAO;IACtB,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,gDAAgD;IAChD,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,sDAAsD;IACtD,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"ssr-data.d.ts","sourceRoot":"","sources":["../../src/client/ssr-data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAQH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAIjE,MAAM,WAAW,OAAO;IACtB,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,gDAAgD;IAChD,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,sDAAsD;IACtD,MAAM,EAAE,aAAa,CAAC;IACtB;;;OAGG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B;;;;;;;;;;;;;OAaG;IACH,WAAW,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,sBAAsB,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CACzE;AAkBD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,OAAO,GAAG,SAAS,GAAG,IAAI,CAEjF;AAMD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAE9C;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAEnC;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,IAAI,OAAO,GAAG,SAAS,CAKhD"}
|
package/dist/client/state.d.ts
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* See design/18-build-system.md §"Module Singleton Strategy" and
|
|
19
19
|
* §"Singleton State Registry".
|
|
20
20
|
*/
|
|
21
|
+
import type { CoercedParams } from '../shared/param-value.js';
|
|
21
22
|
import type { SlotParamsRecord } from '../shared/slot-params.js';
|
|
22
23
|
import type { RouterInstance } from './router-types.js';
|
|
23
24
|
import type { SsrData } from './ssr-data.js';
|
|
@@ -34,8 +35,8 @@ export declare function _setSsrDataProvider(provider: (() => SsrData | undefined
|
|
|
34
35
|
export declare let currentSsrData: SsrData | undefined;
|
|
35
36
|
export declare function _setCurrentSsrData(data: SsrData | undefined): void;
|
|
36
37
|
/** Current route params snapshot — replaced (not mutated) on each navigation. */
|
|
37
|
-
export declare let currentParams:
|
|
38
|
-
export declare function _setCurrentParams(params:
|
|
38
|
+
export declare let currentParams: CoercedParams;
|
|
39
|
+
export declare function _setCurrentParams(params: CoercedParams): void;
|
|
39
40
|
/**
|
|
40
41
|
* Per-slot params snapshot, keyed by slot tree path — the module-level
|
|
41
42
|
* fallback behind `useSegmentParams(slotPath)` when no NavigationContext is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/client/state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAA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EAAE,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;AAEpE,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,SAAS,GAAG,IAAI,CAE3F;AAED,gEAAgE;AAChE,eAAO,IAAI,cAAc,EAAE,OAAO,GAAG,SAAS,CAAC;AAE/C,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAElE;AAID,iFAAiF;AACjF,eAAO,IAAI,aAAa,EAAE,aAAkB,CAAC;AAE7C,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAE7D;AAED;;;;;GAKG;AACH,eAAO,IAAI,iBAAiB,EAAE,gBAAgB,GAAG,IAAW,CAAC;AAE7D,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,gBAAgB,GAAG,IAAI,GAAG,IAAI,CAE/E;AAED,qDAAqD;AACrD,eAAO,MAAM,eAAe,YAAiB,IAAI,CAAG,CAAC;AAIrD,uEAAuE;AACvE,eAAO,IAAI,YAAY,QAAK,CAAC;AAC7B,eAAO,IAAI,kBAAkB,iBAAwB,CAAC;AAEtD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAG9E;AAID,oDAAoD;AACpD,eAAO,IAAI,SAAS,SAAQ,CAAC;AAE7B,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAElD"}
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
*
|
|
30
30
|
* Design doc: design/09-typescript.md §"Typed Routes"
|
|
31
31
|
*/
|
|
32
|
+
import type { CoercedParams } from '../shared/param-value.js';
|
|
32
33
|
import type { Routes } from '../index.js';
|
|
33
34
|
import { type SlotParamsRecord } from '../shared/slot-params.js';
|
|
34
35
|
/**
|
|
@@ -42,7 +43,7 @@ export declare function subscribe(callback: () => void): () => void;
|
|
|
42
43
|
* Get the current params snapshot (module-level fallback).
|
|
43
44
|
* Used by tests and by the hook when called outside a React component.
|
|
44
45
|
*/
|
|
45
|
-
export declare function getSnapshot():
|
|
46
|
+
export declare function getSnapshot(): CoercedParams;
|
|
46
47
|
/**
|
|
47
48
|
* Set the current route params in the module-level store.
|
|
48
49
|
*
|
|
@@ -58,7 +59,7 @@ export declare function getSnapshot(): Record<string, string | string[]>;
|
|
|
58
59
|
* During SSR, params are also available via getSsrData().params
|
|
59
60
|
* (ALS-backed).
|
|
60
61
|
*/
|
|
61
|
-
export declare function setCurrentParams(params:
|
|
62
|
+
export declare function setCurrentParams(params: CoercedParams): void;
|
|
62
63
|
/**
|
|
63
64
|
* Set the per-slot params snapshot in the module-level store.
|
|
64
65
|
*
|
|
@@ -99,6 +100,6 @@ export declare function notifyParamsListeners(): void;
|
|
|
99
100
|
*/
|
|
100
101
|
export declare function useSegmentParams<R extends keyof Routes>(segmentPath: R): Routes[R] extends {
|
|
101
102
|
segmentParams: infer P;
|
|
102
|
-
} ? P :
|
|
103
|
-
export declare function useSegmentParams(segmentPath?: string):
|
|
103
|
+
} ? P : CoercedParams;
|
|
104
|
+
export declare function useSegmentParams(segmentPath?: string): CoercedParams;
|
|
104
105
|
//# sourceMappingURL=use-segment-params.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-segment-params.d.ts","sourceRoot":"","sources":["../../src/client/use-segment-params.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAS1C,OAAO,EAAwB,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAOvF;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAG1D;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,
|
|
1
|
+
{"version":3,"file":"use-segment-params.d.ts","sourceRoot":"","sources":["../../src/client/use-segment-params.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAS1C,OAAO,EAAwB,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAOvF;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAG1D;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,aAAa,CAE3C;AAMD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAE5D;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,gBAAgB,GAAG,IAAI,GAAG,IAAI,CAE9E;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAI5C;AAMD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,MAAM,EACrD,WAAW,EAAE,CAAC,GACb,MAAM,CAAC,CAAC,CAAC,SAAS;IAAE,aAAa,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,CAAC,GAAG,aAAa,CAAC;AACpE,wBAAgB,gBAAgB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC"}
|
package/dist/config-types.d.ts
CHANGED
|
@@ -157,12 +157,30 @@ export interface TimberUserConfig {
|
|
|
157
157
|
* to use a custom location.
|
|
158
158
|
*/
|
|
159
159
|
appDir?: string;
|
|
160
|
-
/**
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
160
|
+
/**
|
|
161
|
+
* MDX/Markdown compilation options passed to vite-plugin-satteri.
|
|
162
|
+
*
|
|
163
|
+
* Satteri's plugin API is visitor-based (`defineMdastPlugin` /
|
|
164
|
+
* `defineHastPlugin` from the `satteri` package) — unified
|
|
165
|
+
* remark/rehype plugins are not supported.
|
|
166
|
+
*
|
|
167
|
+
* Set to `false` to disable timber's MDX support entirely — even when a
|
|
168
|
+
* `content/` directory exists. Use this when registering your own MDX
|
|
169
|
+
* compiler (e.g. `@mdx-js/rollup` for the unified pipeline) directly in
|
|
170
|
+
* `vite.config.ts`.
|
|
171
|
+
*
|
|
172
|
+
* See design/20-content-collections.md.
|
|
173
|
+
*/
|
|
174
|
+
mdx?: false | {
|
|
175
|
+
/** MDAST-stage plugins (created with satteri's `defineMdastPlugin`). */
|
|
176
|
+
mdastPlugins?: unknown[];
|
|
177
|
+
/** HAST-stage plugins (created with satteri's `defineHastPlugin`). */
|
|
178
|
+
hastPlugins?: unknown[];
|
|
179
|
+
/**
|
|
180
|
+
* Parser feature toggles. Defaults: `gfm: true`, `frontmatter: true`,
|
|
181
|
+
* everything else (math, directive, wikilinks, …) off.
|
|
182
|
+
*/
|
|
183
|
+
features?: Record<string, unknown>;
|
|
166
184
|
};
|
|
167
185
|
/**
|
|
168
186
|
* Server action bound args encryption configuration.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-types.d.ts","sourceRoot":"","sources":["../src/config-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,uDAAuD;AACvD,MAAM,WAAW,sBAAsB;IACrC,yEAAyE;IACzE,QAAQ,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC7B;;;;;;;;;;OAUG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;;;;;;;;;OAaG;IACH,gBAAgB,CAAC,EAAE,OAAO,GAAG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CAAC;QACf,kCAAkC;QAClC,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACH"}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { a as __esmMin, o as __exportAll, s as __toCommonJS } from "./_chunks/dist-BA3u1z3W.js";
|
|
2
2
|
import { t as RSC_CONTENT_TYPE } from "./_chunks/rsc-media-type-DRqE_lD_.js";
|
|
3
3
|
import { a as canonicalize, d as isMetadataRouteServePath, u as isDynamicMetadataExtension } from "./_chunks/segment-keys-BawYuNFO.js";
|
|
4
|
-
import { n as collectInterceptionRewrites, r as matchUrlParts, t as scanRoutes } from "./_chunks/scanner-
|
|
5
|
-
import { h as swallow } from "./_chunks/logger-
|
|
6
|
-
import { c as writeRouteCodegen, i as getPrerenderExport, l as buildDirToRouteMap, n as formatConventionWarnings, r as lintConventions, s as flushCodegenWrites, t as checkAppDirExists } from "./_chunks/convention-lint-
|
|
4
|
+
import { n as collectInterceptionRewrites, r as matchUrlParts, t as scanRoutes } from "./_chunks/scanner-CAietmj4.js";
|
|
5
|
+
import { h as swallow } from "./_chunks/logger-CH7IcMmg.js";
|
|
6
|
+
import { c as writeRouteCodegen, i as getPrerenderExport, l as buildDirToRouteMap, n as formatConventionWarnings, r as lintConventions, s as flushCodegenWrites, t as checkAppDirExists } from "./_chunks/convention-lint-CpteIpTm.js";
|
|
7
7
|
import { c as resolveClientJavascript, i as mergeFileConfig, l as createNoopTimer, o as resolveAppDir, r as loadTimberConfigFile, s as resolveBuildDir, t as createPluginContext } from "./_chunks/plugin-context-rCinWLiE.js";
|
|
8
|
-
import { r as validateSchemaAgainstRoutes, t as collectLeafRoutes } from "./_chunks/walkers-
|
|
8
|
+
import { r as validateSchemaAgainstRoutes, t as collectLeafRoutes } from "./_chunks/walkers-BsVLmD1S.js";
|
|
9
9
|
import { i as withBasePath, n as normalizeBasePath, t as isRelativeBase } from "./_chunks/base-path-DaQrzbez.js";
|
|
10
10
|
import { t as rscPayloadPath } from "./_chunks/rsc-payload-path-B_LBodc2.js";
|
|
11
11
|
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-D7vb6GdI.js";
|
|
@@ -2094,6 +2094,7 @@ function findMdxComponents(root) {
|
|
|
2094
2094
|
* Determine if MDX should be activated based on config and project structure.
|
|
2095
2095
|
*/
|
|
2096
2096
|
function shouldActivate(ctx) {
|
|
2097
|
+
if (ctx.config.mdx === false) return false;
|
|
2097
2098
|
const exts = ctx.config.pageExtensions;
|
|
2098
2099
|
if (exts && exts.some((ext) => MDX_EXTENSIONS.includes(ext))) return true;
|
|
2099
2100
|
if (existsSync(join(ctx.root, "content"))) return true;
|
|
@@ -2105,13 +2106,11 @@ function shouldActivate(ctx) {
|
|
|
2105
2106
|
*
|
|
2106
2107
|
* Why this matters: pnpm only hoists declared (peer) dependencies into a
|
|
2107
2108
|
* package's resolution scope. The MDX integration's optional companions
|
|
2108
|
-
* — `
|
|
2109
|
-
*
|
|
2110
|
-
*
|
|
2111
|
-
*
|
|
2112
|
-
*
|
|
2113
|
-
* `undefined` and skipped frontmatter parsing entirely — leaving MDX to
|
|
2114
|
-
* choke on YAML as JS expressions (TIM-840).
|
|
2109
|
+
* — `vite-plugin-satteri` and `satteri` — are installed as direct deps of
|
|
2110
|
+
* the consumer (e.g. `packages/website`), not `@timber-js/app`. A bare
|
|
2111
|
+
* `import('vite-plugin-satteri')` from inside this file resolves against
|
|
2112
|
+
* `packages/timber-app/node_modules` and silently fails with
|
|
2113
|
+
* `ERR_MODULE_NOT_FOUND` (TIM-840).
|
|
2115
2114
|
*
|
|
2116
2115
|
* Resolving relative to `projectRoot` (via `createRequire`) makes the
|
|
2117
2116
|
* lookup walk the consumer's `node_modules` tree first, which is where
|
|
@@ -2138,39 +2137,41 @@ async function tryImport(name, projectRoot) {
|
|
|
2138
2137
|
* Create the timber-mdx Vite plugin.
|
|
2139
2138
|
*
|
|
2140
2139
|
* Uses the transform and resolveId hooks to delegate MDX compilation
|
|
2141
|
-
* to
|
|
2140
|
+
* to vite-plugin-satteri. The inner plugin is loaded lazily on first
|
|
2141
|
+
* activation.
|
|
2142
2142
|
*
|
|
2143
|
-
* Hooks: buildStart (loads
|
|
2143
|
+
* Hooks: buildStart (loads vite-plugin-satteri), resolveId, load, transform
|
|
2144
2144
|
*/
|
|
2145
2145
|
function timberMdx(ctx) {
|
|
2146
2146
|
let innerPlugin = null;
|
|
2147
2147
|
async function activate() {
|
|
2148
2148
|
if (innerPlugin !== null || !shouldActivate(ctx)) return;
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
"
|
|
2149
|
+
if (ctx.config.pageExtensions?.includes("md")) throw new Error([
|
|
2150
|
+
"[timber] pageExtensions includes 'md', but .md route pages are not supported:",
|
|
2151
|
+
"Markdown files compile to HTML strings, not components.",
|
|
2152
|
+
"",
|
|
2153
|
+
"Use .mdx for pages (pageExtensions: ['tsx', 'ts', 'mdx']).",
|
|
2154
|
+
".md files can still be imported as HTML strings — no pageExtensions entry needed."
|
|
2155
|
+
].join("\n"));
|
|
2156
|
+
const createSatteriPlugin = await tryImport("vite-plugin-satteri", ctx.root);
|
|
2157
|
+
if (!createSatteriPlugin) throw new Error([
|
|
2158
|
+
"[timber] MDX is enabled but vite-plugin-satteri is not installed.",
|
|
2152
2159
|
"",
|
|
2153
2160
|
"Install it:",
|
|
2154
|
-
" pnpm add -D
|
|
2161
|
+
" pnpm add -D vite-plugin-satteri satteri",
|
|
2155
2162
|
"",
|
|
2156
2163
|
"MDX is activated because pageExtensions includes \"mdx\"/\"md\" or a content/ directory exists."
|
|
2157
2164
|
].join("\n"));
|
|
2158
|
-
const mdxConfig = ctx.config.mdx
|
|
2159
|
-
const
|
|
2160
|
-
const remarkFrontmatter = await tryImport("remark-frontmatter", ctx.root);
|
|
2161
|
-
const remarkMdxFrontmatter = await tryImport("remark-mdx-frontmatter", ctx.root);
|
|
2162
|
-
if (remarkFrontmatter) remarkPlugins.push(remarkFrontmatter);
|
|
2163
|
-
if (remarkMdxFrontmatter) remarkPlugins.push(remarkMdxFrontmatter);
|
|
2164
|
-
if (mdxConfig.remarkPlugins) remarkPlugins.push(...mdxConfig.remarkPlugins);
|
|
2165
|
-
const mdxOptions = {
|
|
2166
|
-
remarkPlugins,
|
|
2167
|
-
rehypePlugins: mdxConfig.rehypePlugins ?? [],
|
|
2168
|
-
recmaPlugins: mdxConfig.recmaPlugins ?? [],
|
|
2169
|
-
remarkRehypeOptions: mdxConfig.remarkRehypeOptions
|
|
2170
|
-
};
|
|
2165
|
+
const mdxConfig = ctx.config.mdx || {};
|
|
2166
|
+
const mdxOptions = { development: ctx.dev };
|
|
2171
2167
|
const mdxComponentsPath = findMdxComponents(ctx.root);
|
|
2172
2168
|
if (mdxComponentsPath) mdxOptions.providerImportSource = mdxComponentsPath;
|
|
2173
|
-
innerPlugin =
|
|
2169
|
+
innerPlugin = createSatteriPlugin({
|
|
2170
|
+
mdx: mdxOptions,
|
|
2171
|
+
...mdxConfig.mdastPlugins ? { mdastPlugins: mdxConfig.mdastPlugins } : {},
|
|
2172
|
+
...mdxConfig.hastPlugins ? { hastPlugins: mdxConfig.hastPlugins } : {},
|
|
2173
|
+
...mdxConfig.features ? { features: mdxConfig.features } : {}
|
|
2174
|
+
});
|
|
2174
2175
|
}
|
|
2175
2176
|
return {
|
|
2176
2177
|
name: "timber-mdx",
|
|
@@ -2198,6 +2199,7 @@ function timberMdx(ctx) {
|
|
|
2198
2199
|
},
|
|
2199
2200
|
async transform(code, id) {
|
|
2200
2201
|
if (!innerPlugin) return null;
|
|
2202
|
+
if (id.includes("?")) return null;
|
|
2201
2203
|
const envName = this.environment?.name;
|
|
2202
2204
|
if (envName && envName !== "rsc") return null;
|
|
2203
2205
|
if (typeof innerPlugin.transform === "function") return innerPlugin.transform.call(this, code, id);
|
|
@@ -7426,7 +7428,8 @@ var BUILD_ONLY_EXTERNALS = [
|
|
|
7426
7428
|
"vite",
|
|
7427
7429
|
"nitro",
|
|
7428
7430
|
"rollup",
|
|
7429
|
-
"
|
|
7431
|
+
"vite-plugin-satteri",
|
|
7432
|
+
"satteri",
|
|
7430
7433
|
"fsevents",
|
|
7431
7434
|
"chokidar"
|
|
7432
7435
|
];
|