vike 0.4.223-commit-59f3966 → 0.4.223-commit-e239e2b
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/api/prepareViteApiCall.js +0 -1
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +22 -13
- package/dist/cjs/shared/page-configs/serialize/parsePageConfigs.js +3 -1
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/node/api/prepareViteApiCall.js +0 -1
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +22 -13
- package/dist/esm/shared/page-configs/serialize/parsePageConfigs.js +3 -1
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/utils/projectInfo.d.ts +1 -1
- package/package.json +2 -2
|
@@ -40,7 +40,6 @@ exports.prepareViteApiCall = prepareViteApiCall;
|
|
|
40
40
|
exports.getViteRoot = getViteRoot;
|
|
41
41
|
exports.assertViteRoot = assertViteRoot;
|
|
42
42
|
exports.normalizeViteRoot = normalizeViteRoot;
|
|
43
|
-
// TODO: enable Vike extensions to add Vite plugins
|
|
44
43
|
const vite_1 = require("vite");
|
|
45
44
|
const context_js_1 = require("./context.js");
|
|
46
45
|
const getVikeConfig_js_1 = require("../plugin/plugins/importUserCode/v1-design/getVikeConfig.js");
|
|
@@ -206,6 +206,7 @@ function getPageConfigsBuildTime(configDefinitionsResolved, plusFilesAll, userRo
|
|
|
206
206
|
return;
|
|
207
207
|
pageConfigGlobal.configValueSources[configName] = sources;
|
|
208
208
|
});
|
|
209
|
+
applyEffectsAll(pageConfigGlobal.configValueSources, configDefinitionsResolved.configDefinitionsGlobal);
|
|
209
210
|
assertPageConfigGlobal(pageConfigGlobal, plusFilesAll);
|
|
210
211
|
const pageConfigs = (0, utils_js_1.objectEntries)(configDefinitionsResolved.configDefinitionsLocal)
|
|
211
212
|
.filter(([_locationId, { plusFiles }]) => isDefiningPage(plusFiles))
|
|
@@ -679,7 +680,7 @@ function applyEffectsAll(configValueSources, configDefinitions) {
|
|
|
679
680
|
if (!source)
|
|
680
681
|
return;
|
|
681
682
|
// The config value is eagerly loaded since `configDef.env === 'config-only``
|
|
682
|
-
(0, utils_js_1.assert)('value' in source);
|
|
683
|
+
(0, utils_js_1.assert)('value' in source); // TODO/now: refactor all `'value' in`
|
|
683
684
|
// Call effect
|
|
684
685
|
const configModFromEffect = configDef.effect({
|
|
685
686
|
configValue: source.value,
|
|
@@ -687,12 +688,11 @@ function applyEffectsAll(configValueSources, configDefinitions) {
|
|
|
687
688
|
});
|
|
688
689
|
if (!configModFromEffect)
|
|
689
690
|
return;
|
|
690
|
-
(
|
|
691
|
-
applyEffect(configModFromEffect, configValueSources, configDef);
|
|
691
|
+
applyEffect(configModFromEffect, source, configValueSources, configName, configDef, configDefinitions);
|
|
692
692
|
});
|
|
693
693
|
}
|
|
694
|
-
function applyEffect(configModFromEffect, configValueSources, configDefEffect) {
|
|
695
|
-
const notSupported =
|
|
694
|
+
function applyEffect(configModFromEffect, source, configValueSources, configNameEffect, configDefEffect, configDefinitions) {
|
|
695
|
+
const notSupported = `${picocolors_1.default.cyan('meta.effect')} currently only supports setting the value of a config, or modifying the ${picocolors_1.default.cyan('meta.env')} of a config.`;
|
|
696
696
|
(0, utils_js_1.objectEntries)(configModFromEffect).forEach(([configName, configValue]) => {
|
|
697
697
|
if (configName === 'meta') {
|
|
698
698
|
let configDefinedAt;
|
|
@@ -718,14 +718,23 @@ function applyEffect(configModFromEffect, configValueSources, configDefEffect) {
|
|
|
718
718
|
});
|
|
719
719
|
}
|
|
720
720
|
else {
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
721
|
+
const configDef = configDefinitions[configName];
|
|
722
|
+
(0, utils_js_1.assert)(configDef);
|
|
723
|
+
(0, utils_js_1.assert)(configDefEffect._userEffectDefinedAtFilePath);
|
|
724
|
+
const configValueSource = {
|
|
725
|
+
definedAtFilePath: configDefEffect._userEffectDefinedAtFilePath,
|
|
726
|
+
plusFile: source.plusFile,
|
|
727
|
+
locationId: source.locationId,
|
|
728
|
+
configEnv: configDef.env,
|
|
729
|
+
isOverriden: false, // TODO/now check
|
|
730
|
+
valueIsLoadedWithImport: false,
|
|
731
|
+
valueIsDefinedByPlusValueFile: false,
|
|
732
|
+
valueIsLoaded: true,
|
|
733
|
+
value: configValue
|
|
734
|
+
};
|
|
735
|
+
(0, utils_js_1.assertUsage)(!!configDef.global === !!configDefEffect.global, `The configuration ${picocolors_1.default.cyan(configNameEffect)} has a ${picocolors_1.default.cyan('meta.effect')} that changes the configuration ${picocolors_1.default.cyan(configName)} and, consequently, both ${picocolors_1.default.cyan(configNameEffect)} and ${picocolors_1.default.cyan(configName)} must have the same ${picocolors_1.default.cyan('meta.global')} value.`);
|
|
736
|
+
configValueSources[configName] ?? (configValueSources[configName] = []);
|
|
737
|
+
configValueSources[configName].push(configValueSource);
|
|
729
738
|
}
|
|
730
739
|
});
|
|
731
740
|
}
|
|
@@ -66,7 +66,9 @@ function parseConfigValuesSerialized_tmp(configValuesSerialized) {
|
|
|
66
66
|
const { valueSerialized, ...common } = configValueSeriliazed;
|
|
67
67
|
const { value, sideExports } = parseValueSerialized(valueSerialized, configName, () => {
|
|
68
68
|
(0, utils_js_1.assert)(configValueSeriliazed.type !== 'computed');
|
|
69
|
-
|
|
69
|
+
const { definedAtData } = configValueSeriliazed;
|
|
70
|
+
const definedAtFile = Array.isArray(definedAtData) ? definedAtData[0] : definedAtData;
|
|
71
|
+
return definedAtFile;
|
|
70
72
|
});
|
|
71
73
|
addSideExports(sideExports);
|
|
72
74
|
configValue = { value, ...common };
|
|
@@ -2,7 +2,6 @@ export { prepareViteApiCall };
|
|
|
2
2
|
export { getViteRoot };
|
|
3
3
|
export { assertViteRoot };
|
|
4
4
|
export { normalizeViteRoot };
|
|
5
|
-
// TODO: enable Vike extensions to add Vite plugins
|
|
6
5
|
import { loadConfigFromFile, mergeConfig, resolveConfig } from 'vite';
|
|
7
6
|
import { clearContextApiOperation, setContextApiOperation } from './context.js';
|
|
8
7
|
import { getVikeConfig2 } from '../plugin/plugins/importUserCode/v1-design/getVikeConfig.js';
|
|
@@ -200,6 +200,7 @@ function getPageConfigsBuildTime(configDefinitionsResolved, plusFilesAll, userRo
|
|
|
200
200
|
return;
|
|
201
201
|
pageConfigGlobal.configValueSources[configName] = sources;
|
|
202
202
|
});
|
|
203
|
+
applyEffectsAll(pageConfigGlobal.configValueSources, configDefinitionsResolved.configDefinitionsGlobal);
|
|
203
204
|
assertPageConfigGlobal(pageConfigGlobal, plusFilesAll);
|
|
204
205
|
const pageConfigs = objectEntries(configDefinitionsResolved.configDefinitionsLocal)
|
|
205
206
|
.filter(([_locationId, { plusFiles }]) => isDefiningPage(plusFiles))
|
|
@@ -673,7 +674,7 @@ function applyEffectsAll(configValueSources, configDefinitions) {
|
|
|
673
674
|
if (!source)
|
|
674
675
|
return;
|
|
675
676
|
// The config value is eagerly loaded since `configDef.env === 'config-only``
|
|
676
|
-
assert('value' in source);
|
|
677
|
+
assert('value' in source); // TODO/now: refactor all `'value' in`
|
|
677
678
|
// Call effect
|
|
678
679
|
const configModFromEffect = configDef.effect({
|
|
679
680
|
configValue: source.value,
|
|
@@ -681,12 +682,11 @@ function applyEffectsAll(configValueSources, configDefinitions) {
|
|
|
681
682
|
});
|
|
682
683
|
if (!configModFromEffect)
|
|
683
684
|
return;
|
|
684
|
-
|
|
685
|
-
applyEffect(configModFromEffect, configValueSources, configDef);
|
|
685
|
+
applyEffect(configModFromEffect, source, configValueSources, configName, configDef, configDefinitions);
|
|
686
686
|
});
|
|
687
687
|
}
|
|
688
|
-
function applyEffect(configModFromEffect, configValueSources, configDefEffect) {
|
|
689
|
-
const notSupported =
|
|
688
|
+
function applyEffect(configModFromEffect, source, configValueSources, configNameEffect, configDefEffect, configDefinitions) {
|
|
689
|
+
const notSupported = `${pc.cyan('meta.effect')} currently only supports setting the value of a config, or modifying the ${pc.cyan('meta.env')} of a config.`;
|
|
690
690
|
objectEntries(configModFromEffect).forEach(([configName, configValue]) => {
|
|
691
691
|
if (configName === 'meta') {
|
|
692
692
|
let configDefinedAt;
|
|
@@ -712,14 +712,23 @@ function applyEffect(configModFromEffect, configValueSources, configDefEffect) {
|
|
|
712
712
|
});
|
|
713
713
|
}
|
|
714
714
|
else {
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
715
|
+
const configDef = configDefinitions[configName];
|
|
716
|
+
assert(configDef);
|
|
717
|
+
assert(configDefEffect._userEffectDefinedAtFilePath);
|
|
718
|
+
const configValueSource = {
|
|
719
|
+
definedAtFilePath: configDefEffect._userEffectDefinedAtFilePath,
|
|
720
|
+
plusFile: source.plusFile,
|
|
721
|
+
locationId: source.locationId,
|
|
722
|
+
configEnv: configDef.env,
|
|
723
|
+
isOverriden: false, // TODO/now check
|
|
724
|
+
valueIsLoadedWithImport: false,
|
|
725
|
+
valueIsDefinedByPlusValueFile: false,
|
|
726
|
+
valueIsLoaded: true,
|
|
727
|
+
value: configValue
|
|
728
|
+
};
|
|
729
|
+
assertUsage(!!configDef.global === !!configDefEffect.global, `The configuration ${pc.cyan(configNameEffect)} has a ${pc.cyan('meta.effect')} that changes the configuration ${pc.cyan(configName)} and, consequently, both ${pc.cyan(configNameEffect)} and ${pc.cyan(configName)} must have the same ${pc.cyan('meta.global')} value.`);
|
|
730
|
+
configValueSources[configName] ?? (configValueSources[configName] = []);
|
|
731
|
+
configValueSources[configName].push(configValueSource);
|
|
723
732
|
}
|
|
724
733
|
});
|
|
725
734
|
}
|
|
@@ -64,7 +64,9 @@ function parseConfigValuesSerialized_tmp(configValuesSerialized) {
|
|
|
64
64
|
const { valueSerialized, ...common } = configValueSeriliazed;
|
|
65
65
|
const { value, sideExports } = parseValueSerialized(valueSerialized, configName, () => {
|
|
66
66
|
assert(configValueSeriliazed.type !== 'computed');
|
|
67
|
-
|
|
67
|
+
const { definedAtData } = configValueSeriliazed;
|
|
68
|
+
const definedAtFile = Array.isArray(definedAtData) ? definedAtData[0] : definedAtData;
|
|
69
|
+
return definedAtFile;
|
|
68
70
|
});
|
|
69
71
|
addSideExports(sideExports);
|
|
70
72
|
configValue = { value, ...common };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.223-commit-
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.223-commit-e239e2b";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.223-commit-
|
|
2
|
+
export const PROJECT_VERSION = '0.4.223-commit-e239e2b';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vike",
|
|
3
|
-
"version": "0.4.223-commit-
|
|
3
|
+
"version": "0.4.223-commit-e239e2b",
|
|
4
4
|
"repository": "https://github.com/vikejs/vike",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": {
|
|
@@ -252,7 +252,7 @@
|
|
|
252
252
|
"react-streaming": "^0.3.47",
|
|
253
253
|
"rimraf": "^5.0.5",
|
|
254
254
|
"typescript": "^5.7.3",
|
|
255
|
-
"vite": "^6.0
|
|
255
|
+
"vite": "^6.2.0"
|
|
256
256
|
},
|
|
257
257
|
"scripts": {
|
|
258
258
|
"dev": "tsc --watch",
|