vike 0.4.238-commit-3c1a09d → 0.4.238-commit-d48a597
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/cjs/node/prerender/resolvePrerenderConfig.js +3 -2
- package/dist/cjs/node/runtime/index.js +3 -3
- package/dist/cjs/node/runtime/page-files/setup.js +3 -1
- package/dist/cjs/node/runtime/renderPage/createHttpResponse.js +2 -9
- package/dist/cjs/node/runtime/renderPage/createPageContextServerSide.js +2 -2
- package/dist/cjs/node/runtime/{csp.js → renderPage/csp.js} +13 -12
- package/dist/cjs/node/runtime/renderPage/execHookOnRenderHtml.js +2 -2
- package/dist/cjs/node/runtime/renderPage/getEarlyHints.js +1 -1
- package/dist/cjs/node/runtime/renderPage/getHttpResponseBody.js +2 -2
- package/dist/cjs/node/runtime/renderPage/headersResponse.js +48 -0
- package/dist/cjs/node/runtime/{html → renderPage/html}/injectAssets/getHtmlTags.js +6 -6
- package/dist/cjs/node/runtime/{html → renderPage/html}/injectAssets/getViteDevScript.js +1 -1
- package/dist/cjs/node/runtime/{html → renderPage/html}/injectAssets/inferHtmlTags.js +5 -6
- package/dist/cjs/node/runtime/{html → renderPage/html}/injectAssets/injectAssets__public.js +1 -1
- package/dist/cjs/node/runtime/{html → renderPage/html}/injectAssets/injectHtmlTags.js +1 -1
- package/dist/cjs/node/runtime/{html → renderPage/html}/injectAssets/mergeScriptTags.js +2 -2
- package/dist/cjs/node/runtime/{html → renderPage/html}/injectAssets.js +2 -2
- package/dist/cjs/node/runtime/{html → renderPage/html}/propKeys.js +1 -1
- package/dist/cjs/node/runtime/{html → renderPage/html}/renderHtml.js +1 -1
- package/dist/cjs/node/runtime/{html → renderPage/html}/serializeContext.js +6 -6
- package/dist/cjs/node/runtime/{html → renderPage/html}/stream/react-streaming.js +1 -1
- package/dist/cjs/node/runtime/{html → renderPage/html}/stream.js +1 -1
- package/dist/cjs/node/runtime/renderPage/loadPageConfigsLazyServerSide.js +16 -48
- package/dist/cjs/node/runtime/renderPage/renderPageAfterRoute.js +2 -2
- package/dist/cjs/node/runtime/renderPage.js +1 -1
- package/dist/cjs/node/vite/plugins/pluginBuild/handleAssetsManifest.js +1 -1
- package/dist/cjs/node/vite/plugins/pluginNonRunnableDev.js +4 -3
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal.js +20 -22
- package/dist/cjs/shared/createGlobalContextShared.js +4 -22
- package/dist/cjs/shared/createPageContextShared.js +2 -2
- package/dist/cjs/shared/page-configs/resolveVikeConfigPublic.js +62 -44
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/cjs/utils/assert.js +16 -1
- package/dist/esm/client/runtime-client-routing/createPageContextClientSide.d.ts +39 -16
- package/dist/esm/client/runtime-client-routing/createPageContextClientSide.js +1 -1
- package/dist/esm/client/runtime-client-routing/getPageContextCurrent.d.ts +2 -2
- package/dist/esm/client/runtime-client-routing/getPageContextFromHooks.d.ts +97 -83
- package/dist/esm/client/runtime-client-routing/globalContext.d.ts +38 -10
- package/dist/esm/client/runtime-client-routing/prefetch/getPrefetchSettings.d.ts +2 -2
- package/dist/esm/client/runtime-client-routing/prefetch.d.ts +2 -2
- package/dist/esm/client/runtime-client-routing/prefetch.js +2 -2
- package/dist/esm/client/runtime-client-routing/preparePageContextForPublicUsageClient.d.ts +2 -2
- package/dist/esm/client/runtime-client-routing/renderPageClientSide.d.ts +43 -28
- package/dist/esm/client/runtime-server-routing/createPageContextClientSide.d.ts +39 -16
- package/dist/esm/client/runtime-server-routing/createPageContextClientSide.js +1 -1
- package/dist/esm/client/runtime-server-routing/globalContext.d.ts +38 -10
- package/dist/esm/client/runtime-server-routing/preparePageContextForPublicUsageClient.d.ts +2 -2
- package/dist/esm/client/shared/createGetGlobalContextClient.d.ts +38 -10
- package/dist/esm/client/shared/execHookOnRenderClient.d.ts +2 -2
- package/dist/esm/client/shared/loadPageConfigsLazyClientSide.d.ts +1 -1
- package/dist/esm/client/shared/loadPageConfigsLazyClientSide.js +2 -3
- package/dist/esm/client/shared/preparePageContextForPublicUsageClientShared.d.ts +2 -2
- package/dist/esm/node/prerender/resolvePrerenderConfig.js +4 -3
- package/dist/esm/node/prerender/runPrerender.d.ts +56 -15
- package/dist/esm/node/runtime/globalContext.d.ts +152 -40
- package/dist/esm/node/runtime/index.d.ts +3 -3
- package/dist/esm/node/runtime/index.js +3 -3
- package/dist/esm/node/runtime/page-files/setup.js +3 -1
- package/dist/esm/node/runtime/renderPage/createHttpResponse.d.ts +1 -1
- package/dist/esm/node/runtime/renderPage/createHttpResponse.js +2 -9
- package/dist/esm/node/runtime/renderPage/createPageContextServerSide.d.ts +52 -10
- package/dist/esm/node/runtime/renderPage/createPageContextServerSide.js +2 -2
- package/dist/esm/node/runtime/renderPage/csp.d.ts +12 -0
- package/dist/esm/node/runtime/{csp.js → renderPage/csp.js} +13 -12
- package/dist/esm/node/runtime/renderPage/execHookOnRenderHtml.d.ts +2 -2
- package/dist/esm/node/runtime/renderPage/execHookOnRenderHtml.js +2 -2
- package/dist/esm/node/runtime/renderPage/execHookServer.d.ts +2 -2
- package/dist/esm/node/runtime/renderPage/getEarlyHints.js +1 -1
- package/dist/esm/node/runtime/renderPage/getHttpResponseBody.d.ts +2 -2
- package/dist/esm/node/runtime/renderPage/getHttpResponseBody.js +2 -2
- package/dist/esm/node/runtime/renderPage/headersResponse.d.ts +10 -0
- package/dist/esm/node/runtime/renderPage/headersResponse.js +46 -0
- package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/getHtmlTags.d.ts +1 -1
- package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/getHtmlTags.js +6 -6
- package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/getViteDevScript.d.ts +1 -1
- package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/getViteDevScript.js +1 -1
- package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/inferHtmlTags.d.ts +3 -3
- package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/inferHtmlTags.js +4 -5
- package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/injectAssets__public.js +1 -1
- package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/injectHtmlTags.js +1 -1
- package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/mergeScriptTags.js +3 -3
- package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets.d.ts +2 -2
- package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets.js +2 -2
- package/dist/esm/node/runtime/{html → renderPage/html}/propKeys.js +1 -1
- package/dist/esm/node/runtime/{html → renderPage/html}/renderHtml.d.ts +1 -1
- package/dist/esm/node/runtime/{html → renderPage/html}/renderHtml.js +1 -1
- package/dist/esm/node/runtime/{html → renderPage/html}/serializeContext.d.ts +4 -4
- package/dist/esm/node/runtime/{html → renderPage/html}/serializeContext.js +6 -6
- package/dist/esm/node/runtime/{html → renderPage/html}/stream/react-streaming.js +1 -1
- package/dist/esm/node/runtime/{html → renderPage/html}/stream.js +1 -1
- package/dist/esm/node/runtime/renderPage/loadPageConfigsLazyServerSide.d.ts +61 -16
- package/dist/esm/node/runtime/renderPage/loadPageConfigsLazyServerSide.js +18 -50
- package/dist/esm/node/runtime/renderPage/preparePageContextForPublicUsageServer.d.ts +2 -2
- package/dist/esm/node/runtime/renderPage/renderPageAfterRoute.d.ts +112 -30
- package/dist/esm/node/runtime/renderPage/renderPageAfterRoute.js +2 -2
- package/dist/esm/node/runtime/renderPage.d.ts +52 -10
- package/dist/esm/node/runtime/renderPage.js +1 -1
- package/dist/esm/node/vite/plugins/pluginBuild/handleAssetsManifest.js +1 -1
- package/dist/esm/node/vite/plugins/pluginNonRunnableDev.js +4 -3
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal.d.ts +4 -8
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal.js +22 -24
- package/dist/esm/shared/createGlobalContextShared.d.ts +73 -17
- package/dist/esm/shared/createGlobalContextShared.js +5 -23
- package/dist/esm/shared/createPageContextShared.d.ts +2 -7
- package/dist/esm/shared/createPageContextShared.js +2 -2
- package/dist/esm/shared/getPageFiles.d.ts +1 -1
- package/dist/esm/shared/hooks/execHook.d.ts +2 -2
- package/dist/esm/shared/hooks/getHook.d.ts +3 -3
- package/dist/esm/shared/page-configs/resolveVikeConfigPublic.d.ts +91 -31
- package/dist/esm/shared/page-configs/resolveVikeConfigPublic.js +62 -44
- package/dist/esm/types/Config/ConfigResolved.d.ts +8 -0
- package/dist/esm/types/Config.d.ts +4 -4
- package/dist/esm/types/PageContext.d.ts +3 -26
- package/dist/esm/types/VikeNamespace.d.ts +0 -27
- package/dist/esm/types/index.d.ts +2 -2
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/utils/assert.js +16 -1
- package/package.json +1 -1
- package/dist/cjs/types/Config/helpers.js +0 -2
- package/dist/esm/node/runtime/csp.d.ts +0 -12
- package/dist/esm/types/Config/PageContextConfig.d.ts +0 -15
- package/dist/esm/types/Config/helpers.d.ts +0 -10
- package/dist/esm/types/Config/helpers.js +0 -1
- /package/dist/cjs/node/runtime/{html → renderPage/html}/injectAssets/sanitizeJson.js +0 -0
- /package/dist/cjs/types/Config/{PageContextConfig.js → ConfigResolved.js} +0 -0
- /package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/injectAssets__public.d.ts +0 -0
- /package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/injectHtmlTags.d.ts +0 -0
- /package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/mergeScriptTags.d.ts +0 -0
- /package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/sanitizeJson.d.ts +0 -0
- /package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/sanitizeJson.js +0 -0
- /package/dist/esm/node/runtime/{html → renderPage/html}/propKeys.d.ts +0 -0
- /package/dist/esm/node/runtime/{html → renderPage/html}/stream/react-streaming.d.ts +0 -0
- /package/dist/esm/node/runtime/{html → renderPage/html}/stream.d.ts +0 -0
- /package/dist/esm/types/Config/{PageContextConfig.js → ConfigResolved.js} +0 -0
|
@@ -2,7 +2,7 @@ export { createGlobalContextShared };
|
|
|
2
2
|
export { getGlobalContextSyncErrMsg };
|
|
3
3
|
import { assert, changeEnumerable, genPromise, objectAssign, objectReplace, unique } from './utils.js';
|
|
4
4
|
import { parseVirtualFileExportsGlobalEntry } from './getPageFiles/parseVirtualFileExportsGlobalEntry.js';
|
|
5
|
-
import {
|
|
5
|
+
import { resolveGlobalContextConfig } from './page-configs/resolveVikeConfigPublic.js';
|
|
6
6
|
import { execHookGlobal } from './hooks/execHook.js';
|
|
7
7
|
import { prepareGlobalContextForPublicUsage } from './prepareGlobalContextForPublicUsage.js';
|
|
8
8
|
import { getHookFromPageConfigGlobalCumulative } from './hooks/getHook.js';
|
|
@@ -70,7 +70,9 @@ addGlobalContextTmp, addGlobalContextAsync) {
|
|
|
70
70
|
return globalObject.globalContext;
|
|
71
71
|
}
|
|
72
72
|
function createGlobalContextBase(virtualFileExportsGlobalEntry) {
|
|
73
|
-
const { pageFilesAll,
|
|
73
|
+
const { pageFilesAll, pageConfigs, pageConfigGlobal } = parseVirtualFileExportsGlobalEntry(virtualFileExportsGlobalEntry);
|
|
74
|
+
const allPageIds = getAllPageIds(pageFilesAll, pageConfigs);
|
|
75
|
+
const globalContextAddendum = resolveGlobalContextConfig(pageConfigs, pageConfigGlobal);
|
|
74
76
|
const globalContext = {
|
|
75
77
|
/**
|
|
76
78
|
* Useful for distinguishing `globalContext` from other objects and narrowing down TypeScript unions.
|
|
@@ -84,31 +86,11 @@ function createGlobalContextBase(virtualFileExportsGlobalEntry) {
|
|
|
84
86
|
_pageConfigs: pageConfigs,
|
|
85
87
|
_pageConfigGlobal: pageConfigGlobal,
|
|
86
88
|
_allPageIds: allPageIds,
|
|
87
|
-
|
|
88
|
-
config: vikeConfigPublicGlobal.config,
|
|
89
|
-
pages: vikeConfigPublicPagesEager,
|
|
89
|
+
...globalContextAddendum,
|
|
90
90
|
};
|
|
91
91
|
changeEnumerable(globalContext, '_isOriginalObject', false);
|
|
92
92
|
return globalContext;
|
|
93
93
|
}
|
|
94
|
-
function getConfigsAll(virtualFileExportsGlobalEntry) {
|
|
95
|
-
const { pageFilesAll, pageConfigs, pageConfigGlobal } = parseVirtualFileExportsGlobalEntry(virtualFileExportsGlobalEntry);
|
|
96
|
-
const allPageIds = getAllPageIds(pageFilesAll, pageConfigs);
|
|
97
|
-
const vikeConfigPublicGlobal = resolveVikeConfigPublicGlobal({
|
|
98
|
-
pageConfigGlobalValues: pageConfigGlobal.configValues,
|
|
99
|
-
});
|
|
100
|
-
const vikeConfigPublicPagesEager = Object.fromEntries(pageConfigs.map((pageConfig) => {
|
|
101
|
-
return resolveVikeConfigPublicPageEagerLoaded(pageConfigGlobal.configValues, pageConfig, pageConfig.configValues);
|
|
102
|
-
}));
|
|
103
|
-
return {
|
|
104
|
-
pageFilesAll,
|
|
105
|
-
allPageIds,
|
|
106
|
-
pageConfigs,
|
|
107
|
-
pageConfigGlobal,
|
|
108
|
-
vikeConfigPublicGlobal,
|
|
109
|
-
vikeConfigPublicPagesEager,
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
94
|
function getAllPageIds(pageFilesAll, pageConfigs) {
|
|
113
95
|
const fileIds = pageFilesAll.filter(({ isDefaultPageFile }) => !isDefaultPageFile).map(({ pageId }) => pageId);
|
|
114
96
|
const allPageIds = unique(fileIds);
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
export { createPageContextShared };
|
|
2
2
|
export { createPageContextObject };
|
|
3
|
-
import type {
|
|
3
|
+
import type { GlobalConfigPublic } from './page-configs/resolveVikeConfigPublic.js';
|
|
4
4
|
import { type PageContextPrepareMinimum } from './preparePageContextForPublicUsage.js';
|
|
5
|
-
declare function createPageContextShared<T extends PageContextPrepareMinimum>(pageContextCreated: T,
|
|
6
|
-
config: import("../types/index.js").ConfigResolved;
|
|
7
|
-
_source: import("./page-configs/resolveVikeConfigPublic.js").Source;
|
|
8
|
-
_sources: import("./page-configs/resolveVikeConfigPublic.js").Sources;
|
|
9
|
-
_from: import("./page-configs/resolveVikeConfigPublic.js").From;
|
|
10
|
-
};
|
|
5
|
+
declare function createPageContextShared<T extends PageContextPrepareMinimum>(pageContextCreated: T, globalConfigPublic: GlobalConfigPublic): T & GlobalConfigPublic;
|
|
11
6
|
declare function createPageContextObject(): {
|
|
12
7
|
_isOriginalObject: true;
|
|
13
8
|
isPageContext: true;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { createPageContextShared };
|
|
2
2
|
export { createPageContextObject };
|
|
3
3
|
import { changeEnumerable, objectAssign } from './utils.js';
|
|
4
|
-
function createPageContextShared(pageContextCreated,
|
|
5
|
-
objectAssign(pageContextCreated,
|
|
4
|
+
function createPageContextShared(pageContextCreated, globalConfigPublic) {
|
|
5
|
+
objectAssign(pageContextCreated, globalConfigPublic);
|
|
6
6
|
return pageContextCreated;
|
|
7
7
|
}
|
|
8
8
|
function createPageContextObject() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type { PageFile } from './getPageFiles/getPageFileObject.js';
|
|
2
|
-
export type { ExportsAll,
|
|
2
|
+
export type { ExportsAll, PageContextConfig } from './page-configs/resolveVikeConfigPublic.js';
|
|
3
3
|
export { getPageFilesClientSide } from './getPageFiles/getAllPageIdFiles.js';
|
|
4
4
|
export { getPageFilesServerSide } from './getPageFiles/getAllPageIdFiles.js';
|
|
@@ -11,14 +11,14 @@ export { isUserHookError };
|
|
|
11
11
|
export type { PageContextExecHook };
|
|
12
12
|
import type { PageContextClient, PageContextServer } from '../../types/PageContext.js';
|
|
13
13
|
import type { Hook, HookLoc } from './getHook.js';
|
|
14
|
-
import type {
|
|
14
|
+
import type { PageContextConfig } from '../getPageFiles.js';
|
|
15
15
|
import type { HookName, HookNameGlobal } from '../../types/Config.js';
|
|
16
16
|
import type { PageConfigGlobalRuntime } from '../../types/PageConfig.js';
|
|
17
17
|
import type { PageContextForPublicUsageServer } from '../../node/runtime/renderPage/preparePageContextForPublicUsageServer.js';
|
|
18
18
|
import type { PageContextForPublicUsageClientShared } from '../../client/shared/preparePageContextForPublicUsageClientShared.js';
|
|
19
19
|
import { type PageContextPrepareMinimum } from '../preparePageContextForPublicUsage.js';
|
|
20
20
|
import type { GlobalContextPrepareMinimum } from '../prepareGlobalContextForPublicUsage.js';
|
|
21
|
-
type PageContextExecHook =
|
|
21
|
+
type PageContextExecHook = PageContextConfig & PageContextForPublicUsage;
|
|
22
22
|
type PageContextForPublicUsage = PageContextForPublicUsageServer | PageContextForPublicUsageClientShared;
|
|
23
23
|
type HookWithResult = Hook & {
|
|
24
24
|
hookReturn: unknown;
|
|
@@ -9,7 +9,7 @@ export type { HookLoc };
|
|
|
9
9
|
export type { HookTimeout };
|
|
10
10
|
export type { HooksTimeoutProvidedByUser };
|
|
11
11
|
export { getHookTimeoutDefault };
|
|
12
|
-
import type {
|
|
12
|
+
import type { PageContextConfig } from '../getPageFiles.js';
|
|
13
13
|
import type { HookNameOld, HookNamePage, HookNameGlobal, HookName } from '../../types/Config.js';
|
|
14
14
|
import type { PageConfigGlobalRuntime, PageConfigRuntime } from '../../types/PageConfig.js';
|
|
15
15
|
import type { GlobalContextPrepareMinimum } from '../prepareGlobalContextForPublicUsage.js';
|
|
@@ -28,8 +28,8 @@ type HookTimeout = {
|
|
|
28
28
|
warning: number | false;
|
|
29
29
|
};
|
|
30
30
|
type HooksTimeoutProvidedByUser = false | Partial<Record<HookNameOld, false | Partial<HookTimeout>>>;
|
|
31
|
-
declare function getHookFromPageContext(pageContext:
|
|
32
|
-
declare function getHookFromPageContextNew(hookName: HookName, pageContext:
|
|
31
|
+
declare function getHookFromPageContext(pageContext: PageContextConfig, hookName: HookNameOld): null | Hook;
|
|
32
|
+
declare function getHookFromPageContextNew(hookName: HookName, pageContext: PageContextConfig): Hook[];
|
|
33
33
|
declare function getHookFromPageConfig(pageConfig: PageConfigRuntime, hookName: HookNamePage): null | Hook;
|
|
34
34
|
declare function getHookFromPageConfigGlobal(pageConfigGlobal: PageConfigGlobalRuntime, hookName: HookNameGlobal): null | Hook;
|
|
35
35
|
declare function getHookFromPageConfigGlobalCumulative(pageConfigGlobal: PageConfigGlobalRuntime, hookName: HookNameGlobal): Hook[];
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export type {
|
|
5
|
-
export type {
|
|
6
|
-
export type { VikeConfigPublicPageLazyLoaded };
|
|
1
|
+
export { resolveGlobalConfigPublic };
|
|
2
|
+
export { resolvePageContextConfig };
|
|
3
|
+
export { resolveGlobalContextConfig };
|
|
4
|
+
export type { PageContextConfig };
|
|
5
|
+
export type { GlobalConfigPublic };
|
|
7
6
|
export type { Source };
|
|
8
7
|
export type { Sources };
|
|
9
8
|
export type { From };
|
|
@@ -11,9 +10,9 @@ export type { ExportsAll };
|
|
|
11
10
|
export type { ConfigEntries };
|
|
12
11
|
import type { FileType } from '../getPageFiles/fileTypes.js';
|
|
13
12
|
import type { PageFile } from '../getPageFiles/getPageFileObject.js';
|
|
14
|
-
import type { ConfigValues, PageConfigBuildTime, PageConfigGlobalRuntime, PageConfigRuntime, PageConfigRuntimeLoaded } from '../../types/PageConfig.js';
|
|
13
|
+
import type { ConfigValues, PageConfigBuildTime, PageConfigGlobalBuildTime, PageConfigGlobalRuntime, PageConfigRuntime, PageConfigRuntimeLoaded } from '../../types/PageConfig.js';
|
|
15
14
|
import { type ConfigDefinedAtOptional } from './getConfigDefinedAt.js';
|
|
16
|
-
import type { ConfigResolved } from '../../types/Config/
|
|
15
|
+
import type { ConfigResolved } from '../../types/Config/ConfigResolved.js';
|
|
17
16
|
import type { Route } from '../../types/Config.js';
|
|
18
17
|
type ExportsAll = Record<string, {
|
|
19
18
|
exportValue: unknown;
|
|
@@ -35,17 +34,6 @@ type ConfigEntries = Record<string, {
|
|
|
35
34
|
configDefinedAt: ConfigDefinedAtOptional;
|
|
36
35
|
configDefinedByFile: string | null;
|
|
37
36
|
}[]>;
|
|
38
|
-
type VikeConfigPublicPageLazyLoaded = {
|
|
39
|
-
config: ConfigResolved;
|
|
40
|
-
source: Source;
|
|
41
|
-
sources: Sources;
|
|
42
|
-
from: From;
|
|
43
|
-
configEntries: ConfigEntries;
|
|
44
|
-
exports: Record<string, unknown>;
|
|
45
|
-
exportsAll: ExportsAll;
|
|
46
|
-
/** @deprecated */
|
|
47
|
-
pageExports: Record<string, unknown>;
|
|
48
|
-
};
|
|
49
37
|
type From = {
|
|
50
38
|
configsStandard: Record<string, // configName
|
|
51
39
|
SourceConfigsStandard>;
|
|
@@ -77,11 +65,34 @@ type SourceConfigsComputed = {
|
|
|
77
65
|
definedAt: 'Vike';
|
|
78
66
|
value: unknown;
|
|
79
67
|
};
|
|
80
|
-
type
|
|
68
|
+
type PageContextConfig = {
|
|
69
|
+
/** The page's configuration values.
|
|
70
|
+
*
|
|
71
|
+
* https://vike.dev/config
|
|
72
|
+
* https://vike.dev/pageContext#config
|
|
73
|
+
*/
|
|
81
74
|
config: ConfigResolved;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
75
|
+
source: Source;
|
|
76
|
+
sources: Sources;
|
|
77
|
+
from: From;
|
|
78
|
+
/** The page's configuration, including the configs origin and overridden configs.
|
|
79
|
+
*
|
|
80
|
+
* https://vike.dev/config
|
|
81
|
+
*/
|
|
82
|
+
configEntries: ConfigEntries;
|
|
83
|
+
/** Custom Exports/Hooks.
|
|
84
|
+
*
|
|
85
|
+
* https://vike.dev/exports
|
|
86
|
+
*/
|
|
87
|
+
exports: Record<string, unknown>;
|
|
88
|
+
/**
|
|
89
|
+
* Same as `pageContext.exports` but cumulative.
|
|
90
|
+
*
|
|
91
|
+
* https://vike.dev/exports
|
|
92
|
+
*/
|
|
93
|
+
exportsAll: ExportsAll;
|
|
94
|
+
/** @deprecated */
|
|
95
|
+
pageExports: Record<string, unknown>;
|
|
85
96
|
};
|
|
86
97
|
type WithRoute = {
|
|
87
98
|
route: Route;
|
|
@@ -90,12 +101,61 @@ type WithRoute = {
|
|
|
90
101
|
route?: undefined;
|
|
91
102
|
isErrorPage: true;
|
|
92
103
|
};
|
|
93
|
-
type
|
|
94
|
-
type
|
|
95
|
-
declare function
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
104
|
+
type PageConfigPublicWithRoute = ConfigPublic & WithRoute;
|
|
105
|
+
type ConfigPublic = ReturnType<typeof getPublicCopy>;
|
|
106
|
+
declare function getPublicCopy(configInternal: ReturnType<typeof resolveConfigPublic_V1Design>): {
|
|
107
|
+
config: ConfigResolved;
|
|
108
|
+
_source: Source;
|
|
109
|
+
_sources: Sources;
|
|
110
|
+
_from: From;
|
|
111
|
+
};
|
|
112
|
+
declare function resolvePageContextConfig(pageFiles: PageFile[], // V0.4 design
|
|
100
113
|
pageConfig: PageConfigRuntimeLoaded | null, // V1 design
|
|
101
|
-
pageConfigGlobal: PageConfigGlobalRuntime):
|
|
114
|
+
pageConfigGlobal: PageConfigGlobalRuntime): PageContextConfig;
|
|
115
|
+
declare function resolveGlobalContextConfig(pageConfigs: PageConfigRuntime[], pageConfigGlobal: PageConfigGlobalRuntime): {
|
|
116
|
+
_globalConfigPublic: {
|
|
117
|
+
pages: {
|
|
118
|
+
[k: string]: PageConfigPublicWithRoute;
|
|
119
|
+
};
|
|
120
|
+
config: ConfigResolved;
|
|
121
|
+
_source: Source;
|
|
122
|
+
_sources: Sources;
|
|
123
|
+
_from: From;
|
|
124
|
+
};
|
|
125
|
+
pages: {
|
|
126
|
+
[k: string]: PageConfigPublicWithRoute;
|
|
127
|
+
};
|
|
128
|
+
config: ConfigResolved;
|
|
129
|
+
_source: Source;
|
|
130
|
+
_sources: Sources;
|
|
131
|
+
_from: From;
|
|
132
|
+
};
|
|
133
|
+
type GlobalConfigPublic = Omit<ReturnType<typeof resolveGlobalConfigPublic>, '_globalConfigPublic'>;
|
|
134
|
+
declare function resolveGlobalConfigPublic<PageConfig extends PageConfigRuntime | PageConfigBuildTime, PageConfigGlobal extends PageConfigGlobalRuntime | PageConfigGlobalBuildTime>(pageConfigs: PageConfig[], pageConfigGlobal: PageConfigGlobal, getConfigValues: (config: PageConfig | PageConfigGlobal, isGlobalConfig?: true) => ConfigValues): {
|
|
135
|
+
_globalConfigPublic: {
|
|
136
|
+
pages: {
|
|
137
|
+
[k: string]: PageConfigPublicWithRoute;
|
|
138
|
+
};
|
|
139
|
+
config: ConfigResolved;
|
|
140
|
+
_source: Source;
|
|
141
|
+
_sources: Sources;
|
|
142
|
+
_from: From;
|
|
143
|
+
};
|
|
144
|
+
pages: {
|
|
145
|
+
[k: string]: PageConfigPublicWithRoute;
|
|
146
|
+
};
|
|
147
|
+
config: ConfigResolved;
|
|
148
|
+
_source: Source;
|
|
149
|
+
_sources: Sources;
|
|
150
|
+
_from: From;
|
|
151
|
+
};
|
|
152
|
+
declare function resolveConfigPublic_V1Design(pageConfig: {
|
|
153
|
+
configValues: ConfigValues;
|
|
154
|
+
}): {
|
|
155
|
+
config: ConfigResolved;
|
|
156
|
+
configEntries: ConfigEntries;
|
|
157
|
+
exportsAll: ExportsAll;
|
|
158
|
+
source: Source;
|
|
159
|
+
sources: Sources;
|
|
160
|
+
from: From;
|
|
161
|
+
};
|
|
@@ -1,55 +1,48 @@
|
|
|
1
|
-
// TODO/now: rename PageConfig names
|
|
2
|
-
// - Use `Internal` suffix, i.e. {Page,Global}ConfigInternal
|
|
3
|
-
// - While keeping {Page,Global}ConfigPublic or remove Public suffix and rename it to {Page,Global}Config ?
|
|
4
|
-
// - rename EagerLoaded EagerlyLoaded
|
|
5
|
-
// - remove `LazyLoaded` suffix
|
|
6
|
-
// TODO/now: rename VikeConfigPublicPageLazyLoaded PageContextSomething (for `pageContext: PageContextSomething` usage)
|
|
7
1
|
// TO-DO/soon/same-api: use public API internally?
|
|
8
2
|
// TO-DO/soon/flat-pageContext: rename definedAt => definedBy
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
3
|
+
export { resolveGlobalConfigPublic };
|
|
4
|
+
export { resolvePageContextConfig };
|
|
5
|
+
export { resolveGlobalContextConfig };
|
|
12
6
|
import { assertDefaultExports, forbiddenDefaultExports } from '../getPageFiles/assert_exports_old_design.js';
|
|
13
7
|
import { getConfigDefinedAtOptional, getDefinedAtString } from './getConfigDefinedAt.js';
|
|
14
8
|
import { getConfigValueFilePathToShowToUser } from './helpers.js';
|
|
15
9
|
import { assert, isObject, assertWarning, assertUsage, makeLast, isBrowser, isScriptFile, isTemplateFile, objectDefineProperty, } from '../utils.js';
|
|
16
10
|
import pc from '@brillout/picocolors';
|
|
17
|
-
function
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
11
|
+
function resolveGlobalConfigPublicPage(pageConfigGlobalValues, pageConfig, pageConfigValues) {
|
|
12
|
+
const pageConfigPublic_ = resolvePageConfigPublic({ pageConfigGlobalValues, pageConfigValues });
|
|
13
|
+
const pageConfigPublic = getPublicCopy(pageConfigPublic_);
|
|
14
|
+
const page = (() => {
|
|
15
|
+
if (!pageConfig.isErrorPage) {
|
|
16
|
+
const route = pageConfigPublic.config.route ?? pageConfig.routeFilesystem.routeString;
|
|
17
|
+
return {
|
|
18
|
+
...pageConfigPublic,
|
|
19
|
+
route,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
return {
|
|
24
|
+
...pageConfigPublic,
|
|
25
|
+
isErrorPage: true,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
})();
|
|
34
29
|
return [pageConfig.pageId, page];
|
|
35
30
|
}
|
|
36
|
-
function getPublicCopy(
|
|
37
|
-
|
|
38
|
-
config:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
31
|
+
function getPublicCopy(configInternal) {
|
|
32
|
+
const configPublic = {
|
|
33
|
+
config: configInternal.config,
|
|
34
|
+
// TO-DO/soon/flat-pageContext: expose publicly?
|
|
35
|
+
_source: configInternal.source,
|
|
36
|
+
_sources: configInternal.sources,
|
|
37
|
+
_from: configInternal.from,
|
|
42
38
|
};
|
|
39
|
+
return configPublic;
|
|
43
40
|
}
|
|
44
|
-
function
|
|
41
|
+
function resolvePageConfigPublic({ pageConfigGlobalValues, pageConfigValues, }) {
|
|
45
42
|
const configValues = { ...pageConfigGlobalValues, ...pageConfigValues };
|
|
46
|
-
return
|
|
43
|
+
return resolveConfigPublic_V1Design({ configValues });
|
|
47
44
|
}
|
|
48
|
-
function
|
|
49
|
-
const vikeConfigPublicGlobal = resolveVikeConfigPublic_V1Design({ configValues: pageConfigGlobalValues });
|
|
50
|
-
return getPublicCopy(vikeConfigPublicGlobal);
|
|
51
|
-
}
|
|
52
|
-
function resolveVikeConfigPublicPageLazyLoaded(pageFiles, // V0.4 design
|
|
45
|
+
function resolvePageContextConfig(pageFiles, // V0.4 design
|
|
53
46
|
pageConfig, // V1 design
|
|
54
47
|
pageConfigGlobal) {
|
|
55
48
|
const config = {};
|
|
@@ -76,7 +69,7 @@ pageConfigGlobal) {
|
|
|
76
69
|
let sources;
|
|
77
70
|
let from;
|
|
78
71
|
if (pageConfig) {
|
|
79
|
-
const res =
|
|
72
|
+
const res = resolvePageConfigPublic({
|
|
80
73
|
pageConfigGlobalValues: pageConfigGlobal.configValues,
|
|
81
74
|
pageConfigValues: pageConfig.configValues,
|
|
82
75
|
});
|
|
@@ -111,7 +104,7 @@ pageConfigGlobal) {
|
|
|
111
104
|
});
|
|
112
105
|
assert(!('default' in exports));
|
|
113
106
|
assert(!('default' in exportsAll));
|
|
114
|
-
const
|
|
107
|
+
const pageContextAddendum = {
|
|
115
108
|
config: config,
|
|
116
109
|
from,
|
|
117
110
|
source,
|
|
@@ -122,7 +115,7 @@ pageConfigGlobal) {
|
|
|
122
115
|
exportsAll,
|
|
123
116
|
};
|
|
124
117
|
// TO-DO/next-major-release: remove
|
|
125
|
-
objectDefineProperty(
|
|
118
|
+
objectDefineProperty(pageContextAddendum, 'pageExports', {
|
|
126
119
|
get: () => {
|
|
127
120
|
// We only show the warning in Node.js because when using Client Routing Vue integration uses `Object.assign(pageContextReactive, pageContext)` which will wrongully trigger the warning. There is no cross-browser way to catch whether the property accessor was initiated by an `Object.assign()` call.
|
|
128
121
|
if (!isBrowser()) {
|
|
@@ -136,10 +129,33 @@ pageConfigGlobal) {
|
|
|
136
129
|
enumerable: false,
|
|
137
130
|
configurable: true,
|
|
138
131
|
});
|
|
139
|
-
return
|
|
132
|
+
return pageContextAddendum;
|
|
133
|
+
}
|
|
134
|
+
function resolveGlobalContextConfig(pageConfigs, pageConfigGlobal) {
|
|
135
|
+
const globalContextAddendum = resolveGlobalConfigPublic(pageConfigs, pageConfigGlobal, (c) => c.configValues);
|
|
136
|
+
return globalContextAddendum;
|
|
137
|
+
}
|
|
138
|
+
function resolveGlobalConfigPublic(pageConfigs, pageConfigGlobal, getConfigValues) {
|
|
139
|
+
// global
|
|
140
|
+
const pageConfigGlobalValues = getConfigValues(pageConfigGlobal, true);
|
|
141
|
+
const globalConfigPublicBase_ = resolveConfigPublic_V1Design({ configValues: pageConfigGlobalValues });
|
|
142
|
+
const globalConfigPublicBase = getPublicCopy(globalConfigPublicBase_);
|
|
143
|
+
// pages
|
|
144
|
+
const pages = Object.fromEntries(pageConfigs.map((pageConfig) => {
|
|
145
|
+
const pageConfigValues = getConfigValues(pageConfig);
|
|
146
|
+
return resolveGlobalConfigPublicPage(pageConfigGlobalValues, pageConfig, pageConfigValues);
|
|
147
|
+
}));
|
|
148
|
+
const globalConfigPublic = {
|
|
149
|
+
...globalConfigPublicBase,
|
|
150
|
+
pages,
|
|
151
|
+
};
|
|
152
|
+
return {
|
|
153
|
+
...globalConfigPublic,
|
|
154
|
+
_globalConfigPublic: globalConfigPublic,
|
|
155
|
+
};
|
|
140
156
|
}
|
|
141
157
|
// V1 design
|
|
142
|
-
function
|
|
158
|
+
function resolveConfigPublic_V1Design(pageConfig) {
|
|
143
159
|
const config = {};
|
|
144
160
|
const configEntries = {};
|
|
145
161
|
const exportsAll = {};
|
|
@@ -227,6 +243,8 @@ function resolveVikeConfigPublic_V1Design(pageConfig) {
|
|
|
227
243
|
from,
|
|
228
244
|
};
|
|
229
245
|
}
|
|
246
|
+
// V0.4 design
|
|
247
|
+
// TO-DO/next-major-release: remove
|
|
230
248
|
function getExportValues(pageFile) {
|
|
231
249
|
const { filePath, fileExports } = pageFile;
|
|
232
250
|
assert(fileExports); // assume pageFile.loadFile() was called
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { ConfigResolved };
|
|
2
|
+
import type { ConfigBuiltIn, ConfigBuiltInResolved, ImportString } from '../Config.js';
|
|
3
|
+
type ConfigUnresolved = WithoutImportString<ConfigBuiltIn & Vike.Config>;
|
|
4
|
+
type ConfigResolvedOnly = ConfigBuiltInResolved & Vike.ConfigResolved;
|
|
5
|
+
type ConfigResolved = ConfigResolvedOnly & Omit<ConfigUnresolved, keyof ConfigResolvedOnly>;
|
|
6
|
+
type WithoutImportString<T> = {
|
|
7
|
+
[K in keyof T]: Exclude<T[K], ImportString>;
|
|
8
|
+
};
|
|
@@ -37,14 +37,14 @@ export type { RouteAsync };
|
|
|
37
37
|
export type { RouteSync };
|
|
38
38
|
import type { PrefetchSetting, PrefetchStaticAssets } from '../client/runtime-client-routing/prefetch/PrefetchSetting.js';
|
|
39
39
|
import type { ConfigDefinition } from '../node/vite/shared/resolveVikeConfigInternal/configDefinitionsBuiltIn.js';
|
|
40
|
-
import type { DocumentHtml } from '../node/runtime/html/renderHtml.js';
|
|
40
|
+
import type { DocumentHtml } from '../node/runtime/renderPage/html/renderHtml.js';
|
|
41
41
|
import type { InjectFilterEntry } from './index.js';
|
|
42
42
|
import type { VikeVitePluginOptions } from '../node/vite/index.js';
|
|
43
|
-
import type { Vike
|
|
43
|
+
import type { Vike } from './VikeNamespace.js';
|
|
44
44
|
import type { HooksTimeoutProvidedByUser } from '../shared/hooks/getHook.js';
|
|
45
45
|
import type { GlobalContext, PageContextClient, PageContextServer } from './PageContext.js';
|
|
46
46
|
import type { InlineConfig } from 'vite';
|
|
47
|
-
import type { PassToClientPublic } from '../node/runtime/html/serializeContext.js';
|
|
47
|
+
import type { PassToClientPublic } from '../node/runtime/renderPage/html/serializeContext.js';
|
|
48
48
|
type HookNameOld = HookName | HookNameOldDesign;
|
|
49
49
|
type HookName = HookNamePage | HookNameGlobal;
|
|
50
50
|
type HookNamePage = 'onHydrationEnd' | 'onBeforePrerenderStart' | 'onBeforeRender' | 'onPageTransitionStart' | 'onPageTransitionEnd' | 'onRenderHtml' | 'onRenderClient' | 'guard' | 'data' | 'onData' | 'route';
|
|
@@ -52,7 +52,7 @@ type HookNameGlobal = 'onBeforeRoute' | 'onPrerenderStart' | 'onCreatePageContex
|
|
|
52
52
|
type HookNameOldDesign = 'render' | 'prerender' | 'onBeforePrerender';
|
|
53
53
|
type ConfigNameBuiltIn = Exclude<keyof ConfigBuiltIn, keyof VikeVitePluginOptions | 'onBeforeRoute' | 'onPrerenderStart' | 'vite' | 'redirects'> | 'prerender' | 'serverOnlyHooks' | 'isClientRuntimeLoaded' | 'onBeforeRenderEnv' | 'dataEnv' | 'hooksTimeout' | 'clientHooks' | 'middleware';
|
|
54
54
|
type ConfigNameGlobal = 'onPrerenderStart' | 'onBeforeRoute' | 'prerender' | 'disableAutoFullBuild' | 'includeAssetsImportedByServer' | 'baseAssets' | 'baseServer' | 'redirects' | 'trailingSlash' | 'disableUrlNormalization' | 'vite';
|
|
55
|
-
type Config = ConfigBuiltIn & Vike.Config
|
|
55
|
+
type Config = ConfigBuiltIn & Vike.Config;
|
|
56
56
|
/** @deprecated This type is deprecated, see https://vike.dev/data */
|
|
57
57
|
type DataAsync<Data = unknown> = (pageContext: PageContextServer) => Promise<Data>;
|
|
58
58
|
/** @deprecated This type is deprecated, see https://vike.dev/data */
|
|
@@ -15,9 +15,8 @@ export type { PageContextBuiltInServer_deprecated as PageContextBuiltInServer };
|
|
|
15
15
|
export type { PageContextBuiltInClientWithClientRouting_deprecated as PageContextBuiltInClientWithClientRouting };
|
|
16
16
|
export type { PageContextBuiltInClientWithServerRouting_deprecated as PageContextBuiltInClientWithServerRouting };
|
|
17
17
|
import type { PageContextUrlInternal, PageContextUrlClient, PageContextUrlServer } from '../shared/getPageContextUrlComputed.js';
|
|
18
|
-
import type {
|
|
18
|
+
import type { From, PageContextConfig, Source, Sources } from '../shared/page-configs/resolveVikeConfigPublic.js';
|
|
19
19
|
import type { Config } from './Config.js';
|
|
20
|
-
import type { PageContextConfig } from './Config/PageContextConfig.js';
|
|
21
20
|
import type { AbortStatusCode } from '../shared/route/abort.js';
|
|
22
21
|
import type { GlobalContextServer } from '../node/runtime/globalContext.js';
|
|
23
22
|
import type { GlobalContextClient } from '../client/runtime-client-routing/globalContext.js';
|
|
@@ -28,7 +27,7 @@ type PageContextClient<Data = unknown> = PageContextBuiltInClientWithClientRouti
|
|
|
28
27
|
type GlobalContext = GlobalContextServer | GlobalContextClient;
|
|
29
28
|
type PageContextWithServerRouting<Data = unknown> = PageContextClientWithServerRouting<Data> | PageContextServer<Data>;
|
|
30
29
|
type PageContextClientWithServerRouting<Data = unknown> = PageContextBuiltInClientWithServerRouting<Data> & Vike.PageContext & Vike.PageContextClient;
|
|
31
|
-
type PageContextBuiltInCommon<Data> = {
|
|
30
|
+
type PageContextBuiltInCommon<Data> = PageContextConfig & {
|
|
32
31
|
/**
|
|
33
32
|
* Useful for distinguishing `pageContext` from other objects and narrowing down TypeScript unions.
|
|
34
33
|
*
|
|
@@ -53,28 +52,6 @@ type PageContextBuiltInCommon<Data> = {
|
|
|
53
52
|
* https://vike.dev/pageContext#data
|
|
54
53
|
*/
|
|
55
54
|
data: Data;
|
|
56
|
-
/** The page's configuration values.
|
|
57
|
-
*
|
|
58
|
-
* https://vike.dev/config
|
|
59
|
-
* https://vike.dev/pageContext#config
|
|
60
|
-
*/
|
|
61
|
-
config: PageContextConfig;
|
|
62
|
-
/** The page's configuration, including the configs origin and overridden configs.
|
|
63
|
-
*
|
|
64
|
-
* https://vike.dev/config
|
|
65
|
-
*/
|
|
66
|
-
configEntries: ConfigEntries;
|
|
67
|
-
/** Custom Exports/Hooks.
|
|
68
|
-
*
|
|
69
|
-
* https://vike.dev/exports
|
|
70
|
-
*/
|
|
71
|
-
exports: Record<string, unknown>;
|
|
72
|
-
/**
|
|
73
|
-
* Same as `pageContext.exports` but cumulative.
|
|
74
|
-
*
|
|
75
|
-
* https://vike.dev/exports
|
|
76
|
-
*/
|
|
77
|
-
exportsAll: ExportsAll;
|
|
78
55
|
/** The URL you provided to Vike when calling `renderPage({ urlOriginal })` in your server middleware.
|
|
79
56
|
*
|
|
80
57
|
* https://vike.dev/renderPage
|
|
@@ -188,7 +165,7 @@ type PageContextBuiltInServer<Data> = PageContextBuiltInCommon<Data> & PageConte
|
|
|
188
165
|
*
|
|
189
166
|
* https://vike.dev/csp
|
|
190
167
|
*/
|
|
191
|
-
cspNonce
|
|
168
|
+
cspNonce: string | null;
|
|
192
169
|
isHydration?: undefined;
|
|
193
170
|
isBackwardNavigation?: undefined;
|
|
194
171
|
previousPageContext?: undefined;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export type { Vike };
|
|
2
|
-
export type { VikePackages };
|
|
3
2
|
declare global {
|
|
4
3
|
/** Refine Vike types. */
|
|
5
4
|
namespace Vike {
|
|
@@ -62,30 +61,4 @@ declare global {
|
|
|
62
61
|
_interfaceIsNotAny?: never;
|
|
63
62
|
}
|
|
64
63
|
}
|
|
65
|
-
/** This namespace is only used by:
|
|
66
|
-
* - `vike-react`
|
|
67
|
-
* - `vike-vue`
|
|
68
|
-
* - `vike-solid`
|
|
69
|
-
* - `vike-svelte`
|
|
70
|
-
* - `vike-angular`
|
|
71
|
-
*
|
|
72
|
-
* As a Vike user, you can ignore this.
|
|
73
|
-
*/
|
|
74
|
-
namespace VikePackages {
|
|
75
|
-
interface ConfigVikeReact {
|
|
76
|
-
_interfaceIsNotAny?: never;
|
|
77
|
-
}
|
|
78
|
-
interface ConfigVikeVue {
|
|
79
|
-
_interfaceIsNotAny?: never;
|
|
80
|
-
}
|
|
81
|
-
interface ConfigVikeSolid {
|
|
82
|
-
_interfaceIsNotAny?: never;
|
|
83
|
-
}
|
|
84
|
-
interface ConfigVikeSvelte {
|
|
85
|
-
_interfaceIsNotAny?: never;
|
|
86
|
-
}
|
|
87
|
-
interface ConfigVikeAngular {
|
|
88
|
-
_interfaceIsNotAny?: never;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
64
|
}
|
|
@@ -5,13 +5,13 @@ export type { PageContextBuiltInClientWithClientRouting } from './PageContext.js
|
|
|
5
5
|
export type { PageContextBuiltInClientWithServerRouting } from './PageContext.js';
|
|
6
6
|
export type { Config, ConfigMeta as Meta, ImportString, KeepScrollPosition, } from './Config.js';
|
|
7
7
|
export type { DataAsync, DataSync, GuardAsync, GuardSync, OnBeforePrerenderStartAsync, OnBeforePrerenderStartSync, OnBeforeRenderAsync, OnBeforeRenderSync, OnBeforeRouteAsync, OnBeforeRouteSync, OnHydrationEndAsync, OnHydrationEndSync, OnPageTransitionEndAsync, OnPageTransitionEndSync, OnPageTransitionStartAsync, OnPageTransitionStartSync, OnPrerenderStartAsync, OnPrerenderStartSync, OnRenderClientAsync, OnRenderClientSync, OnRenderHtmlAsync, OnRenderHtmlSync, RouteAsync, RouteSync, } from './Config.js';
|
|
8
|
-
export type { ConfigResolved } from './Config/
|
|
8
|
+
export type { ConfigResolved } from './Config/ConfigResolved.js';
|
|
9
9
|
export type { ConfigEnv } from './PageConfig.js';
|
|
10
10
|
export type { ConfigDefinition, ConfigEffect, } from '../node/vite/shared/resolveVikeConfigInternal/configDefinitionsBuiltIn.js';
|
|
11
11
|
export type { ConfigEntries } from '../shared/page-configs/resolveVikeConfigPublic.js';
|
|
12
12
|
export type { VikeConfig } from '../node/vite/shared/resolveVikeConfigInternal.js';
|
|
13
13
|
export type { UrlPublic as Url } from '../utils/parseUrl.js';
|
|
14
|
-
export type { InjectFilterEntry } from '../node/runtime/html/injectAssets/getHtmlTags.js';
|
|
14
|
+
export type { InjectFilterEntry } from '../node/runtime/renderPage/html/injectAssets/getHtmlTags.js';
|
|
15
15
|
export { defineConfig } from './defineConfig.js';
|
|
16
16
|
import type { ConfigEnv } from './PageConfig.js';
|
|
17
17
|
/** @deprecated Replace:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.238-commit-
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.238-commit-d48a597";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.238-commit-
|
|
2
|
+
export const PROJECT_VERSION = '0.4.238-commit-d48a597';
|
package/dist/esm/utils/assert.js
CHANGED
|
@@ -147,6 +147,7 @@ function addPrefixProjectName(msg, showProjectVersion = false) {
|
|
|
147
147
|
const prefix = showProjectVersion ? projectTagWithVersion : projectTag;
|
|
148
148
|
return `${prefix}${msg}`;
|
|
149
149
|
}
|
|
150
|
+
// TO-DO/eventually: remove this (refactor the whole log handling)
|
|
150
151
|
function getAssertErrMsg(thing) {
|
|
151
152
|
let errMsg;
|
|
152
153
|
let errStack;
|
|
@@ -170,7 +171,21 @@ function getAssertErrMsg(thing) {
|
|
|
170
171
|
}
|
|
171
172
|
}
|
|
172
173
|
else if (errStack?.includes(tag)) {
|
|
173
|
-
|
|
174
|
+
// The following assert can fail, e.g. with following error:
|
|
175
|
+
// ```
|
|
176
|
+
// Error: Error running module "/home/rom/code/vike-server/examples/cloudflare-react/cloudflare-entry.js".
|
|
177
|
+
// Error running module "photon:cloudflare:/home/rom/code/vike-server/examples/cloudflare-react/server.js".
|
|
178
|
+
// Error running module "/home/rom/code/vike-server/examples/cloudflare-react/server.js".
|
|
179
|
+
// Error running module "/home/rom/code/vike-server/node_modules/.pnpm/@photonjs+hono@0.0.6_@hattip+core@0.0.49_elysia@1.3.13_exact-mirror@0.1.6_@sinclair+typ_c39d432d43266746f390ace81b426601/node_modules/@photonjs/hono/dist/index.js?v=6ca51a04".
|
|
180
|
+
// Error running module "/home/rom/code/vike-server/node_modules/.pnpm/@photonjs+hono@0.0.6_@hattip+core@0.0.49_elysia@1.3.13_exact-mirror@0.1.6_@sinclair+typ_c39d432d43266746f390ace81b426601/node_modules/@photonjs/hono/dist/apply.dev.js?v=6ca51a04".
|
|
181
|
+
// Error running module "photon:get-middlewares:dev:hono".
|
|
182
|
+
// Error running module "/home/rom/code/vike-server/packages/vike-server/dist/universal.dev.js".
|
|
183
|
+
// [vike][Wrong Usage] The global context isn't set yet, use getGlobalContextAsync() instead........
|
|
184
|
+
// at async ProxyServer.fetch (file:///home/rom/code/vike-server/node_modules/.pnpm/miniflare@4.20250829.0/node_modules/miniflare/src/workers/core/proxy.worker.ts:174:11)
|
|
185
|
+
// ```
|
|
186
|
+
/*
|
|
187
|
+
throw new Error('Internal Vike error')
|
|
188
|
+
*/
|
|
174
189
|
}
|
|
175
190
|
if (errMsg?.startsWith(tag)) {
|
|
176
191
|
const assertMsg = errMsg.slice(tag.length);
|
package/package.json
CHANGED