@uniformdev/next-app-router 20.81.1-alpha.7.sha-91a5b13e0c → 20.81.1

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 (46) hide show
  1. package/dist/{UniformComposition-C00_YDOg.d.ts → UniformComposition-DBO-oo7J.d.ts} +31 -11
  2. package/dist/{UniformComposition-DiArCpVQ.d.mts → UniformComposition-le6UEB_r.d.mts} +31 -11
  3. package/dist/cache.d.mts +6 -24
  4. package/dist/cache.d.ts +6 -24
  5. package/dist/cache.js +831 -410
  6. package/dist/cache.mjs +829 -405
  7. package/dist/client-BElN_CWD.d.mts +786 -0
  8. package/dist/client-BElN_CWD.d.ts +786 -0
  9. package/dist/compat.d.mts +4 -2
  10. package/dist/compat.d.ts +4 -2
  11. package/dist/component.d.mts +1 -10
  12. package/dist/component.d.ts +1 -10
  13. package/dist/component.js +617 -113
  14. package/dist/component.mjs +640 -112
  15. package/dist/config/default.js +1 -0
  16. package/dist/config/default.mjs +1 -0
  17. package/dist/handler.d.mts +2 -15
  18. package/dist/handler.d.ts +2 -15
  19. package/dist/handler.js +628 -134
  20. package/dist/handler.mjs +626 -132
  21. package/dist/index.d.mts +42 -73
  22. package/dist/index.d.ts +42 -73
  23. package/dist/index.esm.js +5802 -2205
  24. package/dist/index.js +5615 -2022
  25. package/dist/index.mjs +5802 -2205
  26. package/dist/middleware.d.mts +13 -52
  27. package/dist/middleware.d.ts +13 -52
  28. package/dist/middleware.js +5741 -405
  29. package/dist/middleware.mjs +5774 -415
  30. package/dist/resolveRouteFromCode-BOvjIvM2.d.ts +18 -0
  31. package/dist/resolveRouteFromCode-CuJ4JHeb.d.mts +18 -0
  32. package/package.json +9 -37
  33. package/dist/composition-BvOM-LIW.d.mts +0 -28
  34. package/dist/composition-BvOM-LIW.d.ts +0 -28
  35. package/dist/createCachedManifestProvider-C7faGJJ8.d.mts +0 -69
  36. package/dist/createCachedManifestProvider-C7faGJJ8.d.ts +0 -69
  37. package/dist/edge.d.mts +0 -57
  38. package/dist/edge.d.ts +0 -57
  39. package/dist/edge.js +0 -1105
  40. package/dist/edge.mjs +0 -1073
  41. package/dist/resolveRouteFromPath-BHJGOpBN.d.ts +0 -82
  42. package/dist/resolveRouteFromPath-BsZUVkRX.d.mts +0 -82
  43. package/dist/vercel.d.mts +0 -24
  44. package/dist/vercel.d.ts +0 -24
  45. package/dist/vercel.js +0 -703
  46. package/dist/vercel.mjs +0 -675
