vite-node 0.34.2 → 0.34.3
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/cli.cjs +1 -1
- package/dist/cli.d.ts +1 -2
- package/dist/cli.mjs +1 -1
- package/dist/client.d.ts +1 -2
- package/dist/hmr.d.ts +4 -81
- package/dist/index.d.ts +1 -2
- package/dist/server.d.ts +1 -2
- package/dist/{types-e8623e9c.d.ts → types-2dc895bd.d.ts} +111 -2
- package/dist/types.d.ts +1 -2
- package/dist/utils.d.ts +1 -2
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -25,7 +25,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
25
25
|
var cac__default = /*#__PURE__*/_interopDefaultLegacy(cac);
|
|
26
26
|
var c__default = /*#__PURE__*/_interopDefaultLegacy(c);
|
|
27
27
|
|
|
28
|
-
var version = "0.34.
|
|
28
|
+
var version = "0.34.3";
|
|
29
29
|
|
|
30
30
|
const cli = cac__default["default"]("vite-node");
|
|
31
31
|
cli.option("-r, --root <path>", "Use specified root directory").option("-c, --config <path>", "Use specified config file").option("-m, --mode <mode>", "Set env mode").option("-w, --watch", 'Restart on file changes, similar to "nodemon"').option("--script", "Use vite-node as a script runner").option("--options <options>", "Use specified Vite server options").option("-v, --version", "Output the version number").option("-h, --help", "Display help for command");
|
package/dist/cli.d.ts
CHANGED
package/dist/cli.mjs
CHANGED
|
@@ -18,7 +18,7 @@ import 'node:path';
|
|
|
18
18
|
import 'node:vm';
|
|
19
19
|
import 'node:events';
|
|
20
20
|
|
|
21
|
-
var version = "0.34.
|
|
21
|
+
var version = "0.34.3";
|
|
22
22
|
|
|
23
23
|
const cli = cac("vite-node");
|
|
24
24
|
cli.option("-r, --root <path>", "Use specified root directory").option("-c, --config <path>", "Use specified config file").option("-m, --mode <mode>", "Set env mode").option("-w, --watch", 'Restart on file changes, similar to "nodemon"').option("--script", "Use vite-node as a script runner").option("--options <options>", "Use specified Vite server options").option("-v, --version", "Output the version number").option("-h, --help", "Display help for command");
|
package/dist/client.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import './types.d-7442d07f.js';
|
|
2
|
-
export {
|
|
3
|
-
import 'vite/types/hot';
|
|
2
|
+
export { k as DEFAULT_REQUEST_STUBS, M as ModuleCacheMap, i as ViteNodeRunner } from './types-2dc895bd.js';
|
package/dist/hmr.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from 'node:events';
|
|
2
|
-
import { HMRPayload
|
|
3
|
-
import { h as ViteNodeRunner, H as HotContext } from './types-
|
|
4
|
-
import 'vite/types/hot';
|
|
2
|
+
import { HMRPayload, Plugin } from 'vite';
|
|
3
|
+
import { h as CustomEventMap, i as ViteNodeRunner, j as HMRPayload$1, H as HotContext } from './types-2dc895bd.js';
|
|
5
4
|
import './types.d-7442d07f.js';
|
|
6
5
|
|
|
7
6
|
type EventType = string | symbol;
|
|
@@ -13,7 +12,7 @@ interface Emitter<Events extends Record<EventType, unknown>> {
|
|
|
13
12
|
emit<Key extends keyof Events>(type: undefined extends Events[Key] ? Key : never): void;
|
|
14
13
|
}
|
|
15
14
|
type HMREmitter = Emitter<{
|
|
16
|
-
'message': HMRPayload
|
|
15
|
+
'message': HMRPayload;
|
|
17
16
|
}> & EventEmitter;
|
|
18
17
|
declare module 'vite' {
|
|
19
18
|
interface ViteDevServer {
|
|
@@ -23,82 +22,6 @@ declare module 'vite' {
|
|
|
23
22
|
declare function createHmrEmitter(): HMREmitter;
|
|
24
23
|
declare function viteNodeHmrPlugin(): Plugin;
|
|
25
24
|
|
|
26
|
-
type HMRPayload =
|
|
27
|
-
| ConnectedPayload
|
|
28
|
-
| UpdatePayload
|
|
29
|
-
| FullReloadPayload
|
|
30
|
-
| CustomPayload
|
|
31
|
-
| ErrorPayload
|
|
32
|
-
| PrunePayload
|
|
33
|
-
|
|
34
|
-
interface ConnectedPayload {
|
|
35
|
-
type: 'connected'
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
interface UpdatePayload {
|
|
39
|
-
type: 'update'
|
|
40
|
-
updates: Update[]
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
interface Update {
|
|
44
|
-
type: 'js-update' | 'css-update'
|
|
45
|
-
path: string
|
|
46
|
-
acceptedPath: string
|
|
47
|
-
timestamp: number
|
|
48
|
-
/**
|
|
49
|
-
* @experimental internal
|
|
50
|
-
*/
|
|
51
|
-
explicitImportRequired?: boolean | undefined
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
interface PrunePayload {
|
|
55
|
-
type: 'prune'
|
|
56
|
-
paths: string[]
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
interface FullReloadPayload {
|
|
60
|
-
type: 'full-reload'
|
|
61
|
-
path?: string
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
interface CustomPayload {
|
|
65
|
-
type: 'custom'
|
|
66
|
-
event: string
|
|
67
|
-
data?: any
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
interface ErrorPayload {
|
|
71
|
-
type: 'error'
|
|
72
|
-
err: {
|
|
73
|
-
[name: string]: any
|
|
74
|
-
message: string
|
|
75
|
-
stack: string
|
|
76
|
-
id?: string
|
|
77
|
-
frame?: string
|
|
78
|
-
plugin?: string
|
|
79
|
-
pluginCode?: string
|
|
80
|
-
loc?: {
|
|
81
|
-
file?: string
|
|
82
|
-
line: number
|
|
83
|
-
column: number
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
interface CustomEventMap {
|
|
89
|
-
'vite:beforeUpdate': UpdatePayload
|
|
90
|
-
'vite:afterUpdate': UpdatePayload
|
|
91
|
-
'vite:beforePrune': PrunePayload
|
|
92
|
-
'vite:beforeFullReload': FullReloadPayload
|
|
93
|
-
'vite:error': ErrorPayload
|
|
94
|
-
'vite:invalidate': InvalidatePayload
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
interface InvalidatePayload {
|
|
98
|
-
path: string
|
|
99
|
-
message: string | undefined
|
|
100
|
-
}
|
|
101
|
-
|
|
102
25
|
type ModuleNamespace = Record<string, any> & {
|
|
103
26
|
[Symbol.toStringTag]: 'Module';
|
|
104
27
|
};
|
|
@@ -126,7 +49,7 @@ interface CacheData {
|
|
|
126
49
|
declare function getCache(runner: ViteNodeRunner): CacheData;
|
|
127
50
|
declare function sendMessageBuffer(runner: ViteNodeRunner, emitter: HMREmitter): void;
|
|
128
51
|
declare function reload(runner: ViteNodeRunner, files: string[]): Promise<any[]>;
|
|
129
|
-
declare function handleMessage(runner: ViteNodeRunner, emitter: HMREmitter, files: string[], payload: HMRPayload): Promise<void>;
|
|
52
|
+
declare function handleMessage(runner: ViteNodeRunner, emitter: HMREmitter, files: string[], payload: HMRPayload$1): Promise<void>;
|
|
130
53
|
declare function createHotContext(runner: ViteNodeRunner, emitter: HMREmitter, files: string[], ownerPath: string): HotContext;
|
|
131
54
|
|
|
132
55
|
export { Emitter, EventType, HMREmitter, Handler, HotCallback, HotModule, InferCustomEventPayload, ModuleNamespace, createHmrEmitter, createHotContext, getCache, handleMessage, reload, sendMessageBuffer, viteNodeHmrPlugin };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export { A as Arrayable, a as Awaitable, C as CreateHotContextFunction, g as DebuggerOptions, D as DepsHandlingOptions, b as FetchFunction, F as FetchResult, H as HotContext, d as ModuleCache, M as ModuleCacheMap, N as Nullable, R as RawSourceMap, c as ResolveIdFunction, S as StartOfSourceMap, e as ViteNodeResolveId, V as ViteNodeRunnerOptions, f as ViteNodeServerOptions } from './types-
|
|
1
|
+
export { A as Arrayable, a as Awaitable, C as CreateHotContextFunction, g as DebuggerOptions, D as DepsHandlingOptions, b as FetchFunction, F as FetchResult, H as HotContext, d as ModuleCache, M as ModuleCacheMap, N as Nullable, R as RawSourceMap, c as ResolveIdFunction, S as StartOfSourceMap, e as ViteNodeResolveId, V as ViteNodeRunnerOptions, f as ViteNodeServerOptions } from './types-2dc895bd.js';
|
|
2
2
|
export { D as DecodedSourceMap, E as EncodedSourceMap } from './types.d-7442d07f.js';
|
|
3
|
-
import 'vite/types/hot';
|
package/dist/server.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { TransformResult, ViteDevServer } from 'vite';
|
|
2
2
|
import { E as EncodedSourceMap } from './types.d-7442d07f.js';
|
|
3
|
-
import { g as DebuggerOptions, D as DepsHandlingOptions, f as ViteNodeServerOptions, F as FetchResult, e as ViteNodeResolveId } from './types-
|
|
4
|
-
import 'vite/types/hot';
|
|
3
|
+
import { g as DebuggerOptions, D as DepsHandlingOptions, f as ViteNodeServerOptions, F as FetchResult, e as ViteNodeResolveId } from './types-2dc895bd.js';
|
|
5
4
|
|
|
6
5
|
declare class Debugger {
|
|
7
6
|
options: DebuggerOptions;
|
|
@@ -1,6 +1,115 @@
|
|
|
1
|
-
import { ViteHotContext } from 'vite/types/hot';
|
|
2
1
|
import { E as EncodedSourceMap } from './types.d-7442d07f.js';
|
|
3
2
|
|
|
3
|
+
type HMRPayload =
|
|
4
|
+
| ConnectedPayload
|
|
5
|
+
| UpdatePayload
|
|
6
|
+
| FullReloadPayload
|
|
7
|
+
| CustomPayload
|
|
8
|
+
| ErrorPayload
|
|
9
|
+
| PrunePayload
|
|
10
|
+
|
|
11
|
+
interface ConnectedPayload {
|
|
12
|
+
type: 'connected'
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface UpdatePayload {
|
|
16
|
+
type: 'update'
|
|
17
|
+
updates: Update[]
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface Update {
|
|
21
|
+
type: 'js-update' | 'css-update'
|
|
22
|
+
path: string
|
|
23
|
+
acceptedPath: string
|
|
24
|
+
timestamp: number
|
|
25
|
+
/**
|
|
26
|
+
* @experimental internal
|
|
27
|
+
*/
|
|
28
|
+
explicitImportRequired?: boolean | undefined
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface PrunePayload {
|
|
32
|
+
type: 'prune'
|
|
33
|
+
paths: string[]
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface FullReloadPayload {
|
|
37
|
+
type: 'full-reload'
|
|
38
|
+
path?: string
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface CustomPayload {
|
|
42
|
+
type: 'custom'
|
|
43
|
+
event: string
|
|
44
|
+
data?: any
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface ErrorPayload {
|
|
48
|
+
type: 'error'
|
|
49
|
+
err: {
|
|
50
|
+
[name: string]: any
|
|
51
|
+
message: string
|
|
52
|
+
stack: string
|
|
53
|
+
id?: string
|
|
54
|
+
frame?: string
|
|
55
|
+
plugin?: string
|
|
56
|
+
pluginCode?: string
|
|
57
|
+
loc?: {
|
|
58
|
+
file?: string
|
|
59
|
+
line: number
|
|
60
|
+
column: number
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
interface CustomEventMap {
|
|
66
|
+
'vite:beforeUpdate': UpdatePayload
|
|
67
|
+
'vite:afterUpdate': UpdatePayload
|
|
68
|
+
'vite:beforePrune': PrunePayload
|
|
69
|
+
'vite:beforeFullReload': FullReloadPayload
|
|
70
|
+
'vite:error': ErrorPayload
|
|
71
|
+
'vite:invalidate': InvalidatePayload
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
interface InvalidatePayload {
|
|
75
|
+
path: string
|
|
76
|
+
message: string | undefined
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
type InferCustomEventPayload<T extends string> =
|
|
80
|
+
T extends keyof CustomEventMap ? CustomEventMap[T] : any
|
|
81
|
+
|
|
82
|
+
type ModuleNamespace = Record<string, any> & {
|
|
83
|
+
[Symbol.toStringTag]: 'Module'
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
interface ViteHotContext {
|
|
87
|
+
readonly data: any
|
|
88
|
+
|
|
89
|
+
accept(): void
|
|
90
|
+
accept(cb: (mod: ModuleNamespace | undefined) => void): void
|
|
91
|
+
accept(dep: string, cb: (mod: ModuleNamespace | undefined) => void): void
|
|
92
|
+
accept(
|
|
93
|
+
deps: readonly string[],
|
|
94
|
+
cb: (mods: Array<ModuleNamespace | undefined>) => void,
|
|
95
|
+
): void
|
|
96
|
+
|
|
97
|
+
acceptExports(
|
|
98
|
+
exportNames: string | readonly string[],
|
|
99
|
+
cb?: (mod: ModuleNamespace | undefined) => void,
|
|
100
|
+
): void
|
|
101
|
+
|
|
102
|
+
dispose(cb: (data: any) => void): void
|
|
103
|
+
prune(cb: (data: any) => void): void
|
|
104
|
+
invalidate(message?: string): void
|
|
105
|
+
|
|
106
|
+
on<T extends string>(
|
|
107
|
+
event: T,
|
|
108
|
+
cb: (payload: InferCustomEventPayload<T>) => void,
|
|
109
|
+
): void
|
|
110
|
+
send<T extends string>(event: T, data?: InferCustomEventPayload<T>): void
|
|
111
|
+
}
|
|
112
|
+
|
|
4
113
|
declare const DEFAULT_REQUEST_STUBS: Record<string, Record<string, unknown>>;
|
|
5
114
|
declare class ModuleCacheMap extends Map<string, ModuleCache> {
|
|
6
115
|
normalizePath(fsPath: string): string;
|
|
@@ -174,4 +283,4 @@ interface DebuggerOptions {
|
|
|
174
283
|
loadDumppedModules?: boolean;
|
|
175
284
|
}
|
|
176
285
|
|
|
177
|
-
export { Arrayable as A, CreateHotContextFunction as C, DepsHandlingOptions as D, FetchResult as F, HotContext as H, ModuleCacheMap as M, Nullable as N, RawSourceMap as R, StartOfSourceMap as S, ViteNodeRunnerOptions as V, Awaitable as a, FetchFunction as b, ResolveIdFunction as c, ModuleCache as d, ViteNodeResolveId as e, ViteNodeServerOptions as f, DebuggerOptions as g,
|
|
286
|
+
export { Arrayable as A, CreateHotContextFunction as C, DepsHandlingOptions as D, FetchResult as F, HotContext as H, ModuleCacheMap as M, Nullable as N, RawSourceMap as R, StartOfSourceMap as S, ViteNodeRunnerOptions as V, Awaitable as a, FetchFunction as b, ResolveIdFunction as c, ModuleCache as d, ViteNodeResolveId as e, ViteNodeServerOptions as f, DebuggerOptions as g, CustomEventMap as h, ViteNodeRunner as i, HMRPayload as j, DEFAULT_REQUEST_STUBS as k };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export { A as Arrayable, a as Awaitable, C as CreateHotContextFunction, g as DebuggerOptions, D as DepsHandlingOptions, b as FetchFunction, F as FetchResult, H as HotContext, d as ModuleCache, M as ModuleCacheMap, N as Nullable, R as RawSourceMap, c as ResolveIdFunction, S as StartOfSourceMap, e as ViteNodeResolveId, V as ViteNodeRunnerOptions, f as ViteNodeServerOptions } from './types-2dc895bd.js';
|
|
2
2
|
export { D as DecodedSourceMap, E as EncodedSourceMap } from './types.d-7442d07f.js';
|
|
3
|
-
export { A as Arrayable, a as Awaitable, C as CreateHotContextFunction, g as DebuggerOptions, D as DepsHandlingOptions, b as FetchFunction, F as FetchResult, H as HotContext, d as ModuleCache, M as ModuleCacheMap, N as Nullable, R as RawSourceMap, c as ResolveIdFunction, S as StartOfSourceMap, e as ViteNodeResolveId, V as ViteNodeRunnerOptions, f as ViteNodeServerOptions } from './types-e8623e9c.js';
|
package/dist/utils.d.ts
CHANGED