vike 0.4.171-commit-e429162 → 0.4.171-commit-978d69d
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/plugin/plugins/extractAssetsPlugin.js +1 -1
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +1 -1
- package/dist/cjs/node/runtime/html/stream.js +9 -9
- package/dist/cjs/node/runtime/renderPage/getHttpResponseBody.js +2 -2
- package/dist/cjs/shared/getPageFiles/getExports.js +10 -10
- package/dist/cjs/shared/hooks/executeHook.js +10 -6
- package/dist/cjs/shared/page-configs/serialize/parseConfigValuesImported.js +1 -1
- package/dist/cjs/utils/projectInfo.js +1 -1
- package/dist/esm/client/client-routing-runtime/getPageContextFromHooks.js +1 -1
- package/dist/esm/node/plugin/plugins/extractAssetsPlugin.js +1 -1
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +1 -1
- package/dist/esm/node/runtime/html/stream.d.ts +1 -1
- package/dist/esm/node/runtime/html/stream.js +9 -9
- package/dist/esm/node/runtime/renderPage/getHttpResponseBody.js +2 -2
- package/dist/esm/shared/VikeNamespace.d.ts +9 -0
- package/dist/esm/shared/getPageFiles/getExports.d.ts +5 -5
- package/dist/esm/shared/getPageFiles/getExports.js +10 -10
- package/dist/esm/shared/hooks/executeHook.d.ts +6 -1
- package/dist/esm/shared/hooks/executeHook.js +10 -6
- package/dist/esm/shared/page-configs/Config/PageContextConfig.d.ts +2 -2
- package/dist/esm/shared/page-configs/PageConfig.d.ts +4 -4
- package/dist/esm/shared/page-configs/serialize/PageConfigSerialized.d.ts +2 -2
- package/dist/esm/shared/page-configs/serialize/parseConfigValuesImported.js +1 -1
- package/dist/esm/utils/projectInfo.d.ts +2 -2
- package/dist/esm/utils/projectInfo.js +1 -1
- package/package.json +1 -1
|
@@ -102,7 +102,7 @@ function extractAssetsPlugin() {
|
|
|
102
102
|
}
|
|
103
103
|
// If the import path resolves to a file in `node_modules/`, we ignore that file:
|
|
104
104
|
// - Direct CSS dependencies are included though, such as `import 'bootstrap/theme/dark.css'`. (Because the above if-branch for CSS files will add the file.)
|
|
105
|
-
// - Loading CSS from a library (living in `node_modules/`) in a non-direct way is
|
|
105
|
+
// - Loading CSS from a library (living in `node_modules/`) in a non-direct way is unconventional; we can safely not support this case. (I'm not aware of any library that does this.)
|
|
106
106
|
(0, utils_js_1.assertPosixPath)(file);
|
|
107
107
|
if (file.includes('/node_modules/')) {
|
|
108
108
|
return emptyModule(file, importer);
|
|
@@ -898,7 +898,7 @@ function getConfigValues(configValueSources, configValuesComputed, configDefinit
|
|
|
898
898
|
const configValueSource = sources[0];
|
|
899
899
|
if ('value' in configValueSource) {
|
|
900
900
|
configValues[configName] = {
|
|
901
|
-
type: '
|
|
901
|
+
type: 'standard',
|
|
902
902
|
value: configValueSource.value,
|
|
903
903
|
definedAtData: getDefinedAtFile(configValueSource)
|
|
904
904
|
};
|
|
@@ -762,17 +762,17 @@ async function loadStreamNodeModule() {
|
|
|
762
762
|
const { Readable, Writable } = streamModule;
|
|
763
763
|
return { Readable, Writable };
|
|
764
764
|
}
|
|
765
|
-
function getStreamName(
|
|
766
|
-
let
|
|
767
|
-
if (
|
|
768
|
-
|
|
765
|
+
function getStreamName(kind, type) {
|
|
766
|
+
let typeName = (0, utils_js_1.capitalizeFirstLetter)(type);
|
|
767
|
+
if (typeName === 'Node') {
|
|
768
|
+
typeName = 'Node.js';
|
|
769
769
|
}
|
|
770
|
-
const
|
|
771
|
-
if (
|
|
772
|
-
return `a ${
|
|
770
|
+
const kindName = (0, utils_js_1.capitalizeFirstLetter)(kind);
|
|
771
|
+
if (kind !== 'pipe') {
|
|
772
|
+
return `a ${kindName} ${typeName} Stream`;
|
|
773
773
|
}
|
|
774
|
-
if (
|
|
775
|
-
return `a ${
|
|
774
|
+
if (kind === 'pipe') {
|
|
775
|
+
return `a ${typeName} Stream Pipe`;
|
|
776
776
|
}
|
|
777
777
|
(0, utils_js_1.assert)(false);
|
|
778
778
|
}
|
|
@@ -100,8 +100,8 @@ function getHttpResponseBodyStreamHandlers(htmlRender, renderHook) {
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
|
-
function getFixMsg(
|
|
104
|
-
const streamName = (0, stream_js_1.getStreamName)(
|
|
103
|
+
function getFixMsg(kind, type) {
|
|
104
|
+
const streamName = (0, stream_js_1.getStreamName)(kind, type);
|
|
105
105
|
(0, utils_js_1.assert)(['a ', 'an ', 'the '].some((s) => streamName.startsWith(s)));
|
|
106
106
|
(0, utils_js_1.assert)(renderHook);
|
|
107
107
|
const { hookFilePath, hookName } = renderHook;
|
|
@@ -40,7 +40,7 @@ function getPageContextExports(pageFiles, pageConfig) {
|
|
|
40
40
|
sources[configName].push(src);
|
|
41
41
|
};
|
|
42
42
|
const from = {
|
|
43
|
-
|
|
43
|
+
configsStandard: {},
|
|
44
44
|
configsCumulative: {},
|
|
45
45
|
configsComputed: {}
|
|
46
46
|
};
|
|
@@ -58,6 +58,15 @@ function getPageContextExports(pageFiles, pageConfig) {
|
|
|
58
58
|
configDefinedAt,
|
|
59
59
|
configDefinedByFile: configValueFilePathToShowToUser
|
|
60
60
|
});
|
|
61
|
+
if (configValue.type === 'standard') {
|
|
62
|
+
const src = {
|
|
63
|
+
type: 'configsStandard',
|
|
64
|
+
value: configValue.value,
|
|
65
|
+
definedAt: (0, getConfigDefinedAt_js_1.getDefinedAtString)(configValue.definedAtData, configName)
|
|
66
|
+
};
|
|
67
|
+
addSrc(src, configName);
|
|
68
|
+
from.configsStandard[configName] = src;
|
|
69
|
+
}
|
|
61
70
|
if (configValue.type === 'cumulative') {
|
|
62
71
|
const src = {
|
|
63
72
|
type: 'configsCumulative',
|
|
@@ -74,15 +83,6 @@ function getPageContextExports(pageFiles, pageConfig) {
|
|
|
74
83
|
addSrc(src, configName);
|
|
75
84
|
from.configsCumulative[configName] = src;
|
|
76
85
|
}
|
|
77
|
-
if (configValue.type === 'classic') {
|
|
78
|
-
const src = {
|
|
79
|
-
type: 'configsOverridable',
|
|
80
|
-
value: configValue.value,
|
|
81
|
-
definedAt: (0, getConfigDefinedAt_js_1.getDefinedAtString)(configValue.definedAtData, configName)
|
|
82
|
-
};
|
|
83
|
-
addSrc(src, configName);
|
|
84
|
-
from.configsOverridable[configName] = src;
|
|
85
|
-
}
|
|
86
86
|
if (configValue.type === 'computed') {
|
|
87
87
|
const src = {
|
|
88
88
|
type: 'configsComputed',
|
|
@@ -5,7 +5,6 @@ const assert_js_1 = require("../../utils/assert.js");
|
|
|
5
5
|
const getGlobalObject_js_1 = require("../../utils/getGlobalObject.js");
|
|
6
6
|
const humanizeTime_js_1 = require("../../utils/humanizeTime.js");
|
|
7
7
|
const isObject_js_1 = require("../../utils/isObject.js");
|
|
8
|
-
const utils_js_1 = require("../utils.js");
|
|
9
8
|
const globalObject = (0, getGlobalObject_js_1.getGlobalObject)('utils/executeHook.ts', {
|
|
10
9
|
userHookErrors: new WeakMap(),
|
|
11
10
|
pageContext: null
|
|
@@ -64,15 +63,20 @@ exports.executeHook = executeHook;
|
|
|
64
63
|
function isNotDisabled(timeout) {
|
|
65
64
|
return !!timeout && timeout !== Infinity;
|
|
66
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Access `pageContext` object inside Vike hooks, in order to create universal hooks.
|
|
68
|
+
*
|
|
69
|
+
* https://vike.dev/getPageContext
|
|
70
|
+
*/
|
|
67
71
|
function getPageContext() {
|
|
68
72
|
return globalObject.pageContext;
|
|
69
73
|
}
|
|
70
74
|
exports.getPageContext = getPageContext;
|
|
71
75
|
function providePageContext(pageContext) {
|
|
72
76
|
globalObject.pageContext = pageContext;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
77
|
+
// Promise.resolve() is quicker than process.nextTick() and setImmediate()
|
|
78
|
+
// https://stackoverflow.com/questions/67949576/process-nexttick-before-promise-resolve-then
|
|
79
|
+
Promise.resolve().then(() => {
|
|
80
|
+
globalObject.pageContext = null;
|
|
81
|
+
});
|
|
78
82
|
}
|
|
@@ -53,7 +53,7 @@ function parseConfigValuesImported(configValuesImported) {
|
|
|
53
53
|
(0, utils_js_1.assert)(val);
|
|
54
54
|
const { value, importPath, exportName } = val;
|
|
55
55
|
configValues[configName] = {
|
|
56
|
-
type: '
|
|
56
|
+
type: 'standard',
|
|
57
57
|
value,
|
|
58
58
|
definedAtData: {
|
|
59
59
|
// importPath cannot be relative to the current file, since the current file is a virtual file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PROJECT_VERSION = exports.projectInfo = void 0;
|
|
4
|
-
const PROJECT_VERSION = '0.4.171-commit-
|
|
4
|
+
const PROJECT_VERSION = '0.4.171-commit-978d69d';
|
|
5
5
|
exports.PROJECT_VERSION = PROJECT_VERSION;
|
|
6
6
|
const projectInfo = {
|
|
7
7
|
projectName: 'Vike',
|
|
@@ -221,7 +221,7 @@ async function fetchPageContextFromServer(pageContext) {
|
|
|
221
221
|
}
|
|
222
222
|
// Is there a reason for having two different properties? Can't we use only one property? I guess/think the isServerSideError property was an attempt (a bad idea really) for rendering the error page even though an error occured on the server-side (which is a bad idea because the added complexity is non-negligible while the added value is minuscule since the error page usually doesn't have any (meaningful / server-side) hooks).
|
|
223
223
|
if ('serverSideError' in pageContextFromServer || isServerSideError in pageContextFromServer) {
|
|
224
|
-
throw getProjectError(`
|
|
224
|
+
throw getProjectError(`pageContext couldn't be fetched from server: an error occurred on the server-side (see your server logs)`);
|
|
225
225
|
}
|
|
226
226
|
assert(hasProp(pageContextFromServer, '_pageId', 'string'));
|
|
227
227
|
processPageContextFromServer(pageContextFromServer);
|
|
@@ -101,7 +101,7 @@ function extractAssetsPlugin() {
|
|
|
101
101
|
}
|
|
102
102
|
// If the import path resolves to a file in `node_modules/`, we ignore that file:
|
|
103
103
|
// - Direct CSS dependencies are included though, such as `import 'bootstrap/theme/dark.css'`. (Because the above if-branch for CSS files will add the file.)
|
|
104
|
-
// - Loading CSS from a library (living in `node_modules/`) in a non-direct way is
|
|
104
|
+
// - Loading CSS from a library (living in `node_modules/`) in a non-direct way is unconventional; we can safely not support this case. (I'm not aware of any library that does this.)
|
|
105
105
|
assertPosixPath(file);
|
|
106
106
|
if (file.includes('/node_modules/')) {
|
|
107
107
|
return emptyModule(file, importer);
|
|
@@ -892,7 +892,7 @@ function getConfigValues(configValueSources, configValuesComputed, configDefinit
|
|
|
892
892
|
const configValueSource = sources[0];
|
|
893
893
|
if ('value' in configValueSource) {
|
|
894
894
|
configValues[configName] = {
|
|
895
|
-
type: '
|
|
895
|
+
type: 'standard',
|
|
896
896
|
value: configValueSource.value,
|
|
897
897
|
definedAtData: getDefinedAtFile(configValueSource)
|
|
898
898
|
};
|
|
@@ -80,5 +80,5 @@ type StreamPipeWrapped = {
|
|
|
80
80
|
};
|
|
81
81
|
declare function pipeStream(pipe: StreamPipe): StreamPipeWrapped;
|
|
82
82
|
declare function streamToString(stream: StreamProviderAny): Promise<string>;
|
|
83
|
-
declare function getStreamName(
|
|
83
|
+
declare function getStreamName(kind: 'pipe' | 'readable' | 'writable', type: 'web' | 'node'): `a ${string} Stream` | `a ${string} Stream Pipe`;
|
|
84
84
|
declare function inferStreamName(stream: StreamProviderNormalized): `a ${string} Stream` | `a ${string} Stream Pipe`;
|
|
@@ -758,17 +758,17 @@ async function loadStreamNodeModule() {
|
|
|
758
758
|
const { Readable, Writable } = streamModule;
|
|
759
759
|
return { Readable, Writable };
|
|
760
760
|
}
|
|
761
|
-
function getStreamName(
|
|
762
|
-
let
|
|
763
|
-
if (
|
|
764
|
-
|
|
761
|
+
function getStreamName(kind, type) {
|
|
762
|
+
let typeName = capitalizeFirstLetter(type);
|
|
763
|
+
if (typeName === 'Node') {
|
|
764
|
+
typeName = 'Node.js';
|
|
765
765
|
}
|
|
766
|
-
const
|
|
767
|
-
if (
|
|
768
|
-
return `a ${
|
|
766
|
+
const kindName = capitalizeFirstLetter(kind);
|
|
767
|
+
if (kind !== 'pipe') {
|
|
768
|
+
return `a ${kindName} ${typeName} Stream`;
|
|
769
769
|
}
|
|
770
|
-
if (
|
|
771
|
-
return `a ${
|
|
770
|
+
if (kind === 'pipe') {
|
|
771
|
+
return `a ${typeName} Stream Pipe`;
|
|
772
772
|
}
|
|
773
773
|
assert(false);
|
|
774
774
|
}
|
|
@@ -95,8 +95,8 @@ function getHttpResponseBodyStreamHandlers(htmlRender, renderHook) {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
|
-
function getFixMsg(
|
|
99
|
-
const streamName = getStreamName(
|
|
98
|
+
function getFixMsg(kind, type) {
|
|
99
|
+
const streamName = getStreamName(kind, type);
|
|
100
100
|
assert(['a ', 'an ', 'the '].some((s) => streamName.startsWith(s)));
|
|
101
101
|
assert(renderHook);
|
|
102
102
|
const { hookFilePath, hookName } = renderHook;
|
|
@@ -9,6 +9,7 @@ declare global {
|
|
|
9
9
|
* - You can refine the type of `Config['Page']`.
|
|
10
10
|
* - You can define the type of custom configurations created with `config.meta` (https://vike.dev/meta)
|
|
11
11
|
*
|
|
12
|
+
* https://vike.dev/meta#typescript
|
|
12
13
|
*/
|
|
13
14
|
interface Config {
|
|
14
15
|
}
|
|
@@ -22,6 +23,14 @@ declare global {
|
|
|
22
23
|
*/
|
|
23
24
|
interface PageContext {
|
|
24
25
|
}
|
|
26
|
+
/** Refine the `pageContext.config` type.
|
|
27
|
+
*
|
|
28
|
+
* It's used for cumulative configs: the `pageContext.config[configName]` type is an `array` whereas `Config[configName]` isn't.
|
|
29
|
+
*
|
|
30
|
+
* https://vike.dev/meta#typescript
|
|
31
|
+
*/
|
|
32
|
+
interface ConfigResolved {
|
|
33
|
+
}
|
|
25
34
|
}
|
|
26
35
|
/** This namespace is only used by:
|
|
27
36
|
* - `vike-react`
|
|
@@ -41,8 +41,8 @@ type PageContextExports = {
|
|
|
41
41
|
pageExports: Record<string, unknown>;
|
|
42
42
|
};
|
|
43
43
|
type From = {
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
configsStandard: Record<string, // configName
|
|
45
|
+
SourceConfigsStandard>;
|
|
46
46
|
configsCumulative: Record<string, // configName
|
|
47
47
|
SourceConfigsCumulative>;
|
|
48
48
|
configsComputed: Record<string, // configName
|
|
@@ -53,9 +53,9 @@ SourceAny>;
|
|
|
53
53
|
type Sources = Record<string, // configName
|
|
54
54
|
SourceAny[]>;
|
|
55
55
|
type SourceAny = SourceConfigs;
|
|
56
|
-
type SourceConfigs =
|
|
57
|
-
type
|
|
58
|
-
type: '
|
|
56
|
+
type SourceConfigs = SourceConfigsStandard | SourceConfigsCumulative | SourceConfigsComputed;
|
|
57
|
+
type SourceConfigsStandard = {
|
|
58
|
+
type: 'configsStandard';
|
|
59
59
|
value: unknown;
|
|
60
60
|
definedAt: string;
|
|
61
61
|
};
|
|
@@ -35,7 +35,7 @@ function getPageContextExports(pageFiles, pageConfig) {
|
|
|
35
35
|
sources[configName].push(src);
|
|
36
36
|
};
|
|
37
37
|
const from = {
|
|
38
|
-
|
|
38
|
+
configsStandard: {},
|
|
39
39
|
configsCumulative: {},
|
|
40
40
|
configsComputed: {}
|
|
41
41
|
};
|
|
@@ -53,6 +53,15 @@ function getPageContextExports(pageFiles, pageConfig) {
|
|
|
53
53
|
configDefinedAt,
|
|
54
54
|
configDefinedByFile: configValueFilePathToShowToUser
|
|
55
55
|
});
|
|
56
|
+
if (configValue.type === 'standard') {
|
|
57
|
+
const src = {
|
|
58
|
+
type: 'configsStandard',
|
|
59
|
+
value: configValue.value,
|
|
60
|
+
definedAt: getDefinedAtString(configValue.definedAtData, configName)
|
|
61
|
+
};
|
|
62
|
+
addSrc(src, configName);
|
|
63
|
+
from.configsStandard[configName] = src;
|
|
64
|
+
}
|
|
56
65
|
if (configValue.type === 'cumulative') {
|
|
57
66
|
const src = {
|
|
58
67
|
type: 'configsCumulative',
|
|
@@ -69,15 +78,6 @@ function getPageContextExports(pageFiles, pageConfig) {
|
|
|
69
78
|
addSrc(src, configName);
|
|
70
79
|
from.configsCumulative[configName] = src;
|
|
71
80
|
}
|
|
72
|
-
if (configValue.type === 'classic') {
|
|
73
|
-
const src = {
|
|
74
|
-
type: 'configsOverridable',
|
|
75
|
-
value: configValue.value,
|
|
76
|
-
definedAt: getDefinedAtString(configValue.definedAtData, configName)
|
|
77
|
-
};
|
|
78
|
-
addSrc(src, configName);
|
|
79
|
-
from.configsOverridable[configName] = src;
|
|
80
|
-
}
|
|
81
81
|
if (configValue.type === 'computed') {
|
|
82
82
|
const src = {
|
|
83
83
|
type: 'configsComputed',
|
|
@@ -6,4 +6,9 @@ import type { Hook, HookLoc } from './getHook.js';
|
|
|
6
6
|
type PageContextUnknown = null | Record<string, unknown>;
|
|
7
7
|
declare function isUserHookError(err: unknown): false | HookLoc;
|
|
8
8
|
declare function executeHook<T = unknown>(hookFnCaller: () => T, hook: Omit<Hook, 'hookFn'>, pageContext: PageContextUnknown): Promise<T>;
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Access `pageContext` object inside Vike hooks, in order to create universal hooks.
|
|
11
|
+
*
|
|
12
|
+
* https://vike.dev/getPageContext
|
|
13
|
+
*/
|
|
14
|
+
declare function getPageContext<PageContext = PageContextClient | PageContextServer>(): null | PageContext;
|
|
@@ -5,7 +5,6 @@ import { getProjectError, assertWarning } from '../../utils/assert.js';
|
|
|
5
5
|
import { getGlobalObject } from '../../utils/getGlobalObject.js';
|
|
6
6
|
import { humanizeTime } from '../../utils/humanizeTime.js';
|
|
7
7
|
import { isObject } from '../../utils/isObject.js';
|
|
8
|
-
import { isBrowser } from '../utils.js';
|
|
9
8
|
const globalObject = getGlobalObject('utils/executeHook.ts', {
|
|
10
9
|
userHookErrors: new WeakMap(),
|
|
11
10
|
pageContext: null
|
|
@@ -62,14 +61,19 @@ function executeHook(hookFnCaller, hook, pageContext) {
|
|
|
62
61
|
function isNotDisabled(timeout) {
|
|
63
62
|
return !!timeout && timeout !== Infinity;
|
|
64
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Access `pageContext` object inside Vike hooks, in order to create universal hooks.
|
|
66
|
+
*
|
|
67
|
+
* https://vike.dev/getPageContext
|
|
68
|
+
*/
|
|
65
69
|
function getPageContext() {
|
|
66
70
|
return globalObject.pageContext;
|
|
67
71
|
}
|
|
68
72
|
function providePageContext(pageContext) {
|
|
69
73
|
globalObject.pageContext = pageContext;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
74
|
+
// Promise.resolve() is quicker than process.nextTick() and setImmediate()
|
|
75
|
+
// https://stackoverflow.com/questions/67949576/process-nexttick-before-promise-resolve-then
|
|
76
|
+
Promise.resolve().then(() => {
|
|
77
|
+
globalObject.pageContext = null;
|
|
78
|
+
});
|
|
75
79
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export type { PageContextConfig };
|
|
2
2
|
import type { VikePackages } from '../../VikeNamespace.js';
|
|
3
3
|
import type { ConfigBuiltIn } from '../Config.js';
|
|
4
|
-
import type { Combine, IsNotEmpty, XOR5 } from './helpers.
|
|
5
|
-
type PageContextConfig = ConfigBuiltIn & Vike.Config & (ConfigVikePackagesNotEmptyXor extends true ? ConfigVikePackagesIntersection : ConfigVikePackagesCombined);
|
|
4
|
+
import type { Combine, IsNotEmpty, XOR5 } from './helpers.js';
|
|
5
|
+
type PageContextConfig = ConfigBuiltIn & Vike.ConfigResolved & Omit<Vike.Config, keyof Vike.ConfigResolved> & (ConfigVikePackagesNotEmptyXor extends true ? ConfigVikePackagesIntersection : ConfigVikePackagesCombined);
|
|
6
6
|
type ConfigVikePackagesIntersection = VikePackages.ConfigVikeReact & VikePackages.ConfigVikeVue & VikePackages.ConfigVikeSolid & VikePackages.ConfigVikeSvelte & VikePackages.ConfigVikeAngular;
|
|
7
7
|
type ConfigVikePackagesCombined = Combine<VikePackages.ConfigVikeReact, Combine<VikePackages.ConfigVikeVue, Combine<VikePackages.ConfigVikeSolid, Combine<VikePackages.ConfigVikeSvelte, VikePackages.ConfigVikeAngular>>>>;
|
|
8
8
|
type ConfigVikePackagesNotEmptyXor = XOR5<IsNotEmpty<VikePackages.ConfigVikeReact>, IsNotEmpty<VikePackages.ConfigVikeVue>, IsNotEmpty<VikePackages.ConfigVikeSolid>, IsNotEmpty<VikePackages.ConfigVikeSvelte>, IsNotEmpty<VikePackages.ConfigVikeAngular>>;
|
|
@@ -6,7 +6,7 @@ export type { ConfigEnvInternal };
|
|
|
6
6
|
export type { PageConfigGlobalRuntime };
|
|
7
7
|
export type { PageConfigGlobalBuildTime };
|
|
8
8
|
export type { ConfigValue };
|
|
9
|
-
export type {
|
|
9
|
+
export type { ConfigValueStandard };
|
|
10
10
|
export type { ConfigValueCumulative };
|
|
11
11
|
export type { ConfigValueComputed };
|
|
12
12
|
export type { ConfigValues };
|
|
@@ -86,10 +86,10 @@ type ConfigValuesComputed = Record<string, {
|
|
|
86
86
|
configEnv: ConfigEnvInternal;
|
|
87
87
|
value: unknown;
|
|
88
88
|
}>;
|
|
89
|
-
type ConfigValue =
|
|
89
|
+
type ConfigValue = ConfigValueStandard | ConfigValueCumulative | ConfigValueComputed;
|
|
90
90
|
/** Defined by a unique source (thus unique file path). */
|
|
91
|
-
type
|
|
92
|
-
type: '
|
|
91
|
+
type ConfigValueStandard = {
|
|
92
|
+
type: 'standard';
|
|
93
93
|
value: unknown;
|
|
94
94
|
definedAtData: DefinedAtFile;
|
|
95
95
|
};
|
|
@@ -2,7 +2,7 @@ export type { PageConfigRuntimeSerialized };
|
|
|
2
2
|
export type { PageConfigGlobalRuntimeSerialized };
|
|
3
3
|
export type { ConfigValueSerialized };
|
|
4
4
|
export type { ConfigValueImported };
|
|
5
|
-
import type {
|
|
5
|
+
import type { ConfigValueStandard, ConfigValueComputed, ConfigValueCumulative, PageConfigRuntime } from '../PageConfig.js';
|
|
6
6
|
/** Page config data structure serialized in virtual files: parsing it results in PageConfigRuntime */
|
|
7
7
|
type PageConfigRuntimeSerialized = Omit<PageConfigRuntime, 'configValues'> & {
|
|
8
8
|
/** Config values that are serializable and loaded eagerly such as config.passToClient */
|
|
@@ -14,7 +14,7 @@ type PageConfigGlobalRuntimeSerialized = {
|
|
|
14
14
|
configValuesImported: ConfigValueImported[];
|
|
15
15
|
};
|
|
16
16
|
/** Value is serialized */
|
|
17
|
-
type ConfigValueSerialized = (Omit<
|
|
17
|
+
type ConfigValueSerialized = (Omit<ConfigValueStandard, 'value'> & {
|
|
18
18
|
valueSerialized: string;
|
|
19
19
|
}) | (Omit<ConfigValueCumulative, 'value'> & {
|
|
20
20
|
valueSerialized: string;
|
|
@@ -51,7 +51,7 @@ function parseConfigValuesImported(configValuesImported) {
|
|
|
51
51
|
assert(val);
|
|
52
52
|
const { value, importPath, exportName } = val;
|
|
53
53
|
configValues[configName] = {
|
|
54
|
-
type: '
|
|
54
|
+
type: 'standard',
|
|
55
55
|
value,
|
|
56
56
|
definedAtData: {
|
|
57
57
|
// importPath cannot be relative to the current file, since the current file is a virtual file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { projectInfo };
|
|
2
2
|
export { PROJECT_VERSION };
|
|
3
|
-
declare const PROJECT_VERSION: "0.4.171-commit-
|
|
3
|
+
declare const PROJECT_VERSION: "0.4.171-commit-978d69d";
|
|
4
4
|
declare const projectInfo: {
|
|
5
5
|
projectName: "Vike";
|
|
6
|
-
projectVersion: "0.4.171-commit-
|
|
6
|
+
projectVersion: "0.4.171-commit-978d69d";
|
|
7
7
|
};
|