vike 0.4.243-commit-a70ea31 → 0.4.243-commit-0d0395a
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/esm/client/runtime-client-routing/getGlobalContextClientInternal.d.ts +0 -3
- package/dist/esm/client/runtime-client-routing/getPageContextFromHooks.d.ts +12 -4
- package/dist/esm/client/runtime-client-routing/renderPageClientSide.d.ts +3 -1
- package/dist/esm/client/runtime-server-routing/getGlobalContextClientInternal.d.ts +0 -3
- package/dist/esm/client/shared/preparePageContextForPublicUsageClientShared.d.ts +4 -1
- package/dist/esm/node/api/preview.d.ts +3 -0
- package/dist/esm/node/api/preview.js +12 -2
- package/dist/esm/node/runtime/globalContext.d.ts +2 -4
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal.d.ts +5 -1
- package/dist/esm/shared/getProxyForPublicUsage.d.ts +8 -1
- package/dist/esm/shared/getProxyForPublicUsage.js +22 -17
- package/dist/esm/shared/prepareGlobalContextForPublicUsage.d.ts +4 -1
- package/dist/esm/shared/preparePageContextForPublicUsage.d.ts +4 -1
- package/dist/esm/types/Config.d.ts +4 -2
- package/dist/esm/types/GlobalContext.d.ts +17 -0
- package/dist/esm/types/GlobalContext.js +1 -0
- package/dist/esm/types/PageContext.d.ts +4 -8
- package/dist/esm/types/index.d.ts +2 -1
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
export { getGlobalContextClientInternal };
|
|
2
|
-
export type { GlobalContextClient };
|
|
3
2
|
export type { GlobalContextClientInternal };
|
|
4
|
-
import type { GlobalContextBasePublic } from '../../shared/createGlobalContextShared.js';
|
|
5
|
-
type GlobalContextClient = GlobalContextBasePublic & Pick<GlobalContextClientInternal, 'isClientSide'> & Vike.GlobalContext & Vike.GlobalContextClient & {};
|
|
6
3
|
type GlobalContextClientInternal = Awaited<ReturnType<typeof getGlobalContextClientInternal>>;
|
|
7
4
|
declare function getGlobalContextClientInternal(): Promise<{
|
|
8
5
|
_globalConfigPublic: {
|
|
@@ -117,6 +117,7 @@ declare function getPageContextFromHooks_isHydration(pageContext: PageContextSer
|
|
|
117
117
|
url: string;
|
|
118
118
|
pageExports: Record<string, unknown>;
|
|
119
119
|
isBaseMissing?: true;
|
|
120
|
+
ignoreWarning?: import("../../shared/getProxyForPublicUsage.js").IgnoreWarning;
|
|
120
121
|
}> & Pick<PageContextConfig & {
|
|
121
122
|
isPageContext: true;
|
|
122
123
|
Page: import("../../types/Config.js").Config["Page"];
|
|
@@ -138,6 +139,7 @@ declare function getPageContextFromHooks_isHydration(pageContext: PageContextSer
|
|
|
138
139
|
url: string;
|
|
139
140
|
pageExports: Record<string, unknown>;
|
|
140
141
|
isBaseMissing?: true;
|
|
142
|
+
ignoreWarning?: import("../../shared/getProxyForPublicUsage.js").IgnoreWarning;
|
|
141
143
|
}, "exports" | "pageId" | "pageExports" | "config" | "Page" | "data" | "source" | "sources" | "from" | "configEntries" | "exportsAll" | "routeParams" | "abortReason"> & {
|
|
142
144
|
isClientSide: true;
|
|
143
145
|
isPrerendering: false;
|
|
@@ -145,7 +147,7 @@ declare function getPageContextFromHooks_isHydration(pageContext: PageContextSer
|
|
|
145
147
|
isHydration: boolean;
|
|
146
148
|
isBackwardNavigation: boolean | null;
|
|
147
149
|
previousPageContext: import("../../types/PageContext.js").PageContextClient<unknown> | null;
|
|
148
|
-
globalContext: import("
|
|
150
|
+
globalContext: import("../../types/GlobalContext.js").GlobalContextClient;
|
|
149
151
|
} & {
|
|
150
152
|
urlOriginal: string;
|
|
151
153
|
} & {
|
|
@@ -182,6 +184,7 @@ declare function getPageContextFromHooks_isHydration(pageContext: PageContextSer
|
|
|
182
184
|
url: string;
|
|
183
185
|
pageExports: Record<string, unknown>;
|
|
184
186
|
isBaseMissing?: true;
|
|
187
|
+
ignoreWarning?: import("../../shared/getProxyForPublicUsage.js").IgnoreWarning;
|
|
185
188
|
}> & Pick<PageContextConfig & {
|
|
186
189
|
isPageContext: true;
|
|
187
190
|
Page: import("../../types/Config.js").Config["Page"];
|
|
@@ -203,6 +206,7 @@ declare function getPageContextFromHooks_isHydration(pageContext: PageContextSer
|
|
|
203
206
|
url: string;
|
|
204
207
|
pageExports: Record<string, unknown>;
|
|
205
208
|
isBaseMissing?: true;
|
|
209
|
+
ignoreWarning?: import("../../shared/getProxyForPublicUsage.js").IgnoreWarning;
|
|
206
210
|
}, "exports" | "pageId" | "pageExports" | "config" | "Page" | "data" | "source" | "sources" | "from" | "configEntries" | "exportsAll" | "routeParams" | "abortReason"> & {
|
|
207
211
|
isClientSide: true;
|
|
208
212
|
isPrerendering: false;
|
|
@@ -210,7 +214,7 @@ declare function getPageContextFromHooks_isHydration(pageContext: PageContextSer
|
|
|
210
214
|
isHydration: boolean;
|
|
211
215
|
isBackwardNavigation: boolean | null;
|
|
212
216
|
previousPageContext: import("../../types/PageContext.js").PageContextClient<unknown> | null;
|
|
213
|
-
globalContext: import("
|
|
217
|
+
globalContext: import("../../types/GlobalContext.js").GlobalContextClient;
|
|
214
218
|
} & {
|
|
215
219
|
urlOriginal: string;
|
|
216
220
|
} & {
|
|
@@ -338,6 +342,7 @@ declare function getPageContextFromClientHooks(pageContext: {
|
|
|
338
342
|
url: string;
|
|
339
343
|
pageExports: Record<string, unknown>;
|
|
340
344
|
isBaseMissing?: true;
|
|
345
|
+
ignoreWarning?: import("../../shared/getProxyForPublicUsage.js").IgnoreWarning;
|
|
341
346
|
}> & Pick<PageContextConfig & {
|
|
342
347
|
isPageContext: true;
|
|
343
348
|
Page: import("../../types/Config.js").Config["Page"];
|
|
@@ -359,6 +364,7 @@ declare function getPageContextFromClientHooks(pageContext: {
|
|
|
359
364
|
url: string;
|
|
360
365
|
pageExports: Record<string, unknown>;
|
|
361
366
|
isBaseMissing?: true;
|
|
367
|
+
ignoreWarning?: import("../../shared/getProxyForPublicUsage.js").IgnoreWarning;
|
|
362
368
|
}, "exports" | "pageId" | "pageExports" | "config" | "Page" | "data" | "source" | "sources" | "from" | "configEntries" | "exportsAll" | "routeParams" | "abortReason"> & {
|
|
363
369
|
isClientSide: true;
|
|
364
370
|
isPrerendering: false;
|
|
@@ -366,7 +372,7 @@ declare function getPageContextFromClientHooks(pageContext: {
|
|
|
366
372
|
isHydration: boolean;
|
|
367
373
|
isBackwardNavigation: boolean | null;
|
|
368
374
|
previousPageContext: import("../../types/PageContext.js").PageContextClient<unknown> | null;
|
|
369
|
-
globalContext: import("
|
|
375
|
+
globalContext: import("../../types/GlobalContext.js").GlobalContextClient;
|
|
370
376
|
} & {
|
|
371
377
|
urlOriginal: string;
|
|
372
378
|
} & {
|
|
@@ -401,6 +407,7 @@ declare function getPageContextFromClientHooks(pageContext: {
|
|
|
401
407
|
url: string;
|
|
402
408
|
pageExports: Record<string, unknown>;
|
|
403
409
|
isBaseMissing?: true;
|
|
410
|
+
ignoreWarning?: import("../../shared/getProxyForPublicUsage.js").IgnoreWarning;
|
|
404
411
|
}> & Pick<PageContextConfig & {
|
|
405
412
|
isPageContext: true;
|
|
406
413
|
Page: import("../../types/Config.js").Config["Page"];
|
|
@@ -422,6 +429,7 @@ declare function getPageContextFromClientHooks(pageContext: {
|
|
|
422
429
|
url: string;
|
|
423
430
|
pageExports: Record<string, unknown>;
|
|
424
431
|
isBaseMissing?: true;
|
|
432
|
+
ignoreWarning?: import("../../shared/getProxyForPublicUsage.js").IgnoreWarning;
|
|
425
433
|
}, "exports" | "pageId" | "pageExports" | "config" | "Page" | "data" | "source" | "sources" | "from" | "configEntries" | "exportsAll" | "routeParams" | "abortReason"> & {
|
|
426
434
|
isClientSide: true;
|
|
427
435
|
isPrerendering: false;
|
|
@@ -429,7 +437,7 @@ declare function getPageContextFromClientHooks(pageContext: {
|
|
|
429
437
|
isHydration: boolean;
|
|
430
438
|
isBackwardNavigation: boolean | null;
|
|
431
439
|
previousPageContext: import("../../types/PageContext.js").PageContextClient<unknown> | null;
|
|
432
|
-
globalContext: import("
|
|
440
|
+
globalContext: import("../../types/GlobalContext.js").GlobalContextClient;
|
|
433
441
|
} & {
|
|
434
442
|
urlOriginal: string;
|
|
435
443
|
} & {
|
|
@@ -128,6 +128,7 @@ declare function getPageContextBegin(isForErrorPage: boolean, { urlOriginal, isB
|
|
|
128
128
|
url: string;
|
|
129
129
|
pageExports: Record<string, unknown>;
|
|
130
130
|
isBaseMissing?: true;
|
|
131
|
+
ignoreWarning?: import("../../shared/getProxyForPublicUsage.js").IgnoreWarning;
|
|
131
132
|
}> & Pick<PageContextConfig & {
|
|
132
133
|
isPageContext: true;
|
|
133
134
|
Page: import("../../types/Config.js").Config["Page"];
|
|
@@ -149,6 +150,7 @@ declare function getPageContextBegin(isForErrorPage: boolean, { urlOriginal, isB
|
|
|
149
150
|
url: string;
|
|
150
151
|
pageExports: Record<string, unknown>;
|
|
151
152
|
isBaseMissing?: true;
|
|
153
|
+
ignoreWarning?: import("../../shared/getProxyForPublicUsage.js").IgnoreWarning;
|
|
152
154
|
}, "exports" | "pageId" | "pageExports" | "config" | "Page" | "data" | "source" | "sources" | "from" | "configEntries" | "exportsAll" | "routeParams" | "abortReason"> & {
|
|
153
155
|
isClientSide: true;
|
|
154
156
|
isPrerendering: false;
|
|
@@ -156,7 +158,7 @@ declare function getPageContextBegin(isForErrorPage: boolean, { urlOriginal, isB
|
|
|
156
158
|
isHydration: boolean;
|
|
157
159
|
isBackwardNavigation: boolean | null;
|
|
158
160
|
previousPageContext: PageContextClient<unknown> | null;
|
|
159
|
-
globalContext: import("
|
|
161
|
+
globalContext: import("../../types/GlobalContext.js").GlobalContextClient;
|
|
160
162
|
} & {
|
|
161
163
|
urlOriginal: string;
|
|
162
164
|
} & {
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
export { getGlobalContextClientInternal };
|
|
2
|
-
export type { GlobalContextClientWithServerRouting };
|
|
3
2
|
export type { GlobalContextClientInternalWithServerRouting };
|
|
4
|
-
import type { GlobalContextBasePublic } from '../../shared/createGlobalContextShared.js';
|
|
5
|
-
type GlobalContextClientWithServerRouting = GlobalContextBasePublic & Pick<GlobalContextClientInternalWithServerRouting, 'isClientSide'> & Vike.GlobalContext & Vike.GlobalContextClient & {};
|
|
6
3
|
type GlobalContextClientInternalWithServerRouting = Awaited<ReturnType<typeof getGlobalContextClientInternal>>;
|
|
7
4
|
declare function getGlobalContextClientInternal(): Promise<{
|
|
8
5
|
_globalConfigPublic: {
|
|
@@ -8,4 +8,7 @@ type PageContextForPublicUsageClientShared = PageContextPrepareMinimum & PageCon
|
|
|
8
8
|
declare function preparePageContextForPublicUsageClientShared<PageContext extends PageContextForPublicUsageClientShared>(pageContext: PageContext): PageContext & {
|
|
9
9
|
Page: unknown;
|
|
10
10
|
};
|
|
11
|
-
declare function preparePageContextForPublicUsageClientMinimal<PageContext extends PageContextPrepareMinimum>(pageContext: PageContext): PageContext
|
|
11
|
+
declare function preparePageContextForPublicUsageClientMinimal<PageContext extends PageContextPrepareMinimum>(pageContext: PageContext): PageContext & {
|
|
12
|
+
_isProxyObject: true;
|
|
13
|
+
ignoreWarning: import("../../shared/getProxyForPublicUsage.js").IgnoreWarning;
|
|
14
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { preview };
|
|
2
|
+
export type { CliPreviewConfig };
|
|
2
3
|
import { type ResolvedConfig, type PreviewServer } from 'vite';
|
|
3
4
|
import type { ApiOptions } from './types.js';
|
|
4
5
|
/**
|
|
@@ -10,3 +11,5 @@ declare function preview(options?: ApiOptions): Promise<{
|
|
|
10
11
|
viteServer?: PreviewServer;
|
|
11
12
|
viteConfig: ResolvedConfig;
|
|
12
13
|
}>;
|
|
14
|
+
type CliPreviewValue = boolean | 'vite' | undefined;
|
|
15
|
+
type CliPreviewConfig = CliPreviewValue | (() => CliPreviewValue | Promise<CliPreviewValue>);
|
|
@@ -7,6 +7,7 @@ import { assertUsage, assertWarning, onSetupPreview } from './utils.js';
|
|
|
7
7
|
import pc from '@brillout/picocolors';
|
|
8
8
|
import path from 'node:path';
|
|
9
9
|
import { getVikeConfigInternal } from '../vite/shared/resolveVikeConfigInternal.js';
|
|
10
|
+
import { isCallable } from '../runtime/utils.js';
|
|
10
11
|
/**
|
|
11
12
|
* Programmatically trigger `$ vike preview`
|
|
12
13
|
*
|
|
@@ -15,8 +16,7 @@ import { getVikeConfigInternal } from '../vite/shared/resolveVikeConfigInternal.
|
|
|
15
16
|
async function preview(options = {}) {
|
|
16
17
|
onSetupPreview();
|
|
17
18
|
const { viteConfigFromUserResolved, viteConfigResolved } = await prepareViteApiCall(options, 'preview');
|
|
18
|
-
const
|
|
19
|
-
const cliPreview = vikeConfig.config.cli?.preview;
|
|
19
|
+
const cliPreview = await resolveCliPreviewConfig();
|
|
20
20
|
assertUsage(cliPreview !== false, `${pc.cyan('$ vike preview')} isn't supported`);
|
|
21
21
|
const useVite = cliPreview === 'vite' || (cliPreview === undefined && !viteConfigResolved.vitePluginServerEntry?.inject);
|
|
22
22
|
if (!useVite) {
|
|
@@ -38,3 +38,13 @@ async function preview(options = {}) {
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
+
async function resolveCliPreviewConfig() {
|
|
42
|
+
const vikeConfig = await getVikeConfigInternal();
|
|
43
|
+
const val = vikeConfig.config.cli?.preview;
|
|
44
|
+
if (!isCallable(val)) {
|
|
45
|
+
return val;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
return await val();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -20,17 +20,15 @@ export { updateUserFiles };
|
|
|
20
20
|
export { isRunnable };
|
|
21
21
|
export { vikeConfigErrorRecoverMsg };
|
|
22
22
|
export type { BuildInfo };
|
|
23
|
-
export type { GlobalContextServerInternal
|
|
24
|
-
export type { GlobalContextServer };
|
|
23
|
+
export type { GlobalContextServerInternal };
|
|
25
24
|
import type { ViteManifest } from '../../types/ViteManifest.js';
|
|
26
25
|
import type { ResolvedConfig, ViteDevServer } from 'vite';
|
|
27
26
|
import { type PageRoutes } from '../../shared/route/loadPageRoutes.js';
|
|
28
27
|
import type { ViteConfigRuntime } from '../vite/shared/getViteConfigRuntime.js';
|
|
29
|
-
import type { GlobalContext } from '../../types/
|
|
28
|
+
import type { GlobalContext } from '../../types/GlobalContext.js';
|
|
30
29
|
import type { Hook } from '../../shared/hooks/getHook.js';
|
|
31
30
|
import type { PrerenderContext } from '../../types/index.js';
|
|
32
31
|
declare const vikeConfigErrorRecoverMsg: "Vike config loaded";
|
|
33
|
-
type GlobalContextServer = Pick<GlobalContextServerInternal, 'assetsManifest' | 'config' | 'viteConfig' | 'viteConfigRuntime' | 'pages' | 'baseServer' | 'baseAssets' | 'isClientSide'> & Vike.GlobalContext & Vike.GlobalContextServer;
|
|
34
32
|
type GlobalContextServerInternal = Awaited<ReturnType<typeof createGlobalContext>>;
|
|
35
33
|
declare function getGlobalContextServerInternal(): Promise<{
|
|
36
34
|
globalContext: (Record<string, unknown> & {
|
|
@@ -18,6 +18,7 @@ import { type GlobalConfigPublic } from '../../../shared/page-configs/resolveVik
|
|
|
18
18
|
import { type PlusFile } from './resolveVikeConfigInternal/getPlusFilesAll.js';
|
|
19
19
|
import type { PrerenderContextPublic } from '../../prerender/runPrerender.js';
|
|
20
20
|
import type { ResolvedConfig, UserConfig } from 'vite';
|
|
21
|
+
import { type IgnoreWarning } from '../../../shared/getProxyForPublicUsage.js';
|
|
21
22
|
type VikeConfigContext = {
|
|
22
23
|
userRootDir: string;
|
|
23
24
|
isDev: boolean;
|
|
@@ -44,7 +45,10 @@ declare function getVikeConfigInternalSync(): VikeConfigInternal;
|
|
|
44
45
|
* https://vike.dev/getVikeConfig
|
|
45
46
|
*/
|
|
46
47
|
declare function getVikeConfig(config: ResolvedConfig | UserConfig): VikeConfig;
|
|
47
|
-
type VikeConfig = Pick<VikeConfigInternal, 'config' | 'pages' | 'prerenderContext'
|
|
48
|
+
type VikeConfig = Pick<VikeConfigInternal, 'config' | 'pages' | 'prerenderContext'> & {
|
|
49
|
+
/** https://vike.dev/warning/internals */
|
|
50
|
+
ignoreWarning: IgnoreWarning;
|
|
51
|
+
};
|
|
48
52
|
declare function setVikeConfigContext(vikeConfigCtx_: VikeConfigContext): void;
|
|
49
53
|
declare function isVikeConfigContextSet(): boolean;
|
|
50
54
|
declare function getVikeConfigInternalOptional(): Promise<null | VikeConfigInternal>;
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
export { getProxyForPublicUsage };
|
|
2
|
+
export type { IgnoreWarning };
|
|
2
3
|
type Target = Record<string, unknown>;
|
|
3
4
|
type Fallback = (prop: string | symbol) => unknown;
|
|
4
|
-
declare function getProxyForPublicUsage<Obj extends Target>(obj: Obj, objName: 'pageContext' | 'globalContext' | 'prerenderContext' | 'vikeConfig', skipOnInternalProp?: true, fallback?: Fallback): Obj
|
|
5
|
+
declare function getProxyForPublicUsage<Obj extends Target>(obj: Obj, objName: 'pageContext' | 'globalContext' | 'prerenderContext' | 'vikeConfig', skipOnInternalProp?: true, fallback?: Fallback): Obj & {
|
|
6
|
+
_isProxyObject: true;
|
|
7
|
+
/** https://vike.dev/warning/internals */
|
|
8
|
+
ignoreWarning: IgnoreWarning;
|
|
9
|
+
};
|
|
10
|
+
/** https://vike.dev/warning/internals */
|
|
11
|
+
type IgnoreWarning = (prop: string) => any;
|
|
@@ -10,25 +10,27 @@ import { NOT_SERIALIZABLE } from './NOT_SERIALIZABLE.js';
|
|
|
10
10
|
import { assert, assertUsage, assertWarning, getPropAccessNotation, isBrowser } from './utils.js';
|
|
11
11
|
function getProxyForPublicUsage(obj, objName, skipOnInternalProp, fallback) {
|
|
12
12
|
return new Proxy(obj, {
|
|
13
|
-
get:
|
|
13
|
+
get: (_, prop) => getProp(prop, obj, objName, skipOnInternalProp, fallback),
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (
|
|
16
|
+
function getProp(prop, obj, objName, skipOnInternalProp, fallback) {
|
|
17
|
+
const propStr = String(prop);
|
|
18
|
+
if (prop === '_isProxyObject')
|
|
19
|
+
return true;
|
|
20
|
+
if (!skipOnInternalProp) {
|
|
21
|
+
if (prop === 'ignoreWarning')
|
|
22
|
+
return (prop) => getProp(prop, obj, objName, true, fallback);
|
|
23
|
+
if (!globalThis.__VIKE__IS_CLIENT)
|
|
22
24
|
onInternalProp(propStr, objName);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
}
|
|
26
|
+
if (fallback && !(prop in obj)) {
|
|
27
|
+
// Rudimentary flat pageContext implementation https://github.com/vikejs/vike/issues/1268
|
|
28
|
+
// Failed full-fledged implementation: https://github.com/vikejs/vike/pull/2458
|
|
29
|
+
return fallback(prop);
|
|
30
|
+
}
|
|
31
|
+
const val = obj[prop];
|
|
32
|
+
onNotSerializable(propStr, val, objName);
|
|
33
|
+
return val;
|
|
32
34
|
}
|
|
33
35
|
function onNotSerializable(propStr, val, objName) {
|
|
34
36
|
if (val !== NOT_SERIALIZABLE)
|
|
@@ -44,6 +46,9 @@ function onInternalProp(propStr, objName) {
|
|
|
44
46
|
if (propStr === '_configFromHook')
|
|
45
47
|
return;
|
|
46
48
|
if (propStr.startsWith('_')) {
|
|
47
|
-
assertWarning(false, `Using internal ${objName}.${propStr}
|
|
49
|
+
assertWarning(false, `Using internal ${objName}.${propStr} — https://vike.dev/warning/internals`, {
|
|
50
|
+
onlyOnce: true,
|
|
51
|
+
showStackTrace: true,
|
|
52
|
+
});
|
|
48
53
|
}
|
|
49
54
|
}
|
|
@@ -4,4 +4,7 @@ type GlobalContextPrepareMinimum = {
|
|
|
4
4
|
_isOriginalObject: true;
|
|
5
5
|
isGlobalContext: true;
|
|
6
6
|
};
|
|
7
|
-
declare function prepareGlobalContextForPublicUsage<GlobalContext extends GlobalContextPrepareMinimum>(globalContext: GlobalContext): GlobalContext
|
|
7
|
+
declare function prepareGlobalContextForPublicUsage<GlobalContext extends GlobalContextPrepareMinimum>(globalContext: GlobalContext): GlobalContext & {
|
|
8
|
+
_isProxyObject: true;
|
|
9
|
+
ignoreWarning: import("./getProxyForPublicUsage.js").IgnoreWarning;
|
|
10
|
+
};
|
|
@@ -7,5 +7,8 @@ type PageContextPrepareMinimum = {
|
|
|
7
7
|
isPageContext: true;
|
|
8
8
|
_globalContext: GlobalContextPrepareMinimum;
|
|
9
9
|
};
|
|
10
|
-
declare function preparePageContextForPublicUsage<PageContext extends PageContextPrepareMinimum>(pageContext: PageContext): PageContext
|
|
10
|
+
declare function preparePageContextForPublicUsage<PageContext extends PageContextPrepareMinimum>(pageContext: PageContext): PageContext & {
|
|
11
|
+
_isProxyObject: true;
|
|
12
|
+
ignoreWarning: import("./getProxyForPublicUsage.js").IgnoreWarning;
|
|
13
|
+
};
|
|
11
14
|
declare function assertPropertyGetters(pageContext: Record<string, unknown>): void;
|
|
@@ -42,9 +42,11 @@ import type { InjectFilterEntry } from './index.js';
|
|
|
42
42
|
import type { VikeVitePluginOptions } from '../node/vite/index.js';
|
|
43
43
|
import type { Vike } from './VikeNamespace.js';
|
|
44
44
|
import type { HooksTimeoutProvidedByUser } from '../shared/hooks/getHook.js';
|
|
45
|
-
import type {
|
|
45
|
+
import type { PageContextClient, PageContextServer } from './PageContext.js';
|
|
46
|
+
import type { GlobalContext } from './GlobalContext.js';
|
|
46
47
|
import type { InlineConfig } from 'vite';
|
|
47
48
|
import type { PassToClientPublic } from '../node/runtime/renderPage/html/serializeContext.js';
|
|
49
|
+
import type { CliPreviewConfig } from '../node/api/preview.js';
|
|
48
50
|
type HookNameOld = HookName | HookNameOldDesign;
|
|
49
51
|
type HookName = HookNamePage | HookNameGlobal;
|
|
50
52
|
type HookNamePage = 'onHydrationEnd' | 'onBeforePrerenderStart' | 'onBeforeRender' | 'onPageTransitionStart' | 'onPageTransitionEnd' | 'onRenderHtml' | 'onRenderClient' | 'guard' | 'data' | 'onData' | 'route';
|
|
@@ -514,7 +516,7 @@ type ConfigBuiltIn = {
|
|
|
514
516
|
middleware?: Function;
|
|
515
517
|
/** @experimental */
|
|
516
518
|
cli?: {
|
|
517
|
-
preview?:
|
|
519
|
+
preview?: CliPreviewConfig;
|
|
518
520
|
};
|
|
519
521
|
};
|
|
520
522
|
type ConfigBuiltInResolved = {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type { GlobalContext };
|
|
2
|
+
export type { GlobalContextServer };
|
|
3
|
+
export type { GlobalContextClient };
|
|
4
|
+
export type { GlobalContextClientWithServerRouting };
|
|
5
|
+
import type { GlobalContextServerInternal } from '../node/runtime/globalContext.js';
|
|
6
|
+
import type { GlobalContextClientInternalWithServerRouting } from '../client/runtime-server-routing/getGlobalContextClientInternal.js';
|
|
7
|
+
import type { GlobalContextBasePublic } from '../shared/createGlobalContextShared.js';
|
|
8
|
+
import type { GlobalContextClientInternal } from '../client/runtime-client-routing/getGlobalContextClientInternal.js';
|
|
9
|
+
import type { IgnoreWarning } from '../shared/getProxyForPublicUsage.js';
|
|
10
|
+
type GlobalContext = GlobalContextServer | GlobalContextClient;
|
|
11
|
+
type GlobalContextServer = GlobalContextCommon & Pick<GlobalContextServerInternal, 'assetsManifest' | 'config' | 'viteConfig' | 'viteConfigRuntime' | 'pages' | 'baseServer' | 'baseAssets' | 'isClientSide'> & Vike.GlobalContext & Vike.GlobalContextServer;
|
|
12
|
+
type GlobalContextClient = GlobalContextCommon & GlobalContextBasePublic & Pick<GlobalContextClientInternal, 'isClientSide'> & Vike.GlobalContext & Vike.GlobalContextClient & {};
|
|
13
|
+
type GlobalContextClientWithServerRouting = GlobalContextCommon & GlobalContextBasePublic & Pick<GlobalContextClientInternalWithServerRouting, 'isClientSide'> & Vike.GlobalContext & Vike.GlobalContextClient & {};
|
|
14
|
+
type GlobalContextCommon = {
|
|
15
|
+
/** https://vike.dev/warning/internals */
|
|
16
|
+
ignoreWarning?: IgnoreWarning;
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
export type { PageContext };
|
|
2
2
|
export type { PageContextServer };
|
|
3
3
|
export type { PageContextClient };
|
|
4
|
-
export type { GlobalContext };
|
|
5
|
-
export type { GlobalContextServer };
|
|
6
|
-
export type { GlobalContextClient };
|
|
7
4
|
export type { PageContextWithServerRouting };
|
|
8
5
|
export type { PageContextClientWithServerRouting };
|
|
9
|
-
export type { GlobalContextClientWithServerRouting };
|
|
10
6
|
export type { PageContextInternalServer };
|
|
11
7
|
export type { PageContextInternalClient };
|
|
12
8
|
export type { PageContextInternalClient_ServerRouting };
|
|
@@ -18,13 +14,11 @@ import type { PageContextUrlInternal, PageContextUrlClient, PageContextUrlServer
|
|
|
18
14
|
import type { From, PageContextConfig, Source, Sources } from '../shared/page-configs/resolveVikeConfigPublic.js';
|
|
19
15
|
import type { Config } from './Config.js';
|
|
20
16
|
import type { AbortStatusCode } from '../shared/route/abort.js';
|
|
21
|
-
import type { GlobalContextServer } from '
|
|
22
|
-
import type {
|
|
23
|
-
import type { GlobalContextClientWithServerRouting } from '../client/runtime-server-routing/getGlobalContextClientInternal.js';
|
|
17
|
+
import type { GlobalContextClient, GlobalContextServer, GlobalContextClientWithServerRouting } from './GlobalContext.js';
|
|
18
|
+
import type { IgnoreWarning } from '../shared/getProxyForPublicUsage.js';
|
|
24
19
|
type PageContextServer<Data = unknown> = PageContextBuiltInServer<Data> & Vike.PageContext & Vike.PageContextServer;
|
|
25
20
|
type PageContext<Data = unknown> = PageContextClient<Data> | PageContextServer<Data>;
|
|
26
21
|
type PageContextClient<Data = unknown> = PageContextBuiltInClientWithClientRouting<Data> & Vike.PageContext & Vike.PageContextClient;
|
|
27
|
-
type GlobalContext = GlobalContextServer | GlobalContextClient;
|
|
28
22
|
type PageContextWithServerRouting<Data = unknown> = PageContextClientWithServerRouting<Data> | PageContextServer<Data>;
|
|
29
23
|
type PageContextClientWithServerRouting<Data = unknown> = PageContextBuiltInClientWithServerRouting<Data> & Vike.PageContext & Vike.PageContextClient;
|
|
30
24
|
type PageContextBuiltInCommon<Data> = PageContextConfig & {
|
|
@@ -134,6 +128,8 @@ type PageContextBuiltInCommon<Data> = PageContextConfig & {
|
|
|
134
128
|
* https://vike.dev/pageContext#isBaseMissing
|
|
135
129
|
*/
|
|
136
130
|
isBaseMissing?: true;
|
|
131
|
+
/** https://vike.dev/warning/internals */
|
|
132
|
+
ignoreWarning?: IgnoreWarning;
|
|
137
133
|
};
|
|
138
134
|
type PageContextBuiltInServer<Data> = PageContextBuiltInCommon<Data> & PageContextUrlServer & {
|
|
139
135
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export type { PageContext, PageContextServer, PageContextClient,
|
|
1
|
+
export type { PageContext, PageContextServer, PageContextClient, PageContextWithServerRouting, PageContextClientWithServerRouting, } from './PageContext.js';
|
|
2
|
+
export type { GlobalContext, GlobalContextServer, GlobalContextClient, GlobalContextClientWithServerRouting, } from './GlobalContext.js';
|
|
2
3
|
export type { PrerenderContextPublic as PrerenderContext } from '../node/prerender/runPrerender.js';
|
|
3
4
|
export type { PageContextBuiltInServer } from './PageContext.js';
|
|
4
5
|
export type { PageContextBuiltInClientWithClientRouting } from './PageContext.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.243-commit-
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.243-commit-0d0395a";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.243-commit-
|
|
2
|
+
export const PROJECT_VERSION = '0.4.243-commit-0d0395a';
|