vike 0.4.193 → 0.4.195-commit-486b49a
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/LICENSE.md +9 -0
- package/RenderErrorPage.js +1 -0
- package/__internal/setup.js +1 -0
- package/__internal.js +1 -0
- package/abort.js +1 -0
- package/cli.js +1 -0
- package/client/router.js +1 -0
- package/client.js +1 -0
- package/dist/cjs/node/plugin/plugins/importBuild/index.js +2 -2
- package/dist/cjs/node/plugin/plugins/importUserCode/index.js +1 -5
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js +5 -1
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +2 -2
- package/dist/cjs/node/plugin/shared/addSsrMiddleware.js +4 -9
- package/dist/cjs/node/plugin/shared/loggerNotProd/log.js +1 -13
- package/dist/cjs/node/plugin/shared/loggerNotProd.js +2 -24
- package/dist/cjs/node/plugin/shared/loggerVite.js +0 -3
- package/dist/cjs/node/runtime/globalContext/loadImportBuild.js +2 -2
- package/dist/cjs/node/runtime/html/injectAssets/getHtmlTags.js +17 -12
- package/dist/cjs/node/runtime/html/injectAssets/injectHtmlTags.js +1 -1
- package/dist/cjs/node/runtime/html/injectAssets.js +2 -2
- package/dist/cjs/node/runtime/renderPage/analyzePage.js +4 -4
- package/dist/cjs/node/runtime/renderPage/assertArguments.js +3 -3
- package/dist/cjs/node/runtime/renderPage/{createHttpResponseObject.js → createHttpResponse.js} +34 -15
- package/dist/cjs/node/runtime/renderPage/executeOnRenderHtmlHook.js +3 -5
- package/dist/cjs/node/runtime/renderPage/handleErrorWithoutErrorPage.js +4 -3
- package/dist/cjs/node/runtime/renderPage/inferMediaType.js +3 -0
- package/dist/cjs/node/runtime/renderPage/isConfigInvalid.js +4 -2
- package/dist/cjs/node/runtime/renderPage/renderPageAlreadyRouted.js +6 -12
- package/dist/cjs/node/runtime/renderPage.js +62 -66
- package/dist/cjs/shared/getPageFiles/analyzeClientSide.js +3 -3
- package/dist/cjs/shared/page-configs/assertPlusFileExport.js +1 -2
- package/dist/cjs/shared/route/executeOnBeforeRouteHook.js +1 -1
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/cjs/utils/isArray.js +1 -1
- package/dist/cjs/utils/parseUrl-extras.js +6 -1
- package/dist/esm/client/client-routing-runtime/isClientSideRoutable.js +2 -2
- package/dist/esm/client/client-routing-runtime/renderPageClientSide.js +30 -15
- package/dist/esm/node/plugin/plugins/importBuild/index.js +1 -1
- package/dist/esm/node/plugin/plugins/importUserCode/index.js +2 -6
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js +5 -1
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +2 -2
- package/dist/esm/node/plugin/shared/addSsrMiddleware.js +4 -9
- package/dist/esm/node/plugin/shared/loggerNotProd/log.d.ts +0 -7
- package/dist/esm/node/plugin/shared/loggerNotProd/log.js +0 -12
- package/dist/esm/node/plugin/shared/loggerNotProd.d.ts +1 -7
- package/dist/esm/node/plugin/shared/loggerNotProd.js +2 -24
- package/dist/esm/node/plugin/shared/loggerVite.js +1 -4
- package/dist/esm/node/runtime/globalContext/loadImportBuild.js +1 -1
- package/dist/esm/node/runtime/html/injectAssets/getHtmlTags.d.ts +1 -1
- package/dist/esm/node/runtime/html/injectAssets/getHtmlTags.js +17 -12
- package/dist/esm/node/runtime/html/injectAssets/injectHtmlTags.js +1 -1
- package/dist/esm/node/runtime/html/injectAssets.js +2 -2
- package/dist/esm/node/runtime/renderPage/analyzePage.js +4 -4
- package/dist/esm/node/runtime/renderPage/assertArguments.js +3 -3
- package/dist/esm/node/runtime/renderPage/{createHttpResponseObject.d.ts → createHttpResponse.d.ts} +13 -5
- package/dist/esm/node/runtime/renderPage/{createHttpResponseObject.js → createHttpResponse.js} +34 -15
- package/dist/esm/node/runtime/renderPage/executeOnRenderHtmlHook.d.ts +1 -1
- package/dist/esm/node/runtime/renderPage/executeOnRenderHtmlHook.js +3 -5
- package/dist/esm/node/runtime/renderPage/handleErrorWithoutErrorPage.d.ts +2 -0
- package/dist/esm/node/runtime/renderPage/handleErrorWithoutErrorPage.js +4 -3
- package/dist/esm/node/runtime/renderPage/inferMediaType.d.ts +1 -1
- package/dist/esm/node/runtime/renderPage/inferMediaType.js +3 -0
- package/dist/esm/node/runtime/renderPage/isConfigInvalid.d.ts +6 -2
- package/dist/esm/node/runtime/renderPage/isConfigInvalid.js +6 -2
- package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.d.ts +2 -2
- package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.js +5 -11
- package/dist/esm/node/runtime/renderPage.d.ts +2 -2
- package/dist/esm/node/runtime/renderPage.js +62 -66
- package/dist/esm/shared/getPageFiles/analyzeClientSide.d.ts +1 -1
- package/dist/esm/shared/getPageFiles/analyzeClientSide.js +3 -3
- package/dist/esm/shared/page-configs/Config.d.ts +2 -2
- package/dist/esm/shared/page-configs/assertPlusFileExport.js +1 -2
- package/dist/esm/shared/route/abort.d.ts +3 -3
- package/dist/esm/shared/route/executeOnBeforeRouteHook.js +1 -1
- package/dist/esm/types/index.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/utils/isArray.js +1 -1
- package/dist/esm/utils/parseUrl-extras.d.ts +2 -0
- package/dist/esm/utils/parseUrl-extras.js +5 -0
- package/dist/esm/utils/projectInfo.d.ts +1 -1
- package/package.json +69 -68
- package/plugin.js +1 -0
- package/prerender.js +1 -0
- package/routing.js +1 -0
- package/server.js +1 -0
- /package/dist/cjs/node/runtime/renderPage/{createHttpResponseObject → createHttpResponse}/assertNoInfiniteHttpRedirect.js +0 -0
- /package/dist/cjs/node/runtime/renderPage/{createHttpResponseObject → createHttpResponse}/getCacheControl.js +0 -0
- /package/dist/esm/node/runtime/renderPage/{createHttpResponseObject → createHttpResponse}/assertNoInfiniteHttpRedirect.d.ts +0 -0
- /package/dist/esm/node/runtime/renderPage/{createHttpResponseObject → createHttpResponse}/assertNoInfiniteHttpRedirect.js +0 -0
- /package/dist/esm/node/runtime/renderPage/{createHttpResponseObject → createHttpResponse}/getCacheControl.d.ts +0 -0
- /package/dist/esm/node/runtime/renderPage/{createHttpResponseObject → createHttpResponse}/getCacheControl.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { renderPage };
|
|
2
2
|
export { renderPage_addWrapper };
|
|
3
|
-
import { HttpResponse } from './renderPage/
|
|
3
|
+
import { HttpResponse } from './renderPage/createHttpResponse.js';
|
|
4
4
|
import type { PageContextServer } from '../../types/index.js';
|
|
5
5
|
declare let renderPage_wrapper: <PageContext>(_httpRequestId: number, ret: () => Promise<PageContext>) => Promise<{
|
|
6
6
|
pageContextReturn: Awaited<PageContext>;
|
|
@@ -12,5 +12,5 @@ declare function renderPage<PageContextUserAdded extends {}, PageContextInit ext
|
|
|
12
12
|
/** The URL of the HTTP request */
|
|
13
13
|
urlOriginal: string;
|
|
14
14
|
}>(pageContextInit: PageContextInit): Promise<PageContextInit & {
|
|
15
|
-
httpResponse: HttpResponse
|
|
15
|
+
httpResponse: HttpResponse;
|
|
16
16
|
} & Partial<PageContextServer & PageContextUserAdded>>;
|
|
@@ -2,11 +2,11 @@ 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, isUrl, parseUrl, assertEnv, assertWarning, getGlobalObject, checkType, assertUsage, normalizeUrlPathname, removeBaseServer, modifyUrlPathname, prependBase, removeUrlOrigin, addUrlOrigin, createUrlFromComponents, isUri } from './utils.js';
|
|
5
|
+
import { assert, hasProp, objectAssign, isUrl, parseUrl, assertEnv, assertWarning, getGlobalObject, checkType, assertUsage, normalizeUrlPathname, removeBaseServer, modifyUrlPathname, prependBase, removeUrlOrigin, addUrlOrigin, createUrlFromComponents, isUri, getUrlPretty } from './utils.js';
|
|
6
6
|
import { assertNoInfiniteAbortLoop, getPageContextFromAllRewrites, isAbortError, logAbortErrorHandled } from '../../shared/route/abort.js';
|
|
7
7
|
import { getGlobalContext, initGlobalContext_renderPage } from './globalContext.js';
|
|
8
8
|
import { handlePageContextRequestUrl } from './renderPage/handlePageContextRequestUrl.js';
|
|
9
|
-
import {
|
|
9
|
+
import { createHttpResponseFavicon404, createHttpResponseRedirect, createHttpResponsePageContextJson, createHttpResponseError } from './renderPage/createHttpResponse.js';
|
|
10
10
|
import { logRuntimeError, logRuntimeInfo } from './renderPage/loggerRuntime.js';
|
|
11
11
|
import { isNewError } from './renderPage/isNewError.js';
|
|
12
12
|
import { assertArguments } from './renderPage/assertArguments.js';
|
|
@@ -19,8 +19,7 @@ import { handleErrorWithoutErrorPage } from './renderPage/handleErrorWithoutErro
|
|
|
19
19
|
import { loadUserFilesServerSide } from './renderPage/loadUserFilesServerSide.js';
|
|
20
20
|
import { resolveRedirects } from './renderPage/resolveRedirects.js';
|
|
21
21
|
const globalObject = getGlobalObject('runtime/renderPage.ts', {
|
|
22
|
-
httpRequestsCount: 0
|
|
23
|
-
pendingRequestsCount: 0
|
|
22
|
+
httpRequestsCount: 0
|
|
24
23
|
});
|
|
25
24
|
let renderPage_wrapper = async (_httpRequestId, ret) => ({
|
|
26
25
|
pageContextReturn: await ret()
|
|
@@ -31,32 +30,34 @@ const renderPage_addWrapper = (wrapper) => {
|
|
|
31
30
|
// `renderPage()` calls `renderPageNominal()` while ensuring that errors are `console.error(err)` instead of `throw err`, so that Vike never triggers a server shut down. (Throwing an error in an Express.js middleware shuts down the whole Express.js server.)
|
|
32
31
|
async function renderPage(pageContextInit) {
|
|
33
32
|
assertArguments(...arguments);
|
|
34
|
-
assert(hasProp(pageContextInit, 'urlOriginal', 'string'));
|
|
33
|
+
assert(hasProp(pageContextInit, 'urlOriginal', 'string')); // assertUsage() already implemented at assertArguments()
|
|
35
34
|
assertEnv();
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
assertIsUrl(pageContextInit.urlOriginal);
|
|
36
|
+
const urlPathnameWithBase = parseUrl(pageContextInit.urlOriginal, '/').pathname;
|
|
37
|
+
assertIsNotViteRequest(urlPathnameWithBase, pageContextInit.urlOriginal);
|
|
38
|
+
if (urlPathnameWithBase.endsWith('/favicon.ico'))
|
|
39
|
+
return getPageContextHttpResponseFavicon404(pageContextInit);
|
|
41
40
|
const httpRequestId = getRequestId();
|
|
42
|
-
const
|
|
43
|
-
logHttpRequest(
|
|
44
|
-
globalObject.pendingRequestsCount++;
|
|
41
|
+
const urlOriginalPretty = getUrlPretty(pageContextInit.urlOriginal);
|
|
42
|
+
logHttpRequest(urlOriginalPretty, httpRequestId);
|
|
45
43
|
const { pageContextReturn } = await renderPage_wrapper(httpRequestId, () => renderPageAndPrepare(pageContextInit, httpRequestId));
|
|
46
|
-
logHttpResponse(
|
|
47
|
-
globalObject.pendingRequestsCount--;
|
|
44
|
+
logHttpResponse(urlOriginalPretty, httpRequestId, pageContextReturn);
|
|
48
45
|
checkType(pageContextReturn);
|
|
46
|
+
assert(pageContextReturn.httpResponse);
|
|
49
47
|
return pageContextReturn;
|
|
50
48
|
}
|
|
51
49
|
async function renderPageAndPrepare(pageContextInit, httpRequestId) {
|
|
52
50
|
// Invalid config
|
|
53
|
-
const handleInvalidConfig = () => {
|
|
51
|
+
const handleInvalidConfig = (err) => {
|
|
54
52
|
logRuntimeInfo?.(pc.bold(pc.red('Error while loading a Vike config file, see error above.')), httpRequestId, 'error');
|
|
55
|
-
const
|
|
56
|
-
return
|
|
53
|
+
const pageContextWithError = getPageContextHttpResponseError(err, pageContextInit, null);
|
|
54
|
+
return pageContextWithError;
|
|
57
55
|
};
|
|
58
56
|
if (isConfigInvalid) {
|
|
59
|
-
|
|
57
|
+
if (1 < 2 // Make TS happy
|
|
58
|
+
) {
|
|
59
|
+
return handleInvalidConfig(isConfigInvalid.err);
|
|
60
|
+
}
|
|
60
61
|
}
|
|
61
62
|
// Prepare context
|
|
62
63
|
let renderContext;
|
|
@@ -69,21 +70,17 @@ async function renderPageAndPrepare(pageContextInit, httpRequestId) {
|
|
|
69
70
|
// initGlobalContext_renderPage() and getRenderContext() don't call any user hooks => err isn't thrown from user code.
|
|
70
71
|
assert(!isAbortError(err));
|
|
71
72
|
logRuntimeError(err, httpRequestId);
|
|
72
|
-
const
|
|
73
|
-
return
|
|
73
|
+
const pageContextWithError = getPageContextHttpResponseError(err, pageContextInit, null);
|
|
74
|
+
return pageContextWithError;
|
|
74
75
|
}
|
|
75
76
|
if (isConfigInvalid) {
|
|
76
|
-
return handleInvalidConfig();
|
|
77
|
+
return handleInvalidConfig(isConfigInvalid.err);
|
|
77
78
|
}
|
|
78
79
|
else {
|
|
79
80
|
// From now on, renderContext.pageConfigs contains all the configuration data; getVikeConfig() isn't called anymore for this request
|
|
80
81
|
}
|
|
81
82
|
// Check Base URL
|
|
82
|
-
|
|
83
|
-
const pageContextHttpResponse = checkBaseUrl(pageContextInit, httpRequestId);
|
|
84
|
-
if (pageContextHttpResponse)
|
|
85
|
-
return pageContextHttpResponse;
|
|
86
|
-
}
|
|
83
|
+
assertBaseUrl(pageContextInit);
|
|
87
84
|
// Normalize URL
|
|
88
85
|
{
|
|
89
86
|
const pageContextHttpResponse = normalizeUrl(pageContextInit, httpRequestId);
|
|
@@ -179,8 +176,8 @@ async function renderPageAlreadyPrepared(pageContextInit, httpRequestId, renderC
|
|
|
179
176
|
if (!handled.pageContextReturn) {
|
|
180
177
|
const pageContextAbort = errErrorPage._pageContextAbort;
|
|
181
178
|
assertWarning(false, `Failed to render error page because ${pc.cyan(pageContextAbort._abortCall)} was called: make sure ${pc.cyan(pageContextAbort._abortCaller)} doesn't occur while the error page is being rendered.`, { onlyOnce: false });
|
|
182
|
-
const
|
|
183
|
-
return
|
|
179
|
+
const pageContextHttpWithError = getPageContextHttpResponseError(errNominalPage, pageContextInit, pageContextErrorPageInit);
|
|
180
|
+
return pageContextHttpWithError;
|
|
184
181
|
}
|
|
185
182
|
// `throw redirect()` / `throw render(url)`
|
|
186
183
|
return handled.pageContextReturn;
|
|
@@ -188,20 +185,19 @@ async function renderPageAlreadyPrepared(pageContextInit, httpRequestId, renderC
|
|
|
188
185
|
if (isNewError(errErrorPage, errNominalPage)) {
|
|
189
186
|
logRuntimeError(errErrorPage, httpRequestId);
|
|
190
187
|
}
|
|
191
|
-
const
|
|
192
|
-
return
|
|
188
|
+
const pageContextWithError = getPageContextHttpResponseError(errNominalPage, pageContextInit, pageContextErrorPageInit);
|
|
189
|
+
return pageContextWithError;
|
|
193
190
|
}
|
|
194
191
|
return pageContextErrorPage;
|
|
195
192
|
}
|
|
196
193
|
}
|
|
197
194
|
function logHttpRequest(urlOriginal, httpRequestId) {
|
|
198
|
-
|
|
199
|
-
logRuntimeInfo?.(getRequestInfoMessage(urlOriginal), httpRequestId, 'info', clearErrors);
|
|
195
|
+
logRuntimeInfo?.(getRequestInfoMessage(urlOriginal), httpRequestId, 'info');
|
|
200
196
|
}
|
|
201
197
|
function getRequestInfoMessage(urlOriginal) {
|
|
202
198
|
return `HTTP request: ${prettyUrl(urlOriginal)}`;
|
|
203
199
|
}
|
|
204
|
-
function logHttpResponse(
|
|
200
|
+
function logHttpResponse(urlOriginalPretty, httpRequestId, pageContextReturn) {
|
|
205
201
|
const statusCode = pageContextReturn.httpResponse?.statusCode ?? null;
|
|
206
202
|
let msg;
|
|
207
203
|
let isNominal;
|
|
@@ -212,10 +208,10 @@ function logHttpResponse(urlOriginal, httpRequestId, pageContextReturn) {
|
|
|
212
208
|
// - URL doesn't include Base URL
|
|
213
209
|
// - Can we abort earlier so that `logHttpResponse()` and `logHttpRequest()` aren't even called?
|
|
214
210
|
// - Error loading a Vike config file
|
|
215
|
-
// - We should show `HTTP response ${
|
|
211
|
+
// - We should show `HTTP response ${urlOriginalPretty} ERR` instead.
|
|
216
212
|
// - Maybe we can/should make the error available at pageContext.errorWhileRendering
|
|
217
213
|
assert(errorWhileRendering === null || errorWhileRendering === undefined);
|
|
218
|
-
msg = `HTTP response ${prettyUrl(
|
|
214
|
+
msg = `HTTP response ${prettyUrl(urlOriginalPretty)} ${pc.dim('null')}`;
|
|
219
215
|
// Erroneous value (it shoud sometimes be `false`) but it's fine as it doesn't seem to have much of an impact.
|
|
220
216
|
isNominal = true;
|
|
221
217
|
}
|
|
@@ -233,28 +229,33 @@ function logHttpResponse(urlOriginal, httpRequestId, pageContextReturn) {
|
|
|
233
229
|
.find((header) => header[0] === 'Location');
|
|
234
230
|
assert(headerRedirect);
|
|
235
231
|
const urlRedirect = headerRedirect[1];
|
|
236
|
-
|
|
232
|
+
urlOriginalPretty = urlRedirect;
|
|
237
233
|
}
|
|
238
|
-
msg = `HTTP ${type} ${prettyUrl(
|
|
234
|
+
msg = `HTTP ${type} ${prettyUrl(urlOriginalPretty)} ${color(statusCode ?? 'ERR')}`;
|
|
239
235
|
}
|
|
240
236
|
}
|
|
241
237
|
logRuntimeInfo?.(msg, httpRequestId, isNominal ? 'info' : 'error');
|
|
242
238
|
}
|
|
243
|
-
function
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
239
|
+
function prettyUrl(url) {
|
|
240
|
+
return pc.bold(decodeURI(url));
|
|
241
|
+
}
|
|
242
|
+
function getPageContextHttpResponseError(err, pageContextInit, pageContext) {
|
|
243
|
+
const pageContextWithError = createPageContext(pageContextInit);
|
|
244
|
+
const httpResponse = createHttpResponseError(pageContext);
|
|
245
|
+
objectAssign(pageContextWithError, {
|
|
246
|
+
httpResponse,
|
|
247
247
|
errorWhileRendering: err
|
|
248
248
|
});
|
|
249
|
-
return
|
|
249
|
+
return pageContextWithError;
|
|
250
250
|
}
|
|
251
|
-
function
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
251
|
+
function getPageContextHttpResponseFavicon404(pageContextInit) {
|
|
252
|
+
const pageContext = createPageContext(pageContextInit);
|
|
253
|
+
const httpResponse = createHttpResponseFavicon404();
|
|
254
|
+
objectAssign(pageContext, {
|
|
255
|
+
httpResponse
|
|
256
256
|
});
|
|
257
|
-
|
|
257
|
+
checkType(pageContext);
|
|
258
|
+
return pageContext;
|
|
258
259
|
}
|
|
259
260
|
function createPageContext(pageContextInit) {
|
|
260
261
|
const pageContext = {
|
|
@@ -280,6 +281,7 @@ async function renderPageNominal(pageContext) {
|
|
|
280
281
|
}
|
|
281
282
|
}
|
|
282
283
|
assert(hasProp(pageContext, '_pageId', 'string'));
|
|
284
|
+
assert(pageContext.errorWhileRendering === null);
|
|
283
285
|
// Render
|
|
284
286
|
const pageContextAfterRender = await renderPageAlreadyRouted(pageContext);
|
|
285
287
|
assert(pageContext === pageContextAfterRender);
|
|
@@ -325,10 +327,12 @@ function getRequestId() {
|
|
|
325
327
|
assert(httpRequestId >= 1);
|
|
326
328
|
return httpRequestId;
|
|
327
329
|
}
|
|
328
|
-
function
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
330
|
+
function assertIsUrl(urlOriginal) {
|
|
331
|
+
assertUsage(isUrl(urlOriginal), `${pc.code('renderPage(pageContextInit)')} (https://vike.dev/renderPage) called with ${pc.code(`pageContextInit.urlOriginal===${JSON.stringify(urlOriginal)}`)} which isn't a valid URL.`);
|
|
332
|
+
}
|
|
333
|
+
function assertIsNotViteRequest(urlPathname, urlOriginal) {
|
|
334
|
+
const isViteRequest = urlPathname.startsWith('/@vite/client') || urlPathname.startsWith('/@fs/') || urlPathname.startsWith('/__vite_ping');
|
|
335
|
+
assertUsage(!isViteRequest, `${pc.code('renderPage(pageContextInit)')} (https://vike.dev/renderPage) called with ${pc.code(`pageContextInit.urlOriginal===${JSON.stringify(urlOriginal)}`)} which is unexpected because this URL should have already been handled by Vite's development middleware. Make sure to 1. install Vite's development middleware and 2. add Vite's middleware *before* Vike's middleware, see https://vike.dev/renderPage`);
|
|
332
336
|
}
|
|
333
337
|
function normalizeUrl(pageContextInit, httpRequestId) {
|
|
334
338
|
const { trailingSlash, disableUrlNormalization, baseServer } = getGlobalContext();
|
|
@@ -342,7 +346,7 @@ function normalizeUrl(pageContextInit, httpRequestId) {
|
|
|
342
346
|
if (!urlNormalized)
|
|
343
347
|
return null;
|
|
344
348
|
logRuntimeInfo?.(`URL normalized from ${pc.cyan(urlOriginal)} to ${pc.cyan(urlNormalized)} (https://vike.dev/url-normalization)`, httpRequestId, 'info');
|
|
345
|
-
const httpResponse =
|
|
349
|
+
const httpResponse = createHttpResponseRedirect({ url: urlNormalized, statusCode: 301 }, pageContextInit.urlOriginal);
|
|
346
350
|
const pageContextHttpResponse = createPageContext(pageContextInit);
|
|
347
351
|
objectAssign(pageContextHttpResponse, { httpResponse });
|
|
348
352
|
return pageContextHttpResponse;
|
|
@@ -378,7 +382,7 @@ function getPermanentRedirect(pageContextInit, httpRequestId) {
|
|
|
378
382
|
assert(urlTarget !== pageContextInit.urlOriginal);
|
|
379
383
|
}
|
|
380
384
|
logRuntimeInfo?.(`Permanent redirect defined by your config.redirects (https://vike.dev/redirects)`, httpRequestId, 'info');
|
|
381
|
-
const httpResponse =
|
|
385
|
+
const httpResponse = createHttpResponseRedirect({ url: urlTarget, statusCode: 301 }, urlWithoutBase);
|
|
382
386
|
const pageContextHttpResponse = createPageContext(pageContextInit);
|
|
383
387
|
objectAssign(pageContextHttpResponse, { httpResponse });
|
|
384
388
|
return pageContextHttpResponse;
|
|
@@ -422,7 +426,7 @@ pageContextNominalPageInit, httpRequestId, renderContext, pageContextErrorPageIn
|
|
|
422
426
|
if (pageContextAbort._urlRedirect) {
|
|
423
427
|
const pageContextReturn = createPageContext(pageContextInit);
|
|
424
428
|
objectAssign(pageContextReturn, pageContextAbort);
|
|
425
|
-
const httpResponse =
|
|
429
|
+
const httpResponse = createHttpResponseRedirect(pageContextAbort._urlRedirect, (() => {
|
|
426
430
|
const { pathname, searchOriginal } = pageContextNominalPageInit.urlParsed;
|
|
427
431
|
const urlLogical = createUrlFromComponents(null, pathname, searchOriginal,
|
|
428
432
|
// The server-side doesn't have access to the hash
|
|
@@ -435,18 +439,10 @@ pageContextNominalPageInit, httpRequestId, renderContext, pageContextErrorPageIn
|
|
|
435
439
|
assert(pageContextAbort.abortStatusCode);
|
|
436
440
|
return { pageContextAbort };
|
|
437
441
|
}
|
|
438
|
-
function
|
|
442
|
+
function assertBaseUrl(pageContextInit) {
|
|
439
443
|
const { baseServer } = getGlobalContext();
|
|
440
444
|
const { urlOriginal } = pageContextInit;
|
|
441
445
|
const { urlWithoutPageContextRequestSuffix } = handlePageContextRequestUrl(urlOriginal);
|
|
442
446
|
const { hasBaseServer } = parseUrl(urlWithoutPageContextRequestSuffix, baseServer);
|
|
443
|
-
|
|
444
|
-
logRuntimeInfo?.(`${getRequestInfoMessage(urlOriginal)} skipped because URL ${prettyUrl(urlOriginal)} doesn't start with Base URL ${prettyUrl(baseServer)} (https://vike.dev/base-url)`, httpRequestId, 'info');
|
|
445
|
-
const pageContextHttpResponseNull = getPageContextHttpResponseNull(pageContextInit);
|
|
446
|
-
return pageContextHttpResponseNull;
|
|
447
|
-
}
|
|
448
|
-
return null;
|
|
449
|
-
}
|
|
450
|
-
function prettyUrl(url) {
|
|
451
|
-
return pc.bold(decodeURI(url));
|
|
447
|
+
assertUsage(hasBaseServer, `${pc.code('renderPage(pageContextInit)')} (https://vike.dev/renderPage) called with ${pc.code(`pageContextInit.urlOriginal===${JSON.stringify(urlOriginal)}`)} which doesn't start with Base URL ${pc.code(baseServer)} (https://vike.dev/base-url)`);
|
|
452
448
|
}
|
|
@@ -2,6 +2,6 @@ export { analyzeClientSide };
|
|
|
2
2
|
import type { PageConfigRuntime } from '../page-configs/PageConfig.js';
|
|
3
3
|
import type { PageFile } from './getPageFileObject.js';
|
|
4
4
|
declare function analyzeClientSide(pageConfig: PageConfigRuntime | null, pageFilesAll: PageFile[], pageId: string): {
|
|
5
|
-
|
|
5
|
+
isClientRuntimeLoaded: boolean;
|
|
6
6
|
isClientRouting: boolean;
|
|
7
7
|
};
|
|
@@ -5,13 +5,13 @@ function analyzeClientSide(pageConfig, pageFilesAll, pageId) {
|
|
|
5
5
|
// V1 design
|
|
6
6
|
if (pageConfig) {
|
|
7
7
|
const isClientRouting = getConfigValueRuntime(pageConfig, 'clientRouting', 'boolean')?.value ?? false;
|
|
8
|
-
const
|
|
9
|
-
return {
|
|
8
|
+
const isClientRuntimeLoaded = getConfigValueRuntime(pageConfig, 'isClientRuntimeLoaded', 'boolean')?.value ?? false;
|
|
9
|
+
return { isClientRuntimeLoaded, isClientRouting };
|
|
10
10
|
}
|
|
11
11
|
else {
|
|
12
12
|
// TODO/v1-release: remove
|
|
13
13
|
// V0.4 design
|
|
14
14
|
const { isHtmlOnly, isClientRouting } = analyzePageClientSide(pageFilesAll, pageId);
|
|
15
|
-
return {
|
|
15
|
+
return { isClientRuntimeLoaded: !isHtmlOnly, isClientRouting };
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -41,7 +41,7 @@ type HookName = HookNamePage | HookNameGlobal | HookNameOldDesign;
|
|
|
41
41
|
type HookNamePage = 'onHydrationEnd' | 'onBeforePrerenderStart' | 'onBeforeRender' | 'onPageTransitionStart' | 'onPageTransitionEnd' | 'onRenderHtml' | 'onRenderClient' | 'guard' | 'data';
|
|
42
42
|
type HookNameGlobal = 'onBeforePrerender' | 'onBeforeRoute' | 'onPrerenderStart';
|
|
43
43
|
type HookNameOldDesign = 'render' | 'prerender';
|
|
44
|
-
type ConfigNameBuiltIn = Exclude<keyof Config, keyof ConfigVikeUserProvided | 'onBeforeRoute' | 'onPrerenderStart'> | 'prerender' | '
|
|
44
|
+
type ConfigNameBuiltIn = Exclude<keyof Config, keyof ConfigVikeUserProvided | 'onBeforeRoute' | 'onPrerenderStart'> | 'prerender' | 'isClientRuntimeLoaded' | 'onBeforeRenderEnv' | 'dataEnv' | 'hooksTimeout' | 'clientHooks';
|
|
45
45
|
type Config = ConfigBuiltIn & Vike.Config & (VikePackages.ConfigVikeReact | VikePackages.ConfigVikeVue | VikePackages.ConfigVikeSolid | VikePackages.ConfigVikeSvelte | VikePackages.ConfigVikeAngular);
|
|
46
46
|
/** Hook for fetching data.
|
|
47
47
|
*
|
|
@@ -358,7 +358,7 @@ type ConfigBuiltIn = {
|
|
|
358
358
|
*
|
|
359
359
|
* https://vike.dev/injectScriptsAt
|
|
360
360
|
*/
|
|
361
|
-
injectScriptsAt?: 'HTML_BEGIN' | 'HTML_END' | '
|
|
361
|
+
injectScriptsAt?: 'HTML_BEGIN' | 'HTML_END' | 'HTML_STREAM' | null;
|
|
362
362
|
/** Used by Vike extensions to set their name.
|
|
363
363
|
*
|
|
364
364
|
* https://vike.dev/extends
|
|
@@ -19,6 +19,7 @@ function assertPlusFileExport(fileExports, filePathToShowToUser, configName) {
|
|
|
19
19
|
}
|
|
20
20
|
const exportDefault = pc.code('export default');
|
|
21
21
|
const exportNamed = pc.code(`export { ${configName} }`);
|
|
22
|
+
assert(exportNamesValid.length <= 2);
|
|
22
23
|
if (exportNamesValid.length === 0) {
|
|
23
24
|
assertUsage(false, `${filePathToShowToUser} should have a ${exportNamed} or ${exportDefault}`);
|
|
24
25
|
}
|
|
@@ -27,8 +28,6 @@ function assertPlusFileExport(fileExports, filePathToShowToUser, configName) {
|
|
|
27
28
|
onlyOnce: true
|
|
28
29
|
});
|
|
29
30
|
}
|
|
30
|
-
assert(exportNamesValid.length === 1);
|
|
31
|
-
assert(exportNamesInvalid.length > 0);
|
|
32
31
|
if (!TOLERATE_SIDE_EXPORTS.some((ext) => filePathToShowToUser.endsWith(ext))) {
|
|
33
32
|
exportNamesInvalid.forEach((exportInvalid) => {
|
|
34
33
|
assertWarning(false, `${filePathToShowToUser} unexpected ${pc.cyan(`export { ${exportInvalid} }`)}`, {
|
|
@@ -43,9 +43,9 @@ declare function redirect(url: string, statusCode?: 301 | 302): AbortRedirect;
|
|
|
43
43
|
* `404` Not Found
|
|
44
44
|
* `410` Gone (use this instead of `404` if the page existed in the past, see https://github.com/vikejs/vike/issues/1097#issuecomment-1695260887)
|
|
45
45
|
* `429` Too Many Requests (rate limiting)
|
|
46
|
-
* `500` Internal Server Error (
|
|
47
|
-
* `503` Service Unavailable (server is overloaded, a third-party API isn't responding)
|
|
48
|
-
* @param abortReason Sets `pageContext.abortReason` which is used by the error page to show a message to the user, see https://vike.dev/error-page
|
|
46
|
+
* `500` Internal Server Error (your client or server has a bug)
|
|
47
|
+
* `503` Service Unavailable (server is overloaded, or a third-party API isn't responding)
|
|
48
|
+
* @param abortReason Sets `pageContext.abortReason` which is usually used by the error page to show a message to the user, see https://vike.dev/error-page
|
|
49
49
|
*/
|
|
50
50
|
declare function render(abortStatusCode: 401 | 403 | 404 | 410 | 429 | 500 | 503, abortReason?: AbortReason): Error;
|
|
51
51
|
/**
|
|
@@ -66,7 +66,7 @@ async function getPageContextFromHook(onBeforeRouteHook, pageContext) {
|
|
|
66
66
|
}
|
|
67
67
|
if (hasProp(hookReturn.pageContext, 'urlLogical')) {
|
|
68
68
|
assertUsageUrlPathnameAbsolute(
|
|
69
|
-
// We type-cast
|
|
69
|
+
// We skip validation and type-cast instead of assertUsage() in order to save client-side KBs
|
|
70
70
|
hookReturn.pageContext.urlLogical, `${errPrefix} returned ${pc.cyan('{ pageContext: { urlLogical } }')} but ${pc.cyan('urlLogical')}`);
|
|
71
71
|
}
|
|
72
72
|
assertPageContextProvidedByUser(hookReturn.pageContext, {
|
|
@@ -3,7 +3,7 @@ export type { PageContextServer } from '../shared/types.js';
|
|
|
3
3
|
export type { PageContextClient } from '../shared/types.js';
|
|
4
4
|
export type { PageContextWithServerRouting } from '../shared/types.js';
|
|
5
5
|
export type { PageContextClientWithServerRouting } from '../shared/types.js';
|
|
6
|
-
export type { ConfigVitePluginServerEntry } from '@brillout/vite-plugin-server-entry/plugin
|
|
6
|
+
export type { ConfigVitePluginServerEntry } from '@brillout/vite-plugin-server-entry/plugin';
|
|
7
7
|
export type { PageContextBuiltInServer } from '../shared/types.js';
|
|
8
8
|
export type { PageContextBuiltInClientWithClientRouting } from '../shared/types.js';
|
|
9
9
|
export type { PageContextBuiltInClientWithServerRouting } from '../shared/types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.195-commit-486b49a";
|
|
@@ -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.195-commit-486b49a';
|
|
@@ -5,6 +5,7 @@ export { removeBaseServer };
|
|
|
5
5
|
export { modifyUrlPathname };
|
|
6
6
|
export { removeUrlOrigin };
|
|
7
7
|
export { addUrlOrigin };
|
|
8
|
+
export { getUrlPretty };
|
|
8
9
|
declare function prependBase(url: string, baseServer: string): string;
|
|
9
10
|
declare function removeBaseServer(url: string, baseServer: string): string;
|
|
10
11
|
declare function isBaseAssets(base: string): boolean;
|
|
@@ -15,3 +16,4 @@ declare function removeUrlOrigin(url: string): {
|
|
|
15
16
|
origin: string | null;
|
|
16
17
|
};
|
|
17
18
|
declare function addUrlOrigin(url: string, origin: string | null): string;
|
|
19
|
+
declare function getUrlPretty(url: string): string;
|
|
@@ -5,6 +5,7 @@ export { removeBaseServer };
|
|
|
5
5
|
export { modifyUrlPathname };
|
|
6
6
|
export { removeUrlOrigin };
|
|
7
7
|
export { addUrlOrigin };
|
|
8
|
+
export { getUrlPretty };
|
|
8
9
|
import { assertUrlComponents, createUrlFromComponents, isBaseServer, parseUrl } from './parseUrl.js';
|
|
9
10
|
import { assert } from './assert.js';
|
|
10
11
|
import { slice } from './slice.js';
|
|
@@ -100,3 +101,7 @@ function addUrlOrigin(url, origin) {
|
|
|
100
101
|
const urlModified = createUrlFromComponents(origin, pathnameOriginal, searchOriginal, hashOriginal);
|
|
101
102
|
return urlModified;
|
|
102
103
|
}
|
|
104
|
+
function getUrlPretty(url) {
|
|
105
|
+
const { urlModified } = removeUrlOrigin(url);
|
|
106
|
+
return urlModified;
|
|
107
|
+
}
|
package/package.json
CHANGED
|
@@ -1,43 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vike",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"
|
|
5
|
-
"dev": "tsc --watch",
|
|
6
|
-
"build": "rimraf dist/ && pnpm run build:esm && pnpm run build:cjs",
|
|
7
|
-
"build:esm": "tsc",
|
|
8
|
-
"build:cjs": "pnpm run build:cjs:ts && pnpm run build:cjs:fixup",
|
|
9
|
-
"build:cjs:ts": "tsc --project ./tsconfig.cjs.json",
|
|
10
|
-
"build:cjs:fixup": "node ./dist-cjs-fixup.mjs",
|
|
11
|
-
"release": "release-me patch",
|
|
12
|
-
"release:minor": "release-me minor",
|
|
13
|
-
"release:commit": "release-me commit"
|
|
14
|
-
},
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"@brillout/import": "^0.2.3",
|
|
17
|
-
"@brillout/json-serializer": "^0.5.13",
|
|
18
|
-
"@brillout/picocolors": "^1.0.14",
|
|
19
|
-
"@brillout/require-shim": "^0.1.2",
|
|
20
|
-
"@brillout/vite-plugin-server-entry": "^0.4.10",
|
|
21
|
-
"acorn": "^8.0.0",
|
|
22
|
-
"cac": "^6.0.0",
|
|
23
|
-
"es-module-lexer": "^1.0.0",
|
|
24
|
-
"esbuild": "^0.19.0 || ^0.20.0 || ^0.21.0 || ^0.22.0 || ^0.23.0",
|
|
25
|
-
"fast-glob": "^3.0.0",
|
|
26
|
-
"semver": "^7.0.0",
|
|
27
|
-
"sirv": "^2.0.0",
|
|
28
|
-
"source-map-support": "^0.5.0"
|
|
29
|
-
},
|
|
30
|
-
"type": "module",
|
|
3
|
+
"version": "0.4.195-commit-486b49a",
|
|
4
|
+
"repository": "https://github.com/vikejs/vike",
|
|
31
5
|
"exports": {
|
|
32
|
-
".": {
|
|
33
|
-
"worker": "./dist/esm/node/runtime/index-deprecated.js",
|
|
34
|
-
"edge-light": "./dist/esm/node/runtime/index-deprecated.js",
|
|
35
|
-
"require": "./dist/cjs/node/runtime/index-deprecated.js",
|
|
36
|
-
"node": "./dist/esm/node/runtime/index-deprecated.js",
|
|
37
|
-
"browser": "./dist/esm/client/node.js",
|
|
38
|
-
"types": "./dist/esm/node/runtime/index-deprecated.d.ts",
|
|
39
|
-
"default": "./dist/esm/node/runtime/index-deprecated.js"
|
|
40
|
-
},
|
|
41
6
|
"./server": {
|
|
42
7
|
"worker": "./dist/esm/node/runtime/index.js",
|
|
43
8
|
"edge-light": "./dist/esm/node/runtime/index.js",
|
|
@@ -144,8 +109,32 @@
|
|
|
144
109
|
"node": "./dist/esm/node/runtime/globalContext/loadImportBuild.js",
|
|
145
110
|
"types": "./dist/esm/node/runtime/globalContext/loadImportBuild.d.ts",
|
|
146
111
|
"default": "./dist/esm/node/runtime/globalContext/loadImportBuild.js"
|
|
112
|
+
},
|
|
113
|
+
".": {
|
|
114
|
+
"worker": "./dist/esm/node/runtime/index-deprecated.js",
|
|
115
|
+
"edge-light": "./dist/esm/node/runtime/index-deprecated.js",
|
|
116
|
+
"require": "./dist/cjs/node/runtime/index-deprecated.js",
|
|
117
|
+
"node": "./dist/esm/node/runtime/index-deprecated.js",
|
|
118
|
+
"browser": "./dist/esm/client/node.js",
|
|
119
|
+
"types": "./dist/esm/node/runtime/index-deprecated.d.ts",
|
|
120
|
+
"default": "./dist/esm/node/runtime/index-deprecated.js"
|
|
147
121
|
}
|
|
148
122
|
},
|
|
123
|
+
"dependencies": {
|
|
124
|
+
"@brillout/import": "^0.2.3",
|
|
125
|
+
"@brillout/json-serializer": "^0.5.13",
|
|
126
|
+
"@brillout/picocolors": "^1.0.15",
|
|
127
|
+
"@brillout/require-shim": "^0.1.2",
|
|
128
|
+
"@brillout/vite-plugin-server-entry": "^0.4.11",
|
|
129
|
+
"acorn": "^8.0.0",
|
|
130
|
+
"cac": "^6.0.0",
|
|
131
|
+
"es-module-lexer": "^1.0.0",
|
|
132
|
+
"esbuild": "^0.19.0 || ^0.20.0 || ^0.21.0 || ^0.22.0 || ^0.23.0",
|
|
133
|
+
"fast-glob": "^3.0.0",
|
|
134
|
+
"semver": "^7.0.0",
|
|
135
|
+
"sirv": "^2.0.0",
|
|
136
|
+
"source-map-support": "^0.5.0"
|
|
137
|
+
},
|
|
149
138
|
"peerDependencies": {
|
|
150
139
|
"react-streaming": ">=0.3.42",
|
|
151
140
|
"vite": ">=5.1.0"
|
|
@@ -155,8 +144,19 @@
|
|
|
155
144
|
"optional": true
|
|
156
145
|
}
|
|
157
146
|
},
|
|
158
|
-
"
|
|
159
|
-
|
|
147
|
+
"engines": {
|
|
148
|
+
"node": ">=18.0.0"
|
|
149
|
+
},
|
|
150
|
+
"license": "MIT",
|
|
151
|
+
"description": "Flexible, lean, community-driven, dependable, fast Vite-based frontend framework.",
|
|
152
|
+
"keywords": [
|
|
153
|
+
"react",
|
|
154
|
+
"vue",
|
|
155
|
+
"solid",
|
|
156
|
+
"vite",
|
|
157
|
+
"vite-plugin",
|
|
158
|
+
"ssr"
|
|
159
|
+
],
|
|
160
160
|
"typesVersions": {
|
|
161
161
|
"*": {
|
|
162
162
|
"types": [
|
|
@@ -203,16 +203,34 @@
|
|
|
203
203
|
]
|
|
204
204
|
}
|
|
205
205
|
},
|
|
206
|
+
"main": "./dist/esm/node/runtime/index-deprecated.js",
|
|
207
|
+
"types": "./dist/esm/node/runtime/index-deprecated.d.ts",
|
|
208
|
+
"type": "module",
|
|
206
209
|
"bin": {
|
|
207
210
|
"vike": "./node/cli/bin-entry.js"
|
|
208
211
|
},
|
|
212
|
+
"files": [
|
|
213
|
+
"dist/",
|
|
214
|
+
"cli.js",
|
|
215
|
+
"client.js",
|
|
216
|
+
"client/router.js",
|
|
217
|
+
"plugin.js",
|
|
218
|
+
"prerender.js",
|
|
219
|
+
"routing.js",
|
|
220
|
+
"abort.js",
|
|
221
|
+
"RenderErrorPage.js",
|
|
222
|
+
"server.js",
|
|
223
|
+
"__internal.js",
|
|
224
|
+
"__internal/setup.js"
|
|
225
|
+
],
|
|
209
226
|
"devDependencies": {
|
|
210
227
|
"@biomejs/biome": "^1.5.3",
|
|
211
|
-
"@brillout/release-me": "^0.4.
|
|
228
|
+
"@brillout/release-me": "^0.4.2",
|
|
212
229
|
"@types/estree": "^1.0.5",
|
|
213
230
|
"@types/jest": "^29.5.11",
|
|
214
231
|
"@types/node": "^20.10.5",
|
|
215
232
|
"@types/resolve": "^1.20.6",
|
|
233
|
+
"@types/semver": "^7.5.8",
|
|
216
234
|
"@types/source-map-support": "^0.5.10",
|
|
217
235
|
"acorn": "^8.11.2",
|
|
218
236
|
"cac": "^6.7.14",
|
|
@@ -227,32 +245,15 @@
|
|
|
227
245
|
"typescript": "^5.4.5",
|
|
228
246
|
"vite": "^5.4.0"
|
|
229
247
|
},
|
|
230
|
-
"
|
|
231
|
-
"
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
"dist
|
|
237
|
-
"
|
|
238
|
-
"
|
|
239
|
-
"
|
|
240
|
-
"plugin.js",
|
|
241
|
-
"prerender.js",
|
|
242
|
-
"routing.js",
|
|
243
|
-
"abort.js",
|
|
244
|
-
"RenderErrorPage.js",
|
|
245
|
-
"server.js",
|
|
246
|
-
"__internal.js",
|
|
247
|
-
"__internal/setup.js"
|
|
248
|
-
],
|
|
249
|
-
"license": "MIT",
|
|
250
|
-
"keywords": [
|
|
251
|
-
"vite",
|
|
252
|
-
"vite-plugin",
|
|
253
|
-
"ssr"
|
|
254
|
-
],
|
|
255
|
-
"publishConfig": {
|
|
256
|
-
"access": "public"
|
|
248
|
+
"scripts": {
|
|
249
|
+
"dev": "tsc --watch",
|
|
250
|
+
"build": "rimraf dist/ && pnpm run build:esm && pnpm run build:cjs",
|
|
251
|
+
"build:esm": "tsc",
|
|
252
|
+
"build:cjs": "pnpm run build:cjs:ts && pnpm run build:cjs:fixup",
|
|
253
|
+
"build:cjs:ts": "tsc --project ./tsconfig.cjs.json",
|
|
254
|
+
"build:cjs:fixup": "node ./dist-cjs-fixup.mjs",
|
|
255
|
+
"release": "release-me patch",
|
|
256
|
+
"release:minor": "release-me minor",
|
|
257
|
+
"release:commit": "release-me commit"
|
|
257
258
|
}
|
|
258
|
-
}
|
|
259
|
+
}
|
package/plugin.js
CHANGED
package/prerender.js
CHANGED
package/routing.js
CHANGED
package/server.js
CHANGED