@rsdoctor/core 2.0.0-beta.1 → 2.0.0-beta.3
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/26.js +21 -13
- package/dist/build-utils/build/chunks/assetsModules.d.ts +2 -2
- package/dist/compat.d.ts +34 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +55 -3
- package/dist/inner-plugins/plugins/bundle.d.ts +2 -2
- package/dist/inner-plugins/utils/config.d.ts +1 -1
- package/package.json +4 -5
- package/dist/build-utils/build/module-graph/parser.d.ts +0 -2
- package/dist/build-utils/build/module-graph/utils.d.ts +0 -3
- package/dist/common/file.d.ts +0 -2
- package/dist/rules/rules/ecma-version-check/utils.d.ts +0 -2
package/dist/26.js
CHANGED
|
@@ -23641,11 +23641,13 @@ async function createServer(port, host = defaultHost) {
|
|
|
23641
23641
|
let helpers = envinfo.helpers;
|
|
23642
23642
|
envinfo.run;
|
|
23643
23643
|
let getCPUInfo = ()=>helpers.getCPUInfo().then((res)=>res[1]), getMemoryInfo = ()=>helpers.getMemoryInfo().then((res)=>res[1]), getNodeVersion = ()=>helpers.getNodeInfo().then((res)=>res[1]), getYarnVersion = ()=>helpers.getYarnInfo().then((res)=>res[1]), getNpmVersion = ()=>helpers.getnpmInfo().then((res)=>res[1]), getPnpmVersion = ()=>helpers.getpnpmInfo().then((res)=>res[1]);
|
|
23644
|
-
async function getAssetsModulesData(moduleGraph, chunkGraph, bundleDir, sourceMapSets, hasParseBundle = !0, assetsWithoutSourceMap, gzipOptions) {
|
|
23644
|
+
async function getAssetsModulesData(moduleGraph, chunkGraph, bundleDir, sourceMapSets, hasParseBundle = !0, assetsWithoutSourceMap, gzipOptions, brotli = !1) {
|
|
23645
23645
|
return Chunks.getAssetsModulesData(moduleGraph, chunkGraph, bundleDir, {
|
|
23646
23646
|
...hasParseBundle ? {
|
|
23647
23647
|
parseBundle: parseBundle_parseBundle
|
|
23648
23648
|
} : {},
|
|
23649
|
+
brotli: !1 !== brotli,
|
|
23650
|
+
brotliLevel: !1 === brotli ? void 0 : brotli.brotliLevel,
|
|
23649
23651
|
gzip: gzipOptions?.enabled,
|
|
23650
23652
|
gzipLevel: gzipOptions?.enabled ? gzipOptions.level : void 0
|
|
23651
23653
|
}, sourceMapSets, assetsWithoutSourceMap);
|
|
@@ -24043,8 +24045,8 @@ function isCompilerWatching(compiler) {
|
|
|
24043
24045
|
return !!(compiler.watchMode || compiler.parentCompilation?.compiler.watchMode);
|
|
24044
24046
|
}
|
|
24045
24047
|
let normalizeRspackUserOptions = function(config = {}) {
|
|
24046
|
-
var mode, mode1, finalMode, value, value1;
|
|
24047
|
-
let finalBrief, finalNormalOptions, gzipLevel, reportCodeType, mode2;
|
|
24048
|
+
var mode, mode1, finalMode, value, value1, value2, value3;
|
|
24049
|
+
let finalBrief, finalNormalOptions, gzipLevel, brotliLevel, reportCodeType, mode2;
|
|
24048
24050
|
for (let { name, value, replacement } of [
|
|
24049
24051
|
{
|
|
24050
24052
|
name: "top-level 'mode'",
|
|
@@ -24090,6 +24092,9 @@ let normalizeRspackUserOptions = function(config = {}) {
|
|
|
24090
24092
|
parseBundle: defaultBoolean(userSupports.parseBundle, !0),
|
|
24091
24093
|
gzip: (assert(void 0 === (value = userSupports.gzip) || 'boolean' == typeof value || 'object' == typeof value && null !== value && !Array.isArray(value), '`supports.gzip` must be a boolean or an object.'), !1 !== value && {
|
|
24092
24094
|
gzipLevel: (assert('number' == typeof (gzipLevel = void 0 === (value1 = 'object' == typeof value && null !== value ? value.gzipLevel : void 0) ? 6 : value1) && Number.isInteger(gzipLevel) && gzipLevel >= 0 && gzipLevel <= 9, '`supports.gzip.gzipLevel` must be an integer between 0 and 9.'), gzipLevel)
|
|
24095
|
+
}),
|
|
24096
|
+
brotli: (assert(void 0 === (value2 = userSupports.brotli) || 'boolean' == typeof value2 || 'object' == typeof value2 && null !== value2 && !Array.isArray(value2), '`supports.brotli` must be a boolean or an object.'), !1 !== value2 && void 0 !== value2 && {
|
|
24097
|
+
brotliLevel: (assert('number' == typeof (brotliLevel = void 0 === (value3 = 'object' == typeof value2 && null !== value2 ? value2.brotliLevel : void 0) ? 6 : value3) && Number.isInteger(brotliLevel) && brotliLevel >= 0 && brotliLevel <= 11, '`supports.brotli.brotliLevel` must be an integer between 0 and 11.'), brotliLevel)
|
|
24093
24098
|
})
|
|
24094
24099
|
}, disableClientServer = 'true' !== process.env.RSTEST && (!!process.env.CI || userDisableClientServer);
|
|
24095
24100
|
assert('object' == typeof linter), assert('object' == typeof features || Array.isArray(features)), assert('object' == typeof loaderInterceptorOptions), assert('boolean' == typeof disableClientServer), assert('object' == typeof userServer && null !== userServer);
|
|
@@ -24612,7 +24617,7 @@ class InternalBundlePlugin extends InternalBasePlugin {
|
|
|
24612
24617
|
try {
|
|
24613
24618
|
compilation.hooks.processAssets && compilation.hooks.afterProcessAssets.tap(this.tapPostOptions, (assets)=>{
|
|
24614
24619
|
Object.keys(assets).forEach((file)=>{
|
|
24615
|
-
this.ensureAssetContent(file).content = assets[file].source()
|
|
24620
|
+
this.ensureAssetContent(file).content = assets[file].source();
|
|
24616
24621
|
});
|
|
24617
24622
|
});
|
|
24618
24623
|
} finally{
|
|
@@ -24621,10 +24626,12 @@ class InternalBundlePlugin extends InternalBasePlugin {
|
|
|
24621
24626
|
}, this.done = async (compiler)=>{
|
|
24622
24627
|
logger_time('InternalBundlePlugin.done');
|
|
24623
24628
|
try {
|
|
24624
|
-
var
|
|
24625
|
-
this.scheduler.chunkGraph && Chunks.assetsContents(this.map, this.scheduler.chunkGraph, (
|
|
24629
|
+
var compression, compression1;
|
|
24630
|
+
this.scheduler.chunkGraph && Chunks.assetsContents(this.map, this.scheduler.chunkGraph, (compression = this.scheduler.options.supports.gzip, !isCompilerWatching(compiler) && compression), (compression1 = this.scheduler.options.supports.brotli, !isCompilerWatching(compiler) && compression1)), this.sdk.addClientRoutes([
|
|
24626
24631
|
Manifest.RsdoctorManifestClientRoutes.ModuleGraph,
|
|
24627
24632
|
Manifest.RsdoctorManifestClientRoutes.BundleSize
|
|
24633
|
+
]), this.options.features.treeShaking && 'brief' !== this.options.output.mode && this.sdk.addClientRoutes([
|
|
24634
|
+
Manifest.RsdoctorManifestClientRoutes.TreeShaking
|
|
24628
24635
|
]);
|
|
24629
24636
|
} finally{
|
|
24630
24637
|
logger_timeEnd('InternalBundlePlugin.done');
|
|
@@ -24965,24 +24972,24 @@ let hasConsole = !1, ensureModulesChunksGraphFn = (compiler, _this)=>{
|
|
|
24965
24972
|
});
|
|
24966
24973
|
};
|
|
24967
24974
|
async function doneHandler(_this, compiler, nativeGraphState) {
|
|
24968
|
-
var
|
|
24975
|
+
var compression, compression1;
|
|
24969
24976
|
if (!nativeGraphState.chunkGraph || !_this.chunkGraph) throw Error('[RsdoctorRspackPlugin] The Rspack native plugin did not provide chunk graph data.');
|
|
24970
24977
|
if (!nativeGraphState.moduleGraph) throw Error('[RsdoctorRspackPlugin] The Rspack native plugin did not provide module graph data.');
|
|
24971
|
-
let shouldParseBundle = !1 !== _this.options.supports.parseBundle,
|
|
24972
|
-
await getModulesInfos(compiler, _this.modulesGraph, _this.chunkGraph, shouldParseBundle, _this.sourceMapSets, _this.assetsWithoutSourceMap, !1 ===
|
|
24978
|
+
let shouldParseBundle = !1 !== _this.options.supports.parseBundle, gzip = (compression = _this.options.supports.gzip, !isCompilerWatching(compiler) && compression);
|
|
24979
|
+
await getModulesInfos(compiler, _this.modulesGraph, _this.chunkGraph, shouldParseBundle, _this.sourceMapSets, _this.assetsWithoutSourceMap, !1 === gzip ? {
|
|
24973
24980
|
enabled: !1
|
|
24974
24981
|
} : {
|
|
24975
24982
|
enabled: !0,
|
|
24976
|
-
level:
|
|
24977
|
-
}), rsdoctorLogger.debug('reportModuleGraph start'), await _this.sdk.reportModuleGraph(_this.modulesGraph), rsdoctorLogger.debug('reportModuleGraph done'), rsdoctorLogger.debug('reportChunkGraph start'), await _this.sdk.reportChunkGraph(_this.chunkGraph), rsdoctorLogger.debug('reportChunkGraph done'), rsdoctorLogger.debug('doneHandler done');
|
|
24983
|
+
level: gzip.gzipLevel
|
|
24984
|
+
}, (compression1 = _this.options.supports.brotli, !isCompilerWatching(compiler) && compression1)), rsdoctorLogger.debug('reportModuleGraph start'), await _this.sdk.reportModuleGraph(_this.modulesGraph), rsdoctorLogger.debug('reportModuleGraph done'), rsdoctorLogger.debug('reportChunkGraph start'), await _this.sdk.reportChunkGraph(_this.chunkGraph), rsdoctorLogger.debug('reportChunkGraph done'), rsdoctorLogger.debug('doneHandler done');
|
|
24978
24985
|
}
|
|
24979
24986
|
let ensureDevtools = (compiler)=>{
|
|
24980
24987
|
let devtool = compiler.options.devtool;
|
|
24981
24988
|
return !('string' == typeof devtool && /eval/i.test(devtool)) || (hasConsole || rsdoctorLogger.warn('SourceMap with eval is not supported. Please use other sourcemap options.'), hasConsole = !0, !1);
|
|
24982
24989
|
};
|
|
24983
|
-
async function getModulesInfos(compiler, moduleGraph, chunkGraph, parseBundle, sourceMapSets, assetsWithoutSourceMap, gzipOptions) {
|
|
24990
|
+
async function getModulesInfos(compiler, moduleGraph, chunkGraph, parseBundle, sourceMapSets, assetsWithoutSourceMap, gzipOptions, brotli = !1) {
|
|
24984
24991
|
if (moduleGraph) try {
|
|
24985
|
-
await getAssetsModulesData(moduleGraph, chunkGraph, compiler.outputPath, sourceMapSets, parseBundle, assetsWithoutSourceMap, gzipOptions);
|
|
24992
|
+
await getAssetsModulesData(moduleGraph, chunkGraph, compiler.outputPath, sourceMapSets, parseBundle, assetsWithoutSourceMap, gzipOptions, brotli);
|
|
24986
24993
|
} catch {}
|
|
24987
24994
|
}
|
|
24988
24995
|
function toSeverity(input, defaultLevel) {
|
|
@@ -25721,6 +25728,7 @@ let ecma_version_check_rule = defineRule(()=>({
|
|
|
25721
25728
|
},
|
|
25722
25729
|
async check ({ chunkGraph, report, ruleConfig, root, configs }) {
|
|
25723
25730
|
let assets = chunkGraph.getAssets().filter((asset)=>{
|
|
25731
|
+
if (asset.path.endsWith('.lynx.bundle')) return !1;
|
|
25724
25732
|
let extension = path_0.extname(asset.path);
|
|
25725
25733
|
return '.js' === extension || '.bundle' === extension;
|
|
25726
25734
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SDK } from '@rsdoctor/shared/types';
|
|
1
|
+
import { SDK, Plugin } from '@rsdoctor/shared/types';
|
|
2
2
|
export type GzipOptions = {
|
|
3
3
|
enabled: false;
|
|
4
4
|
} | {
|
|
@@ -20,4 +20,4 @@ export type GzipOptions = {
|
|
|
20
20
|
* If not provided and no source maps exist (sourceMapSets is empty), all assets will be parsed via AST.
|
|
21
21
|
* @returns Promise that resolves when module data collection is complete
|
|
22
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): Promise<void>;
|
|
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>;
|
package/dist/compat.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
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/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { logger } from './logger.js';
|
|
2
|
+
export { migrateRsdoctorOptions } from './compat.js';
|
|
3
|
+
export type { CompatibleRsdoctorOptions } from './compat.js';
|
|
2
4
|
export { RsdoctorRspackPlugin } from './rspack-plugin/index.js';
|
|
3
5
|
export { Linter, LinterType, Rule as LinterRule, defineRule, rules, } from './rules/index.js';
|
|
4
6
|
export { RsdoctorSDK, resolveClientDiffHtmlPath } from './sdk/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import "node:module";
|
|
2
2
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
3
|
+
import { Algorithm, Bundle, Data, Loader, Lodash, decycle } from "@rsdoctor/shared/common-browser";
|
|
4
|
+
import node_assert from "node:assert";
|
|
3
5
|
import node_fs from "node:fs";
|
|
4
6
|
import fs_extra from "fs-extra";
|
|
5
7
|
import path_0 from "path";
|
|
@@ -8,7 +10,6 @@ import { Client, Constants, Manifest, SDK } from "@rsdoctor/shared/types";
|
|
|
8
10
|
import { SourceMapConsumer } from "source-map";
|
|
9
11
|
import { ChunkGraph, ModuleGraph, PackageGraph } from "@rsdoctor/shared/graph";
|
|
10
12
|
import sirv from "sirv";
|
|
11
|
-
import { Algorithm, Bundle, Data, Loader, Lodash, decycle } from "@rsdoctor/shared/common-browser";
|
|
12
13
|
import fs from "fs";
|
|
13
14
|
import os_0 from "os";
|
|
14
15
|
import assert from "assert";
|
|
@@ -31,6 +32,57 @@ import { setSDK, logger as rsdoctorLogger, logger_time, timeEnd, color, stringif
|
|
|
31
32
|
import { InternalResolverPlugin, getYarnVersion, InternalPluginsPlugin, getRspackNativePlugin, InternalSummaryPlugin, ensureModulesChunksGraphFn, getNpmVersion, InternalBundlePlugin, isCompilerWatching, getNodeVersion, fs_extra as external_fs_extra_fs_extra, handleBriefModeReport, processCompilerConfig, InternalLoaderPlugin, normalizeRspackUserOptions, defaultPort, getCPUInfo, getPnpmVersion, createServer, getMemoryInfo, InternalErrorReporterPlugin, defaultHost, ProbeLoaderPlugin, getPortSync, InternalRulesPlugin, DevToolError } from "./26.js";
|
|
32
33
|
import { fileURLToPath as __rspack_fileURLToPath } from "node:url";
|
|
33
34
|
var date, __rspack_import_meta_dirname__ = __rspack_dirname(__rspack_fileURLToPath(import.meta.url)), apis_namespaceObject = {};
|
|
35
|
+
function migrateRsdoctorOptions(config = {}) {
|
|
36
|
+
let { mode, port, brief, output, supports, experiments, ...rest } = config, migrations = [], migrate = (value, from, to)=>{
|
|
37
|
+
void 0 !== value && migrations.push(`${from} → ${to}`);
|
|
38
|
+
}, result = {
|
|
39
|
+
...rest
|
|
40
|
+
};
|
|
41
|
+
if (migrate(experiments?.enableNativePlugin, 'experiments.enableNativePlugin', 'remove (the native plugin is always enabled)'), migrate(port, 'port', 'server.port'), void 0 !== port && (result.server = {
|
|
42
|
+
...config.server,
|
|
43
|
+
port: config.server?.port ?? port
|
|
44
|
+
}), supports) {
|
|
45
|
+
let { generateTileGraph, ...currentSupports } = supports;
|
|
46
|
+
migrate(generateTileGraph, 'supports.generateTileGraph', 'remove (treemap is always supported)'), result.supports = currentSupports;
|
|
47
|
+
}
|
|
48
|
+
if (migrate(mode, 'mode', 'lite' === mode ? 'output.reportCodeType' : 'output.mode'), migrate(brief, 'brief', 'output.options.htmlOptions'), migrate(output?.compressData, 'output.compressData', "output.mode: 'brief', output.options.type: ['json']"), migrate(brief?.writeDataJson, 'brief.writeDataJson', "output.options.type: ['html', 'json']"), migrate(output?.options?.htmlOptions?.writeDataJson, 'output.options.htmlOptions.writeDataJson', "output.options.type: ['html', 'json']"), output || void 0 !== mode) {
|
|
49
|
+
let codeType, { compressData, reportCodeType, options, ...currentOutput } = output ?? {};
|
|
50
|
+
null != reportCodeType && 'object' == typeof reportCodeType ? (node_assert(Lodash.isPlainObject(reportCodeType), '`output.reportCodeType` must be a string or a plain object of legacy flags.'), codeType = [
|
|
51
|
+
'noCode',
|
|
52
|
+
'noAssetsAndModuleSource',
|
|
53
|
+
'noModuleSource'
|
|
54
|
+
].find((key)=>reportCodeType[key]), migrate(reportCodeType, 'output.reportCodeType (object)', 'output.reportCodeType (string)')) : codeType = reportCodeType ?? void 0;
|
|
55
|
+
let outputMode = output?.mode ?? (!0 === compressData ? 'brief' : 'lite' === mode ? 'normal' : mode);
|
|
56
|
+
if ('lite' === mode && output?.mode === void 0 && (codeType ??= 'noAssetsAndModuleSource'), 'brief' === outputMode) {
|
|
57
|
+
let { writeDataJson, ...htmlOptions } = options?.htmlOptions ?? {}, reportHtmlName = htmlOptions.reportHtmlName ?? brief?.reportHtmlName;
|
|
58
|
+
result.output = {
|
|
59
|
+
...currentOutput,
|
|
60
|
+
mode: 'brief',
|
|
61
|
+
reportCodeType: void 0 === codeType ? void 0 : 'noCode',
|
|
62
|
+
options: {
|
|
63
|
+
...options,
|
|
64
|
+
type: options?.type ?? (writeDataJson ?? brief?.writeDataJson ? [
|
|
65
|
+
'html',
|
|
66
|
+
'json'
|
|
67
|
+
] : !0 === compressData ? [
|
|
68
|
+
'json'
|
|
69
|
+
] : [
|
|
70
|
+
'html'
|
|
71
|
+
]),
|
|
72
|
+
htmlOptions: {
|
|
73
|
+
...htmlOptions,
|
|
74
|
+
reportHtmlName
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
} else result.output = {
|
|
79
|
+
...currentOutput,
|
|
80
|
+
mode: outputMode,
|
|
81
|
+
reportCodeType: codeType
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
return migrations.length && rsdoctorLogger.warn(`Legacy Rsdoctor options detected. The compatibility layer applied the available migrations; explicit current options take precedence. Please migrate your configuration: ${migrations.join('; ')}.`), result;
|
|
85
|
+
}
|
|
34
86
|
__webpack_require__.r(apis_namespaceObject), __webpack_require__.d(apis_namespaceObject, {
|
|
35
87
|
AlertsAPI: ()=>AlertsAPI,
|
|
36
88
|
BundleDiffAPI: ()=>BundleDiffAPI,
|
|
@@ -1697,7 +1749,7 @@ class RsdoctorSDKController {
|
|
|
1697
1749
|
return this.slaves.filter((item)=>this.activeSlaves.has(item));
|
|
1698
1750
|
}
|
|
1699
1751
|
}
|
|
1700
|
-
var package_namespaceObject = JSON.parse('{"name":"@rsdoctor/core","version":"2.0.0-beta.
|
|
1752
|
+
var package_namespaceObject = JSON.parse('{"name":"@rsdoctor/core","version":"2.0.0-beta.3","repository":{"type":"git","url":"https://github.com/web-infra-dev/rsdoctor","directory":"packages/core"},"license":"MIT","type":"module","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./proxy-loader":{"types":"./dist/proxy-loader.d.ts","default":"./dist/proxy-loader.js"}},"main":"dist/index.js","types":"dist/index.d.ts","typesVersions":{"*":{".":["./dist/index.d.ts"],"proxy-loader":["./dist/proxy-loader.d.ts"]}},"files":["dist","static"],"scripts":{"build":"rs lib","dev":"npm run start","start":"rs lib -w","test":"rs test"},"dependencies":{"@babel/code-frame":"7.26.2","@rsdoctor/client":"workspace:*","@rsdoctor/shared":"workspace:*","@rspack/lite-tapable":"catalog:","@types/estree":"catalog:","acorn":"^8.10.0","acorn-import-attributes":"^1.9.5","acorn-walk":"8.3.5","browserslist-load-config":"^1.0.3","caniuse-lite":"^1.0.30001810","connect-next":"catalog:","cors":"2.8.6","envinfo":"7.21.0","fs-extra":"catalog:","get-port":"5.1.1","launch-editor":"^2.14.1","lines-and-columns":"2.0.4","open":"^11.0.2","raw-body":"3.0.2","rslog":"^2.1.3","semver":"^7.8.5","sirv":"catalog:","source-map":"catalog:","ws":"8.21.3"},"devDependencies":{"@rsbuild/plugin-check-syntax":"catalog:","@rspack/core":"catalog:","@scripts/test-helper":"workspace:*","@types/babel__code-frame":"7.27.0","@types/cors":"2.8.19","@types/envinfo":"7.8.4","@types/fs-extra":"catalog:","@types/node":"catalog:","@types/semver":"^7.8.0","@types/ws":"^8.18.1","babel-loader":"10.1.1","filesize":"catalog:","json-stream-stringify":"3.0.1","string-loader":"0.0.1","ts-loader":"^9.6.2","typescript":"catalog:"},"peerDependencies":{"@rspack/core":"^2.0.0"},"peerDependenciesMeta":{"@rspack/core":{"optional":true}},"engines":{"node":"^20.19.0 || >=22.12.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"}}');
|
|
1701
1753
|
let pluginTapName = 'RsdoctorRspackPlugin', pluginTapPostOptions = {
|
|
1702
1754
|
name: pluginTapName,
|
|
1703
1755
|
stage: 999
|
|
@@ -1963,4 +2015,4 @@ class RsdoctorRspackPlugin {
|
|
|
1963
2015
|
}
|
|
1964
2016
|
export { Linter, LinterRule, LinterType, defineRule, rules } from "./26.js";
|
|
1965
2017
|
export { logger } from "./630.js";
|
|
1966
|
-
export { RsdoctorRspackPlugin, RsdoctorSDK, resolveClientDiffHtmlPath };
|
|
2018
|
+
export { RsdoctorRspackPlugin, RsdoctorSDK, migrateRsdoctorOptions, resolveClientDiffHtmlPath };
|
|
@@ -3,12 +3,12 @@ import { InternalBasePlugin } from './base.js';
|
|
|
3
3
|
export declare class InternalBundlePlugin<T extends Plugin.BaseCompiler> extends InternalBasePlugin<T> {
|
|
4
4
|
readonly name = "bundle";
|
|
5
5
|
map: Map<string, {
|
|
6
|
-
content: string;
|
|
6
|
+
content: string | Buffer;
|
|
7
7
|
}>;
|
|
8
8
|
apply(compiler: T): void;
|
|
9
9
|
changeDevtoolModuleFilename(compiler: Plugin.BaseCompiler): void;
|
|
10
10
|
ensureAssetContent(name: string): {
|
|
11
|
-
content: string;
|
|
11
|
+
content: string | Buffer;
|
|
12
12
|
};
|
|
13
13
|
thisCompilation: (compilation: Plugin.BaseCompilation) => void;
|
|
14
14
|
done: (compiler: T) => Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Linter, Plugin, SDK } from '@rsdoctor/shared/types';
|
|
2
2
|
export declare function isCompilerWatching(compiler: Pick<Plugin.BaseCompiler, 'watchMode' | 'parentCompilation'>): boolean;
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function getEffectiveCompressionConfig<T extends Plugin.NormalizedGzipConfig | Plugin.NormalizedBrotliConfig>(compiler: Pick<Plugin.BaseCompiler, 'watchMode' | 'parentCompilation'>, compression: T): T | false;
|
|
4
4
|
export declare function normalizeUserConfig<Rules extends Linter.ExtendRuleData[]>(config?: Plugin.RsdoctorRspackPluginOptions<Rules>): Plugin.RsdoctorPluginOptionsNormalized<Rules>;
|
|
5
5
|
export declare const normalizeReportType: (reportCodeType: Plugin.NewReportCodeType | undefined, mode: keyof typeof SDK.IMode) => SDK.ToDataType;
|
|
6
6
|
export declare const normalizeRspackUserOptions: typeof normalizeUserConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/core",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"sirv": "3.0.2",
|
|
58
58
|
"source-map": "^0.7.6",
|
|
59
59
|
"ws": "8.21.3",
|
|
60
|
-
"@rsdoctor/client": "2.0.0-beta.
|
|
61
|
-
"@rsdoctor/shared": "2.0.0-beta.
|
|
60
|
+
"@rsdoctor/client": "2.0.0-beta.3",
|
|
61
|
+
"@rsdoctor/shared": "2.0.0-beta.3"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@rsbuild/plugin-check-syntax": "^1.6.1",
|
|
@@ -75,7 +75,6 @@
|
|
|
75
75
|
"json-stream-stringify": "3.0.1",
|
|
76
76
|
"string-loader": "0.0.1",
|
|
77
77
|
"ts-loader": "^9.6.2",
|
|
78
|
-
"tslib": "2.8.1",
|
|
79
78
|
"typescript": "^7.0.2",
|
|
80
79
|
"@scripts/test-helper": "0.1.1"
|
|
81
80
|
},
|
|
@@ -88,7 +87,7 @@
|
|
|
88
87
|
}
|
|
89
88
|
},
|
|
90
89
|
"engines": {
|
|
91
|
-
"node": ">=22.
|
|
90
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
92
91
|
},
|
|
93
92
|
"publishConfig": {
|
|
94
93
|
"access": "public",
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { SDK } from '@rsdoctor/shared/types';
|
|
2
|
-
export declare function getExportIdentifierStatement(name: string, module: SDK.ModuleInstance): SDK.StatementInstance | undefined;
|
|
3
|
-
export declare function getDeclarationIdentifier(name: string, module: SDK.ModuleInstance): SDK.StatementInstance | undefined;
|
package/dist/common/file.d.ts
DELETED