vike 0.4.239-commit-050a4a3 → 0.4.239-commit-33e55d4
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/node/prerender/runPrerender.js +1 -0
- package/dist/cjs/node/runtime/globalContext.js +9 -0
- package/dist/cjs/node/vite/onLoad.js +1 -1
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginModuleBanner.js +13 -7
- package/dist/cjs/node/vite/plugins/pluginEnvVars.js +4 -5
- package/dist/cjs/node/vite/plugins/pluginExtractAssets.js +9 -5
- package/dist/cjs/node/vite/plugins/pluginExtractExportNames.js +11 -5
- package/dist/cjs/node/vite/plugins/pluginFileEnv.js +43 -30
- package/dist/cjs/node/vite/plugins/pluginNonRunnableDev.js +19 -7
- package/dist/cjs/node/vite/plugins/pluginReplaceConstants.js +23 -5
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles.js +12 -7
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/cjs/utils/virtualFileId.js +15 -11
- package/dist/esm/client/runtime-client-routing/createPageContextClientSide.d.ts +1 -1
- package/dist/esm/client/runtime-client-routing/getPageContextFromHooks.d.ts +2 -2
- package/dist/esm/client/runtime-client-routing/globalContext.d.ts +1 -1
- package/dist/esm/client/runtime-client-routing/renderPageClientSide.d.ts +1 -1
- package/dist/esm/client/runtime-server-routing/createPageContextClientSide.d.ts +1 -1
- package/dist/esm/client/runtime-server-routing/globalContext.d.ts +1 -1
- package/dist/esm/client/shared/createGetGlobalContextClient.d.ts +1 -1
- package/dist/esm/node/prerender/runPrerender.d.ts +4 -2
- package/dist/esm/node/prerender/runPrerender.js +2 -1
- package/dist/esm/node/runtime/globalContext.d.ts +13 -2
- package/dist/esm/node/runtime/globalContext.js +10 -1
- package/dist/esm/node/runtime/renderPage/createPageContextServerSide.d.ts +4 -2
- package/dist/esm/node/runtime/renderPage/loadPageConfigsLazyServerSide.d.ts +4 -2
- package/dist/esm/node/runtime/renderPage/renderPageAfterRoute.d.ts +8 -4
- package/dist/esm/node/runtime/renderPage.d.ts +4 -2
- package/dist/esm/node/vite/onLoad.js +1 -1
- package/dist/esm/node/vite/plugins/pluginBuild/pluginModuleBanner.js +14 -8
- package/dist/esm/node/vite/plugins/pluginEnvVars.js +4 -5
- package/dist/esm/node/vite/plugins/pluginExtractAssets.js +9 -3
- package/dist/esm/node/vite/plugins/pluginExtractExportNames.js +11 -5
- package/dist/esm/node/vite/plugins/pluginFileEnv.js +43 -30
- package/dist/esm/node/vite/plugins/pluginNonRunnableDev.js +20 -8
- package/dist/esm/node/vite/plugins/pluginReplaceConstants.d.ts +11 -0
- package/dist/esm/node/vite/plugins/pluginReplaceConstants.js +22 -5
- package/dist/esm/node/vite/plugins/pluginVirtualFiles.js +13 -8
- package/dist/esm/shared/createGlobalContextShared.d.ts +3 -3
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/utils/virtualFileId.d.ts +4 -0
- package/dist/esm/utils/virtualFileId.js +14 -11
- package/package.json +4 -4
|
@@ -9,8 +9,8 @@ import type { GlobalContextServerInternal } from '../node/runtime/globalContext.
|
|
|
9
9
|
import type { GlobalContextClientInternal } from '../client/runtime-client-routing/globalContext.js';
|
|
10
10
|
import { type Hook } from './hooks/getHook.js';
|
|
11
11
|
declare const getGlobalContextSyncErrMsg = "The global context isn't set yet, call getGlobalContextSync() later or use getGlobalContext() instead.";
|
|
12
|
-
declare function createGlobalContextShared<GlobalContextAdded extends
|
|
13
|
-
globalContext?:
|
|
12
|
+
declare function createGlobalContextShared<GlobalContextAdded extends {}, GlobalContextAddedAsync extends {}>(virtualFileExportsGlobalEntry: unknown, globalObject: {
|
|
13
|
+
globalContext?: {};
|
|
14
14
|
onCreateGlobalContextHooks?: Hook[];
|
|
15
15
|
previousCreateGlobalContextPromise?: Promise<void>;
|
|
16
16
|
}, addGlobalContext?: (globalContext: GlobalContextBase) => GlobalContextAdded, addGlobalContextTmp?: (globalContext: GlobalContextBase) => Promise<GlobalContextAdded>, addGlobalContextAsync?: (globalContext: GlobalContextBase) => Promise<GlobalContextAddedAsync>): Promise<{
|
|
@@ -64,7 +64,7 @@ declare function createGlobalContextShared<GlobalContextAdded extends Record<str
|
|
|
64
64
|
_pageConfigs: PageConfigRuntime[];
|
|
65
65
|
_pageConfigGlobal: import("../types/PageConfig.js").PageConfigGlobalRuntime;
|
|
66
66
|
_allPageIds: string[];
|
|
67
|
-
} & GlobalContextAdded & GlobalContextAddedAsync
|
|
67
|
+
} & GlobalContextAdded & Awaited<GlobalContextAddedAsync>>;
|
|
68
68
|
type GlobalContextBasePublic = Pick<GlobalContextBase, 'config' | 'pages' | 'isGlobalContext'>;
|
|
69
69
|
type GlobalContextBase = ReturnType<typeof createGlobalContextBase>;
|
|
70
70
|
declare function createGlobalContextBase(virtualFileExportsGlobalEntry: unknown): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.239-commit-
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.239-commit-33e55d4";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.239-commit-
|
|
2
|
+
export const PROJECT_VERSION = '0.4.239-commit-33e55d4';
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export { isVirtualFileId };
|
|
2
2
|
export { addVirtualFileIdPrefix };
|
|
3
3
|
export { removeVirtualFileIdPrefix };
|
|
4
|
+
export { virtualFileIdPrefix1 };
|
|
5
|
+
export { virtualFileIdPrefix2 };
|
|
6
|
+
declare const virtualFileIdPrefix1 = "virtual:vike:";
|
|
7
|
+
declare const virtualFileIdPrefix2: "\0virtual:vike:";
|
|
4
8
|
declare function isVirtualFileId(id: string): boolean;
|
|
5
9
|
declare function addVirtualFileIdPrefix(id: string): string;
|
|
6
10
|
declare function removeVirtualFileIdPrefix(id: string): string;
|
|
@@ -1,34 +1,37 @@
|
|
|
1
1
|
export { isVirtualFileId };
|
|
2
2
|
export { addVirtualFileIdPrefix };
|
|
3
3
|
export { removeVirtualFileIdPrefix };
|
|
4
|
+
export { virtualFileIdPrefix1 };
|
|
5
|
+
export { virtualFileIdPrefix2 };
|
|
4
6
|
import pc from '@brillout/picocolors';
|
|
5
7
|
import { assert, assertUsage } from './assert.js';
|
|
6
8
|
import { assertIsNotBrowser } from './assertIsNotBrowser.js';
|
|
7
9
|
assertIsNotBrowser();
|
|
8
|
-
const
|
|
10
|
+
const virtualFileIdPrefix1 = 'virtual:vike:';
|
|
9
11
|
// https://vitejs.dev/guide/api-plugin.html#virtual-modules-convention
|
|
10
|
-
const
|
|
12
|
+
const convention = '\0';
|
|
13
|
+
const virtualFileIdPrefix2 = `${convention}${virtualFileIdPrefix1}`;
|
|
11
14
|
function isVirtualFileId(id) {
|
|
12
|
-
if (id.startsWith(
|
|
15
|
+
if (id.startsWith(virtualFileIdPrefix1))
|
|
13
16
|
return true;
|
|
14
|
-
if (id.startsWith(
|
|
17
|
+
if (id.startsWith(virtualFileIdPrefix2))
|
|
15
18
|
return true;
|
|
16
19
|
// https://github.com/vikejs/vike/issues/1985
|
|
17
|
-
assertUsage(!id.includes(
|
|
20
|
+
assertUsage(!id.includes(virtualFileIdPrefix1), `Encountered a module ID ${pc.cyan(id)} that is unexpected. Are you using a tool that modifies the ID of modules? For example, the baseUrl setting in tsconfig.json cannot be used.`);
|
|
18
21
|
return false;
|
|
19
22
|
}
|
|
20
23
|
function addVirtualFileIdPrefix(id) {
|
|
21
24
|
assert(isVirtualFileId(id));
|
|
22
|
-
if (!id.startsWith(
|
|
23
|
-
id =
|
|
25
|
+
if (!id.startsWith(convention)) {
|
|
26
|
+
id = convention + id;
|
|
24
27
|
}
|
|
25
|
-
assert(id.startsWith(
|
|
28
|
+
assert(id.startsWith(convention));
|
|
26
29
|
return id;
|
|
27
30
|
}
|
|
28
31
|
function removeVirtualFileIdPrefix(id) {
|
|
29
|
-
if (id.startsWith(
|
|
30
|
-
id = id.slice(
|
|
32
|
+
if (id.startsWith(convention)) {
|
|
33
|
+
id = id.slice(convention.length);
|
|
31
34
|
}
|
|
32
|
-
assert(!id.startsWith(
|
|
35
|
+
assert(!id.startsWith(convention));
|
|
33
36
|
return id;
|
|
34
37
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vike",
|
|
3
|
-
"version": "0.4.239-commit-
|
|
3
|
+
"version": "0.4.239-commit-33e55d4",
|
|
4
4
|
"repository": "https://github.com/vikejs/vike",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": {
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"@brillout/json-serializer": "^0.5.20",
|
|
133
133
|
"@brillout/picocolors": "^1.0.26",
|
|
134
134
|
"@brillout/require-shim": "^0.1.2",
|
|
135
|
-
"@brillout/vite-plugin-server-entry": "^0.7.
|
|
135
|
+
"@brillout/vite-plugin-server-entry": "^0.7.14",
|
|
136
136
|
"acorn": "^8.0.0",
|
|
137
137
|
"cac": "^6.0.0",
|
|
138
138
|
"es-module-lexer": "^1.0.0",
|
|
@@ -144,11 +144,11 @@
|
|
|
144
144
|
"sirv": "^3.0.1",
|
|
145
145
|
"source-map-support": "^0.5.0",
|
|
146
146
|
"tinyglobby": "^0.2.10",
|
|
147
|
-
"vite": ">=6.
|
|
147
|
+
"vite": ">=6.3.0"
|
|
148
148
|
},
|
|
149
149
|
"peerDependencies": {
|
|
150
150
|
"react-streaming": ">=0.3.42",
|
|
151
|
-
"vite": ">=6.
|
|
151
|
+
"vite": ">=6.3.0"
|
|
152
152
|
},
|
|
153
153
|
"peerDependenciesMeta": {
|
|
154
154
|
"react-streaming": {
|