vite-node 0.28.5 → 0.29.0

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.
@@ -1,3 +1,5 @@
1
+ import { E as EncodedSourceMap } from './types.d-1e7e3fdf.js';
2
+
1
3
  type HMRPayload =
2
4
  | ConnectedPayload
3
5
  | UpdatePayload
@@ -157,7 +159,7 @@ declare class ModuleCacheMap extends Map<string, ModuleCache> {
157
159
  /**
158
160
  * Return parsed source map based on inlined source map of the module
159
161
  */
160
- getSourceMap(id: string): RawSourceMap | null;
162
+ getSourceMap(id: string): EncodedSourceMap | null;
161
163
  }
162
164
  declare class ViteNodeRunner {
163
165
  options: ViteNodeRunnerOptions;
@@ -171,7 +173,6 @@ declare class ViteNodeRunner {
171
173
  constructor(options: ViteNodeRunnerOptions);
172
174
  executeFile(file: string): Promise<any>;
173
175
  executeId(rawId: string): Promise<any>;
174
- getSourceMap(id: string): RawSourceMap | null;
175
176
  /** @internal */
176
177
  cachedRequest(id: string, fsPath: string, callstack: string[]): Promise<any>;
177
178
  shouldResolveId(id: string, _importee?: string): boolean;
@@ -198,6 +199,7 @@ type Arrayable<T> = T | Array<T>;
198
199
  interface DepsHandlingOptions {
199
200
  external?: (string | RegExp)[];
200
201
  inline?: (string | RegExp)[] | true;
202
+ cacheDir?: string;
201
203
  /**
202
204
  * Try to guess the CJS version of a package when it's invalid ESM
203
205
  * @default false
@@ -208,6 +210,7 @@ interface StartOfSourceMap {
208
210
  file?: string;
209
211
  sourceRoot?: string;
210
212
  }
213
+
211
214
  interface RawSourceMap extends StartOfSourceMap {
212
215
  version: string;
213
216
  sources: string[];
@@ -218,7 +221,7 @@ interface RawSourceMap extends StartOfSourceMap {
218
221
  interface FetchResult {
219
222
  code?: string;
220
223
  externalize?: string;
221
- map?: RawSourceMap;
224
+ map?: EncodedSourceMap | null;
222
225
  }
223
226
  type HotContext = Omit<ViteHotContext, 'acceptDeps' | 'decline'>;
224
227
  type FetchFunction = (id: string) => Promise<FetchResult>;
@@ -230,7 +233,7 @@ interface ModuleCache {
230
233
  evaluated?: boolean;
231
234
  resolving?: boolean;
232
235
  code?: string;
233
- map?: RawSourceMap;
236
+ map?: EncodedSourceMap;
234
237
  /**
235
238
  * Module ids that imports this module
236
239
  */
@@ -0,0 +1,23 @@
1
+ declare type GeneratedColumn = number;
2
+ declare type SourcesIndex = number;
3
+ declare type SourceLine = number;
4
+ declare type SourceColumn = number;
5
+ declare type NamesIndex = number;
6
+ declare type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex];
7
+
8
+ interface SourceMapV3 {
9
+ file?: string | null;
10
+ names: string[];
11
+ sourceRoot?: string;
12
+ sources: (string | null)[];
13
+ sourcesContent?: (string | null)[];
14
+ version: 3;
15
+ }
16
+ interface EncodedSourceMap extends SourceMapV3 {
17
+ mappings: string;
18
+ }
19
+ interface DecodedSourceMap extends SourceMapV3 {
20
+ mappings: SourceMapSegment[][];
21
+ }
22
+
23
+ export { DecodedSourceMap as D, EncodedSourceMap as E };
package/dist/types.d.ts CHANGED
@@ -1 +1,2 @@
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-63205a44.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-e288fc62.js';
2
+ export { D as DecodedSourceMap, E as EncodedSourceMap } from './types.d-1e7e3fdf.js';
package/dist/utils.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { N as Nullable, A as Arrayable } from './types-63205a44.js';
1
+ import { N as Nullable, A as Arrayable } from './types-e288fc62.js';
2
+ import './types.d-1e7e3fdf.js';
2
3
 
3
4
  declare const isWindows: boolean;
4
5
  declare function slash(str: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-node",
3
- "version": "0.28.5",
3
+ "version": "0.29.0",
4
4
  "description": "Vite as Node.js runtime",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -75,14 +75,11 @@
75
75
  "mlly": "^1.1.0",
76
76
  "pathe": "^1.1.0",
77
77
  "picocolors": "^1.0.0",
78
- "source-map": "^0.6.1",
79
- "source-map-support": "^0.5.21",
80
78
  "vite": "^3.0.0 || ^4.0.0"
81
79
  },
82
80
  "devDependencies": {
81
+ "@jridgewell/trace-mapping": "^0.3.17",
83
82
  "@types/debug": "^4.1.7",
84
- "@types/source-map": "^0.5.7",
85
- "@types/source-map-support": "^0.5.6",
86
83
  "rollup": "^2.79.1"
87
84
  },
88
85
  "scripts": {