rspack-plugin-mock 2.1.0 → 2.2.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.
- package/dist/helper.d.ts +113 -114
- package/dist/helper.js +24 -145
- package/dist/index-BjZK24gW.d.ts +1065 -0
- package/dist/index.d.ts +3 -4
- package/dist/index.js +15 -8
- package/dist/{logger-CzeuHKAL.js → logger-DTZcb53u.js} +126 -599
- package/dist/{options-CI0LRpJZ.js → options-C3NAM6gv.js} +24 -33
- package/dist/rsbuild.d.ts +2 -3
- package/dist/rsbuild.js +4 -4
- package/dist/{server-pC78IYdH.d.ts → server-DurHqymI.d.ts} +24 -40
- package/dist/server.d.ts +1 -1
- package/dist/server.js +1 -1
- package/package.json +32 -50
- package/dist/index-BMMGM-eD.d.ts +0 -1066
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as processRawData, d as
|
|
2
|
-
import { createRequire } from "node:module";
|
|
1
|
+
import { c as processRawData, d as vfs, f as getPackageDepList, m as createMatcher, p as getPackageDeps, s as processMockData, t as createLogger, u as normalizePath } from "./logger-DTZcb53u.js";
|
|
2
|
+
import { createRequire, isBuiltin } from "node:module";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import process from "node:process";
|
|
5
5
|
import { attemptAsync, isBoolean, isPlainObject, toArray, uniq } from "@pengzhanbo/utils";
|
|
@@ -8,13 +8,12 @@ import fs, { promises } from "node:fs";
|
|
|
8
8
|
import fsp from "node:fs/promises";
|
|
9
9
|
import ansis from "ansis";
|
|
10
10
|
import { glob } from "tinyglobby";
|
|
11
|
-
import isCore from "is-core-module";
|
|
12
11
|
import { loadPackageJSONSync } from "local-pkg";
|
|
13
12
|
import { pathToFileURL } from "node:url";
|
|
14
13
|
import { createHash } from "node:crypto";
|
|
15
14
|
import EventEmitter from "node:events";
|
|
16
15
|
import chokidar from "chokidar";
|
|
17
|
-
|
|
16
|
+
|
|
18
17
|
const require = createRequire(import.meta.url);
|
|
19
18
|
function createCompiler(options, callback) {
|
|
20
19
|
const rspackOptions = resolveRspackOptions(options);
|
|
@@ -38,7 +37,7 @@ function createCompiler(options, callback) {
|
|
|
38
37
|
const aliasList = Object.keys(options.alias || {}).map((key) => key.replace(/\$$/g, ""));
|
|
39
38
|
for (const { name } of modules) if (name?.startsWith("external")) {
|
|
40
39
|
const packageName = normalizePackageName(name);
|
|
41
|
-
if (!
|
|
40
|
+
if (!isBuiltin(packageName) && !aliasList.includes(packageName)) externals.push(normalizePackageName(name));
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
43
|
await callback({
|
|
@@ -136,8 +135,8 @@ function resolveRspackOptions({ cwd, isEsm = true, entryFile, plugins, alias, wa
|
|
|
136
135
|
] }
|
|
137
136
|
};
|
|
138
137
|
}
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
|
|
139
|
+
|
|
141
140
|
async function loadFromCode({ filepath, code, isESM, cwd }) {
|
|
142
141
|
filepath = path.resolve(cwd, filepath);
|
|
143
142
|
const ext = isESM ? ".mjs" : ".cjs";
|
|
@@ -154,12 +153,13 @@ async function importDefault(filepath) {
|
|
|
154
153
|
function getHash(str) {
|
|
155
154
|
return createHash("md5").update(str).digest("hex");
|
|
156
155
|
}
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
|
|
157
|
+
|
|
159
158
|
function createMockCompiler(options) {
|
|
160
159
|
return new MockCompiler(options);
|
|
161
160
|
}
|
|
162
161
|
var MockCompiler = class extends EventEmitter {
|
|
162
|
+
options;
|
|
163
163
|
cwd;
|
|
164
164
|
mockWatcher;
|
|
165
165
|
entryFile;
|
|
@@ -269,12 +269,12 @@ var MockCompiler = class extends EventEmitter {
|
|
|
269
269
|
});
|
|
270
270
|
}
|
|
271
271
|
};
|
|
272
|
-
|
|
273
|
-
|
|
272
|
+
|
|
273
|
+
|
|
274
274
|
var name = "rspack-plugin-mock";
|
|
275
|
-
var version = "2.
|
|
276
|
-
|
|
277
|
-
|
|
275
|
+
var version = "2.2.0";
|
|
276
|
+
|
|
277
|
+
|
|
278
278
|
function generatePackageJson(options, externals) {
|
|
279
279
|
const deps = getPackageDeps(options.context);
|
|
280
280
|
const exclude = [
|
|
@@ -297,8 +297,8 @@ function generatePackageJson(options, externals) {
|
|
|
297
297
|
});
|
|
298
298
|
return JSON.stringify(mockPkg, null, 2);
|
|
299
299
|
}
|
|
300
|
-
|
|
301
|
-
|
|
300
|
+
|
|
301
|
+
|
|
302
302
|
function generatorServerEntryCode({ proxies, wsPrefix, cookiesOptions, bodyParserOptions, priority, build }) {
|
|
303
303
|
const { serverPort, log } = build;
|
|
304
304
|
return `import { createServer } from 'node:http';
|
|
@@ -343,8 +343,8 @@ server.listen(${serverPort});
|
|
|
343
343
|
console.log('listen: http://localhost:${serverPort}');
|
|
344
344
|
`;
|
|
345
345
|
}
|
|
346
|
-
|
|
347
|
-
|
|
346
|
+
|
|
347
|
+
|
|
348
348
|
async function writeMockEntryFile(entryFile, files, cwd, dir) {
|
|
349
349
|
const importers = [];
|
|
350
350
|
const exporters = [];
|
|
@@ -359,8 +359,8 @@ async function writeMockEntryFile(entryFile, files, cwd, dir) {
|
|
|
359
359
|
if (!fs.existsSync(dirname)) await fsp.mkdir(dirname, { recursive: true });
|
|
360
360
|
await fsp.writeFile(entryFile, code, "utf8");
|
|
361
361
|
}
|
|
362
|
-
|
|
363
|
-
|
|
362
|
+
|
|
363
|
+
|
|
364
364
|
async function buildMockServer(options, outputDir) {
|
|
365
365
|
const buildOptions = options.build;
|
|
366
366
|
const entryFile = path.resolve(process.cwd(), "node_modules/.cache/mock-server/mock-server.ts");
|
|
@@ -410,8 +410,8 @@ async function buildMockServer(options, outputDir) {
|
|
|
410
410
|
options.logger.info(` ${ansis.green(filename)}${space}${ansis.bold.dim(`${sourceSize} kB`)}`);
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
|
-
|
|
414
|
-
|
|
413
|
+
|
|
414
|
+
|
|
415
415
|
function resolvePluginOptions({ prefix = [], wsPrefix = [], cwd, dir = "mock", include = ["**/*.mock.{js,ts,cjs,mjs,json,json5}"], exclude = [], reload = false, log = "info", cors = true, formidableOptions = {}, build = false, cookiesOptions = {}, bodyParserOptions = {}, priority = {}, activeScene = [], record = false, replay }, { alias, context, plugins, proxies: rawProxies }) {
|
|
416
416
|
const logger = createLogger("rspack:mock", isBoolean(log) ? log ? "info" : "error" : log);
|
|
417
417
|
const proxies = [...toArray(prefix), ...rawProxies];
|
|
@@ -459,16 +459,7 @@ function resolvePluginOptions({ prefix = [], wsPrefix = [], cwd, dir = "mock", i
|
|
|
459
459
|
replay: replay ?? resolvedRecord.enabled ?? false
|
|
460
460
|
};
|
|
461
461
|
}
|
|
462
|
-
|
|
463
|
-
* Resolve record options
|
|
464
|
-
*
|
|
465
|
-
* 解析录制配置
|
|
466
|
-
*
|
|
467
|
-
* @param cwd - Current working directory / 当前工作目录
|
|
468
|
-
* @param dir - Mock context directory / 模拟上下文目录
|
|
469
|
-
* @param record - Record options / 录制配置
|
|
470
|
-
* @returns Resolved record options / 解析后的录制配置
|
|
471
|
-
*/
|
|
462
|
+
|
|
472
463
|
function resolveRecordOptions(cwd, dir, record) {
|
|
473
464
|
const recordOptions = typeof record === "boolean" ? { enabled: record } : record;
|
|
474
465
|
const expires = recordOptions?.expires ?? 0;
|
|
@@ -483,5 +474,5 @@ function resolveRecordOptions(cwd, dir, record) {
|
|
|
483
474
|
filter: recordOptions?.filter || (() => true)
|
|
484
475
|
};
|
|
485
476
|
}
|
|
486
|
-
|
|
477
|
+
|
|
487
478
|
export { buildMockServer as n, createMockCompiler as r, resolvePluginOptions as t };
|
package/dist/rsbuild.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { A as ResponseBody, C as HandleFunction, D as MockResponse, E as MockRequest, M as CookiesOption, N as GetCookieOption, O as NextFunction, P as SetCookieOption, S as ExtraRequest, T as Method, _ as RecordedMeta, a as MockWebsocketItem, b as RecordedRes, c as MockHttpItem, d as LogType, f as MockMatchPriority, g as RecordOptions, h as ServerBuildOption, i as MockOptions, j as SimpleHandleFunction, k as NextHandleFunction, l as BodyParserOptions, m as MockServerPluginOptions, n as HttpProxyPlugin, o as WebSocketSetupContext, p as MockMatchSpecialPriority, r as PathFilter, s as MockErrorConfig, t as FormidableFile, u as LogLevel, v as RecordedReq, w as Headers, x as ResolvedRecordOptions, y as RecordedRequest } from "./index-
|
|
1
|
+
import { A as ResponseBody, C as HandleFunction, D as MockResponse, E as MockRequest, M as CookiesOption, N as GetCookieOption, O as NextFunction, P as SetCookieOption, S as ExtraRequest, T as Method, _ as RecordedMeta, a as MockWebsocketItem, b as RecordedRes, c as MockHttpItem, d as LogType, f as MockMatchPriority, g as RecordOptions, h as ServerBuildOption, i as MockOptions, j as SimpleHandleFunction, k as NextHandleFunction, l as BodyParserOptions, m as MockServerPluginOptions, n as HttpProxyPlugin, o as WebSocketSetupContext, p as MockMatchSpecialPriority, r as PathFilter, s as MockErrorConfig, t as FormidableFile, u as LogLevel, v as RecordedReq, w as Headers, x as ResolvedRecordOptions, y as RecordedRequest } from "./index-BjZK24gW.js";
|
|
2
2
|
import { DefineMockDataOptions, HeaderStream, MockData, SSEMessage, createDefineMock, createSSEStream, defineMock, defineMockData } from "./helper.js";
|
|
3
3
|
import { RsbuildPlugin } from "@rsbuild/core";
|
|
4
|
-
|
|
5
4
|
//#region src/core/rsbuild.d.ts
|
|
6
5
|
declare function pluginMockServer(options?: MockServerPluginOptions): RsbuildPlugin;
|
|
7
6
|
//#endregion
|
|
8
|
-
export { BodyParserOptions, CookiesOption, DefineMockDataOptions, ExtraRequest, type FormidableFile, GetCookieOption, HandleFunction, HeaderStream, Headers, HttpProxyPlugin, LogLevel, LogType, Method, MockData, MockErrorConfig, type MockHttpItem, MockMatchPriority, MockMatchSpecialPriority, type MockOptions, type MockRequest, MockResponse, type MockServerPluginOptions, type MockWebsocketItem, NextFunction, NextHandleFunction, PathFilter, RecordOptions, RecordedMeta, RecordedReq, RecordedRequest, RecordedRes, ResolvedRecordOptions, ResponseBody, SSEMessage, ServerBuildOption, SetCookieOption, SimpleHandleFunction, WebSocketSetupContext, createDefineMock, createSSEStream, defineMock, defineMockData, pluginMockServer };
|
|
7
|
+
export { type BodyParserOptions, type CookiesOption, DefineMockDataOptions, type ExtraRequest, type FormidableFile, type GetCookieOption, type HandleFunction, HeaderStream, type Headers, type HttpProxyPlugin, type LogLevel, type LogType, type Method, MockData, type MockErrorConfig, type MockHttpItem, type MockMatchPriority, type MockMatchSpecialPriority, type MockOptions, type MockRequest, type MockResponse, type MockServerPluginOptions, type MockWebsocketItem, type NextFunction, type NextHandleFunction, type PathFilter, type RecordOptions, type RecordedMeta, type RecordedReq, type RecordedRequest, type RecordedRes, type ResolvedRecordOptions, type ResponseBody, SSEMessage, type ServerBuildOption, type SetCookieOption, type SimpleHandleFunction, type WebSocketSetupContext, createDefineMock, createSSEStream, defineMock, defineMockData, pluginMockServer };
|
package/dist/rsbuild.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { a as rewriteRequest, i as createMockMiddleware, o as Recorder, r as mockWebSocket } from "./logger-
|
|
2
|
-
import { n as buildMockServer, r as createMockCompiler, t as resolvePluginOptions } from "./options-
|
|
1
|
+
import { a as rewriteRequest, i as createMockMiddleware, o as Recorder, r as mockWebSocket } from "./logger-DTZcb53u.js";
|
|
2
|
+
import { n as buildMockServer, r as createMockCompiler, t as resolvePluginOptions } from "./options-C3NAM6gv.js";
|
|
3
3
|
import { createDefineMock, createSSEStream, defineMock, defineMockData } from "./helper.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import { isArray, objectEntries, toArray } from "@pengzhanbo/utils";
|
|
7
7
|
import rspack from "@rspack/core";
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
function pluginMockServer(options = {}) {
|
|
10
10
|
return {
|
|
11
11
|
name: "plugin-mock-server",
|
|
@@ -76,5 +76,5 @@ function resolveConfigProxies(config) {
|
|
|
76
76
|
});
|
|
77
77
|
return proxies;
|
|
78
78
|
}
|
|
79
|
-
|
|
79
|
+
|
|
80
80
|
export { createDefineMock, createSSEStream, defineMock, defineMockData, pluginMockServer };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as MockWebsocketItem, c as MockHttpItem, h as ServerBuildOption, i as MockOptions, k as NextHandleFunction, m as MockServerPluginOptions, r as PathFilter, u as LogLevel, x as ResolvedRecordOptions } from "./index-
|
|
1
|
+
import { a as MockWebsocketItem, c as MockHttpItem, h as ServerBuildOption, i as MockOptions, k as NextHandleFunction, m as MockServerPluginOptions, r as PathFilter, u as LogLevel, x as ResolvedRecordOptions } from "./index-BjZK24gW.js";
|
|
2
2
|
import { Arrayable } from "@pengzhanbo/utils";
|
|
3
3
|
import { Compiler, RspackPluginInstance } from "@rspack/core";
|
|
4
4
|
import { Matcher } from "picomatch";
|
|
@@ -7,7 +7,6 @@ import { FSWatcher } from "chokidar";
|
|
|
7
7
|
import { CorsOptions } from "cors";
|
|
8
8
|
import { Server } from "node:http";
|
|
9
9
|
import { Http2SecureServer } from "node:http2";
|
|
10
|
-
|
|
11
10
|
//#region src/core/logger.d.ts
|
|
12
11
|
interface Logger {
|
|
13
12
|
debug: (msg: string, level?: boolean | LogLevel) => void;
|
|
@@ -38,8 +37,8 @@ type ResolvePluginOptions = Required<Omit<MockServerPluginOptions, "build">> & R
|
|
|
38
37
|
declare class MockCompiler extends EventEmitter {
|
|
39
38
|
options: ResolvePluginOptions;
|
|
40
39
|
cwd: string;
|
|
41
|
-
mockWatcher
|
|
42
|
-
entryFile
|
|
40
|
+
mockWatcher: FSWatcher;
|
|
41
|
+
entryFile: string;
|
|
43
42
|
deps: string[];
|
|
44
43
|
isESM: boolean;
|
|
45
44
|
private _mockData;
|
|
@@ -66,37 +65,26 @@ interface CreateMockMiddlewareOptions extends Pick<ResolvePluginOptions, "formid
|
|
|
66
65
|
cors: false | CorsOptions;
|
|
67
66
|
}
|
|
68
67
|
/**
|
|
69
|
-
* Create mock middleware
|
|
70
|
-
*
|
|
71
|
-
* 创建 Mock 中间件
|
|
72
|
-
*
|
|
73
|
-
* @param compiler - Compiler instance / 编译器实例
|
|
74
|
-
* @param options - Middleware options / 中间件配置项
|
|
75
|
-
* @param options.formidableOptions - Formidable options / Formidable 配置项
|
|
76
|
-
* @param options.bodyParserOptions - Body parser options / 请求体解析配置项
|
|
77
|
-
* @param options.proxies - Proxy paths / 代理路径
|
|
78
|
-
* @param options.cookiesOptions - Cookies options / Cookies 配置项
|
|
79
|
-
* @param options.logger - Logger instance / 日志实例
|
|
80
|
-
* @param options.priority - Path matching priority / 路径匹配优先级
|
|
81
|
-
* @param options.cors - CORS options / CORS 配置项
|
|
82
|
-
* @param options.record - Record options / 录制配置项
|
|
83
|
-
* @param options.replay - Replay options / 回放配置项
|
|
84
|
-
* @param options.activeScene - Active scene / 活动场景
|
|
85
|
-
*
|
|
86
|
-
* @returns Connect middleware function / Connect 中间件函数
|
|
87
|
-
*/
|
|
88
|
-
declare function createMockMiddleware(compiler: MockCompiler, {
|
|
89
|
-
formidableOptions,
|
|
90
|
-
bodyParserOptions,
|
|
91
|
-
proxies,
|
|
92
|
-
cookiesOptions,
|
|
93
|
-
logger,
|
|
94
|
-
priority,
|
|
95
|
-
cors: corsOptions,
|
|
96
|
-
record,
|
|
97
|
-
replay,
|
|
98
|
-
activeScene
|
|
99
|
-
}: CreateMockMiddlewareOptions): NextHandleFunction;
|
|
68
|
+
* Create mock middleware
|
|
69
|
+
*
|
|
70
|
+
* 创建 Mock 中间件
|
|
71
|
+
*
|
|
72
|
+
* @param compiler - Compiler instance / 编译器实例
|
|
73
|
+
* @param options - Middleware options / 中间件配置项
|
|
74
|
+
* @param options.formidableOptions - Formidable options / Formidable 配置项
|
|
75
|
+
* @param options.bodyParserOptions - Body parser options / 请求体解析配置项
|
|
76
|
+
* @param options.proxies - Proxy paths / 代理路径
|
|
77
|
+
* @param options.cookiesOptions - Cookies options / Cookies 配置项
|
|
78
|
+
* @param options.logger - Logger instance / 日志实例
|
|
79
|
+
* @param options.priority - Path matching priority / 路径匹配优先级
|
|
80
|
+
* @param options.cors - CORS options / CORS 配置项
|
|
81
|
+
* @param options.record - Record options / 录制配置项
|
|
82
|
+
* @param options.replay - Replay options / 回放配置项
|
|
83
|
+
* @param options.activeScene - Active scene / 活动场景
|
|
84
|
+
*
|
|
85
|
+
* @returns Connect middleware function / Connect 中间件函数
|
|
86
|
+
*/
|
|
87
|
+
declare function createMockMiddleware(compiler: MockCompiler, { formidableOptions, bodyParserOptions, proxies, cookiesOptions, logger, priority, cors: corsOptions, record, replay, activeScene }: CreateMockMiddlewareOptions): NextHandleFunction;
|
|
100
88
|
//#endregion
|
|
101
89
|
//#region src/mockWebsocket/server.d.ts
|
|
102
90
|
interface MockSocketOptions {
|
|
@@ -104,10 +92,6 @@ interface MockSocketOptions {
|
|
|
104
92
|
cookiesOptions: MockServerPluginOptions["cookiesOptions"];
|
|
105
93
|
logger: Logger;
|
|
106
94
|
}
|
|
107
|
-
declare function mockWebSocket(compiler: MockCompiler, httpServer: Server | Http2SecureServer | null, {
|
|
108
|
-
wsProxies: proxies,
|
|
109
|
-
cookiesOptions,
|
|
110
|
-
logger
|
|
111
|
-
}: MockSocketOptions): void;
|
|
95
|
+
declare function mockWebSocket(compiler: MockCompiler, httpServer: Server | Http2SecureServer | null, { wsProxies: proxies, cookiesOptions, logger }: MockSocketOptions): void;
|
|
112
96
|
//#endregion
|
|
113
97
|
export { processMockData as a, MockCompiler as c, createLogger as d, logLevels as f, createMockMiddleware as i, ResolvePluginOptions as l, mockWebSocket as n, processRawData as o, CreateMockMiddlewareOptions as r, sortByValidator as s, MockSocketOptions as t, Logger as u };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as processMockData, d as createLogger, f as logLevels, i as createMockMiddleware, n as mockWebSocket, o as processRawData, r as CreateMockMiddlewareOptions, s as sortByValidator, t as MockSocketOptions, u as Logger } from "./server-
|
|
1
|
+
import { a as processMockData, d as createLogger, f as logLevels, i as createMockMiddleware, n as mockWebSocket, o as processRawData, r as CreateMockMiddlewareOptions, s as sortByValidator, t as MockSocketOptions, u as Logger } from "./server-DurHqymI.js";
|
|
2
2
|
export { CreateMockMiddlewareOptions, Logger, MockSocketOptions, createLogger, createMockMiddleware, logLevels, mockWebSocket, processMockData, processRawData, sortByValidator };
|
package/dist/server.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { c as processRawData, i as createMockMiddleware, l as sortByValidator, n as logLevels, r as mockWebSocket, s as processMockData, t as createLogger } from "./logger-
|
|
1
|
+
import { c as processRawData, i as createMockMiddleware, l as sortByValidator, n as logLevels, r as mockWebSocket, s as processMockData, t as createLogger } from "./logger-DTZcb53u.js";
|
|
2
2
|
export { createLogger, createMockMiddleware, logLevels, mockWebSocket, processMockData, processRawData, sortByValidator };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rspack-plugin-mock",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.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",
|
|
@@ -22,33 +22,12 @@
|
|
|
22
22
|
"#json5-loader": "./dist/json5-loader.mjs"
|
|
23
23
|
},
|
|
24
24
|
"exports": {
|
|
25
|
-
".":
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
"./server": {
|
|
32
|
-
"import": {
|
|
33
|
-
"types": "./dist/server.d.ts",
|
|
34
|
-
"default": "./dist/server.js"
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
"./rsbuild": {
|
|
38
|
-
"import": {
|
|
39
|
-
"types": "./dist/rsbuild.d.ts",
|
|
40
|
-
"default": "./dist/rsbuild.js"
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
"./helper": {
|
|
44
|
-
"import": {
|
|
45
|
-
"types": "./dist/helper.d.ts",
|
|
46
|
-
"default": "./dist/helper.js"
|
|
47
|
-
}
|
|
48
|
-
},
|
|
25
|
+
".": "./dist/index.js",
|
|
26
|
+
"./helper": "./dist/helper.js",
|
|
27
|
+
"./rsbuild": "./dist/rsbuild.js",
|
|
28
|
+
"./server": "./dist/server.js",
|
|
49
29
|
"./package.json": "./package.json"
|
|
50
30
|
},
|
|
51
|
-
"main": "dist/index.js",
|
|
52
31
|
"types": "dist/index.d.ts",
|
|
53
32
|
"files": [
|
|
54
33
|
"dist"
|
|
@@ -74,47 +53,50 @@
|
|
|
74
53
|
}
|
|
75
54
|
},
|
|
76
55
|
"dependencies": {
|
|
77
|
-
"@pengzhanbo/utils": "^3.
|
|
78
|
-
"ansis": "^4.
|
|
56
|
+
"@pengzhanbo/utils": "^3.10.0",
|
|
57
|
+
"ansis": "^4.3.1",
|
|
79
58
|
"chokidar": "^5.0.0",
|
|
80
59
|
"co-body": "^6.2.0",
|
|
60
|
+
"cookies": "^0.9.1",
|
|
81
61
|
"cors": "^2.8.6",
|
|
82
|
-
"debug": "^4.4.3",
|
|
83
62
|
"formidable": "^3.5.4",
|
|
84
63
|
"http-status": "^2.1.0",
|
|
85
|
-
"is-core-module": "^2.16.1",
|
|
86
64
|
"json5": "^2.2.3",
|
|
87
|
-
"local-pkg": "^1.1
|
|
88
|
-
"memfs": "^4.
|
|
65
|
+
"local-pkg": "^1.2.1",
|
|
66
|
+
"memfs": "^4.68.0",
|
|
89
67
|
"mime-types": "^3.0.2",
|
|
90
68
|
"path-to-regexp": "^8.4.2",
|
|
91
|
-
"picomatch": "^4.0.
|
|
92
|
-
"tinyglobby": "^0.2.
|
|
93
|
-
"ws": "^8.
|
|
69
|
+
"picomatch": "^4.0.5",
|
|
70
|
+
"tinyglobby": "^0.2.17",
|
|
71
|
+
"ws": "^8.21.3"
|
|
94
72
|
},
|
|
95
73
|
"devDependencies": {
|
|
96
|
-
"@pengzhanbo/eslint-config": "^2.
|
|
97
|
-
"@rsbuild/core": "^2.
|
|
98
|
-
"@rspack/core": "^2.
|
|
74
|
+
"@pengzhanbo/eslint-config": "^2.8.5",
|
|
75
|
+
"@rsbuild/core": "^2.1.10",
|
|
76
|
+
"@rspack/core": "^2.1.8",
|
|
99
77
|
"@types/co-body": "^6.1.3",
|
|
78
|
+
"@types/cookies": "^0.9.2",
|
|
100
79
|
"@types/cors": "^2.8.19",
|
|
101
|
-
"@types/debug": "^4.1.13",
|
|
102
80
|
"@types/formidable": "^3.5.1",
|
|
103
|
-
"@types/is-core-module": "^2.2.2",
|
|
104
81
|
"@types/mime-types": "^3.0.1",
|
|
105
|
-
"@types/node": "^
|
|
82
|
+
"@types/node": "^26.2.0",
|
|
106
83
|
"@types/picomatch": "^4.0.3",
|
|
107
84
|
"@types/ws": "^8.18.1",
|
|
108
|
-
"bumpp": "^
|
|
109
|
-
"conventional-changelog
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"
|
|
85
|
+
"bumpp": "^12.2.0",
|
|
86
|
+
"conventional-changelog": "^7.2.0",
|
|
87
|
+
"conventional-changelog-angular": "^8.3.1",
|
|
88
|
+
"eslint": "^10.8.1",
|
|
89
|
+
"js-tokens": "^10.0.0",
|
|
90
|
+
"nano-staged": "^1.0.2",
|
|
91
|
+
"simple-git-hooks": "^2.13.1",
|
|
92
|
+
"tsdown": "^0.22.14",
|
|
93
|
+
"typescript": "6.0.3",
|
|
115
94
|
"zstd-codec": "^0.1.5"
|
|
116
95
|
},
|
|
117
|
-
"
|
|
96
|
+
"simple-git-hooks": {
|
|
97
|
+
"pre-commit": "./node_modules/.bin/nano-staged --allow-empty"
|
|
98
|
+
},
|
|
99
|
+
"nano-staged": {
|
|
118
100
|
"*": "eslint --fix"
|
|
119
101
|
},
|
|
120
102
|
"publishConfig": {
|
|
@@ -126,7 +108,7 @@
|
|
|
126
108
|
"build": "tsdown",
|
|
127
109
|
"lint": "eslint .",
|
|
128
110
|
"release:publish": "pnpm -r publish",
|
|
129
|
-
"release:changelog": "conventional-changelog -p angular
|
|
111
|
+
"release:changelog": "conventional-changelog -p angular",
|
|
130
112
|
"release": "bumpp package.json --execute=\"pnpm release:changelog\" --commit --all --push --tag"
|
|
131
113
|
}
|
|
132
114
|
}
|