vike 0.4.172-commit-24e2d90 → 0.4.172-commit-1b7b761

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.
@@ -21,7 +21,7 @@ function assertConfigExportPath(interfaceFile) {
21
21
  const name = getConfigNameValue(interfaceFile);
22
22
  (0, utils_js_1.assert)(name); // already asserted in assertExtensionName()
23
23
  const importPathAbsoluteExpected = `${name}/config`;
24
- (0, utils_js_1.assertWarning)(importPathAbsolute === importPathAbsoluteExpected, `The Vike configuration of ${picocolors_1.default.bold(name)} is exported at ${picocolors_1.default.bold(importPathAbsolute)} but it should be exported at ${picocolors_1.default.bold(importPathAbsoluteExpected)} instead.`, { onlyOnce: true });
24
+ (0, utils_js_1.assertWarning)(importPathAbsolute === importPathAbsoluteExpected, `The Vike configuration of ${picocolors_1.default.bold(name)} is exported at ${picocolors_1.default.bold(importPathAbsolute)}, but it should be exported at ${picocolors_1.default.bold(importPathAbsoluteExpected)} instead.`, { onlyOnce: true });
25
25
  }
26
26
  function assertExtensionName(interfaceFile) {
27
27
  let nameDeduced;
@@ -36,7 +36,7 @@ function assertExtensionName(interfaceFile) {
36
36
  const name = getConfigNameValue(interfaceFile);
37
37
  const filePathToShowToUser = getFilePathToShowToUser(interfaceFile);
38
38
  if (name) {
39
- (0, utils_js_1.assertWarning)(name === nameDeduced, `The setting ${picocolors_1.default.bold('name')} defined at ${filePathToShowToUser} is ${picocolors_1.default.bold(name)} but it should be ${picocolors_1.default.bold(nameDeduced)} instead (the name of the npm package).`, { onlyOnce: true });
39
+ (0, utils_js_1.assertWarning)(name === nameDeduced, `The setting ${picocolors_1.default.bold('name')} defined at ${filePathToShowToUser} is ${picocolors_1.default.bold(name)}, but it should be ${picocolors_1.default.bold(nameDeduced)} instead (the name of the npm package).`, { onlyOnce: true });
40
40
  }
41
41
  else {
42
42
  if (
@@ -79,11 +79,12 @@ function assertExtensionsPeerDependencies(interfaceFilesRelevantList) {
79
79
  Object.entries(require).forEach(([reqName, reqVersion]) => {
80
80
  const errBase = `${picocolors_1.default.bold(name)} requires ${picocolors_1.default.bold(reqName)}`;
81
81
  if (reqName === 'vike') {
82
- (0, utils_js_1.assertUsage)(isVersionRange(utils_js_1.PROJECT_VERSION, reqVersion), `${errBase} version ${picocolors_1.default.bold(reqVersion)} but ${picocolors_1.default.bold(utils_js_1.PROJECT_VERSION)} is installed.`);
82
+ (0, utils_js_1.assertUsage)(isVersionRange(utils_js_1.PROJECT_VERSION, reqVersion), `${errBase} version ${picocolors_1.default.bold(reqVersion)}, but ${picocolors_1.default.bold(utils_js_1.PROJECT_VERSION)} is installed.`);
83
+ return;
83
84
  }
84
85
  const extensionVersion = extensions[reqName];
85
86
  (0, utils_js_1.assertUsage)(extensionVersion, `${errBase}.`);
86
- (0, utils_js_1.assertUsage)(isVersionRange(extensionVersion, reqVersion), `${errBase} version ${picocolors_1.default.bold(reqVersion)} but ${picocolors_1.default.bold(extensionVersion)} is installed.`);
87
+ (0, utils_js_1.assertUsage)(isVersionRange(extensionVersion, reqVersion), `${errBase} version ${picocolors_1.default.bold(reqVersion)}, but ${picocolors_1.default.bold(extensionVersion)} is installed.`);
87
88
  });
88
89
  });
89
90
  }
@@ -115,7 +116,7 @@ function getExtensionVersion(name, interfaceFile) {
115
116
  const { packageJson, packageJsonPath } = found;
116
117
  const filePathToShowToUser = getFilePathToShowToUser(interfaceFile);
117
118
  const nameExpected = packageJson.name;
118
- (0, utils_js_1.assertWarning)(name === nameExpected, `The setting ${picocolors_1.default.bold('name')} defined at ${filePathToShowToUser} is ${picocolors_1.default.bold(JSON.stringify(name))} but it should be equal to ${picocolors_1.default.bold(JSON.stringify(nameExpected))} (the value of ${packageJsonPath}${picocolors_1.default.dim('#')}${picocolors_1.default.bold('name')})`, { onlyOnce: true });
119
+ (0, utils_js_1.assertWarning)(name === nameExpected, `The setting ${picocolors_1.default.bold('name')} defined at ${filePathToShowToUser} is ${picocolors_1.default.bold(JSON.stringify(name))}, but it should be equal to ${picocolors_1.default.bold(JSON.stringify(nameExpected))} (the value of ${packageJsonPath}${picocolors_1.default.dim('#')}${picocolors_1.default.bold('name')})`, { onlyOnce: true });
119
120
  const { version } = packageJson;
120
121
  (0, utils_js_1.assert)(typeof version === 'string');
121
122
  extensionsVersion[name] = version;
@@ -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.172-commit-24e2d90';
4
+ const PROJECT_VERSION = '0.4.172-commit-1b7b761';
5
5
  exports.PROJECT_VERSION = PROJECT_VERSION;
6
6
  const projectInfo = {
7
7
  projectName: 'Vike',
@@ -16,7 +16,7 @@ function assertConfigExportPath(interfaceFile) {
16
16
  const name = getConfigNameValue(interfaceFile);
17
17
  assert(name); // already asserted in assertExtensionName()
18
18
  const importPathAbsoluteExpected = `${name}/config`;
19
- assertWarning(importPathAbsolute === importPathAbsoluteExpected, `The Vike configuration of ${pc.bold(name)} is exported at ${pc.bold(importPathAbsolute)} but it should be exported at ${pc.bold(importPathAbsoluteExpected)} instead.`, { onlyOnce: true });
19
+ assertWarning(importPathAbsolute === importPathAbsoluteExpected, `The Vike configuration of ${pc.bold(name)} is exported at ${pc.bold(importPathAbsolute)}, but it should be exported at ${pc.bold(importPathAbsoluteExpected)} instead.`, { onlyOnce: true });
20
20
  }
21
21
  function assertExtensionName(interfaceFile) {
22
22
  let nameDeduced;
@@ -31,7 +31,7 @@ function assertExtensionName(interfaceFile) {
31
31
  const name = getConfigNameValue(interfaceFile);
32
32
  const filePathToShowToUser = getFilePathToShowToUser(interfaceFile);
33
33
  if (name) {
34
- assertWarning(name === nameDeduced, `The setting ${pc.bold('name')} defined at ${filePathToShowToUser} is ${pc.bold(name)} but it should be ${pc.bold(nameDeduced)} instead (the name of the npm package).`, { onlyOnce: true });
34
+ assertWarning(name === nameDeduced, `The setting ${pc.bold('name')} defined at ${filePathToShowToUser} is ${pc.bold(name)}, but it should be ${pc.bold(nameDeduced)} instead (the name of the npm package).`, { onlyOnce: true });
35
35
  }
36
36
  else {
37
37
  if (
@@ -74,11 +74,12 @@ function assertExtensionsPeerDependencies(interfaceFilesRelevantList) {
74
74
  Object.entries(require).forEach(([reqName, reqVersion]) => {
75
75
  const errBase = `${pc.bold(name)} requires ${pc.bold(reqName)}`;
76
76
  if (reqName === 'vike') {
77
- assertUsage(isVersionRange(PROJECT_VERSION, reqVersion), `${errBase} version ${pc.bold(reqVersion)} but ${pc.bold(PROJECT_VERSION)} is installed.`);
77
+ assertUsage(isVersionRange(PROJECT_VERSION, reqVersion), `${errBase} version ${pc.bold(reqVersion)}, but ${pc.bold(PROJECT_VERSION)} is installed.`);
78
+ return;
78
79
  }
79
80
  const extensionVersion = extensions[reqName];
80
81
  assertUsage(extensionVersion, `${errBase}.`);
81
- assertUsage(isVersionRange(extensionVersion, reqVersion), `${errBase} version ${pc.bold(reqVersion)} but ${pc.bold(extensionVersion)} is installed.`);
82
+ assertUsage(isVersionRange(extensionVersion, reqVersion), `${errBase} version ${pc.bold(reqVersion)}, but ${pc.bold(extensionVersion)} is installed.`);
82
83
  });
83
84
  });
84
85
  }
@@ -109,7 +110,7 @@ function getExtensionVersion(name, interfaceFile) {
109
110
  const { packageJson, packageJsonPath } = found;
110
111
  const filePathToShowToUser = getFilePathToShowToUser(interfaceFile);
111
112
  const nameExpected = packageJson.name;
112
- assertWarning(name === nameExpected, `The setting ${pc.bold('name')} defined at ${filePathToShowToUser} is ${pc.bold(JSON.stringify(name))} but it should be equal to ${pc.bold(JSON.stringify(nameExpected))} (the value of ${packageJsonPath}${pc.dim('#')}${pc.bold('name')})`, { onlyOnce: true });
113
+ assertWarning(name === nameExpected, `The setting ${pc.bold('name')} defined at ${filePathToShowToUser} is ${pc.bold(JSON.stringify(name))}, but it should be equal to ${pc.bold(JSON.stringify(nameExpected))} (the value of ${packageJsonPath}${pc.dim('#')}${pc.bold('name')})`, { onlyOnce: true });
113
114
  const { version } = packageJson;
114
115
  assert(typeof version === 'string');
115
116
  extensionsVersion[name] = version;
@@ -1,8 +1,11 @@
1
1
  export type { PageContextConfig };
2
2
  import type { VikePackages } from '../../VikeNamespace.js';
3
- import type { ConfigBuiltIn } from '../Config.js';
3
+ import type { ConfigBuiltIn, ImportString } from '../Config.js';
4
4
  import type { Combine, IsNotEmpty, XOR5 } from './helpers.js';
5
- type PageContextConfig = ConfigBuiltIn & Vike.ConfigResolved & Omit<Vike.Config, keyof Vike.ConfigResolved> & (ConfigVikePackagesNotEmptyXor extends true ? ConfigVikePackagesIntersection : ConfigVikePackagesCombined);
5
+ type WithoutImportString<T> = {
6
+ [K in keyof T]: Exclude<T[K], ImportString>;
7
+ };
8
+ type PageContextConfig = ConfigBuiltIn & Vike.ConfigResolved & WithoutImportString<Omit<Vike.Config, keyof Vike.ConfigResolved>> & (ConfigVikePackagesNotEmptyXor extends true ? ConfigVikePackagesIntersection : ConfigVikePackagesCombined);
6
9
  type ConfigVikePackagesIntersection = VikePackages.ConfigVikeReact & VikePackages.ConfigVikeVue & VikePackages.ConfigVikeSolid & VikePackages.ConfigVikeSvelte & VikePackages.ConfigVikeAngular;
7
10
  type ConfigVikePackagesCombined = Combine<VikePackages.ConfigVikeReact, Combine<VikePackages.ConfigVikeVue, Combine<VikePackages.ConfigVikeSolid, Combine<VikePackages.ConfigVikeSvelte, VikePackages.ConfigVikeAngular>>>>;
8
11
  type ConfigVikePackagesNotEmptyXor = XOR5<IsNotEmpty<VikePackages.ConfigVikeReact>, IsNotEmpty<VikePackages.ConfigVikeVue>, IsNotEmpty<VikePackages.ConfigVikeSolid>, IsNotEmpty<VikePackages.ConfigVikeSvelte>, IsNotEmpty<VikePackages.ConfigVikeAngular>>;
@@ -1,7 +1,7 @@
1
1
  export { projectInfo };
2
2
  export { PROJECT_VERSION };
3
- declare const PROJECT_VERSION: "0.4.172-commit-24e2d90";
3
+ declare const PROJECT_VERSION: "0.4.172-commit-1b7b761";
4
4
  declare const projectInfo: {
5
5
  projectName: "Vike";
6
- projectVersion: "0.4.172-commit-24e2d90";
6
+ projectVersion: "0.4.172-commit-1b7b761";
7
7
  };
@@ -1,6 +1,6 @@
1
1
  export { projectInfo };
2
2
  export { PROJECT_VERSION };
3
- const PROJECT_VERSION = '0.4.172-commit-24e2d90';
3
+ const PROJECT_VERSION = '0.4.172-commit-1b7b761';
4
4
  const projectInfo = {
5
5
  projectName: 'Vike',
6
6
  projectVersion: PROJECT_VERSION
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike",
3
- "version": "0.4.172-commit-24e2d90",
3
+ "version": "0.4.172-commit-1b7b761",
4
4
  "scripts": {
5
5
  "dev": "tsc --watch",
6
6
  "build": "rimraf dist/ && pnpm run build:esm && pnpm run build:cjs",