vite-node 0.30.1 → 0.31.1
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 +3 -2
- package/dist/cli.mjs +1 -1
- package/dist/client.cjs +22 -27
- package/dist/client.d.ts +3 -2
- package/dist/client.mjs +22 -27
- package/dist/hmr.d.ts +82 -5
- package/dist/index.d.ts +3 -2
- package/dist/server.d.ts +3 -2
- package/dist/source-map.cjs +1 -1
- package/dist/source-map.d.ts +1 -1
- package/dist/source-map.mjs +1 -1
- package/dist/{types-c39b64bb.d.ts → types-557128db.d.ts} +5 -113
- package/dist/types.d.ts +3 -2
- package/dist/utils.d.ts +3 -2
- package/package.json +3 -3
- /package/dist/{types.d-1e7e3fdf.d.ts → types.d-7442d07f.d.ts} +0 -0
package/dist/cli.cjs
CHANGED
|
@@ -24,7 +24,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
24
24
|
var cac__default = /*#__PURE__*/_interopDefaultLegacy(cac);
|
|
25
25
|
var c__default = /*#__PURE__*/_interopDefaultLegacy(c);
|
|
26
26
|
|
|
27
|
-
var version = "0.
|
|
27
|
+
var version = "0.31.1";
|
|
28
28
|
|
|
29
29
|
const cli = cac__default["default"]("vite-node");
|
|
30
30
|
cli.version(version).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").help();
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '
|
|
1
|
+
import { f as ViteNodeServerOptions } from './types-557128db.js';
|
|
2
|
+
import 'vite/types/hot';
|
|
3
|
+
import './types.d-7442d07f.js';
|
|
3
4
|
|
|
4
5
|
interface CliOptions {
|
|
5
6
|
root?: string;
|
package/dist/cli.mjs
CHANGED
|
@@ -17,7 +17,7 @@ import 'node:path';
|
|
|
17
17
|
import 'node:vm';
|
|
18
18
|
import 'node:events';
|
|
19
19
|
|
|
20
|
-
var version = "0.
|
|
20
|
+
var version = "0.31.1";
|
|
21
21
|
|
|
22
22
|
const cli = cac("vite-node");
|
|
23
23
|
cli.version(version).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").help();
|
package/dist/client.cjs
CHANGED
|
@@ -53,6 +53,8 @@ const clientStub = {
|
|
|
53
53
|
invalidate: () => {
|
|
54
54
|
},
|
|
55
55
|
on: () => {
|
|
56
|
+
},
|
|
57
|
+
send: () => {
|
|
56
58
|
}
|
|
57
59
|
};
|
|
58
60
|
},
|
|
@@ -188,16 +190,29 @@ class ViteNodeRunner {
|
|
|
188
190
|
mod.importers = /* @__PURE__ */ new Set();
|
|
189
191
|
if (importee)
|
|
190
192
|
mod.importers.add(importee);
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
if (
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
193
|
+
const getStack = () => `stack:
|
|
194
|
+
${[...callstack, fsPath].reverse().map((p) => ` - ${p}`).join("\n")}`;
|
|
195
|
+
if (callstack.includes(fsPath) || callstack.some((c) => {
|
|
196
|
+
var _a;
|
|
197
|
+
return (_a = this.moduleCache.get(c).importers) == null ? void 0 : _a.has(fsPath);
|
|
198
|
+
})) {
|
|
199
|
+
if (mod.exports)
|
|
200
|
+
return mod.exports;
|
|
201
|
+
}
|
|
202
|
+
let debugTimer;
|
|
203
|
+
if (this.debug)
|
|
204
|
+
debugTimer = setTimeout(() => console.warn(`[vite-node] module ${fsPath} takes over 2s to load.
|
|
205
|
+
${getStack()}`), 2e3);
|
|
197
206
|
try {
|
|
207
|
+
if (mod.promise)
|
|
208
|
+
return await mod.promise;
|
|
209
|
+
const promise = this.directRequest(id, fsPath, callstack);
|
|
210
|
+
Object.assign(mod, { promise, evaluated: false });
|
|
198
211
|
return await promise;
|
|
199
212
|
} finally {
|
|
200
213
|
mod.evaluated = true;
|
|
214
|
+
if (debugTimer)
|
|
215
|
+
clearTimeout(debugTimer);
|
|
201
216
|
}
|
|
202
217
|
}
|
|
203
218
|
shouldResolveId(id, _importee) {
|
|
@@ -228,27 +243,7 @@ class ViteNodeRunner {
|
|
|
228
243
|
}
|
|
229
244
|
/** @internal */
|
|
230
245
|
async dependencyRequest(id, fsPath, callstack) {
|
|
231
|
-
|
|
232
|
-
const getStack = () => {
|
|
233
|
-
return `stack:
|
|
234
|
-
${[...callstack, fsPath].reverse().map((p) => `- ${p}`).join("\n")}`;
|
|
235
|
-
};
|
|
236
|
-
let debugTimer;
|
|
237
|
-
if (this.debug)
|
|
238
|
-
debugTimer = setTimeout(() => console.warn(() => `module ${fsPath} takes over 2s to load.
|
|
239
|
-
${getStack()}`), 2e3);
|
|
240
|
-
try {
|
|
241
|
-
if (callstack.includes(fsPath)) {
|
|
242
|
-
const depExports = (_a = this.moduleCache.get(fsPath)) == null ? void 0 : _a.exports;
|
|
243
|
-
if (depExports)
|
|
244
|
-
return depExports;
|
|
245
|
-
throw new Error(`[vite-node] Failed to resolve circular dependency, ${getStack()}`);
|
|
246
|
-
}
|
|
247
|
-
return await this.cachedRequest(id, fsPath, callstack);
|
|
248
|
-
} finally {
|
|
249
|
-
if (debugTimer)
|
|
250
|
-
clearTimeout(debugTimer);
|
|
251
|
-
}
|
|
246
|
+
return await this.cachedRequest(id, fsPath, callstack);
|
|
252
247
|
}
|
|
253
248
|
/** @internal */
|
|
254
249
|
async directRequest(id, fsPath, _callstack) {
|
package/dist/client.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import './types.d-
|
|
2
|
-
export {
|
|
1
|
+
import './types.d-7442d07f.js';
|
|
2
|
+
export { i as DEFAULT_REQUEST_STUBS, M as ModuleCacheMap, h as ViteNodeRunner } from './types-557128db.js';
|
|
3
|
+
import 'vite/types/hot';
|
package/dist/client.mjs
CHANGED
|
@@ -26,6 +26,8 @@ const clientStub = {
|
|
|
26
26
|
invalidate: () => {
|
|
27
27
|
},
|
|
28
28
|
on: () => {
|
|
29
|
+
},
|
|
30
|
+
send: () => {
|
|
29
31
|
}
|
|
30
32
|
};
|
|
31
33
|
},
|
|
@@ -161,16 +163,29 @@ class ViteNodeRunner {
|
|
|
161
163
|
mod.importers = /* @__PURE__ */ new Set();
|
|
162
164
|
if (importee)
|
|
163
165
|
mod.importers.add(importee);
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
if (
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
166
|
+
const getStack = () => `stack:
|
|
167
|
+
${[...callstack, fsPath].reverse().map((p) => ` - ${p}`).join("\n")}`;
|
|
168
|
+
if (callstack.includes(fsPath) || callstack.some((c) => {
|
|
169
|
+
var _a;
|
|
170
|
+
return (_a = this.moduleCache.get(c).importers) == null ? void 0 : _a.has(fsPath);
|
|
171
|
+
})) {
|
|
172
|
+
if (mod.exports)
|
|
173
|
+
return mod.exports;
|
|
174
|
+
}
|
|
175
|
+
let debugTimer;
|
|
176
|
+
if (this.debug)
|
|
177
|
+
debugTimer = setTimeout(() => console.warn(`[vite-node] module ${fsPath} takes over 2s to load.
|
|
178
|
+
${getStack()}`), 2e3);
|
|
170
179
|
try {
|
|
180
|
+
if (mod.promise)
|
|
181
|
+
return await mod.promise;
|
|
182
|
+
const promise = this.directRequest(id, fsPath, callstack);
|
|
183
|
+
Object.assign(mod, { promise, evaluated: false });
|
|
171
184
|
return await promise;
|
|
172
185
|
} finally {
|
|
173
186
|
mod.evaluated = true;
|
|
187
|
+
if (debugTimer)
|
|
188
|
+
clearTimeout(debugTimer);
|
|
174
189
|
}
|
|
175
190
|
}
|
|
176
191
|
shouldResolveId(id, _importee) {
|
|
@@ -201,27 +216,7 @@ class ViteNodeRunner {
|
|
|
201
216
|
}
|
|
202
217
|
/** @internal */
|
|
203
218
|
async dependencyRequest(id, fsPath, callstack) {
|
|
204
|
-
|
|
205
|
-
const getStack = () => {
|
|
206
|
-
return `stack:
|
|
207
|
-
${[...callstack, fsPath].reverse().map((p) => `- ${p}`).join("\n")}`;
|
|
208
|
-
};
|
|
209
|
-
let debugTimer;
|
|
210
|
-
if (this.debug)
|
|
211
|
-
debugTimer = setTimeout(() => console.warn(() => `module ${fsPath} takes over 2s to load.
|
|
212
|
-
${getStack()}`), 2e3);
|
|
213
|
-
try {
|
|
214
|
-
if (callstack.includes(fsPath)) {
|
|
215
|
-
const depExports = (_a = this.moduleCache.get(fsPath)) == null ? void 0 : _a.exports;
|
|
216
|
-
if (depExports)
|
|
217
|
-
return depExports;
|
|
218
|
-
throw new Error(`[vite-node] Failed to resolve circular dependency, ${getStack()}`);
|
|
219
|
-
}
|
|
220
|
-
return await this.cachedRequest(id, fsPath, callstack);
|
|
221
|
-
} finally {
|
|
222
|
-
if (debugTimer)
|
|
223
|
-
clearTimeout(debugTimer);
|
|
224
|
-
}
|
|
219
|
+
return await this.cachedRequest(id, fsPath, callstack);
|
|
225
220
|
}
|
|
226
221
|
/** @internal */
|
|
227
222
|
async directRequest(id, fsPath, _callstack) {
|
package/dist/hmr.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { EventEmitter } from 'node:events';
|
|
2
|
-
import { HMRPayload, Plugin } from 'vite';
|
|
3
|
-
import {
|
|
4
|
-
import '
|
|
2
|
+
import { HMRPayload as HMRPayload$1, Plugin } from 'vite';
|
|
3
|
+
import { h as ViteNodeRunner, H as HotContext } from './types-557128db.js';
|
|
4
|
+
import 'vite/types/hot';
|
|
5
|
+
import './types.d-7442d07f.js';
|
|
5
6
|
|
|
6
7
|
type EventType = string | symbol;
|
|
7
8
|
type Handler<T = unknown> = (event: T) => void;
|
|
@@ -12,7 +13,7 @@ interface Emitter<Events extends Record<EventType, unknown>> {
|
|
|
12
13
|
emit<Key extends keyof Events>(type: undefined extends Events[Key] ? Key : never): void;
|
|
13
14
|
}
|
|
14
15
|
type HMREmitter = Emitter<{
|
|
15
|
-
'message': HMRPayload;
|
|
16
|
+
'message': HMRPayload$1;
|
|
16
17
|
}> & EventEmitter;
|
|
17
18
|
declare module 'vite' {
|
|
18
19
|
interface ViteDevServer {
|
|
@@ -22,6 +23,82 @@ declare module 'vite' {
|
|
|
22
23
|
declare function createHmrEmitter(): HMREmitter;
|
|
23
24
|
declare function viteNodeHmrPlugin(): Plugin;
|
|
24
25
|
|
|
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
|
+
|
|
25
102
|
type InferCustomEventPayload<T extends string> = T extends keyof CustomEventMap ? CustomEventMap[T] : any;
|
|
26
103
|
interface HotModule {
|
|
27
104
|
id: string;
|
|
@@ -46,7 +123,7 @@ interface CacheData {
|
|
|
46
123
|
declare function getCache(runner: ViteNodeRunner): CacheData;
|
|
47
124
|
declare function sendMessageBuffer(runner: ViteNodeRunner, emitter: HMREmitter): void;
|
|
48
125
|
declare function reload(runner: ViteNodeRunner, files: string[]): Promise<any[]>;
|
|
49
|
-
declare function handleMessage(runner: ViteNodeRunner, emitter: HMREmitter, files: string[], payload: HMRPayload
|
|
126
|
+
declare function handleMessage(runner: ViteNodeRunner, emitter: HMREmitter, files: string[], payload: HMRPayload): Promise<void>;
|
|
50
127
|
declare function createHotContext(runner: ViteNodeRunner, emitter: HMREmitter, files: string[], ownerPath: string): HotContext;
|
|
51
128
|
|
|
52
129
|
export { Emitter, EventType, HMREmitter, Handler, HotCallback, HotModule, InferCustomEventPayload, createHmrEmitter, createHotContext, getCache, handleMessage, reload, sendMessageBuffer, viteNodeHmrPlugin };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { A as Arrayable, C as CreateHotContextFunction,
|
|
2
|
-
export { D as DecodedSourceMap, E as EncodedSourceMap } from './types.d-
|
|
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-557128db.js';
|
|
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,6 +1,7 @@
|
|
|
1
1
|
import { TransformResult, ViteDevServer } from 'vite';
|
|
2
|
-
import { E as EncodedSourceMap } from './types.d-
|
|
3
|
-
import {
|
|
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-557128db.js';
|
|
4
|
+
import 'vite/types/hot';
|
|
4
5
|
|
|
5
6
|
declare class Debugger {
|
|
6
7
|
options: DebuggerOptions;
|
package/dist/source-map.cjs
CHANGED
|
@@ -802,7 +802,7 @@ function wrapCallSite(frame, state) {
|
|
|
802
802
|
return state.nextPosition.name || originalFunctionName();
|
|
803
803
|
};
|
|
804
804
|
frame.getFileName = function() {
|
|
805
|
-
return position.source;
|
|
805
|
+
return position.source ?? void 0;
|
|
806
806
|
};
|
|
807
807
|
frame.getLineNumber = function() {
|
|
808
808
|
return position.line;
|
package/dist/source-map.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TransformResult } from 'vite';
|
|
2
|
-
import { E as EncodedSourceMap } from './types.d-
|
|
2
|
+
import { E as EncodedSourceMap } from './types.d-7442d07f.js';
|
|
3
3
|
|
|
4
4
|
interface InstallSourceMapSupportOptions {
|
|
5
5
|
getSourceMap: (source: string) => EncodedSourceMap | null | undefined;
|
package/dist/source-map.mjs
CHANGED
|
@@ -793,7 +793,7 @@ function wrapCallSite(frame, state) {
|
|
|
793
793
|
return state.nextPosition.name || originalFunctionName();
|
|
794
794
|
};
|
|
795
795
|
frame.getFileName = function() {
|
|
796
|
-
return position.source;
|
|
796
|
+
return position.source ?? void 0;
|
|
797
797
|
};
|
|
798
798
|
frame.getLineNumber = function() {
|
|
799
799
|
return position.line;
|
|
@@ -1,114 +1,5 @@
|
|
|
1
|
-
import {
|
|
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
|
-
}
|
|
1
|
+
import { ViteHotContext } from 'vite/types/hot';
|
|
2
|
+
import { E as EncodedSourceMap } from './types.d-7442d07f.js';
|
|
112
3
|
|
|
113
4
|
declare const DEFAULT_REQUEST_STUBS: Record<string, unknown>;
|
|
114
5
|
declare class ModuleCacheMap extends Map<string, ModuleCache> {
|
|
@@ -172,6 +63,7 @@ declare class ViteNodeRunner {
|
|
|
172
63
|
|
|
173
64
|
type Nullable<T> = T | null | undefined;
|
|
174
65
|
type Arrayable<T> = T | Array<T>;
|
|
66
|
+
type Awaitable<T> = T | PromiseLike<T>;
|
|
175
67
|
interface DepsHandlingOptions {
|
|
176
68
|
external?: (string | RegExp)[];
|
|
177
69
|
inline?: (string | RegExp)[] | true;
|
|
@@ -201,7 +93,7 @@ interface FetchResult {
|
|
|
201
93
|
}
|
|
202
94
|
type HotContext = Omit<ViteHotContext, 'acceptDeps' | 'decline'>;
|
|
203
95
|
type FetchFunction = (id: string) => Promise<FetchResult>;
|
|
204
|
-
type ResolveIdFunction = (id: string, importer?: string) =>
|
|
96
|
+
type ResolveIdFunction = (id: string, importer?: string) => Awaitable<ViteNodeResolveId | null | undefined | void>;
|
|
205
97
|
type CreateHotContextFunction = (runner: ViteNodeRunner, url: string) => HotContext;
|
|
206
98
|
interface ModuleCache {
|
|
207
99
|
promise?: Promise<any>;
|
|
@@ -265,4 +157,4 @@ interface DebuggerOptions {
|
|
|
265
157
|
loadDumppedModules?: boolean;
|
|
266
158
|
}
|
|
267
159
|
|
|
268
|
-
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,
|
|
160
|
+
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, ViteNodeRunner as h, DEFAULT_REQUEST_STUBS as i };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export { D as DecodedSourceMap, E as EncodedSourceMap } from './types.d-
|
|
1
|
+
import 'vite/types/hot';
|
|
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-557128db.js';
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { N as Nullable, A as Arrayable } from './types-
|
|
2
|
-
import '
|
|
1
|
+
import { N as Nullable, A as Arrayable } from './types-557128db.js';
|
|
2
|
+
import 'vite/types/hot';
|
|
3
|
+
import './types.d-7442d07f.js';
|
|
3
4
|
|
|
4
5
|
declare const isWindows: boolean;
|
|
5
6
|
declare function slash(str: string): string;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-node",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.1",
|
|
4
4
|
"description": "Vite as Node.js runtime",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"funding": "https://
|
|
7
|
+
"funding": "https://opencollective.com/vitest",
|
|
8
8
|
"homepage": "https://github.com/vitest-dev/vitest/blob/main/packages/vite-node#readme",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"vite": "^3.0.0 || ^4.0.0"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"@jridgewell/trace-mapping": "^0.3.
|
|
81
|
+
"@jridgewell/trace-mapping": "^0.3.18",
|
|
82
82
|
"@types/debug": "^4.1.7",
|
|
83
83
|
"rollup": "^2.79.1"
|
|
84
84
|
},
|
|
File without changes
|