vike 0.4.256-commit-3041693 → 0.4.256-commit-70e9a80
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/vite/plugins/pluginDev/optimizeDeps.d.ts +1 -1
- package/dist/node/vite/plugins/pluginDev/optimizeDeps.js +2 -1
- package/dist/node/vite/plugins/pluginUniversalDeploy/getDeployConfigs.d.ts +1 -1
- package/dist/node/vite/plugins/pluginUniversalDeploy/getDeployConfigs.js +30 -44
- package/dist/node/vite/plugins/pluginUniversalDeploy/getServerInfo.js +5 -5
- package/dist/node/vite/shared/resolveVikeConfigInternal/configDefinitionsBuiltIn.js +1 -1
- package/dist/types/Server.d.ts +2 -1
- package/dist/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/utils/PROJECT_VERSION.js +1 -1
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ declare const optimizeDeps: {
|
|
|
9
9
|
};
|
|
10
10
|
readonly ssr: {
|
|
11
11
|
readonly optimizeDeps: {
|
|
12
|
-
readonly exclude: ["@brillout/import", "@brillout/json-serializer", "@brillout/
|
|
12
|
+
readonly exclude: ["@brillout/import", "@brillout/json-serializer", "@brillout/vite-plugin-server-entry", "vike"];
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
};
|
|
@@ -55,7 +55,8 @@ const optimizeDeps = {
|
|
|
55
55
|
exclude: [
|
|
56
56
|
'@brillout/import',
|
|
57
57
|
'@brillout/json-serializer',
|
|
58
|
-
|
|
58
|
+
// FIXME Breaks @cloudflare/vite-plugin. Remove me if CI passes
|
|
59
|
+
// '@brillout/picocolors',
|
|
59
60
|
'@brillout/vite-plugin-server-entry',
|
|
60
61
|
'vike',
|
|
61
62
|
],
|
|
@@ -8,7 +8,7 @@ declare function getDeployConfigs(pageId: string, page: PageConfigPublicWithRout
|
|
|
8
8
|
isr: {
|
|
9
9
|
expiration: number;
|
|
10
10
|
} | undefined;
|
|
11
|
-
edge: boolean;
|
|
11
|
+
edge: boolean | undefined;
|
|
12
12
|
};
|
|
13
13
|
} | null;
|
|
14
14
|
export declare function getRoutePageContextJson(routeIr: ReturnType<typeof fromVike>): {
|
|
@@ -1,57 +1,43 @@
|
|
|
1
1
|
export { getDeployConfigs };
|
|
2
|
-
import pc from '@brillout/picocolors';
|
|
3
2
|
import { assert, assertUsage, assertWarning } from '../../../../utils/assert.js';
|
|
4
3
|
import { isObject } from '../../../../utils/isObject.js';
|
|
5
4
|
import '../../assertEnvVite.js';
|
|
5
|
+
import { isCallable } from '../../../../utils/isCallable.js';
|
|
6
6
|
function getDeployConfigs(pageId, page) {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const edge =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
assertWarning(false, `Page ${pageId}: ${pc.cyan(isrOrEdge)} is not supported when using route function. Remove ${pc.cyan(isrOrEdge)} config or use a route string if possible.`, { onlyOnce: true });
|
|
15
|
-
isr = null;
|
|
7
|
+
const { route } = page;
|
|
8
|
+
if (!route)
|
|
9
|
+
return null;
|
|
10
|
+
// Vercel setting: +edge
|
|
11
|
+
const { edge } = page.config;
|
|
12
|
+
if (edge) {
|
|
13
|
+
assertUsage(typeof edge === 'boolean', '+edge must be a boolean');
|
|
16
14
|
}
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
// Vercel setting: +isr
|
|
16
|
+
let { isr } = page.config;
|
|
17
|
+
if (isr) {
|
|
18
|
+
assertUsage(isObject(isr), '+isr must be an object');
|
|
19
|
+
assertUsage(typeof isr.expiration === 'number' && isr.expiration > 0, '+isr.expiration must be a positive number');
|
|
19
20
|
}
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
vercel: {
|
|
26
|
-
isr: isr ? { expiration: isr } : undefined,
|
|
27
|
-
edge: Boolean(edge),
|
|
28
|
-
},
|
|
29
|
-
};
|
|
21
|
+
if (edge) {
|
|
22
|
+
assertWarning(!isr, `Page ${pageId} — ISR isn't supported for edge functions — remove +isr or +edge`, {
|
|
23
|
+
onlyOnce: true,
|
|
24
|
+
});
|
|
25
|
+
isr = undefined;
|
|
30
26
|
}
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
function extractIsr(pageConfig) {
|
|
34
|
-
if (!pageConfig.isr)
|
|
35
|
-
return null;
|
|
36
|
-
const isr = pageConfig.isr;
|
|
37
|
-
assertUsage(isObject(isr) &&
|
|
38
|
-
typeof isr.expiration === 'number' &&
|
|
39
|
-
isr.expiration > 0, ' `{ expiration }` must be a positive number');
|
|
40
|
-
return isr;
|
|
41
|
-
}
|
|
42
|
-
function assertIsr(isr) {
|
|
43
|
-
if (isr === null || isr === undefined)
|
|
27
|
+
if (!edge && !isr)
|
|
44
28
|
return null;
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return null;
|
|
50
|
-
if (!('edge' in exports))
|
|
29
|
+
if (isCallable(route)) {
|
|
30
|
+
const errMsg = (configName) => `The route of the page ${pageId} is defined via a Route Function — ${configName} isn't supported. Remove ${configName} or define the page's route using a Route String (or Filesytem Routing) instead of a Route Function.`;
|
|
31
|
+
assertWarning(!isr, errMsg('+isr'), { onlyOnce: true });
|
|
32
|
+
assertWarning(!edge, errMsg('+edge'), { onlyOnce: true });
|
|
51
33
|
return null;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
route,
|
|
37
|
+
// route: [...new Set([...toRou3(routeIr), ...getRoutePageContextJson(routeIr)])],
|
|
38
|
+
// Supported by vite-plugin-vercel@11
|
|
39
|
+
vercel: { isr, edge },
|
|
40
|
+
};
|
|
55
41
|
}
|
|
56
42
|
export function getRoutePageContextJson(routeIr) {
|
|
57
43
|
const lastSegment = routeIr.pathname.at(-1);
|
|
@@ -4,23 +4,23 @@ import '../../assertEnvVite.js';
|
|
|
4
4
|
export function getServerInfo(vikeConfig) {
|
|
5
5
|
let serverEntryId;
|
|
6
6
|
let serverFilePath = null;
|
|
7
|
-
|
|
7
|
+
let serverEntryVike;
|
|
8
|
+
const serverConfig = vikeConfig.config.server ?? true;
|
|
8
9
|
// universal-deploy support manually disabled by user
|
|
9
10
|
if (serverConfig === false)
|
|
10
11
|
return;
|
|
11
12
|
const serverPlusFile = vikeConfig._pageConfigGlobal.configValueSources.server?.[0];
|
|
12
|
-
if (serverPlusFile) {
|
|
13
|
+
if (serverPlusFile?.valueIsDefinedByPlusValueFile) {
|
|
13
14
|
assert('filePathAbsoluteFilesystem' in serverPlusFile.definedAt);
|
|
14
15
|
serverFilePath = serverPlusFile.definedAt.filePathAbsoluteFilesystem;
|
|
15
16
|
assert(serverFilePath);
|
|
16
17
|
serverEntryId = serverFilePath;
|
|
18
|
+
serverEntryVike = serverFilePath;
|
|
17
19
|
}
|
|
18
20
|
else {
|
|
19
21
|
serverEntryId = catchAllEntry;
|
|
22
|
+
serverEntryVike = 'vike/fetch';
|
|
20
23
|
}
|
|
21
|
-
if (serverConfig !== true && !serverFilePath)
|
|
22
|
-
return;
|
|
23
|
-
const serverEntryVike = serverFilePath ?? 'vike/fetch';
|
|
24
24
|
return {
|
|
25
25
|
// Used to filter which module ID to transform.
|
|
26
26
|
// It points to a fully resolved server entry or the virtual universal-deploy catchAll entry.
|
package/dist/types/Server.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.256-commit-
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.256-commit-70e9a80";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.256-commit-
|
|
2
|
+
export const PROJECT_VERSION = '0.4.256-commit-70e9a80';
|