vinext 0.0.0 → 0.0.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.
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/build/static-export.d.ts +78 -0
- package/dist/build/static-export.d.ts.map +1 -0
- package/dist/build/static-export.js +553 -0
- package/dist/build/static-export.js.map +1 -0
- package/dist/check.d.ts +52 -0
- package/dist/check.d.ts.map +1 -0
- package/dist/check.js +483 -0
- package/dist/check.js.map +1 -0
- package/dist/cli.d.ts +15 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +565 -0
- package/dist/cli.js.map +1 -0
- package/dist/client/entry.d.ts +2 -0
- package/dist/client/entry.d.ts.map +1 -0
- package/dist/client/entry.js +85 -0
- package/dist/client/entry.js.map +1 -0
- package/dist/cloudflare/index.d.ts +8 -0
- package/dist/cloudflare/index.d.ts.map +1 -0
- package/dist/cloudflare/index.js +8 -0
- package/dist/cloudflare/index.js.map +1 -0
- package/dist/cloudflare/kv-cache-handler.d.ts +68 -0
- package/dist/cloudflare/kv-cache-handler.d.ts.map +1 -0
- package/dist/cloudflare/kv-cache-handler.js +304 -0
- package/dist/cloudflare/kv-cache-handler.js.map +1 -0
- package/dist/cloudflare/tpr.d.ts +78 -0
- package/dist/cloudflare/tpr.d.ts.map +1 -0
- package/dist/cloudflare/tpr.js +672 -0
- package/dist/cloudflare/tpr.js.map +1 -0
- package/dist/config/config-matchers.d.ts +106 -0
- package/dist/config/config-matchers.d.ts.map +1 -0
- package/dist/config/config-matchers.js +499 -0
- package/dist/config/config-matchers.js.map +1 -0
- package/dist/config/next-config.d.ts +153 -0
- package/dist/config/next-config.d.ts.map +1 -0
- package/dist/config/next-config.js +274 -0
- package/dist/config/next-config.js.map +1 -0
- package/dist/deploy.d.ts +87 -0
- package/dist/deploy.d.ts.map +1 -0
- package/dist/deploy.js +644 -0
- package/dist/deploy.js.map +1 -0
- package/dist/index.d.ts +156 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3287 -0
- package/dist/index.js.map +1 -0
- package/dist/init.d.ts +55 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/init.js +201 -0
- package/dist/init.js.map +1 -0
- package/dist/routing/app-router.d.ts +96 -0
- package/dist/routing/app-router.d.ts.map +1 -0
- package/dist/routing/app-router.js +815 -0
- package/dist/routing/app-router.js.map +1 -0
- package/dist/routing/pages-router.d.ts +52 -0
- package/dist/routing/pages-router.d.ts.map +1 -0
- package/dist/routing/pages-router.js +239 -0
- package/dist/routing/pages-router.js.map +1 -0
- package/dist/server/api-handler.d.ts +18 -0
- package/dist/server/api-handler.d.ts.map +1 -0
- package/dist/server/api-handler.js +169 -0
- package/dist/server/api-handler.js.map +1 -0
- package/dist/server/app-dev-server.d.ts +42 -0
- package/dist/server/app-dev-server.d.ts.map +1 -0
- package/dist/server/app-dev-server.js +2718 -0
- package/dist/server/app-dev-server.js.map +1 -0
- package/dist/server/app-router-entry.d.ts +18 -0
- package/dist/server/app-router-entry.d.ts.map +1 -0
- package/dist/server/app-router-entry.js +34 -0
- package/dist/server/app-router-entry.js.map +1 -0
- package/dist/server/dev-server.d.ts +40 -0
- package/dist/server/dev-server.d.ts.map +1 -0
- package/dist/server/dev-server.js +758 -0
- package/dist/server/dev-server.js.map +1 -0
- package/dist/server/html.d.ts +22 -0
- package/dist/server/html.d.ts.map +1 -0
- package/dist/server/html.js +29 -0
- package/dist/server/html.js.map +1 -0
- package/dist/server/image-optimization.d.ts +56 -0
- package/dist/server/image-optimization.d.ts.map +1 -0
- package/dist/server/image-optimization.js +103 -0
- package/dist/server/image-optimization.js.map +1 -0
- package/dist/server/instrumentation.d.ts +68 -0
- package/dist/server/instrumentation.d.ts.map +1 -0
- package/dist/server/instrumentation.js +90 -0
- package/dist/server/instrumentation.js.map +1 -0
- package/dist/server/isr-cache.d.ts +61 -0
- package/dist/server/isr-cache.d.ts.map +1 -0
- package/dist/server/isr-cache.js +134 -0
- package/dist/server/isr-cache.js.map +1 -0
- package/dist/server/metadata-routes.d.ts +103 -0
- package/dist/server/metadata-routes.d.ts.map +1 -0
- package/dist/server/metadata-routes.js +270 -0
- package/dist/server/metadata-routes.js.map +1 -0
- package/dist/server/middleware.d.ts +77 -0
- package/dist/server/middleware.d.ts.map +1 -0
- package/dist/server/middleware.js +228 -0
- package/dist/server/middleware.js.map +1 -0
- package/dist/server/prod-server.d.ts +78 -0
- package/dist/server/prod-server.d.ts.map +1 -0
- package/dist/server/prod-server.js +712 -0
- package/dist/server/prod-server.js.map +1 -0
- package/dist/shims/amp.d.ts +17 -0
- package/dist/shims/amp.d.ts.map +1 -0
- package/dist/shims/amp.js +21 -0
- package/dist/shims/amp.js.map +1 -0
- package/dist/shims/app.d.ts +12 -0
- package/dist/shims/app.d.ts.map +1 -0
- package/dist/shims/app.js +2 -0
- package/dist/shims/app.js.map +1 -0
- package/dist/shims/cache-runtime.d.ts +68 -0
- package/dist/shims/cache-runtime.d.ts.map +1 -0
- package/dist/shims/cache-runtime.js +437 -0
- package/dist/shims/cache-runtime.js.map +1 -0
- package/dist/shims/cache.d.ts +243 -0
- package/dist/shims/cache.d.ts.map +1 -0
- package/dist/shims/cache.js +415 -0
- package/dist/shims/cache.js.map +1 -0
- package/dist/shims/client-only.d.ts +18 -0
- package/dist/shims/client-only.d.ts.map +1 -0
- package/dist/shims/client-only.js +18 -0
- package/dist/shims/client-only.js.map +1 -0
- package/dist/shims/config.d.ts +27 -0
- package/dist/shims/config.d.ts.map +1 -0
- package/dist/shims/config.js +30 -0
- package/dist/shims/config.js.map +1 -0
- package/dist/shims/constants.d.ts +13 -0
- package/dist/shims/constants.d.ts.map +1 -0
- package/dist/shims/constants.js +13 -0
- package/dist/shims/constants.js.map +1 -0
- package/dist/shims/document.d.ts +33 -0
- package/dist/shims/document.d.ts.map +1 -0
- package/dist/shims/document.js +32 -0
- package/dist/shims/document.js.map +1 -0
- package/dist/shims/dynamic.d.ts +33 -0
- package/dist/shims/dynamic.d.ts.map +1 -0
- package/dist/shims/dynamic.js +148 -0
- package/dist/shims/dynamic.js.map +1 -0
- package/dist/shims/error-boundary.d.ts +33 -0
- package/dist/shims/error-boundary.d.ts.map +1 -0
- package/dist/shims/error-boundary.js +88 -0
- package/dist/shims/error-boundary.js.map +1 -0
- package/dist/shims/error.d.ts +16 -0
- package/dist/shims/error.d.ts.map +1 -0
- package/dist/shims/error.js +45 -0
- package/dist/shims/error.js.map +1 -0
- package/dist/shims/fetch-cache.d.ts +61 -0
- package/dist/shims/fetch-cache.d.ts.map +1 -0
- package/dist/shims/fetch-cache.js +307 -0
- package/dist/shims/fetch-cache.js.map +1 -0
- package/dist/shims/font-google.d.ts +122 -0
- package/dist/shims/font-google.d.ts.map +1 -0
- package/dist/shims/font-google.js +387 -0
- package/dist/shims/font-google.js.map +1 -0
- package/dist/shims/font-local.d.ts +61 -0
- package/dist/shims/font-local.d.ts.map +1 -0
- package/dist/shims/font-local.js +303 -0
- package/dist/shims/font-local.js.map +1 -0
- package/dist/shims/form.d.ts +30 -0
- package/dist/shims/form.d.ts.map +1 -0
- package/dist/shims/form.js +78 -0
- package/dist/shims/form.js.map +1 -0
- package/dist/shims/head-state.d.ts +11 -0
- package/dist/shims/head-state.d.ts.map +1 -0
- package/dist/shims/head-state.js +47 -0
- package/dist/shims/head-state.js.map +1 -0
- package/dist/shims/head.d.ts +28 -0
- package/dist/shims/head.d.ts.map +1 -0
- package/dist/shims/head.js +148 -0
- package/dist/shims/head.js.map +1 -0
- package/dist/shims/headers.d.ts +150 -0
- package/dist/shims/headers.d.ts.map +1 -0
- package/dist/shims/headers.js +412 -0
- package/dist/shims/headers.js.map +1 -0
- package/dist/shims/image-config.d.ts +30 -0
- package/dist/shims/image-config.d.ts.map +1 -0
- package/dist/shims/image-config.js +91 -0
- package/dist/shims/image-config.js.map +1 -0
- package/dist/shims/image.d.ts +63 -0
- package/dist/shims/image.d.ts.map +1 -0
- package/dist/shims/image.js +284 -0
- package/dist/shims/image.js.map +1 -0
- package/dist/shims/internal/api-utils.d.ts +12 -0
- package/dist/shims/internal/api-utils.d.ts.map +1 -0
- package/dist/shims/internal/api-utils.js +7 -0
- package/dist/shims/internal/api-utils.js.map +1 -0
- package/dist/shims/internal/app-router-context.d.ts +21 -0
- package/dist/shims/internal/app-router-context.d.ts.map +1 -0
- package/dist/shims/internal/app-router-context.js +15 -0
- package/dist/shims/internal/app-router-context.js.map +1 -0
- package/dist/shims/internal/cookies.d.ts +9 -0
- package/dist/shims/internal/cookies.d.ts.map +1 -0
- package/dist/shims/internal/cookies.js +9 -0
- package/dist/shims/internal/cookies.js.map +1 -0
- package/dist/shims/internal/router-context.d.ts +2 -0
- package/dist/shims/internal/router-context.d.ts.map +1 -0
- package/dist/shims/internal/router-context.js +9 -0
- package/dist/shims/internal/router-context.js.map +1 -0
- package/dist/shims/internal/utils.d.ts +48 -0
- package/dist/shims/internal/utils.d.ts.map +1 -0
- package/dist/shims/internal/utils.js +35 -0
- package/dist/shims/internal/utils.js.map +1 -0
- package/dist/shims/internal/work-unit-async-storage.d.ts +12 -0
- package/dist/shims/internal/work-unit-async-storage.d.ts.map +1 -0
- package/dist/shims/internal/work-unit-async-storage.js +13 -0
- package/dist/shims/internal/work-unit-async-storage.js.map +1 -0
- package/dist/shims/layout-segment-context.d.ts +21 -0
- package/dist/shims/layout-segment-context.d.ts.map +1 -0
- package/dist/shims/layout-segment-context.js +27 -0
- package/dist/shims/layout-segment-context.js.map +1 -0
- package/dist/shims/legacy-image.d.ts +52 -0
- package/dist/shims/legacy-image.d.ts.map +1 -0
- package/dist/shims/legacy-image.js +46 -0
- package/dist/shims/legacy-image.js.map +1 -0
- package/dist/shims/link.d.ts +48 -0
- package/dist/shims/link.d.ts.map +1 -0
- package/dist/shims/link.js +395 -0
- package/dist/shims/link.js.map +1 -0
- package/dist/shims/metadata.d.ts +184 -0
- package/dist/shims/metadata.d.ts.map +1 -0
- package/dist/shims/metadata.js +472 -0
- package/dist/shims/metadata.js.map +1 -0
- package/dist/shims/navigation-state.d.ts +14 -0
- package/dist/shims/navigation-state.d.ts.map +1 -0
- package/dist/shims/navigation-state.js +77 -0
- package/dist/shims/navigation-state.js.map +1 -0
- package/dist/shims/navigation.d.ts +201 -0
- package/dist/shims/navigation.d.ts.map +1 -0
- package/dist/shims/navigation.js +672 -0
- package/dist/shims/navigation.js.map +1 -0
- package/dist/shims/og.d.ts +20 -0
- package/dist/shims/og.d.ts.map +1 -0
- package/dist/shims/og.js +19 -0
- package/dist/shims/og.js.map +1 -0
- package/dist/shims/router-state.d.ts +11 -0
- package/dist/shims/router-state.d.ts.map +1 -0
- package/dist/shims/router-state.js +56 -0
- package/dist/shims/router-state.js.map +1 -0
- package/dist/shims/router.d.ts +103 -0
- package/dist/shims/router.d.ts.map +1 -0
- package/dist/shims/router.js +536 -0
- package/dist/shims/router.js.map +1 -0
- package/dist/shims/script.d.ts +58 -0
- package/dist/shims/script.d.ts.map +1 -0
- package/dist/shims/script.js +163 -0
- package/dist/shims/script.js.map +1 -0
- package/dist/shims/server-only.d.ts +19 -0
- package/dist/shims/server-only.d.ts.map +1 -0
- package/dist/shims/server-only.js +19 -0
- package/dist/shims/server-only.js.map +1 -0
- package/dist/shims/server.d.ts +178 -0
- package/dist/shims/server.d.ts.map +1 -0
- package/dist/shims/server.js +377 -0
- package/dist/shims/server.js.map +1 -0
- package/dist/shims/web-vitals.d.ts +24 -0
- package/dist/shims/web-vitals.d.ts.map +1 -0
- package/dist/shims/web-vitals.js +17 -0
- package/dist/shims/web-vitals.js.map +1 -0
- package/dist/utils/hash.d.ts +6 -0
- package/dist/utils/hash.d.ts.map +1 -0
- package/dist/utils/hash.js +20 -0
- package/dist/utils/hash.js.map +1 -0
- package/dist/utils/project.d.ts +36 -0
- package/dist/utils/project.d.ts.map +1 -0
- package/dist/utils/project.js +112 -0
- package/dist/utils/project.js.map +1 -0
- package/dist/utils/query.d.ts +10 -0
- package/dist/utils/query.d.ts.map +1 -0
- package/dist/utils/query.js +27 -0
- package/dist/utils/query.js.map +1 -0
- package/package.json +65 -7
- package/index.js +0 -1
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* next/cache shim
|
|
3
|
+
*
|
|
4
|
+
* Provides the Next.js caching API surface: revalidateTag, revalidatePath,
|
|
5
|
+
* unstable_cache. Backed by a pluggable CacheHandler that defaults to
|
|
6
|
+
* in-memory but can be swapped for Cloudflare KV, Redis, DynamoDB, etc.
|
|
7
|
+
*
|
|
8
|
+
* The CacheHandler interface matches Next.js 16's CacheHandler class, so
|
|
9
|
+
* existing community adapters (@neshca/cache-handler, @opennextjs/aws, etc.)
|
|
10
|
+
* can be used directly.
|
|
11
|
+
*
|
|
12
|
+
* Configuration (in vite.config.ts or next.config.js):
|
|
13
|
+
* vinext({ cacheHandler: './my-cache-handler.ts' })
|
|
14
|
+
*
|
|
15
|
+
* Or set at runtime:
|
|
16
|
+
* import { setCacheHandler } from 'next/cache';
|
|
17
|
+
* setCacheHandler(new MyCacheHandler());
|
|
18
|
+
*/
|
|
19
|
+
import { markDynamicUsage as _markDynamic } from "./headers.js";
|
|
20
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
21
|
+
import { fnv1a64 } from "../utils/hash.js";
|
|
22
|
+
/** @internal Set by cache-runtime.ts on import to avoid circular dependency */
|
|
23
|
+
let _getCacheContextFn = null;
|
|
24
|
+
/**
|
|
25
|
+
* Register the cache context accessor. Called by cache-runtime.ts on load.
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export function _registerCacheContextAccessor(fn) {
|
|
29
|
+
_getCacheContextFn = fn;
|
|
30
|
+
}
|
|
31
|
+
export class MemoryCacheHandler {
|
|
32
|
+
store = new Map();
|
|
33
|
+
tagRevalidatedAt = new Map();
|
|
34
|
+
async get(key, _ctx) {
|
|
35
|
+
const entry = this.store.get(key);
|
|
36
|
+
if (!entry)
|
|
37
|
+
return null;
|
|
38
|
+
// Check tag-based invalidation first — if tag was invalidated, treat as hard miss
|
|
39
|
+
for (const tag of entry.tags) {
|
|
40
|
+
const revalidatedAt = this.tagRevalidatedAt.get(tag);
|
|
41
|
+
if (revalidatedAt && revalidatedAt >= entry.lastModified) {
|
|
42
|
+
this.store.delete(key);
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// Check time-based expiry — return stale entry with cacheState="stale"
|
|
47
|
+
// instead of deleting, so ISR can serve stale-while-revalidate
|
|
48
|
+
if (entry.revalidateAt !== null && Date.now() > entry.revalidateAt) {
|
|
49
|
+
return {
|
|
50
|
+
lastModified: entry.lastModified,
|
|
51
|
+
value: entry.value,
|
|
52
|
+
cacheState: "stale",
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
lastModified: entry.lastModified,
|
|
57
|
+
value: entry.value,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
async set(key, data, ctx) {
|
|
61
|
+
const tags = [];
|
|
62
|
+
if (data && "tags" in data && Array.isArray(data.tags)) {
|
|
63
|
+
tags.push(...data.tags);
|
|
64
|
+
}
|
|
65
|
+
if (ctx && "tags" in ctx && Array.isArray(ctx.tags)) {
|
|
66
|
+
tags.push(...ctx.tags);
|
|
67
|
+
}
|
|
68
|
+
let revalidateAt = null;
|
|
69
|
+
if (ctx) {
|
|
70
|
+
// Handle both old-style { revalidate } and new-style { cacheControl: { revalidate } }
|
|
71
|
+
const revalidate = ctx.cacheControl?.revalidate ?? ctx.revalidate;
|
|
72
|
+
if (typeof revalidate === "number" && revalidate > 0) {
|
|
73
|
+
revalidateAt = Date.now() + revalidate * 1000;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (data && "revalidate" in data && typeof data.revalidate === "number") {
|
|
77
|
+
revalidateAt = Date.now() + data.revalidate * 1000;
|
|
78
|
+
}
|
|
79
|
+
this.store.set(key, {
|
|
80
|
+
value: data,
|
|
81
|
+
tags,
|
|
82
|
+
lastModified: Date.now(),
|
|
83
|
+
revalidateAt,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
async revalidateTag(tags, _durations) {
|
|
87
|
+
const tagList = Array.isArray(tags) ? tags : [tags];
|
|
88
|
+
const now = Date.now();
|
|
89
|
+
for (const tag of tagList) {
|
|
90
|
+
this.tagRevalidatedAt.set(tag, now);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
resetRequestCache() {
|
|
94
|
+
// No-op for the simple memory cache. In a production adapter,
|
|
95
|
+
// this would clear per-request caches (e.g., dedup fetch calls).
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
// ---------------------------------------------------------------------------
|
|
99
|
+
// Active cache handler — the singleton used by next/cache API functions.
|
|
100
|
+
// Defaults to MemoryCacheHandler, can be swapped at runtime.
|
|
101
|
+
// ---------------------------------------------------------------------------
|
|
102
|
+
let activeHandler = new MemoryCacheHandler();
|
|
103
|
+
/**
|
|
104
|
+
* Set a custom CacheHandler. Call this during server startup to
|
|
105
|
+
* plug in Cloudflare KV, Redis, DynamoDB, or any other backend.
|
|
106
|
+
*
|
|
107
|
+
* The handler must implement the CacheHandler interface (same shape
|
|
108
|
+
* as Next.js 16's CacheHandler class).
|
|
109
|
+
*/
|
|
110
|
+
export function setCacheHandler(handler) {
|
|
111
|
+
activeHandler = handler;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Get the active CacheHandler (for internal use or testing).
|
|
115
|
+
*/
|
|
116
|
+
export function getCacheHandler() {
|
|
117
|
+
return activeHandler;
|
|
118
|
+
}
|
|
119
|
+
// ---------------------------------------------------------------------------
|
|
120
|
+
// Public API — what app code imports from 'next/cache'
|
|
121
|
+
// ---------------------------------------------------------------------------
|
|
122
|
+
/**
|
|
123
|
+
* Revalidate cached data associated with a specific cache tag.
|
|
124
|
+
*
|
|
125
|
+
* Works with both `fetch(..., { next: { tags: ['myTag'] } })` and
|
|
126
|
+
* `unstable_cache(fn, keys, { tags: ['myTag'] })`.
|
|
127
|
+
*/
|
|
128
|
+
/**
|
|
129
|
+
* Revalidate cached data associated with a specific cache tag.
|
|
130
|
+
*
|
|
131
|
+
* Next.js 16 updated signature: requires a cacheLife profile as second argument
|
|
132
|
+
* for stale-while-revalidate (SWR) behavior. The single-argument form is
|
|
133
|
+
* deprecated but still supported for backward compatibility.
|
|
134
|
+
*
|
|
135
|
+
* @param tag - Cache tag to revalidate
|
|
136
|
+
* @param profile - cacheLife profile name (e.g. 'max', 'hours') or inline { expire: number }
|
|
137
|
+
*/
|
|
138
|
+
export async function revalidateTag(tag, profile) {
|
|
139
|
+
// Resolve the profile to durations for the handler
|
|
140
|
+
let durations;
|
|
141
|
+
if (typeof profile === "string") {
|
|
142
|
+
const resolved = cacheLifeProfiles[profile];
|
|
143
|
+
if (resolved) {
|
|
144
|
+
durations = { expire: resolved.expire };
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
else if (profile && typeof profile === "object") {
|
|
148
|
+
durations = profile;
|
|
149
|
+
}
|
|
150
|
+
await activeHandler.revalidateTag(tag, durations);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Revalidate cached data associated with a specific path.
|
|
154
|
+
*
|
|
155
|
+
* Under the hood, Next.js converts paths to internal tags.
|
|
156
|
+
* We use a `_N_T_/path` prefix convention for path-based tags.
|
|
157
|
+
*/
|
|
158
|
+
export async function revalidatePath(path, _type) {
|
|
159
|
+
// Next.js internally converts paths to tags with a prefix
|
|
160
|
+
const pathTag = `_N_T_${path}`;
|
|
161
|
+
await activeHandler.revalidateTag([path, pathTag]);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Expire and immediately refresh cached data for a tag (Next.js 16).
|
|
165
|
+
*
|
|
166
|
+
* Server Actions-only API that provides read-your-writes semantics:
|
|
167
|
+
* the cache entry is expired and fresh data is read within the same request,
|
|
168
|
+
* so the user immediately sees their changes.
|
|
169
|
+
*
|
|
170
|
+
* Use this for interactive features (forms, user settings) where users
|
|
171
|
+
* expect to see their updates instantly.
|
|
172
|
+
*
|
|
173
|
+
* @param tag - Cache tag to expire and refresh
|
|
174
|
+
*/
|
|
175
|
+
export async function updateTag(tag) {
|
|
176
|
+
// Expire the tag immediately (same as revalidateTag without SWR)
|
|
177
|
+
await activeHandler.revalidateTag(tag);
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Refresh uncached data on the page (Next.js 16).
|
|
181
|
+
*
|
|
182
|
+
* Server Actions-only API that signals the client to re-fetch dynamic
|
|
183
|
+
* (uncached) data without touching the cache. Complementary to the
|
|
184
|
+
* client-side router.refresh().
|
|
185
|
+
*
|
|
186
|
+
* Use this when you need to refresh data like notification counts,
|
|
187
|
+
* live metrics, or status indicators after performing a server action.
|
|
188
|
+
*/
|
|
189
|
+
export function refresh() {
|
|
190
|
+
// In our implementation, this is a signal that the client should
|
|
191
|
+
// refresh dynamic data. The actual refresh happens on the client side
|
|
192
|
+
// via the RSC protocol — the server action response triggers a
|
|
193
|
+
// client-side navigation refresh.
|
|
194
|
+
// For now, this is a no-op on the server; the Server Action response
|
|
195
|
+
// mechanism already handles re-rendering the affected RSC tree.
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Opt out of static rendering and indicate a particular component should not be cached.
|
|
199
|
+
*
|
|
200
|
+
* In Next.js, calling noStore() inside a Server Component ensures the component
|
|
201
|
+
* is dynamically rendered. In our implementation, this is a no-op since we don't
|
|
202
|
+
* have the same static/dynamic rendering split — all server rendering is on-demand.
|
|
203
|
+
* It's provided for API compatibility so apps importing it don't break.
|
|
204
|
+
*/
|
|
205
|
+
export function unstable_noStore() {
|
|
206
|
+
// Signal dynamic usage so ISR-configured routes bypass the cache
|
|
207
|
+
_markDynamic();
|
|
208
|
+
}
|
|
209
|
+
// Also export as `noStore` (Next.js 15+ naming)
|
|
210
|
+
export { unstable_noStore as noStore };
|
|
211
|
+
const _ALS_KEY = Symbol.for("vinext.cache.als");
|
|
212
|
+
const _FALLBACK_KEY = Symbol.for("vinext.cache.fallback");
|
|
213
|
+
const _g = globalThis;
|
|
214
|
+
const _cacheAls = (_g[_ALS_KEY] ??= new AsyncLocalStorage());
|
|
215
|
+
const _cacheFallbackState = (_g[_FALLBACK_KEY] ??= {
|
|
216
|
+
requestScopedCacheLife: null,
|
|
217
|
+
});
|
|
218
|
+
function _cacheEnterWith(state) {
|
|
219
|
+
const enterWith = _cacheAls.enterWith;
|
|
220
|
+
if (typeof enterWith === "function") {
|
|
221
|
+
try {
|
|
222
|
+
enterWith.call(_cacheAls, state);
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
catch {
|
|
226
|
+
// Fall through to best-effort fallback.
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
_cacheFallbackState.requestScopedCacheLife = state.requestScopedCacheLife;
|
|
230
|
+
}
|
|
231
|
+
function _getCacheState() {
|
|
232
|
+
return _cacheAls.getStore() ?? _cacheFallbackState;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Initialize cache ALS for a new request. Call at request entry.
|
|
236
|
+
* @internal
|
|
237
|
+
*/
|
|
238
|
+
export function _initRequestScopedCacheState() {
|
|
239
|
+
_cacheEnterWith({ requestScopedCacheLife: null });
|
|
240
|
+
_cacheFallbackState.requestScopedCacheLife = null;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Set a request-scoped cache life config. Called by cacheLife() when outside
|
|
244
|
+
* a "use cache" function context.
|
|
245
|
+
* @internal
|
|
246
|
+
*/
|
|
247
|
+
export function _setRequestScopedCacheLife(config) {
|
|
248
|
+
const state = _getCacheState();
|
|
249
|
+
if (state.requestScopedCacheLife === null) {
|
|
250
|
+
state.requestScopedCacheLife = { ...config };
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
// Minimum-wins rule
|
|
254
|
+
if (config.stale !== undefined) {
|
|
255
|
+
state.requestScopedCacheLife.stale = state.requestScopedCacheLife.stale !== undefined
|
|
256
|
+
? Math.min(state.requestScopedCacheLife.stale, config.stale)
|
|
257
|
+
: config.stale;
|
|
258
|
+
}
|
|
259
|
+
if (config.revalidate !== undefined) {
|
|
260
|
+
state.requestScopedCacheLife.revalidate = state.requestScopedCacheLife.revalidate !== undefined
|
|
261
|
+
? Math.min(state.requestScopedCacheLife.revalidate, config.revalidate)
|
|
262
|
+
: config.revalidate;
|
|
263
|
+
}
|
|
264
|
+
if (config.expire !== undefined) {
|
|
265
|
+
state.requestScopedCacheLife.expire = state.requestScopedCacheLife.expire !== undefined
|
|
266
|
+
? Math.min(state.requestScopedCacheLife.expire, config.expire)
|
|
267
|
+
: config.expire;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Consume and reset the request-scoped cache life. Returns null if none was set.
|
|
273
|
+
* @internal
|
|
274
|
+
*/
|
|
275
|
+
export function _consumeRequestScopedCacheLife() {
|
|
276
|
+
const state = _getCacheState();
|
|
277
|
+
const config = state.requestScopedCacheLife;
|
|
278
|
+
state.requestScopedCacheLife = null;
|
|
279
|
+
return config;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Built-in cache life profiles matching Next.js 16.
|
|
283
|
+
*/
|
|
284
|
+
export const cacheLifeProfiles = {
|
|
285
|
+
default: { revalidate: 900, expire: 4294967294 },
|
|
286
|
+
seconds: { stale: 30, revalidate: 1, expire: 60 },
|
|
287
|
+
minutes: { stale: 300, revalidate: 60, expire: 3600 },
|
|
288
|
+
hours: { stale: 300, revalidate: 3600, expire: 86400 },
|
|
289
|
+
days: { stale: 300, revalidate: 86400, expire: 604800 },
|
|
290
|
+
weeks: { stale: 300, revalidate: 604800, expire: 2592000 },
|
|
291
|
+
max: { stale: 300, revalidate: 2592000, expire: 31536000 },
|
|
292
|
+
};
|
|
293
|
+
/**
|
|
294
|
+
* Set the cache lifetime for a "use cache" function.
|
|
295
|
+
*
|
|
296
|
+
* Accepts either a built-in profile name (e.g., "hours", "days") or a custom
|
|
297
|
+
* configuration object. In Next.js, this only works inside "use cache" functions.
|
|
298
|
+
*
|
|
299
|
+
* When called inside a "use cache" function, this sets the cache TTL.
|
|
300
|
+
* The "minimum-wins" rule applies: if called multiple times, the shortest
|
|
301
|
+
* duration for each field wins.
|
|
302
|
+
*
|
|
303
|
+
* When called outside a "use cache" context, this is a validated no-op.
|
|
304
|
+
*/
|
|
305
|
+
export function cacheLife(profile) {
|
|
306
|
+
let resolvedConfig;
|
|
307
|
+
if (typeof profile === "string") {
|
|
308
|
+
// Validate the profile name exists
|
|
309
|
+
if (!cacheLifeProfiles[profile]) {
|
|
310
|
+
console.warn(`[vinext] cacheLife: unknown profile "${profile}". ` +
|
|
311
|
+
`Available profiles: ${Object.keys(cacheLifeProfiles).join(", ")}`);
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
resolvedConfig = { ...cacheLifeProfiles[profile] };
|
|
315
|
+
}
|
|
316
|
+
else if (typeof profile === "object" && profile !== null) {
|
|
317
|
+
// Validate the config shape
|
|
318
|
+
if (profile.expire !== undefined &&
|
|
319
|
+
profile.revalidate !== undefined &&
|
|
320
|
+
profile.expire < profile.revalidate) {
|
|
321
|
+
console.warn("[vinext] cacheLife: expire must be >= revalidate");
|
|
322
|
+
}
|
|
323
|
+
resolvedConfig = { ...profile };
|
|
324
|
+
}
|
|
325
|
+
else {
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
// If we're inside a "use cache" context, push the config
|
|
329
|
+
try {
|
|
330
|
+
const ctx = _getCacheContextFn?.();
|
|
331
|
+
if (ctx) {
|
|
332
|
+
ctx.lifeConfigs.push(resolvedConfig);
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
catch {
|
|
337
|
+
// Fall through to request-scoped
|
|
338
|
+
}
|
|
339
|
+
// Outside a "use cache" context (e.g., page component with file-level "use cache"):
|
|
340
|
+
// store as request-scoped so the server can read it after rendering.
|
|
341
|
+
_setRequestScopedCacheLife(resolvedConfig);
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Tag a "use cache" function's cached result for on-demand revalidation.
|
|
345
|
+
*
|
|
346
|
+
* Tags set here can be invalidated via revalidateTag(). In Next.js, this only
|
|
347
|
+
* works inside "use cache" functions.
|
|
348
|
+
*
|
|
349
|
+
* When called inside a "use cache" function, tags are attached to the cached
|
|
350
|
+
* entry. They can later be invalidated via revalidateTag().
|
|
351
|
+
*
|
|
352
|
+
* When called outside a "use cache" context, this is a no-op.
|
|
353
|
+
*/
|
|
354
|
+
export function cacheTag(...tags) {
|
|
355
|
+
try {
|
|
356
|
+
const ctx = _getCacheContextFn?.();
|
|
357
|
+
if (ctx) {
|
|
358
|
+
ctx.tags.push(...tags);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
catch {
|
|
362
|
+
// Not in a cache context — no-op
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Wrap an async function with caching.
|
|
367
|
+
*
|
|
368
|
+
* Returns a new function that caches results. The cache key is derived
|
|
369
|
+
* from keyParts + serialized arguments.
|
|
370
|
+
*/
|
|
371
|
+
export function unstable_cache(fn, keyParts, options) {
|
|
372
|
+
const baseKey = keyParts
|
|
373
|
+
? keyParts.join(":")
|
|
374
|
+
: fnv1a64(fn.toString());
|
|
375
|
+
const tags = options?.tags ?? [];
|
|
376
|
+
const revalidateSeconds = options?.revalidate;
|
|
377
|
+
const cachedFn = async (...args) => {
|
|
378
|
+
const argsKey = JSON.stringify(args);
|
|
379
|
+
const cacheKey = `unstable_cache:${baseKey}:${argsKey}`;
|
|
380
|
+
// Try to get from cache
|
|
381
|
+
const existing = await activeHandler.get(cacheKey, {
|
|
382
|
+
kind: "FETCH",
|
|
383
|
+
tags,
|
|
384
|
+
});
|
|
385
|
+
if (existing?.value && existing.value.kind === "FETCH") {
|
|
386
|
+
try {
|
|
387
|
+
return JSON.parse(existing.value.data.body);
|
|
388
|
+
}
|
|
389
|
+
catch {
|
|
390
|
+
// Corrupted entry, fall through to re-fetch
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
// Cache miss — call the function
|
|
394
|
+
const result = await fn(...args);
|
|
395
|
+
// Store in cache using the FETCH kind
|
|
396
|
+
const cacheValue = {
|
|
397
|
+
kind: "FETCH",
|
|
398
|
+
data: {
|
|
399
|
+
headers: {},
|
|
400
|
+
body: JSON.stringify(result),
|
|
401
|
+
url: cacheKey,
|
|
402
|
+
},
|
|
403
|
+
tags,
|
|
404
|
+
revalidate: typeof revalidateSeconds === "number" ? revalidateSeconds : 0,
|
|
405
|
+
};
|
|
406
|
+
await activeHandler.set(cacheKey, cacheValue, {
|
|
407
|
+
fetchCache: true,
|
|
408
|
+
tags,
|
|
409
|
+
revalidate: revalidateSeconds,
|
|
410
|
+
});
|
|
411
|
+
return result;
|
|
412
|
+
};
|
|
413
|
+
return cachedFn;
|
|
414
|
+
}
|
|
415
|
+
//# sourceMappingURL=cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../src/shims/cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,gBAAgB,IAAI,YAAY,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAa3C,+EAA+E;AAC/E,IAAI,kBAAkB,GAA2C,IAAI,CAAC;AAEtE;;;GAGG;AACH,MAAM,UAAU,6BAA6B,CAAC,EAAiC;IAC7E,kBAAkB,GAAG,EAAE,CAAC;AAC1B,CAAC;AA+GD,MAAM,OAAO,kBAAkB;IACrB,KAAK,GAAG,IAAI,GAAG,EAAuB,CAAC;IACvC,gBAAgB,GAAG,IAAI,GAAG,EAAkB,CAAC;IAErD,KAAK,CAAC,GAAG,CACP,GAAW,EACX,IAA8B;QAE9B,MAAM,KAAK,GAAG,IAAI,CAAC,KAA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AC,CAAC;SAC1E,CAAC;QAEF,MAAM,aAAa,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE;YAC5C,UAAU,EAAE,IAAI;YAChB,IAAI;YACJ,UAAU,EAAE,iBAAiB;SAC9B,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;IAEF,OAAO,QAAa,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shim for the `client-only` package.
|
|
3
|
+
*
|
|
4
|
+
* The real `client-only` npm package uses the `react-server` export
|
|
5
|
+
* condition: it's a no-op in client bundles, and throws when imported
|
|
6
|
+
* in a server (RSC) environment.
|
|
7
|
+
*
|
|
8
|
+
* In Vite with @vitejs/plugin-rsc, the environment system already
|
|
9
|
+
* separates server and client module graphs. If the real package is
|
|
10
|
+
* installed it works automatically. This shim exists as a fallback so
|
|
11
|
+
* users don't need to install `client-only` as a separate dependency.
|
|
12
|
+
*
|
|
13
|
+
* Build-time enforcement (preventing client code from being imported
|
|
14
|
+
* in server components) is handled by the RSC plugin's environment
|
|
15
|
+
* system and "use client" / "use server" directives, not by this module.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=client-only.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-only.d.ts","sourceRoot":"","sources":["../../src/shims/client-only.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shim for the `client-only` package.
|
|
3
|
+
*
|
|
4
|
+
* The real `client-only` npm package uses the `react-server` export
|
|
5
|
+
* condition: it's a no-op in client bundles, and throws when imported
|
|
6
|
+
* in a server (RSC) environment.
|
|
7
|
+
*
|
|
8
|
+
* In Vite with @vitejs/plugin-rsc, the environment system already
|
|
9
|
+
* separates server and client module graphs. If the real package is
|
|
10
|
+
* installed it works automatically. This shim exists as a fallback so
|
|
11
|
+
* users don't need to install `client-only` as a separate dependency.
|
|
12
|
+
*
|
|
13
|
+
* Build-time enforcement (preventing client code from being imported
|
|
14
|
+
* in server components) is handled by the RSC plugin's environment
|
|
15
|
+
* system and "use client" / "use server" directives, not by this module.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=client-only.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-only.js","sourceRoot":"","sources":["../../src/shims/client-only.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* next/config shim
|
|
3
|
+
*
|
|
4
|
+
* Provides runtime config support (publicRuntimeConfig / serverRuntimeConfig)
|
|
5
|
+
* from next.config.js. Note: next/config was removed in Next.js 16, but many
|
|
6
|
+
* apps still use it. This shim keeps them working during migration.
|
|
7
|
+
*
|
|
8
|
+
* Usage in apps:
|
|
9
|
+
* import getConfig from "next/config";
|
|
10
|
+
* const { publicRuntimeConfig, serverRuntimeConfig } = getConfig();
|
|
11
|
+
*/
|
|
12
|
+
interface RuntimeConfig {
|
|
13
|
+
serverRuntimeConfig: Record<string, unknown>;
|
|
14
|
+
publicRuntimeConfig: Record<string, unknown>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Set the runtime config. Called during app bootstrap (by the plugin)
|
|
18
|
+
* with values from next.config.js.
|
|
19
|
+
*/
|
|
20
|
+
export declare function setConfig(configValue: RuntimeConfig): void;
|
|
21
|
+
/**
|
|
22
|
+
* Get the current runtime config.
|
|
23
|
+
* Default export — matches `import getConfig from "next/config"`.
|
|
24
|
+
*/
|
|
25
|
+
export default function getConfig(): RuntimeConfig;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/shims/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,UAAU,aAAa;IACrB,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7C,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC9C;AAOD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,WAAW,EAAE,aAAa,GAAG,IAAI,CAE1D;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,IAAI,aAAa,CAEjD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* next/config shim
|
|
3
|
+
*
|
|
4
|
+
* Provides runtime config support (publicRuntimeConfig / serverRuntimeConfig)
|
|
5
|
+
* from next.config.js. Note: next/config was removed in Next.js 16, but many
|
|
6
|
+
* apps still use it. This shim keeps them working during migration.
|
|
7
|
+
*
|
|
8
|
+
* Usage in apps:
|
|
9
|
+
* import getConfig from "next/config";
|
|
10
|
+
* const { publicRuntimeConfig, serverRuntimeConfig } = getConfig();
|
|
11
|
+
*/
|
|
12
|
+
let runtimeConfig = {
|
|
13
|
+
serverRuntimeConfig: {},
|
|
14
|
+
publicRuntimeConfig: {},
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Set the runtime config. Called during app bootstrap (by the plugin)
|
|
18
|
+
* with values from next.config.js.
|
|
19
|
+
*/
|
|
20
|
+
export function setConfig(configValue) {
|
|
21
|
+
runtimeConfig = configValue;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get the current runtime config.
|
|
25
|
+
* Default export — matches `import getConfig from "next/config"`.
|
|
26
|
+
*/
|
|
27
|
+
export default function getConfig() {
|
|
28
|
+
return runtimeConfig;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/shims/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,IAAI,aAAa,GAAkB;IACjC,mBAAmB,EAAE,EAAE;IACvB,mBAAmB,EAAE,EAAE;CACxB,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,WAA0B;IAClD,aAAa,GAAG,WAAW,CAAC;AAC9B,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS;IAC/B,OAAO,aAAa,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* next/constants shim
|
|
3
|
+
*
|
|
4
|
+
* Provides build/runtime phase constants used by next.config.js
|
|
5
|
+
* and some third-party libraries.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PHASE_PRODUCTION_BUILD = "phase-production-build";
|
|
8
|
+
export declare const PHASE_DEVELOPMENT_SERVER = "phase-development-server";
|
|
9
|
+
export declare const PHASE_PRODUCTION_SERVER = "phase-production-server";
|
|
10
|
+
export declare const PHASE_EXPORT = "phase-export";
|
|
11
|
+
export declare const PHASE_INFO = "phase-info";
|
|
12
|
+
export declare const PHASE_TEST = "phase-test";
|
|
13
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/shims/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAC/D,eAAO,MAAM,wBAAwB,6BAA6B,CAAC;AACnE,eAAO,MAAM,uBAAuB,4BAA4B,CAAC;AACjE,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,eAAO,MAAM,UAAU,eAAe,CAAC;AACvC,eAAO,MAAM,UAAU,eAAe,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* next/constants shim
|
|
3
|
+
*
|
|
4
|
+
* Provides build/runtime phase constants used by next.config.js
|
|
5
|
+
* and some third-party libraries.
|
|
6
|
+
*/
|
|
7
|
+
export const PHASE_PRODUCTION_BUILD = "phase-production-build";
|
|
8
|
+
export const PHASE_DEVELOPMENT_SERVER = "phase-development-server";
|
|
9
|
+
export const PHASE_PRODUCTION_SERVER = "phase-production-server";
|
|
10
|
+
export const PHASE_EXPORT = "phase-export";
|
|
11
|
+
export const PHASE_INFO = "phase-info";
|
|
12
|
+
export const PHASE_TEST = "phase-test";
|
|
13
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/shims/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAC/D,MAAM,CAAC,MAAM,wBAAwB,GAAG,0BAA0B,CAAC;AACnE,MAAM,CAAC,MAAM,uBAAuB,GAAG,yBAAyB,CAAC;AACjE,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC;AAC3C,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAC;AACvC,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* next/document shim
|
|
3
|
+
*
|
|
4
|
+
* Provides Html, Head, Main, NextScript components for custom _document.tsx.
|
|
5
|
+
* During SSR these render placeholder markers that the dev server replaces
|
|
6
|
+
* with actual content.
|
|
7
|
+
*/
|
|
8
|
+
import React from "react";
|
|
9
|
+
export declare function Html({ children, lang, ...props }: React.HTMLAttributes<HTMLHtmlElement> & {
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
/**
|
|
13
|
+
* Document Head - renders <head> with children.
|
|
14
|
+
* The dev server injects meta tags, styles, etc.
|
|
15
|
+
*/
|
|
16
|
+
export declare function Head({ children }: {
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
/**
|
|
20
|
+
* Main - renders the page content container.
|
|
21
|
+
*/
|
|
22
|
+
export declare function Main(): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
/**
|
|
24
|
+
* NextScript - renders a placeholder that the dev-server replaces with
|
|
25
|
+
* actual hydration scripts (__NEXT_DATA__ + entry module).
|
|
26
|
+
* Uses dangerouslySetInnerHTML so the HTML comment survives renderToString.
|
|
27
|
+
*/
|
|
28
|
+
export declare function NextScript(): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
/**
|
|
30
|
+
* Default Document component - used when no custom _document.tsx exists.
|
|
31
|
+
*/
|
|
32
|
+
export default function Document(): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
//# sourceMappingURL=document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../src/shims/document.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,wBAAgB,IAAI,CAAC,EACnB,QAAQ,EACR,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAMxE;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAQhE;AAED;;GAEG;AACH,wBAAgB,IAAI,4CAEnB;AAED;;;;GAIG;AACH,wBAAgB,UAAU,4CAEzB;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,4CAU/B"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export function Html({ children, lang, ...props }) {
|
|
3
|
+
return (_jsx("html", { lang: lang, ...props, children: children }));
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Document Head - renders <head> with children.
|
|
7
|
+
* The dev server injects meta tags, styles, etc.
|
|
8
|
+
*/
|
|
9
|
+
export function Head({ children }) {
|
|
10
|
+
return (_jsxs("head", { children: [_jsx("meta", { charSet: "utf-8" }), _jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }), children] }));
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Main - renders the page content container.
|
|
14
|
+
*/
|
|
15
|
+
export function Main() {
|
|
16
|
+
return _jsx("div", { id: "__next", dangerouslySetInnerHTML: { __html: "__NEXT_MAIN__" } });
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* NextScript - renders a placeholder that the dev-server replaces with
|
|
20
|
+
* actual hydration scripts (__NEXT_DATA__ + entry module).
|
|
21
|
+
* Uses dangerouslySetInnerHTML so the HTML comment survives renderToString.
|
|
22
|
+
*/
|
|
23
|
+
export function NextScript() {
|
|
24
|
+
return _jsx("span", { dangerouslySetInnerHTML: { __html: "<!-- __NEXT_SCRIPTS__ -->" } });
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Default Document component - used when no custom _document.tsx exists.
|
|
28
|
+
*/
|
|
29
|
+
export default function Document() {
|
|
30
|
+
return (_jsxs(Html, { children: [_jsx(Head, {}), _jsxs("body", { children: [_jsx(Main, {}), _jsx(NextScript, {})] })] }));
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document.js","sourceRoot":"","sources":["../../src/shims/document.tsx"],"names":[],"mappings":";AASA,MAAM,UAAU,IAAI,CAAC,EACnB,QAAQ,EACR,IAAI,EACJ,GAAG,KAAK,EAC+D;IACvE,OAAO,CACL,eAAM,IAAI,EAAE,IAAI,KAAM,KAAK,YACxB,QAAQ,GACJ,CACR,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAC,EAAE,QAAQ,EAAkC;IAC/D,OAAO,CACL,2BACE,eAAM,OAAO,EAAC,OAAO,GAAG,EACxB,eAAM,IAAI,EAAC,UAAU,EAAC,OAAO,EAAC,qCAAqC,GAAG,EACrE,QAAQ,IACJ,CACR,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,IAAI;IAClB,OAAO,cAAK,EAAE,EAAC,QAAQ,EAAC,uBAAuB,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,GAAI,CAAC;AACnF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,eAAM,uBAAuB,EAAE,EAAE,MAAM,EAAE,2BAA2B,EAAE,GAAI,CAAC;AACpF,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ;IAC9B,OAAO,CACL,MAAC,IAAI,eACH,KAAC,IAAI,KAAG,EACR,2BACE,KAAC,IAAI,KAAG,EACR,KAAC,UAAU,KAAG,IACT,IACF,CACR,CAAC;AACJ,CAAC"}
|