vike 0.4.167-commit-14e4b5e → 0.4.167-commit-c08a6bb
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/importUserCode/v1-design/getVikeConfig.js +26 -7
- package/dist/cjs/utils/projectInfo.js +1 -1
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +26 -7
- package/dist/esm/utils/projectInfo.d.ts +2 -2
- package/dist/esm/utils/projectInfo.js +1 -1
- package/package.json +1 -1
|
@@ -781,7 +781,30 @@ function assertNoUnexpectedPlusSign(filePath: string, fileName: string) {
|
|
|
781
781
|
}
|
|
782
782
|
*/
|
|
783
783
|
function handleUnknownConfig(configName, configNames, filePathToShowToUser) {
|
|
784
|
-
|
|
784
|
+
{
|
|
785
|
+
const ui = ['vike-react', 'vike-vue', 'vike-solid'];
|
|
786
|
+
const knownVikeExntensionConfigs = {
|
|
787
|
+
description: ui,
|
|
788
|
+
favicon: ui,
|
|
789
|
+
Head: ui,
|
|
790
|
+
Layout: ui,
|
|
791
|
+
onCreateApp: ['vike-vue'],
|
|
792
|
+
title: ui,
|
|
793
|
+
ssr: ui,
|
|
794
|
+
stream: ui,
|
|
795
|
+
Wrapper: ui
|
|
796
|
+
};
|
|
797
|
+
if (configName in knownVikeExntensionConfigs) {
|
|
798
|
+
const requiredVikeExtension = knownVikeExntensionConfigs[configName];
|
|
799
|
+
(0, utils_js_1.assertUsage)(false, [
|
|
800
|
+
`${filePathToShowToUser} uses the config ${picocolors_1.default.cyan(configName)} (https://vike.dev/${configName})`,
|
|
801
|
+
`which requires the Vike extension ${requiredVikeExtension.map((e) => picocolors_1.default.bold(e)).join('/')}.`,
|
|
802
|
+
`Make sure to install the Vike extension,`,
|
|
803
|
+
`and make sure it applies to ${filePathToShowToUser} as explained at https://vike.dev/extends#inheritance.`
|
|
804
|
+
].join(' '));
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
let errMsg = `${filePathToShowToUser} sets an unknown config ${picocolors_1.default.cyan(configName)}`;
|
|
785
808
|
let configNameSimilar = null;
|
|
786
809
|
if (configName === 'page') {
|
|
787
810
|
configNameSimilar = 'Page';
|
|
@@ -789,17 +812,13 @@ function handleUnknownConfig(configName, configNames, filePathToShowToUser) {
|
|
|
789
812
|
else {
|
|
790
813
|
configNameSimilar = (0, utils_js_1.getMostSimilar)(configName, configNames);
|
|
791
814
|
}
|
|
792
|
-
if (configNameSimilar
|
|
793
|
-
(0, utils_js_1.assert)(configNameSimilar);
|
|
815
|
+
if (configNameSimilar) {
|
|
794
816
|
(0, utils_js_1.assert)(configNameSimilar !== configName);
|
|
795
|
-
errMsg += `, did you mean to
|
|
817
|
+
errMsg += `, did you mean to set ${picocolors_1.default.cyan(configNameSimilar)} instead?`;
|
|
796
818
|
if (configName === 'page') {
|
|
797
819
|
errMsg += ` (The name of the config ${picocolors_1.default.cyan('Page')} starts with a capital letter ${picocolors_1.default.cyan('P')} because it usually defines a UI component: a ubiquitous JavaScript convention is to start the name of UI components with a capital letter.)`;
|
|
798
820
|
}
|
|
799
821
|
}
|
|
800
|
-
else {
|
|
801
|
-
errMsg += `, you need to define the config ${picocolors_1.default.cyan(configName)} by using ${picocolors_1.default.cyan('config.meta')} https://vike.dev/meta`;
|
|
802
|
-
}
|
|
803
822
|
(0, utils_js_1.assertUsage)(false, errMsg);
|
|
804
823
|
}
|
|
805
824
|
function determineRouteFilesystem(locationId, configValueSources) {
|
|
@@ -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.167-commit-
|
|
4
|
+
const PROJECT_VERSION = '0.4.167-commit-c08a6bb';
|
|
5
5
|
exports.PROJECT_VERSION = PROJECT_VERSION;
|
|
6
6
|
const projectInfo = {
|
|
7
7
|
projectName: 'Vike',
|
|
@@ -776,7 +776,30 @@ function assertNoUnexpectedPlusSign(filePath: string, fileName: string) {
|
|
|
776
776
|
}
|
|
777
777
|
*/
|
|
778
778
|
function handleUnknownConfig(configName, configNames, filePathToShowToUser) {
|
|
779
|
-
|
|
779
|
+
{
|
|
780
|
+
const ui = ['vike-react', 'vike-vue', 'vike-solid'];
|
|
781
|
+
const knownVikeExntensionConfigs = {
|
|
782
|
+
description: ui,
|
|
783
|
+
favicon: ui,
|
|
784
|
+
Head: ui,
|
|
785
|
+
Layout: ui,
|
|
786
|
+
onCreateApp: ['vike-vue'],
|
|
787
|
+
title: ui,
|
|
788
|
+
ssr: ui,
|
|
789
|
+
stream: ui,
|
|
790
|
+
Wrapper: ui
|
|
791
|
+
};
|
|
792
|
+
if (configName in knownVikeExntensionConfigs) {
|
|
793
|
+
const requiredVikeExtension = knownVikeExntensionConfigs[configName];
|
|
794
|
+
assertUsage(false, [
|
|
795
|
+
`${filePathToShowToUser} uses the config ${pc.cyan(configName)} (https://vike.dev/${configName})`,
|
|
796
|
+
`which requires the Vike extension ${requiredVikeExtension.map((e) => pc.bold(e)).join('/')}.`,
|
|
797
|
+
`Make sure to install the Vike extension,`,
|
|
798
|
+
`and make sure it applies to ${filePathToShowToUser} as explained at https://vike.dev/extends#inheritance.`
|
|
799
|
+
].join(' '));
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
let errMsg = `${filePathToShowToUser} sets an unknown config ${pc.cyan(configName)}`;
|
|
780
803
|
let configNameSimilar = null;
|
|
781
804
|
if (configName === 'page') {
|
|
782
805
|
configNameSimilar = 'Page';
|
|
@@ -784,17 +807,13 @@ function handleUnknownConfig(configName, configNames, filePathToShowToUser) {
|
|
|
784
807
|
else {
|
|
785
808
|
configNameSimilar = getMostSimilar(configName, configNames);
|
|
786
809
|
}
|
|
787
|
-
if (configNameSimilar
|
|
788
|
-
assert(configNameSimilar);
|
|
810
|
+
if (configNameSimilar) {
|
|
789
811
|
assert(configNameSimilar !== configName);
|
|
790
|
-
errMsg += `, did you mean to
|
|
812
|
+
errMsg += `, did you mean to set ${pc.cyan(configNameSimilar)} instead?`;
|
|
791
813
|
if (configName === 'page') {
|
|
792
814
|
errMsg += ` (The name of the config ${pc.cyan('Page')} starts with a capital letter ${pc.cyan('P')} because it usually defines a UI component: a ubiquitous JavaScript convention is to start the name of UI components with a capital letter.)`;
|
|
793
815
|
}
|
|
794
816
|
}
|
|
795
|
-
else {
|
|
796
|
-
errMsg += `, you need to define the config ${pc.cyan(configName)} by using ${pc.cyan('config.meta')} https://vike.dev/meta`;
|
|
797
|
-
}
|
|
798
817
|
assertUsage(false, errMsg);
|
|
799
818
|
}
|
|
800
819
|
function determineRouteFilesystem(locationId, configValueSources) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { projectInfo };
|
|
2
2
|
export { PROJECT_VERSION };
|
|
3
|
-
declare const PROJECT_VERSION: "0.4.167-commit-
|
|
3
|
+
declare const PROJECT_VERSION: "0.4.167-commit-c08a6bb";
|
|
4
4
|
declare const projectInfo: {
|
|
5
5
|
projectName: "Vike";
|
|
6
|
-
projectVersion: "0.4.167-commit-
|
|
6
|
+
projectVersion: "0.4.167-commit-c08a6bb";
|
|
7
7
|
};
|