vite-node 0.31.0 → 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 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.31.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,6 +1,6 @@
1
- import { e as ViteNodeServerOptions } from './types-d9c0fafd.js';
1
+ import { f as ViteNodeServerOptions } from './types-557128db.js';
2
2
  import 'vite/types/hot';
3
- import './types.d-1e7e3fdf.js';
3
+ import './types.d-7442d07f.js';
4
4
 
5
5
  interface CliOptions {
6
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.31.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.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import './types.d-1e7e3fdf.js';
2
- export { h as DEFAULT_REQUEST_STUBS, M as ModuleCacheMap, g as ViteNodeRunner } from './types-d9c0fafd.js';
1
+ import './types.d-7442d07f.js';
2
+ export { i as DEFAULT_REQUEST_STUBS, M as ModuleCacheMap, h as ViteNodeRunner } from './types-557128db.js';
3
3
  import 'vite/types/hot';
package/dist/hmr.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { EventEmitter } from 'node:events';
2
2
  import { HMRPayload as HMRPayload$1, Plugin } from 'vite';
3
- import { g as ViteNodeRunner, H as HotContext } from './types-d9c0fafd.js';
3
+ import { h as ViteNodeRunner, H as HotContext } from './types-557128db.js';
4
4
  import 'vite/types/hot';
5
- import './types.d-1e7e3fdf.js';
5
+ import './types.d-7442d07f.js';
6
6
 
7
7
  type EventType = string | symbol;
8
8
  type Handler<T = unknown> = (event: T) => void;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
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-d9c0fafd.js';
2
- export { D as DecodedSourceMap, E as EncodedSourceMap } from './types.d-1e7e3fdf.js';
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
3
  import 'vite/types/hot';
package/dist/server.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { TransformResult, ViteDevServer } from 'vite';
2
- import { E as EncodedSourceMap } from './types.d-1e7e3fdf.js';
3
- import { f as DebuggerOptions, D as DepsHandlingOptions, e as ViteNodeServerOptions, F as FetchResult, d as ViteNodeResolveId } from './types-d9c0fafd.js';
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
4
  import 'vite/types/hot';
5
5
 
6
6
  declare class Debugger {
@@ -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;
@@ -1,5 +1,5 @@
1
1
  import { TransformResult } from 'vite';
2
- import { E as EncodedSourceMap } from './types.d-1e7e3fdf.js';
2
+ import { E as EncodedSourceMap } from './types.d-7442d07f.js';
3
3
 
4
4
  interface InstallSourceMapSupportOptions {
5
5
  getSourceMap: (source: string) => EncodedSourceMap | null | undefined;
@@ -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,5 +1,5 @@
1
1
  import { ViteHotContext } from 'vite/types/hot';
2
- import { E as EncodedSourceMap } from './types.d-1e7e3fdf.js';
2
+ import { E as EncodedSourceMap } from './types.d-7442d07f.js';
3
3
 
4
4
  declare const DEFAULT_REQUEST_STUBS: Record<string, unknown>;
5
5
  declare class ModuleCacheMap extends Map<string, ModuleCache> {
@@ -63,6 +63,7 @@ declare class ViteNodeRunner {
63
63
 
64
64
  type Nullable<T> = T | null | undefined;
65
65
  type Arrayable<T> = T | Array<T>;
66
+ type Awaitable<T> = T | PromiseLike<T>;
66
67
  interface DepsHandlingOptions {
67
68
  external?: (string | RegExp)[];
68
69
  inline?: (string | RegExp)[] | true;
@@ -92,7 +93,7 @@ interface FetchResult {
92
93
  }
93
94
  type HotContext = Omit<ViteHotContext, 'acceptDeps' | 'decline'>;
94
95
  type FetchFunction = (id: string) => Promise<FetchResult>;
95
- type ResolveIdFunction = (id: string, importer?: string) => Promise<ViteNodeResolveId | null>;
96
+ type ResolveIdFunction = (id: string, importer?: string) => Awaitable<ViteNodeResolveId | null | undefined | void>;
96
97
  type CreateHotContextFunction = (runner: ViteNodeRunner, url: string) => HotContext;
97
98
  interface ModuleCache {
98
99
  promise?: Promise<any>;
@@ -156,4 +157,4 @@ interface DebuggerOptions {
156
157
  loadDumppedModules?: boolean;
157
158
  }
158
159
 
159
- 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, FetchFunction as a, ResolveIdFunction as b, ModuleCache as c, ViteNodeResolveId as d, ViteNodeServerOptions as e, DebuggerOptions as f, ViteNodeRunner as g, DEFAULT_REQUEST_STUBS as h };
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,3 +1,3 @@
1
1
  import 'vite/types/hot';
2
- export { D as DecodedSourceMap, E as EncodedSourceMap } from './types.d-1e7e3fdf.js';
3
- 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-d9c0fafd.js';
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,6 +1,6 @@
1
- import { N as Nullable, A as Arrayable } from './types-d9c0fafd.js';
1
+ import { N as Nullable, A as Arrayable } from './types-557128db.js';
2
2
  import 'vite/types/hot';
3
- import './types.d-1e7e3fdf.js';
3
+ import './types.d-7442d07f.js';
4
4
 
5
5
  declare const isWindows: boolean;
6
6
  declare function slash(str: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-node",
3
- "version": "0.31.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",
@@ -78,7 +78,7 @@
78
78
  "vite": "^3.0.0 || ^4.0.0"
79
79
  },
80
80
  "devDependencies": {
81
- "@jridgewell/trace-mapping": "^0.3.17",
81
+ "@jridgewell/trace-mapping": "^0.3.18",
82
82
  "@types/debug": "^4.1.7",
83
83
  "rollup": "^2.79.1"
84
84
  },