vite 6.3.4 → 7.0.0-beta.0
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/LICENSE.md +29 -0
- package/dist/client/client.mjs +796 -924
- package/dist/client/env.mjs +14 -19
- package/dist/node/chunks/dep-3jlWaCfC.js +5 -0
- package/dist/node/chunks/dep-B4i1tHPo.js +30 -0
- package/dist/node/chunks/dep-CCzsqxOh.js +5597 -0
- package/dist/node/chunks/dep-Ccq9jQdz.js +5 -0
- package/dist/node/chunks/dep-Ctugieod.js +150 -0
- package/dist/node/chunks/dep-D5HXLrlI.js +378 -0
- package/dist/node/chunks/dep-D_UgUiRQ.js +5 -0
- package/dist/node/chunks/dep-FHYvcJhE.js +446 -0
- package/dist/node/chunks/dep-P8c3Tybu.js +5 -0
- package/dist/node/chunks/dep-RiwDEHuV.js +7345 -0
- package/dist/node/chunks/dep-bvBD1i2C.js +36517 -0
- package/dist/node/cli.js +617 -865
- package/dist/node/constants.js +3 -148
- package/dist/node/index.d.ts +2730 -3081
- package/dist/node/index.js +25 -188
- package/dist/node/module-runner.d.ts +241 -229
- package/dist/node/module-runner.js +1041 -1175
- package/dist/node/moduleRunnerTransport-CnL9s_k9.d.ts +88 -0
- package/package.json +36 -38
- package/types/internal/cssPreprocessorOptions.d.ts +0 -19
- package/dist/node/chunks/dep-3RmXg9uo.js +0 -553
- package/dist/node/chunks/dep-Bn81Esdm.js +0 -49496
- package/dist/node/chunks/dep-CvfTChi5.js +0 -8218
- package/dist/node/chunks/dep-D5ITTxnT.js +0 -7113
- package/dist/node/chunks/dep-SOJpRpBL.js +0 -822
- package/dist/node/moduleRunnerTransport.d-DJ_mE5sf.d.ts +0 -87
- package/dist/node-cjs/publicUtils.cjs +0 -3986
- package/index.cjs +0 -96
- package/index.d.cts +0 -6
@@ -1,87 +0,0 @@
|
|
1
|
-
import { HotPayload } from '../../types/hmrPayload.js';
|
2
|
-
|
3
|
-
interface FetchFunctionOptions {
|
4
|
-
cached?: boolean;
|
5
|
-
startOffset?: number;
|
6
|
-
}
|
7
|
-
type FetchResult = CachedFetchResult | ExternalFetchResult | ViteFetchResult;
|
8
|
-
interface CachedFetchResult {
|
9
|
-
/**
|
10
|
-
* If module cached in the runner, we can just confirm
|
11
|
-
* it wasn't invalidated on the server side.
|
12
|
-
*/
|
13
|
-
cache: true;
|
14
|
-
}
|
15
|
-
interface ExternalFetchResult {
|
16
|
-
/**
|
17
|
-
* The path to the externalized module starting with file://,
|
18
|
-
* by default this will be imported via a dynamic "import"
|
19
|
-
* instead of being transformed by vite and loaded with vite runner
|
20
|
-
*/
|
21
|
-
externalize: string;
|
22
|
-
/**
|
23
|
-
* Type of the module. Will be used to determine if import statement is correct.
|
24
|
-
* For example, if Vite needs to throw an error if variable is not actually exported
|
25
|
-
*/
|
26
|
-
type: 'module' | 'commonjs' | 'builtin' | 'network';
|
27
|
-
}
|
28
|
-
interface ViteFetchResult {
|
29
|
-
/**
|
30
|
-
* Code that will be evaluated by vite runner
|
31
|
-
* by default this will be wrapped in an async function
|
32
|
-
*/
|
33
|
-
code: string;
|
34
|
-
/**
|
35
|
-
* File path of the module on disk.
|
36
|
-
* This will be resolved as import.meta.url/filename
|
37
|
-
* Will be equal to `null` for virtual modules
|
38
|
-
*/
|
39
|
-
file: string | null;
|
40
|
-
/**
|
41
|
-
* Module ID in the server module graph.
|
42
|
-
*/
|
43
|
-
id: string;
|
44
|
-
/**
|
45
|
-
* Module URL used in the import.
|
46
|
-
*/
|
47
|
-
url: string;
|
48
|
-
/**
|
49
|
-
* Invalidate module on the client side.
|
50
|
-
*/
|
51
|
-
invalidate: boolean;
|
52
|
-
}
|
53
|
-
type InvokeMethods = {
|
54
|
-
fetchModule: (id: string, importer?: string, options?: FetchFunctionOptions) => Promise<FetchResult>;
|
55
|
-
};
|
56
|
-
|
57
|
-
type ModuleRunnerTransportHandlers = {
|
58
|
-
onMessage: (data: HotPayload) => void;
|
59
|
-
onDisconnection: () => void;
|
60
|
-
};
|
61
|
-
/**
|
62
|
-
* "send and connect" or "invoke" must be implemented
|
63
|
-
*/
|
64
|
-
interface ModuleRunnerTransport {
|
65
|
-
connect?(handlers: ModuleRunnerTransportHandlers): Promise<void> | void;
|
66
|
-
disconnect?(): Promise<void> | void;
|
67
|
-
send?(data: HotPayload): Promise<void> | void;
|
68
|
-
invoke?(data: HotPayload): Promise<{
|
69
|
-
result: any;
|
70
|
-
} | {
|
71
|
-
error: any;
|
72
|
-
}>;
|
73
|
-
timeout?: number;
|
74
|
-
}
|
75
|
-
interface NormalizedModuleRunnerTransport {
|
76
|
-
connect?(onMessage?: (data: HotPayload) => void): Promise<void> | void;
|
77
|
-
disconnect?(): Promise<void> | void;
|
78
|
-
send(data: HotPayload): Promise<void>;
|
79
|
-
invoke<T extends keyof InvokeMethods>(name: T, data: Parameters<InvokeMethods[T]>): Promise<ReturnType<Awaited<InvokeMethods[T]>>>;
|
80
|
-
}
|
81
|
-
declare const createWebSocketModuleRunnerTransport: (options: {
|
82
|
-
createConnection: () => WebSocket;
|
83
|
-
pingInterval?: number;
|
84
|
-
}) => Required<Pick<ModuleRunnerTransport, "connect" | "disconnect" | "send">>;
|
85
|
-
|
86
|
-
export { createWebSocketModuleRunnerTransport as c };
|
87
|
-
export type { ExternalFetchResult as E, FetchFunctionOptions as F, ModuleRunnerTransport as M, NormalizedModuleRunnerTransport as N, ViteFetchResult as V, FetchResult as a, ModuleRunnerTransportHandlers as b };
|