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.
@@ -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
- `${filePathToShowToUser} uses the config ${picocolors_1.default.cyan(configName)} (https://vike.dev/${configName})`,
858
- `which requires the Vike extension ${requiredVikeExtension.map((e) => picocolors_1.default.bold(e)).join('/')}.`,
859
- `Make sure to install the Vike extension,`,
860
- `and make sure it applies to ${filePathToShowToUser} as explained at https://vike.dev/extends#inheritance.`
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
- let errMsg = `${filePathToShowToUser} sets an unknown config ${picocolors_1.default.cyan(configName)}`;
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 += `, did you mean to set ${picocolors_1.default.cyan(configNameSimilar)} instead?`;
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 usually defines a UI component: a ubiquitous JavaScript convention is to start the name of UI components with a capital letter.)`;
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) {
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PROJECT_VERSION = void 0;
4
4
  // Automatically updated by @brillout/release-me
5
- exports.PROJECT_VERSION = '0.4.197-commit-6410424';
5
+ exports.PROJECT_VERSION = '0.4.197-commit-1251ed9';
@@ -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
- `${filePathToShowToUser} uses the config ${pc.cyan(configName)} (https://vike.dev/${configName})`,
852
- `which requires the Vike extension ${requiredVikeExtension.map((e) => pc.bold(e)).join('/')}.`,
853
- `Make sure to install the Vike extension,`,
854
- `and make sure it applies to ${filePathToShowToUser} as explained at https://vike.dev/extends#inheritance.`
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
- let errMsg = `${filePathToShowToUser} sets an unknown config ${pc.cyan(configName)}`;
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 += `, did you mean to set ${pc.cyan(configNameSimilar)} instead?`;
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 usually defines a UI component: a ubiquitous JavaScript convention is to start the name of UI components with a capital letter.)`;
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-6410424";
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-6410424';
2
+ export const PROJECT_VERSION = '0.4.197-commit-1251ed9';
@@ -1,4 +1,4 @@
1
1
  export declare const projectInfo: {
2
2
  projectName: "Vike";
3
- projectVersion: "0.4.197-commit-6410424";
3
+ projectVersion: "0.4.197-commit-1251ed9";
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike",
3
- "version": "0.4.197-commit-6410424",
3
+ "version": "0.4.197-commit-1251ed9",
4
4
  "repository": "https://github.com/vikejs/vike",
5
5
  "exports": {
6
6
  "./server": {