@@ -1,82 +0,0 @@
1
- import { PageState } from '@uniformdev/next-app-router-shared';
2
- import { R as ResolvedRouteResult } from './composition-BvOM-LIW.js';
3
-
4
- type ResolveCompositionByIdOptions = {
5
- /**
6
- * The page state to resolve for, which sets the composition state, release and locale. Take it
7
- * from `deserializePageState` or from an earlier resolver's result.
8
- */
9
- pageState: PageState;
10
- compositionId: string;
11
- /**
12
- * Reported to analytics as the composition's matched route.
13
- *
14
- * @defaultValue `pageState.routePath`
15
- */
16
- matchedRoute?: string;
17
- };
18
- /**
19
- * Resolves a composition by id for the given page state, without the Route API. The editor state
20
- * falls back to the draft state, and the returned page state carries the state that resolved.
21
- * `route` is undefined when no composition has the id.
22
- */
23
- declare const resolveCompositionById: ({ pageState, compositionId, matchedRoute, }: ResolveCompositionByIdOptions) => Promise<ResolvedRouteResult>;
24
-
25
- type ResolveCompositionBySlugOptions = {
26
- /**
27
- * The page state to resolve for, which sets the composition state, release and locale. Take it
28
- * from `deserializePageState` or from an earlier resolver's result.
29
- */
30
- pageState: PageState;
31
- slug: string;
32
- /**
33
- * Reported to analytics as the composition's matched route.
34
- *
35
- * @defaultValue `pageState.routePath`
36
- */
37
- matchedRoute?: string;
38
- };
39
- /**
40
- * Resolves a composition by slug for the given page state, without the Route API. The editor state
41
- * falls back to the draft state, and the returned page state carries the state that resolved.
42
- * `route` is undefined when no composition has the slug. Publishing a composition revalidates its
43
- * current slug, so a renamed slug serves the cached composition until it expires.
44
- */
45
- declare const resolveCompositionBySlug: ({ pageState, slug, matchedRoute, }: ResolveCompositionBySlugOptions) => Promise<ResolvedRouteResult>;
46
-
47
- type ResolveRouteFunction = (options: ResolveRouteFromCodeOptions) => Promise<ResolvedRouteResult>;
48
- type ResolveRouteFromCodeOptions = {
49
- code: string;
50
- };
51
- /**
52
- * Resolves the route of a `[code]` path segment through the Route API, returning a composition, a
53
- * redirect, or no `route` when the path matches neither. Pass the result to `requireComposition`
54
- * to apply redirects and not found. A code in the editor state falls back to the draft state when
55
- * the composition has no editor state, and the returned page state carries the state that
56
- * resolved.
57
- */
58
- declare const resolveRouteFromCode: ResolveRouteFunction;
59
-
60
- type ResolveRouteFromPathOptions = {
61
- /**
62
- * The page state to resolve for, which sets the composition state, release and locale. Take it
63
- * from `deserializePageState` or from an earlier resolver's result.
64
- */
65
- pageState: PageState;
66
- /**
67
- * Project map path to resolve, for example `/site-settings` or `/en/404`. Replaces the page
68
- * state's route path on the result.
69
- */
70
- path: string;
71
- };
72
- /**
73
- * Resolves a project map path through the Route API for the given page state, returning a
74
- * composition, a redirect, or no `route` when the path matches neither. Unlike
75
- * `resolveCompositionBySlug` and `resolveCompositionById`, it evaluates redirects, resolves dynamic
76
- * segments into `dynamicInputs` and matches the locale against the project map. The editor state
77
- * falls back to the draft state, and the returned page state carries the path and the state that
78
- * resolved.
79
- */
80
- declare const resolveRouteFromPath: ({ pageState, path, }: ResolveRouteFromPathOptions) => Promise<ResolvedRouteResult>;
81
-
82
- export { type ResolveCompositionByIdOptions as R, type ResolveCompositionBySlugOptions as a, type ResolveRouteFromCodeOptions as b, type ResolveRouteFromPathOptions as c, type ResolveRouteFunction as d, resolveCompositionBySlug as e, resolveRouteFromCode as f, resolveRouteFromPath as g, resolveCompositionById as r };
@@ -1,82 +0,0 @@
1
- import { PageState } from '@uniformdev/next-app-router-shared';
2
- import { R as ResolvedRouteResult } from './composition-BvOM-LIW.mjs';
3
-
4
- type ResolveCompositionByIdOptions = {
5
- /**
6
- * The page state to resolve for, which sets the composition state, release and locale. Take it
7
- * from `deserializePageState` or from an earlier resolver's result.
8
- */
9
- pageState: PageState;
10
- compositionId: string;
11
- /**
12
- * Reported to analytics as the composition's matched route.
13
- *
14
- * @defaultValue `pageState.routePath`
15
- */
16
- matchedRoute?: string;
17
- };
18
- /**
19
- * Resolves a composition by id for the given page state, without the Route API. The editor state
20
- * falls back to the draft state, and the returned page state carries the state that resolved.
21
- * `route` is undefined when no composition has the id.
22
- */
23
- declare const resolveCompositionById: ({ pageState, compositionId, matchedRoute, }: ResolveCompositionByIdOptions) => Promise<ResolvedRouteResult>;
24
-
25
- type ResolveCompositionBySlugOptions = {
26
- /**
27
- * The page state to resolve for, which sets the composition state, release and locale. Take it
28
- * from `deserializePageState` or from an earlier resolver's result.
29
- */
30
- pageState: PageState;
31
- slug: string;
32
- /**
33
- * Reported to analytics as the composition's matched route.
34
- *
35
- * @defaultValue `pageState.routePath`
36
- */
37
- matchedRoute?: string;
38
- };
39
- /**
40
- * Resolves a composition by slug for the given page state, without the Route API. The editor state
41
- * falls back to the draft state, and the returned page state carries the state that resolved.
42
- * `route` is undefined when no composition has the slug. Publishing a composition revalidates its
43
- * current slug, so a renamed slug serves the cached composition until it expires.
44
- */
45
- declare const resolveCompositionBySlug: ({ pageState, slug, matchedRoute, }: ResolveCompositionBySlugOptions) => Promise<ResolvedRouteResult>;
46
-
47
- type ResolveRouteFunction = (options: ResolveRouteFromCodeOptions) => Promise<ResolvedRouteResult>;
48
- type ResolveRouteFromCodeOptions = {
49
- code: string;
50
- };
51
- /**
52
- * Resolves the route of a `[code]` path segment through the Route API, returning a composition, a
53
- * redirect, or no `route` when the path matches neither. Pass the result to `requireComposition`
54
- * to apply redirects and not found. A code in the editor state falls back to the draft state when
55
- * the composition has no editor state, and the returned page state carries the state that
56
- * resolved.
57
- */
58
- declare const resolveRouteFromCode: ResolveRouteFunction;
59
-
60
- type ResolveRouteFromPathOptions = {
61
- /**
62
- * The page state to resolve for, which sets the composition state, release and locale. Take it
63
- * from `deserializePageState` or from an earlier resolver's result.
64
- */
65
- pageState: PageState;
66
- /**
67
- * Project map path to resolve, for example `/site-settings` or `/en/404`. Replaces the page
68
- * state's route path on the result.
69
- */
70
- path: string;
71
- };
72
- /**
73
- * Resolves a project map path through the Route API for the given page state, returning a
74
- * composition, a redirect, or no `route` when the path matches neither. Unlike
75
- * `resolveCompositionBySlug` and `resolveCompositionById`, it evaluates redirects, resolves dynamic
76
- * segments into `dynamicInputs` and matches the locale against the project map. The editor state
77
- * falls back to the draft state, and the returned page state carries the path and the state that
78
- * resolved.
79
- */
80
- declare const resolveRouteFromPath: ({ pageState, path, }: ResolveRouteFromPathOptions) => Promise<ResolvedRouteResult>;
81
-
82
- export { type ResolveCompositionByIdOptions as R, type ResolveCompositionBySlugOptions as a, type ResolveRouteFromCodeOptions as b, type ResolveRouteFromPathOptions as c, type ResolveRouteFunction as d, resolveCompositionBySlug as e, resolveRouteFromCode as f, resolveRouteFromPath as g, resolveCompositionById as r };
package/dist/vercel.d.mts DELETED
@@ -1,24 +0,0 @@
1
- import { C as CreateCachedManifestProviderOptions, M as ManifestProvider } from './createCachedManifestProvider-C7faGJJ8.mjs';
2
- import '@uniformdev/context';
3
-
4
- /**
5
- * Expires Vercel runtime cache entries with any of the given tags. Pass it as `onRevalidateTags`
6
- * to `createPreviewPOSTRouteHandler`, so publishing the manifest expires the copy
7
- * `vercelManifestProvider` stored. Does nothing under `next dev` without `RUNTIME_CACHE_ENDPOINT`.
8
- *
9
- * Requires the optional peer dependency `@vercel/functions`.
10
- */
11
- declare const expireVercelRuntimeCacheTags: (tags: string[]) => Promise<void>;
12
-
13
- /**
14
- * Creates a manifest provider for `uniformEdgeMiddleware` that stores the published manifest in
15
- * Vercel's runtime cache, tagged `manifest`, and loads it from the Uniform API on a miss. Pair it
16
- * with `expireVercelRuntimeCacheTags` in the preview route handler so publishing the manifest
17
- * expires the cached copy. Under `next dev` without `RUNTIME_CACHE_ENDPOINT`, it skips the
18
- * runtime cache and loads from the API.
19
- *
20
- * Requires the optional peer dependency `@vercel/functions`.
21
- */
22
- declare const vercelManifestProvider: (options?: Omit<CreateCachedManifestProviderOptions, "cache">) => ManifestProvider;
23
-
24
- export { expireVercelRuntimeCacheTags, vercelManifestProvider };
package/dist/vercel.d.ts DELETED
@@ -1,24 +0,0 @@
1
- import { C as CreateCachedManifestProviderOptions, M as ManifestProvider } from './createCachedManifestProvider-C7faGJJ8.js';
2
- import '@uniformdev/context';
3
-
4
- /**
5
- * Expires Vercel runtime cache entries with any of the given tags. Pass it as `onRevalidateTags`
6
- * to `createPreviewPOSTRouteHandler`, so publishing the manifest expires the copy
7
- * `vercelManifestProvider` stored. Does nothing under `next dev` without `RUNTIME_CACHE_ENDPOINT`.
8
- *
9
- * Requires the optional peer dependency `@vercel/functions`.
10
- */
11
- declare const expireVercelRuntimeCacheTags: (tags: string[]) => Promise<void>;
12
-
13
- /**
14
- * Creates a manifest provider for `uniformEdgeMiddleware` that stores the published manifest in
15
- * Vercel's runtime cache, tagged `manifest`, and loads it from the Uniform API on a miss. Pair it
16
- * with `expireVercelRuntimeCacheTags` in the preview route handler so publishing the manifest
17
- * expires the cached copy. Under `next dev` without `RUNTIME_CACHE_ENDPOINT`, it skips the
18
- * runtime cache and loads from the API.
19
- *
20
- * Requires the optional peer dependency `@vercel/functions`.
21
- */
22
- declare const vercelManifestProvider: (options?: Omit<CreateCachedManifestProviderOptions, "cache">) => ManifestProvider;
23
-
24
- export { expireVercelRuntimeCacheTags, vercelManifestProvider };