vike 0.4.236-commit-e752d12 → 0.4.236-commit-79f1ef0
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/createGetGlobalContextClient.js +20 -10
- package/dist/cjs/client/shared/utils.js +1 -0
- package/dist/cjs/node/runtime/globalContext.js +104 -20
- package/dist/cjs/node/runtime/html/injectAssets/getViteDevScript.js +3 -1
- package/dist/cjs/node/runtime/renderPage/getPageAssets/retrieveAssetsDev.js +4 -0
- package/dist/cjs/node/runtime/renderPage/getPageAssets.js +3 -1
- package/dist/cjs/node/runtime/utils.js +4 -0
- package/dist/cjs/node/shared/utils.js +1 -0
- package/dist/cjs/node/shared/virtualFiles/virtualFileEntry.js +16 -14
- package/dist/cjs/node/shared/virtualFiles/virtualFilePageConfigLazy.js +10 -4
- package/dist/cjs/node/vite/index.js +2 -0
- package/dist/cjs/node/vite/plugins/pluginBuild/handleAssetsManifest.js +19 -11
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginAutoFullBuild.js +2 -2
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginBuildApp.js +28 -13
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginBuildConfig.js +0 -3
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginDistFileNames.js +12 -7
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginModuleBanner.js +2 -2
- package/dist/cjs/node/vite/plugins/pluginCommon.js +1 -0
- package/dist/cjs/node/vite/plugins/pluginDev/determineOptimizeDeps.js +102 -58
- package/dist/cjs/node/vite/plugins/pluginEnvVars.js +3 -3
- package/dist/cjs/node/vite/plugins/pluginExtractAssets.js +3 -4
- package/dist/cjs/node/vite/plugins/pluginExtractExportNames.js +2 -2
- package/dist/cjs/node/vite/plugins/pluginNonRunnableDev.js +51 -0
- package/dist/cjs/node/vite/plugins/pluginReplaceConstants.js +1 -1
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles/getVirtualFilePageConfigLazy.js +1 -0
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles/getVirtualFilePageConfigsEager.js +4 -0
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles.js +4 -5
- package/dist/cjs/node/vite/shared/applyRegExWithMagicString.js +1 -0
- package/dist/cjs/node/vite/shared/getMagicString.js +18 -0
- package/dist/cjs/node/vite/shared/getManifestFilePathRelative.js +10 -0
- package/dist/cjs/node/vite/utils.js +1 -0
- package/dist/cjs/shared/createGlobalContextShared.js +5 -1
- package/dist/cjs/shared/getPageFiles/parseVirtualFileExports.js +6 -0
- package/dist/cjs/shared/getProxyForPublicUsage.js +2 -2
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/cjs/utils/assertSetup.js +2 -0
- package/dist/cjs/utils/debug.js +1 -0
- package/dist/cjs/utils/getViteRPC.js +79 -0
- package/dist/cjs/utils/isFilePathAbsoluteFilesystem.js +1 -0
- package/dist/cjs/utils/isRunnableDevEnvironment.js +9 -0
- package/dist/cjs/utils/virtualFileId.js +39 -0
- 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/history.d.ts +4 -2
- package/dist/esm/client/runtime-client-routing/history.js +13 -35
- package/dist/esm/client/runtime-client-routing/initClientRouter.js +3 -2
- package/dist/esm/client/runtime-client-routing/renderPageClientSide.d.ts +1 -1
- package/dist/esm/client/runtime-client-routing/renderPageClientSide.js +43 -30
- 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/client/shared/createGetGlobalContextClient.js +20 -10
- package/dist/esm/client/shared/utils.d.ts +1 -0
- package/dist/esm/client/shared/utils.js +1 -0
- package/dist/esm/node/prerender/runPrerender.d.ts +40 -132
- package/dist/esm/node/runtime/globalContext.d.ts +32 -52
- package/dist/esm/node/runtime/globalContext.js +105 -21
- package/dist/esm/node/runtime/html/injectAssets/getViteDevScript.js +4 -2
- package/dist/esm/node/runtime/renderPage/createPageContextServerSide.d.ts +10 -33
- package/dist/esm/node/runtime/renderPage/getPageAssets/retrieveAssetsDev.js +4 -0
- package/dist/esm/node/runtime/renderPage/getPageAssets.js +4 -2
- package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.d.ts +20 -66
- package/dist/esm/node/runtime/renderPage.d.ts +10 -33
- package/dist/esm/node/runtime/utils.d.ts +4 -0
- package/dist/esm/node/runtime/utils.js +4 -0
- package/dist/esm/node/shared/utils.d.ts +1 -0
- package/dist/esm/node/shared/utils.js +1 -0
- package/dist/esm/node/shared/virtualFiles/virtualFileEntry.js +16 -14
- package/dist/esm/node/shared/virtualFiles/virtualFilePageConfigLazy.js +11 -5
- package/dist/esm/node/vite/index.js +2 -0
- package/dist/esm/node/vite/plugins/pluginBuild/handleAssetsManifest.d.ts +1 -1
- package/dist/esm/node/vite/plugins/pluginBuild/handleAssetsManifest.js +19 -11
- package/dist/esm/node/vite/plugins/pluginBuild/pluginAutoFullBuild.js +2 -2
- package/dist/esm/node/vite/plugins/pluginBuild/pluginBuildApp.js +28 -13
- package/dist/esm/node/vite/plugins/pluginBuild/pluginBuildConfig.d.ts +0 -2
- package/dist/esm/node/vite/plugins/pluginBuild/pluginBuildConfig.js +0 -2
- package/dist/esm/node/vite/plugins/pluginBuild/pluginDistFileNames.js +12 -7
- package/dist/esm/node/vite/plugins/pluginBuild/pluginModuleBanner.js +2 -2
- package/dist/esm/node/vite/plugins/pluginCommon.d.ts +3 -0
- package/dist/esm/node/vite/plugins/pluginCommon.js +1 -0
- package/dist/esm/node/vite/plugins/pluginDev/determineOptimizeDeps.js +103 -59
- package/dist/esm/node/vite/plugins/pluginExtractAssets.js +3 -4
- package/dist/esm/node/vite/plugins/pluginNonRunnableDev.d.ts +26 -0
- package/dist/esm/node/vite/plugins/pluginNonRunnableDev.js +49 -0
- package/dist/esm/node/vite/plugins/pluginVirtualFiles/getVirtualFilePageConfigLazy.js +1 -0
- package/dist/esm/node/vite/plugins/pluginVirtualFiles/getVirtualFilePageConfigsEager.js +4 -0
- package/dist/esm/node/vite/plugins/pluginVirtualFiles.js +3 -4
- package/dist/esm/node/vite/shared/applyRegExWithMagicString.js +1 -0
- package/dist/esm/node/vite/shared/getMagicString.d.ts +9 -0
- package/dist/esm/node/vite/shared/getMagicString.js +13 -0
- package/dist/esm/node/vite/shared/getManifestFilePathRelative.d.ts +2 -0
- package/dist/esm/node/vite/shared/getManifestFilePathRelative.js +8 -0
- package/dist/esm/node/vite/utils.d.ts +1 -0
- package/dist/esm/node/vite/utils.js +1 -0
- package/dist/esm/shared/createGlobalContextShared.d.ts +3 -3
- package/dist/esm/shared/createGlobalContextShared.js +5 -1
- package/dist/esm/shared/getPageFiles/parseVirtualFileExports.js +6 -0
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/utils/assertSetup.js +2 -0
- package/dist/esm/utils/debug.d.ts +1 -1
- package/dist/esm/utils/debug.js +1 -0
- package/dist/esm/utils/getViteRPC.d.ts +6 -0
- package/dist/esm/utils/getViteRPC.js +77 -0
- package/dist/esm/utils/isFilePathAbsoluteFilesystem.d.ts +7 -0
- package/dist/esm/utils/isFilePathAbsoluteFilesystem.js +1 -0
- package/dist/esm/utils/isRunnableDevEnvironment.d.ts +3 -0
- package/dist/esm/utils/isRunnableDevEnvironment.js +7 -0
- package/dist/esm/utils/virtualFileId.d.ts +6 -0
- package/dist/esm/{node/shared/virtualFiles.js → utils/virtualFileId.js} +15 -17
- package/package.json +12 -3
- package/dist/cjs/node/shared/virtualFiles.js +0 -41
- package/dist/esm/node/shared/virtualFiles.d.ts +0 -8
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.236-commit-
|
|
2
|
+
export const PROJECT_VERSION = '0.4.236-commit-79f1ef0';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { createDebugger };
|
|
2
2
|
export { isDebugActivated };
|
|
3
3
|
export type { Debug };
|
|
4
|
-
declare const flags: readonly ["vike:crawl", "vike:error", "vike:esbuild-resolve", "vike:pluginExtractAssets", "vike:pluginExtractExportNames", "vike:glob", "vike:globalContext", "vike:log", "vike:optimizeDeps", "vike:outDir", "vike:pageFiles", "vike:pointer-imports", "vike:resolve", "vike:routing", "vike:setup", "vike:stream", "vike:virtualFiles"];
|
|
4
|
+
declare const flags: readonly ["vike:crawl", "vike:error", "vike:esbuild-resolve", "vike:pluginExtractAssets", "vike:pluginExtractExportNames", "vike:glob", "vike:globalContext", "vike:log", "vike:optimizeDeps", "vike:outDir", "vike:pageFiles", "vike:pointer-imports", "vike:resolve", "vike:routing", "vike:setup", "vike:stream", "vike:virtualFiles", "vike:vite-rpc"];
|
|
5
5
|
type Flag = (typeof flags)[number];
|
|
6
6
|
type Debug = ReturnType<typeof createDebugger>;
|
|
7
7
|
type Options = {
|
package/dist/esm/utils/debug.js
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { getViteRPC };
|
|
2
|
+
export { createViteRPC };
|
|
3
|
+
import type { ViteDevServer } from 'vite';
|
|
4
|
+
declare function getViteRPC<RpcFunctions>(): RpcFunctions;
|
|
5
|
+
type AsyncFunction = (...args: any[]) => Promise<unknown>;
|
|
6
|
+
declare function createViteRPC(viteDevServer: ViteDevServer, getRpcFunctions: (viteDevServer: ViteDevServer) => Record<string, AsyncFunction>): void;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export { getViteRPC }; // consumer (aka RPC client)
|
|
2
|
+
export { createViteRPC }; // provider (aka RPC server)
|
|
3
|
+
import { assert } from './assert.js';
|
|
4
|
+
import { genPromise } from './genPromise.js';
|
|
5
|
+
import { getRandomId } from './getRandomId.js';
|
|
6
|
+
import { getGlobalObject } from './getGlobalObject.js';
|
|
7
|
+
import { createDebugger } from './debug.js';
|
|
8
|
+
import { assertIsNotBrowser } from './assertIsNotBrowser.js';
|
|
9
|
+
assertIsNotBrowser();
|
|
10
|
+
const globalObject = getGlobalObject('utils/getViteRPC.ts', {
|
|
11
|
+
rpc: null,
|
|
12
|
+
});
|
|
13
|
+
const debug = createDebugger('vike:vite-rpc');
|
|
14
|
+
function getViteRPC() {
|
|
15
|
+
globalObject.rpc ?? (globalObject.rpc = createRpcClient());
|
|
16
|
+
return globalObject.rpc;
|
|
17
|
+
}
|
|
18
|
+
function createRpcClient() {
|
|
19
|
+
// @ts-ignore CJS build doesn't support import.meta — TO-DO/eventually: let's remove this ts-ignore after we removed the CJS build
|
|
20
|
+
const hot = import.meta.hot;
|
|
21
|
+
assert(hot);
|
|
22
|
+
const listeners = [];
|
|
23
|
+
hot.on(`vike:rpc:response`, (dataResponse) => {
|
|
24
|
+
if (debug.isActivated)
|
|
25
|
+
debug('Response received', dataResponse);
|
|
26
|
+
const { callId, functionReturn } = dataResponse;
|
|
27
|
+
listeners.forEach((l) => {
|
|
28
|
+
if (callId !== l.callId)
|
|
29
|
+
return;
|
|
30
|
+
l.cb(functionReturn);
|
|
31
|
+
listeners.splice(listeners.indexOf(l), 1);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
const rpc = new Proxy({}, {
|
|
35
|
+
get(_, functionName) {
|
|
36
|
+
return async (...functionArgs) => {
|
|
37
|
+
// @ts-ignore CJS build doesn't support import.meta — TO-DO/eventually: let's remove this ts-ignore after we removed the CJS build
|
|
38
|
+
const hot = import.meta.hot;
|
|
39
|
+
assert(hot);
|
|
40
|
+
const callId = getRandomId();
|
|
41
|
+
const { promise, resolve } = genPromise({ timeout: 3 * 1000 });
|
|
42
|
+
listeners.push({
|
|
43
|
+
callId,
|
|
44
|
+
cb: (functionReturn) => {
|
|
45
|
+
resolve(functionReturn);
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
const dataRequest = { callId, functionName, functionArgs };
|
|
49
|
+
if (debug.isActivated)
|
|
50
|
+
debug('Request sent', dataRequest);
|
|
51
|
+
// Vite's type is wrong: import.meta.hot.send() does seem to return a promise
|
|
52
|
+
await hot.send('vike:rpc:request', dataRequest);
|
|
53
|
+
const functionReturn = await promise;
|
|
54
|
+
return functionReturn;
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
return rpc;
|
|
59
|
+
}
|
|
60
|
+
function createViteRPC(viteDevServer, getRpcFunctions) {
|
|
61
|
+
const rpcFunctions = getRpcFunctions(viteDevServer);
|
|
62
|
+
const { environments } = viteDevServer;
|
|
63
|
+
for (const envName in environments) {
|
|
64
|
+
debug('Listening to environment', envName);
|
|
65
|
+
const env = environments[envName];
|
|
66
|
+
env.hot.on('vike:rpc:request', async (dataRequest) => {
|
|
67
|
+
if (debug.isActivated)
|
|
68
|
+
debug('Request received', dataRequest);
|
|
69
|
+
const { callId, functionName, functionArgs } = dataRequest;
|
|
70
|
+
const functionReturn = await rpcFunctions[functionName](...functionArgs);
|
|
71
|
+
const dataResponse = { callId, functionReturn };
|
|
72
|
+
if (debug.isActivated)
|
|
73
|
+
debug('Response sent', dataResponse);
|
|
74
|
+
env.hot.send('vike:rpc:response', dataResponse);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { assertFilePathAbsoluteFilesystem };
|
|
2
|
+
export { isFilePathAbsoluteFilesystem };
|
|
2
3
|
export { isFilePathAbsolute };
|
|
3
4
|
/**
|
|
4
5
|
* Asserts that `filePath` is an absolute file path starting from the filesystem root.
|
|
@@ -6,6 +7,12 @@ export { isFilePathAbsolute };
|
|
|
6
7
|
* It isn't reliable for Linux users, but that's okay because the assertion will eventually fail on windows.
|
|
7
8
|
*/
|
|
8
9
|
declare function assertFilePathAbsoluteFilesystem(filePath: string): void;
|
|
10
|
+
/**
|
|
11
|
+
* Whether `filePath` is an absolute file path starting from the filesystem root.
|
|
12
|
+
*
|
|
13
|
+
* Isn't reliable for Linux users: it returns `true` for an absolute path starting from the user root dir.
|
|
14
|
+
*/
|
|
15
|
+
declare function isFilePathAbsoluteFilesystem(filePath: string): boolean;
|
|
9
16
|
/**
|
|
10
17
|
* Whether `filePath` is an absolute file path.
|
|
11
18
|
*
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { isRunnableDevEnvironment };
|
|
2
|
+
// We use this instead of `import { isRunnableDevEnvironment } from 'vite'` because:
|
|
3
|
+
// - Vite's isRunnableDevEnvironment() isn't reliable in monorepos where multiple Vite instances can be used simultaneously (it uses `instanceof RunnableDevEnvironment` which fails)
|
|
4
|
+
// - We can use this in Vike's server production runtime without having to load the 'vite' package
|
|
5
|
+
function isRunnableDevEnvironment(environment) {
|
|
6
|
+
return !!environment && 'runner' in environment && !!environment.runner;
|
|
7
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { isVirtualFileId };
|
|
2
|
+
export { addVirtualFileIdPrefix };
|
|
3
|
+
export { removeVirtualFileIdPrefix };
|
|
4
|
+
declare function isVirtualFileId(id: string): boolean;
|
|
5
|
+
declare function addVirtualFileIdPrefix(id: string): string;
|
|
6
|
+
declare function removeVirtualFileIdPrefix(id: string): string;
|
|
@@ -1,36 +1,34 @@
|
|
|
1
1
|
export { isVirtualFileId };
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export { removeVirtualIdTag };
|
|
2
|
+
export { addVirtualFileIdPrefix };
|
|
3
|
+
export { removeVirtualFileIdPrefix };
|
|
5
4
|
import pc from '@brillout/picocolors';
|
|
6
|
-
import { assert, assertUsage } from './
|
|
5
|
+
import { assert, assertUsage } from './assert.js';
|
|
6
|
+
import { assertIsNotBrowser } from './assertIsNotBrowser.js';
|
|
7
|
+
assertIsNotBrowser();
|
|
7
8
|
const idBase = 'virtual:vike:';
|
|
8
9
|
// https://vitejs.dev/guide/api-plugin.html#virtual-modules-convention
|
|
9
|
-
const
|
|
10
|
+
const prefix = '\0';
|
|
10
11
|
function isVirtualFileId(id) {
|
|
11
12
|
if (id.startsWith(idBase))
|
|
12
13
|
return true;
|
|
13
|
-
if (id.startsWith(
|
|
14
|
+
if (id.startsWith(prefix + idBase))
|
|
14
15
|
return true;
|
|
15
16
|
// https://github.com/vikejs/vike/issues/1985
|
|
16
17
|
assertUsage(!id.includes(idBase), `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.`);
|
|
17
18
|
return false;
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
return removeVirtualIdTag(id);
|
|
21
|
-
}
|
|
22
|
-
function resolveVirtualFileId(id) {
|
|
20
|
+
function addVirtualFileIdPrefix(id) {
|
|
23
21
|
assert(isVirtualFileId(id));
|
|
24
|
-
if (!id.startsWith(
|
|
25
|
-
id =
|
|
22
|
+
if (!id.startsWith(prefix)) {
|
|
23
|
+
id = prefix + id;
|
|
26
24
|
}
|
|
27
|
-
assert(id.startsWith(
|
|
25
|
+
assert(id.startsWith(prefix));
|
|
28
26
|
return id;
|
|
29
27
|
}
|
|
30
|
-
function
|
|
31
|
-
if (id.startsWith(
|
|
32
|
-
id = id.slice(
|
|
28
|
+
function removeVirtualFileIdPrefix(id) {
|
|
29
|
+
if (id.startsWith(prefix)) {
|
|
30
|
+
id = id.slice(prefix.length);
|
|
33
31
|
}
|
|
34
|
-
assert(!id.startsWith(
|
|
32
|
+
assert(!id.startsWith(prefix));
|
|
35
33
|
return id;
|
|
36
34
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vike",
|
|
3
|
-
"version": "0.4.236-commit-
|
|
3
|
+
"version": "0.4.236-commit-79f1ef0",
|
|
4
4
|
"repository": "https://github.com/vikejs/vike",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": {
|
|
7
7
|
"worker": "./dist/esm/node/runtime/index.js",
|
|
8
|
+
"workerd": "./dist/esm/node/runtime/index.js",
|
|
8
9
|
"require": "./dist/cjs/node/runtime/index.js",
|
|
9
10
|
"node": "./dist/esm/node/runtime/index.js",
|
|
10
11
|
"browser": "./dist/esm/client/node.js",
|
|
@@ -19,6 +20,7 @@
|
|
|
19
20
|
},
|
|
20
21
|
"./client/router": {
|
|
21
22
|
"worker": "./dist/esm/node/client/router.js",
|
|
23
|
+
"workerd": "./dist/esm/node/client/router.js",
|
|
22
24
|
"require": "./dist/cjs/node/client/router.js",
|
|
23
25
|
"node": "./dist/esm/node/client/router.js",
|
|
24
26
|
"browser": "./dist/esm/client/runtime-client-routing/index.js",
|
|
@@ -27,6 +29,7 @@
|
|
|
27
29
|
},
|
|
28
30
|
"./routing": {
|
|
29
31
|
"worker": "./dist/esm/shared/route/routing.js",
|
|
32
|
+
"workerd": "./dist/esm/shared/route/routing.js",
|
|
30
33
|
"require": "./dist/cjs/shared/route/routing.js",
|
|
31
34
|
"node": "./dist/esm/shared/route/routing.js",
|
|
32
35
|
"browser": "./dist/esm/shared/route/routing.js",
|
|
@@ -59,6 +62,7 @@
|
|
|
59
62
|
},
|
|
60
63
|
"./RenderErrorPage": {
|
|
61
64
|
"worker": "./dist/esm/shared/RenderErrorPage.js",
|
|
65
|
+
"workerd": "./dist/esm/shared/RenderErrorPage.js",
|
|
62
66
|
"require": "./dist/cjs/shared/RenderErrorPage.js",
|
|
63
67
|
"node": "./dist/esm/shared/RenderErrorPage.js",
|
|
64
68
|
"browser": "./dist/esm/shared/RenderErrorPage.js",
|
|
@@ -67,6 +71,7 @@
|
|
|
67
71
|
},
|
|
68
72
|
"./abort": {
|
|
69
73
|
"worker": "./dist/esm/shared/abort.js",
|
|
74
|
+
"workerd": "./dist/esm/shared/abort.js",
|
|
70
75
|
"require": "./dist/cjs/shared/abort.js",
|
|
71
76
|
"node": "./dist/esm/shared/abort.js",
|
|
72
77
|
"browser": "./dist/esm/shared/abort.js",
|
|
@@ -75,6 +80,7 @@
|
|
|
75
80
|
},
|
|
76
81
|
"./getPageContext": {
|
|
77
82
|
"worker": "./dist/esm/shared/getPageContext.js",
|
|
83
|
+
"workerd": "./dist/esm/shared/getPageContext.js",
|
|
78
84
|
"require": "./dist/cjs/shared/getPageContext.js",
|
|
79
85
|
"node": "./dist/esm/shared/getPageContext.js",
|
|
80
86
|
"browser": "./dist/esm/shared/getPageContext.js",
|
|
@@ -83,6 +89,7 @@
|
|
|
83
89
|
},
|
|
84
90
|
"./modifyUrl": {
|
|
85
91
|
"worker": "./dist/esm/shared/modifyUrl.js",
|
|
92
|
+
"workerd": "./dist/esm/shared/modifyUrl.js",
|
|
86
93
|
"require": "./dist/cjs/shared/modifyUrl.js",
|
|
87
94
|
"node": "./dist/esm/shared/modifyUrl.js",
|
|
88
95
|
"browser": "./dist/esm/shared/modifyUrl.js",
|
|
@@ -91,6 +98,7 @@
|
|
|
91
98
|
},
|
|
92
99
|
"./universal-middleware": {
|
|
93
100
|
"worker": "./dist/esm/node/runtime/universal-middleware.js",
|
|
101
|
+
"workerd": "./dist/esm/node/runtime/universal-middleware.js",
|
|
94
102
|
"require": "./dist/cjs/node/runtime/universal-middleware.js",
|
|
95
103
|
"node": "./dist/esm/node/runtime/universal-middleware.js",
|
|
96
104
|
"browser": "./dist/esm/client/node.js",
|
|
@@ -111,6 +119,7 @@
|
|
|
111
119
|
},
|
|
112
120
|
".": {
|
|
113
121
|
"worker": "./dist/esm/node/runtime/index.js",
|
|
122
|
+
"workerd": "./dist/esm/node/runtime/index.js",
|
|
114
123
|
"require": "./dist/cjs/node/runtime/index.js",
|
|
115
124
|
"node": "./dist/esm/node/runtime/index.js",
|
|
116
125
|
"browser": "./dist/esm/client/index.js",
|
|
@@ -123,7 +132,7 @@
|
|
|
123
132
|
"@brillout/json-serializer": "^0.5.16",
|
|
124
133
|
"@brillout/picocolors": "^1.0.26",
|
|
125
134
|
"@brillout/require-shim": "^0.1.2",
|
|
126
|
-
"@brillout/vite-plugin-server-entry": "^0.7.
|
|
135
|
+
"@brillout/vite-plugin-server-entry": "^0.7.12",
|
|
127
136
|
"acorn": "^8.0.0",
|
|
128
137
|
"cac": "^6.0.0",
|
|
129
138
|
"es-module-lexer": "^1.0.0",
|
|
@@ -254,7 +263,7 @@
|
|
|
254
263
|
"react-streaming": "^0.4.3",
|
|
255
264
|
"rimraf": "^5.0.5",
|
|
256
265
|
"typescript": "^5.8.3",
|
|
257
|
-
"vite": "^
|
|
266
|
+
"vite": "^7.0.6"
|
|
258
267
|
},
|
|
259
268
|
"scripts": {
|
|
260
269
|
"dev": "tsc --watch",
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isVirtualFileId = isVirtualFileId;
|
|
7
|
-
exports.getVirtualFileId = getVirtualFileId;
|
|
8
|
-
exports.resolveVirtualFileId = resolveVirtualFileId;
|
|
9
|
-
exports.removeVirtualIdTag = removeVirtualIdTag;
|
|
10
|
-
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
11
|
-
const utils_js_1 = require("./utils.js");
|
|
12
|
-
const idBase = 'virtual:vike:';
|
|
13
|
-
// https://vitejs.dev/guide/api-plugin.html#virtual-modules-convention
|
|
14
|
-
const virtualIdTag = '\0';
|
|
15
|
-
function isVirtualFileId(id) {
|
|
16
|
-
if (id.startsWith(idBase))
|
|
17
|
-
return true;
|
|
18
|
-
if (id.startsWith(virtualIdTag + idBase))
|
|
19
|
-
return true;
|
|
20
|
-
// https://github.com/vikejs/vike/issues/1985
|
|
21
|
-
(0, utils_js_1.assertUsage)(!id.includes(idBase), `Encountered a module ID ${picocolors_1.default.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.`);
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
function getVirtualFileId(id) {
|
|
25
|
-
return removeVirtualIdTag(id);
|
|
26
|
-
}
|
|
27
|
-
function resolveVirtualFileId(id) {
|
|
28
|
-
(0, utils_js_1.assert)(isVirtualFileId(id));
|
|
29
|
-
if (!id.startsWith(virtualIdTag)) {
|
|
30
|
-
id = virtualIdTag + id;
|
|
31
|
-
}
|
|
32
|
-
(0, utils_js_1.assert)(id.startsWith(virtualIdTag));
|
|
33
|
-
return id;
|
|
34
|
-
}
|
|
35
|
-
function removeVirtualIdTag(id) {
|
|
36
|
-
if (id.startsWith(virtualIdTag)) {
|
|
37
|
-
id = id.slice(virtualIdTag.length);
|
|
38
|
-
}
|
|
39
|
-
(0, utils_js_1.assert)(!id.startsWith(virtualIdTag));
|
|
40
|
-
return id;
|
|
41
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { isVirtualFileId };
|
|
2
|
-
export { getVirtualFileId };
|
|
3
|
-
export { resolveVirtualFileId };
|
|
4
|
-
export { removeVirtualIdTag };
|
|
5
|
-
declare function isVirtualFileId(id: string): boolean;
|
|
6
|
-
declare function getVirtualFileId(id: string): string;
|
|
7
|
-
declare function resolveVirtualFileId(id: string): string;
|
|
8
|
-
declare function removeVirtualIdTag(id: string): string;
|