@rsdoctor/core 2.0.0-rc.0 → 2.0.0-rc.2
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/e.js +6030 -888
- package/dist/e.js.LICENSE.txt +1 -1
- package/dist/index.d.ts +458 -7
- package/dist/index.js +2519 -1684
- package/dist/index.js.LICENSE.txt +8 -2
- package/dist/probe-loader.d.ts +13 -0
- package/dist/proxy-loader.d.ts +36 -1
- package/dist/r.js +9218 -241
- package/dist/r.js.LICENSE.txt +57 -0
- package/package.json +26 -26
- package/dist/build-utils/build/chunks/assetsModules.d.ts +0 -23
- package/dist/build-utils/build/chunks/index.d.ts +0 -2
- package/dist/build-utils/build/chunks/rspack/transform.d.ts +0 -13
- package/dist/build-utils/build/envinfo.d.ts +0 -13
- package/dist/build-utils/build/file/cache.d.ts +0 -5
- package/dist/build-utils/build/file/index.d.ts +0 -3
- package/dist/build-utils/build/file/sharding.d.ts +0 -21
- package/dist/build-utils/build/index.d.ts +0 -10
- package/dist/build-utils/build/json.d.ts +0 -3
- package/dist/build-utils/build/loader/index.d.ts +0 -2
- package/dist/build-utils/build/loader/probeLoader.d.ts +0 -9
- package/dist/build-utils/build/loader/probeLoaderPlugin.d.ts +0 -6
- package/dist/build-utils/build/module-graph/index.d.ts +0 -1
- package/dist/build-utils/build/module-graph/rspack/transform.d.ts +0 -26
- package/dist/build-utils/build/process.d.ts +0 -2
- package/dist/build-utils/build/server.d.ts +0 -14
- package/dist/build-utils/build/utils/index.d.ts +0 -3
- package/dist/build-utils/build/utils/loader.d.ts +0 -20
- package/dist/build-utils/build/utils/parseBundle.d.ts +0 -12
- package/dist/build-utils/build/utils/plugin.d.ts +0 -5
- package/dist/build-utils/index.d.ts +0 -11
- package/dist/common/global-config.d.ts +0 -21
- package/dist/compat.d.ts +0 -34
- package/dist/error/error.d.ts +0 -35
- package/dist/error/index.d.ts +0 -2
- package/dist/error/transform.d.ts +0 -3
- package/dist/error/utils.d.ts +0 -4
- package/dist/inner-plugins/constants.d.ts +0 -6
- package/dist/inner-plugins/index.d.ts +0 -2
- package/dist/inner-plugins/loaders/proxy.d.ts +0 -7
- package/dist/inner-plugins/plugins/base.d.ts +0 -12
- package/dist/inner-plugins/plugins/bundle.d.ts +0 -15
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.ts +0 -34
- package/dist/inner-plugins/plugins/errors.d.ts +0 -12
- package/dist/inner-plugins/plugins/index.d.ts +0 -10
- package/dist/inner-plugins/plugins/loader.d.ts +0 -12
- package/dist/inner-plugins/plugins/plugins.d.ts +0 -8
- package/dist/inner-plugins/plugins/progress.d.ts +0 -8
- package/dist/inner-plugins/plugins/resolver.d.ts +0 -12
- package/dist/inner-plugins/plugins/rspack.d.ts +0 -9
- package/dist/inner-plugins/plugins/rules.d.ts +0 -8
- package/dist/inner-plugins/plugins/sourcemapTool.d.ts +0 -47
- package/dist/inner-plugins/plugins/summary.d.ts +0 -15
- package/dist/inner-plugins/utils/circleDetect.d.ts +0 -4
- package/dist/inner-plugins/utils/config.d.ts +0 -6
- package/dist/inner-plugins/utils/index.d.ts +0 -9
- package/dist/inner-plugins/utils/loader.d.ts +0 -10
- package/dist/inner-plugins/utils/normalize-config.d.ts +0 -32
- package/dist/inner-plugins/utils/openBrowser.d.ts +0 -1
- package/dist/inner-plugins/utils/plugin-common.d.ts +0 -11
- package/dist/inner-plugins/utils/plugin.d.ts +0 -4
- package/dist/inner-plugins/utils/ruleWarnings.d.ts +0 -2
- package/dist/inner-plugins/utils/sdk.d.ts +0 -8
- package/dist/logger.d.ts +0 -9
- package/dist/rspack-plugin/constants.d.ts +0 -9
- package/dist/rspack-plugin/index.d.ts +0 -1
- package/dist/rspack-plugin/plugin.d.ts +0 -55
- package/dist/rspack-plugin/session.d.ts +0 -19
- package/dist/rspack-plugin/writeStore.d.ts +0 -2
- package/dist/rule-utils/document/document.d.ts +0 -16
- package/dist/rule-utils/document/index.d.ts +0 -3
- package/dist/rule-utils/document/server.d.ts +0 -4
- package/dist/rule-utils/document/types.d.ts +0 -31
- package/dist/rule-utils/index.d.ts +0 -2
- package/dist/rule-utils/parser/asserts.d.ts +0 -81
- package/dist/rule-utils/parser/index.d.ts +0 -4
- package/dist/rule-utils/parser/parser.d.ts +0 -118
- package/dist/rule-utils/parser/types.d.ts +0 -30
- package/dist/rule-utils/parser/utils.d.ts +0 -27
- package/dist/rules/index.d.ts +0 -3
- package/dist/rules/linter.d.ts +0 -9
- package/dist/rules/rule.d.ts +0 -27
- package/dist/rules/rules/cjs-require/index.d.ts +0 -4
- package/dist/rules/rules/cjs-require/types.d.ts +0 -7
- package/dist/rules/rules/cross-chunks-package/index.d.ts +0 -4
- package/dist/rules/rules/cross-chunks-package/types.d.ts +0 -3
- package/dist/rules/rules/cross-chunks-package/utils.d.ts +0 -1
- package/dist/rules/rules/default-import-check/index.d.ts +0 -4
- package/dist/rules/rules/default-import-check/types.d.ts +0 -4
- package/dist/rules/rules/default-import-check/utils.d.ts +0 -10
- package/dist/rules/rules/duplicate-package/index.d.ts +0 -4
- package/dist/rules/rules/duplicate-package/types.d.ts +0 -24
- package/dist/rules/rules/duplicate-package/utils.d.ts +0 -3
- package/dist/rules/rules/ecma-version-check/htmlParserStub.d.ts +0 -3
- package/dist/rules/rules/ecma-version-check/index.d.ts +0 -5
- package/dist/rules/rules/ecma-version-check/types.d.ts +0 -13
- package/dist/rules/rules/esm-resolved-to-cjs/index.d.ts +0 -4
- package/dist/rules/rules/esm-resolved-to-cjs/types.d.ts +0 -8
- package/dist/rules/rules/index.d.ts +0 -2
- package/dist/rules/rules/loader-performance-optimization/index.d.ts +0 -4
- package/dist/rules/rules/loader-performance-optimization/types.d.ts +0 -22
- package/dist/rules/rules/loader-performance-optimization/utils.d.ts +0 -1
- package/dist/rules/rules/module-mixed-chunks/index.d.ts +0 -4
- package/dist/rules/rules/module-mixed-chunks/types.d.ts +0 -3
- package/dist/rules/rules/side-effects-only-imports/index.d.ts +0 -4
- package/dist/rules/rules/side-effects-only-imports/types.d.ts +0 -9
- package/dist/rules/utils.d.ts +0 -3
- package/dist/sdk/index.d.ts +0 -2
- package/dist/sdk/multiple/controller.d.ts +0 -26
- package/dist/sdk/multiple/index.d.ts +0 -2
- package/dist/sdk/multiple/primary.d.ts +0 -41
- package/dist/sdk/multiple/server.d.ts +0 -7
- package/dist/sdk/sdk/core.d.ts +0 -34
- package/dist/sdk/sdk/index.d.ts +0 -54
- package/dist/sdk/sdk/types.d.ts +0 -26
- package/dist/sdk/server/apis/alerts.d.ts +0 -5
- package/dist/sdk/server/apis/base.d.ts +0 -11
- package/dist/sdk/server/apis/bundle-diff.d.ts +0 -6
- package/dist/sdk/server/apis/data.d.ts +0 -6
- package/dist/sdk/server/apis/fs.d.ts +0 -5
- package/dist/sdk/server/apis/graph.d.ts +0 -12
- package/dist/sdk/server/apis/index.d.ts +0 -10
- package/dist/sdk/server/apis/loader.d.ts +0 -15
- package/dist/sdk/server/apis/plugin.d.ts +0 -6
- package/dist/sdk/server/apis/project.d.ts +0 -8
- package/dist/sdk/server/apis/renderer.d.ts +0 -6
- package/dist/sdk/server/apis/resolver.d.ts +0 -6
- package/dist/sdk/server/client.d.ts +0 -3
- package/dist/sdk/server/fakeServer.d.ts +0 -9
- package/dist/sdk/server/index.d.ts +0 -44
- package/dist/sdk/server/json-body.d.ts +0 -6
- package/dist/sdk/server/router.d.ts +0 -24
- package/dist/sdk/server/security.d.ts +0 -5
- package/dist/sdk/server/socket/api.d.ts +0 -15
- package/dist/sdk/server/socket/index.d.ts +0 -48
- package/dist/sdk/server/utils.d.ts +0 -6
- package/dist/sdk/utils/base.d.ts +0 -1
- package/dist/sdk/utils/constant.d.ts +0 -1
- package/dist/sdk/utils/date.d.ts +0 -1
- package/dist/sdk/utils/index.d.ts +0 -4
- package/dist/sdk/utils/manifestSharding.d.ts +0 -16
- package/dist/sdk/utils/openBrowser.d.ts +0 -4
- package/dist/sdk/utils/upload.d.ts +0 -2
- package/dist/sdk/utils/writeJson.d.ts +0 -1
- package/dist/sdk.d.ts +0 -1
- package/dist/types/index.d.ts +0 -3
- package/dist/types/loader.d.ts +0 -24
- package/dist/types/plugin.d.ts +0 -22
- package/dist/types/rules.d.ts +0 -7
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* connect
|
|
3
|
+
* Copyright(c) 2010 Sencha Inc.
|
|
4
|
+
* Copyright(c) 2011 TJ Holowaychuk
|
|
5
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
6
|
+
* Copyright(c) 2025 Rstackjs
|
|
7
|
+
* MIT Licensed
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/*!
|
|
11
|
+
* ee-first
|
|
12
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
13
|
+
* MIT Licensed
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/*!
|
|
17
|
+
* encodeurl
|
|
18
|
+
* Copyright(c) 2016 Douglas Christopher Wilson
|
|
19
|
+
* MIT Licensed
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/*!
|
|
23
|
+
* escape-html
|
|
24
|
+
* Copyright(c) 2012-2013 TJ Holowaychuk
|
|
25
|
+
* Copyright(c) 2015 Andreas Lubbe
|
|
26
|
+
* Copyright(c) 2015 Tiancheng "Timothy" Gu
|
|
27
|
+
* MIT Licensed
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/*!
|
|
31
|
+
* finalhandler
|
|
32
|
+
* Copyright(c) 2014-2022 Douglas Christopher Wilson
|
|
33
|
+
* MIT Licensed
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/*!
|
|
37
|
+
* on-finished
|
|
38
|
+
* Copyright(c) 2013 Jonathan Ong
|
|
39
|
+
* Copyright(c) 2014 Douglas Christopher Wilson
|
|
40
|
+
* MIT Licensed
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
/*!
|
|
44
|
+
* parseurl
|
|
45
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
46
|
+
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|
47
|
+
* MIT Licensed
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
/*!
|
|
51
|
+
* statuses
|
|
52
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
53
|
+
* Copyright(c) 2016 Douglas Christopher Wilson
|
|
54
|
+
* MIT Licensed
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
/*! LICENSE: index.js.LICENSE.txt */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/core",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -35,47 +35,47 @@
|
|
|
35
35
|
"static"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@babel/code-frame": "7.26.2",
|
|
39
|
-
"@rspack/lite-tapable": "^1.1.5",
|
|
40
|
-
"@types/estree": "1.0.5",
|
|
41
|
-
"acorn": "^8.10.0",
|
|
42
|
-
"acorn-import-attributes": "^1.9.5",
|
|
43
|
-
"acorn-walk": "8.3.5",
|
|
44
|
-
"browserslist-load-config": "^1.0.3",
|
|
45
38
|
"caniuse-lite": "^1.0.30001810",
|
|
46
|
-
"connect-next": "4.0.3",
|
|
47
|
-
"cors": "2.8.6",
|
|
48
|
-
"envinfo": "7.21.0",
|
|
49
|
-
"fs-extra": "^11.1.1",
|
|
50
|
-
"get-port": "5.1.1",
|
|
51
|
-
"launch-editor": "^2.14.1",
|
|
52
|
-
"lines-and-columns": "2.0.4",
|
|
53
|
-
"rslog": "^2.1.3",
|
|
54
|
-
"semver": "^7.8.5",
|
|
55
39
|
"sirv": "3.0.2",
|
|
56
|
-
"source-map": "^0.
|
|
57
|
-
"
|
|
58
|
-
"@rsdoctor/shared": "2.0.0-rc.
|
|
59
|
-
"@rsdoctor/client": "2.0.0-rc.0"
|
|
40
|
+
"source-map": "^0.8.0",
|
|
41
|
+
"@rsdoctor/client": "2.0.0-rc.2",
|
|
42
|
+
"@rsdoctor/shared": "2.0.0-rc.2"
|
|
60
43
|
},
|
|
61
44
|
"devDependencies": {
|
|
62
|
-
"@
|
|
63
|
-
"@
|
|
45
|
+
"@babel/code-frame": "7.26.2",
|
|
46
|
+
"@rsbuild/plugin-check-syntax": "^2.0.1",
|
|
47
|
+
"@rspack/core": "^2.2.6",
|
|
48
|
+
"@rspack/lite-tapable": "^1.2.0",
|
|
64
49
|
"@types/babel__code-frame": "7.27.0",
|
|
65
50
|
"@types/cors": "2.8.19",
|
|
66
51
|
"@types/envinfo": "7.8.4",
|
|
52
|
+
"@types/estree": "1.0.5",
|
|
67
53
|
"@types/fs-extra": "^11.0.4",
|
|
68
54
|
"@types/node": "^24.12.3",
|
|
69
55
|
"@types/semver": "^7.8.0",
|
|
70
56
|
"@types/ws": "^8.18.1",
|
|
57
|
+
"acorn": "^8.10.0",
|
|
58
|
+
"acorn-import-attributes": "^1.9.5",
|
|
59
|
+
"acorn-walk": "8.3.5",
|
|
71
60
|
"babel-loader": "10.1.1",
|
|
72
|
-
"
|
|
61
|
+
"browserslist-load-config": "^1.0.3",
|
|
62
|
+
"connect-next": "5.0.0",
|
|
63
|
+
"cors": "2.8.6",
|
|
64
|
+
"envinfo": "7.21.0",
|
|
65
|
+
"filesize": "^11.0.24",
|
|
66
|
+
"fs-extra": "^11.1.1",
|
|
67
|
+
"get-port": "5.1.1",
|
|
73
68
|
"json-stream-stringify": "3.0.1",
|
|
74
|
-
"
|
|
75
|
-
"
|
|
69
|
+
"launch-editor": "^2.14.1",
|
|
70
|
+
"lines-and-columns": "2.0.4",
|
|
71
|
+
"open": "^11.0.4",
|
|
72
|
+
"raw-body": "4.0.0",
|
|
73
|
+
"rslog": "^2.3.0",
|
|
74
|
+
"semver": "^7.8.5",
|
|
76
75
|
"string-loader": "0.0.1",
|
|
77
76
|
"ts-loader": "^9.6.2",
|
|
78
77
|
"typescript": "^7.0.2",
|
|
78
|
+
"ws": "8.21.3",
|
|
79
79
|
"@scripts/test-helper": "0.1.1"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { SDK, Plugin } from '@rsdoctor/shared/types';
|
|
2
|
-
export type GzipOptions = {
|
|
3
|
-
enabled: false;
|
|
4
|
-
} | {
|
|
5
|
-
enabled: true;
|
|
6
|
-
level: number;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Collects module size data from bundle assets, using source maps when available
|
|
10
|
-
* and falling back to AST parsing for assets without source maps.
|
|
11
|
-
*
|
|
12
|
-
* @param moduleGraph - The module graph instance
|
|
13
|
-
* @param chunkGraph - The chunk graph instance
|
|
14
|
-
* @param bundleDir - Directory containing the bundle assets
|
|
15
|
-
* @param sourceMapSets - Map of module paths to their source code (from source maps)
|
|
16
|
-
* @param hasParseBundle - Whether to enable AST parsing fallback
|
|
17
|
-
* @param assetsWithoutSourceMap - Optional set of asset paths that don't have source maps.
|
|
18
|
-
* When provided, these assets will be parsed using AST parsing instead of source map data.
|
|
19
|
-
* This is used as a fallback mechanism when source maps are unavailable for specific assets.
|
|
20
|
-
* If not provided and no source maps exist (sourceMapSets is empty), all assets will be parsed via AST.
|
|
21
|
-
* @returns Promise that resolves when module data collection is complete
|
|
22
|
-
*/
|
|
23
|
-
export declare function getAssetsModulesData(moduleGraph: SDK.ModuleGraphInstance, chunkGraph: SDK.ChunkGraphInstance, bundleDir: string, sourceMapSets: Map<string, string>, hasParseBundle?: boolean, assetsWithoutSourceMap?: Set<string>, gzipOptions?: GzipOptions, brotli?: Plugin.NormalizedBrotliConfig): Promise<void>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Plugin, SDK } from '@rsdoctor/shared/types';
|
|
2
|
-
/**
|
|
3
|
-
* Patch native chunk graph data from Rspack into ChunkGraph instance
|
|
4
|
-
* @param cg The ChunkGraph instance to be patched
|
|
5
|
-
* @param rawChunkGraph Raw chunk graph data from Rspack native plugin
|
|
6
|
-
*/
|
|
7
|
-
export declare function patchNativeChunkGraph(cg: SDK.ChunkGraphInstance, rawChunkGraph: Plugin.RspackNativeChunkGraph): void;
|
|
8
|
-
/**
|
|
9
|
-
* Patch native assets data from Rspack into ChunkGraph instance
|
|
10
|
-
* @param cg The ChunkGraph instance to be patched
|
|
11
|
-
* @param rawAssetPatch Raw assets patch data from Rspack native plugin
|
|
12
|
-
*/
|
|
13
|
-
export declare function patchNativeAssets(cg: SDK.ChunkGraphInstance, rawAssetPatch: Plugin.RspackNativeAssetPatch): void;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const getCPUInfo: () => Promise<string>;
|
|
2
|
-
export declare const getOSInfo: () => Promise<string>;
|
|
3
|
-
export declare const getMemoryInfo: () => Promise<string>;
|
|
4
|
-
export declare const getNodeVersion: () => Promise<string>;
|
|
5
|
-
export declare const getYarnVersion: () => Promise<string>;
|
|
6
|
-
export declare const getNpmVersion: () => Promise<string>;
|
|
7
|
-
export declare const getPnpmVersion: () => Promise<string>;
|
|
8
|
-
export declare function getNpmPackageVersion(pkg: string): Promise<string>;
|
|
9
|
-
export declare function getNpmPackageVersion(pkgs: string[]): Promise<string[]>;
|
|
10
|
-
export declare function getGlobalNpmPackageVersion(pkg: string): Promise<string>;
|
|
11
|
-
export declare function getGlobalNpmPackageVersion(pkgs: string[]): Promise<string[]>;
|
|
12
|
-
export declare function getGitBranch(): Promise<string>;
|
|
13
|
-
export declare function getGitRepo(): Promise<string>;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Common } from '@rsdoctor/shared/types';
|
|
2
|
-
export declare function readFile(path: string): Promise<string>;
|
|
3
|
-
export declare function readFileSync(path: string): string;
|
|
4
|
-
export declare function readJSON<T extends Common.PlainObject>(path: string): Promise<T>;
|
|
5
|
-
export declare function readJSONSync<T extends Common.PlainObject>(path: string): T;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export declare class FileSharding {
|
|
2
|
-
protected content: string;
|
|
3
|
-
protected limitBytes: number;
|
|
4
|
-
protected encoding: BufferEncoding;
|
|
5
|
-
constructor(content: string, limitBytes?: number, encoding?: BufferEncoding);
|
|
6
|
-
/**
|
|
7
|
-
* @param ext the extension name of the output file (must starts with ".")
|
|
8
|
-
*/
|
|
9
|
-
createVirtualShardingFiles(ext?: string, index?: number): {
|
|
10
|
-
filename: string;
|
|
11
|
-
content: Buffer<ArrayBufferLike>;
|
|
12
|
-
}[];
|
|
13
|
-
/**
|
|
14
|
-
* @param folder absolute path of folder which used to save string sharding files.
|
|
15
|
-
* @param ext the extension name of the output file (must starts with ".")
|
|
16
|
-
*/
|
|
17
|
-
writeStringToFolder(folder: string, ext?: string, index?: number): Promise<{
|
|
18
|
-
filename: string;
|
|
19
|
-
content: Buffer<ArrayBufferLike>;
|
|
20
|
-
}[]>;
|
|
21
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * as File from './file/index.js';
|
|
2
|
-
export * as Json from './json.js';
|
|
3
|
-
export * as Server from './server.js';
|
|
4
|
-
export * as EnvInfo from './envinfo.js';
|
|
5
|
-
export * as Process from './process.js';
|
|
6
|
-
export * as Chunks from './chunks/index.js';
|
|
7
|
-
export * as Utils from './utils/index.js';
|
|
8
|
-
export * as Loader from './loader/index.js';
|
|
9
|
-
export * as Types from '../../types/index.js';
|
|
10
|
-
export * as ModuleGraph from './module-graph/index.js';
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { SDK } from '@rsdoctor/shared/types';
|
|
2
|
-
export declare function stringify<T, P = T extends undefined ? undefined : string>(json: T, replacer?: (this: any, key: string, value: any) => any, space?: string | number, cycle?: boolean, chunkSize?: number): Promise<P>;
|
|
3
|
-
export declare const readPackageJson: (file: string, readFile?: SDK.GetPackageFile) => SDK.PackageBasicData | undefined;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from '@rsdoctor/shared/types';
|
|
2
|
-
export interface ProbeLoaderOptions {
|
|
3
|
-
loader: string;
|
|
4
|
-
options: Record<string, any>;
|
|
5
|
-
type: 'start' | 'end';
|
|
6
|
-
builderName: string;
|
|
7
|
-
}
|
|
8
|
-
declare const loaderModule: Plugin.LoaderDefinition<ProbeLoaderOptions, object>;
|
|
9
|
-
export default loaderModule;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './rspack/transform.js';
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Plugin, SDK } from '@rsdoctor/shared/types';
|
|
2
|
-
/**
|
|
3
|
-
* Patch native module graph data from Rspack into ModuleGraph instance
|
|
4
|
-
* @param mg The ModuleGraph instance to be patched
|
|
5
|
-
* @param cg The ChunkGraph instance to be patched
|
|
6
|
-
* @param rawModuleGraph Raw module graph data from Rspack native plugin
|
|
7
|
-
*/
|
|
8
|
-
export declare function patchNativeModuleGraph(mg: SDK.ModuleGraphInstance, cg: SDK.ChunkGraphInstance, rawModuleGraph: Plugin.RspackNativeModuleGraph): void;
|
|
9
|
-
/**
|
|
10
|
-
* Patch native ids data from Rspack into ModuleGraph instance
|
|
11
|
-
* @param mg The ModuleGraph instance to be patched
|
|
12
|
-
* @param rawModuleIdsPatch Raw ids patch data from Rspack native plugin
|
|
13
|
-
*/
|
|
14
|
-
export declare function patchNativeModuleIds(mg: SDK.ModuleGraphInstance, rawModuleIdsPatch: Plugin.RspackNativeModuleIdsPatch): void;
|
|
15
|
-
/**
|
|
16
|
-
* Patch native sources data from Rspack into ModuleGraph instance
|
|
17
|
-
* @param mg The ModuleGraph instance to be patched
|
|
18
|
-
* @param rawModuleIdsPatch Raw sources patch data from Rspack native plugin
|
|
19
|
-
*/
|
|
20
|
-
export declare function patchNativeModuleSources(mg: SDK.ModuleGraphInstance, rawModuleSourcesPatch: Plugin.RspackNativeModuleSourcePatch): void;
|
|
21
|
-
/**
|
|
22
|
-
* Extract and store code snippets for side effect locations
|
|
23
|
-
* This should be called after module sources have been set
|
|
24
|
-
* @param mg The ModuleGraph instance with modules and side effect locations
|
|
25
|
-
*/
|
|
26
|
-
export declare function extractSideEffectCodes(mg: SDK.ModuleGraphInstance): void;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import http from 'http';
|
|
2
|
-
import { Thirdparty } from '@rsdoctor/shared/types';
|
|
3
|
-
export declare const defaultHost = "127.0.0.1";
|
|
4
|
-
export declare const defaultPort: number;
|
|
5
|
-
export declare function getPort(expectPort: number, host?: string): Promise<number>;
|
|
6
|
-
export declare const createGetPortSyncFunctionString: (expectPort: number, host?: string) => string;
|
|
7
|
-
export declare function getPortSync(expectPort: number, host?: string): number | never;
|
|
8
|
-
export declare function createApp(): Thirdparty.connect.Server;
|
|
9
|
-
export declare function createServer(port: number, host?: string): Promise<{
|
|
10
|
-
app: Thirdparty.connect.Server;
|
|
11
|
-
server: http.Server;
|
|
12
|
-
port: number;
|
|
13
|
-
close(): Promise<void> | never;
|
|
14
|
-
}>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Common, Plugin } from '@rsdoctor/shared/types';
|
|
2
|
-
export declare function parsePathQueryFragment(str: string): {
|
|
3
|
-
path: string;
|
|
4
|
-
query: string;
|
|
5
|
-
fragment: string;
|
|
6
|
-
};
|
|
7
|
-
export declare function loadLoaderModule(loaderPath: string, cwd?: string): {
|
|
8
|
-
default: Plugin.LoaderDefinition<Common.PlainObject, object>;
|
|
9
|
-
pitch: Plugin.PitchLoaderDefinitionFunction;
|
|
10
|
-
raw: boolean | void;
|
|
11
|
-
};
|
|
12
|
-
export declare function extractLoaderName(loaderPath: string, cwd?: string): string;
|
|
13
|
-
export declare function mapEachRules<T extends Plugin.BuildRuleSetRule>(rules: T[], callback: (rule: T) => T): T[];
|
|
14
|
-
export declare function isESMLoader(r: Plugin.BuildRuleSetRule): boolean;
|
|
15
|
-
export declare function getLoaderNameMatch(r: Plugin.BuildRuleSetRule, loaderName: string, strict?: boolean): boolean;
|
|
16
|
-
export declare function addProbeLoader2Rules<T extends Plugin.BuildRuleSetRule>(rules: T[], compiler: Plugin.BaseCompiler, fn: (r: Plugin.BuildRuleSetRule) => boolean): T[];
|
|
17
|
-
export declare function createLoaderContextTrap(this: Plugin.LoaderContext<Common.PlainObject>, final: (err: Error | null | undefined, res: string | Buffer | null, sourceMap?: Plugin.SourceMapInput) => void): Plugin.LoaderContext<Common.PlainObject<any>>;
|
|
18
|
-
export declare function parseQuery(query: string): {
|
|
19
|
-
[k: string]: string;
|
|
20
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ParseBundle } from '@rsdoctor/shared/graph';
|
|
2
|
-
/**
|
|
3
|
-
* The following code is based on
|
|
4
|
-
* https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/44bd8d0f9aa3b098e271af220096ea70cc44bc9e/src/parseUtils.js#L10
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* MIT Licensed
|
|
8
|
-
* Author th0r
|
|
9
|
-
* Copyright JS Foundation and other contributors.
|
|
10
|
-
* https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/44bd8d0f9aa3b098e271af220096ea70cc44bc9e/LICENSE
|
|
11
|
-
*/
|
|
12
|
-
export declare const parseBundle: ParseBundle;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from '@rsdoctor/shared/types';
|
|
2
|
-
export type IHook = Plugin.BaseCompiler['hooks'][keyof Plugin.BaseCompiler['hooks']];
|
|
3
|
-
export declare function shouldInterceptPluginHook<T extends IHook>(hook: T): boolean;
|
|
4
|
-
export declare function interceptCompilerHooks(compiler: Plugin.BaseCompiler, interceptor: (name: string, hook: IHook, scope: 'compiler') => void): void;
|
|
5
|
-
export declare function interceptCompilationHooks(compilation: Plugin.BaseCompilation, interceptor: (name: string, hook: IHook, scope: 'compilation') => void): void;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * as Build from './build/index.js';
|
|
2
|
-
export * as EnvInfo from './build/envinfo.js';
|
|
3
|
-
export * as File from './build/file/index.js';
|
|
4
|
-
export * as Json from './build/json.js';
|
|
5
|
-
export * as Process from './build/process.js';
|
|
6
|
-
export * as Server from './build/server.js';
|
|
7
|
-
export * as Chunks from './build/chunks/index.js';
|
|
8
|
-
export * as Utils from './build/utils/index.js';
|
|
9
|
-
export * as Loader from './build/loader/index.js';
|
|
10
|
-
export * as Types from '../types/index.js';
|
|
11
|
-
export * as ModuleGraph from './build/module-graph/index.js';
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description Writes the builder port information to mcp.json.
|
|
3
|
-
*
|
|
4
|
-
* The mcp.json file uses the following format:
|
|
5
|
-
* {
|
|
6
|
-
* portList: {
|
|
7
|
-
* builder1: portNumber,
|
|
8
|
-
* builder2: portNumber,
|
|
9
|
-
* },
|
|
10
|
-
* port: portNumber, // The port of the last builder is used by default
|
|
11
|
-
* }
|
|
12
|
-
*
|
|
13
|
-
* @param {number} port - The port number to write.
|
|
14
|
-
* @param {string} [builderName] - The name of the builder.
|
|
15
|
-
*/
|
|
16
|
-
export declare function writeMcpPort(port: number, builderName?: string): void;
|
|
17
|
-
/**
|
|
18
|
-
* @description Gets the path to the mcp.json file.
|
|
19
|
-
* @returns {string} The path to the mcp.json file.
|
|
20
|
-
*/
|
|
21
|
-
export declare function getMcpConfigPath(): string;
|
package/dist/compat.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { Config, Linter, Plugin } from '@rsdoctor/shared/types';
|
|
2
|
-
type LegacyBriefConfig = Config.BriefConfig & {
|
|
3
|
-
writeDataJson?: boolean;
|
|
4
|
-
};
|
|
5
|
-
/** Options accepted by framework integrations migrating from Rsdoctor 1.x. */
|
|
6
|
-
export type CompatibleRsdoctorOptions<Rules extends Linter.ExtendRuleData[] = []> = Omit<Plugin.RsdoctorRspackPluginOptions<Rules>, 'output' | 'supports'> & {
|
|
7
|
-
mode?: 'normal' | 'brief' | 'lite';
|
|
8
|
-
port?: number;
|
|
9
|
-
brief?: LegacyBriefConfig;
|
|
10
|
-
experiments?: {
|
|
11
|
-
enableNativePlugin?: boolean | {
|
|
12
|
-
moduleGraph?: boolean;
|
|
13
|
-
chunkGraph?: boolean;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
supports?: Plugin.RsdoctorRspackPluginOptions<Rules>['supports'] & {
|
|
17
|
-
generateTileGraph?: boolean;
|
|
18
|
-
};
|
|
19
|
-
output?: {
|
|
20
|
-
mode?: 'normal' | 'brief';
|
|
21
|
-
reportDir?: string;
|
|
22
|
-
reportCodeType?: Config.NewReportCodeType | Partial<Record<Config.NewReportCodeType, boolean>>;
|
|
23
|
-
compressData?: boolean;
|
|
24
|
-
options?: Omit<Config.BriefModeOptions, 'htmlOptions'> & {
|
|
25
|
-
htmlOptions?: LegacyBriefConfig;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Translate legacy options before constructing the plugin. Explicit current
|
|
31
|
-
* options take precedence. The input is never mutated; only legacy fields log.
|
|
32
|
-
*/
|
|
33
|
-
export declare function migrateRsdoctorOptions<Rules extends Linter.ExtendRuleData[] = []>(config?: CompatibleRsdoctorOptions<Rules>): Plugin.RsdoctorRspackPluginOptions<Rules>;
|
|
34
|
-
export {};
|
package/dist/error/error.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Err, Rule } from '@rsdoctor/shared/types';
|
|
2
|
-
export declare class DevToolError extends Error implements Err.DevToolErrorInstance {
|
|
3
|
-
static from(err: unknown, opt?: Err.DevToolErrorParams): DevToolError;
|
|
4
|
-
readonly id: number;
|
|
5
|
-
readonly code?: string;
|
|
6
|
-
readonly category?: string;
|
|
7
|
-
readonly title: string;
|
|
8
|
-
readonly detail?: any;
|
|
9
|
-
readonly fixData?: Err.FixData;
|
|
10
|
-
readonly hint?: string;
|
|
11
|
-
readonly referenceUrl?: string;
|
|
12
|
-
private _codeFrame?;
|
|
13
|
-
private _controller;
|
|
14
|
-
private readonly _level;
|
|
15
|
-
constructor(title: string, message: string, opts?: Err.DevToolErrorParams);
|
|
16
|
-
get level(): keyof typeof Err.ErrorLevel;
|
|
17
|
-
get path(): string | undefined;
|
|
18
|
-
set path(file: string | undefined);
|
|
19
|
-
get codeFrame(): Err.CodeFrameOption | undefined;
|
|
20
|
-
private printCodeFrame;
|
|
21
|
-
toString(): string;
|
|
22
|
-
toData(): Rule.RuleStoreDataItem;
|
|
23
|
-
toError(): Error;
|
|
24
|
-
/**
|
|
25
|
-
* for json stringify
|
|
26
|
-
*/
|
|
27
|
-
toJSON(): {
|
|
28
|
-
message: string;
|
|
29
|
-
name: string;
|
|
30
|
-
stack: string | undefined;
|
|
31
|
-
};
|
|
32
|
-
setControllerOption(opt: Err.ControllerOption): void;
|
|
33
|
-
setCodeFrame(opt: Err.CodeFrameOption): void;
|
|
34
|
-
isSame(error: Err.DevToolErrorInstance): boolean;
|
|
35
|
-
}
|
package/dist/error/index.d.ts
DELETED
package/dist/error/utils.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { Err, Logger } from '@rsdoctor/shared/types';
|
|
2
|
-
export declare function toLevel(level: keyof typeof Err.ErrorLevel): Err.ErrorLevel;
|
|
3
|
-
export declare function insertSpace(rawLines: string, line: number, width: number): string;
|
|
4
|
-
export declare function printErrors({ errors, warnings }: Err.DevToolErrorsData, logLevel?: Logger.LogLevelName): string;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Tap } from '@rspack/lite-tapable';
|
|
2
|
-
export declare const pluginTapName = "RsdoctorRspackPlugin";
|
|
3
|
-
export declare const pluginTapPostOptions: Tap;
|
|
4
|
-
export declare const pluginTapPreOptions: Tap;
|
|
5
|
-
export declare const internalPluginTapPreOptions: (namespace: string) => Tap;
|
|
6
|
-
export declare const internalPluginTapPostOptions: (namespace: string) => Tap;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Plugin as PluginType } from '@rsdoctor/shared/types';
|
|
2
|
-
import { Plugin } from '@rsdoctor/shared/types';
|
|
3
|
-
import type { ProxyLoaderOptions } from '../../types/index.js';
|
|
4
|
-
declare const loaderModule: Plugin.LoaderDefinition<ProxyLoaderOptions, object>;
|
|
5
|
-
export declare const pitch: (this: PluginType.LoaderContext<ProxyLoaderOptions>) => void | string | Buffer<ArrayBufferLike> | Promise<string | Buffer<ArrayBufferLike>>;
|
|
6
|
-
export declare const raw = true;
|
|
7
|
-
export default loaderModule;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Linter, Plugin, SDK } from '@rsdoctor/shared/types';
|
|
2
|
-
import type { InternalPlugin, RsdoctorPluginInstance } from '../../types/index.js';
|
|
3
|
-
export declare abstract class InternalBasePlugin<T extends Plugin.BaseCompiler> implements InternalPlugin<T, Linter.ExtendRuleData[]> {
|
|
4
|
-
readonly scheduler: RsdoctorPluginInstance<T, Linter.ExtendRuleData[]>;
|
|
5
|
-
abstract name: string;
|
|
6
|
-
constructor(scheduler: RsdoctorPluginInstance<T, Linter.ExtendRuleData[]>);
|
|
7
|
-
abstract apply(compiler: T): void;
|
|
8
|
-
get options(): Plugin.RsdoctorPluginOptionsNormalized<Linter.ExtendRuleData<any, string>[]>;
|
|
9
|
-
get sdk(): SDK.RsdoctorBuilderSDKInstance;
|
|
10
|
-
get tapPostOptions(): import("@rspack/lite-tapable").Tap;
|
|
11
|
-
get tapPreOptions(): import("@rspack/lite-tapable").Tap;
|
|
12
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Plugin } from '@rsdoctor/shared/types';
|
|
2
|
-
import { InternalBasePlugin } from './base.js';
|
|
3
|
-
export declare class InternalBundlePlugin<T extends Plugin.BaseCompiler> extends InternalBasePlugin<T> {
|
|
4
|
-
readonly name = "bundle";
|
|
5
|
-
map: Map<string, {
|
|
6
|
-
content: string | Buffer;
|
|
7
|
-
}>;
|
|
8
|
-
apply(compiler: T): void;
|
|
9
|
-
changeDevtoolModuleFilename(compiler: Plugin.BaseCompiler): void;
|
|
10
|
-
ensureAssetContent(name: string): {
|
|
11
|
-
content: string | Buffer;
|
|
12
|
-
};
|
|
13
|
-
thisCompilation: (compilation: Plugin.BaseCompilation) => void;
|
|
14
|
-
done: (compiler: T) => Promise<void>;
|
|
15
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { RsdoctorPluginInstance } from '../../types/index.js';
|
|
2
|
-
import { Linter, Plugin } from '@rsdoctor/shared/types';
|
|
3
|
-
/**
|
|
4
|
-
* Represents a mapping item from a source map.
|
|
5
|
-
*/
|
|
6
|
-
export interface MappingItem {
|
|
7
|
-
source: string | null;
|
|
8
|
-
generatedLine: number;
|
|
9
|
-
generatedColumn: number;
|
|
10
|
-
originalLine: number | null;
|
|
11
|
-
originalColumn: number | null;
|
|
12
|
-
name: string | null;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Main function to generate ModuleGraph and ChunkGraph from Rspack native data
|
|
16
|
-
* and collect source maps.
|
|
17
|
-
*/
|
|
18
|
-
export declare const ensureModulesChunksGraphFn: (compiler: Plugin.BaseCompiler, _this: RsdoctorPluginInstance<Plugin.BaseCompiler, Linter.ExtendRuleData[]>) => void;
|
|
19
|
-
/**
|
|
20
|
-
* Checks if source map processing is enabled and supported by the current compiler configuration.
|
|
21
|
-
* Warns if eval-based source maps are used (unsupported).
|
|
22
|
-
* @param compiler - The Rspack compiler instance.
|
|
23
|
-
* @returns true if source maps are enabled and supported, false otherwise.
|
|
24
|
-
*/
|
|
25
|
-
export declare const ensureDevtools: (compiler: Plugin.BaseCompiler) => boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Calculates namespace and source map filename regex for source map resolution.
|
|
28
|
-
* @param compiler - The Rspack compiler instance.
|
|
29
|
-
* @returns An object containing namespace and sourceMapFilenameRegex.
|
|
30
|
-
*/
|
|
31
|
-
export declare function calculateNamespaceAndRegex(compiler: Plugin.BaseCompiler): {
|
|
32
|
-
namespace: string;
|
|
33
|
-
sourceMapFilenameRegex: RegExp;
|
|
34
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Rule, Err, Plugin } from '@rsdoctor/shared/types';
|
|
2
|
-
import { InternalBasePlugin } from './base.js';
|
|
3
|
-
import { DevToolError } from '../../error/index.js';
|
|
4
|
-
export declare class InternalErrorReporterPlugin<T extends Plugin.BaseCompiler> extends InternalBasePlugin<T> {
|
|
5
|
-
readonly name = "error-reporter";
|
|
6
|
-
apply(compiler: T): void;
|
|
7
|
-
done: (stats: Plugin.BaseStats) => Promise<void>;
|
|
8
|
-
afterCompile: (compilation: Plugin.BaseCompilation) => Promise<void>;
|
|
9
|
-
handleBundlerError(err: Plugin.BuildError, category: Rule.RuleMessageCategory, level: keyof typeof Err.ErrorLevel): DevToolError;
|
|
10
|
-
reportWarnings(warnings: Plugin.BuildError[]): Promise<void>;
|
|
11
|
-
reportErrors(errors: Plugin.BuildWarning[]): Promise<void>;
|
|
12
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from './loader.js';
|
|
2
|
-
export * from './plugins.js';
|
|
3
|
-
export * from './errors.js';
|
|
4
|
-
export * from './progress.js';
|
|
5
|
-
export * from './summary.js';
|
|
6
|
-
export * from './base.js';
|
|
7
|
-
export * from './bundle.js';
|
|
8
|
-
export * from './ensureModulesChunkGraph.js';
|
|
9
|
-
export * from './rules.js';
|
|
10
|
-
export * from './resolver.js';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Plugin } from '@rsdoctor/shared/types';
|
|
2
|
-
import { InternalBasePlugin } from './base.js';
|
|
3
|
-
export declare class InternalLoaderPlugin<T extends Plugin.BaseCompiler> extends InternalBasePlugin<T> {
|
|
4
|
-
readonly name = "loader";
|
|
5
|
-
private cacheMarkerPath?;
|
|
6
|
-
readonly internalLoaderPath: string;
|
|
7
|
-
apply(compiler: T): void;
|
|
8
|
-
afterPlugins: (compiler: T) => void;
|
|
9
|
-
compilation(compiler: T, compilation: Plugin.BaseCompilation): void;
|
|
10
|
-
getInterceptRules(compiler: T, rules: Plugin.BuildRuleSetRules): Plugin.BuildRuleSetRule[];
|
|
11
|
-
private getCacheMarkerPath;
|
|
12
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Plugin } from '@rsdoctor/shared/types';
|
|
2
|
-
import { InternalBasePlugin } from './base.js';
|
|
3
|
-
export declare class InternalPluginsPlugin<T extends Plugin.BaseCompiler> extends InternalBasePlugin<T> {
|
|
4
|
-
readonly name = "plugins";
|
|
5
|
-
apply(compiler: Plugin.BaseCompiler): void;
|
|
6
|
-
afterPlugins: (compiler: Plugin.BaseCompiler) => void;
|
|
7
|
-
compilation: (compiler: Plugin.BaseCompiler, compilation: Plugin.BaseCompilation) => void;
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SDK } from '@rsdoctor/shared/types';
|
|
2
|
-
import type { Plugin } from '@rsdoctor/shared/types';
|
|
3
|
-
import { InternalBasePlugin } from './base.js';
|
|
4
|
-
export declare class InternalProgressPlugin<T extends Plugin.BaseCompilerType<'rspack'>> extends InternalBasePlugin<T> {
|
|
5
|
-
readonly name = "progress";
|
|
6
|
-
protected currentProgress: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.APIExtends.GetCompileProgress>;
|
|
7
|
-
apply(compiler: T): void;
|
|
8
|
-
}
|