vike 0.4.151 → 0.4.152-commit-3d25618
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/index.js +1 -1
- package/dist/cjs/node/plugin/plugins/baseUrls.js +2 -2
- package/dist/cjs/node/plugin/plugins/importBuild/getVikeManifest.js +1 -1
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js +3 -0
- package/dist/cjs/node/plugin/shared/loggerVite.js +1 -1
- package/dist/cjs/node/runtime/html/injectAssets/getHtmlTags.js +2 -0
- package/dist/cjs/node/runtime/renderPage/createHttpResponseObject/getCacheControl.js +20 -0
- package/dist/cjs/node/runtime/renderPage/createHttpResponseObject.js +8 -1
- package/dist/cjs/node/runtime/renderPage/getPageAssets/retrieveAssetsDev.js +2 -1
- package/dist/cjs/node/runtime/renderPage/renderPageAlreadyRouted.js +1 -1
- package/dist/cjs/node/runtime/renderPage.js +21 -9
- package/dist/cjs/shared/getPageFiles/getExports.js +1 -1
- package/dist/cjs/shared/route/resolveRedirects.js +1 -1
- package/dist/cjs/utils/debug.js +11 -11
- package/dist/cjs/utils/projectInfo.js +1 -1
- package/dist/esm/node/plugin/index.js +1 -1
- package/dist/esm/node/plugin/plugins/baseUrls.js +2 -2
- package/dist/esm/node/plugin/plugins/importBuild/getVikeManifest.js +1 -1
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js +3 -0
- package/dist/esm/node/plugin/shared/loggerVite.js +1 -1
- package/dist/esm/node/runtime/html/injectAssets/getHtmlTags.js +2 -0
- package/dist/esm/node/runtime/renderPage/createHttpResponseObject/getCacheControl.d.ts +3 -0
- package/dist/esm/node/runtime/renderPage/createHttpResponseObject/getCacheControl.js +17 -0
- package/dist/esm/node/runtime/renderPage/createHttpResponseObject.js +8 -1
- package/dist/esm/node/runtime/renderPage/getPageAssets/retrieveAssetsDev.js +2 -1
- package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.js +1 -1
- package/dist/esm/node/runtime/renderPage.js +22 -10
- package/dist/esm/shared/VikeNamespace.d.ts +3 -0
- package/dist/esm/shared/getPageFiles/getExports.js +1 -1
- package/dist/esm/shared/page-configs/Config/PageContextConfig.d.ts +4 -4
- package/dist/esm/shared/page-configs/Config/helpers.d.ts +2 -2
- package/dist/esm/shared/page-configs/Config.d.ts +19 -10
- package/dist/esm/shared/route/resolveRedirects.js +1 -1
- package/dist/esm/utils/debug.d.ts +3 -3
- package/dist/esm/utils/debug.js +11 -11
- package/dist/esm/utils/projectInfo.d.ts +2 -2
- package/dist/esm/utils/projectInfo.js +1 -1
- package/package.json +30 -18
|
@@ -32,7 +32,7 @@ const assertFileEnv_js_1 = require("./plugins/assertFileEnv.js");
|
|
|
32
32
|
// Return as `any` to avoid Plugin type mismatches when there are multiple Vite versions installed
|
|
33
33
|
function plugin(vikeConfig) {
|
|
34
34
|
const plugins = [
|
|
35
|
-
(0, index_js_3.resolveVikeConfig)(vikeConfig),
|
|
35
|
+
(0, index_js_3.resolveVikeConfig)(vikeConfig), // The configResolved() hook of resolveVikeConfig() should be the first called
|
|
36
36
|
...(0, commonConfig_js_1.commonConfig)(),
|
|
37
37
|
(0, index_js_2.importUserCode)(),
|
|
38
38
|
...(0, index_js_1.devConfig)(),
|
|
@@ -19,11 +19,11 @@ function baseUrls(configVike) {
|
|
|
19
19
|
process.env.BASE_ASSETS = baseAssets;
|
|
20
20
|
return {
|
|
21
21
|
envPrefix: [
|
|
22
|
-
'VITE_',
|
|
22
|
+
'VITE_', // Vite doesn't seem to merge in its default, see https://github.com/vikejs/vike/issues/554
|
|
23
23
|
'BASE_SERVER',
|
|
24
24
|
'BASE_ASSETS'
|
|
25
25
|
],
|
|
26
|
-
base: baseAssets,
|
|
26
|
+
base: baseAssets, // Make Vite inject baseAssets to imports e.g. `import logoUrl from './logo.svg.js'`
|
|
27
27
|
_baseOriginal: config.base ?? '/__UNSET__' // Vite resolves `_baseOriginal: null` to `undefined`
|
|
28
28
|
};
|
|
29
29
|
},
|
|
@@ -13,7 +13,7 @@ function getVikeManifest(config, configVike) {
|
|
|
13
13
|
const runtimeManifest = (0, globalContext_js_1.getRuntimeManifest)(configVike);
|
|
14
14
|
const manifest = {
|
|
15
15
|
version: utils_js_1.projectInfo.projectVersion,
|
|
16
|
-
usesClientRouter: (0, extractExportNamesPlugin_js_1.isUsingClientRouter)(),
|
|
16
|
+
usesClientRouter: (0, extractExportNamesPlugin_js_1.isUsingClientRouter)(), // TODO/v1-release: remove
|
|
17
17
|
manifestKeyMap: getManifestKeyMap(configVike, config),
|
|
18
18
|
...runtimeManifest
|
|
19
19
|
};
|
|
@@ -31,7 +31,7 @@ function intercept(logType, config) {
|
|
|
31
31
|
if (options.error && store?.shouldErrorBeSwallowed(options.error)) {
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
// Remove this once https://github.com/vitejs/vite/pull/13495 is released
|
|
34
|
+
// Remove this once https://github.com/vitejs/vite/pull/13495 is released and widely used
|
|
35
35
|
if (msg.startsWith('Transform failed with ') && store && logType === 'error') {
|
|
36
36
|
store.markErrorMessageAsLogged(msg);
|
|
37
37
|
return;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCacheControl = void 0;
|
|
4
|
+
const helpers_js_1 = require("../../../../shared/page-configs/helpers.js");
|
|
5
|
+
const defaultValue = 'no-store, max-age=0';
|
|
6
|
+
function getCacheControl(pageId, pageConfigs) {
|
|
7
|
+
// TODO/v1-release: remove
|
|
8
|
+
if (pageConfigs.length === 0)
|
|
9
|
+
return defaultValue;
|
|
10
|
+
const pageConfig = (0, helpers_js_1.getPageConfig)(pageId, pageConfigs);
|
|
11
|
+
const configValue = (0, helpers_js_1.getConfigValue)(pageConfig, 'cacheControl', 'string');
|
|
12
|
+
const value = configValue?.value;
|
|
13
|
+
if (value)
|
|
14
|
+
return value;
|
|
15
|
+
// - Disabling caching by default is the safest strategy, because caching is problematic with authentication as described in https://github.com/vikejs/vike/issues/1275#issuecomment-1824366875
|
|
16
|
+
// - Are there use cases when we don't need to disable caching?
|
|
17
|
+
// - When there isn't any <script id="vike_pageContext" type="application/json"> then we can safely have caching. (We don't implement this exception because we're lazy and it's quite a rare situation.)
|
|
18
|
+
return defaultValue;
|
|
19
|
+
}
|
|
20
|
+
exports.getCacheControl = getCacheControl;
|
|
@@ -5,6 +5,7 @@ const utils_js_1 = require("../utils.js");
|
|
|
5
5
|
const error_page_js_1 = require("../../../shared/error-page.js");
|
|
6
6
|
const getHttpResponseBody_js_1 = require("./getHttpResponseBody.js");
|
|
7
7
|
const getEarlyHints_js_1 = require("./getEarlyHints.js");
|
|
8
|
+
const getCacheControl_js_1 = require("./createHttpResponseObject/getCacheControl.js");
|
|
8
9
|
const assertNoInfiniteHttpRedirect_js_1 = require("./createHttpResponseObject/assertNoInfiniteHttpRedirect.js");
|
|
9
10
|
async function createHttpResponseObject(htmlRender, renderHook, pageContext) {
|
|
10
11
|
if (htmlRender === null) {
|
|
@@ -26,7 +27,13 @@ async function createHttpResponseObject(htmlRender, renderHook, pageContext) {
|
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
const earlyHints = (0, getEarlyHints_js_1.getEarlyHints)(await pageContext.__getPageAssets());
|
|
29
|
-
|
|
30
|
+
const headers = [];
|
|
31
|
+
(0, utils_js_1.assert)(pageContext._pageId);
|
|
32
|
+
const cacheControl = (0, getCacheControl_js_1.getCacheControl)(pageContext._pageId, pageContext._pageConfigs);
|
|
33
|
+
if (cacheControl) {
|
|
34
|
+
headers.push(['Cache-Control', cacheControl]);
|
|
35
|
+
}
|
|
36
|
+
return getHttpResponse(statusCode, 'text/html;charset=utf-8', headers, htmlRender, earlyHints, renderHook);
|
|
30
37
|
}
|
|
31
38
|
exports.createHttpResponseObject = createHttpResponseObject;
|
|
32
39
|
async function createHttpResponsePageContextJson(pageContextSerialized) {
|
|
@@ -46,7 +46,8 @@ function collectCss(mod, styleUrls, visitedModules, importer) {
|
|
|
46
46
|
// - I believe some Vite plugins don't respect the \0 virtual module convention. What should we do then?
|
|
47
47
|
// - https://github.com/vikejs/vike/issues/1327
|
|
48
48
|
// - https://github.com/vikejs/vike/commit/3f7b9916dddc84e29e2c20d2b0df7211b6f1acbd
|
|
49
|
-
|
|
49
|
+
// - https://github.com/vikejs/vike/issues/479#issuecomment-1870043943
|
|
50
|
+
styleUrls.add(`/@id/__x00__${mod.url.substring(1)}`);
|
|
50
51
|
}
|
|
51
52
|
else {
|
|
52
53
|
// Is this useful? Maybe for virtual modules that don't respect the \0 virtual module convention?
|
|
@@ -108,7 +108,7 @@ async function prerender404Page(renderContext, pageContextInit_) {
|
|
|
108
108
|
_debugRouteMatches: []
|
|
109
109
|
};
|
|
110
110
|
const pageContextInit = {
|
|
111
|
-
urlOriginal: '/fake-404-url',
|
|
111
|
+
urlOriginal: '/fake-404-url', // A URL is needed for `applyViteHtmlTransform`
|
|
112
112
|
...pageContextInit_
|
|
113
113
|
};
|
|
114
114
|
{
|
|
@@ -343,21 +343,33 @@ function getPermanentRedirect(pageContextInit, httpRequestId) {
|
|
|
343
343
|
const { redirects, baseServer } = (0, globalContext_js_1.getGlobalContext)();
|
|
344
344
|
const urlWithoutBase = (0, utils_js_1.removeBaseServer)(pageContextInit.urlOriginal, baseServer);
|
|
345
345
|
let origin = null;
|
|
346
|
+
let urlTargetExternal = null;
|
|
346
347
|
let urlTarget = (0, utils_js_1.modifyUrlPathname)(urlWithoutBase, (urlPathname) => {
|
|
347
|
-
const
|
|
348
|
-
if (
|
|
348
|
+
const urlTarget = (0, resolveRedirects_js_1.resolveRedirects)(redirects, urlPathname);
|
|
349
|
+
if (urlTarget === null)
|
|
349
350
|
return null;
|
|
350
|
-
|
|
351
|
+
if (!(0, utils_js_1.isParsable)(urlTarget)) {
|
|
352
|
+
// E.g. `urlTarget === 'mailto:some@example.com'`
|
|
353
|
+
(0, utils_js_1.assert)((0, utils_js_1.isUriWithProtocol)(urlTarget) && !urlTarget.startsWith('http'));
|
|
354
|
+
urlTargetExternal = urlTarget;
|
|
355
|
+
return null;
|
|
356
|
+
}
|
|
357
|
+
const { urlModified, origin: origin_ } = (0, utils_js_1.removeUrlOrigin)(urlTarget);
|
|
351
358
|
origin = origin_;
|
|
352
359
|
return urlModified;
|
|
353
360
|
});
|
|
354
|
-
if (
|
|
355
|
-
urlTarget =
|
|
356
|
-
|
|
357
|
-
|
|
361
|
+
if (urlTargetExternal) {
|
|
362
|
+
urlTarget = urlTargetExternal;
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
if (origin)
|
|
366
|
+
urlTarget = (0, utils_js_1.addUrlOrigin)(urlTarget, origin);
|
|
367
|
+
if (urlTarget === urlWithoutBase)
|
|
368
|
+
return null;
|
|
369
|
+
urlTarget = (0, utils_js_1.prependBase)(urlTarget, baseServer);
|
|
370
|
+
(0, utils_js_1.assert)(urlTarget !== pageContextInit.urlOriginal);
|
|
371
|
+
}
|
|
358
372
|
(0, loggerRuntime_js_1.logRuntimeInfo)?.(`Permanent redirect defined by your config.redirects (https://vike.dev/redirects)`, httpRequestId, 'info');
|
|
359
|
-
urlTarget = (0, utils_js_1.prependBase)(urlTarget, baseServer);
|
|
360
|
-
(0, utils_js_1.assert)(urlTarget !== pageContextInit.urlOriginal);
|
|
361
373
|
const httpResponse = (0, createHttpResponseObject_js_1.createHttpResponseObjectRedirect)({ url: urlTarget, statusCode: 301 }, urlWithoutBase);
|
|
362
374
|
const pageContextHttpResponse = { ...pageContextInit, httpResponse };
|
|
363
375
|
return pageContextHttpResponse;
|
|
@@ -24,7 +24,7 @@ function getExports(pageFiles, pageConfig) {
|
|
|
24
24
|
exportValue,
|
|
25
25
|
exportSource: `${pageFile.filePath} > ${isFromDefaultExport ? `\`export default { ${exportName} }\`` : `\`export { ${exportName} }\``}`,
|
|
26
26
|
filePath: pageFile.filePath,
|
|
27
|
-
_filePath: pageFile.filePath,
|
|
27
|
+
_filePath: pageFile.filePath, // TODO/next-major-release: remove
|
|
28
28
|
_fileType: pageFile.fileType,
|
|
29
29
|
_isFromDefaultExport: isFromDefaultExport
|
|
30
30
|
});
|
|
@@ -27,7 +27,7 @@ function resolveRouteStringRedirect(urlSource, urlTarget, urlPathname) {
|
|
|
27
27
|
(0, utils_js_1.assertUsage)(urlTarget.startsWith('/') ||
|
|
28
28
|
// Is allowing any protocol a safety issue? https://github.com/vikejs/vike/pull/1292#issuecomment-1828043917
|
|
29
29
|
(0, parseUrl_extras_js_1.isUriWithProtocol)(urlTarget) ||
|
|
30
|
-
urlTarget === '*', `${configSrc} Invalid redirection target URL ${picocolors_1.default.cyan(urlTarget)}: the target URL should start with ${picocolors_1.default.cyan('/')}, a valid protocol (${picocolors_1.default.cyan('https:')}, ${picocolors_1.default.cyan('http:')}, ${picocolors_1.default.cyan('ipfs:')}, ${picocolors_1.default.cyan('magnet:')}, ...), or be ${picocolors_1.default.cyan('*')}`);
|
|
30
|
+
urlTarget === '*', `${configSrc} Invalid redirection target URL ${picocolors_1.default.cyan(urlTarget)}: the target URL should start with ${picocolors_1.default.cyan('/')}, a valid protocol (${picocolors_1.default.cyan('https:')}, ${picocolors_1.default.cyan('http:')}, ${picocolors_1.default.cyan('mailto:')}, ${picocolors_1.default.cyan('ipfs:')}, ${picocolors_1.default.cyan('magnet:')}, ...), or be ${picocolors_1.default.cyan('*')}`);
|
|
31
31
|
assertParams(urlSource, urlTarget);
|
|
32
32
|
const match = (0, resolveRouteString_js_1.resolveRouteString)(urlSource, urlPathname);
|
|
33
33
|
if (!match)
|
package/dist/cjs/utils/debug.js
CHANGED
|
@@ -10,24 +10,24 @@ const getTerminWidth_js_1 = require("./getTerminWidth.js");
|
|
|
10
10
|
// Avoid this to be loaded in the browser. For isomorphic code: instead of `import { createDebugger } from './utils.js'`, use `globalThis.createDebugger()`.
|
|
11
11
|
(0, assert_js_1.assert)(!(0, isBrowser_js_1.isBrowser)());
|
|
12
12
|
globalThis.__brillout_debug_createDebugger = createDebugger;
|
|
13
|
-
function createDebugger(
|
|
14
|
-
(0, checkType_js_1.checkType)(
|
|
13
|
+
function createDebugger(flag, optionsGlobal) {
|
|
14
|
+
(0, checkType_js_1.checkType)(flag);
|
|
15
15
|
const debugWithOptions = (optionsLocal) => {
|
|
16
16
|
return (...msgs) => {
|
|
17
17
|
const options = { ...optionsGlobal, ...optionsLocal };
|
|
18
|
-
debug_(
|
|
18
|
+
debug_(flag, options, ...msgs);
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
const debug = (...msgs) => debugWithOptions({})(...msgs);
|
|
22
|
-
(0, objectAssign_js_1.objectAssign)(debug, { options: debugWithOptions, isEnabled: isDebugEnabled(
|
|
22
|
+
(0, objectAssign_js_1.objectAssign)(debug, { options: debugWithOptions, isEnabled: isDebugEnabled(flag) });
|
|
23
23
|
return debug;
|
|
24
24
|
}
|
|
25
25
|
exports.createDebugger = createDebugger;
|
|
26
|
-
function debug_(
|
|
27
|
-
if (!isDebugEnabled(
|
|
26
|
+
function debug_(flag, options, ...msgs) {
|
|
27
|
+
if (!isDebugEnabled(flag))
|
|
28
28
|
return;
|
|
29
29
|
let [msgFirst, ...msgsRest] = msgs;
|
|
30
|
-
const padding = ' '.repeat(
|
|
30
|
+
const padding = ' '.repeat(flag.length + 1);
|
|
31
31
|
msgFirst = formatMsg(msgFirst, options, padding, 'FIRST');
|
|
32
32
|
msgsRest = msgsRest.map((msg, i) => {
|
|
33
33
|
const position = i === msgsRest.length - 1 ? 'LAST' : 'MIDDLE';
|
|
@@ -44,13 +44,13 @@ function debug_(namespace, options, ...msgs) {
|
|
|
44
44
|
logFirst = [msgFirst];
|
|
45
45
|
logsRest = msgsRest;
|
|
46
46
|
}
|
|
47
|
-
console.log('\x1b[1m%s\x1b[0m',
|
|
47
|
+
console.log('\x1b[1m%s\x1b[0m', flag, ...logFirst);
|
|
48
48
|
logsRest.forEach((msg) => {
|
|
49
49
|
console.log(msg);
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
function isDebugEnabled(
|
|
53
|
-
(0, checkType_js_1.checkType)(
|
|
52
|
+
function isDebugEnabled(flag) {
|
|
53
|
+
(0, checkType_js_1.checkType)(flag);
|
|
54
54
|
let DEBUG;
|
|
55
55
|
// - `process` can be undefined in edge workers
|
|
56
56
|
// - We want bundlers to be able to statically replace `process.env.*`
|
|
@@ -58,7 +58,7 @@ function isDebugEnabled(namespace) {
|
|
|
58
58
|
DEBUG = process.env.DEBUG;
|
|
59
59
|
}
|
|
60
60
|
catch { }
|
|
61
|
-
return DEBUG?.includes(
|
|
61
|
+
return DEBUG?.includes(flag) ?? false;
|
|
62
62
|
}
|
|
63
63
|
exports.isDebugEnabled = isDebugEnabled;
|
|
64
64
|
function formatMsg(info, options, padding, position) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PROJECT_VERSION = exports.projectInfo = void 0;
|
|
4
4
|
const assertSingleInstance_js_1 = require("./assertSingleInstance.js");
|
|
5
|
-
const PROJECT_VERSION = '0.4.
|
|
5
|
+
const PROJECT_VERSION = '0.4.152-commit-3d25618';
|
|
6
6
|
exports.PROJECT_VERSION = PROJECT_VERSION;
|
|
7
7
|
const projectInfo = {
|
|
8
8
|
projectName: 'Vike',
|
|
@@ -28,7 +28,7 @@ markEnvAsVite();
|
|
|
28
28
|
// Return as `any` to avoid Plugin type mismatches when there are multiple Vite versions installed
|
|
29
29
|
function plugin(vikeConfig) {
|
|
30
30
|
const plugins = [
|
|
31
|
-
resolveVikeConfig(vikeConfig),
|
|
31
|
+
resolveVikeConfig(vikeConfig), // The configResolved() hook of resolveVikeConfig() should be the first called
|
|
32
32
|
...commonConfig(),
|
|
33
33
|
importUserCode(),
|
|
34
34
|
...devConfig(),
|
|
@@ -17,11 +17,11 @@ function baseUrls(configVike) {
|
|
|
17
17
|
process.env.BASE_ASSETS = baseAssets;
|
|
18
18
|
return {
|
|
19
19
|
envPrefix: [
|
|
20
|
-
'VITE_',
|
|
20
|
+
'VITE_', // Vite doesn't seem to merge in its default, see https://github.com/vikejs/vike/issues/554
|
|
21
21
|
'BASE_SERVER',
|
|
22
22
|
'BASE_ASSETS'
|
|
23
23
|
],
|
|
24
|
-
base: baseAssets,
|
|
24
|
+
base: baseAssets, // Make Vite inject baseAssets to imports e.g. `import logoUrl from './logo.svg.js'`
|
|
25
25
|
_baseOriginal: config.base ?? '/__UNSET__' // Vite resolves `_baseOriginal: null` to `undefined`
|
|
26
26
|
};
|
|
27
27
|
},
|
|
@@ -8,7 +8,7 @@ function getVikeManifest(config, configVike) {
|
|
|
8
8
|
const runtimeManifest = getRuntimeManifest(configVike);
|
|
9
9
|
const manifest = {
|
|
10
10
|
version: projectInfo.projectVersion,
|
|
11
|
-
usesClientRouter: isUsingClientRouter(),
|
|
11
|
+
usesClientRouter: isUsingClientRouter(), // TODO/v1-release: remove
|
|
12
12
|
manifestKeyMap: getManifestKeyMap(configVike, config),
|
|
13
13
|
...runtimeManifest
|
|
14
14
|
};
|
|
@@ -28,7 +28,7 @@ function intercept(logType, config) {
|
|
|
28
28
|
if (options.error && store?.shouldErrorBeSwallowed(options.error)) {
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
// Remove this once https://github.com/vitejs/vite/pull/13495 is released
|
|
31
|
+
// Remove this once https://github.com/vitejs/vite/pull/13495 is released and widely used
|
|
32
32
|
if (msg.startsWith('Transform failed with ') && store && logType === 'error') {
|
|
33
33
|
store.markErrorMessageAsLogged(msg);
|
|
34
34
|
return;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { getCacheControl };
|
|
2
|
+
import { getConfigValue, getPageConfig } from '../../../../shared/page-configs/helpers.js';
|
|
3
|
+
const defaultValue = 'no-store, max-age=0';
|
|
4
|
+
function getCacheControl(pageId, pageConfigs) {
|
|
5
|
+
// TODO/v1-release: remove
|
|
6
|
+
if (pageConfigs.length === 0)
|
|
7
|
+
return defaultValue;
|
|
8
|
+
const pageConfig = getPageConfig(pageId, pageConfigs);
|
|
9
|
+
const configValue = getConfigValue(pageConfig, 'cacheControl', 'string');
|
|
10
|
+
const value = configValue?.value;
|
|
11
|
+
if (value)
|
|
12
|
+
return value;
|
|
13
|
+
// - Disabling caching by default is the safest strategy, because caching is problematic with authentication as described in https://github.com/vikejs/vike/issues/1275#issuecomment-1824366875
|
|
14
|
+
// - Are there use cases when we don't need to disable caching?
|
|
15
|
+
// - When there isn't any <script id="vike_pageContext" type="application/json"> then we can safely have caching. (We don't implement this exception because we're lazy and it's quite a rare situation.)
|
|
16
|
+
return defaultValue;
|
|
17
|
+
}
|
|
@@ -5,6 +5,7 @@ import { assert, assertWarning } from '../utils.js';
|
|
|
5
5
|
import { isErrorPage } from '../../../shared/error-page.js';
|
|
6
6
|
import { getHttpResponseBody, getHttpResponseBodyStreamHandlers } from './getHttpResponseBody.js';
|
|
7
7
|
import { getEarlyHints } from './getEarlyHints.js';
|
|
8
|
+
import { getCacheControl } from './createHttpResponseObject/getCacheControl.js';
|
|
8
9
|
import { assertNoInfiniteHttpRedirect } from './createHttpResponseObject/assertNoInfiniteHttpRedirect.js';
|
|
9
10
|
async function createHttpResponseObject(htmlRender, renderHook, pageContext) {
|
|
10
11
|
if (htmlRender === null) {
|
|
@@ -26,7 +27,13 @@ async function createHttpResponseObject(htmlRender, renderHook, pageContext) {
|
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
const earlyHints = getEarlyHints(await pageContext.__getPageAssets());
|
|
29
|
-
|
|
30
|
+
const headers = [];
|
|
31
|
+
assert(pageContext._pageId);
|
|
32
|
+
const cacheControl = getCacheControl(pageContext._pageId, pageContext._pageConfigs);
|
|
33
|
+
if (cacheControl) {
|
|
34
|
+
headers.push(['Cache-Control', cacheControl]);
|
|
35
|
+
}
|
|
36
|
+
return getHttpResponse(statusCode, 'text/html;charset=utf-8', headers, htmlRender, earlyHints, renderHook);
|
|
30
37
|
}
|
|
31
38
|
async function createHttpResponsePageContextJson(pageContextSerialized) {
|
|
32
39
|
const httpResponse = getHttpResponse(200, 'application/json', [], pageContextSerialized, [], null);
|
|
@@ -43,7 +43,8 @@ function collectCss(mod, styleUrls, visitedModules, importer) {
|
|
|
43
43
|
// - I believe some Vite plugins don't respect the \0 virtual module convention. What should we do then?
|
|
44
44
|
// - https://github.com/vikejs/vike/issues/1327
|
|
45
45
|
// - https://github.com/vikejs/vike/commit/3f7b9916dddc84e29e2c20d2b0df7211b6f1acbd
|
|
46
|
-
|
|
46
|
+
// - https://github.com/vikejs/vike/issues/479#issuecomment-1870043943
|
|
47
|
+
styleUrls.add(`/@id/__x00__${mod.url.substring(1)}`);
|
|
47
48
|
}
|
|
48
49
|
else {
|
|
49
50
|
// Is this useful? Maybe for virtual modules that don't respect the \0 virtual module convention?
|
|
@@ -105,7 +105,7 @@ async function prerender404Page(renderContext, pageContextInit_) {
|
|
|
105
105
|
_debugRouteMatches: []
|
|
106
106
|
};
|
|
107
107
|
const pageContextInit = {
|
|
108
|
-
urlOriginal: '/fake-404-url',
|
|
108
|
+
urlOriginal: '/fake-404-url', // A URL is needed for `applyViteHtmlTransform`
|
|
109
109
|
...pageContextInit_
|
|
110
110
|
};
|
|
111
111
|
{
|
|
@@ -2,7 +2,7 @@ export { renderPage };
|
|
|
2
2
|
export { renderPage_addWrapper };
|
|
3
3
|
import { getRenderContext, getPageContextInitEnhanced, renderPageAlreadyRouted } from './renderPage/renderPageAlreadyRouted.js';
|
|
4
4
|
import { route } from '../../shared/route/index.js';
|
|
5
|
-
import { assert, hasProp, objectAssign, isParsable, parseUrl, assertEnv, assertWarning, getGlobalObject, checkType, assertUsage, normalizeUrlPathname, removeBaseServer, modifyUrlPathname, prependBase, removeUrlOrigin, addUrlOrigin, createUrlFromComponents } from './utils.js';
|
|
5
|
+
import { assert, hasProp, objectAssign, isParsable, parseUrl, assertEnv, assertWarning, getGlobalObject, checkType, assertUsage, normalizeUrlPathname, removeBaseServer, modifyUrlPathname, prependBase, removeUrlOrigin, addUrlOrigin, createUrlFromComponents, isUriWithProtocol } from './utils.js';
|
|
6
6
|
import { assertNoInfiniteAbortLoop, getPageContextFromAllRewrites, isAbortError, logAbortErrorHandled } from '../../shared/route/abort.js';
|
|
7
7
|
import { getGlobalContext, initGlobalContext } from './globalContext.js';
|
|
8
8
|
import { handlePageContextRequestUrl } from './renderPage/handlePageContextRequestUrl.js';
|
|
@@ -337,21 +337,33 @@ function getPermanentRedirect(pageContextInit, httpRequestId) {
|
|
|
337
337
|
const { redirects, baseServer } = getGlobalContext();
|
|
338
338
|
const urlWithoutBase = removeBaseServer(pageContextInit.urlOriginal, baseServer);
|
|
339
339
|
let origin = null;
|
|
340
|
+
let urlTargetExternal = null;
|
|
340
341
|
let urlTarget = modifyUrlPathname(urlWithoutBase, (urlPathname) => {
|
|
341
|
-
const
|
|
342
|
-
if (
|
|
342
|
+
const urlTarget = resolveRedirects(redirects, urlPathname);
|
|
343
|
+
if (urlTarget === null)
|
|
343
344
|
return null;
|
|
344
|
-
|
|
345
|
+
if (!isParsable(urlTarget)) {
|
|
346
|
+
// E.g. `urlTarget === 'mailto:some@example.com'`
|
|
347
|
+
assert(isUriWithProtocol(urlTarget) && !urlTarget.startsWith('http'));
|
|
348
|
+
urlTargetExternal = urlTarget;
|
|
349
|
+
return null;
|
|
350
|
+
}
|
|
351
|
+
const { urlModified, origin: origin_ } = removeUrlOrigin(urlTarget);
|
|
345
352
|
origin = origin_;
|
|
346
353
|
return urlModified;
|
|
347
354
|
});
|
|
348
|
-
if (
|
|
349
|
-
urlTarget =
|
|
350
|
-
|
|
351
|
-
|
|
355
|
+
if (urlTargetExternal) {
|
|
356
|
+
urlTarget = urlTargetExternal;
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
if (origin)
|
|
360
|
+
urlTarget = addUrlOrigin(urlTarget, origin);
|
|
361
|
+
if (urlTarget === urlWithoutBase)
|
|
362
|
+
return null;
|
|
363
|
+
urlTarget = prependBase(urlTarget, baseServer);
|
|
364
|
+
assert(urlTarget !== pageContextInit.urlOriginal);
|
|
365
|
+
}
|
|
352
366
|
logRuntimeInfo?.(`Permanent redirect defined by your config.redirects (https://vike.dev/redirects)`, httpRequestId, 'info');
|
|
353
|
-
urlTarget = prependBase(urlTarget, baseServer);
|
|
354
|
-
assert(urlTarget !== pageContextInit.urlOriginal);
|
|
355
367
|
const httpResponse = createHttpResponseObjectRedirect({ url: urlTarget, statusCode: 301 }, urlWithoutBase);
|
|
356
368
|
const pageContextHttpResponse = { ...pageContextInit, httpResponse };
|
|
357
369
|
return pageContextHttpResponse;
|
|
@@ -28,6 +28,7 @@ declare global {
|
|
|
28
28
|
* - `vike-vue`
|
|
29
29
|
* - `vike-solid`
|
|
30
30
|
* - `vike-svelte`
|
|
31
|
+
* - `vike-angular`
|
|
31
32
|
*
|
|
32
33
|
* As a Vike user, you can ignore this.
|
|
33
34
|
*/
|
|
@@ -40,5 +41,7 @@ declare global {
|
|
|
40
41
|
}
|
|
41
42
|
interface ConfigVikeSvelte {
|
|
42
43
|
}
|
|
44
|
+
interface ConfigVikeAngular {
|
|
45
|
+
}
|
|
43
46
|
}
|
|
44
47
|
}
|
|
@@ -20,7 +20,7 @@ function getExports(pageFiles, pageConfig) {
|
|
|
20
20
|
exportValue,
|
|
21
21
|
exportSource: `${pageFile.filePath} > ${isFromDefaultExport ? `\`export default { ${exportName} }\`` : `\`export { ${exportName} }\``}`,
|
|
22
22
|
filePath: pageFile.filePath,
|
|
23
|
-
_filePath: pageFile.filePath,
|
|
23
|
+
_filePath: pageFile.filePath, // TODO/next-major-release: remove
|
|
24
24
|
_fileType: pageFile.fileType,
|
|
25
25
|
_isFromDefaultExport: isFromDefaultExport
|
|
26
26
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export type { PageContextConfig };
|
|
2
2
|
import type { VikePackages } from '../../VikeNamespace.js';
|
|
3
3
|
import type { ConfigBuiltIn } from '../Config.js';
|
|
4
|
-
import type { Combine, IsNotEmpty,
|
|
4
|
+
import type { Combine, IsNotEmpty, XOR5 } from './helpers.ts';
|
|
5
5
|
type PageContextConfig = ConfigBuiltIn & (ConfigVikePackagesNotEmptyXor extends true ? ConfigVikePackagesIntersection : ConfigVikePackagesCombined);
|
|
6
|
-
type ConfigVikePackagesIntersection = VikePackages.ConfigVikeReact & VikePackages.ConfigVikeVue & VikePackages.ConfigVikeSolid & VikePackages.ConfigVikeSvelte;
|
|
7
|
-
type ConfigVikePackagesCombined = Combine<VikePackages.ConfigVikeReact, Combine<VikePackages.ConfigVikeVue, Combine<VikePackages.ConfigVikeSolid, VikePackages.ConfigVikeSvelte
|
|
8
|
-
type ConfigVikePackagesNotEmptyXor =
|
|
6
|
+
type ConfigVikePackagesIntersection = VikePackages.ConfigVikeReact & VikePackages.ConfigVikeVue & VikePackages.ConfigVikeSolid & VikePackages.ConfigVikeSvelte & VikePackages.ConfigVikeAngular;
|
|
7
|
+
type ConfigVikePackagesCombined = Combine<VikePackages.ConfigVikeReact, Combine<VikePackages.ConfigVikeVue, Combine<VikePackages.ConfigVikeSolid, Combine<VikePackages.ConfigVikeSvelte, VikePackages.ConfigVikeAngular>>>>;
|
|
8
|
+
type ConfigVikePackagesNotEmptyXor = XOR5<IsNotEmpty<VikePackages.ConfigVikeReact>, IsNotEmpty<VikePackages.ConfigVikeVue>, IsNotEmpty<VikePackages.ConfigVikeSolid>, IsNotEmpty<VikePackages.ConfigVikeSvelte>, IsNotEmpty<VikePackages.ConfigVikeAngular>>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export type { IsNotEmpty };
|
|
2
|
-
export type {
|
|
2
|
+
export type { XOR5 };
|
|
3
3
|
export type { Combine };
|
|
4
4
|
type IsNotEmpty<T> = Not<IsEmpty<T>>;
|
|
5
5
|
type IsEmpty<T> = keyof T extends never ? true : false;
|
|
6
6
|
type Combine<T1, T2> = {
|
|
7
7
|
[K in keyof T1 | keyof T2]?: (K extends keyof T1 ? T1[K] : never) | (K extends keyof T2 ? T2[K] : never);
|
|
8
8
|
};
|
|
9
|
-
type
|
|
9
|
+
type XOR5<T1 extends boolean, T2 extends boolean, T3 extends boolean, T4 extends boolean, T5 extends boolean> = (T1 extends true ? T2 extends true ? false : T3 extends true ? false : T4 extends true ? false : Not<T5> : T2 extends true ? T3 extends true ? false : T4 extends true ? false : Not<T5> : T3 extends true ? T4 extends true ? false : Not<T5> : T4 extends true ? Not<T5> : T5);
|
|
10
10
|
type Not<T extends boolean> = T extends true ? false : true;
|
|
@@ -41,7 +41,7 @@ type HookNamePage = 'onHydrationEnd' | 'onBeforePrerenderStart' | 'onBeforeRende
|
|
|
41
41
|
type HookNameGlobal = 'onBeforePrerender' | 'onBeforeRoute' | 'onPrerenderStart';
|
|
42
42
|
type HookNameOldDesign = 'render' | 'prerender';
|
|
43
43
|
type ConfigNameBuiltIn = Exclude<keyof Config, keyof ConfigVikeUserProvided | 'onBeforeRoute' | 'onPrerenderStart'> | 'prerender' | 'isClientSideRenderable' | 'onBeforeRenderEnv' | 'dataEnv' | 'hooksTimeout';
|
|
44
|
-
type Config = ConfigBuiltIn & Vike.Config & (VikePackages.ConfigVikeReact | VikePackages.ConfigVikeVue | VikePackages.ConfigVikeSolid | VikePackages.ConfigVikeSvelte);
|
|
44
|
+
type Config = ConfigBuiltIn & Vike.Config & (VikePackages.ConfigVikeReact | VikePackages.ConfigVikeVue | VikePackages.ConfigVikeSolid | VikePackages.ConfigVikeSvelte | VikePackages.ConfigVikeAngular);
|
|
45
45
|
/** Hook for fetching data.
|
|
46
46
|
*
|
|
47
47
|
* https://vike.dev/data
|
|
@@ -66,17 +66,21 @@ type GuardSync = (pageContext: PageContextServer) => void;
|
|
|
66
66
|
*
|
|
67
67
|
* https://vike.dev/onBeforePrerenderStart
|
|
68
68
|
*/
|
|
69
|
-
type OnBeforePrerenderStartAsync = () => Promise<(string | {
|
|
69
|
+
type OnBeforePrerenderStartAsync<Data = unknown> = () => Promise<(string | {
|
|
70
70
|
url: string;
|
|
71
|
-
pageContext: Partial<Vike.PageContext
|
|
71
|
+
pageContext: Partial<Vike.PageContext & {
|
|
72
|
+
data: Data;
|
|
73
|
+
}>;
|
|
72
74
|
})[]>;
|
|
73
75
|
/** Global Hook called before the whole pre-rendering process starts.
|
|
74
76
|
*
|
|
75
77
|
* https://vike.dev/onBeforePrerenderStart
|
|
76
78
|
*/
|
|
77
|
-
type OnBeforePrerenderStartSync = () => (string | {
|
|
79
|
+
type OnBeforePrerenderStartSync<Data = unknown> = () => (string | {
|
|
78
80
|
url: string;
|
|
79
|
-
pageContext: Partial<Vike.PageContext
|
|
81
|
+
pageContext: Partial<Vike.PageContext & {
|
|
82
|
+
data: Data;
|
|
83
|
+
}>;
|
|
80
84
|
})[];
|
|
81
85
|
/** Hook called before the page is rendered.
|
|
82
86
|
*
|
|
@@ -213,10 +217,6 @@ type RouteSync = (pageContext: PageContextServer | PageContextClient) => {
|
|
|
213
217
|
routeParams?: Record<string, string>;
|
|
214
218
|
precedence?: number;
|
|
215
219
|
} | boolean;
|
|
216
|
-
/** The page's URL(s).
|
|
217
|
-
*
|
|
218
|
-
* https://vike.dev/route
|
|
219
|
-
*/
|
|
220
220
|
/** Page configuration.
|
|
221
221
|
*
|
|
222
222
|
* https://vike.dev/config
|
|
@@ -336,8 +336,17 @@ type ConfigBuiltIn = {
|
|
|
336
336
|
* https://vike.dev/prefetchStaticAssets
|
|
337
337
|
*/
|
|
338
338
|
prefetchStaticAssets?: PrefetchStaticAssets | ImportString;
|
|
339
|
-
/** Modify the
|
|
339
|
+
/** Modify the timeouts of hooks. */
|
|
340
340
|
hooksTimeout?: HooksTimeoutProvidedByUser;
|
|
341
|
+
/** `Cache-Control` HTTP header value.
|
|
342
|
+
*
|
|
343
|
+
* Default: `no-store, max-age=0`
|
|
344
|
+
*
|
|
345
|
+
* Set to an empty string to not send the header.
|
|
346
|
+
*
|
|
347
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
|
|
348
|
+
*/
|
|
349
|
+
cacheControl?: string;
|
|
341
350
|
};
|
|
342
351
|
type ConfigMeta = Record<string, ConfigDefinition>;
|
|
343
352
|
type ImportString = `import:${string}`;
|
|
@@ -23,7 +23,7 @@ function resolveRouteStringRedirect(urlSource, urlTarget, urlPathname) {
|
|
|
23
23
|
assertUsage(urlTarget.startsWith('/') ||
|
|
24
24
|
// Is allowing any protocol a safety issue? https://github.com/vikejs/vike/pull/1292#issuecomment-1828043917
|
|
25
25
|
isUriWithProtocol(urlTarget) ||
|
|
26
|
-
urlTarget === '*', `${configSrc} Invalid redirection target URL ${pc.cyan(urlTarget)}: the target URL should start with ${pc.cyan('/')}, a valid protocol (${pc.cyan('https:')}, ${pc.cyan('http:')}, ${pc.cyan('ipfs:')}, ${pc.cyan('magnet:')}, ...), or be ${pc.cyan('*')}`);
|
|
26
|
+
urlTarget === '*', `${configSrc} Invalid redirection target URL ${pc.cyan(urlTarget)}: the target URL should start with ${pc.cyan('/')}, a valid protocol (${pc.cyan('https:')}, ${pc.cyan('http:')}, ${pc.cyan('mailto:')}, ${pc.cyan('ipfs:')}, ${pc.cyan('magnet:')}, ...), or be ${pc.cyan('*')}`);
|
|
27
27
|
assertParams(urlSource, urlTarget);
|
|
28
28
|
const match = resolveRouteString(urlSource, urlPathname);
|
|
29
29
|
if (!match)
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export { createDebugger };
|
|
2
2
|
export { isDebugEnabled };
|
|
3
3
|
export type { Debug };
|
|
4
|
-
type
|
|
4
|
+
type Flag = 'vike:routing' | 'vike:error' | 'vike:stream' | 'vike:log' | 'vike:virtual-files' | 'vike:outDir' | 'vike:extractExportNames' | 'vike:extractAssets' | 'vike:glob' | 'vike:pageFiles' | 'vike:stem';
|
|
5
5
|
type Debug = ReturnType<typeof createDebugger>;
|
|
6
6
|
type Options = {
|
|
7
7
|
serialization?: {
|
|
8
8
|
emptyArray?: string;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
-
declare function createDebugger(
|
|
11
|
+
declare function createDebugger(flag: Flag, optionsGlobal?: Options): ((...msgs: unknown[]) => void) & {
|
|
12
12
|
options: (optionsLocal: Options) => (...msgs: unknown[]) => void;
|
|
13
13
|
isEnabled: boolean;
|
|
14
14
|
};
|
|
15
|
-
declare function isDebugEnabled(
|
|
15
|
+
declare function isDebugEnabled(flag: Flag): boolean;
|
package/dist/esm/utils/debug.js
CHANGED
|
@@ -9,23 +9,23 @@ import { getTerminalWidth } from './getTerminWidth.js';
|
|
|
9
9
|
// Avoid this to be loaded in the browser. For isomorphic code: instead of `import { createDebugger } from './utils.js'`, use `globalThis.createDebugger()`.
|
|
10
10
|
assert(!isBrowser());
|
|
11
11
|
globalThis.__brillout_debug_createDebugger = createDebugger;
|
|
12
|
-
function createDebugger(
|
|
13
|
-
checkType(
|
|
12
|
+
function createDebugger(flag, optionsGlobal) {
|
|
13
|
+
checkType(flag);
|
|
14
14
|
const debugWithOptions = (optionsLocal) => {
|
|
15
15
|
return (...msgs) => {
|
|
16
16
|
const options = { ...optionsGlobal, ...optionsLocal };
|
|
17
|
-
debug_(
|
|
17
|
+
debug_(flag, options, ...msgs);
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
20
|
const debug = (...msgs) => debugWithOptions({})(...msgs);
|
|
21
|
-
objectAssign(debug, { options: debugWithOptions, isEnabled: isDebugEnabled(
|
|
21
|
+
objectAssign(debug, { options: debugWithOptions, isEnabled: isDebugEnabled(flag) });
|
|
22
22
|
return debug;
|
|
23
23
|
}
|
|
24
|
-
function debug_(
|
|
25
|
-
if (!isDebugEnabled(
|
|
24
|
+
function debug_(flag, options, ...msgs) {
|
|
25
|
+
if (!isDebugEnabled(flag))
|
|
26
26
|
return;
|
|
27
27
|
let [msgFirst, ...msgsRest] = msgs;
|
|
28
|
-
const padding = ' '.repeat(
|
|
28
|
+
const padding = ' '.repeat(flag.length + 1);
|
|
29
29
|
msgFirst = formatMsg(msgFirst, options, padding, 'FIRST');
|
|
30
30
|
msgsRest = msgsRest.map((msg, i) => {
|
|
31
31
|
const position = i === msgsRest.length - 1 ? 'LAST' : 'MIDDLE';
|
|
@@ -42,13 +42,13 @@ function debug_(namespace, options, ...msgs) {
|
|
|
42
42
|
logFirst = [msgFirst];
|
|
43
43
|
logsRest = msgsRest;
|
|
44
44
|
}
|
|
45
|
-
console.log('\x1b[1m%s\x1b[0m',
|
|
45
|
+
console.log('\x1b[1m%s\x1b[0m', flag, ...logFirst);
|
|
46
46
|
logsRest.forEach((msg) => {
|
|
47
47
|
console.log(msg);
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
function isDebugEnabled(
|
|
51
|
-
checkType(
|
|
50
|
+
function isDebugEnabled(flag) {
|
|
51
|
+
checkType(flag);
|
|
52
52
|
let DEBUG;
|
|
53
53
|
// - `process` can be undefined in edge workers
|
|
54
54
|
// - We want bundlers to be able to statically replace `process.env.*`
|
|
@@ -56,7 +56,7 @@ function isDebugEnabled(namespace) {
|
|
|
56
56
|
DEBUG = process.env.DEBUG;
|
|
57
57
|
}
|
|
58
58
|
catch { }
|
|
59
|
-
return DEBUG?.includes(
|
|
59
|
+
return DEBUG?.includes(flag) ?? false;
|
|
60
60
|
}
|
|
61
61
|
function formatMsg(info, options, padding, position) {
|
|
62
62
|
if (info === undefined) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export { projectInfo };
|
|
2
2
|
export type { ProjectTag };
|
|
3
3
|
export { PROJECT_VERSION };
|
|
4
|
-
declare const PROJECT_VERSION: "0.4.
|
|
4
|
+
declare const PROJECT_VERSION: "0.4.152-commit-3d25618";
|
|
5
5
|
type PackageName = typeof projectInfo.npmPackageName;
|
|
6
6
|
type ProjectVersion = typeof projectInfo.projectVersion;
|
|
7
7
|
type ProjectTag = `[${PackageName}]` | `[${PackageName}@${ProjectVersion}]`;
|
|
8
8
|
declare const projectInfo: {
|
|
9
9
|
projectName: "Vike";
|
|
10
|
-
projectVersion: "0.4.
|
|
10
|
+
projectVersion: "0.4.152-commit-3d25618";
|
|
11
11
|
npmPackageName: "vike";
|
|
12
12
|
githubRepository: "https://github.com/vikejs/vike";
|
|
13
13
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { projectInfo };
|
|
2
2
|
export { PROJECT_VERSION };
|
|
3
3
|
import { onProjectInfo } from './assertSingleInstance.js';
|
|
4
|
-
const PROJECT_VERSION = '0.4.
|
|
4
|
+
const PROJECT_VERSION = '0.4.152-commit-3d25618';
|
|
5
5
|
const projectInfo = {
|
|
6
6
|
projectName: 'Vike',
|
|
7
7
|
projectVersion: PROJECT_VERSION,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vike",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.152-commit-3d25618",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "tsc --watch",
|
|
6
6
|
"build": "rimraf dist/ && pnpm run build:esm && pnpm run build:cjs",
|
|
@@ -12,18 +12,18 @@
|
|
|
12
12
|
"release:commit": "release-me commit"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@brillout/import": "0.2.3",
|
|
15
|
+
"@brillout/import": "^0.2.3",
|
|
16
16
|
"@brillout/json-serializer": "^0.5.8",
|
|
17
17
|
"@brillout/picocolors": "^1.0.10",
|
|
18
18
|
"@brillout/require-shim": "^0.1.2",
|
|
19
19
|
"@brillout/vite-plugin-import-build": "^0.3.1",
|
|
20
|
-
"acorn": "^8.
|
|
21
|
-
"cac": "^6.
|
|
22
|
-
"es-module-lexer": "^1.
|
|
23
|
-
"esbuild": "^0.
|
|
24
|
-
"fast-glob": "^3.
|
|
25
|
-
"sirv": "^2.0.
|
|
26
|
-
"source-map-support": "^0.5.
|
|
20
|
+
"acorn": "^8.0.0",
|
|
21
|
+
"cac": "^6.0.0",
|
|
22
|
+
"es-module-lexer": "^1.0.0",
|
|
23
|
+
"esbuild": "^0.19.0",
|
|
24
|
+
"fast-glob": "^3.0.0",
|
|
25
|
+
"sirv": "^2.0.0",
|
|
26
|
+
"source-map-support": "^0.5.0"
|
|
27
27
|
},
|
|
28
28
|
"type": "module",
|
|
29
29
|
"exports": {
|
|
@@ -169,15 +169,27 @@
|
|
|
169
169
|
"vike": "./node/cli/bin-entry.js"
|
|
170
170
|
},
|
|
171
171
|
"devDependencies": {
|
|
172
|
-
"@brillout/
|
|
173
|
-
"@
|
|
174
|
-
"@
|
|
175
|
-
"@
|
|
176
|
-
"@
|
|
177
|
-
"
|
|
178
|
-
"
|
|
179
|
-
"
|
|
180
|
-
"
|
|
172
|
+
"@brillout/import": "^0.2.3",
|
|
173
|
+
"@brillout/json-serializer": "^0.5.8",
|
|
174
|
+
"@brillout/picocolors": "^1.0.10",
|
|
175
|
+
"@brillout/require-shim": "^0.1.2",
|
|
176
|
+
"@brillout/vite-plugin-import-build": "^0.3.1",
|
|
177
|
+
"acorn": "^8.11.2",
|
|
178
|
+
"cac": "^6.7.14",
|
|
179
|
+
"es-module-lexer": "^1.4.1",
|
|
180
|
+
"esbuild": "^0.19.10",
|
|
181
|
+
"fast-glob": "^3.3.2",
|
|
182
|
+
"sirv": "^2.0.4",
|
|
183
|
+
"source-map-support": "^0.5.21",
|
|
184
|
+
"@brillout/release-me": "^0.1.13",
|
|
185
|
+
"@types/estree": "^1.0.5",
|
|
186
|
+
"@types/jest": "^29.5.11",
|
|
187
|
+
"@types/node": "^20.10.5",
|
|
188
|
+
"@types/resolve": "^1.20.6",
|
|
189
|
+
"@types/source-map-support": "^0.5.10",
|
|
190
|
+
"rimraf": "^5.0.5",
|
|
191
|
+
"typescript": "^5.3.3",
|
|
192
|
+
"vite": "^5.0.10"
|
|
181
193
|
},
|
|
182
194
|
"engines": {
|
|
183
195
|
"node": ">=16.0.0"
|