vike 0.4.197-commit-6410424 → 0.4.197-commit-1251ed9
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 +16 -7
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/client/client-routing-runtime/prefetch.js +3 -1
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +16 -7
- 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 +1 -1
|
@@ -838,6 +838,9 @@ function assertNoUnexpectedPlusSign(filePath: string, fileName: string) {
|
|
|
838
838
|
}
|
|
839
839
|
*/
|
|
840
840
|
function handleUnknownConfig(configName, configNames, filePathToShowToUser) {
|
|
841
|
+
const configNameColored = picocolors_1.default.cyan(configName);
|
|
842
|
+
let errMsg = `${filePathToShowToUser} sets an unknown config ${configNameColored}.`;
|
|
843
|
+
// vike-{react,vue,solid} hint
|
|
841
844
|
{
|
|
842
845
|
const ui = ['vike-react', 'vike-vue', 'vike-solid'];
|
|
843
846
|
const knownVikeExntensionConfigs = {
|
|
@@ -854,14 +857,16 @@ function handleUnknownConfig(configName, configNames, filePathToShowToUser) {
|
|
|
854
857
|
if (configName in knownVikeExntensionConfigs) {
|
|
855
858
|
const requiredVikeExtension = knownVikeExntensionConfigs[configName];
|
|
856
859
|
(0, utils_js_1.assertUsage)(false, [
|
|
857
|
-
|
|
858
|
-
`
|
|
859
|
-
|
|
860
|
-
|
|
860
|
+
errMsg,
|
|
861
|
+
`If you want to use the configuration documented at https://vike.dev/${configName} then make sure to install the Vike extension ${requiredVikeExtension
|
|
862
|
+
.map((e) => picocolors_1.default.bold(e))
|
|
863
|
+
.join('/')}.`,
|
|
864
|
+
`Also make sure it applies to ${filePathToShowToUser} (see https://vike.dev/extends#inheritance).`,
|
|
865
|
+
`Alternatively, if you don't want to use the aforementioned Vike extension, define it yourself by using ${picocolors_1.default.cyan('meta')} (https://vike.dev/meta).`
|
|
861
866
|
].join(' '));
|
|
862
867
|
}
|
|
863
868
|
}
|
|
864
|
-
|
|
869
|
+
// Similarity hint
|
|
865
870
|
let configNameSimilar = null;
|
|
866
871
|
if (configName === 'page') {
|
|
867
872
|
configNameSimilar = 'Page';
|
|
@@ -871,11 +876,15 @@ function handleUnknownConfig(configName, configNames, filePathToShowToUser) {
|
|
|
871
876
|
}
|
|
872
877
|
if (configNameSimilar) {
|
|
873
878
|
(0, utils_js_1.assert)(configNameSimilar !== configName);
|
|
874
|
-
errMsg +=
|
|
879
|
+
errMsg += ` Did you mean to set ${picocolors_1.default.cyan(configNameSimilar)} instead?`;
|
|
875
880
|
if (configName === 'page') {
|
|
876
|
-
errMsg += ` (The name of the config ${picocolors_1.default.cyan('Page')} starts with a capital letter ${picocolors_1.default.cyan('P')} because it
|
|
881
|
+
errMsg += ` (The name of the config ${picocolors_1.default.cyan('Page')} starts with a capital letter ${picocolors_1.default.cyan('P')} because it defines a UI component: a ubiquitous JavaScript convention is that the name of UI components start with a capital letter.)`;
|
|
877
882
|
}
|
|
878
883
|
}
|
|
884
|
+
// `meta` hint
|
|
885
|
+
if (!configNameSimilar) {
|
|
886
|
+
errMsg += ` Make sure to define ${configNameColored} by using ${picocolors_1.default.cyan('meta')} (https://vike.dev/meta), and also make sure the meta configuration applies to ${filePathToShowToUser} (see https://vike.dev/config#inheritance).`;
|
|
887
|
+
}
|
|
879
888
|
(0, utils_js_1.assertUsage)(false, errMsg);
|
|
880
889
|
}
|
|
881
890
|
function determineRouteFilesystem(locationId, configValueSources) {
|
|
@@ -187,8 +187,10 @@ async function prefetchOnEvent(linkTag, event) {
|
|
|
187
187
|
// TODO/pageContext-prefetch: remove this dirty hack used by @brillout/docpress and, instead, use Vike's default if pageContextCurrent isn't defined yet.
|
|
188
188
|
prefetchSettings = { staticAssets: 'hover', pageContext: Infinity };
|
|
189
189
|
}
|
|
190
|
+
// Check again in case DOM was manipulated since last check
|
|
191
|
+
if (skipLink(linkTag))
|
|
192
|
+
return;
|
|
190
193
|
const urlOfLink = linkTag.getAttribute('href');
|
|
191
|
-
assert(urlOfLink);
|
|
192
194
|
const pageContextLink = await getPageContextLink(urlOfLink);
|
|
193
195
|
if (!pageContextLink?.pageId)
|
|
194
196
|
return;
|
|
@@ -832,6 +832,9 @@ function assertNoUnexpectedPlusSign(filePath: string, fileName: string) {
|
|
|
832
832
|
}
|
|
833
833
|
*/
|
|
834
834
|
function handleUnknownConfig(configName, configNames, filePathToShowToUser) {
|
|
835
|
+
const configNameColored = pc.cyan(configName);
|
|
836
|
+
let errMsg = `${filePathToShowToUser} sets an unknown config ${configNameColored}.`;
|
|
837
|
+
// vike-{react,vue,solid} hint
|
|
835
838
|
{
|
|
836
839
|
const ui = ['vike-react', 'vike-vue', 'vike-solid'];
|
|
837
840
|
const knownVikeExntensionConfigs = {
|
|
@@ -848,14 +851,16 @@ function handleUnknownConfig(configName, configNames, filePathToShowToUser) {
|
|
|
848
851
|
if (configName in knownVikeExntensionConfigs) {
|
|
849
852
|
const requiredVikeExtension = knownVikeExntensionConfigs[configName];
|
|
850
853
|
assertUsage(false, [
|
|
851
|
-
|
|
852
|
-
`
|
|
853
|
-
|
|
854
|
-
|
|
854
|
+
errMsg,
|
|
855
|
+
`If you want to use the configuration documented at https://vike.dev/${configName} then make sure to install the Vike extension ${requiredVikeExtension
|
|
856
|
+
.map((e) => pc.bold(e))
|
|
857
|
+
.join('/')}.`,
|
|
858
|
+
`Also make sure it applies to ${filePathToShowToUser} (see https://vike.dev/extends#inheritance).`,
|
|
859
|
+
`Alternatively, if you don't want to use the aforementioned Vike extension, define it yourself by using ${pc.cyan('meta')} (https://vike.dev/meta).`
|
|
855
860
|
].join(' '));
|
|
856
861
|
}
|
|
857
862
|
}
|
|
858
|
-
|
|
863
|
+
// Similarity hint
|
|
859
864
|
let configNameSimilar = null;
|
|
860
865
|
if (configName === 'page') {
|
|
861
866
|
configNameSimilar = 'Page';
|
|
@@ -865,11 +870,15 @@ function handleUnknownConfig(configName, configNames, filePathToShowToUser) {
|
|
|
865
870
|
}
|
|
866
871
|
if (configNameSimilar) {
|
|
867
872
|
assert(configNameSimilar !== configName);
|
|
868
|
-
errMsg +=
|
|
873
|
+
errMsg += ` Did you mean to set ${pc.cyan(configNameSimilar)} instead?`;
|
|
869
874
|
if (configName === 'page') {
|
|
870
|
-
errMsg += ` (The name of the config ${pc.cyan('Page')} starts with a capital letter ${pc.cyan('P')} because it
|
|
875
|
+
errMsg += ` (The name of the config ${pc.cyan('Page')} starts with a capital letter ${pc.cyan('P')} because it defines a UI component: a ubiquitous JavaScript convention is that the name of UI components start with a capital letter.)`;
|
|
871
876
|
}
|
|
872
877
|
}
|
|
878
|
+
// `meta` hint
|
|
879
|
+
if (!configNameSimilar) {
|
|
880
|
+
errMsg += ` Make sure to define ${configNameColored} by using ${pc.cyan('meta')} (https://vike.dev/meta), and also make sure the meta configuration applies to ${filePathToShowToUser} (see https://vike.dev/config#inheritance).`;
|
|
881
|
+
}
|
|
873
882
|
assertUsage(false, errMsg);
|
|
874
883
|
}
|
|
875
884
|
function determineRouteFilesystem(locationId, configValueSources) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.197-commit-
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.197-commit-1251ed9";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.197-commit-
|
|
2
|
+
export const PROJECT_VERSION = '0.4.197-commit-1251ed9';
|