vike 0.4.181-commit-ddcbf7d → 0.4.181-commit-2f53249
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/plugin/plugins/fileEnv.js +7 -6
- package/dist/cjs/utils/PROJECT_VERSION.js +2 -1
- package/dist/esm/node/plugin/plugins/fileEnv.js +7 -6
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +2 -1
- package/dist/esm/utils/projectInfo.d.ts +1 -1
- package/package.json +2 -2
|
@@ -31,6 +31,10 @@ function fileEnv() {
|
|
|
31
31
|
order: 'pre',
|
|
32
32
|
*/
|
|
33
33
|
async handler(source, importer, options) {
|
|
34
|
+
// It seems like Vite's scan doesn't apply transformers. (We need the `.telefunc.js` transformer to apply for our analysis to be correct.)
|
|
35
|
+
// @ts-expect-error Vite's type is wrong
|
|
36
|
+
if (options.scan)
|
|
37
|
+
return;
|
|
34
38
|
// TODO/v1-release: remove
|
|
35
39
|
if (extractAssetsPlugin_js_1.extractAssetsRE.test(source) || extractExportNamesPlugin_js_1.extractExportNamesRE.test(source))
|
|
36
40
|
return;
|
|
@@ -58,14 +62,14 @@ function fileEnv() {
|
|
|
58
62
|
const envActual = isServerSide ? 'server' : 'client';
|
|
59
63
|
const envExpect = isServerSide ? 'client' : 'server';
|
|
60
64
|
const suffix = `.${envExpect}.`;
|
|
61
|
-
// Everything
|
|
65
|
+
// Everything is good
|
|
62
66
|
if (!modulePath.includes(suffix))
|
|
63
67
|
return;
|
|
64
68
|
// Show error message
|
|
65
69
|
let errMsg;
|
|
66
70
|
let modulePathPretty = (0, getFilePath_js_1.getModuleFilePath)(moduleId, config);
|
|
67
71
|
modulePathPretty = modulePathPretty.replaceAll(suffix, picocolors_1.default.bold(suffix));
|
|
68
|
-
errMsg = `${(0, utils_js_1.capitalizeFirstLetter)(envExpect)}-only
|
|
72
|
+
errMsg = `${(0, utils_js_1.capitalizeFirstLetter)(envExpect)}-only file ${modulePathPretty} (https://vike.dev/file-env) imported on the ${envActual}-side`;
|
|
69
73
|
if (importer &&
|
|
70
74
|
// Don't show Vike's virtual modules that import the entry plus files such as /pages/about/+Page.js
|
|
71
75
|
!importer.includes('virtual:vike:') &&
|
|
@@ -75,10 +79,7 @@ function fileEnv() {
|
|
|
75
79
|
errMsg += ` by ${importerPath}`;
|
|
76
80
|
}
|
|
77
81
|
if (isDev) {
|
|
78
|
-
errMsg += '
|
|
79
|
-
}
|
|
80
|
-
errMsg += '.';
|
|
81
|
-
if (isDev) {
|
|
82
|
+
errMsg += ' and, therefore, Vike will prevent building your app for production.';
|
|
82
83
|
(0, utils_js_1.assertWarning)(false, errMsg, { onlyOnce: true });
|
|
83
84
|
}
|
|
84
85
|
else {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
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.181-commit-2f53249';
|
|
@@ -26,6 +26,10 @@ function fileEnv() {
|
|
|
26
26
|
order: 'pre',
|
|
27
27
|
*/
|
|
28
28
|
async handler(source, importer, options) {
|
|
29
|
+
// It seems like Vite's scan doesn't apply transformers. (We need the `.telefunc.js` transformer to apply for our analysis to be correct.)
|
|
30
|
+
// @ts-expect-error Vite's type is wrong
|
|
31
|
+
if (options.scan)
|
|
32
|
+
return;
|
|
29
33
|
// TODO/v1-release: remove
|
|
30
34
|
if (extractAssetsRE.test(source) || extractExportNamesRE.test(source))
|
|
31
35
|
return;
|
|
@@ -53,14 +57,14 @@ function fileEnv() {
|
|
|
53
57
|
const envActual = isServerSide ? 'server' : 'client';
|
|
54
58
|
const envExpect = isServerSide ? 'client' : 'server';
|
|
55
59
|
const suffix = `.${envExpect}.`;
|
|
56
|
-
// Everything
|
|
60
|
+
// Everything is good
|
|
57
61
|
if (!modulePath.includes(suffix))
|
|
58
62
|
return;
|
|
59
63
|
// Show error message
|
|
60
64
|
let errMsg;
|
|
61
65
|
let modulePathPretty = getModuleFilePath(moduleId, config);
|
|
62
66
|
modulePathPretty = modulePathPretty.replaceAll(suffix, pc.bold(suffix));
|
|
63
|
-
errMsg = `${capitalizeFirstLetter(envExpect)}-only
|
|
67
|
+
errMsg = `${capitalizeFirstLetter(envExpect)}-only file ${modulePathPretty} (https://vike.dev/file-env) imported on the ${envActual}-side`;
|
|
64
68
|
if (importer &&
|
|
65
69
|
// Don't show Vike's virtual modules that import the entry plus files such as /pages/about/+Page.js
|
|
66
70
|
!importer.includes('virtual:vike:') &&
|
|
@@ -70,10 +74,7 @@ function fileEnv() {
|
|
|
70
74
|
errMsg += ` by ${importerPath}`;
|
|
71
75
|
}
|
|
72
76
|
if (isDev) {
|
|
73
|
-
errMsg += '
|
|
74
|
-
}
|
|
75
|
-
errMsg += '.';
|
|
76
|
-
if (isDev) {
|
|
77
|
+
errMsg += ' and, therefore, Vike will prevent building your app for production.';
|
|
77
78
|
assertWarning(false, errMsg, { onlyOnce: true });
|
|
78
79
|
}
|
|
79
80
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.181-commit-
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.181-commit-2f53249";
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
// Automatically updated by @brillout/release-me
|
|
2
|
+
export const PROJECT_VERSION = '0.4.181-commit-2f53249';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vike",
|
|
3
|
-
"version": "0.4.181-commit-
|
|
3
|
+
"version": "0.4.181-commit-2f53249",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "tsc --watch",
|
|
6
6
|
"build": "rimraf dist/ && pnpm run build:esm && pnpm run build:cjs",
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
"sirv": "^2.0.4",
|
|
230
230
|
"source-map-support": "^0.5.21",
|
|
231
231
|
"typescript": "^5.4.5",
|
|
232
|
-
"vite": "
|
|
232
|
+
"vite": "^5.3.5"
|
|
233
233
|
},
|
|
234
234
|
"engines": {
|
|
235
235
|
"node": ">=18.0.0"
|