vike 0.4.143-commit-fa295e1 → 0.4.144-commit-e40e9b1
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/buildConfig.js +1 -1
- package/dist/cjs/node/plugin/plugins/config/index.js +1 -1
- package/dist/cjs/node/plugin/plugins/devConfig/determineOptimizeDeps.js +3 -5
- package/dist/cjs/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.js +17 -8
- package/dist/cjs/node/plugin/plugins/importUserCode/index.js +2 -2
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js +4 -4
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +69 -87
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigValuesAll.js +7 -42
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigs.js +24 -26
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/helpers.js +6 -8
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/isRuntimeEnvMatch.js +18 -0
- package/dist/cjs/node/plugin/shared/findPageFiles.js +2 -1
- package/dist/cjs/node/plugin/utils.js +1 -1
- package/dist/cjs/node/prerender/runPrerender.js +4 -4
- package/dist/cjs/node/runtime/renderPage.js +1 -1
- package/dist/cjs/shared/assertPageContextProvidedByUser.js +1 -1
- package/dist/cjs/shared/getPageFiles/getExports.js +4 -4
- package/dist/cjs/shared/getPageFiles/parseGlobResults.js +3 -3
- package/dist/cjs/shared/page-configs/getExportPath.js +7 -8
- package/dist/cjs/shared/page-configs/loadConfigValues.js +1 -1
- package/dist/cjs/shared/page-configs/serialize/PageConfigSerialized.js +2 -0
- package/dist/cjs/shared/{getPageFiles → page-configs/serialize}/assertPageConfigs.js +1 -1
- package/dist/cjs/shared/page-configs/{parseConfigValuesImported.js → serialize/parseConfigValuesImported.js} +13 -10
- package/dist/cjs/shared/{getPageFiles/parsePageConfigsSerialized.js → page-configs/serialize/parsePageConfigs.js} +6 -6
- package/dist/cjs/shared/page-configs/serialize/serializeConfigValue.js +58 -0
- package/dist/cjs/shared/page-configs/utils.js +11 -12
- package/dist/cjs/shared/route/loadPageRoutes.js +1 -1
- package/dist/cjs/utils/getOutDirs.js +25 -18
- package/dist/cjs/utils/getValuePrintable.js +1 -1
- package/dist/cjs/utils/projectInfo.js +1 -1
- package/dist/cjs/utils/warnIfErrorIsNotObject.js +1 -1
- package/dist/esm/client/client-routing-runtime/useClientRouter.js +1 -1
- package/dist/esm/node/plugin/plugins/buildConfig.js +2 -2
- package/dist/esm/node/plugin/plugins/config/index.js +2 -2
- package/dist/esm/node/plugin/plugins/devConfig/determineOptimizeDeps.js +4 -6
- package/dist/esm/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.js +18 -9
- package/dist/esm/node/plugin/plugins/importUserCode/index.js +3 -3
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.d.ts +2 -2
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js +4 -4
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.d.ts +2 -2
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +69 -87
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigValuesAll.d.ts +1 -6
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigValuesAll.js +6 -38
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigs.d.ts +1 -1
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigs.js +21 -23
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/helpers.d.ts +3 -3
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/helpers.js +6 -8
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/isRuntimeEnvMatch.d.ts +7 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/isRuntimeEnvMatch.js +15 -0
- package/dist/esm/node/plugin/shared/findPageFiles.js +3 -2
- package/dist/esm/node/plugin/utils.js +1 -1
- package/dist/esm/node/prerender/runPrerender.js +5 -5
- package/dist/esm/node/runtime/renderPage.js +1 -1
- package/dist/esm/shared/assertPageContextProvidedByUser.js +1 -1
- package/dist/esm/shared/getPageFiles/getExports.js +4 -4
- package/dist/esm/shared/getPageFiles/parseGlobResults.js +3 -3
- package/dist/esm/shared/page-configs/PageConfig.d.ts +25 -62
- package/dist/esm/shared/page-configs/getExportPath.d.ts +1 -1
- package/dist/esm/shared/page-configs/getExportPath.js +7 -8
- package/dist/esm/shared/page-configs/loadConfigValues.js +1 -1
- package/dist/esm/shared/page-configs/serialize/PageConfigSerialized.d.ts +32 -0
- package/dist/esm/shared/page-configs/serialize/PageConfigSerialized.js +1 -0
- package/dist/esm/shared/{getPageFiles → page-configs/serialize}/assertPageConfigs.d.ts +1 -1
- package/dist/esm/shared/{getPageFiles → page-configs/serialize}/assertPageConfigs.js +1 -1
- package/dist/esm/shared/page-configs/{parseConfigValuesImported.d.ts → serialize/parseConfigValuesImported.d.ts} +2 -1
- package/dist/esm/shared/page-configs/{parseConfigValuesImported.js → serialize/parseConfigValuesImported.js} +13 -10
- package/dist/esm/shared/page-configs/serialize/parsePageConfigs.d.ts +7 -0
- package/dist/esm/shared/{getPageFiles/parsePageConfigsSerialized.js → page-configs/serialize/parsePageConfigs.js} +5 -5
- package/dist/esm/shared/page-configs/serialize/serializeConfigValue.d.ts +8 -0
- package/dist/esm/shared/page-configs/serialize/serializeConfigValue.js +52 -0
- package/dist/esm/shared/page-configs/utils.d.ts +3 -3
- package/dist/esm/shared/page-configs/utils.js +11 -12
- package/dist/esm/shared/route/loadPageRoutes.js +1 -1
- package/dist/esm/utils/getOutDirs.d.ts +0 -2
- package/dist/esm/utils/getOutDirs.js +24 -17
- package/dist/esm/utils/getValuePrintable.js +1 -1
- package/dist/esm/utils/projectInfo.d.ts +1 -1
- package/dist/esm/utils/projectInfo.js +1 -1
- package/dist/esm/utils/warnIfErrorIsNotObject.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/isConfigEnvMatch.js +0 -13
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/isConfigEnvMatch.d.ts +0 -3
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/isConfigEnvMatch.js +0 -10
- package/dist/esm/shared/getPageFiles/parsePageConfigsSerialized.d.ts +0 -6
package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigValuesAll.d.ts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
export { getVirtualFilePageConfigValuesAll };
|
|
2
|
-
export { serializeConfigValueImported };
|
|
3
|
-
import type { ConfigValueSource } from '../../../../../shared/page-configs/PageConfig.js';
|
|
4
2
|
import type { ConfigVikeResolved } from '../../../../../shared/ConfigVike.js';
|
|
5
|
-
declare function getVirtualFilePageConfigValuesAll(id: string, userRootDir: string, isDev: boolean, configVike: ConfigVikeResolved): Promise<string>;
|
|
6
|
-
declare function serializeConfigValueImported(configValueSource: ConfigValueSource, configName: string, whitespace: string, varCounterContainer: {
|
|
7
|
-
varCounter: number;
|
|
8
|
-
}, importStatements: string[]): string[];
|
|
3
|
+
declare function getVirtualFilePageConfigValuesAll(id: string, userRootDir: string, outDirRoot: string, isDev: boolean, configVike: ConfigVikeResolved): Promise<string>;
|
package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigValuesAll.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
export { getVirtualFilePageConfigValuesAll };
|
|
2
|
-
|
|
3
|
-
import { assert, assertPosixPath } from '../../../utils.js';
|
|
4
|
-
import { generateEagerImport } from '../generateEagerImport.js';
|
|
2
|
+
import { assert } from '../../../utils.js';
|
|
5
3
|
import { getVirtualFileIdPageConfigValuesAll, isVirtualFileIdPageConfigValuesAll } from '../../../../shared/virtual-files/virtualFilePageConfigValuesAll.js';
|
|
6
4
|
import { getVikeConfig } from './getVikeConfig.js';
|
|
7
5
|
import { extractAssetsAddQuery } from '../../../../shared/extractAssetsQuery.js';
|
|
8
6
|
import { debug } from './debug.js';
|
|
9
|
-
import path from 'path';
|
|
10
7
|
import { getConfigValue } from '../../../../../shared/page-configs/utils.js';
|
|
11
8
|
import { getConfigValueSourcesRelevant } from '../../../shared/getConfigValueSourcesRelevant.js';
|
|
12
|
-
import {
|
|
13
|
-
|
|
9
|
+
import { isRuntimeEnvMatch } from './isRuntimeEnvMatch.js';
|
|
10
|
+
import { serializeConfigValueImported } from '../../../../../shared/page-configs/serialize/serializeConfigValue.js';
|
|
11
|
+
async function getVirtualFilePageConfigValuesAll(id, userRootDir, outDirRoot, isDev, configVike) {
|
|
14
12
|
const result = isVirtualFileIdPageConfigValuesAll(id);
|
|
15
13
|
assert(result);
|
|
16
14
|
/* This assertion fails when using includeAssetsImportedByServer
|
|
@@ -20,7 +18,7 @@ async function getVirtualFilePageConfigValuesAll(id, userRootDir, isDev, configV
|
|
|
20
18
|
}
|
|
21
19
|
*/
|
|
22
20
|
const { pageId, isForClientSide } = result;
|
|
23
|
-
const { pageConfigs } = await getVikeConfig(userRootDir, isDev, configVike.extensions, true);
|
|
21
|
+
const { pageConfigs } = await getVikeConfig(userRootDir, outDirRoot, isDev, configVike.extensions, true);
|
|
24
22
|
const pageConfig = pageConfigs.find((pageConfig) => pageConfig.pageId === pageId);
|
|
25
23
|
assert(pageConfig);
|
|
26
24
|
const code = getLoadConfigValuesAll(pageConfig, isForClientSide, pageId, configVike.includeAssetsImportedByServer, isDev);
|
|
@@ -40,7 +38,7 @@ function getLoadConfigValuesAll(pageConfig, isForClientSide, pageId, includeAsse
|
|
|
40
38
|
return;
|
|
41
39
|
if (configValueSource.valueIsFilePath)
|
|
42
40
|
return;
|
|
43
|
-
if (!
|
|
41
|
+
if (!isRuntimeEnvMatch(configEnv, { isForClientSide, isClientRouting, isEager: false }))
|
|
44
42
|
return;
|
|
45
43
|
const whitespace = ' ';
|
|
46
44
|
lines.push(...serializeConfigValueImported(configValueSource, configName, whitespace, varCounterContainer, importStatements));
|
|
@@ -52,33 +50,3 @@ function getLoadConfigValuesAll(pageConfig, isForClientSide, pageId, includeAsse
|
|
|
52
50
|
const code = [...importStatements, ...lines].join('\n');
|
|
53
51
|
return code;
|
|
54
52
|
}
|
|
55
|
-
function serializeConfigValueImported(configValueSource, configName, whitespace, varCounterContainer, importStatements) {
|
|
56
|
-
assert(!configValueSource.valueIsFilePath);
|
|
57
|
-
assert(whitespace.replaceAll(' ', '').length === 0);
|
|
58
|
-
const { valueIsImportedAtRuntime, definedAtInfo } = configValueSource;
|
|
59
|
-
assert(valueIsImportedAtRuntime);
|
|
60
|
-
const { filePathRelativeToUserRootDir, importPathAbsolute, exportName } = definedAtInfo;
|
|
61
|
-
const importPath = filePathRelativeToUserRootDir ?? importPathAbsolute;
|
|
62
|
-
assertPosixPath(importPath);
|
|
63
|
-
const fileName = path.posix.basename(importPath);
|
|
64
|
-
const isValueFile = fileName.startsWith('+');
|
|
65
|
-
if (isValueFile)
|
|
66
|
-
assert(exportName === undefined);
|
|
67
|
-
const { importName, importStatement } = generateEagerImport(importPath, varCounterContainer.varCounter++, exportName);
|
|
68
|
-
importStatements.push(importStatement);
|
|
69
|
-
const lines = [];
|
|
70
|
-
lines.push(` {`);
|
|
71
|
-
lines.push(` configName: '${configName}',`);
|
|
72
|
-
lines.push(` importPath: '${importPath}',`);
|
|
73
|
-
lines.push(` isValueFile: ${JSON.stringify(isValueFile)},`);
|
|
74
|
-
if (isValueFile) {
|
|
75
|
-
lines.push(` importFileExports: ${importName},`);
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
lines.push(` importFileExportValue: ${importName},`);
|
|
79
|
-
assert(exportName);
|
|
80
|
-
lines.push(` exportName: ${JSON.stringify(exportName)},`);
|
|
81
|
-
}
|
|
82
|
-
lines.push(` },`);
|
|
83
|
-
return lines;
|
|
84
|
-
}
|
package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigs.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ export { getVirtualFilePageConfigs };
|
|
|
2
2
|
export { getConfigValueSerialized };
|
|
3
3
|
import type { DefinedAt } from '../../../../../shared/page-configs/PageConfig.js';
|
|
4
4
|
import type { ConfigVikeResolved } from '../../../../../shared/ConfigVike.js';
|
|
5
|
-
declare function getVirtualFilePageConfigs(userRootDir: string, isForClientSide: boolean, isDev: boolean, id: string, configVike: ConfigVikeResolved, isClientRouting: boolean): Promise<string>;
|
|
5
|
+
declare function getVirtualFilePageConfigs(userRootDir: string, outDirRoot: string, isForClientSide: boolean, isDev: boolean, id: string, configVike: ConfigVikeResolved, isClientRouting: boolean): Promise<string>;
|
|
6
6
|
declare function getConfigValueSerialized(value: unknown, configName: string, definedAt: DefinedAt): string;
|
|
@@ -7,11 +7,11 @@ import { stringify } from '@brillout/json-serializer/stringify';
|
|
|
7
7
|
import { getConfigEnv } from './helpers.js';
|
|
8
8
|
import pc from '@brillout/picocolors';
|
|
9
9
|
import { getVikeConfig } from './getVikeConfig.js';
|
|
10
|
-
import {
|
|
11
|
-
import { serializeConfigValueImported } from './getVirtualFilePageConfigValuesAll.js';
|
|
10
|
+
import { isRuntimeEnvMatch } from './isRuntimeEnvMatch.js';
|
|
12
11
|
import { getConfigValueFilePathToShowToUser } from '../../../../../shared/page-configs/utils.js';
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
import { serializeConfigValue, serializeConfigValueImported } from '../../../../../shared/page-configs/serialize/serializeConfigValue.js';
|
|
13
|
+
async function getVirtualFilePageConfigs(userRootDir, outDirRoot, isForClientSide, isDev, id, configVike, isClientRouting) {
|
|
14
|
+
const { pageConfigs, pageConfigGlobal } = await getVikeConfig(userRootDir, outDirRoot, isDev, configVike.extensions, true);
|
|
15
15
|
return getContent(pageConfigs, pageConfigGlobal, isForClientSide, isDev, id, isClientRouting);
|
|
16
16
|
}
|
|
17
17
|
function getContent(pageConfigs, pageConfigGlobal, isForClientSide, isDev, id, isClientRouting) {
|
|
@@ -28,12 +28,25 @@ function getContent(pageConfigs, pageConfigGlobal, isForClientSide, isDev, id, i
|
|
|
28
28
|
lines.push(` routeFilesystem: ${JSON.stringify(routeFilesystem)},`);
|
|
29
29
|
lines.push(` loadConfigValuesAll: async () => (await import(${JSON.stringify(virtualFileIdPageConfigValuesAll)})).default,`);
|
|
30
30
|
lines.push(` configValuesSerialized: {`);
|
|
31
|
-
Object.entries(pageConfig.
|
|
31
|
+
Object.entries(pageConfig.configValuesComputed).forEach(([configName, configValuesComputed]) => {
|
|
32
|
+
const { value, configEnv } = configValuesComputed;
|
|
33
|
+
if (!isRuntimeEnvMatch(configEnv, { isForClientSide, isClientRouting, isEager: true }))
|
|
34
|
+
return;
|
|
35
|
+
if (pageConfig.configValueSources[configName])
|
|
36
|
+
return;
|
|
37
|
+
const configValue = pageConfig.configValues[configName];
|
|
38
|
+
assert(configValue);
|
|
39
|
+
const { definedAt } = configValue;
|
|
40
|
+
const valueSerialized = getConfigValueSerialized(value, configName, definedAt);
|
|
41
|
+
serializeConfigValue(lines, configName, { definedAt, valueSerialized });
|
|
42
|
+
});
|
|
43
|
+
Object.entries(pageConfig.configValueSources).forEach(([configName]) => {
|
|
32
44
|
const configValue = pageConfig.configValues[configName];
|
|
33
45
|
if (configValue) {
|
|
34
|
-
const configEnv = getConfigEnv(pageConfig, configName);
|
|
46
|
+
const configEnv = getConfigEnv(pageConfig.configValueSources, configName);
|
|
35
47
|
assert(configEnv, configName);
|
|
36
|
-
|
|
48
|
+
const isEnvMatch = isRuntimeEnvMatch(configEnv, { isForClientSide, isClientRouting, isEager: true });
|
|
49
|
+
if (!isEnvMatch)
|
|
37
50
|
return;
|
|
38
51
|
const { value, definedAt } = configValue;
|
|
39
52
|
const valueSerialized = getConfigValueSerialized(value, configName, definedAt);
|
|
@@ -51,7 +64,6 @@ function getContent(pageConfigs, pageConfigGlobal, isForClientSide, isDev, id, i
|
|
|
51
64
|
assert(configValueSource);
|
|
52
65
|
if (configValueSource.configEnv !== '_routing-eager')
|
|
53
66
|
return;
|
|
54
|
-
assert(!configValueSource.isComputed);
|
|
55
67
|
lines.push(...serializeConfigValueImported(configValueSource, configName, whitespace, varCounterContainer, importStatements));
|
|
56
68
|
});
|
|
57
69
|
lines.push(`${whitespace}],`);
|
|
@@ -89,29 +101,15 @@ function getContent(pageConfigs, pageConfigGlobal, isForClientSide, isDev, id, i
|
|
|
89
101
|
debug(id, isForClientSide ? 'CLIENT-SIDE' : 'SERVER-SIDE', code);
|
|
90
102
|
return code;
|
|
91
103
|
}
|
|
92
|
-
function serializeConfigValue(lines, configName, configValueSerialized) {
|
|
93
|
-
let whitespace = ' ';
|
|
94
|
-
lines.push(`${whitespace}['${configName}']: {`);
|
|
95
|
-
whitespace += ' ';
|
|
96
|
-
Object.entries(configValueSerialized).forEach(([key, val]) => {
|
|
97
|
-
const valSerialized = key === 'definedAt' ? JSON.stringify(val) : val;
|
|
98
|
-
lines.push(`${whitespace} ${key}: ${valSerialized},`);
|
|
99
|
-
});
|
|
100
|
-
whitespace = whitespace.slice(2);
|
|
101
|
-
lines.push(`${whitespace}},`);
|
|
102
|
-
}
|
|
103
104
|
function getConfigValueSerialized(value, configName, definedAt) {
|
|
104
|
-
let configValueSerialized;
|
|
105
105
|
const valueName = `config${getPropAccessNotation(configName)}`;
|
|
106
|
+
let configValueSerialized;
|
|
106
107
|
try {
|
|
107
108
|
configValueSerialized = stringify(value, { valueName });
|
|
108
109
|
}
|
|
109
110
|
catch (err) {
|
|
110
111
|
assert(hasProp(err, 'messageCore', 'string'));
|
|
111
112
|
const configValueFilePathToShowToUser = getConfigValueFilePathToShowToUser({ definedAt });
|
|
112
|
-
// definedAt is null when config value is:
|
|
113
|
-
// - computed => all computed values defined by Vike can are serializable
|
|
114
|
-
// - cumulative => the values are already ensured to be serializable
|
|
115
113
|
assert(configValueFilePathToShowToUser);
|
|
116
114
|
assertUsage(false, [
|
|
117
115
|
`The value of the config ${pc.cyan(configName)} cannot be defined inside the file ${configValueFilePathToShowToUser}:`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { getConfigEnv };
|
|
2
2
|
export { isConfigSet };
|
|
3
|
-
import type { ConfigEnvInternal,
|
|
4
|
-
declare function getConfigEnv(
|
|
5
|
-
declare function isConfigSet(
|
|
3
|
+
import type { ConfigEnvInternal, ConfigValueSources } from '../../../../../shared/page-configs/PageConfig.js';
|
|
4
|
+
declare function getConfigEnv(configValueSources: ConfigValueSources, configName: string): null | ConfigEnvInternal;
|
|
5
|
+
declare function isConfigSet(configValueSources: ConfigValueSources, configName: string): boolean;
|
|
@@ -2,8 +2,8 @@ export { getConfigEnv };
|
|
|
2
2
|
export { isConfigSet };
|
|
3
3
|
import { assert, assertIsNotProductionRuntime } from '../../../utils.js';
|
|
4
4
|
assertIsNotProductionRuntime();
|
|
5
|
-
function getConfigEnv(
|
|
6
|
-
const configValueSource = getConfigValueSource(
|
|
5
|
+
function getConfigEnv(configValueSources, configName) {
|
|
6
|
+
const configValueSource = getConfigValueSource(configValueSources, configName);
|
|
7
7
|
if (!configValueSource)
|
|
8
8
|
return null;
|
|
9
9
|
if (configValueSource) {
|
|
@@ -21,17 +21,15 @@ function getConfigEnv(pageConfig, configName) {
|
|
|
21
21
|
*/
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
function isConfigSet(
|
|
25
|
-
const configValueSource = getConfigValueSource(
|
|
24
|
+
function isConfigSet(configValueSources, configName) {
|
|
25
|
+
const configValueSource = getConfigValueSource(configValueSources, configName);
|
|
26
26
|
// Enable users to suppress global config values by overriding the config's value to null
|
|
27
27
|
if (configValueSource?.value === null)
|
|
28
28
|
return false;
|
|
29
29
|
return !!configValueSource;
|
|
30
30
|
}
|
|
31
|
-
function getConfigValueSource(
|
|
32
|
-
|
|
33
|
-
assert(pageConfig.configValueSources);
|
|
34
|
-
const sources = pageConfig.configValueSources[configName];
|
|
31
|
+
function getConfigValueSource(configValueSources, configName) {
|
|
32
|
+
const sources = configValueSources[configName];
|
|
35
33
|
if (!sources)
|
|
36
34
|
return null;
|
|
37
35
|
const configValueSource = sources[0];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { isRuntimeEnvMatch };
|
|
2
|
+
import type { ConfigEnvInternal } from '../../../../../shared/page-configs/PageConfig.js';
|
|
3
|
+
declare function isRuntimeEnvMatch(configEnv: ConfigEnvInternal, runtime: {
|
|
4
|
+
isForClientSide: boolean;
|
|
5
|
+
isClientRouting: boolean;
|
|
6
|
+
isEager: boolean;
|
|
7
|
+
}): boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { isRuntimeEnvMatch };
|
|
2
|
+
function isRuntimeEnvMatch(configEnv, runtime) {
|
|
3
|
+
const { isForClientSide, isClientRouting, isEager } = runtime;
|
|
4
|
+
if (configEnv === 'config-only')
|
|
5
|
+
return false;
|
|
6
|
+
if (configEnv === (isForClientSide ? 'server-only' : 'client-only'))
|
|
7
|
+
return false;
|
|
8
|
+
if (configEnv === '_routing-eager' || configEnv === '_routing-lazy') {
|
|
9
|
+
if (isForClientSide && !isClientRouting)
|
|
10
|
+
return false;
|
|
11
|
+
if (isEager !== (configEnv === '_routing-eager'))
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export { findPageFiles };
|
|
2
2
|
import glob from 'fast-glob';
|
|
3
|
-
import { assertWarning, toPosixPath, scriptFileExtensions } from '../utils.js';
|
|
3
|
+
import { assertWarning, toPosixPath, scriptFileExtensions, getOutDirs } from '../utils.js';
|
|
4
4
|
import pc from '@brillout/picocolors';
|
|
5
5
|
async function findPageFiles(config, fileTypes, isDev) {
|
|
6
6
|
const cwd = config.root;
|
|
7
|
+
const { outDirRoot } = getOutDirs(config);
|
|
7
8
|
const timeBase = new Date().getTime();
|
|
8
|
-
let pageFiles = await glob(fileTypes.map((fileType) => `**/*${fileType}.${scriptFileExtensions}`), { ignore: ['**/node_modules/**'], cwd, dot: false });
|
|
9
|
+
let pageFiles = await glob(fileTypes.map((fileType) => `**/*${fileType}.${scriptFileExtensions}`), { ignore: ['**/node_modules/**', `${outDirRoot}/**`], cwd, dot: false });
|
|
9
10
|
pageFiles = pageFiles.map((p) => '/' + toPosixPath(p));
|
|
10
11
|
const time = new Date().getTime() - timeBase;
|
|
11
12
|
if (isDev) {
|
|
@@ -5,7 +5,7 @@ export { prerenderForceExit };
|
|
|
5
5
|
import '../runtime/page-files/setup.js';
|
|
6
6
|
import path from 'path';
|
|
7
7
|
import { route } from '../../shared/route/index.js';
|
|
8
|
-
import { assert, assertUsage, assertWarning, hasProp, projectInfo, objectAssign, isObjectWithKeys, isCallable,
|
|
8
|
+
import { assert, assertUsage, assertWarning, hasProp, projectInfo, objectAssign, isObjectWithKeys, isCallable, getOutDirs, hasPropertyGetter, assertPosixPath, urlToFile, executeHook, isPlainObject, setNodeEnvToProduction } from './utils.js';
|
|
9
9
|
import { pLimit } from '../../utils/pLimit.js';
|
|
10
10
|
import { prerenderPage, prerender404Page, getRenderContext, getPageContextInitEnhanced } from '../runtime/renderPage/renderPageAlreadyRouted.js';
|
|
11
11
|
import pc from '@brillout/picocolors';
|
|
@@ -44,7 +44,7 @@ async function runPrerender(options, manuallyTriggered) {
|
|
|
44
44
|
const viteConfig = await resolveConfig(options.viteConfig || {}, 'vike pre-rendering', 'production');
|
|
45
45
|
assertLoadedConfig(viteConfig, options);
|
|
46
46
|
const configVike = await getConfigVike(viteConfig);
|
|
47
|
-
const { outDirClient, outDirRoot } =
|
|
47
|
+
const { outDirClient, outDirRoot } = getOutDirs(viteConfig);
|
|
48
48
|
const { root } = viteConfig;
|
|
49
49
|
const prerenderConfig = configVike.prerender;
|
|
50
50
|
if (!prerenderConfig) {
|
|
@@ -87,13 +87,13 @@ async function collectDoNoPrerenderList(renderContext, doNotPrerenderList, concu
|
|
|
87
87
|
const configName = 'prerender';
|
|
88
88
|
const configValue = getConfigValue(pageConfig, configName, 'boolean');
|
|
89
89
|
if (configValue?.value === false) {
|
|
90
|
-
const
|
|
91
|
-
assert(
|
|
90
|
+
const configValueFilePathToShowToUser = getConfigValueFilePathToShowToUser(configValue);
|
|
91
|
+
assert(configValueFilePathToShowToUser);
|
|
92
92
|
doNotPrerenderList.push({
|
|
93
93
|
pageId: pageConfig.pageId,
|
|
94
94
|
setByConfigName: 'prerender',
|
|
95
95
|
setByConfigValue: false,
|
|
96
|
-
setByConfigFile:
|
|
96
|
+
setByConfigFile: configValueFilePathToShowToUser
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
});
|
|
@@ -305,7 +305,7 @@ function getRequestId() {
|
|
|
305
305
|
}
|
|
306
306
|
function skipRequest(urlOriginal) {
|
|
307
307
|
const isViteClientRequest = urlOriginal.endsWith('/@vite/client') || urlOriginal.startsWith('/@fs/');
|
|
308
|
-
assertWarning(!isViteClientRequest, `The vike middleware renderPage() was called with the URL ${urlOriginal} which is unexpected because the HTTP request should have already been handled by Vite's development middleware. Make sure to 1. install Vite's development middleware and 2. add Vite's middleware *before*
|
|
308
|
+
assertWarning(!isViteClientRequest, `The vike middleware renderPage() was called with the URL ${urlOriginal} which is unexpected because the HTTP request should have already been handled by Vite's development middleware. Make sure to 1. install Vite's development middleware and 2. add Vite's middleware *before* Vike's middleware, see https://vike.dev/renderPage`, { onlyOnce: true });
|
|
309
309
|
return (urlOriginal.endsWith('/__vite_ping') ||
|
|
310
310
|
urlOriginal.endsWith('/favicon.ico') ||
|
|
311
311
|
!isParsable(urlOriginal) ||
|
|
@@ -10,6 +10,6 @@ function assertPageContextProvidedByUser(pageContextProvidedByUser, { hookName,
|
|
|
10
10
|
assertUsage(!('_objectCreatedByVike' in pageContextProvidedByUser), `${errPrefix} shouldn't be the whole ${pc.cyan('pageContext')} object, see https://vike.dev/pageContext-manipulation#do-not-return-entire-pagecontext`);
|
|
11
11
|
// In principle, it's possible to use onBeforeRoute()` to override and define the whole routing.
|
|
12
12
|
// Is that a good idea to allow users to do this? Beyond deep integration with Vue Router or React Router, is there a use case for this?
|
|
13
|
-
assertWarning(!('_pageId' in pageContextProvidedByUser), `${errPrefix} sets ${pc.cyan('pageContext._pageId')} which means that
|
|
13
|
+
assertWarning(!('_pageId' in pageContextProvidedByUser), `${errPrefix} sets ${pc.cyan('pageContext._pageId')} which means that Vike's routing is overriden. This is an experimental feature: make sure to contact a vike maintainer before using this.`, { onlyOnce: true });
|
|
14
14
|
assertUsage(!('is404' in pageContextProvidedByUser), `${errPrefix} sets ${pc.cyan('pageContext.is404')} which is forbidden, use ${pc.cyan('throw render()')} instead, see https://vike.dev/render`);
|
|
15
15
|
}
|
|
@@ -30,7 +30,7 @@ function getExports(pageFiles, pageConfig) {
|
|
|
30
30
|
if (pageConfig) {
|
|
31
31
|
Object.entries(pageConfig.configValues).forEach(([configName, configValue]) => {
|
|
32
32
|
const { value } = configValue;
|
|
33
|
-
const
|
|
33
|
+
const configValueFilePathToShowToUser = getConfigValueFilePathToShowToUser(configValue);
|
|
34
34
|
const configDefinedAt = getConfigDefinedAtString(configName, configValue, true);
|
|
35
35
|
config[configName] = config[configName] ?? value;
|
|
36
36
|
configEntries[configName] = configEntries[configName] ?? [];
|
|
@@ -39,7 +39,7 @@ function getExports(pageFiles, pageConfig) {
|
|
|
39
39
|
configEntries[configName].push({
|
|
40
40
|
configValue: value,
|
|
41
41
|
configDefinedAt,
|
|
42
|
-
configDefinedByFile:
|
|
42
|
+
configDefinedByFile: configValueFilePathToShowToUser
|
|
43
43
|
});
|
|
44
44
|
// TODO/v1-release: remove
|
|
45
45
|
const exportName = configName;
|
|
@@ -47,8 +47,8 @@ function getExports(pageFiles, pageConfig) {
|
|
|
47
47
|
exportsAll[exportName].push({
|
|
48
48
|
exportValue: value,
|
|
49
49
|
exportSource: configDefinedAt,
|
|
50
|
-
filePath,
|
|
51
|
-
_filePath:
|
|
50
|
+
filePath: configValueFilePathToShowToUser,
|
|
51
|
+
_filePath: configValueFilePathToShowToUser,
|
|
52
52
|
_fileType: null,
|
|
53
53
|
_isFromDefaultExport: null
|
|
54
54
|
});
|
|
@@ -3,8 +3,8 @@ import { assert, hasProp, isCallable, isObject, cast, assertUsage } from '../uti
|
|
|
3
3
|
import { assertExportValues } from './assert_exports_old_design.js';
|
|
4
4
|
import { getPageFileObject } from './getPageFileObject.js';
|
|
5
5
|
import { fileTypes } from './fileTypes.js';
|
|
6
|
-
import { assertPageConfigGlobalSerialized, assertPageConfigsSerialized } from '
|
|
7
|
-
import {
|
|
6
|
+
import { assertPageConfigGlobalSerialized, assertPageConfigsSerialized } from '../page-configs/serialize/assertPageConfigs.js';
|
|
7
|
+
import { parsePageConfigs } from '../page-configs/serialize/parsePageConfigs.js';
|
|
8
8
|
function parseGlobResults(pageFilesExports) {
|
|
9
9
|
assert(hasProp(pageFilesExports, 'isGeneratedFile'));
|
|
10
10
|
assert(pageFilesExports.isGeneratedFile !== false, `vike was re-installed(/re-built). Restart your app.`);
|
|
@@ -21,7 +21,7 @@ function parseGlobResults(pageFilesExports) {
|
|
|
21
21
|
const { pageConfigsSerialized, pageConfigGlobalSerialized } = pageFilesExports;
|
|
22
22
|
assertPageConfigsSerialized(pageConfigsSerialized);
|
|
23
23
|
assertPageConfigGlobalSerialized(pageConfigGlobalSerialized);
|
|
24
|
-
const { pageConfigs, pageConfigGlobal } =
|
|
24
|
+
const { pageConfigs, pageConfigGlobal } = parsePageConfigs(pageConfigsSerialized, pageConfigGlobalSerialized);
|
|
25
25
|
const pageFilesMap = {};
|
|
26
26
|
parseGlobResult(pageFilesExports.pageFilesLazy).forEach(({ filePath, pageFile, globValue }) => {
|
|
27
27
|
pageFile = pageFilesMap[filePath] = pageFilesMap[filePath] ?? pageFile;
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
export type { PageConfigRuntime };
|
|
2
2
|
export type { PageConfigRuntimeLoaded };
|
|
3
|
-
export type { PageConfigRuntimeSerialized };
|
|
4
3
|
export type { PageConfigBuildTime };
|
|
5
|
-
export type { ConfigEnvInternal };
|
|
6
4
|
export type { ConfigEnv };
|
|
5
|
+
export type { ConfigEnvInternal };
|
|
7
6
|
export type { PageConfigGlobalRuntime };
|
|
8
|
-
export type { PageConfigGlobalRuntimeSerialized };
|
|
9
7
|
export type { PageConfigGlobalBuildTime };
|
|
10
|
-
export type { ConfigSource };
|
|
11
8
|
export type { ConfigValue };
|
|
12
|
-
export type { ConfigValueSerialized };
|
|
13
|
-
export type { ConfigValueImported };
|
|
14
9
|
export type { ConfigValues };
|
|
15
10
|
export type { ConfigValueSource };
|
|
16
11
|
export type { ConfigValueSources };
|
|
12
|
+
export type { ConfigValueComputed };
|
|
13
|
+
export type { ConfigValuesComputed };
|
|
17
14
|
export type { DefinedAt };
|
|
18
|
-
export type {
|
|
19
|
-
export type {
|
|
20
|
-
|
|
15
|
+
export type { DefinedAtFile };
|
|
16
|
+
export type { DefinedAtFileInfo };
|
|
17
|
+
import type { ConfigValueImported } from './serialize/PageConfigSerialized.js';
|
|
21
18
|
type PageConfigBase = {
|
|
22
19
|
pageId: string;
|
|
23
20
|
isErrorPage?: true;
|
|
@@ -31,34 +28,23 @@ type PageConfigRuntime = PageConfigBase & {
|
|
|
31
28
|
/** Loaded config values */
|
|
32
29
|
configValues: ConfigValues;
|
|
33
30
|
/** Load config values that are lazily loaded such as config.Page */
|
|
34
|
-
loadConfigValuesAll:
|
|
31
|
+
loadConfigValuesAll: () => Promise<ConfigValueImported[]>;
|
|
35
32
|
};
|
|
36
33
|
/** Same as PageConfigRuntime but also contains all lazily loaded config values such as config.Page */
|
|
37
34
|
type PageConfigRuntimeLoaded = PageConfigRuntime & {
|
|
38
35
|
/** Whether loadConfigValuesAll() was called */
|
|
39
36
|
isLoaded: true;
|
|
40
37
|
};
|
|
41
|
-
/**
|
|
38
|
+
/** Page config data structure available and used at build-time */
|
|
42
39
|
type PageConfigBuildTime = PageConfigBase & {
|
|
43
40
|
configValues: ConfigValues;
|
|
44
41
|
configValueSources: ConfigValueSources;
|
|
42
|
+
configValuesComputed: ConfigValuesComputed;
|
|
45
43
|
};
|
|
46
|
-
/**
|
|
47
|
-
type PageConfigRuntimeSerialized = PageConfigBase & {
|
|
48
|
-
/** Config values that are loaded eagerly and serializable such as config.passToClient */
|
|
49
|
-
configValuesSerialized: Record<string, ConfigValueSerialized>;
|
|
50
|
-
/** Config values imported eagerly such as config.route */
|
|
51
|
-
configValuesImported: ConfigValueImported[];
|
|
52
|
-
/** Config values imported lazily such as config.page */
|
|
53
|
-
loadConfigValuesAll: LoadConfigValuesAll;
|
|
54
|
-
};
|
|
55
|
-
/** page config that applies to all pages */
|
|
44
|
+
/** Page config that applies to all pages */
|
|
56
45
|
type PageConfigGlobalRuntime = {
|
|
57
46
|
configValues: ConfigValues;
|
|
58
47
|
};
|
|
59
|
-
type PageConfigGlobalRuntimeSerialized = {
|
|
60
|
-
configValuesImported: ConfigValueImported[];
|
|
61
|
-
};
|
|
62
48
|
type PageConfigGlobalBuildTime = {
|
|
63
49
|
configValueSources: ConfigValueSources;
|
|
64
50
|
};
|
|
@@ -66,36 +52,33 @@ type ConfigEnv = 'client-only' | 'server-only' | 'server-and-client' | 'config-o
|
|
|
66
52
|
/** For Vike internal use */
|
|
67
53
|
type ConfigEnvInternal = ConfigEnv | '_routing-eager' | '_routing-lazy';
|
|
68
54
|
type ConfigValueSource = {
|
|
69
|
-
configEnv: ConfigEnvInternal;
|
|
70
55
|
value?: unknown;
|
|
56
|
+
configEnv: ConfigEnvInternal;
|
|
57
|
+
definedAtInfo: DefinedAtFileInfo;
|
|
58
|
+
/** Wether the config value is loaded at run-time, for example config.Page or config.onBeforeRender */
|
|
71
59
|
valueIsImportedAtRuntime: boolean;
|
|
60
|
+
/** Whether the config value is a file path, for example config.client */
|
|
72
61
|
valueIsFilePath?: true;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
valueIsImportedAtRuntime: false;
|
|
80
|
-
});
|
|
62
|
+
};
|
|
63
|
+
type ConfigValueComputed = {
|
|
64
|
+
configEnv: ConfigEnvInternal;
|
|
65
|
+
value: unknown;
|
|
66
|
+
};
|
|
67
|
+
type ConfigValuesComputed = Record<string, ConfigValueComputed>;
|
|
81
68
|
type ConfigValueSources = Record<string, ConfigValueSource[]>;
|
|
82
69
|
type ConfigValue = {
|
|
83
70
|
value: unknown;
|
|
84
71
|
definedAt: DefinedAt;
|
|
85
72
|
};
|
|
86
|
-
type ConfigValueSerialized = {
|
|
87
|
-
valueSerialized: string;
|
|
88
|
-
definedAt: DefinedAt;
|
|
89
|
-
};
|
|
90
73
|
type ConfigValues = Record<string, ConfigValue>;
|
|
91
74
|
type DefinedAt = {
|
|
92
|
-
|
|
75
|
+
file: DefinedAtFile;
|
|
93
76
|
isEffect?: true;
|
|
94
77
|
isComputed?: undefined;
|
|
95
78
|
isCumulative?: undefined;
|
|
96
79
|
} | {
|
|
97
80
|
isCumulative: true;
|
|
98
|
-
|
|
81
|
+
files: DefinedAtFile[];
|
|
99
82
|
isEffect?: undefined;
|
|
100
83
|
isComputed?: undefined;
|
|
101
84
|
} | {
|
|
@@ -103,11 +86,12 @@ type DefinedAt = {
|
|
|
103
86
|
isEffect?: undefined;
|
|
104
87
|
isCumulative?: undefined;
|
|
105
88
|
};
|
|
106
|
-
type
|
|
89
|
+
type DefinedAtFile = {
|
|
107
90
|
filePathToShowToUser: string;
|
|
108
91
|
fileExportPath: null | string[];
|
|
109
92
|
};
|
|
110
|
-
type
|
|
93
|
+
type DefinedAtFileInfo = // TODO: replace filePathRelativeToUserRootDir and importPathAbsolute with following?
|
|
94
|
+
({
|
|
111
95
|
filePathRelativeToUserRootDir: string;
|
|
112
96
|
filePathAbsolute: string;
|
|
113
97
|
importPathAbsolute: null;
|
|
@@ -119,24 +103,3 @@ type DefinedAtInfoFull = ({
|
|
|
119
103
|
exportName?: string;
|
|
120
104
|
fileExportPath: null | string[];
|
|
121
105
|
};
|
|
122
|
-
type ConfigSource = {
|
|
123
|
-
configSourceFile: string;
|
|
124
|
-
} & ({
|
|
125
|
-
configSourceFileExportName: string;
|
|
126
|
-
configSourceFileDefaultExportKey?: undefined;
|
|
127
|
-
} | {
|
|
128
|
-
configSourceFileDefaultExportKey: string;
|
|
129
|
-
configSourceFileExportName?: undefined;
|
|
130
|
-
});
|
|
131
|
-
type LoadConfigValuesAll = () => Promise<ConfigValueImported[]>;
|
|
132
|
-
type ConfigValueImported = {
|
|
133
|
-
configName: string;
|
|
134
|
-
importPath: string;
|
|
135
|
-
} & ({
|
|
136
|
-
isValueFile: true;
|
|
137
|
-
importFileExports: Record<string, unknown>;
|
|
138
|
-
} | {
|
|
139
|
-
isValueFile: false;
|
|
140
|
-
exportName: string;
|
|
141
|
-
importFileExportValue: unknown;
|
|
142
|
-
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { getExportPath };
|
|
2
|
-
declare function getExportPath(fileExportPath: null | string[]): null | string;
|
|
2
|
+
declare function getExportPath(fileExportPath: null | string[], configName: string): null | string;
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
export { getExportPath };
|
|
2
2
|
import { assert } from '../utils.js';
|
|
3
|
-
function getExportPath(fileExportPath) {
|
|
3
|
+
function getExportPath(fileExportPath, configName) {
|
|
4
4
|
if (!fileExportPath)
|
|
5
5
|
return null;
|
|
6
|
-
let prefix = '';
|
|
7
|
-
let suffix = '';
|
|
8
6
|
let [exportName, ...exportObjectPath] = fileExportPath;
|
|
9
7
|
if (!exportName)
|
|
10
8
|
return null;
|
|
11
|
-
if (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
if (exportObjectPath.length === 0 && ['*', 'default', configName].includes(exportName))
|
|
10
|
+
return null;
|
|
11
|
+
assert(exportName !== '*');
|
|
12
|
+
let prefix = '';
|
|
13
|
+
let suffix = '';
|
|
14
|
+
if (exportName === 'default') {
|
|
16
15
|
prefix = 'export default';
|
|
17
16
|
}
|
|
18
17
|
else {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { loadConfigValues };
|
|
2
2
|
import { objectAssign } from '../utils.js';
|
|
3
|
-
import { parseConfigValuesImported } from './parseConfigValuesImported.js';
|
|
3
|
+
import { parseConfigValuesImported } from './serialize/parseConfigValuesImported.js';
|
|
4
4
|
async function loadConfigValues(pageConfig, isDev) {
|
|
5
5
|
if ('isLoaded' in pageConfig &&
|
|
6
6
|
// We don't need to cache in dev, since Vite already caches the virtual module
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type { PageConfigRuntimeSerialized };
|
|
2
|
+
export type { PageConfigGlobalRuntimeSerialized };
|
|
3
|
+
export type { ConfigValueSerialized };
|
|
4
|
+
export type { ConfigValueImported };
|
|
5
|
+
import type { DefinedAt, PageConfigRuntime } from '../PageConfig.js';
|
|
6
|
+
/** page config data structure serialized in virtual files: parsing it results in PageConfigRuntime */
|
|
7
|
+
type PageConfigRuntimeSerialized = Omit<PageConfigRuntime, 'configValues'> & {
|
|
8
|
+
/** Config values that are loaded eagerly and serializable such as config.passToClient */
|
|
9
|
+
configValuesSerialized: Record<string, ConfigValueSerialized>;
|
|
10
|
+
/** Config values imported eagerly such as config.route */
|
|
11
|
+
configValuesImported: ConfigValueImported[];
|
|
12
|
+
};
|
|
13
|
+
type PageConfigGlobalRuntimeSerialized = {
|
|
14
|
+
configValuesImported: ConfigValueImported[];
|
|
15
|
+
};
|
|
16
|
+
/** Value is serialized. */
|
|
17
|
+
type ConfigValueSerialized = {
|
|
18
|
+
valueSerialized: string;
|
|
19
|
+
definedAt: DefinedAt;
|
|
20
|
+
};
|
|
21
|
+
/** Value is imported. */
|
|
22
|
+
type ConfigValueImported = {
|
|
23
|
+
configName: string;
|
|
24
|
+
importPath: string;
|
|
25
|
+
} & ({
|
|
26
|
+
isValueFile: true;
|
|
27
|
+
exportValues: Record<string, unknown>;
|
|
28
|
+
} | {
|
|
29
|
+
isValueFile: false;
|
|
30
|
+
exportName: string;
|
|
31
|
+
exportValue: unknown;
|
|
32
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { assertPageConfigsSerialized };
|
|
2
2
|
export { assertPageConfigGlobalSerialized };
|
|
3
|
-
import type { PageConfigGlobalRuntimeSerialized, PageConfigRuntimeSerialized } from '
|
|
3
|
+
import type { PageConfigGlobalRuntimeSerialized, PageConfigRuntimeSerialized } from './PageConfigSerialized.js';
|
|
4
4
|
declare function assertPageConfigsSerialized(pageConfigsSerialized: unknown): asserts pageConfigsSerialized is PageConfigRuntimeSerialized[];
|
|
5
5
|
declare function assertPageConfigGlobalSerialized(pageConfigGlobalSerialized: unknown): asserts pageConfigGlobalSerialized is PageConfigGlobalRuntimeSerialized;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { assertPageConfigsSerialized };
|
|
2
2
|
export { assertPageConfigGlobalSerialized };
|
|
3
|
-
import { assert, isObject, hasProp } from '
|
|
3
|
+
import { assert, isObject, hasProp } from '../../utils.js';
|
|
4
4
|
function assertPageConfigsSerialized(pageConfigsSerialized) {
|
|
5
5
|
assert(Array.isArray(pageConfigsSerialized));
|
|
6
6
|
pageConfigsSerialized.forEach((pageConfigSerialized) => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { parseConfigValuesImported };
|
|
2
|
-
import type {
|
|
2
|
+
import type { ConfigValues } from '../PageConfig.js';
|
|
3
|
+
import type { ConfigValueImported } from './PageConfigSerialized.js';
|
|
3
4
|
declare function parseConfigValuesImported(configValuesImported: ConfigValueImported[]): ConfigValues;
|