rspack-plugin-mock 0.4.0 → 0.5.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,9 +1,9 @@
1
1
  import { RspackPluginInstance, Compiler, RspackOptionsNormalized } from '@rspack/core';
2
- import { i as LogLevel, M as MockServerPluginOptions, S as ServerBuildOption, c as MockOptions } from './types-BgpcN3jm.js';
2
+ import { i as LogLevel, b as MockOptions, c as MockServerPluginOptions, S as ServerBuildOption } from './types-Aw0AciTG.js';
3
3
  import { Server as Server$1 } from 'node:http';
4
4
  import { Http2SecureServer } from 'node:http2';
5
- import EventEmitter from 'node:events';
6
5
  import { FSWatcher } from 'node:fs';
6
+ import EventEmitter from 'node:events';
7
7
 
8
8
  interface Logger {
9
9
  debug: (msg: string, level?: boolean | LogLevel) => void;
@@ -14,18 +14,6 @@ interface Logger {
14
14
  declare const logLevels: Record<LogLevel, number>;
15
15
  declare function createLogger(prefix: string, defaultLevel?: LogLevel): Logger;
16
16
 
17
- interface ResolvedCompilerOptions {
18
- alias: Record<string, false | string | (string | false)[]>;
19
- proxies: (string | ((pathname: string, req: any) => boolean))[];
20
- wsProxies: (string | ((pathname: string, req: any) => boolean))[];
21
- plugins: RspackPluginInstance[];
22
- context?: string;
23
- }
24
- type ResolvePluginOptions = Required<Omit<MockServerPluginOptions, 'build'>> & ResolvedCompilerOptions & {
25
- logger: Logger;
26
- build: false | ServerBuildOption;
27
- };
28
-
29
17
  interface MockCompilerOptions {
30
18
  alias?: Record<string, false | string | (string | false)[]>;
31
19
  plugins: RspackPluginInstance[];
@@ -55,6 +43,18 @@ declare class MockCompiler extends EventEmitter {
55
43
  watchMockFiles(): void;
56
44
  }
57
45
 
46
+ interface ResolvedCompilerOptions {
47
+ alias: Record<string, false | string | (string | false)[]>;
48
+ proxies: (string | ((pathname: string, req: any) => boolean))[];
49
+ wsProxies: (string | ((pathname: string, req: any) => boolean))[];
50
+ plugins: RspackPluginInstance[];
51
+ context?: string;
52
+ }
53
+ type ResolvePluginOptions = Required<Omit<MockServerPluginOptions, 'build'>> & ResolvedCompilerOptions & {
54
+ logger: Logger;
55
+ build: false | ServerBuildOption;
56
+ };
57
+
58
58
  interface MiddlewareOptions {
59
59
  alias: Record<string, false | string | (string | false)[]>;
60
60
  proxies: (string | ((pathname: string, req: any) => boolean))[];
@@ -73,4 +73,4 @@ interface MockSocketOptions {
73
73
  }
74
74
  declare function mockWebSocket(compiler: MockCompiler, httpServer: Server$1 | Http2SecureServer, { wsProxies: proxies, cookiesOptions, logger, }: MockSocketOptions): void;
75
75
 
76
- export { type Logger as L, type MiddlewareOptions as M, type ResolvePluginOptions as R, type Server as S, type Middleware as a, type MockSocketOptions as b, createMockMiddleware as c, type MockCompilerOptions as d, createMockCompiler as e, MockCompiler as f, createLogger as g, logLevels as l, mockWebSocket as m };
76
+ export { type Logger as L, type MockCompilerOptions as M, type ResolvePluginOptions as R, type Server as S, MockCompiler as a, type MiddlewareOptions as b, createMockCompiler as c, createMockMiddleware as d, type Middleware as e, type MockSocketOptions as f, createLogger as g, logLevels as l, mockWebSocket as m };
@@ -1,9 +1,9 @@
1
1
  import { RspackPluginInstance, Compiler, RspackOptionsNormalized } from '@rspack/core';
2
- import { i as LogLevel, M as MockServerPluginOptions, S as ServerBuildOption, c as MockOptions } from './types-BgpcN3jm.cjs';
2
+ import { i as LogLevel, b as MockOptions, c as MockServerPluginOptions, S as ServerBuildOption } from './types-Aw0AciTG.cjs';
3
3
  import { Server as Server$1 } from 'node:http';
4
4
  import { Http2SecureServer } from 'node:http2';
5
- import EventEmitter from 'node:events';
6
5
  import { FSWatcher } from 'node:fs';
6
+ import EventEmitter from 'node:events';
7
7
 
8
8
  interface Logger {
9
9
  debug: (msg: string, level?: boolean | LogLevel) => void;
@@ -14,18 +14,6 @@ interface Logger {
14
14
  declare const logLevels: Record<LogLevel, number>;
15
15
  declare function createLogger(prefix: string, defaultLevel?: LogLevel): Logger;
16
16
 
17
- interface ResolvedCompilerOptions {
18
- alias: Record<string, false | string | (string | false)[]>;
19
- proxies: (string | ((pathname: string, req: any) => boolean))[];
20
- wsProxies: (string | ((pathname: string, req: any) => boolean))[];
21
- plugins: RspackPluginInstance[];
22
- context?: string;
23
- }
24
- type ResolvePluginOptions = Required<Omit<MockServerPluginOptions, 'build'>> & ResolvedCompilerOptions & {
25
- logger: Logger;
26
- build: false | ServerBuildOption;
27
- };
28
-
29
17
  interface MockCompilerOptions {
30
18
  alias?: Record<string, false | string | (string | false)[]>;
31
19
  plugins: RspackPluginInstance[];
@@ -55,6 +43,18 @@ declare class MockCompiler extends EventEmitter {
55
43
  watchMockFiles(): void;
56
44
  }
57
45
 
46
+ interface ResolvedCompilerOptions {
47
+ alias: Record<string, false | string | (string | false)[]>;
48
+ proxies: (string | ((pathname: string, req: any) => boolean))[];
49
+ wsProxies: (string | ((pathname: string, req: any) => boolean))[];
50
+ plugins: RspackPluginInstance[];
51
+ context?: string;
52
+ }
53
+ type ResolvePluginOptions = Required<Omit<MockServerPluginOptions, 'build'>> & ResolvedCompilerOptions & {
54
+ logger: Logger;
55
+ build: false | ServerBuildOption;
56
+ };
57
+
58
58
  interface MiddlewareOptions {
59
59
  alias: Record<string, false | string | (string | false)[]>;
60
60
  proxies: (string | ((pathname: string, req: any) => boolean))[];
@@ -73,4 +73,4 @@ interface MockSocketOptions {
73
73
  }
74
74
  declare function mockWebSocket(compiler: MockCompiler, httpServer: Server$1 | Http2SecureServer, { wsProxies: proxies, cookiesOptions, logger, }: MockSocketOptions): void;
75
75
 
76
- export { type Logger as L, type MiddlewareOptions as M, type ResolvePluginOptions as R, type Server as S, type Middleware as a, type MockSocketOptions as b, createMockMiddleware as c, type MockCompilerOptions as d, createMockCompiler as e, MockCompiler as f, createLogger as g, logLevels as l, mockWebSocket as m };
76
+ export { type Logger as L, type MockCompilerOptions as M, type ResolvePluginOptions as R, type Server as S, MockCompiler as a, type MiddlewareOptions as b, createMockCompiler as c, createMockMiddleware as d, type Middleware as e, type MockSocketOptions as f, createLogger as g, logLevels as l, mockWebSocket as m };
package/dist/rsbuild.cjs CHANGED
@@ -3,16 +3,16 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkZUCMHLWWcjs = require('./chunk-ZUCMHLWW.cjs');
6
+ var _chunkYAHWW6TXcjs = require('./chunk-YAHWW6TX.cjs');
7
7
 
8
8
 
9
9
 
10
- var _chunkT2VK464Wcjs = require('./chunk-T2VK464W.cjs');
10
+ var _chunkTKSRTJX5cjs = require('./chunk-TKSRTJX5.cjs');
11
11
 
12
12
  // src/rsbuild.ts
13
- var _process = require('process'); var _process2 = _interopRequireDefault(_process);
14
13
  var _http = require('http');
15
14
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
15
+ var _process = require('process'); var _process2 = _interopRequireDefault(_process);
16
16
  var _utils = require('@pengzhanbo/utils');
17
17
  var _core = require('@rspack/core'); var _core2 = _interopRequireDefault(_core);
18
18
  var _picocolors = require('picocolors'); var _picocolors2 = _interopRequireDefault(_picocolors);
@@ -22,7 +22,7 @@ function pluginMockServer(options = {}) {
22
22
  name: "plugin-mock-server",
23
23
  setup(api) {
24
24
  const rsbuildConfig = api.getRsbuildConfig();
25
- const resolvedOptions = _chunkZUCMHLWWcjs.resolvePluginOptions.call(void 0, options, {
25
+ const resolvedOptions = _chunkYAHWW6TXcjs.resolvePluginOptions.call(void 0, options, {
26
26
  proxies: resolveConfigProxies(rsbuildConfig),
27
27
  alias: {},
28
28
  context: api.context.rootPath,
@@ -32,7 +32,7 @@ function pluginMockServer(options = {}) {
32
32
  if (resolvedOptions.build) {
33
33
  api.onAfterBuild(async () => {
34
34
  const config = api.getNormalizedConfig();
35
- await _chunkZUCMHLWWcjs.buildMockServer.call(void 0,
35
+ await _chunkYAHWW6TXcjs.buildMockServer.call(void 0,
36
36
  resolvedOptions,
37
37
  _path2.default.resolve(_process2.default.cwd(), config.output.distPath.root || "dist")
38
38
  );
@@ -40,10 +40,10 @@ function pluginMockServer(options = {}) {
40
40
  }
41
41
  return;
42
42
  }
43
- const mockCompiler = _chunkZUCMHLWWcjs.createMockCompiler.call(void 0, resolvedOptions);
43
+ const mockCompiler = _chunkYAHWW6TXcjs.createMockCompiler.call(void 0, resolvedOptions);
44
44
  api.modifyRsbuildConfig((config) => {
45
45
  updateServerProxyConfigByHttpMock(config);
46
- const mockMiddleware = _chunkZUCMHLWWcjs.createMockMiddleware.call(void 0, mockCompiler, resolvedOptions);
46
+ const mockMiddleware = _chunkYAHWW6TXcjs.createMockMiddleware.call(void 0, mockCompiler, resolvedOptions);
47
47
  config.dev ??= {};
48
48
  config.dev.setupMiddlewares ??= [];
49
49
  config.dev.setupMiddlewares.push((middlewares, server2) => {
@@ -64,7 +64,7 @@ function pluginMockServer(options = {}) {
64
64
  mockCompiler.run();
65
65
  if (shouldMockWs) {
66
66
  server = _http.createServer.call(void 0, );
67
- _chunkT2VK464Wcjs.mockWebSocket.call(void 0, mockCompiler, server, resolvedOptions);
67
+ _chunkTKSRTJX5cjs.mockWebSocket.call(void 0, mockCompiler, server, resolvedOptions);
68
68
  server.listen(port);
69
69
  }
70
70
  }
@@ -105,7 +105,7 @@ function updateServerProxyConfigByHttpMock(config) {
105
105
  onError: onError || onProxyError,
106
106
  onProxyReq: (proxyReq, req, ...args) => {
107
107
  _optionalChain([onProxyReq, 'optionalCall', _16 => _16(proxyReq, req, ...args)]);
108
- _chunkT2VK464Wcjs.rewriteRequest.call(void 0, proxyReq, req);
108
+ _chunkTKSRTJX5cjs.rewriteRequest.call(void 0, proxyReq, req);
109
109
  }
110
110
  };
111
111
  }
@@ -115,7 +115,7 @@ function updateServerProxyConfigByHttpMock(config) {
115
115
  const onProxyReq = config.server.proxy.onProxyReq;
116
116
  config.server.proxy.onProxyReq = (proxyReq, req, ...args) => {
117
117
  _optionalChain([onProxyReq, 'optionalCall', _17 => _17(proxyReq, req, ...args)]);
118
- _chunkT2VK464Wcjs.rewriteRequest.call(void 0, proxyReq, req);
118
+ _chunkTKSRTJX5cjs.rewriteRequest.call(void 0, proxyReq, req);
119
119
  };
120
120
  config.server.proxy.onError ??= onProxyError;
121
121
  } else if (config.server.proxy) {
@@ -130,7 +130,7 @@ function updateServerProxyConfigByHttpMock(config) {
130
130
  ...rest,
131
131
  onProxyReq: (proxyReq, req, ...args) => {
132
132
  _optionalChain([onProxyReq, 'optionalCall', _18 => _18(proxyReq, req, ...args)]);
133
- _chunkT2VK464Wcjs.rewriteRequest.call(void 0, proxyReq, req);
133
+ _chunkTKSRTJX5cjs.rewriteRequest.call(void 0, proxyReq, req);
134
134
  },
135
135
  onError: onError || onProxyError
136
136
  };
@@ -1,14 +1,15 @@
1
1
  import { RsbuildPlugin } from '@rsbuild/core';
2
- import { M as MockServerPluginOptions } from './types-BgpcN3jm.cjs';
3
- import 'node:buffer';
4
- import 'node:http';
5
- import 'node:stream';
2
+ import { c as MockServerPluginOptions } from './types-Aw0AciTG.cjs';
3
+ export { B as BodyParserOptions, E as ExtraRequest, F as FormidableFile, i as LogLevel, L as LogType, f as Method, M as MockHttpItem, d as MockMatchPriority, e as MockMatchSpecialPriority, b as MockOptions, g as MockRequest, h as MockResponse, a as MockWebsocketItem, R as ResponseBody, S as ServerBuildOption, W as WebSocketSetupContext } from './types-Aw0AciTG.cjs';
4
+ import 'co-body';
6
5
  import 'cookies';
7
6
  import 'cors';
8
7
  import 'formidable';
8
+ import 'node:buffer';
9
+ import 'node:http';
10
+ import 'node:stream';
9
11
  import 'ws';
10
- import 'co-body';
11
12
 
12
13
  declare function pluginMockServer(options?: MockServerPluginOptions): RsbuildPlugin;
13
14
 
14
- export { pluginMockServer };
15
+ export { MockServerPluginOptions, pluginMockServer };
package/dist/rsbuild.d.ts CHANGED
@@ -1,14 +1,15 @@
1
1
  import { RsbuildPlugin } from '@rsbuild/core';
2
- import { M as MockServerPluginOptions } from './types-BgpcN3jm.js';
3
- import 'node:buffer';
4
- import 'node:http';
5
- import 'node:stream';
2
+ import { c as MockServerPluginOptions } from './types-Aw0AciTG.js';
3
+ export { B as BodyParserOptions, E as ExtraRequest, F as FormidableFile, i as LogLevel, L as LogType, f as Method, M as MockHttpItem, d as MockMatchPriority, e as MockMatchSpecialPriority, b as MockOptions, g as MockRequest, h as MockResponse, a as MockWebsocketItem, R as ResponseBody, S as ServerBuildOption, W as WebSocketSetupContext } from './types-Aw0AciTG.js';
4
+ import 'co-body';
6
5
  import 'cookies';
7
6
  import 'cors';
8
7
  import 'formidable';
8
+ import 'node:buffer';
9
+ import 'node:http';
10
+ import 'node:stream';
9
11
  import 'ws';
10
- import 'co-body';
11
12
 
12
13
  declare function pluginMockServer(options?: MockServerPluginOptions): RsbuildPlugin;
13
14
 
14
- export { pluginMockServer };
15
+ export { MockServerPluginOptions, pluginMockServer };
package/dist/rsbuild.js CHANGED
@@ -3,16 +3,16 @@ import {
3
3
  createMockCompiler,
4
4
  createMockMiddleware,
5
5
  resolvePluginOptions
6
- } from "./chunk-VKD4VKFQ.js";
6
+ } from "./chunk-E5FBQV7W.js";
7
7
  import {
8
8
  mockWebSocket,
9
9
  rewriteRequest
10
- } from "./chunk-2SSCBSV5.js";
10
+ } from "./chunk-KN5FLSDL.js";
11
11
 
12
12
  // src/rsbuild.ts
13
- import process from "process";
14
- import { createServer } from "http";
15
- import path from "path";
13
+ import { createServer } from "node:http";
14
+ import path from "node:path";
15
+ import process from "node:process";
16
16
  import { isArray, toArray } from "@pengzhanbo/utils";
17
17
  import rspack from "@rspack/core";
18
18
  import color from "picocolors";
package/dist/server.cjs CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
 
9
- var _chunkT2VK464Wcjs = require('./chunk-T2VK464W.cjs');
9
+ var _chunkTKSRTJX5cjs = require('./chunk-TKSRTJX5.cjs');
10
10
 
11
11
 
12
12
 
@@ -15,4 +15,4 @@ var _chunkT2VK464Wcjs = require('./chunk-T2VK464W.cjs');
15
15
 
16
16
 
17
17
 
18
- exports.baseMiddleware = _chunkT2VK464Wcjs.baseMiddleware; exports.createLogger = _chunkT2VK464Wcjs.createLogger; exports.logLevels = _chunkT2VK464Wcjs.logLevels; exports.mockWebSocket = _chunkT2VK464Wcjs.mockWebSocket; exports.sortByValidator = _chunkT2VK464Wcjs.sortByValidator; exports.transformMockData = _chunkT2VK464Wcjs.transformMockData; exports.transformRawData = _chunkT2VK464Wcjs.transformRawData;
18
+ exports.baseMiddleware = _chunkTKSRTJX5cjs.baseMiddleware; exports.createLogger = _chunkTKSRTJX5cjs.createLogger; exports.logLevels = _chunkTKSRTJX5cjs.logLevels; exports.mockWebSocket = _chunkTKSRTJX5cjs.mockWebSocket; exports.sortByValidator = _chunkTKSRTJX5cjs.sortByValidator; exports.transformMockData = _chunkTKSRTJX5cjs.transformMockData; exports.transformRawData = _chunkTKSRTJX5cjs.transformRawData;
package/dist/server.d.cts CHANGED
@@ -1,18 +1,18 @@
1
- import { M as MockServerPluginOptions, a as MockHttpItem, b as MockWebsocketItem, c as MockOptions } from './types-BgpcN3jm.cjs';
2
- import { L as Logger, f as MockCompiler, a as Middleware } from './mockWebsocket-Dc9CZBfv.cjs';
3
- export { b as MockSocketOptions, g as createLogger, l as logLevels, m as mockWebSocket } from './mockWebsocket-Dc9CZBfv.cjs';
4
- import 'node:buffer';
5
- import 'node:http';
6
- import 'node:stream';
1
+ import { c as MockServerPluginOptions, M as MockHttpItem, a as MockWebsocketItem, b as MockOptions } from './types-Aw0AciTG.cjs';
2
+ import { L as Logger, a as MockCompiler, e as Middleware } from './mockWebsocket-Ki_cShTv.cjs';
3
+ export { f as MockSocketOptions, g as createLogger, l as logLevels, m as mockWebSocket } from './mockWebsocket-Ki_cShTv.cjs';
4
+ import 'co-body';
7
5
  import 'cookies';
8
6
  import 'cors';
9
7
  import 'formidable';
8
+ import 'node:buffer';
9
+ import 'node:http';
10
+ import 'node:stream';
10
11
  import 'ws';
11
- import 'co-body';
12
12
  import '@rspack/core';
13
13
  import 'node:http2';
14
- import 'node:events';
15
14
  import 'node:fs';
15
+ import 'node:events';
16
16
 
17
17
  interface BaseMiddlewareOptions {
18
18
  formidableOptions: MockServerPluginOptions['formidableOptions'];
package/dist/server.d.ts CHANGED
@@ -1,18 +1,18 @@
1
- import { M as MockServerPluginOptions, a as MockHttpItem, b as MockWebsocketItem, c as MockOptions } from './types-BgpcN3jm.js';
2
- import { L as Logger, f as MockCompiler, a as Middleware } from './mockWebsocket-CPuTAvL0.js';
3
- export { b as MockSocketOptions, g as createLogger, l as logLevels, m as mockWebSocket } from './mockWebsocket-CPuTAvL0.js';
4
- import 'node:buffer';
5
- import 'node:http';
6
- import 'node:stream';
1
+ import { c as MockServerPluginOptions, M as MockHttpItem, a as MockWebsocketItem, b as MockOptions } from './types-Aw0AciTG.js';
2
+ import { L as Logger, a as MockCompiler, e as Middleware } from './mockWebsocket-DBgZBsdo.js';
3
+ export { f as MockSocketOptions, g as createLogger, l as logLevels, m as mockWebSocket } from './mockWebsocket-DBgZBsdo.js';
4
+ import 'co-body';
7
5
  import 'cookies';
8
6
  import 'cors';
9
7
  import 'formidable';
8
+ import 'node:buffer';
9
+ import 'node:http';
10
+ import 'node:stream';
10
11
  import 'ws';
11
- import 'co-body';
12
12
  import '@rspack/core';
13
13
  import 'node:http2';
14
- import 'node:events';
15
14
  import 'node:fs';
15
+ import 'node:events';
16
16
 
17
17
  interface BaseMiddlewareOptions {
18
18
  formidableOptions: MockServerPluginOptions['formidableOptions'];
package/dist/server.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  sortByValidator,
7
7
  transformMockData,
8
8
  transformRawData
9
- } from "./chunk-2SSCBSV5.js";
9
+ } from "./chunk-KN5FLSDL.js";
10
10
  export {
11
11
  baseMiddleware,
12
12
  createLogger,
@@ -1,11 +1,11 @@
1
- import { Buffer } from 'node:buffer';
2
- import http from 'node:http';
3
- import { Readable } from 'node:stream';
1
+ import { Options } from 'co-body';
4
2
  import Cookies from 'cookies';
5
3
  import { CorsOptions } from 'cors';
6
4
  import formidable from 'formidable';
5
+ import { Buffer } from 'node:buffer';
6
+ import http from 'node:http';
7
+ import { Readable } from 'node:stream';
7
8
  import { WebSocketServer } from 'ws';
8
- import { Options } from 'co-body';
9
9
 
10
10
  /**
11
11
  * Configure plugin
@@ -567,4 +567,4 @@ type FormidableFile = formidable.File | formidable.File[];
567
567
  type LogType = 'info' | 'warn' | 'error' | 'debug';
568
568
  type LogLevel = LogType | 'silent';
569
569
 
570
- export type { BodyParserOptions as B, ExtraRequest as E, FormidableFile as F, LogType as L, MockServerPluginOptions as M, ResponseBody as R, ServerBuildOption as S, WebSocketSetupContext as W, MockHttpItem as a, MockWebsocketItem as b, MockOptions as c, MockMatchPriority as d, MockMatchSpecialPriority as e, Method as f, MockRequest as g, MockResponse as h, LogLevel as i };
570
+ export type { BodyParserOptions as B, ExtraRequest as E, FormidableFile as F, LogType as L, MockHttpItem as M, ResponseBody as R, ServerBuildOption as S, WebSocketSetupContext as W, MockWebsocketItem as a, MockOptions as b, MockServerPluginOptions as c, MockMatchPriority as d, MockMatchSpecialPriority as e, Method as f, MockRequest as g, MockResponse as h, LogLevel as i };
@@ -1,11 +1,11 @@
1
- import { Buffer } from 'node:buffer';
2
- import http from 'node:http';
3
- import { Readable } from 'node:stream';
1
+ import { Options } from 'co-body';
4
2
  import Cookies from 'cookies';
5
3
  import { CorsOptions } from 'cors';
6
4
  import formidable from 'formidable';
5
+ import { Buffer } from 'node:buffer';
6
+ import http from 'node:http';
7
+ import { Readable } from 'node:stream';
7
8
  import { WebSocketServer } from 'ws';
8
- import { Options } from 'co-body';
9
9
 
10
10
  /**
11
11
  * Configure plugin
@@ -567,4 +567,4 @@ type FormidableFile = formidable.File | formidable.File[];
567
567
  type LogType = 'info' | 'warn' | 'error' | 'debug';
568
568
  type LogLevel = LogType | 'silent';
569
569
 
570
- export type { BodyParserOptions as B, ExtraRequest as E, FormidableFile as F, LogType as L, MockServerPluginOptions as M, ResponseBody as R, ServerBuildOption as S, WebSocketSetupContext as W, MockHttpItem as a, MockWebsocketItem as b, MockOptions as c, MockMatchPriority as d, MockMatchSpecialPriority as e, Method as f, MockRequest as g, MockResponse as h, LogLevel as i };
570
+ export type { BodyParserOptions as B, ExtraRequest as E, FormidableFile as F, LogType as L, MockHttpItem as M, ResponseBody as R, ServerBuildOption as S, WebSocketSetupContext as W, MockWebsocketItem as a, MockOptions as b, MockServerPluginOptions as c, MockMatchPriority as d, MockMatchSpecialPriority as e, Method as f, MockRequest as g, MockResponse as h, LogLevel as i };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rspack-plugin-mock",
3
3
  "type": "module",
4
- "version": "0.4.0",
4
+ "version": "0.5.0",
5
5
  "description": "inject api mock server to development server",
6
6
  "author": "pengzhanbo <q942450674@outlook.com> (https://github.com/pengzhanbo)",
7
7
  "license": "MIT",
@@ -74,8 +74,8 @@
74
74
  "pnpm": ">=9"
75
75
  },
76
76
  "peerDependencies": {
77
- "@rsbuild/core": ">=0.7.0",
78
- "@rspack/core": ">=0.7.0"
77
+ "@rsbuild/core": ">=1.0.0",
78
+ "@rspack/core": ">=1.0.0"
79
79
  },
80
80
  "peerDependenciesMeta": {
81
81
  "@rsbuild/core": {
@@ -87,28 +87,28 @@
87
87
  },
88
88
  "dependencies": {
89
89
  "@pengzhanbo/utils": "^1.1.2",
90
- "@rollup/pluginutils": "^5.1.0",
91
- "chokidar": "^3.6.0",
90
+ "@rollup/pluginutils": "^5.1.3",
91
+ "chokidar": "3.6.0",
92
92
  "co-body": "^6.2.0",
93
93
  "cookies": "^0.9.1",
94
94
  "cors": "^2.8.5",
95
95
  "debug": "^4.3.7",
96
96
  "fast-glob": "^3.3.2",
97
97
  "formidable": "2.1.2",
98
- "http-status": "^1.7.4",
98
+ "http-status": "^2.0.0",
99
99
  "is-core-module": "^2.15.1",
100
100
  "json5": "^2.2.3",
101
- "memfs": "^4.11.1",
101
+ "memfs": "^4.14.0",
102
102
  "mime-types": "^2.1.35",
103
103
  "path-to-regexp": "7.1.0",
104
- "picocolors": "^1.1.0",
104
+ "picocolors": "^1.1.1",
105
105
  "portfinder": "^1.0.32",
106
106
  "ws": "^8.18.0"
107
107
  },
108
108
  "devDependencies": {
109
- "@pengzhanbo/eslint-config": "^1.15.0",
110
- "@rsbuild/core": "1.0.1-rc.5",
111
- "@rspack/core": "^1.0.3",
109
+ "@pengzhanbo/eslint-config": "^1.18.2",
110
+ "@rsbuild/core": "^1.1.0",
111
+ "@rspack/core": "^1.1.1",
112
112
  "@types/co-body": "^6.1.3",
113
113
  "@types/cookies": "^0.9.0",
114
114
  "@types/cors": "^2.8.17",
@@ -116,15 +116,15 @@
116
116
  "@types/formidable": "2.0.6",
117
117
  "@types/is-core-module": "^2.2.2",
118
118
  "@types/mime-types": "^2.1.4",
119
- "@types/node": "^22.5.4",
120
- "@types/ws": "^8.5.12",
121
- "bumpp": "^9.5.2",
119
+ "@types/node": "^22.9.0",
120
+ "@types/ws": "^8.5.13",
121
+ "bumpp": "^9.8.1",
122
122
  "conventional-changelog-cli": "^5.0.0",
123
- "eslint": "^9.10.0",
124
- "husky": "^9.1.5",
123
+ "eslint": "^9.14.0",
124
+ "husky": "^9.1.6",
125
125
  "lint-staged": "^15.2.10",
126
- "tsup": "^8.2.4",
127
- "typescript": "^5.5.4"
126
+ "tsup": "^8.3.5",
127
+ "typescript": "^5.6.3"
128
128
  },
129
129
  "lint-staged": {
130
130
  "*": "eslint --fix"