vike 0.4.256-commit-70e9a80 → 0.4.256-commit-3de784e
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/pluginUniversalDeploy/getDeployConfigs.js +1 -1
- package/dist/node/vite/plugins/pluginUniversalDeploy/getServerInfo.js +2 -2
- package/dist/node/vite/plugins/pluginUniversalDeploy/pluginServerEntryInject.js +2 -3
- package/dist/node/vite/plugins/pluginUniversalDeploy.js +10 -3
- package/dist/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/utils/PROJECT_VERSION.js +1 -1
- package/package.json +2 -2
|
@@ -27,7 +27,7 @@ function getDeployConfigs(pageId, page) {
|
|
|
27
27
|
if (!edge && !isr)
|
|
28
28
|
return null;
|
|
29
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
|
|
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 Filesystem Routing) instead of a Route Function.`;
|
|
31
31
|
assertWarning(!isr, errMsg('+isr'), { onlyOnce: true });
|
|
32
32
|
assertWarning(!edge, errMsg('+edge'), { onlyOnce: true });
|
|
33
33
|
return null;
|
|
@@ -5,8 +5,8 @@ export function getServerInfo(vikeConfig) {
|
|
|
5
5
|
let serverEntryId;
|
|
6
6
|
let serverFilePath = null;
|
|
7
7
|
let serverEntryVike;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
// universal-deploy support must be manually enabled
|
|
9
|
+
const serverConfig = vikeConfig.config.server ?? false;
|
|
10
10
|
if (serverConfig === false)
|
|
11
11
|
return;
|
|
12
12
|
const serverPlusFile = vikeConfig._pageConfigGlobal.configValueSources.server?.[0];
|
|
@@ -2,6 +2,7 @@ import { getMagicString } from '../../shared/getMagicString.js';
|
|
|
2
2
|
import { serverEntryVirtualId } from '@brillout/vite-plugin-server-entry/plugin';
|
|
3
3
|
import { pluginCommon } from './common.js';
|
|
4
4
|
import '../../assertEnvVite.js';
|
|
5
|
+
import { escapeRegex } from '../../../../utils/escapeRegex.js';
|
|
5
6
|
export function pluginServerEntryInject(serverEntryId) {
|
|
6
7
|
return {
|
|
7
8
|
name: 'vike:pluginUniversalDeploy:serverEntry',
|
|
@@ -9,9 +10,7 @@ export function pluginServerEntryInject(serverEntryId) {
|
|
|
9
10
|
transform: {
|
|
10
11
|
order: 'post',
|
|
11
12
|
filter: {
|
|
12
|
-
id:
|
|
13
|
-
include: [serverEntryId],
|
|
14
|
-
},
|
|
13
|
+
id: new RegExp(escapeRegex(serverEntryId)),
|
|
15
14
|
},
|
|
16
15
|
handler(code, id) {
|
|
17
16
|
const { magicString, getMagicStringResult } = getMagicString(code, id);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { pluginUniversalDeploy };
|
|
2
2
|
import { toRou3 } from 'convert-route';
|
|
3
3
|
import { addEntry } from '@universal-deploy/store';
|
|
4
|
-
import universalDeploy from '@universal-deploy/vite';
|
|
4
|
+
import universalDeploy, { resolveTargets } from '@universal-deploy/vite';
|
|
5
5
|
import { fromVike } from 'convert-route/vike';
|
|
6
6
|
import { pluginServerEntryInject } from './pluginUniversalDeploy/pluginServerEntryInject.js';
|
|
7
7
|
import { getDeployConfigs, getRoutePageContextJson } from './pluginUniversalDeploy/getDeployConfigs.js';
|
|
@@ -10,14 +10,21 @@ import { hasVikeServerOrVikePhoton } from './pluginUniversalDeploy/detectDepreca
|
|
|
10
10
|
import { getServerInfo } from './pluginUniversalDeploy/getServerInfo.js';
|
|
11
11
|
import { pluginServerEntryAlias } from './pluginUniversalDeploy/pluginServerEntryAlias.js';
|
|
12
12
|
import { pluginUnwrapProdOptions } from './pluginUniversalDeploy/pluginUnwrapProdOptions.js';
|
|
13
|
-
import '../assertEnvVite.js';
|
|
14
13
|
import { unique } from '../../../utils/unique.js';
|
|
14
|
+
import { assertUsage } from '../../../utils/assert.js';
|
|
15
|
+
import '../assertEnvVite.js';
|
|
15
16
|
function pluginUniversalDeploy(vikeConfig) {
|
|
16
17
|
if (hasVikeServerOrVikePhoton(vikeConfig))
|
|
17
18
|
return [];
|
|
18
19
|
const serverInfo = getServerInfo(vikeConfig);
|
|
19
20
|
if (!serverInfo)
|
|
20
|
-
return [
|
|
21
|
+
return [
|
|
22
|
+
resolveTargets(({ vercel, node, netlify }) => {
|
|
23
|
+
// Cloudflare is supported even without universal-deploy
|
|
24
|
+
const target = vercel ? 'Vercel' : node ? 'Node.js' : netlify ? 'Netlify' : null;
|
|
25
|
+
assertUsage(target === null, `Cannot target ${target} without a server entry. Either set \`server: true\` in +config.js or create a \`+server.js\` file.`);
|
|
26
|
+
}),
|
|
27
|
+
];
|
|
21
28
|
const { serverEntryVike, serverEntryId, serverFilePath } = serverInfo;
|
|
22
29
|
return [
|
|
23
30
|
...universalDeploy(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.256-commit-
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.256-commit-3de784e";
|
|
@@ -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-3de784e';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vike",
|
|
3
|
-
"version": "0.4.256-commit-
|
|
3
|
+
"version": "0.4.256-commit-3de784e",
|
|
4
4
|
"repository": "https://github.com/vikejs/vike",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": {
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"@brillout/picocolors": "^1.0.30",
|
|
134
134
|
"@brillout/vite-plugin-server-entry": "0.7.18",
|
|
135
135
|
"@universal-deploy/store": "^0.2.1",
|
|
136
|
-
"@universal-deploy/vite": "^0.1.
|
|
136
|
+
"@universal-deploy/vite": "^0.1.3",
|
|
137
137
|
"@universal-middleware/core": "^0.4.17",
|
|
138
138
|
"@universal-middleware/node": "^0.1.0",
|
|
139
139
|
"cac": "^6.0.0",
|