vike 0.4.259-commit-2fe6cc7 → 0.4.259-commit-fc34c43
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/node/api/resolveViteConfigFromUser.js +19 -6
- package/dist/node/prerender/runPrerender.d.ts +8 -2
- package/dist/node/vite/plugins/build/pluginBuildApp.js +3 -3
- package/dist/node/vite/shared/addSsrMiddleware.js +1 -1
- package/dist/node/vite/shared/isViteCli.d.ts +9 -4
- package/dist/node/vite/shared/isViteCli.js +24 -4
- package/dist/server/runtime/globalContext.js +4 -1
- package/dist/server/runtime/renderPageServer/createPageContextServer.d.ts +12 -3
- package/dist/server/runtime/renderPageServer/loadPageConfigsLazyServerSide.d.ts +8 -2
- package/dist/server/runtime/renderPageServer/renderPageServerAfterRoute.d.ts +32 -8
- package/dist/server/runtime/renderPageServer.d.ts +8 -2
- package/dist/server/runtime/renderPageServer.js +2 -2
- package/dist/types/PageContext.d.ts +5 -2
- package/dist/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/utils/PROJECT_VERSION.js +1 -1
- package/package.json +5 -5
|
@@ -14,7 +14,7 @@ import { toPosixPath } from '../../utils/path.js';
|
|
|
14
14
|
import pc from '@brillout/picocolors';
|
|
15
15
|
import { getEnvVarObject } from '../vite/shared/getEnvVarObject.js';
|
|
16
16
|
import { getVikeApiOperation, isVikeCliOrApi } from '../../shared-server-node/api-context.js';
|
|
17
|
-
import {
|
|
17
|
+
import { getViteCliCommand, getViteCliArgs } from '../vite/shared/isViteCli.js';
|
|
18
18
|
import './assertEnvApiDevAndProd.js';
|
|
19
19
|
const globalObject = getGlobalObject('api/prepareViteApiCall.ts', {});
|
|
20
20
|
async function resolveViteConfigFromUser() {
|
|
@@ -59,8 +59,16 @@ async function getViteInfo(viteContext) {
|
|
|
59
59
|
// Precedence:
|
|
60
60
|
// 1. (highest precedence) | viteConfigFromUserEnvVar | VITE_CONFIG
|
|
61
61
|
// 2. | viteConfigFromUserVikeMode | VIKE_CONFIG & Vike CLI options — only `+mode`
|
|
62
|
-
//
|
|
63
|
-
//
|
|
62
|
+
// 3. | viteConfigFromUserViteCli | Vite CLI args — `[root]` & `-c/--config`
|
|
63
|
+
// 4. | viteConfigFromUserVikeApiOptions | Vike API options
|
|
64
|
+
// 5. (lowest precedence) | viteConfigFromUserViteConfigFile | vite.config.js
|
|
65
|
+
// Resolve Vite CLI args (when invoked via Vite's CLI rather than Vike's API).
|
|
66
|
+
// Without this, Vike loads vite.config.js blind to `vite [root]` / `-c <file>` and
|
|
67
|
+
// ends up with the wrong root when those Vite CLI args are used.
|
|
68
|
+
const viteConfigFromUserViteCli = getViteCliArgs();
|
|
69
|
+
if (viteConfigFromUserViteCli) {
|
|
70
|
+
viteConfigFromUserResolved = merge(viteConfigFromUserResolved ?? {}, viteConfigFromUserViteCli);
|
|
71
|
+
}
|
|
64
72
|
// Resolve Vike's +mode setting
|
|
65
73
|
{
|
|
66
74
|
const viteConfigFromUserVikeMode = pick(getVikeConfigFromCliOrEnv().vikeConfigFromCliOrEnv, ['mode']);
|
|
@@ -156,7 +164,7 @@ async function loadViteConfigFile(viteConfigFromUserResolved, viteContext) {
|
|
|
156
164
|
}
|
|
157
165
|
function getViteContext() {
|
|
158
166
|
const vikeApiOperation = getVikeApiOperation();
|
|
159
|
-
const viteCommand =
|
|
167
|
+
const viteCommand = getViteCliCommand();
|
|
160
168
|
assert(!(viteCommand && vikeApiOperation));
|
|
161
169
|
if (vikeApiOperation)
|
|
162
170
|
return getViteContextWithOperation(vikeApiOperation.operation);
|
|
@@ -224,7 +232,12 @@ async function assertViteRoot2(root, viteConfigFromUserResolved, viteContext) {
|
|
|
224
232
|
function assertViteRoot(rootResolvedEarly, config) {
|
|
225
233
|
const rootResolved = config.root;
|
|
226
234
|
const rootGlobal = globalObject.root;
|
|
227
|
-
if (rootGlobal)
|
|
228
|
-
assert(
|
|
235
|
+
if (rootGlobal && normalizeViteRoot(rootGlobal) !== normalizeViteRoot(rootResolvedEarly)) {
|
|
236
|
+
assert(false, {
|
|
237
|
+
rootResolved,
|
|
238
|
+
rootGlobal,
|
|
239
|
+
rootResolvedEarly,
|
|
240
|
+
});
|
|
241
|
+
}
|
|
229
242
|
assertUsage(normalizeViteRoot(rootResolvedEarly) === normalizeViteRoot(rootResolved), errMsg);
|
|
230
243
|
}
|
|
@@ -72,7 +72,10 @@ declare function createPageContextPrerendering(urlOriginal: string, prerenderCon
|
|
|
72
72
|
isPrerendering: boolean;
|
|
73
73
|
_requestId: number;
|
|
74
74
|
} & import("../../types/PageContext.js").PageContextInit & {
|
|
75
|
-
|
|
75
|
+
_nodeDev?: {
|
|
76
|
+
req: import("http").IncomingMessage;
|
|
77
|
+
res: import("http").ServerResponse;
|
|
78
|
+
};
|
|
76
79
|
_reqWeb?: Request;
|
|
77
80
|
} & {
|
|
78
81
|
_globalContext: ({
|
|
@@ -148,7 +151,10 @@ declare function createPageContextPrerendering(urlOriginal: string, prerenderCon
|
|
|
148
151
|
_baseServer: string;
|
|
149
152
|
_baseAssets: string;
|
|
150
153
|
_pageContextInit: import("../../types/PageContext.js").PageContextInit & {
|
|
151
|
-
|
|
154
|
+
_nodeDev?: {
|
|
155
|
+
req: import("http").IncomingMessage;
|
|
156
|
+
res: import("http").ServerResponse;
|
|
157
|
+
};
|
|
152
158
|
_reqWeb?: Request;
|
|
153
159
|
} & {
|
|
154
160
|
headers?: Record<string, unknown>;
|
|
@@ -5,7 +5,7 @@ import { assert, assertWarning } from '../../../../utils/assert.js';
|
|
|
5
5
|
import { onSetupBuild } from '../../../../utils/assertSetup.js';
|
|
6
6
|
import { getGlobalObject } from '../../../../utils/getGlobalObject.js';
|
|
7
7
|
import { isPrerenderAutoRunEnabled, wasPrerenderRun } from '../../../prerender/context.js';
|
|
8
|
-
import { isViteCli,
|
|
8
|
+
import { isViteCli, getViteBuildCliArgs } from '../../shared/isViteCli.js';
|
|
9
9
|
import pc from '@brillout/picocolors';
|
|
10
10
|
import { getVikeConfigInternal } from '../../shared/resolveVikeConfigInternal.js';
|
|
11
11
|
import { isVikeCliOrApi } from '../../../../shared-server-node/api-context.js';
|
|
@@ -141,7 +141,7 @@ async function triggerPrerendering(config, viteEnv, bundle) {
|
|
|
141
141
|
}
|
|
142
142
|
async function abortViteBuildSsr() {
|
|
143
143
|
const vikeConfig = await getVikeConfigInternal();
|
|
144
|
-
if (vikeConfig.config.disableAutoFullBuild !== true && isViteCli() &&
|
|
144
|
+
if (vikeConfig.config.disableAutoFullBuild !== true && isViteCli() && getViteBuildCliArgs()?.build.ssr) {
|
|
145
145
|
assertWarning(false, `The CLI call ${pc.cyan('$ vite build --ssr')} is superfluous since ${pc.cyan('$ vite build')} also builds the server-side. If you want two separate build steps then use https://vike.dev/disableAutoFullBuild or use Vite's ${pc.cyan('build()')} API.`, { onlyOnce: true });
|
|
146
146
|
process.exit(0);
|
|
147
147
|
}
|
|
@@ -160,7 +160,7 @@ function isPrerenderForceExit() {
|
|
|
160
160
|
return globalObject.forceExit;
|
|
161
161
|
}
|
|
162
162
|
function getFullBuildInlineConfig(config) {
|
|
163
|
-
const configFromCli = !isViteCli() ? null :
|
|
163
|
+
const configFromCli = !isViteCli() ? null : getViteBuildCliArgs();
|
|
164
164
|
if (config._viteConfigFromUserResolved) {
|
|
165
165
|
return config._viteConfigFromUserResolved;
|
|
166
166
|
}
|
|
@@ -14,7 +14,7 @@ function addSsrMiddleware(middlewares, config, isPreview, isPrerenderingEnabled)
|
|
|
14
14
|
const pageContextInit = {
|
|
15
15
|
urlOriginal: url,
|
|
16
16
|
headersOriginal: headers,
|
|
17
|
-
|
|
17
|
+
_nodeDev: { req, res },
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(pageContextInit, 'userAgent', {
|
|
20
20
|
get() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { isViteCli };
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
2
|
+
export { getViteCliArgs };
|
|
3
|
+
export { getViteBuildCliArgs };
|
|
4
|
+
export { getViteCliCommand };
|
|
4
5
|
import '../assertEnvVite.js';
|
|
5
6
|
declare function isViteCli(): boolean;
|
|
6
7
|
type ConfigFromCli = {
|
|
@@ -10,5 +11,9 @@ type ConfigFromCli = {
|
|
|
10
11
|
build: Record<string, unknown>;
|
|
11
12
|
};
|
|
12
13
|
type ViteCommand = 'dev' | 'build' | 'optimize' | 'preview';
|
|
13
|
-
declare function
|
|
14
|
-
declare function
|
|
14
|
+
declare function getViteCliCommand(): ViteCommand | null;
|
|
15
|
+
declare function getViteBuildCliArgs(): null | ConfigFromCli;
|
|
16
|
+
declare function getViteCliArgs(): null | {
|
|
17
|
+
root: string | undefined;
|
|
18
|
+
configFile: string | undefined;
|
|
19
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { isViteCli };
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
2
|
+
export { getViteCliArgs };
|
|
3
|
+
export { getViteBuildCliArgs };
|
|
4
|
+
export { getViteCliCommand };
|
|
4
5
|
import { assert } from '../../../utils/assert.js';
|
|
5
6
|
import { isObject } from '../../../utils/isObject.js';
|
|
6
7
|
import { isToolCli } from '../../../utils/isToolCli.js';
|
|
@@ -10,7 +11,7 @@ const desc = 'vike:vite-cli-simulation';
|
|
|
10
11
|
function isViteCli() {
|
|
11
12
|
return isToolCli('vite');
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
+
function getViteCliCommand() {
|
|
14
15
|
if (!isViteCli())
|
|
15
16
|
return null;
|
|
16
17
|
let command;
|
|
@@ -45,7 +46,7 @@ function getViteCommandFromCli() {
|
|
|
45
46
|
assert(command);
|
|
46
47
|
return command;
|
|
47
48
|
}
|
|
48
|
-
function
|
|
49
|
+
function getViteBuildCliArgs() {
|
|
49
50
|
if (!isViteCli())
|
|
50
51
|
return null;
|
|
51
52
|
// Copied & adapted from Vite
|
|
@@ -135,3 +136,22 @@ function getViteConfigForBuildFromCli() {
|
|
|
135
136
|
return ret;
|
|
136
137
|
}
|
|
137
138
|
}
|
|
139
|
+
function getViteCliArgs() {
|
|
140
|
+
if (!isViteCli())
|
|
141
|
+
return null;
|
|
142
|
+
const cli = cac(desc);
|
|
143
|
+
cli.option('-c, --config <file>', desc);
|
|
144
|
+
let result = null;
|
|
145
|
+
const setResult = (root, options) => {
|
|
146
|
+
assert(root === undefined || typeof root === 'string');
|
|
147
|
+
assert(isObject(options));
|
|
148
|
+
assert(options.config === undefined || typeof options.config === 'string');
|
|
149
|
+
result = { root, configFile: options.config };
|
|
150
|
+
};
|
|
151
|
+
cli.command('[root]', desc).alias('serve').alias('dev').action(setResult);
|
|
152
|
+
cli.command('build [root]', desc).action(setResult);
|
|
153
|
+
cli.command('optimize [root]', desc).action(setResult);
|
|
154
|
+
cli.command('preview [root]', desc).action(setResult);
|
|
155
|
+
cli.parse();
|
|
156
|
+
return result;
|
|
157
|
+
}
|
|
@@ -454,9 +454,12 @@ async function createGlobalContext(virtualFileExportsGlobalEntry) {
|
|
|
454
454
|
debug('createGlobalContext() - done [sync]');
|
|
455
455
|
// We define an early globalContext version synchronously, so that getGlobalContextSync() can be called early.
|
|
456
456
|
// - Required by vike-vercel
|
|
457
|
-
|
|
457
|
+
const globalContextIsSetEarly = !!globalObject.globalContext;
|
|
458
|
+
assertWarning(globalContextIsSetEarly, "globalContext isn't set early", { onlyOnce: false });
|
|
458
459
|
const globalContext = await globalContextPromise;
|
|
459
460
|
debug('createGlobalContext() - done [async]');
|
|
461
|
+
assert(globalContextIsSetEarly); // We deliberately assert after the `await` (otherwise it swallows promise rejections such as an assert() failing synchronously inside `async createGlobalContextShared()`).
|
|
462
|
+
assert(globalObject.globalContext);
|
|
460
463
|
assertV1Design(
|
|
461
464
|
// pageConfigs is PageConfigRuntime[] but assertV1Design() requires PageConfigBuildTime[]
|
|
462
465
|
globalContext._pageConfigs.length > 0, globalContext._pageFilesAll);
|
|
@@ -24,7 +24,10 @@ declare function createPageContextServer(pageContextInit: PageContextInitInterna
|
|
|
24
24
|
isPrerendering: boolean;
|
|
25
25
|
_requestId: number;
|
|
26
26
|
} & PageContextInit & {
|
|
27
|
-
|
|
27
|
+
_nodeDev?: {
|
|
28
|
+
req: import("http").IncomingMessage;
|
|
29
|
+
res: import("http").ServerResponse;
|
|
30
|
+
};
|
|
28
31
|
_reqWeb?: Request;
|
|
29
32
|
} & {
|
|
30
33
|
_globalContext: ({
|
|
@@ -100,7 +103,10 @@ declare function createPageContextServer(pageContextInit: PageContextInitInterna
|
|
|
100
103
|
_baseServer: string;
|
|
101
104
|
_baseAssets: string;
|
|
102
105
|
_pageContextInit: PageContextInit & {
|
|
103
|
-
|
|
106
|
+
_nodeDev?: {
|
|
107
|
+
req: import("http").IncomingMessage;
|
|
108
|
+
res: import("http").ServerResponse;
|
|
109
|
+
};
|
|
104
110
|
_reqWeb?: Request;
|
|
105
111
|
} & {
|
|
106
112
|
headers?: Record<string, unknown>;
|
|
@@ -132,6 +138,9 @@ declare function createPageContextServerWithoutGlobalContext(pageContextInit: Pa
|
|
|
132
138
|
isPrerendering: boolean;
|
|
133
139
|
_requestId: number;
|
|
134
140
|
} & PageContextInit & {
|
|
135
|
-
|
|
141
|
+
_nodeDev?: {
|
|
142
|
+
req: import("http").IncomingMessage;
|
|
143
|
+
res: import("http").ServerResponse;
|
|
144
|
+
};
|
|
136
145
|
_reqWeb?: Request;
|
|
137
146
|
};
|
|
@@ -23,7 +23,10 @@ declare function loadPageConfigsLazyServerSide(pageContext: PageContext_loadPage
|
|
|
23
23
|
isPrerendering: boolean;
|
|
24
24
|
_requestId: number;
|
|
25
25
|
} & import("../renderPageServer.js").PageContextInit & {
|
|
26
|
-
|
|
26
|
+
_nodeDev?: {
|
|
27
|
+
req: import("http").IncomingMessage;
|
|
28
|
+
res: import("http").ServerResponse;
|
|
29
|
+
};
|
|
27
30
|
_reqWeb?: Request;
|
|
28
31
|
} & {
|
|
29
32
|
_globalContext: ({
|
|
@@ -99,7 +102,10 @@ declare function loadPageConfigsLazyServerSide(pageContext: PageContext_loadPage
|
|
|
99
102
|
_baseServer: string;
|
|
100
103
|
_baseAssets: string;
|
|
101
104
|
_pageContextInit: import("../renderPageServer.js").PageContextInit & {
|
|
102
|
-
|
|
105
|
+
_nodeDev?: {
|
|
106
|
+
req: import("http").IncomingMessage;
|
|
107
|
+
res: import("http").ServerResponse;
|
|
108
|
+
};
|
|
103
109
|
_reqWeb?: Request;
|
|
104
110
|
} & {
|
|
105
111
|
headers?: Record<string, unknown>;
|
|
@@ -31,7 +31,10 @@ declare function prerenderPage(pageContext: Parameters<typeof prerenderPageEntry
|
|
|
31
31
|
isPrerendering: boolean;
|
|
32
32
|
_requestId: number;
|
|
33
33
|
} & import("../renderPageServer.js").PageContextInit & {
|
|
34
|
-
|
|
34
|
+
_nodeDev?: {
|
|
35
|
+
req: import("http").IncomingMessage;
|
|
36
|
+
res: import("http").ServerResponse;
|
|
37
|
+
};
|
|
35
38
|
_reqWeb?: Request;
|
|
36
39
|
} & {
|
|
37
40
|
_globalContext: ({
|
|
@@ -107,7 +110,10 @@ declare function prerenderPage(pageContext: Parameters<typeof prerenderPageEntry
|
|
|
107
110
|
_baseServer: string;
|
|
108
111
|
_baseAssets: string;
|
|
109
112
|
_pageContextInit: import("../renderPageServer.js").PageContextInit & {
|
|
110
|
-
|
|
113
|
+
_nodeDev?: {
|
|
114
|
+
req: import("http").IncomingMessage;
|
|
115
|
+
res: import("http").ServerResponse;
|
|
116
|
+
};
|
|
111
117
|
_reqWeb?: Request;
|
|
112
118
|
} & {
|
|
113
119
|
headers?: Record<string, unknown>;
|
|
@@ -167,7 +173,10 @@ declare function prerenderPage(pageContext: Parameters<typeof prerenderPageEntry
|
|
|
167
173
|
isPrerendering: boolean;
|
|
168
174
|
_requestId: number;
|
|
169
175
|
} & import("../renderPageServer.js").PageContextInit & {
|
|
170
|
-
|
|
176
|
+
_nodeDev?: {
|
|
177
|
+
req: import("http").IncomingMessage;
|
|
178
|
+
res: import("http").ServerResponse;
|
|
179
|
+
};
|
|
171
180
|
_reqWeb?: Request;
|
|
172
181
|
} & {
|
|
173
182
|
_globalContext: ({
|
|
@@ -243,7 +252,10 @@ declare function prerenderPage(pageContext: Parameters<typeof prerenderPageEntry
|
|
|
243
252
|
_baseServer: string;
|
|
244
253
|
_baseAssets: string;
|
|
245
254
|
_pageContextInit: import("../renderPageServer.js").PageContextInit & {
|
|
246
|
-
|
|
255
|
+
_nodeDev?: {
|
|
256
|
+
req: import("http").IncomingMessage;
|
|
257
|
+
res: import("http").ServerResponse;
|
|
258
|
+
};
|
|
247
259
|
_reqWeb?: Request;
|
|
248
260
|
} & {
|
|
249
261
|
headers?: Record<string, unknown>;
|
|
@@ -311,7 +323,10 @@ declare function prerenderPageEntry(pageContext: PageContextCreatedServer & Page
|
|
|
311
323
|
isPrerendering: boolean;
|
|
312
324
|
_requestId: number;
|
|
313
325
|
} & import("../renderPageServer.js").PageContextInit & {
|
|
314
|
-
|
|
326
|
+
_nodeDev?: {
|
|
327
|
+
req: import("http").IncomingMessage;
|
|
328
|
+
res: import("http").ServerResponse;
|
|
329
|
+
};
|
|
315
330
|
_reqWeb?: Request;
|
|
316
331
|
} & {
|
|
317
332
|
_globalContext: ({
|
|
@@ -387,7 +402,10 @@ declare function prerenderPageEntry(pageContext: PageContextCreatedServer & Page
|
|
|
387
402
|
_baseServer: string;
|
|
388
403
|
_baseAssets: string;
|
|
389
404
|
_pageContextInit: import("../renderPageServer.js").PageContextInit & {
|
|
390
|
-
|
|
405
|
+
_nodeDev?: {
|
|
406
|
+
req: import("http").IncomingMessage;
|
|
407
|
+
res: import("http").ServerResponse;
|
|
408
|
+
};
|
|
391
409
|
_reqWeb?: Request;
|
|
392
410
|
} & {
|
|
393
411
|
headers?: Record<string, unknown>;
|
|
@@ -447,7 +465,10 @@ declare function prerenderPageEntry(pageContext: PageContextCreatedServer & Page
|
|
|
447
465
|
isPrerendering: boolean;
|
|
448
466
|
_requestId: number;
|
|
449
467
|
} & import("../renderPageServer.js").PageContextInit & {
|
|
450
|
-
|
|
468
|
+
_nodeDev?: {
|
|
469
|
+
req: import("http").IncomingMessage;
|
|
470
|
+
res: import("http").ServerResponse;
|
|
471
|
+
};
|
|
451
472
|
_reqWeb?: Request;
|
|
452
473
|
} & {
|
|
453
474
|
_globalContext: ({
|
|
@@ -523,7 +544,10 @@ declare function prerenderPageEntry(pageContext: PageContextCreatedServer & Page
|
|
|
523
544
|
_baseServer: string;
|
|
524
545
|
_baseAssets: string;
|
|
525
546
|
_pageContextInit: import("../renderPageServer.js").PageContextInit & {
|
|
526
|
-
|
|
547
|
+
_nodeDev?: {
|
|
548
|
+
req: import("http").IncomingMessage;
|
|
549
|
+
res: import("http").ServerResponse;
|
|
550
|
+
};
|
|
527
551
|
_reqWeb?: Request;
|
|
528
552
|
} & {
|
|
529
553
|
headers?: Record<string, unknown>;
|
|
@@ -23,7 +23,10 @@ declare function getPageContextBegin(pageContextInit: PageContextInitInternal, g
|
|
|
23
23
|
isPrerendering: boolean;
|
|
24
24
|
_requestId: number;
|
|
25
25
|
} & PageContextInit & {
|
|
26
|
-
|
|
26
|
+
_nodeDev?: {
|
|
27
|
+
req: import("http").IncomingMessage;
|
|
28
|
+
res: import("http").ServerResponse;
|
|
29
|
+
};
|
|
27
30
|
_reqWeb?: Request;
|
|
28
31
|
} & {
|
|
29
32
|
_globalContext: ({
|
|
@@ -99,7 +102,10 @@ declare function getPageContextBegin(pageContextInit: PageContextInitInternal, g
|
|
|
99
102
|
_baseServer: string;
|
|
100
103
|
_baseAssets: string;
|
|
101
104
|
_pageContextInit: PageContextInit & {
|
|
102
|
-
|
|
105
|
+
_nodeDev?: {
|
|
106
|
+
req: import("http").IncomingMessage;
|
|
107
|
+
res: import("http").ServerResponse;
|
|
108
|
+
};
|
|
103
109
|
_reqWeb?: Request;
|
|
104
110
|
} & {
|
|
105
111
|
headers?: Record<string, unknown>;
|
|
@@ -265,8 +265,8 @@ async function renderPageServerEntryWithMiddlewares(pageContext, renderPageServe
|
|
|
265
265
|
]);
|
|
266
266
|
const handler = router[universalSymbol];
|
|
267
267
|
const request = pageContext._reqWeb ??
|
|
268
|
-
(pageContext.
|
|
269
|
-
? requestAdapter(pageContext.
|
|
268
|
+
(pageContext._nodeDev
|
|
269
|
+
? requestAdapter(pageContext._nodeDev.req, pageContext._nodeDev.res)
|
|
270
270
|
: new Request(new URL(pageContext.urlOriginal, 'http://localhost').toString(), {
|
|
271
271
|
headers: pageContext.headers ?? {},
|
|
272
272
|
}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IncomingMessage } from 'node:http';
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
2
|
export type { PageContext };
|
|
3
3
|
export type { PageContextServer };
|
|
4
4
|
export type { PageContextClient };
|
|
@@ -140,7 +140,10 @@ type PageContextInit = {
|
|
|
140
140
|
/** @deprecated Set `pageContextInit.urlOriginal` instead */ url?: string;
|
|
141
141
|
};
|
|
142
142
|
type PageContextInitInternal = PageContextInit & {
|
|
143
|
-
|
|
143
|
+
_nodeDev?: {
|
|
144
|
+
req: IncomingMessage;
|
|
145
|
+
res: ServerResponse;
|
|
146
|
+
};
|
|
144
147
|
_reqWeb?: Request;
|
|
145
148
|
};
|
|
146
149
|
type PageContextBuiltInServer<Data> = PageContextBuiltInCommon<Data> & PageContextInit & PageContextUrlServer & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.259-commit-
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.259-commit-fc34c43";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.259-commit-
|
|
2
|
+
export const PROJECT_VERSION = '0.4.259-commit-fc34c43';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vike",
|
|
3
|
-
"version": "0.4.259-commit-
|
|
3
|
+
"version": "0.4.259-commit-fc34c43",
|
|
4
4
|
"repository": "https://github.com/vikejs/vike",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": {
|
|
@@ -130,12 +130,12 @@
|
|
|
130
130
|
"@babel/types": "^7.28.5",
|
|
131
131
|
"@brillout/import": "^0.2.6",
|
|
132
132
|
"@brillout/json-serializer": "^0.5.23",
|
|
133
|
-
"@brillout/picocolors": "^1.0.
|
|
133
|
+
"@brillout/picocolors": "^1.0.31",
|
|
134
134
|
"@brillout/vite-plugin-server-entry": "0.7.18",
|
|
135
135
|
"@universal-deploy/store": "^0.2.1",
|
|
136
136
|
"@universal-deploy/vite": "^0.1.9",
|
|
137
137
|
"@universal-middleware/core": "^0.4.17",
|
|
138
|
-
"@universal-middleware/node": "^0.
|
|
138
|
+
"@universal-middleware/node": "^0.2.0",
|
|
139
139
|
"cac": "^6.0.0",
|
|
140
140
|
"convert-route": "^1.1.1",
|
|
141
141
|
"es-module-lexer": "^1.0.0",
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"json5": "^2.0.0",
|
|
144
144
|
"magic-string": "^0.30.17",
|
|
145
145
|
"picomatch": "^4.0.4",
|
|
146
|
-
"semver": "^7.8.
|
|
146
|
+
"semver": "^7.8.1",
|
|
147
147
|
"sirv": "^3.0.2",
|
|
148
148
|
"source-map-support": "^0.5.0",
|
|
149
149
|
"tinyglobby": "^0.2.16",
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
"node": ">=20.19.0"
|
|
167
167
|
},
|
|
168
168
|
"license": "MIT",
|
|
169
|
-
"description": "(Replaces Next.js/Nuxt) 🔨
|
|
169
|
+
"description": "(Replaces Next.js/Nuxt) 🔨 Build mission-critical applications with stability and development freedom.",
|
|
170
170
|
"keywords": [
|
|
171
171
|
"vite-plugin",
|
|
172
172
|
"ssr",
|