vike 0.4.225-commit-37a36a5 → 0.4.225-commit-b8fc36e
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/client/shared/getPageContextProxyForUser.js +3 -66
- package/dist/cjs/node/api/build.js +7 -7
- package/dist/cjs/node/api/dev.js +2 -2
- package/dist/cjs/node/api/prepareViteApiCall.js +52 -29
- package/dist/cjs/node/api/prerender.js +2 -2
- package/dist/cjs/node/api/preview.js +2 -2
- package/dist/cjs/node/api/utils.js +1 -0
- package/dist/cjs/node/cli/parseCli.js +10 -4
- package/dist/cjs/node/plugin/plugins/build/pluginAutoFullBuild.js +2 -2
- package/dist/cjs/node/plugin/plugins/commonConfig.js +0 -6
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js +4 -0
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +20 -7
- package/dist/cjs/node/plugin/shared/getEnvVarObject.js +7 -0
- package/dist/cjs/node/prerender/resolvePrerenderConfig.js +3 -3
- package/dist/cjs/node/prerender/runPrerender.js +8 -12
- package/dist/cjs/node/runtime/html/serializePageContextClientSide.js +67 -14
- package/dist/cjs/node/runtime/renderPage/preparePageContextForUserConsumptionServerSide.js +3 -0
- package/dist/cjs/node/runtime/renderPage/renderPageAlreadyRouted.js +18 -12
- package/dist/cjs/node/runtime/renderPage.js +13 -28
- package/dist/cjs/node/runtime-dev/createDevMiddleware.js +2 -2
- package/dist/cjs/shared/NOT_SERIALIZABLE.js +5 -0
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/cjs/utils/assert.js +1 -1
- package/dist/cjs/utils/objectAssign.js +7 -2
- package/dist/cjs/utils/pick.js +12 -0
- package/dist/esm/client/client-routing-runtime/createPageContext.d.ts +2 -0
- package/dist/esm/client/client-routing-runtime/createPageContext.js +2 -1
- package/dist/esm/client/client-routing-runtime/renderPageClientSide.js +1 -1
- package/dist/esm/client/server-routing-runtime/getPageContext.d.ts +6 -3
- package/dist/esm/client/server-routing-runtime/getPageContext.js +6 -3
- package/dist/esm/client/shared/getPageContextProxyForUser.d.ts +1 -11
- package/dist/esm/client/shared/getPageContextProxyForUser.js +4 -67
- package/dist/esm/client/shared/preparePageContextForUserConsumptionClientSide.d.ts +2 -2
- package/dist/esm/node/api/build.js +7 -7
- package/dist/esm/node/api/dev.js +2 -2
- package/dist/esm/node/api/prepareViteApiCall.d.ts +1 -1
- package/dist/esm/node/api/prepareViteApiCall.js +54 -31
- package/dist/esm/node/api/prerender.js +2 -2
- package/dist/esm/node/api/preview.js +2 -2
- package/dist/esm/node/api/utils.d.ts +1 -0
- package/dist/esm/node/api/utils.js +1 -0
- package/dist/esm/node/cli/parseCli.js +10 -4
- package/dist/esm/node/plugin/plugins/build/pluginAutoFullBuild.js +2 -2
- package/dist/esm/node/plugin/plugins/commonConfig.d.ts +1 -1
- package/dist/esm/node/plugin/plugins/commonConfig.js +0 -6
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js +4 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.d.ts +8 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +20 -7
- package/dist/esm/node/plugin/shared/getEnvVarObject.js +7 -0
- package/dist/esm/node/prerender/resolvePrerenderConfig.js +3 -3
- package/dist/esm/node/prerender/runPrerender.js +8 -12
- package/dist/esm/node/runtime/html/serializePageContextClientSide.d.ts +2 -0
- package/dist/esm/node/runtime/html/serializePageContextClientSide.js +69 -15
- package/dist/esm/node/runtime/renderPage/preparePageContextForUserConsumptionServerSide.js +3 -0
- package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.d.ts +27 -1
- package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.js +18 -12
- package/dist/esm/node/runtime/renderPage.js +14 -29
- package/dist/esm/node/runtime-dev/createDevMiddleware.js +2 -2
- package/dist/esm/shared/NOT_SERIALIZABLE.d.ts +1 -0
- package/dist/esm/shared/NOT_SERIALIZABLE.js +2 -0
- package/dist/esm/shared/page-configs/Config.d.ts +11 -3
- package/dist/esm/shared/page-configs/PageConfig.d.ts +1 -1
- package/dist/esm/shared/route/abort.d.ts +2 -2
- package/dist/esm/shared/types.d.ts +34 -2
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/utils/assert.js +1 -1
- package/dist/esm/utils/objectAssign.d.ts +1 -1
- package/dist/esm/utils/objectAssign.js +7 -2
- package/dist/esm/utils/pick.d.ts +1 -0
- package/dist/esm/utils/pick.js +9 -0
- package/package.json +1 -1
- package/dist/cjs/shared/notSerializable.js +0 -5
- package/dist/esm/shared/notSerializable.d.ts +0 -1
- package/dist/esm/shared/notSerializable.js +0 -2
|
@@ -5,12 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.serializePageContextClientSide = serializePageContextClientSide;
|
|
7
7
|
exports.serializePageContextAbort = serializePageContextAbort;
|
|
8
|
+
exports.getPropKeys = getPropKeys;
|
|
8
9
|
const stringify_1 = require("@brillout/json-serializer/stringify");
|
|
9
10
|
const utils_js_1 = require("../utils.js");
|
|
10
11
|
const error_page_js_1 = require("../../../shared/error-page.js");
|
|
11
12
|
const addIs404ToPageProps_js_1 = require("../../../shared/addIs404ToPageProps.js");
|
|
12
13
|
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
13
|
-
const
|
|
14
|
+
const NOT_SERIALIZABLE_js_1 = require("../../../shared/NOT_SERIALIZABLE.js");
|
|
14
15
|
const pageContextInitIsPassedToClient_js_1 = require("../../../shared/misc/pageContextInitIsPassedToClient.js");
|
|
15
16
|
const isServerSideError_js_1 = require("../../../shared/misc/isServerSideError.js");
|
|
16
17
|
const PASS_TO_CLIENT = [
|
|
@@ -30,12 +31,8 @@ const PASS_TO_CLIENT = [
|
|
|
30
31
|
const PASS_TO_CLIENT_ERROR_PAGE = ['pageProps', 'is404', isServerSideError_js_1.isServerSideError];
|
|
31
32
|
function serializePageContextClientSide(pageContext) {
|
|
32
33
|
const passToClient = getPassToClient(pageContext);
|
|
33
|
-
const pageContextClient =
|
|
34
|
-
passToClient.
|
|
35
|
-
// We set non-existing props to `undefined`, in order to pass the list of passToClient values to the client-side
|
|
36
|
-
pageContextClient[prop] = pageContext[prop];
|
|
37
|
-
});
|
|
38
|
-
if (Object.keys(pageContext._pageContextInit).some((p) => passToClient.includes(p))) {
|
|
34
|
+
const pageContextClient = applyPassToClient(passToClient, pageContext);
|
|
35
|
+
if (passToClient.some((prop) => getPropVal(pageContext._pageContextInit, prop))) {
|
|
39
36
|
pageContextClient[pageContextInitIsPassedToClient_js_1.pageContextInitIsPassedToClient] = true;
|
|
40
37
|
}
|
|
41
38
|
let pageContextSerialized;
|
|
@@ -47,14 +44,15 @@ function serializePageContextClientSide(pageContext) {
|
|
|
47
44
|
let hasWarned = false;
|
|
48
45
|
const propsNonSerializable = [];
|
|
49
46
|
passToClient.forEach((prop) => {
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
const res = getPropVal(pageContext, prop);
|
|
48
|
+
if (!res)
|
|
49
|
+
return;
|
|
50
|
+
const { value } = res;
|
|
51
|
+
const varName = `pageContext${getPropKeys(prop).map(utils_js_1.getPropAccessNotation).join('')}`;
|
|
53
52
|
try {
|
|
54
|
-
serialize(
|
|
53
|
+
serialize(value, varName);
|
|
55
54
|
}
|
|
56
55
|
catch (err) {
|
|
57
|
-
hasWarned = true;
|
|
58
56
|
propsNonSerializable.push(prop);
|
|
59
57
|
// useConfig() wrong usage
|
|
60
58
|
if (prop === '_configFromHook') {
|
|
@@ -67,7 +65,7 @@ function serializePageContextClientSide(pageContext) {
|
|
|
67
65
|
// Non-serializable pageContext set by the user
|
|
68
66
|
let msg = [
|
|
69
67
|
`${h(varName)} can't be serialized and, therefore, can't be passed to the client side.`,
|
|
70
|
-
`Make sure ${h(varName)} is serializable, or remove ${h(
|
|
68
|
+
`Make sure ${h(varName)} is serializable, or remove ${h(JSON.stringify(prop))} from ${h('passToClient')}.`
|
|
71
69
|
].join(' ');
|
|
72
70
|
if ((0, stringify_1.isJsonSerializerError)(err)) {
|
|
73
71
|
msg = `${msg} Serialization error: ${err.messageCore}.`;
|
|
@@ -80,11 +78,12 @@ function serializePageContextClientSide(pageContext) {
|
|
|
80
78
|
}
|
|
81
79
|
// We warn (instead of throwing an error) since Vike's client runtime throws an error (with `assertUsage()`) if the user's client code tries to access the property that cannot be serialized
|
|
82
80
|
(0, utils_js_1.assertWarning)(false, msg, { onlyOnce: false });
|
|
81
|
+
hasWarned = true;
|
|
83
82
|
}
|
|
84
83
|
});
|
|
85
84
|
(0, utils_js_1.assert)(hasWarned);
|
|
86
85
|
propsNonSerializable.forEach((prop) => {
|
|
87
|
-
pageContextClient[prop] =
|
|
86
|
+
pageContextClient[getPropKeys(prop)[0]] = NOT_SERIALIZABLE_js_1.NOT_SERIALIZABLE;
|
|
88
87
|
});
|
|
89
88
|
try {
|
|
90
89
|
pageContextSerialized = serialize(pageContextClient);
|
|
@@ -143,3 +142,57 @@ function serializePageContextAbort(pageContext) {
|
|
|
143
142
|
}
|
|
144
143
|
return serialize(pageContext);
|
|
145
144
|
}
|
|
145
|
+
function applyPassToClient(passToClient, pageContext) {
|
|
146
|
+
const pageContextClient = {};
|
|
147
|
+
passToClient.forEach((prop) => {
|
|
148
|
+
// Get value from pageContext
|
|
149
|
+
const res = getPropVal(pageContext, prop);
|
|
150
|
+
if (!res)
|
|
151
|
+
return;
|
|
152
|
+
const { value } = res;
|
|
153
|
+
// Set value to pageContextClient
|
|
154
|
+
setPropVal(pageContextClient, prop, value);
|
|
155
|
+
});
|
|
156
|
+
return pageContextClient;
|
|
157
|
+
}
|
|
158
|
+
// Get a nested property from an object using a dot-separated path such as 'user.id'
|
|
159
|
+
function getPropVal(obj, prop) {
|
|
160
|
+
const keys = getPropKeys(prop);
|
|
161
|
+
let value = obj;
|
|
162
|
+
for (const key of keys) {
|
|
163
|
+
if ((0, utils_js_1.isObject)(value) && key in value) {
|
|
164
|
+
value = value[key];
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
return null; // Property or intermediate property doesn't exist
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return { value };
|
|
171
|
+
}
|
|
172
|
+
// Set a nested property in an object using a dot-separated path such as 'user.id'
|
|
173
|
+
function setPropVal(obj, prop, val) {
|
|
174
|
+
const keys = getPropKeys(prop);
|
|
175
|
+
let currentObj = obj;
|
|
176
|
+
// Creating intermediate objects if necessary
|
|
177
|
+
for (let i = 0; i <= keys.length - 2; i++) {
|
|
178
|
+
const key = keys[i];
|
|
179
|
+
if (!(key in currentObj)) {
|
|
180
|
+
// Create intermediate object
|
|
181
|
+
currentObj[key] = {};
|
|
182
|
+
}
|
|
183
|
+
if (!(0, utils_js_1.isObject)(currentObj[key])) {
|
|
184
|
+
// Skip value upon data structure conflict
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
currentObj = currentObj[key];
|
|
188
|
+
}
|
|
189
|
+
// Set the final key to the value
|
|
190
|
+
const finalKey = keys[keys.length - 1];
|
|
191
|
+
currentObj[finalKey] = val;
|
|
192
|
+
}
|
|
193
|
+
function getPropKeys(prop) {
|
|
194
|
+
// Like `prop.split('.')` but with added support for `\` escaping, see serializePageContextClientSide.spec.ts
|
|
195
|
+
return prop
|
|
196
|
+
.split(/(?<!\\)\./) // Split on unescaped dots
|
|
197
|
+
.map((key) => key.replace(/\\\./g, '.')); // Replace escaped dots with literal dots
|
|
198
|
+
}
|
|
@@ -9,5 +9,8 @@ function preparePageContextForUserConsumptionServerSide(pageContext) {
|
|
|
9
9
|
(0, utils_js_1.assert)((0, utils_js_1.isPlainObject)(pageContext.routeParams));
|
|
10
10
|
(0, utils_js_1.assert)('Page' in pageContext);
|
|
11
11
|
(0, utils_js_1.assert)(typeof pageContext.isClientSideNavigation === 'boolean');
|
|
12
|
+
(0, utils_js_1.assert)(pageContext._isPageContextObject);
|
|
13
|
+
(0, utils_js_1.assert)(pageContext.isClientSide === false);
|
|
14
|
+
(0, utils_js_1.assert)(typeof pageContext.isPrerendering === 'boolean');
|
|
12
15
|
(0, preparePageContextForUserConsumption_js_1.preparePageContextForUserConsumption)(pageContext);
|
|
13
16
|
}
|
|
@@ -7,6 +7,7 @@ exports.renderPageAlreadyRouted = renderPageAlreadyRouted;
|
|
|
7
7
|
exports.prerenderPage = prerenderPage;
|
|
8
8
|
exports.prerender404Page = prerender404Page;
|
|
9
9
|
exports.getPageContextInitEnhanced = getPageContextInitEnhanced;
|
|
10
|
+
exports.createPageContext = createPageContext;
|
|
10
11
|
const error_page_js_1 = require("../../../shared/error-page.js");
|
|
11
12
|
const renderHtml_js_1 = require("../html/renderHtml.js");
|
|
12
13
|
const utils_js_1 = require("../utils.js");
|
|
@@ -89,7 +90,11 @@ async function prerender404Page(pageContextInit_, globalContext) {
|
|
|
89
90
|
if (!errorPageId) {
|
|
90
91
|
return null;
|
|
91
92
|
}
|
|
92
|
-
|
|
93
|
+
// A URL is required for `viteDevServer.transformIndexHtml(url,html)`
|
|
94
|
+
const pageContextInit = { urlOriginal: '/fake-404-url' };
|
|
95
|
+
(0, utils_js_1.objectAssign)(pageContextInit, pageContextInit_);
|
|
96
|
+
const pageContext = await getPageContextInitEnhanced(pageContextInit, globalContext, true);
|
|
97
|
+
(0, utils_js_1.objectAssign)(pageContext, {
|
|
93
98
|
pageId: errorPageId,
|
|
94
99
|
_httpRequestId: null,
|
|
95
100
|
_urlRewrite: null,
|
|
@@ -98,25 +103,17 @@ async function prerender404Page(pageContextInit_, globalContext) {
|
|
|
98
103
|
// `prerender404Page()` is about generating `dist/client/404.html` for static hosts; there is no Client Routing.
|
|
99
104
|
_usesClientRouter: false,
|
|
100
105
|
_debugRouteMatches: []
|
|
101
|
-
};
|
|
102
|
-
const pageContextInit = {
|
|
103
|
-
urlOriginal: '/fake-404-url' // A URL is needed for `applyViteHtmlTransform`
|
|
104
|
-
};
|
|
105
|
-
(0, utils_js_1.objectAssign)(pageContextInit, pageContextInit_);
|
|
106
|
-
{
|
|
107
|
-
const pageContextInitEnhanced = await getPageContextInitEnhanced(pageContextInit, globalContext);
|
|
108
|
-
(0, utils_js_1.objectAssign)(pageContext, pageContextInitEnhanced);
|
|
109
|
-
}
|
|
106
|
+
});
|
|
110
107
|
(0, utils_js_1.objectAssign)(pageContext, await (0, loadUserFilesServerSide_js_1.loadUserFilesServerSide)(pageContext));
|
|
111
108
|
return prerenderPage(pageContext);
|
|
112
109
|
}
|
|
113
|
-
async function getPageContextInitEnhanced(pageContextInit, globalContext, { ssr: { urlRewrite, urlHandler, isClientSideNavigation } = {
|
|
110
|
+
async function getPageContextInitEnhanced(pageContextInit, globalContext, isPrerendering, { ssr: { urlRewrite, urlHandler, isClientSideNavigation } = {
|
|
114
111
|
urlRewrite: null,
|
|
115
112
|
urlHandler: null,
|
|
116
113
|
isClientSideNavigation: false
|
|
117
114
|
} } = {}) {
|
|
118
115
|
(0, utils_js_1.assert)(pageContextInit.urlOriginal);
|
|
119
|
-
const pageContextInitEnhanced =
|
|
116
|
+
const pageContextInitEnhanced = createPageContext(pageContextInit, isPrerendering);
|
|
120
117
|
(0, utils_js_1.objectAssign)(pageContextInitEnhanced, pageContextInit);
|
|
121
118
|
(0, utils_js_1.objectAssign)(pageContextInitEnhanced, {
|
|
122
119
|
_objectCreatedByVike: true,
|
|
@@ -163,3 +160,12 @@ async function getPageContextInitEnhanced(pageContextInit, globalContext, { ssr:
|
|
|
163
160
|
}
|
|
164
161
|
return pageContextInitEnhanced;
|
|
165
162
|
}
|
|
163
|
+
function createPageContext(pageContextInit, isPrerendering) {
|
|
164
|
+
const pageContext = {
|
|
165
|
+
_isPageContextObject: true,
|
|
166
|
+
isClientSide: false,
|
|
167
|
+
isPrerendering
|
|
168
|
+
};
|
|
169
|
+
(0, utils_js_1.objectAssign)(pageContext, pageContextInit);
|
|
170
|
+
return pageContext;
|
|
171
|
+
}
|
|
@@ -108,15 +108,9 @@ async function renderPageAlreadyPrepared(pageContextInit, globalContext, httpReq
|
|
|
108
108
|
// https://stackoverflow.com/questions/9683007/detect-infinite-http-redirect-loop-on-server-side
|
|
109
109
|
0);
|
|
110
110
|
let pageContextNominalPageSuccess;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
(0, utils_js_1.objectAssign)(pageContextNominalPageInit, pageContextFromAllRewrites);
|
|
115
|
-
}
|
|
116
|
-
{
|
|
117
|
-
const pageContextInitEnhanced = await getPageContextInitEnhancedSSR(pageContextInit, globalContext, pageContextNominalPageInit._urlRewrite, httpRequestId);
|
|
118
|
-
(0, utils_js_1.objectAssign)(pageContextNominalPageInit, pageContextInitEnhanced);
|
|
119
|
-
}
|
|
111
|
+
const pageContextFromAllRewrites = (0, abort_js_1.getPageContextFromAllRewrites)(pageContextsFromRewrite);
|
|
112
|
+
const pageContextNominalPageInit = await getPageContextInitEnhancedSSR(pageContextInit, globalContext, pageContextFromAllRewrites._urlRewrite, httpRequestId);
|
|
113
|
+
(0, utils_js_1.objectAssign)(pageContextNominalPageInit, pageContextFromAllRewrites);
|
|
120
114
|
let errNominalPage;
|
|
121
115
|
{
|
|
122
116
|
try {
|
|
@@ -247,7 +241,7 @@ function prettyUrl(url) {
|
|
|
247
241
|
return picocolors_1.default.bold(decodeURI(url));
|
|
248
242
|
}
|
|
249
243
|
function getPageContextHttpResponseError(err, pageContextInit, pageContext) {
|
|
250
|
-
const pageContextWithError = createPageContext(pageContextInit);
|
|
244
|
+
const pageContextWithError = (0, renderPageAlreadyRouted_js_1.createPageContext)(pageContextInit, false);
|
|
251
245
|
const httpResponse = (0, createHttpResponse_js_1.createHttpResponseError)(pageContext);
|
|
252
246
|
(0, utils_js_1.objectAssign)(pageContextWithError, {
|
|
253
247
|
httpResponse,
|
|
@@ -255,13 +249,6 @@ function getPageContextHttpResponseError(err, pageContextInit, pageContext) {
|
|
|
255
249
|
});
|
|
256
250
|
return pageContextWithError;
|
|
257
251
|
}
|
|
258
|
-
function createPageContext(pageContextInit) {
|
|
259
|
-
const pageContext = {
|
|
260
|
-
_isPageContextObject: true
|
|
261
|
-
};
|
|
262
|
-
Object.assign(pageContext, pageContextInit);
|
|
263
|
-
return pageContext;
|
|
264
|
-
}
|
|
265
252
|
async function renderPageNominal(pageContext) {
|
|
266
253
|
(0, utils_js_1.objectAssign)(pageContext, { errorWhileRendering: null });
|
|
267
254
|
// Route
|
|
@@ -286,10 +273,8 @@ async function renderPageNominal(pageContext) {
|
|
|
286
273
|
return pageContextAfterRender;
|
|
287
274
|
}
|
|
288
275
|
async function getPageContextErrorPageInit(pageContextInit, globalContext, errNominalPage, pageContextNominalPagePartial, httpRequestId) {
|
|
289
|
-
const
|
|
276
|
+
const pageContext = await getPageContextInitEnhancedSSR(pageContextInit, globalContext, null, httpRequestId);
|
|
290
277
|
(0, utils_js_1.assert)(errNominalPage);
|
|
291
|
-
const pageContext = {};
|
|
292
|
-
(0, utils_js_1.objectAssign)(pageContext, pageContextInitEnhanced);
|
|
293
278
|
(0, utils_js_1.objectAssign)(pageContext, {
|
|
294
279
|
is404: false,
|
|
295
280
|
errorWhileRendering: errNominalPage,
|
|
@@ -303,7 +288,7 @@ async function getPageContextErrorPageInit(pageContextInit, globalContext, errNo
|
|
|
303
288
|
}
|
|
304
289
|
async function getPageContextInitEnhancedSSR(pageContextInit, globalContext, urlRewrite, httpRequestId) {
|
|
305
290
|
const { isClientSideNavigation, _urlHandler } = handlePageContextUrl(pageContextInit.urlOriginal);
|
|
306
|
-
const pageContextInitEnhanced = await (0, renderPageAlreadyRouted_js_1.getPageContextInitEnhanced)(pageContextInit, globalContext, {
|
|
291
|
+
const pageContextInitEnhanced = await (0, renderPageAlreadyRouted_js_1.getPageContextInitEnhanced)(pageContextInit, globalContext, false, {
|
|
307
292
|
ssr: {
|
|
308
293
|
urlRewrite,
|
|
309
294
|
urlHandler: _urlHandler,
|
|
@@ -347,7 +332,7 @@ async function normalizeUrl(pageContextInit, globalContext, httpRequestId) {
|
|
|
347
332
|
return null;
|
|
348
333
|
(0, loggerRuntime_js_1.logRuntimeInfo)?.(`URL normalized from ${picocolors_1.default.cyan(urlOriginal)} to ${picocolors_1.default.cyan(urlNormalized)} (https://vike.dev/url-normalization)`, httpRequestId, 'info');
|
|
349
334
|
const httpResponse = (0, createHttpResponse_js_1.createHttpResponseRedirect)({ url: urlNormalized, statusCode: 301 }, pageContextInit);
|
|
350
|
-
const pageContextHttpResponse = createPageContext(pageContextInit);
|
|
335
|
+
const pageContextHttpResponse = (0, renderPageAlreadyRouted_js_1.createPageContext)(pageContextInit, false);
|
|
351
336
|
(0, utils_js_1.objectAssign)(pageContextHttpResponse, { httpResponse });
|
|
352
337
|
return pageContextHttpResponse;
|
|
353
338
|
}
|
|
@@ -389,7 +374,7 @@ async function getPermanentRedirect(pageContextInit, globalContext, httpRequestI
|
|
|
389
374
|
}
|
|
390
375
|
(0, loggerRuntime_js_1.logRuntimeInfo)?.(`Permanent redirection defined by config.redirects (https://vike.dev/redirects)`, httpRequestId, 'info');
|
|
391
376
|
const httpResponse = (0, createHttpResponse_js_1.createHttpResponseRedirect)({ url: urlTarget, statusCode: 301 }, pageContextInit);
|
|
392
|
-
const pageContextHttpResponse = createPageContext(pageContextInit);
|
|
377
|
+
const pageContextHttpResponse = (0, renderPageAlreadyRouted_js_1.createPageContext)(pageContextInit, false);
|
|
393
378
|
(0, utils_js_1.objectAssign)(pageContextHttpResponse, { httpResponse });
|
|
394
379
|
return pageContextHttpResponse;
|
|
395
380
|
}
|
|
@@ -410,10 +395,10 @@ pageContextNominalPageInit, httpRequestId, pageContextErrorPageInit, globalConte
|
|
|
410
395
|
const abortCall = pageContextAbort._abortCall;
|
|
411
396
|
(0, utils_js_1.assert)(abortCall);
|
|
412
397
|
(0, utils_js_1.assertUsage)(errorPageId, `You called ${picocolors_1.default.cyan(abortCall)} but you didn't define an error page, make sure to define one https://vike.dev/error-page`);
|
|
413
|
-
const pageContext = createPageContext({});
|
|
398
|
+
const pageContext = (0, renderPageAlreadyRouted_js_1.createPageContext)({}, false);
|
|
414
399
|
(0, utils_js_1.objectAssign)(pageContext, { pageId: errorPageId });
|
|
415
400
|
(0, utils_js_1.objectAssign)(pageContext, pageContextAbort);
|
|
416
|
-
(0, utils_js_1.objectAssign)(pageContext, pageContextErrorPageInit);
|
|
401
|
+
(0, utils_js_1.objectAssign)(pageContext, pageContextErrorPageInit, true);
|
|
417
402
|
(0, utils_js_1.objectAssign)(pageContext, await (0, loadUserFilesServerSide_js_1.loadUserFilesServerSide)(pageContext));
|
|
418
403
|
// We include pageContextInit: we don't only serialize pageContextAbort because the error page may need to access pageContextInit
|
|
419
404
|
pageContextSerialized = (0, serializePageContextClientSide_js_1.serializePageContextClientSide)(pageContext);
|
|
@@ -434,7 +419,7 @@ pageContextNominalPageInit, httpRequestId, pageContextErrorPageInit, globalConte
|
|
|
434
419
|
return { pageContextReturn };
|
|
435
420
|
}
|
|
436
421
|
if (pageContextAbort._urlRedirect) {
|
|
437
|
-
const pageContextReturn = createPageContext(pageContextInit);
|
|
422
|
+
const pageContextReturn = (0, renderPageAlreadyRouted_js_1.createPageContext)(pageContextInit, false);
|
|
438
423
|
(0, utils_js_1.objectAssign)(pageContextReturn, pageContextAbort);
|
|
439
424
|
const httpResponse = (0, createHttpResponse_js_1.createHttpResponseRedirect)(pageContextAbort._urlRedirect, pageContextInit);
|
|
440
425
|
(0, utils_js_1.objectAssign)(pageContextReturn, { httpResponse });
|
|
@@ -449,7 +434,7 @@ async function checkBaseUrl(pageContextInit, globalContext) {
|
|
|
449
434
|
const { isBaseMissing } = (0, utils_js_1.parseUrl)(urlOriginal, baseServer);
|
|
450
435
|
if (!isBaseMissing)
|
|
451
436
|
return;
|
|
452
|
-
const pageContext = createPageContext(pageContextInit);
|
|
437
|
+
const pageContext = (0, renderPageAlreadyRouted_js_1.createPageContext)(pageContextInit, false);
|
|
453
438
|
const httpResponse = (0, createHttpResponse_js_1.createHttpResponseBaseIsMissing)(urlOriginal, baseServer);
|
|
454
439
|
(0, utils_js_1.objectAssign)(pageContext, {
|
|
455
440
|
httpResponse,
|
|
@@ -462,7 +447,7 @@ function renderInvalidRequest(pageContextInit) {
|
|
|
462
447
|
const urlPathnameWithBase = (0, utils_js_1.parseUrl)(pageContextInit.urlOriginal, '/').pathname;
|
|
463
448
|
assertIsNotViteRequest(urlPathnameWithBase, pageContextInit.urlOriginal);
|
|
464
449
|
if (urlPathnameWithBase.endsWith('/favicon.ico')) {
|
|
465
|
-
const pageContext = createPageContext(pageContextInit);
|
|
450
|
+
const pageContext = (0, renderPageAlreadyRouted_js_1.createPageContext)(pageContextInit, false);
|
|
466
451
|
const httpResponse = (0, createHttpResponse_js_1.createHttpResponseFavicon404)();
|
|
467
452
|
(0, utils_js_1.objectAssign)(pageContext, { httpResponse });
|
|
468
453
|
(0, utils_js_1.checkType)(pageContext);
|
|
@@ -22,8 +22,8 @@ async function createDevMiddleware(options = {}) {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
const {
|
|
26
|
-
const server = await (0, vite_1.createServer)(
|
|
25
|
+
const { viteConfigFromUserEnhanced } = await (0, prepareViteApiCall_js_1.prepareViteApiCall)(optionsMod, 'dev');
|
|
26
|
+
const server = await (0, vite_1.createServer)(viteConfigFromUserEnhanced);
|
|
27
27
|
const devMiddleware = server.middlewares;
|
|
28
28
|
return { devMiddleware, viteServer: server, viteConfig: server.config };
|
|
29
29
|
}
|
package/dist/cjs/utils/assert.js
CHANGED
|
@@ -47,7 +47,7 @@ function assert(condition, debugInfo) {
|
|
|
47
47
|
const debugInfoSerialized = typeof debugInfo === 'string' ? debugInfo : JSON.stringify(debugInfo);
|
|
48
48
|
return picocolors_1.default.dim(`Debug info (for Vike maintainers; you can ignore this): ${debugInfoSerialized}`);
|
|
49
49
|
})();
|
|
50
|
-
const link = picocolors_1.default.
|
|
50
|
+
const link = picocolors_1.default.underline('https://github.com/vikejs/vike/issues/new?template=bug.yml');
|
|
51
51
|
let errMsg = [
|
|
52
52
|
`You stumbled upon a Vike bug. Go to ${link} and copy-paste this error. A maintainer will fix the bug (usually within 24 hours).`,
|
|
53
53
|
debugStr
|
|
@@ -5,9 +5,14 @@ const assert_js_1 = require("./assert.js");
|
|
|
5
5
|
// Same as Object.assign() but:
|
|
6
6
|
// - With type inference
|
|
7
7
|
// - Preserves property descriptors, which we need for preserving the getters added by getPageContextUrlComputed()
|
|
8
|
-
function objectAssign(obj, objAddendum) {
|
|
8
|
+
function objectAssign(obj, objAddendum, objAddendumCanBePageContextObject) {
|
|
9
9
|
if (objAddendum) {
|
|
10
|
-
|
|
10
|
+
if (!objAddendumCanBePageContextObject) {
|
|
11
|
+
// We only need this assert() in the rare case when the user is expected to mutate `pageContext` after the Vike hook was executed (and its promise resolved).
|
|
12
|
+
// - The only use case I can think of is the user mutating `pageContext` after the onRenderClient() promise resolved (which can happen when client-side rendering finishes after onRenderClient() resolves). In that case, having Vike await async Vike hooks isn't enough.
|
|
13
|
+
// - IIRC this assert() was mostly needed for preserving the getters added by getPageContextUrlComputed() but we don't need this anymore.
|
|
14
|
+
(0, assert_js_1.assert)(!('_isPageContextObject' in objAddendum));
|
|
15
|
+
}
|
|
11
16
|
Object.defineProperties(obj, Object.getOwnPropertyDescriptors(objAddendum));
|
|
12
17
|
}
|
|
13
18
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pick = pick;
|
|
4
|
+
function pick(obj, keys) {
|
|
5
|
+
const result = {};
|
|
6
|
+
for (const key of keys) {
|
|
7
|
+
if (key in obj) {
|
|
8
|
+
result[key] = obj[key];
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return result;
|
|
12
|
+
}
|
|
@@ -4,7 +4,6 @@ import { getPageContextUrlComputed } from '../../shared/getPageContextUrlCompute
|
|
|
4
4
|
import { loadPageRoutes } from '../../shared/route/loadPageRoutes.js';
|
|
5
5
|
import { getBaseServer } from './getBaseServer.js';
|
|
6
6
|
import { assert, isBaseServer, objectAssign } from './utils.js';
|
|
7
|
-
// TODO/now: can we avoid optimizeDeps.exclude of client runtime?
|
|
8
7
|
// @ts-ignore
|
|
9
8
|
import * as virtualFileExports from 'virtual:vike:importUserCode:client:client-routing';
|
|
10
9
|
const { pageFilesAll, allPageIds, pageConfigs, pageConfigGlobal } = getPageConfigsRuntime(virtualFileExports);
|
|
@@ -14,6 +13,8 @@ async function createPageContext(urlOriginal) {
|
|
|
14
13
|
assert(isBaseServer(baseServer));
|
|
15
14
|
const pageContext = {
|
|
16
15
|
_isPageContextObject: true,
|
|
16
|
+
isClientSide: true,
|
|
17
|
+
isPrerendering: false,
|
|
17
18
|
urlOriginal,
|
|
18
19
|
_objectCreatedByVike: true,
|
|
19
20
|
_urlHandler: null,
|
|
@@ -276,7 +276,7 @@ async function renderPageClientSide(renderArgs) {
|
|
|
276
276
|
if ('err' in args) {
|
|
277
277
|
const { err } = args;
|
|
278
278
|
assert(!('errorWhileRendering' in pageContext));
|
|
279
|
-
pageContext
|
|
279
|
+
objectAssign(pageContext, { errorWhileRendering: err });
|
|
280
280
|
if (isAbortError(err)) {
|
|
281
281
|
const errAbort = err;
|
|
282
282
|
logAbortErrorHandled(err, !import.meta.env.DEV, pageContext);
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
export { getPageContext };
|
|
2
2
|
declare function getPageContext(): Promise<{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
_isPageContextObject: boolean;
|
|
4
|
+
isPrerendering: boolean;
|
|
5
|
+
isClientSide: boolean;
|
|
6
6
|
isHydration: true;
|
|
7
7
|
isBackwardNavigation: null;
|
|
8
8
|
_hasPageContextFromServer: true;
|
|
9
9
|
_hasPageContextFromClient: false;
|
|
10
|
+
} & {
|
|
11
|
+
pageId: string;
|
|
12
|
+
routeParams: Record<string, string>;
|
|
10
13
|
} & {
|
|
11
14
|
_pageFilesAll: import("../../shared/getPageFiles.js").PageFile[];
|
|
12
15
|
_pageConfigs: import("../../__internal/index.js").PageConfig[];
|
|
@@ -9,13 +9,16 @@ import * as virtualFileExports from 'virtual:vike:importUserCode:client:server-r
|
|
|
9
9
|
const { pageFilesAll, pageConfigs, pageConfigGlobal } = getPageConfigsRuntime(virtualFileExports);
|
|
10
10
|
const urlFirst = getCurrentUrl({ withoutHash: true });
|
|
11
11
|
async function getPageContext() {
|
|
12
|
-
const pageContext =
|
|
13
|
-
|
|
12
|
+
const pageContext = {
|
|
13
|
+
_isPageContextObject: true,
|
|
14
|
+
isPrerendering: false,
|
|
15
|
+
isClientSide: true,
|
|
14
16
|
isHydration: true,
|
|
15
17
|
isBackwardNavigation: null,
|
|
16
18
|
_hasPageContextFromServer: true,
|
|
17
19
|
_hasPageContextFromClient: false
|
|
18
|
-
}
|
|
20
|
+
};
|
|
21
|
+
objectAssign(pageContext, getPageContextSerializedInHtml());
|
|
19
22
|
objectAssign(pageContext, await loadPageUserFiles(pageContext.pageId));
|
|
20
23
|
assertPristineUrl();
|
|
21
24
|
return pageContext;
|
|
@@ -1,12 +1,2 @@
|
|
|
1
1
|
export { getPageContextProxyForUser };
|
|
2
|
-
|
|
3
|
-
type PageContextForPassToClientWarning = {
|
|
4
|
-
_hasPageContextFromServer: boolean;
|
|
5
|
-
_hasPageContextFromClient: boolean;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Throw error when pageContext value isn't:
|
|
9
|
-
* - serializable, or
|
|
10
|
-
* - defined.
|
|
11
|
-
*/
|
|
12
|
-
declare function getPageContextProxyForUser<PageContext extends Record<string, unknown> & PageContextForPassToClientWarning>(pageContext: PageContext): PageContext;
|
|
2
|
+
declare function getPageContextProxyForUser<PageContext extends Record<string, unknown>>(pageContext: PageContext): PageContext;
|
|
@@ -1,77 +1,14 @@
|
|
|
1
1
|
export { getPageContextProxyForUser };
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Throw error when pageContext value isn't:
|
|
7
|
-
* - serializable, or
|
|
8
|
-
* - defined.
|
|
9
|
-
*/
|
|
2
|
+
import { assertUsage, getPropAccessNotation } from '../server-routing-runtime/utils.js';
|
|
3
|
+
import { NOT_SERIALIZABLE } from '../../shared/NOT_SERIALIZABLE.js';
|
|
4
|
+
// Throw error when pageContext value isn't serializable
|
|
10
5
|
function getPageContextProxyForUser(pageContext) {
|
|
11
|
-
assert([true, false].includes(pageContext._hasPageContextFromServer));
|
|
12
|
-
assert([true, false].includes(pageContext._hasPageContextFromClient));
|
|
13
6
|
return new Proxy(pageContext, {
|
|
14
7
|
get(_, prop) {
|
|
15
8
|
const val = pageContext[prop];
|
|
16
9
|
const propName = getPropAccessNotation(prop);
|
|
17
|
-
assertUsage(val !==
|
|
18
|
-
passToClientHint(pageContext, prop, propName);
|
|
10
|
+
assertUsage(val !== NOT_SERIALIZABLE, `Can't access pageContext${propName} on the client side. Because it can't be serialized, see server logs.`);
|
|
19
11
|
return val;
|
|
20
12
|
}
|
|
21
13
|
});
|
|
22
14
|
}
|
|
23
|
-
function passToClientHint(pageContext, prop, propName) {
|
|
24
|
-
if (handleVueReactivity(prop))
|
|
25
|
-
return;
|
|
26
|
-
// `prop in pageContext` is the trick we use to know the passToClient value on the client-side, as we set a value to all passToClient props, even `undefined` ones:
|
|
27
|
-
// ```html
|
|
28
|
-
// <script id="vike_pageContext" type="application/json">{"pageProps":"!undefined"}</script>
|
|
29
|
-
// ```
|
|
30
|
-
if (prop in pageContext)
|
|
31
|
-
return;
|
|
32
|
-
if (isWhitelisted(prop))
|
|
33
|
-
return;
|
|
34
|
-
// The trick described above (`prop in pageContext`) doesn't work if Vike doesn't fetch any pageContext from the server.
|
|
35
|
-
// - There would still be some value to show a warning, but it isn't worth it because of the confusion that the first recommendation (adding `prop` to `passToClient`) wouldn't actually remove the warning, and only the second recommendation (using `prop in pageContext` instead of `pageContext[prop]`) would work.
|
|
36
|
-
if (!pageContext._hasPageContextFromServer)
|
|
37
|
-
return;
|
|
38
|
-
const errMsg = `pageContext${propName} isn't defined on the client-side, see https://vike.dev/passToClient#error`;
|
|
39
|
-
if (
|
|
40
|
-
// TODO/next-major-release always make it an error.
|
|
41
|
-
// - Remove pageContext._hasPageContextFromClient logic (IIRC this is its only use case).
|
|
42
|
-
pageContext._hasPageContextFromClient) {
|
|
43
|
-
assertWarning(false, errMsg, { onlyOnce: false, showStackTrace: true });
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
assertUsage(false, errMsg);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
const WHITELIST = [
|
|
50
|
-
'then',
|
|
51
|
-
// Vue calls toJSON()
|
|
52
|
-
'toJSON'
|
|
53
|
-
];
|
|
54
|
-
function isWhitelisted(prop) {
|
|
55
|
-
if (WHITELIST.includes(prop))
|
|
56
|
-
return true;
|
|
57
|
-
if (typeof prop === 'symbol')
|
|
58
|
-
return true; // Vue tries to access some symbols
|
|
59
|
-
if (typeof prop !== 'string')
|
|
60
|
-
return true;
|
|
61
|
-
if (prop.startsWith('__v_'))
|
|
62
|
-
return true; // Vue internals upon `reactive(pageContext)`
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
// Handle Vue's reactivity.
|
|
66
|
-
// When changing a reactive object:
|
|
67
|
-
// - Vue tries to read its old value first. This triggers a `assertIsDefined()` failure if e.g. `pageContextReactive.routeParams = pageContextNew.routeParams` and `pageContextReactive` has no `routeParams`.
|
|
68
|
-
// - Vue seems to read __v_raw before reading the property.
|
|
69
|
-
function handleVueReactivity(prop) {
|
|
70
|
-
if (globalObject.prev === prop || globalObject.prev === '__v_raw')
|
|
71
|
-
return true;
|
|
72
|
-
globalObject.prev = prop;
|
|
73
|
-
window.setTimeout(() => {
|
|
74
|
-
globalObject.prev = undefined;
|
|
75
|
-
}, 0);
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
@@ -2,9 +2,9 @@ export { preparePageContextForUserConsumptionClientSide };
|
|
|
2
2
|
export type { PageContextForUserConsumptionClientSide };
|
|
3
3
|
import type { PageConfigUserFriendlyOld } from '../../shared/getPageFiles.js';
|
|
4
4
|
import type { PageConfigRuntime } from '../../shared/page-configs/PageConfig.js';
|
|
5
|
-
|
|
6
|
-
type PageContextForUserConsumptionClientSide = PageConfigUserFriendlyOld & PageContextForPassToClientWarning & {
|
|
5
|
+
type PageContextForUserConsumptionClientSide = PageConfigUserFriendlyOld & {
|
|
7
6
|
pageId: string;
|
|
7
|
+
_hasPageContextFromServer: boolean;
|
|
8
8
|
_pageConfigs: PageConfigRuntime[];
|
|
9
9
|
};
|
|
10
10
|
declare function preparePageContextForUserConsumptionClientSide<T extends PageContextForUserConsumptionClientSide>(pageContext: T, isClientRouting: boolean): T & {
|
|
@@ -11,13 +11,13 @@ import { assertVersion } from './utils.js';
|
|
|
11
11
|
* https://vike.dev/api#build
|
|
12
12
|
*/
|
|
13
13
|
async function build(options = {}) {
|
|
14
|
-
const {
|
|
14
|
+
const { viteConfigFromUserEnhanced, vikeConfig } = await prepareViteApiCall(options, 'build');
|
|
15
15
|
// Pass it to pluginAutoFullBuild()
|
|
16
|
-
if (
|
|
17
|
-
|
|
16
|
+
if (viteConfigFromUserEnhanced)
|
|
17
|
+
viteConfigFromUserEnhanced._viteConfigFromUserEnhanced = viteConfigFromUserEnhanced;
|
|
18
18
|
if (vikeConfig.global.config.vite6BuilderApp) {
|
|
19
19
|
assertVersion('Vite', version, '6.0.0');
|
|
20
|
-
const builder = await createBuilder(
|
|
20
|
+
const builder = await createBuilder(viteConfigFromUserEnhanced);
|
|
21
21
|
// See Vite plugin vike:build:pluginBuildApp
|
|
22
22
|
await builder.buildApp();
|
|
23
23
|
}
|
|
@@ -30,14 +30,14 @@ async function build(options = {}) {
|
|
|
30
30
|
// > See: https://github.com/vikejs/vike/blob/c6c7533a56b3a16fc43ed644fc5c10c02d0ff375/vike/node/plugin/plugins/autoFullBuild.ts#L98
|
|
31
31
|
// > We purposely don't start the pre-rendering in this `build()` function but in a Rollup hook instead.
|
|
32
32
|
// > Rationale: https://github.com/vikejs/vike/issues/2123
|
|
33
|
-
await buildVite(
|
|
33
|
+
await buildVite(viteConfigFromUserEnhanced);
|
|
34
34
|
// After pre-rendering, when using the Vike CLI, the process is forcefully exited at the end of the buildVite() call above.
|
|
35
35
|
if (isVikeCli() && isPrerendering())
|
|
36
36
|
assert(false);
|
|
37
37
|
}
|
|
38
38
|
return {
|
|
39
|
-
/* We don't return `viteConfig` because `
|
|
40
|
-
viteConfig:
|
|
39
|
+
/* We don't return `viteConfig` because `viteConfigFromUserEnhanced` is `InlineConfig` not `ResolvedConfig`
|
|
40
|
+
viteConfig: viteConfigFromUserEnhanced,
|
|
41
41
|
*/
|
|
42
42
|
};
|
|
43
43
|
}
|
package/dist/esm/node/api/dev.js
CHANGED
|
@@ -7,8 +7,8 @@ import { createServer } from 'vite';
|
|
|
7
7
|
* https://vike.dev/api#dev
|
|
8
8
|
*/
|
|
9
9
|
async function dev(options = {}) {
|
|
10
|
-
const {
|
|
11
|
-
const server = await createServer(
|
|
10
|
+
const { viteConfigFromUserEnhanced } = await prepareViteApiCall(options, 'dev');
|
|
11
|
+
const server = await createServer(viteConfigFromUserEnhanced);
|
|
12
12
|
return {
|
|
13
13
|
viteServer: server,
|
|
14
14
|
viteConfig: server.config
|
|
@@ -7,7 +7,7 @@ import type { APIOptions, Operation } from './types.js';
|
|
|
7
7
|
import { type VikeConfigObject } from '../plugin/plugins/importUserCode/v1-design/getVikeConfig.js';
|
|
8
8
|
declare function prepareViteApiCall(options: APIOptions, operation: Operation): Promise<{
|
|
9
9
|
vikeConfig: VikeConfigObject;
|
|
10
|
-
|
|
10
|
+
viteConfigFromUserEnhanced: InlineConfig | undefined;
|
|
11
11
|
}>;
|
|
12
12
|
declare function getViteRoot(operation: Operation): Promise<string>;
|
|
13
13
|
declare function normalizeViteRoot(root: string): string;
|