vike 0.4.235-commit-d2ac38a → 0.4.236-commit-85d361d

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.
@@ -154,7 +154,9 @@ function setGlobalContext_isPrerendering() {
154
154
  globalObject.isPrerendering = true;
155
155
  setIsProduction(true);
156
156
  }
157
- function setGlobalContext_isProduction(isProduction, tolerateContraditction) {
157
+ function setGlobalContext_isProduction(isProduction, tolerateContraditction = false) {
158
+ if (debug.isActivated)
159
+ debug('setGlobalContext_isProduction()', { isProduction, tolerateContraditction });
158
160
  if (globalObject.isProduction === undefined) {
159
161
  setIsProduction(isProduction);
160
162
  }
@@ -12,7 +12,7 @@ const error_page_js_1 = require("../../../shared/error-page.js");
12
12
  const getHttpResponseBody_js_1 = require("./getHttpResponseBody.js");
13
13
  const getEarlyHints_js_1 = require("./getEarlyHints.js");
14
14
  const assertNoInfiniteHttpRedirect_js_1 = require("./createHttpResponse/assertNoInfiniteHttpRedirect.js");
15
- const getCacheControl_js_1 = require("./createHttpResponse/getCacheControl.js");
15
+ const getCacheControl_js_1 = require("./getCacheControl.js");
16
16
  async function createHttpResponsePage(htmlRender, renderHook, pageContext) {
17
17
  let statusCode = pageContext.abortStatusCode;
18
18
  if (!statusCode) {
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.cacheControlDisable = void 0;
4
4
  exports.getCacheControl = getCacheControl;
5
- const helpers_js_1 = require("../../../../shared/page-configs/helpers.js");
6
- const getConfigValueRuntime_js_1 = require("../../../../shared/page-configs/getConfigValueRuntime.js");
5
+ const helpers_js_1 = require("../../../shared/page-configs/helpers.js");
6
+ const getConfigValueRuntime_js_1 = require("../../../shared/page-configs/getConfigValueRuntime.js");
7
7
  const cacheControlDisable = 'no-store, max-age=0';
8
8
  exports.cacheControlDisable = cacheControlDisable;
9
9
  function getCacheControl(pageId, pageConfigs) {
@@ -11,20 +11,19 @@ const findPageConfig_js_1 = require("../../../shared/page-configs/findPageConfig
11
11
  const analyzePage_js_1 = require("./analyzePage.js");
12
12
  const loadConfigValues_js_1 = require("../../../shared/page-configs/loadConfigValues.js");
13
13
  const execHookServer_js_1 = require("./execHookServer.js");
14
- const getCacheControl_js_1 = require("./createHttpResponse/getCacheControl.js");
15
- // TODO/now: rename?
14
+ const getCacheControl_js_1 = require("./getCacheControl.js");
16
15
  async function loadPageConfigsLazyServerSideAndExecHook(pageContext) {
17
16
  const pageContextAddendum = await loadPageConfigsLazyServerSide(pageContext);
18
17
  (0, utils_js_1.objectAssign)(pageContext, pageContextAddendum);
19
18
  await (0, execHookServer_js_1.execHookServer)('onCreatePageContext', pageContext);
20
19
  return pageContext;
21
20
  }
22
- // TODO/now: rename?
21
+ // TODO/now: define new function resolveAfterLoad() ?
23
22
  async function loadPageConfigsLazyServerSide(pageContext) {
24
23
  const pageConfig = (0, findPageConfig_js_1.findPageConfig)(pageContext._globalContext._pageConfigs, pageContext.pageId); // Make pageConfig globally available as pageContext._pageConfig ?
25
24
  const globalContext = pageContext._globalContext;
26
25
  const [{ pageFilesLoaded, configPublicPageLazy }] = await Promise.all([
27
- loadPageUserFiles(pageContext._globalContext._pageFilesAll, pageConfig, globalContext._pageConfigGlobal, pageContext.pageId, !globalContext._isProduction),
26
+ loadPageConfigFiles(pageContext._globalContext._pageFilesAll, pageConfig, globalContext._pageConfigGlobal, pageContext.pageId, !globalContext._isProduction),
28
27
  (0, analyzePageClientSide_js_1.analyzePageClientSideInit)(pageContext._globalContext._pageFilesAll, pageContext.pageId, {
29
28
  sharedPageFilesAlreadyLoaded: true,
30
29
  }),
@@ -107,8 +106,7 @@ async function loadPageConfigsLazyServerSide(pageContext) {
107
106
  });
108
107
  return pageContextAddendum;
109
108
  }
110
- // TODO/now: rename?
111
- async function loadPageUserFiles(pageFilesAll, pageConfig, pageConfigGlobal, pageId, isDev) {
109
+ async function loadPageConfigFiles(pageFilesAll, pageConfig, pageConfigGlobal, pageId, isDev) {
112
110
  const pageFilesServerSide = (0, getPageFiles_js_1.getPageFilesServerSide)(pageFilesAll, pageId);
113
111
  const pageConfigLoaded = !pageConfig ? null : await (0, loadConfigValues_js_1.loadConfigValues)(pageConfig, isDev);
114
112
  await Promise.all(pageFilesServerSide.map((p) => p.loadFile?.()));
@@ -118,9 +116,7 @@ async function loadPageUserFiles(pageFilesAll, pageConfig, pageConfigGlobal, pag
118
116
  pageFilesLoaded: pageFilesServerSide,
119
117
  };
120
118
  }
121
- function resolveHeadersResponse(
122
- // TODO/now: merge pageContextAddendum with pageContext
123
- pageContext, pageContextAddendum) {
119
+ function resolveHeadersResponse(pageContext, pageContextAddendum) {
124
120
  const headersResponse = mergeHeaders(pageContextAddendum.config.headersResponse);
125
121
  if (!headersResponse.get('Cache-Control')) {
126
122
  const cacheControl = (0, getCacheControl_js_1.getCacheControl)(pageContext.pageId, pageContext._globalContext._pageConfigs);
@@ -174,10 +174,7 @@ async function renderPageOnError(errNominalPage, pageContextBegin, pageContextNo
174
174
  (0, utils_js_1.objectAssign)(pageContextErrorPageInit, { pageId: null });
175
175
  return (0, handleErrorWithoutErrorPage_js_1.handleErrorWithoutErrorPage)(pageContextErrorPageInit);
176
176
  }
177
- else {
178
- // TODO/now: minor refactor
179
- (0, utils_js_1.objectAssign)(pageContextErrorPageInit, { pageId: errorPageId });
180
- }
177
+ (0, utils_js_1.objectAssign)(pageContextErrorPageInit, { pageId: errorPageId });
181
178
  }
182
179
  let pageContextErrorPage;
183
180
  try {
@@ -35,9 +35,7 @@ async function crawlPlusFiles(userRootDir) {
35
35
  : // Fallback to tinyglobby for users that dynamically generate plus files. (Assuming that no plus file is found because of the user's .gitignore list.)
36
36
  filesGlob;
37
37
  (0, utils_js_1.assert)(files);
38
- if (debug.isActivated) {
39
- (0, utils_js_1.assert)(filesGit);
40
- (0, utils_js_1.assert)(filesGlob);
38
+ if (debug.isActivated && filesGit && filesGlob) {
41
39
  (0, utils_js_1.assertWarning)((0, utils_js_1.deepEqual)(filesGlob.slice().sort(), filesGit.slice().sort()), "Git and glob results aren't matching.", { onlyOnce: false });
42
40
  }
43
41
  // Filter build files
@@ -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.235-commit-d2ac38a';
5
+ exports.PROJECT_VERSION = '0.4.236-commit-85d361d';
@@ -36,15 +36,15 @@ function onSetupRuntime() {
36
36
  assertNodeEnvIsNotUndefinedString();
37
37
  if (!setup.viteDevServer && setup.isViteDev === undefined) {
38
38
  // TO-DO/eventually: make it assertUsage() again once https://github.com/vikejs/vike/issues/1528 is implemented.
39
- (0, assert_js_1.assertWarning)(!isNodeEnvDev(), `The ${getEnvDescription()}, which is contradictory because the environment seems to be a production environment (Vite isn't loaded), see https://vike.dev/NODE_ENV`, { onlyOnce: true });
40
- (0, assert_js_1.assertUsage)(!setup.vikeVitePlugin, `Loading Vike's Vite plugin (the ${picocolors_1.default.cyan('vike/plugin')} module) is prohibited in production.`);
39
+ (0, assert_js_1.assertWarning)(!isNodeEnvDev(), `The ${getEnvDescription()}, which is contradictory because the environment seems to be a production environment (Vite isn't loaded), see ${picocolors_1.default.underline('https://vike.dev/NODE_ENV')} and ${picocolors_1.default.underline('https://vike.dev/warning/setup')}`, { onlyOnce: true });
40
+ (0, assert_js_1.assertUsage)(!setup.vikeVitePlugin, `Vike's Vite plugin (the ${picocolors_1.default.cyan('vike/plugin')} module) shouldn't be loaded in production, see ${picocolors_1.default.underline('https://vike.dev/warning/setup')}`);
41
41
  // This assert() one of the main goal of this file: it ensures assertIsNotProductionRuntime()
42
42
  (0, assert_js_1.assert)(!setup.shouldNotBeProduction);
43
43
  }
44
44
  else {
45
45
  if (!setup.isPreview && !setup.vitePreviewServer && !setup.isPrerendering) {
46
46
  // TO-DO/eventually: make it assertUsage() again once https://github.com/vikejs/vike/issues/1528 is implemented.
47
- (0, assert_js_1.assertWarning)(isNodeEnvDev(), `The ${getEnvDescription()}, but Vite is loaded which is prohibited in production, see https://vike.dev/NODE_ENV`, { onlyOnce: true });
47
+ (0, assert_js_1.assertWarning)(isNodeEnvDev(), `The ${getEnvDescription()} while Vite is loaded, but Vite shouldn't be loaded in production, see ${picocolors_1.default.underline('https://vike.dev/warning/setup')}`, { onlyOnce: true });
48
48
  }
49
49
  (0, assert_js_1.assert)(setup.vikeVitePlugin);
50
50
  (0, assert_js_1.assert)(setup.shouldNotBeProduction);
@@ -114,7 +114,7 @@ function assertUsageNodeEnvIsNotDev(operation) {
114
114
  if (!isNodeEnvDev())
115
115
  return;
116
116
  // TO-DO/eventually: make it assertUsage() again once https://github.com/vikejs/vike/issues/1528 is implemented.
117
- (0, assert_js_1.assertWarning)(false, `The ${getEnvDescription()} which is forbidden upon ${operation}, see https://vike.dev/NODE_ENV`, { onlyOnce: true });
117
+ (0, assert_js_1.assertWarning)(false, `The ${getEnvDescription()} upon ${operation} which shouldn't be the case, see ${picocolors_1.default.underline('https://vike.dev/NODE_ENV')}`, { onlyOnce: true });
118
118
  }
119
119
  function getEnvDescription() {
120
120
  const envType = `${(isNodeEnvDev() ? 'development' : 'production')} environment`;
@@ -125,7 +125,7 @@ function getEnvDescription() {
125
125
  // https://github.com/cloudflare/workers-sdk/issues/7886
126
126
  function assertNodeEnvIsNotUndefinedString() {
127
127
  const nodeEnv = getNodeEnv();
128
- (0, assert_js_1.assertWarning)(nodeEnv !== 'undefined', `${picocolors_1.default.cyan('process.env.NODE_ENV==="undefined"')} which is unexpected: ${picocolors_1.default.cyan('process.env.NODE_ENV')} is allowed to be the *value* ${picocolors_1.default.cyan('undefined')} (i.e. ${picocolors_1.default.cyan('process.env.NODE_ENV===undefined')}) but it shouldn't be the *string* ${picocolors_1.default.cyan('"undefined"')} ${picocolors_1.default.underline('https://vike.dev/NODE_ENV')}`, { onlyOnce: true });
128
+ (0, assert_js_1.assertWarning)(nodeEnv !== 'undefined', `${picocolors_1.default.cyan('process.env.NODE_ENV==="undefined"')} which is unexpected: ${picocolors_1.default.cyan('process.env.NODE_ENV')} is allowed to be the *value* ${picocolors_1.default.cyan('undefined')} (i.e. ${picocolors_1.default.cyan('process.env.NODE_ENV===undefined')}) but it shouldn't be the *string* ${picocolors_1.default.cyan('"undefined"')} — see ${picocolors_1.default.underline('https://vike.dev/NODE_ENV')}`, { onlyOnce: true });
129
129
  }
130
130
  function isNodeEnvDev() {
131
131
  const nodeEnv = getNodeEnv();
@@ -49,7 +49,7 @@ function isPathAliasRecommended(alias) {
49
49
  // - In principle, we could allow path aliases that don't start with special character as long as they can be distinguished from npm package names.
50
50
  // - But we still enforce path aliases to start with a special character because it's a much simpler rule to follow.
51
51
  if (alias.startsWith('@/'))
52
- return true; // Needed by contra.com
52
+ return true; // Needed by contra.com and https://github.com/vikejs/vike/issues/1567#issuecomment-3076374243
53
53
  const firstLetter = alias[0];
54
54
  (0, assert_js_1.assert)(firstLetter);
55
55
  if (firstLetter === '@' || /[0-9a-z]/.test(firstLetter.toLowerCase()))
@@ -1,4 +1,4 @@
1
- import { assertUsage } from './runtime-server-routing/utils.js';
1
+ import { assertUsage } from '../utils/assert.js';
2
2
  assertUsage(false, [
3
3
  'Server imports are forbidden on the client-side:',
4
4
  " import { something } from 'vike/server'",
@@ -171,7 +171,7 @@ declare function getGlobalContextSync(): GlobalContext;
171
171
  declare function setGlobalContext_viteDevServer(viteDevServer: ViteDevServer): Promise<void>;
172
172
  declare function setGlobalContext_viteConfig(viteConfig: ResolvedConfig, viteConfigRuntime: ViteConfigRuntime): void;
173
173
  declare function setGlobalContext_isPrerendering(): void;
174
- declare function setGlobalContext_isProduction(isProduction: boolean, tolerateContraditction?: true): void;
174
+ declare function setGlobalContext_isProduction(isProduction: boolean, tolerateContraditction?: boolean): void;
175
175
  declare function getViteDevServer(): ViteDevServer | null;
176
176
  declare function getViteConfig(): ResolvedConfig | null;
177
177
  declare function initGlobalContext_renderPage(): Promise<void>;
@@ -150,7 +150,9 @@ function setGlobalContext_isPrerendering() {
150
150
  globalObject.isPrerendering = true;
151
151
  setIsProduction(true);
152
152
  }
153
- function setGlobalContext_isProduction(isProduction, tolerateContraditction) {
153
+ function setGlobalContext_isProduction(isProduction, tolerateContraditction = false) {
154
+ if (debug.isActivated)
155
+ debug('setGlobalContext_isProduction()', { isProduction, tolerateContraditction });
154
156
  if (globalObject.isProduction === undefined) {
155
157
  setIsProduction(isProduction);
156
158
  }
@@ -10,7 +10,7 @@ import { getErrorPageId, isErrorPage } from '../../../shared/error-page.js';
10
10
  import { getHttpResponseBody, getHttpResponseBodyStreamHandlers } from './getHttpResponseBody.js';
11
11
  import { getEarlyHints } from './getEarlyHints.js';
12
12
  import { assertNoInfiniteHttpRedirect } from './createHttpResponse/assertNoInfiniteHttpRedirect.js';
13
- import { cacheControlDisable } from './createHttpResponse/getCacheControl.js';
13
+ import { cacheControlDisable } from './getCacheControl.js';
14
14
  async function createHttpResponsePage(htmlRender, renderHook, pageContext) {
15
15
  let statusCode = pageContext.abortStatusCode;
16
16
  if (!statusCode) {
@@ -1,5 +1,5 @@
1
1
  export { getCacheControl };
2
2
  export { cacheControlDisable };
3
- import type { PageConfigRuntime } from '../../../../types/PageConfig.js';
3
+ import type { PageConfigRuntime } from '../../../types/PageConfig.js';
4
4
  declare const cacheControlDisable = "no-store, max-age=0";
5
5
  declare function getCacheControl(pageId: string | null, pageConfigs: PageConfigRuntime[]): string;
@@ -1,8 +1,7 @@
1
- // TODO/now: move
2
1
  export { getCacheControl };
3
2
  export { cacheControlDisable };
4
- import { getPageConfig } from '../../../../shared/page-configs/helpers.js';
5
- import { getConfigValueRuntime } from '../../../../shared/page-configs/getConfigValueRuntime.js';
3
+ import { getPageConfig } from '../../../shared/page-configs/helpers.js';
4
+ import { getConfigValueRuntime } from '../../../shared/page-configs/getConfigValueRuntime.js';
6
5
  const cacheControlDisable = 'no-store, max-age=0';
7
6
  function getCacheControl(pageId, pageConfigs) {
8
7
  // TO-DO/next-major-release: remove this line
@@ -9,20 +9,19 @@ import { findPageConfig } from '../../../shared/page-configs/findPageConfig.js';
9
9
  import { analyzePage } from './analyzePage.js';
10
10
  import { loadConfigValues } from '../../../shared/page-configs/loadConfigValues.js';
11
11
  import { execHookServer } from './execHookServer.js';
12
- import { getCacheControl } from './createHttpResponse/getCacheControl.js';
13
- // TODO/now: rename?
12
+ import { getCacheControl } from './getCacheControl.js';
14
13
  async function loadPageConfigsLazyServerSideAndExecHook(pageContext) {
15
14
  const pageContextAddendum = await loadPageConfigsLazyServerSide(pageContext);
16
15
  objectAssign(pageContext, pageContextAddendum);
17
16
  await execHookServer('onCreatePageContext', pageContext);
18
17
  return pageContext;
19
18
  }
20
- // TODO/now: rename?
19
+ // TODO/now: define new function resolveAfterLoad() ?
21
20
  async function loadPageConfigsLazyServerSide(pageContext) {
22
21
  const pageConfig = findPageConfig(pageContext._globalContext._pageConfigs, pageContext.pageId); // Make pageConfig globally available as pageContext._pageConfig ?
23
22
  const globalContext = pageContext._globalContext;
24
23
  const [{ pageFilesLoaded, configPublicPageLazy }] = await Promise.all([
25
- loadPageUserFiles(pageContext._globalContext._pageFilesAll, pageConfig, globalContext._pageConfigGlobal, pageContext.pageId, !globalContext._isProduction),
24
+ loadPageConfigFiles(pageContext._globalContext._pageFilesAll, pageConfig, globalContext._pageConfigGlobal, pageContext.pageId, !globalContext._isProduction),
26
25
  analyzePageClientSideInit(pageContext._globalContext._pageFilesAll, pageContext.pageId, {
27
26
  sharedPageFilesAlreadyLoaded: true,
28
27
  }),
@@ -105,8 +104,7 @@ async function loadPageConfigsLazyServerSide(pageContext) {
105
104
  });
106
105
  return pageContextAddendum;
107
106
  }
108
- // TODO/now: rename?
109
- async function loadPageUserFiles(pageFilesAll, pageConfig, pageConfigGlobal, pageId, isDev) {
107
+ async function loadPageConfigFiles(pageFilesAll, pageConfig, pageConfigGlobal, pageId, isDev) {
110
108
  const pageFilesServerSide = getPageFilesServerSide(pageFilesAll, pageId);
111
109
  const pageConfigLoaded = !pageConfig ? null : await loadConfigValues(pageConfig, isDev);
112
110
  await Promise.all(pageFilesServerSide.map((p) => p.loadFile?.()));
@@ -116,9 +114,7 @@ async function loadPageUserFiles(pageFilesAll, pageConfig, pageConfigGlobal, pag
116
114
  pageFilesLoaded: pageFilesServerSide,
117
115
  };
118
116
  }
119
- function resolveHeadersResponse(
120
- // TODO/now: merge pageContextAddendum with pageContext
121
- pageContext, pageContextAddendum) {
117
+ function resolveHeadersResponse(pageContext, pageContextAddendum) {
122
118
  const headersResponse = mergeHeaders(pageContextAddendum.config.headersResponse);
123
119
  if (!headersResponse.get('Cache-Control')) {
124
120
  const cacheControl = getCacheControl(pageContext.pageId, pageContext._globalContext._pageConfigs);
@@ -169,10 +169,7 @@ async function renderPageOnError(errNominalPage, pageContextBegin, pageContextNo
169
169
  objectAssign(pageContextErrorPageInit, { pageId: null });
170
170
  return handleErrorWithoutErrorPage(pageContextErrorPageInit);
171
171
  }
172
- else {
173
- // TODO/now: minor refactor
174
- objectAssign(pageContextErrorPageInit, { pageId: errorPageId });
175
- }
172
+ objectAssign(pageContextErrorPageInit, { pageId: errorPageId });
176
173
  }
177
174
  let pageContextErrorPage;
178
175
  try {
@@ -30,9 +30,7 @@ async function crawlPlusFiles(userRootDir) {
30
30
  : // Fallback to tinyglobby for users that dynamically generate plus files. (Assuming that no plus file is found because of the user's .gitignore list.)
31
31
  filesGlob;
32
32
  assert(files);
33
- if (debug.isActivated) {
34
- assert(filesGit);
35
- assert(filesGlob);
33
+ if (debug.isActivated && filesGit && filesGlob) {
36
34
  assertWarning(deepEqual(filesGlob.slice().sort(), filesGit.slice().sort()), "Git and glob results aren't matching.", { onlyOnce: false });
37
35
  }
38
36
  // Filter build files
@@ -1 +1 @@
1
- export declare const PROJECT_VERSION: "0.4.235-commit-d2ac38a";
1
+ export declare const PROJECT_VERSION: "0.4.236-commit-85d361d";
@@ -1,2 +1,2 @@
1
1
  // Automatically updated by @brillout/release-me
2
- export const PROJECT_VERSION = '0.4.235-commit-d2ac38a';
2
+ export const PROJECT_VERSION = '0.4.236-commit-85d361d';
@@ -31,15 +31,15 @@ function onSetupRuntime() {
31
31
  assertNodeEnvIsNotUndefinedString();
32
32
  if (!setup.viteDevServer && setup.isViteDev === undefined) {
33
33
  // TO-DO/eventually: make it assertUsage() again once https://github.com/vikejs/vike/issues/1528 is implemented.
34
- assertWarning(!isNodeEnvDev(), `The ${getEnvDescription()}, which is contradictory because the environment seems to be a production environment (Vite isn't loaded), see https://vike.dev/NODE_ENV`, { onlyOnce: true });
35
- assertUsage(!setup.vikeVitePlugin, `Loading Vike's Vite plugin (the ${pc.cyan('vike/plugin')} module) is prohibited in production.`);
34
+ assertWarning(!isNodeEnvDev(), `The ${getEnvDescription()}, which is contradictory because the environment seems to be a production environment (Vite isn't loaded), see ${pc.underline('https://vike.dev/NODE_ENV')} and ${pc.underline('https://vike.dev/warning/setup')}`, { onlyOnce: true });
35
+ assertUsage(!setup.vikeVitePlugin, `Vike's Vite plugin (the ${pc.cyan('vike/plugin')} module) shouldn't be loaded in production, see ${pc.underline('https://vike.dev/warning/setup')}`);
36
36
  // This assert() one of the main goal of this file: it ensures assertIsNotProductionRuntime()
37
37
  assert(!setup.shouldNotBeProduction);
38
38
  }
39
39
  else {
40
40
  if (!setup.isPreview && !setup.vitePreviewServer && !setup.isPrerendering) {
41
41
  // TO-DO/eventually: make it assertUsage() again once https://github.com/vikejs/vike/issues/1528 is implemented.
42
- assertWarning(isNodeEnvDev(), `The ${getEnvDescription()}, but Vite is loaded which is prohibited in production, see https://vike.dev/NODE_ENV`, { onlyOnce: true });
42
+ assertWarning(isNodeEnvDev(), `The ${getEnvDescription()} while Vite is loaded, but Vite shouldn't be loaded in production, see ${pc.underline('https://vike.dev/warning/setup')}`, { onlyOnce: true });
43
43
  }
44
44
  assert(setup.vikeVitePlugin);
45
45
  assert(setup.shouldNotBeProduction);
@@ -109,7 +109,7 @@ function assertUsageNodeEnvIsNotDev(operation) {
109
109
  if (!isNodeEnvDev())
110
110
  return;
111
111
  // TO-DO/eventually: make it assertUsage() again once https://github.com/vikejs/vike/issues/1528 is implemented.
112
- assertWarning(false, `The ${getEnvDescription()} which is forbidden upon ${operation}, see https://vike.dev/NODE_ENV`, { onlyOnce: true });
112
+ assertWarning(false, `The ${getEnvDescription()} upon ${operation} which shouldn't be the case, see ${pc.underline('https://vike.dev/NODE_ENV')}`, { onlyOnce: true });
113
113
  }
114
114
  function getEnvDescription() {
115
115
  const envType = `${(isNodeEnvDev() ? 'development' : 'production')} environment`;
@@ -120,7 +120,7 @@ function getEnvDescription() {
120
120
  // https://github.com/cloudflare/workers-sdk/issues/7886
121
121
  function assertNodeEnvIsNotUndefinedString() {
122
122
  const nodeEnv = getNodeEnv();
123
- assertWarning(nodeEnv !== 'undefined', `${pc.cyan('process.env.NODE_ENV==="undefined"')} which is unexpected: ${pc.cyan('process.env.NODE_ENV')} is allowed to be the *value* ${pc.cyan('undefined')} (i.e. ${pc.cyan('process.env.NODE_ENV===undefined')}) but it shouldn't be the *string* ${pc.cyan('"undefined"')} ${pc.underline('https://vike.dev/NODE_ENV')}`, { onlyOnce: true });
123
+ assertWarning(nodeEnv !== 'undefined', `${pc.cyan('process.env.NODE_ENV==="undefined"')} which is unexpected: ${pc.cyan('process.env.NODE_ENV')} is allowed to be the *value* ${pc.cyan('undefined')} (i.e. ${pc.cyan('process.env.NODE_ENV===undefined')}) but it shouldn't be the *string* ${pc.cyan('"undefined"')} — see ${pc.underline('https://vike.dev/NODE_ENV')}`, { onlyOnce: true });
124
124
  }
125
125
  function isNodeEnvDev() {
126
126
  const nodeEnv = getNodeEnv();
@@ -52,7 +52,7 @@ function isPathAliasRecommended(alias) {
52
52
  // - In principle, we could allow path aliases that don't start with special character as long as they can be distinguished from npm package names.
53
53
  // - But we still enforce path aliases to start with a special character because it's a much simpler rule to follow.
54
54
  if (alias.startsWith('@/'))
55
- return true; // Needed by contra.com
55
+ return true; // Needed by contra.com and https://github.com/vikejs/vike/issues/1567#issuecomment-3076374243
56
56
  const firstLetter = alias[0];
57
57
  assert(firstLetter);
58
58
  if (firstLetter === '@' || /[0-9a-z]/.test(firstLetter.toLowerCase()))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike",
3
- "version": "0.4.235-commit-d2ac38a",
3
+ "version": "0.4.236-commit-85d361d",
4
4
  "repository": "https://github.com/vikejs/vike",
5
5
  "exports": {
6
6
  "./server": {
@@ -251,7 +251,7 @@
251
251
  "@types/picomatch": "^3.0.2",
252
252
  "@types/semver": "^7.5.8",
253
253
  "@types/source-map-support": "^0.5.10",
254
- "react-streaming": "^0.4.2",
254
+ "react-streaming": "^0.4.3",
255
255
  "rimraf": "^5.0.5",
256
256
  "typescript": "^5.8.3",
257
257
  "vite": "^6.3.2"