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 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.7";
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-c9a1a6b2.js';
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
- declare type Optional<T> = T | undefined;
11
- declare type ComputeViteNodeServerOptionsCLI<T extends Record<string, any>> = {
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
- declare type ViteNodeServerOptionsCLI = ComputeViteNodeServerOptionsCLI<ViteNodeServerOptions>;
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.7";
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
- promise.finally(() => {
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-c9a1a6b2.js';
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
- promise.finally(() => {
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-c9a1a6b2.js';
3
+ import { g as CustomEventMap, h as ViteNodeRunner, i as HMRPayload$1, H as HotContext } from './types-fc7e68bc.js';
4
4
 
5
- declare type EventType = string | symbol;
6
- declare type Handler<T = unknown> = (event: T) => void;
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
- declare type HMREmitter = Emitter<{
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
- declare type InferCustomEventPayload<T extends string> = T extends keyof CustomEventMap ? CustomEventMap[T] : any;
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-c9a1a6b2.js';
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-c9a1a6b2.js';
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;
@@ -1,5 +1,5 @@
1
1
  import { TransformResult } from 'vite';
2
- import { R as RawSourceMap } from './types-c9a1a6b2.js';
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
- declare type Nullable<T> = T | null | undefined;
179
- declare type Arrayable<T> = T | Array<T>;
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
- declare type HotContext = Omit<ViteHotContext, 'acceptDeps' | 'decline'>;
206
- declare type FetchFunction = (id: string) => Promise<FetchResult>;
207
- declare type ResolveIdFunction = (id: string, importer?: string) => Promise<ViteNodeResolveId | null>;
208
- declare type CreateHotContextFunction = (runner: ViteNodeRunner, url: string) => HotContext;
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-c9a1a6b2.js';
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
@@ -1,4 +1,4 @@
1
- import { N as Nullable, A as Arrayable } from './types-c9a1a6b2.js';
1
+ import { N as Nullable, A as Arrayable } from './types-fc7e68bc.js';
2
2
 
3
3
  declare const isWindows: boolean;
4
4
  declare function slash(str: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-node",
3
- "version": "0.25.7",
3
+ "version": "0.25.8",
4
4
  "description": "Vite as Node.js runtime",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",