vite-node 0.25.7 → 0.25.8
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 +4 -4
- package/dist/cli.mjs +1 -1
- package/dist/client.cjs +4 -3
- package/dist/client.d.ts +1 -1
- package/dist/client.mjs +4 -3
- package/dist/hmr.d.ts +5 -5
- package/dist/index.d.ts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/source-map.d.ts +1 -1
- package/dist/{types-c9a1a6b2.d.ts → types-fc7e68bc.d.ts} +6 -6
- package/dist/types.d.ts +1 -1
- package/dist/utils.d.ts +1 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -632,7 +632,7 @@ class CAC extends events.EventEmitter {
|
|
|
632
632
|
|
|
633
633
|
const cac = (name = "") => new CAC(name);
|
|
634
634
|
|
|
635
|
-
var version = "0.25.
|
|
635
|
+
var version = "0.25.8";
|
|
636
636
|
|
|
637
637
|
const cli = cac("vite-node");
|
|
638
638
|
cli.version(version).option("-r, --root <path>", "Use specified root directory").option("-c, --config <path>", "Use specified config file").option("-w, --watch", 'Restart on file changes, similar to "nodemon"').option("--options <options>", "Use specified Vite server options").help();
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as ViteNodeServerOptions } from './types-
|
|
1
|
+
import { e as ViteNodeServerOptions } from './types-fc7e68bc.js';
|
|
2
2
|
|
|
3
3
|
interface CliOptions {
|
|
4
4
|
root?: string;
|
|
@@ -7,10 +7,10 @@ interface CliOptions {
|
|
|
7
7
|
options?: ViteNodeServerOptionsCLI;
|
|
8
8
|
'--'?: string[];
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
type Optional<T> = T | undefined;
|
|
11
|
+
type ComputeViteNodeServerOptionsCLI<T extends Record<string, any>> = {
|
|
12
12
|
[K in keyof T]: T[K] extends Optional<RegExp[]> ? string | string[] : T[K] extends Optional<(string | RegExp)[]> ? string | string[] : T[K] extends Optional<(string | RegExp)[] | true> ? string | string[] | true : T[K] extends Optional<Record<string, any>> ? ComputeViteNodeServerOptionsCLI<T[K]> : T[K];
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
type ViteNodeServerOptionsCLI = ComputeViteNodeServerOptionsCLI<ViteNodeServerOptions>;
|
|
15
15
|
|
|
16
16
|
export { CliOptions, ViteNodeServerOptionsCLI };
|
package/dist/cli.mjs
CHANGED
|
@@ -630,7 +630,7 @@ class CAC extends EventEmitter {
|
|
|
630
630
|
|
|
631
631
|
const cac = (name = "") => new CAC(name);
|
|
632
632
|
|
|
633
|
-
var version = "0.25.
|
|
633
|
+
var version = "0.25.8";
|
|
634
634
|
|
|
635
635
|
const cli = cac("vite-node");
|
|
636
636
|
cli.version(version).option("-r, --root <path>", "Use specified root directory").option("-c, --config <path>", "Use specified config file").option("-w, --watch", 'Restart on file changes, similar to "nodemon"').option("--options <options>", "Use specified Vite server options").help();
|
package/dist/client.cjs
CHANGED
|
@@ -169,10 +169,11 @@ class ViteNodeRunner {
|
|
|
169
169
|
return mod.promise;
|
|
170
170
|
const promise = this.directRequest(id, fsPath, callstack);
|
|
171
171
|
Object.assign(mod, { promise, evaluated: false });
|
|
172
|
-
|
|
172
|
+
try {
|
|
173
|
+
return await promise;
|
|
174
|
+
} finally {
|
|
173
175
|
mod.evaluated = true;
|
|
174
|
-
}
|
|
175
|
-
return await promise;
|
|
176
|
+
}
|
|
176
177
|
}
|
|
177
178
|
async directRequest(id, fsPath, _callstack) {
|
|
178
179
|
const callstack = [..._callstack, fsPath];
|
package/dist/client.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { j as DEFAULT_REQUEST_STUBS, M as ModuleCacheMap, h as ViteNodeRunner } from './types-
|
|
1
|
+
export { j as DEFAULT_REQUEST_STUBS, M as ModuleCacheMap, h as ViteNodeRunner } from './types-fc7e68bc.js';
|
package/dist/client.mjs
CHANGED
|
@@ -142,10 +142,11 @@ class ViteNodeRunner {
|
|
|
142
142
|
return mod.promise;
|
|
143
143
|
const promise = this.directRequest(id, fsPath, callstack);
|
|
144
144
|
Object.assign(mod, { promise, evaluated: false });
|
|
145
|
-
|
|
145
|
+
try {
|
|
146
|
+
return await promise;
|
|
147
|
+
} finally {
|
|
146
148
|
mod.evaluated = true;
|
|
147
|
-
}
|
|
148
|
-
return await promise;
|
|
149
|
+
}
|
|
149
150
|
}
|
|
150
151
|
async directRequest(id, fsPath, _callstack) {
|
|
151
152
|
const callstack = [..._callstack, fsPath];
|
package/dist/hmr.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
2
|
import { HMRPayload, Plugin } from 'vite';
|
|
3
|
-
import { g as CustomEventMap, h as ViteNodeRunner, i as HMRPayload$1, H as HotContext } from './types-
|
|
3
|
+
import { g as CustomEventMap, h as ViteNodeRunner, i as HMRPayload$1, H as HotContext } from './types-fc7e68bc.js';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
type EventType = string | symbol;
|
|
6
|
+
type Handler<T = unknown> = (event: T) => void;
|
|
7
7
|
interface Emitter<Events extends Record<EventType, unknown>> {
|
|
8
8
|
on<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void;
|
|
9
9
|
off<Key extends keyof Events>(type: Key, handler?: Handler<Events[Key]>): void;
|
|
10
10
|
emit<Key extends keyof Events>(type: Key, event: Events[Key]): void;
|
|
11
11
|
emit<Key extends keyof Events>(type: undefined extends Events[Key] ? Key : never): void;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
type HMREmitter = Emitter<{
|
|
14
14
|
'message': HMRPayload;
|
|
15
15
|
}> & EventEmitter;
|
|
16
16
|
declare module 'vite' {
|
|
@@ -21,7 +21,7 @@ declare module 'vite' {
|
|
|
21
21
|
declare function createHmrEmitter(): HMREmitter;
|
|
22
22
|
declare function viteNodeHmrPlugin(): Plugin;
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
type InferCustomEventPayload<T extends string> = T extends keyof CustomEventMap ? CustomEventMap[T] : any;
|
|
25
25
|
interface HotModule {
|
|
26
26
|
id: string;
|
|
27
27
|
callbacks: HotCallback[];
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as Arrayable, C as CreateHotContextFunction, f as DebuggerOptions, D as DepsHandlingOptions, a as FetchFunction, F as FetchResult, H as HotContext, c as ModuleCache, M as ModuleCacheMap, N as Nullable, R as RawSourceMap, b as ResolveIdFunction, S as StartOfSourceMap, d as ViteNodeResolveId, V as ViteNodeRunnerOptions, e as ViteNodeServerOptions } from './types-
|
|
1
|
+
export { A as Arrayable, C as CreateHotContextFunction, f as DebuggerOptions, D as DepsHandlingOptions, a as FetchFunction, F as FetchResult, H as HotContext, c as ModuleCache, M as ModuleCacheMap, N as Nullable, R as RawSourceMap, b as ResolveIdFunction, S as StartOfSourceMap, d as ViteNodeResolveId, V as ViteNodeRunnerOptions, e as ViteNodeServerOptions } from './types-fc7e68bc.js';
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TransformResult, ViteDevServer } from 'vite';
|
|
2
|
-
import { f as DebuggerOptions, D as DepsHandlingOptions, e as ViteNodeServerOptions, F as FetchResult, d as ViteNodeResolveId, R as RawSourceMap } from './types-
|
|
2
|
+
import { f as DebuggerOptions, D as DepsHandlingOptions, e as ViteNodeServerOptions, F as FetchResult, d as ViteNodeResolveId, R as RawSourceMap } from './types-fc7e68bc.js';
|
|
3
3
|
|
|
4
4
|
declare class Debugger {
|
|
5
5
|
options: DebuggerOptions;
|
package/dist/source-map.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TransformResult } from 'vite';
|
|
2
|
-
import { R as RawSourceMap } from './types-
|
|
2
|
+
import { R as RawSourceMap } from './types-fc7e68bc.js';
|
|
3
3
|
|
|
4
4
|
interface InstallSourceMapSupportOptions {
|
|
5
5
|
getSourceMap: (source: string) => RawSourceMap | null | undefined;
|
|
@@ -175,8 +175,8 @@ declare class ViteNodeRunner {
|
|
|
175
175
|
hasNestedDefault(target: any): any;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
|
|
179
|
-
|
|
178
|
+
type Nullable<T> = T | null | undefined;
|
|
179
|
+
type Arrayable<T> = T | Array<T>;
|
|
180
180
|
interface DepsHandlingOptions {
|
|
181
181
|
external?: (string | RegExp)[];
|
|
182
182
|
inline?: (string | RegExp)[] | true;
|
|
@@ -202,10 +202,10 @@ interface FetchResult {
|
|
|
202
202
|
externalize?: string;
|
|
203
203
|
map?: RawSourceMap;
|
|
204
204
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
205
|
+
type HotContext = Omit<ViteHotContext, 'acceptDeps' | 'decline'>;
|
|
206
|
+
type FetchFunction = (id: string) => Promise<FetchResult>;
|
|
207
|
+
type ResolveIdFunction = (id: string, importer?: string) => Promise<ViteNodeResolveId | null>;
|
|
208
|
+
type CreateHotContextFunction = (runner: ViteNodeRunner, url: string) => HotContext;
|
|
209
209
|
interface ModuleCache {
|
|
210
210
|
promise?: Promise<any>;
|
|
211
211
|
exports?: any;
|
package/dist/types.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as Arrayable, C as CreateHotContextFunction, f as DebuggerOptions, D as DepsHandlingOptions, a as FetchFunction, F as FetchResult, H as HotContext, c as ModuleCache, M as ModuleCacheMap, N as Nullable, R as RawSourceMap, b as ResolveIdFunction, S as StartOfSourceMap, d as ViteNodeResolveId, V as ViteNodeRunnerOptions, e as ViteNodeServerOptions } from './types-
|
|
1
|
+
export { A as Arrayable, C as CreateHotContextFunction, f as DebuggerOptions, D as DepsHandlingOptions, a as FetchFunction, F as FetchResult, H as HotContext, c as ModuleCache, M as ModuleCacheMap, N as Nullable, R as RawSourceMap, b as ResolveIdFunction, S as StartOfSourceMap, d as ViteNodeResolveId, V as ViteNodeRunnerOptions, e as ViteNodeServerOptions } from './types-fc7e68bc.js';
|
package/dist/utils.d.ts
CHANGED