vike 0.4.176-commit-1442a4a → 0.4.177

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.
@@ -35,8 +35,8 @@ function warnMissingErrorPage(isV1) {
35
35
  if (!globalContext.isProduction) {
36
36
  const msg = [
37
37
  `No ${isV1 ? 'error page' : picocolors_1.default.cyan('_error.page.js')} found,`,
38
- 'we recommend defining an error page,',
39
- 'see https://vike.dev/error-page'
38
+ 'we recommend defining one',
39
+ 'https://vike.dev/error-page'
40
40
  ].join(' ');
41
41
  (0, utils_js_1.assertWarning)(false, msg, { onlyOnce: true });
42
42
  }
@@ -1,4 +1,7 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.onAssertModuleLoad = exports.onClientEntry_ClientRouting = exports.onClientEntry_ServerRouting = void 0;
4
7
  // - Throw error if there are two different versions of vike loaded
@@ -7,6 +10,7 @@ exports.onAssertModuleLoad = exports.onClientEntry_ClientRouting = exports.onCli
7
10
  const unique_js_1 = require("./unique.js");
8
11
  const getGlobalObject_js_1 = require("./getGlobalObject.js");
9
12
  const projectInfo_js_1 = require("./projectInfo.js");
13
+ const picocolors_1 = __importDefault(require("@brillout/picocolors"));
10
14
  /* Use original assertUsage() & assertWarning() after all CJS is removed from node_modules/vike/dist/
11
15
  import { assertUsage, assertWarning } from './assert.js'
12
16
  */
@@ -21,7 +25,7 @@ function assertSingleInstance() {
21
25
  const versions = (0, unique_js_1.unique)(globalObject.instances);
22
26
  assertUsage(versions.length <= 1,
23
27
  // DO *NOT* patch vike to remove this error: because of multiple conflicting versions, you *will* eventually encounter insidious issues that hard to debug and potentially a security hazard, see for example https://github.com/vikejs/vike/issues/1108
24
- `Both vike@${versions[0]} and vike@${versions[1]} loaded. Only one version should be loaded.`);
28
+ `vike@${picocolors_1.default.bold(versions[0])} and vike@${picocolors_1.default.bold(versions[1])} loaded but only one version should be loaded`);
25
29
  }
26
30
  if (globalObject.checkSingleInstance && globalObject.instances.length > 1) {
27
31
  /*/ Not sure whether circular dependency can cause problems? In principle not since client-side code is ESM.
@@ -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.176-commit-1442a4a';
4
+ const PROJECT_VERSION = '0.4.177';
5
5
  exports.PROJECT_VERSION = PROJECT_VERSION;
6
6
  const projectInfo = {
7
7
  projectName: 'Vike',
@@ -29,8 +29,8 @@ function warnMissingErrorPage(isV1) {
29
29
  if (!globalContext.isProduction) {
30
30
  const msg = [
31
31
  `No ${isV1 ? 'error page' : pc.cyan('_error.page.js')} found,`,
32
- 'we recommend defining an error page,',
33
- 'see https://vike.dev/error-page'
32
+ 'we recommend defining one',
33
+ 'https://vike.dev/error-page'
34
34
  ].join(' ');
35
35
  assertWarning(false, msg, { onlyOnce: true });
36
36
  }
@@ -67,9 +67,9 @@ type ConfigEnv = {
67
67
  /** For Vike internal use */
68
68
  type ConfigEnvInternal = Omit<ConfigEnv, 'client'> & {
69
69
  client?: boolean | 'if-client-routing';
70
- /** Always load value, not matter what page is loaded. */
71
- eager?: boolean;
72
- /** Load value only in production or only in development. */
70
+ /** Always load value, no matter which page is loaded. */
71
+ eager?: true;
72
+ /** Load value only in production, or only in development. */
73
73
  production?: boolean;
74
74
  };
75
75
  type ConfigValueSource = {
@@ -7,6 +7,7 @@ export { onAssertModuleLoad };
7
7
  import { unique } from './unique.js';
8
8
  import { getGlobalObject } from './getGlobalObject.js';
9
9
  import { projectInfo } from './projectInfo.js';
10
+ import pc from '@brillout/picocolors';
10
11
  /* Use original assertUsage() & assertWarning() after all CJS is removed from node_modules/vike/dist/
11
12
  import { assertUsage, assertWarning } from './assert.js'
12
13
  */
@@ -21,7 +22,7 @@ function assertSingleInstance() {
21
22
  const versions = unique(globalObject.instances);
22
23
  assertUsage(versions.length <= 1,
23
24
  // DO *NOT* patch vike to remove this error: because of multiple conflicting versions, you *will* eventually encounter insidious issues that hard to debug and potentially a security hazard, see for example https://github.com/vikejs/vike/issues/1108
24
- `Both vike@${versions[0]} and vike@${versions[1]} loaded. Only one version should be loaded.`);
25
+ `vike@${pc.bold(versions[0])} and vike@${pc.bold(versions[1])} loaded but only one version should be loaded`);
25
26
  }
26
27
  if (globalObject.checkSingleInstance && globalObject.instances.length > 1) {
27
28
  /*/ Not sure whether circular dependency can cause problems? In principle not since client-side code is ESM.
@@ -1,7 +1,7 @@
1
1
  export { projectInfo };
2
2
  export { PROJECT_VERSION };
3
- declare const PROJECT_VERSION: "0.4.176-commit-1442a4a";
3
+ declare const PROJECT_VERSION: "0.4.177";
4
4
  declare const projectInfo: {
5
5
  projectName: "Vike";
6
- projectVersion: "0.4.176-commit-1442a4a";
6
+ projectVersion: "0.4.177";
7
7
  };
@@ -1,6 +1,6 @@
1
1
  export { projectInfo };
2
2
  export { PROJECT_VERSION };
3
- const PROJECT_VERSION = '0.4.176-commit-1442a4a';
3
+ const PROJECT_VERSION = '0.4.177';
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.176-commit-1442a4a",
3
+ "version": "0.4.177",
4
4
  "scripts": {
5
5
  "dev": "tsc --watch",
6
6
  "build": "rimraf dist/ && pnpm run build:esm && pnpm run build:cjs",