vike 0.4.238-commit-d48a597 → 0.4.239
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/vite/onLoad.js +1 -1
- package/dist/cjs/node/vite/plugins/pluginCommon.js +1 -1
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles/generateVirtualFileGlobalEntryWithOldDesign.js +1 -1
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/crawlPlusFiles.js +1 -1
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/cjs/utils/assertNodeVersion.js +3 -1
- package/dist/cjs/utils/assertVersion.js +26 -5
- package/dist/cjs/utils/joinEnglish.js +2 -1
- package/dist/esm/node/vite/onLoad.js +1 -1
- package/dist/esm/node/vite/plugins/pluginCommon.js +1 -1
- package/dist/esm/node/vite/plugins/pluginVirtualFiles/generateVirtualFileGlobalEntryWithOldDesign.js +2 -2
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/crawlPlusFiles.js +2 -2
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/utils/assertNodeVersion.js +3 -1
- package/dist/esm/utils/assertVersion.d.ts +4 -3
- package/dist/esm/utils/assertVersion.js +23 -5
- package/dist/esm/utils/joinEnglish.js +2 -1
- package/package.json +2 -2
|
@@ -15,7 +15,7 @@ function onLoad() {
|
|
|
15
15
|
// TO-DO/eventually: let's also use this.meta.viteVersion
|
|
16
16
|
// - https://github.com/vitejs/vite/pull/20088
|
|
17
17
|
// - https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md#700-2025-06-24
|
|
18
|
-
(0, assertVersion_js_1.assertVersion)('Vite', vite_1.version, '6.0.0');
|
|
18
|
+
(0, assertVersion_js_1.assertVersion)('Vite', vite_1.version, ['6.0.0']);
|
|
19
19
|
// Ensure we don't bloat the server runtime with heavy dependencies such Vite and esbuild
|
|
20
20
|
(0, assertSetup_js_1.assertIsNotProductionRuntime)();
|
|
21
21
|
}
|
|
@@ -112,7 +112,7 @@ function setDefault(setting, value, configFromUser, configFromVike) {
|
|
|
112
112
|
/*
|
|
113
113
|
import { version } from 'vite'
|
|
114
114
|
function overrideViteDefaultSsrExternal(config: ResolvedConfig) {
|
|
115
|
-
if (!
|
|
115
|
+
if (!isVersionMatch(version, ['5.0.12'])) return
|
|
116
116
|
// @ts-ignore Not released yet: https://github.com/vitejs/vite/pull/10939/files#diff-5a3d42620df2c6b17e25f440ffdb67683dee7ef57317674d19f41d5f30502310L5
|
|
117
117
|
config.ssr.external ??= true
|
|
118
118
|
}
|
package/dist/cjs/node/vite/plugins/pluginVirtualFiles/generateVirtualFileGlobalEntryWithOldDesign.js
CHANGED
|
@@ -144,7 +144,7 @@ function getGlobs(globRoots, isBuild, fileType, query, isV1Design) {
|
|
|
144
144
|
const globExcludePath = globRoot.excludeDir ? `'!${getGlobPath(globRoot.excludeDir, fileType)}'` : null;
|
|
145
145
|
const globOptions = { eager: isEager };
|
|
146
146
|
if (query) {
|
|
147
|
-
const isNewViteInterface = (0, utils_js_1.
|
|
147
|
+
const isNewViteInterface = (0, utils_js_1.isVersionMatch)(vite_1.version, ['5.1.0']);
|
|
148
148
|
if (isNewViteInterface &&
|
|
149
149
|
// When used for the old design, the new syntax breaks Vike's CI (surprinsigly so). I couldn't reproduce locally (I didn't dig much).
|
|
150
150
|
isV1Design) {
|
|
@@ -152,7 +152,7 @@ async function isGitNotUsable(userRootDir) {
|
|
|
152
152
|
// - We didn't bother test which is the earliest version that works.
|
|
153
153
|
// - Git 2.32.0 doesn't seem to work: https://github.com/vikejs/vike/discussions/1549
|
|
154
154
|
// - Maybe it's because of StackBlitz: looking at the release notes, Git 2.32.0 should be working.
|
|
155
|
-
if (!(0, utils_js_1.
|
|
155
|
+
if (!(0, utils_js_1.isVersionMatch)(gitVersion, ['2.43.1']))
|
|
156
156
|
return true;
|
|
157
157
|
}
|
|
158
158
|
// Is userRootDir inside a Git repository?
|
|
@@ -8,5 +8,7 @@ function assertNodeVersion() {
|
|
|
8
8
|
if (!(0, isNodeJS_js_1.isNodeJS)())
|
|
9
9
|
return;
|
|
10
10
|
const version = process.versions.node;
|
|
11
|
-
(0, assertVersion_js_1.assertVersion)('Node.js', version,
|
|
11
|
+
(0, assertVersion_js_1.assertVersion)('Node.js', version,
|
|
12
|
+
// https://gist.github.com/brillout/8e0133716e169b981b6c4e8a938b0134
|
|
13
|
+
['20.19.0', '22.12.0', '23.0.0']);
|
|
12
14
|
}
|
|
@@ -1,16 +1,37 @@
|
|
|
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.assertVersion = assertVersion;
|
|
4
|
-
exports.
|
|
7
|
+
exports.isVersionMatch = isVersionMatch;
|
|
8
|
+
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
5
9
|
const assert_js_1 = require("./assert.js");
|
|
6
10
|
const assertIsNotBrowser_js_1 = require("./assertIsNotBrowser.js");
|
|
11
|
+
const joinEnglish_js_1 = require("./joinEnglish.js");
|
|
7
12
|
(0, assertIsNotBrowser_js_1.assertIsNotBrowser)();
|
|
8
|
-
function assertVersion(dependencyName, versionActual,
|
|
13
|
+
function assertVersion(dependencyName, versionActual, versionExpectedList) {
|
|
14
|
+
(0, assert_js_1.assertUsage)(isVersionMatch(versionActual, versionExpectedList), `${picocolors_1.default.bold(dependencyName)} ${picocolors_1.default.red(picocolors_1.default.bold(versionActual))} isn't supported, use ${picocolors_1.default.bold(dependencyName)} ${(0, joinEnglish_js_1.joinEnglish)([...versionExpectedList, 'above'].map((v) => picocolors_1.default.green(picocolors_1.default.bold(v))), 'or')}.`);
|
|
15
|
+
}
|
|
16
|
+
function isVersionMatch(versionActual, versionExpectedList) {
|
|
9
17
|
(0, assert_js_1.assert)(versionActual);
|
|
10
|
-
(0, assert_js_1.assert)(
|
|
11
|
-
(0, assert_js_1.
|
|
18
|
+
(0, assert_js_1.assert)(versionExpectedList);
|
|
19
|
+
(0, assert_js_1.assert)(versionExpectedList.length > 0);
|
|
20
|
+
const versionActualMajor = parseVersion(versionActual)[0];
|
|
21
|
+
const versionExpectedListSameMajor = versionExpectedList.filter((versionExpected) => {
|
|
22
|
+
const versionExpectedMajor = parseVersion(versionExpected)[0];
|
|
23
|
+
return versionExpectedMajor === versionActualMajor;
|
|
24
|
+
});
|
|
25
|
+
(0, assert_js_1.assert)(versionExpectedListSameMajor.length <= 1);
|
|
26
|
+
const versionExpectedSameMajor = versionExpectedListSameMajor[0];
|
|
27
|
+
if (versionExpectedSameMajor) {
|
|
28
|
+
return isSameOrAbove(versionActual, versionExpectedSameMajor);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
return versionExpectedList.every((versionExpected) => isSameOrAbove(versionActual, versionExpected));
|
|
32
|
+
}
|
|
12
33
|
}
|
|
13
|
-
function
|
|
34
|
+
function isSameOrAbove(versionActual, versionExpected) {
|
|
14
35
|
const p1 = parseVersion(versionActual);
|
|
15
36
|
const p2 = parseVersion(versionExpected);
|
|
16
37
|
// major
|
|
@@ -9,5 +9,6 @@ function joinEnglish(arr, conjunction, colorizer = (s) => s) {
|
|
|
9
9
|
return colorizer(arr[0]);
|
|
10
10
|
const firsts = arr.slice(0, arr.length - 1);
|
|
11
11
|
const last = arr[arr.length - 1];
|
|
12
|
-
|
|
12
|
+
const lastComma = arr.length > 2 ? ',' : '';
|
|
13
|
+
return firsts.map(colorizer).join(', ') + `${lastComma} ${conjunction} ` + colorizer(last);
|
|
13
14
|
}
|
|
@@ -13,7 +13,7 @@ function onLoad() {
|
|
|
13
13
|
// TO-DO/eventually: let's also use this.meta.viteVersion
|
|
14
14
|
// - https://github.com/vitejs/vite/pull/20088
|
|
15
15
|
// - https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md#700-2025-06-24
|
|
16
|
-
assertVersion('Vite', version, '6.0.0');
|
|
16
|
+
assertVersion('Vite', version, ['6.0.0']);
|
|
17
17
|
// Ensure we don't bloat the server runtime with heavy dependencies such Vite and esbuild
|
|
18
18
|
assertIsNotProductionRuntime();
|
|
19
19
|
}
|
|
@@ -107,7 +107,7 @@ function setDefault(setting, value, configFromUser, configFromVike) {
|
|
|
107
107
|
/*
|
|
108
108
|
import { version } from 'vite'
|
|
109
109
|
function overrideViteDefaultSsrExternal(config: ResolvedConfig) {
|
|
110
|
-
if (!
|
|
110
|
+
if (!isVersionMatch(version, ['5.0.12'])) return
|
|
111
111
|
// @ts-ignore Not released yet: https://github.com/vitejs/vite/pull/10939/files#diff-5a3d42620df2c6b17e25f440ffdb67683dee7ef57317674d19f41d5f30502310L5
|
|
112
112
|
config.ssr.external ??= true
|
|
113
113
|
}
|
package/dist/esm/node/vite/plugins/pluginVirtualFiles/generateVirtualFileGlobalEntryWithOldDesign.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { generateVirtualFileGlobalEntryWithOldDesign };
|
|
2
|
-
import { assert, assertPosixPath, scriptFileExtensionPattern, debugGlob,
|
|
2
|
+
import { assert, assertPosixPath, scriptFileExtensionPattern, debugGlob, isVersionMatch, assertWarning, } from '../../utils.js';
|
|
3
3
|
import { parseVirtualFileId } from '../../../shared/virtualFileId.js';
|
|
4
4
|
import { version as viteVersion } from 'vite';
|
|
5
5
|
import { fileTypes } from '../../../../shared/getPageFiles/fileTypes.js';
|
|
@@ -139,7 +139,7 @@ function getGlobs(globRoots, isBuild, fileType, query, isV1Design) {
|
|
|
139
139
|
const globExcludePath = globRoot.excludeDir ? `'!${getGlobPath(globRoot.excludeDir, fileType)}'` : null;
|
|
140
140
|
const globOptions = { eager: isEager };
|
|
141
141
|
if (query) {
|
|
142
|
-
const isNewViteInterface =
|
|
142
|
+
const isNewViteInterface = isVersionMatch(viteVersion, ['5.1.0']);
|
|
143
143
|
if (isNewViteInterface &&
|
|
144
144
|
// When used for the old design, the new syntax breaks Vike's CI (surprinsigly so). I couldn't reproduce locally (I didn't dig much).
|
|
145
145
|
isV1Design) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { crawlPlusFiles };
|
|
2
2
|
export { isPlusFile };
|
|
3
3
|
export { getPlusFileValueConfigName };
|
|
4
|
-
import { assertPosixPath, assert, scriptFileExtensionPattern, assertIsNotProductionRuntime,
|
|
4
|
+
import { assertPosixPath, assert, scriptFileExtensionPattern, assertIsNotProductionRuntime, isVersionMatch, isScriptFile, scriptFileExtensionList, createDebugger, deepEqual, assertUsage, assertFilePathAbsoluteFilesystem, assertWarning, hasProp, isNotNullish, getGlobalObject, } from '../../utils.js';
|
|
5
5
|
import path from 'node:path';
|
|
6
6
|
import { glob } from 'tinyglobby';
|
|
7
7
|
import { exec } from 'node:child_process';
|
|
@@ -147,7 +147,7 @@ async function isGitNotUsable(userRootDir) {
|
|
|
147
147
|
// - We didn't bother test which is the earliest version that works.
|
|
148
148
|
// - Git 2.32.0 doesn't seem to work: https://github.com/vikejs/vike/discussions/1549
|
|
149
149
|
// - Maybe it's because of StackBlitz: looking at the release notes, Git 2.32.0 should be working.
|
|
150
|
-
if (!
|
|
150
|
+
if (!isVersionMatch(gitVersion, ['2.43.1']))
|
|
151
151
|
return true;
|
|
152
152
|
}
|
|
153
153
|
// Is userRootDir inside a Git repository?
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.239";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.
|
|
2
|
+
export const PROJECT_VERSION = '0.4.239';
|
|
@@ -6,5 +6,7 @@ function assertNodeVersion() {
|
|
|
6
6
|
if (!isNodeJS())
|
|
7
7
|
return;
|
|
8
8
|
const version = process.versions.node;
|
|
9
|
-
assertVersion('Node.js', version,
|
|
9
|
+
assertVersion('Node.js', version,
|
|
10
|
+
// https://gist.github.com/brillout/8e0133716e169b981b6c4e8a938b0134
|
|
11
|
+
['20.19.0', '22.12.0', '23.0.0']);
|
|
10
12
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { assertVersion };
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
declare function
|
|
2
|
+
export { isVersionMatch };
|
|
3
|
+
type Version = `${number}.${number}.${number}`;
|
|
4
|
+
declare function assertVersion(dependencyName: 'Vite' | 'Node.js', versionActual: string, versionExpectedList: Version[]): void;
|
|
5
|
+
declare function isVersionMatch(versionActual: string, versionExpectedList: Version[]): boolean;
|
|
@@ -1,14 +1,32 @@
|
|
|
1
1
|
export { assertVersion };
|
|
2
|
-
export {
|
|
2
|
+
export { isVersionMatch };
|
|
3
|
+
import pc from '@brillout/picocolors';
|
|
3
4
|
import { assert, assertUsage } from './assert.js';
|
|
4
5
|
import { assertIsNotBrowser } from './assertIsNotBrowser.js';
|
|
6
|
+
import { joinEnglish } from './joinEnglish.js';
|
|
5
7
|
assertIsNotBrowser();
|
|
6
|
-
function assertVersion(dependencyName, versionActual,
|
|
8
|
+
function assertVersion(dependencyName, versionActual, versionExpectedList) {
|
|
9
|
+
assertUsage(isVersionMatch(versionActual, versionExpectedList), `${pc.bold(dependencyName)} ${pc.red(pc.bold(versionActual))} isn't supported, use ${pc.bold(dependencyName)} ${joinEnglish([...versionExpectedList, 'above'].map((v) => pc.green(pc.bold(v))), 'or')}.`);
|
|
10
|
+
}
|
|
11
|
+
function isVersionMatch(versionActual, versionExpectedList) {
|
|
7
12
|
assert(versionActual);
|
|
8
|
-
assert(
|
|
9
|
-
|
|
13
|
+
assert(versionExpectedList);
|
|
14
|
+
assert(versionExpectedList.length > 0);
|
|
15
|
+
const versionActualMajor = parseVersion(versionActual)[0];
|
|
16
|
+
const versionExpectedListSameMajor = versionExpectedList.filter((versionExpected) => {
|
|
17
|
+
const versionExpectedMajor = parseVersion(versionExpected)[0];
|
|
18
|
+
return versionExpectedMajor === versionActualMajor;
|
|
19
|
+
});
|
|
20
|
+
assert(versionExpectedListSameMajor.length <= 1);
|
|
21
|
+
const versionExpectedSameMajor = versionExpectedListSameMajor[0];
|
|
22
|
+
if (versionExpectedSameMajor) {
|
|
23
|
+
return isSameOrAbove(versionActual, versionExpectedSameMajor);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
return versionExpectedList.every((versionExpected) => isSameOrAbove(versionActual, versionExpected));
|
|
27
|
+
}
|
|
10
28
|
}
|
|
11
|
-
function
|
|
29
|
+
function isSameOrAbove(versionActual, versionExpected) {
|
|
12
30
|
const p1 = parseVersion(versionActual);
|
|
13
31
|
const p2 = parseVersion(versionExpected);
|
|
14
32
|
// major
|
|
@@ -7,5 +7,6 @@ function joinEnglish(arr, conjunction, colorizer = (s) => s) {
|
|
|
7
7
|
return colorizer(arr[0]);
|
|
8
8
|
const firsts = arr.slice(0, arr.length - 1);
|
|
9
9
|
const last = arr[arr.length - 1];
|
|
10
|
-
|
|
10
|
+
const lastComma = arr.length > 2 ? ',' : '';
|
|
11
|
+
return firsts.map(colorizer).join(', ') + `${lastComma} ${conjunction} ` + colorizer(last);
|
|
11
12
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vike",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.239",
|
|
4
4
|
"repository": "https://github.com/vikejs/vike",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": {
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
}
|
|
160
160
|
},
|
|
161
161
|
"engines": {
|
|
162
|
-
"node": ">=
|
|
162
|
+
"node": ">=20.19.0"
|
|
163
163
|
},
|
|
164
164
|
"license": "MIT",
|
|
165
165
|
"description": "The Framework *You* Control - Next.js & Nuxt alternative for unprecedented flexibility and dependability.",
|