@rsdoctor/core 0.1.0 → 0.1.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/README.md +10 -3
- package/dist/build-utils/build/chunks/assetsModules.d.ts +2 -2
- package/dist/build-utils/build/chunks/chunkTransform.d.ts +2 -2
- package/dist/build-utils/build/chunks/generateTileGraph.d.ts +5 -5
- package/dist/build-utils/build/chunks/generateTileGraph.js +3 -9
- package/dist/build-utils/build/chunks/index.d.ts +1 -1
- package/dist/build-utils/build/index.d.ts +1 -1
- package/dist/build-utils/build/module-graph/index.d.ts +1 -1
- package/dist/build-utils/build/module-graph/parser.d.ts +1 -1
- package/dist/build-utils/build/module-graph/transform.d.ts +1 -1
- package/dist/build-utils/build/module-graph/treeShaking.d.ts +1 -1
- package/dist/build-utils/build/module-graph/utils.d.ts +1 -1
- package/dist/build-utils/build/module-graph/webpack/transform.d.ts +4 -4
- package/dist/build-utils/build/utils/index.d.ts +1 -1
- package/dist/build-utils/build/utils/loader.d.ts +11 -5
- package/dist/build-utils/build/utils/loader.js +94 -5
- package/dist/build-utils/build/utils/parseBundle.d.ts +2 -2
- package/dist/build-utils/build/utils/plugin.d.ts +1 -1
- package/dist/build-utils/common/chunks/assetsContent.d.ts +2 -2
- package/dist/build-utils/common/chunks/assetsModules.d.ts +8 -8
- package/dist/build-utils/common/chunks/assetsModules.js +2 -3
- package/dist/build-utils/common/chunks/chunkTransform.d.ts +2 -2
- package/dist/build-utils/common/chunks/index.d.ts +1 -1
- package/dist/build-utils/common/index.d.ts +1 -1
- package/dist/build-utils/common/module-graph/compatible.d.ts +1 -1
- package/dist/build-utils/common/module-graph/index.d.ts +1 -1
- package/dist/build-utils/common/module-graph/transform.d.ts +1 -4
- package/dist/build-utils/common/module-graph/utils.d.ts +3 -5
- package/dist/build-utils/common/trans-utils/index.d.ts +1 -1
- package/dist/build-utils/common/trans-utils/transStats.d.ts +3 -3
- package/dist/build-utils/common/webpack/compatible.d.ts +2 -2
- package/dist/build-utils/index.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/inner-plugins/constants.d.ts +1 -1
- package/dist/inner-plugins/index.d.ts +1 -1
- package/dist/inner-plugins/loaders/proxy.d.ts +2 -2
- package/dist/inner-plugins/plugins/base.d.ts +10 -10
- package/dist/inner-plugins/plugins/bundle.d.ts +11 -11
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.ts +2 -2
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.js +9 -8
- package/dist/inner-plugins/plugins/errors.d.ts +7 -7
- package/dist/inner-plugins/plugins/index.d.ts +1 -1
- package/dist/inner-plugins/plugins/loader.d.ts +7 -7
- package/dist/inner-plugins/plugins/plugins.d.ts +5 -5
- package/dist/inner-plugins/plugins/progress.d.ts +4 -4
- package/dist/inner-plugins/plugins/rules.d.ts +5 -5
- package/dist/inner-plugins/plugins/summary.d.ts +11 -11
- package/dist/inner-plugins/utils/circleDetect.d.ts +3 -3
- package/dist/inner-plugins/utils/config.d.ts +2 -2
- package/dist/inner-plugins/utils/index.d.ts +1 -1
- package/dist/inner-plugins/utils/loader.d.ts +3 -3
- package/dist/inner-plugins/utils/plugin.d.ts +1 -1
- package/dist/inner-plugins/utils/sdk.d.ts +1 -1
- package/dist/rules/index.d.ts +1 -1
- package/dist/rules/linter.d.ts +6 -10
- package/dist/rules/rule.d.ts +20 -24
- package/dist/rules/rules/default-import-check/index.d.ts +1 -1
- package/dist/rules/rules/default-import-check/types.d.ts +3 -3
- package/dist/rules/rules/default-import-check/utils.d.ts +1 -1
- package/dist/rules/rules/duplicate-package/index.d.ts +1 -1
- package/dist/rules/rules/duplicate-package/types.d.ts +19 -19
- package/dist/rules/rules/duplicate-package/utils.d.ts +1 -1
- package/dist/rules/rules/ecma-version-check/index.d.ts +1 -1
- package/dist/rules/rules/ecma-version-check/types.d.ts +5 -5
- package/dist/rules/rules/ecma-version-check/utils.d.ts +1 -1
- package/dist/rules/rules/index.d.ts +1 -1
- package/dist/rules/rules/loader-performance-optimization/index.d.ts +1 -1
- package/dist/rules/rules/loader-performance-optimization/types.d.ts +18 -18
- package/dist/rules/rules/loader-performance-optimization/utils.d.ts +1 -1
- package/dist/rules/utils.d.ts +1 -1
- package/dist/types/chunks.d.ts +7 -7
- package/dist/types/index.d.ts +1 -1
- package/dist/types/loader.d.ts +15 -15
- package/dist/types/plugin.d.ts +58 -57
- package/dist/types/rules.d.ts +5 -5
- package/dist/types/webpack.d.ts +4 -4
- package/package.json +6 -6
|
@@ -31,11 +31,13 @@ __export(ensureModulesChunkGraph_exports, {
|
|
|
31
31
|
ensureModulesChunksGraphFn: () => ensureModulesChunksGraphFn
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(ensureModulesChunkGraph_exports);
|
|
34
|
-
var
|
|
34
|
+
var import_path = __toESM(require("path"));
|
|
35
|
+
var import_types2 = require("@rsdoctor/types");
|
|
35
36
|
var import_build = require("@rsdoctor/utils/build");
|
|
37
|
+
var import_logger = require("@rsdoctor/utils/logger");
|
|
38
|
+
var import_fs_extra = __toESM(require("fs-extra"));
|
|
36
39
|
var import_build2 = require("../../build-utils/build");
|
|
37
40
|
var import_common = require("../../build-utils/common");
|
|
38
|
-
var import_fs_extra = __toESM(require("fs-extra"));
|
|
39
41
|
var import_constants = require("../constants");
|
|
40
42
|
const ensureModulesChunksGraphFn = (compiler, _this) => {
|
|
41
43
|
if (_this._modulesGraphApplied)
|
|
@@ -64,18 +66,17 @@ const ensureModulesChunksGraphFn = (compiler, _this) => {
|
|
|
64
66
|
context
|
|
65
67
|
);
|
|
66
68
|
(0, import_logger.debug)(import_build.Process.getMemoryUsageMessage, "[After Generate ModuleGraph]");
|
|
67
|
-
await getModulesInfosByStats(
|
|
68
|
-
compiler,
|
|
69
|
-
statsJson,
|
|
70
|
-
_this.modulesGraph
|
|
71
|
-
);
|
|
69
|
+
await getModulesInfosByStats(compiler, statsJson, _this.modulesGraph);
|
|
72
70
|
(0, import_logger.debug)(import_build.Process.getMemoryUsageMessage, "[After Transform ModuleGraph]");
|
|
73
71
|
_this.modulesGraph && await _this.sdk.reportModuleGraph(_this.modulesGraph);
|
|
74
72
|
await _this.sdk.reportChunkGraph(_this.chunkGraph);
|
|
75
73
|
const reportFilePath = await import_build2.Chunks.generateTileGraph(
|
|
76
74
|
statsJson,
|
|
77
75
|
{
|
|
78
|
-
reportFilename:
|
|
76
|
+
reportFilename: import_path.default.join(
|
|
77
|
+
import_types2.Constants.RsdoctorOutputFolder,
|
|
78
|
+
import_build2.Chunks.TileGraphReportName
|
|
79
|
+
),
|
|
79
80
|
reportTitle: "bundle-analyzer"
|
|
80
81
|
},
|
|
81
82
|
compiler.outputPath
|
|
@@ -2,10 +2,10 @@ import { Rule, Err, Plugin } from '@rsdoctor/types';
|
|
|
2
2
|
import { InternalBasePlugin } from './base';
|
|
3
3
|
import { DevToolError } from '@rsdoctor/utils/error';
|
|
4
4
|
export declare class InternalErrorReporterPlugin<T extends Plugin.BaseCompiler> extends InternalBasePlugin<T> {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
5
|
+
readonly name = "error-reporter";
|
|
6
|
+
apply(compiler: T): void;
|
|
7
|
+
done: (stats: Plugin.BaseStats) => Promise<void>;
|
|
8
|
+
handleWebpackError(err: Plugin.BuildError, category: Rule.RuleMessageCategory, level: keyof typeof Err.ErrorLevel): DevToolError;
|
|
9
|
+
reportWarnings(warnings: Plugin.BuildError[]): Promise<void>;
|
|
10
|
+
reportErrors(errors: Plugin.BuildWarning[]): Promise<void>;
|
|
11
|
+
}
|
|
@@ -2,10 +2,10 @@ import { Plugin } from '@rsdoctor/types';
|
|
|
2
2
|
import { RuleSetRule } from 'webpack';
|
|
3
3
|
import { InternalBasePlugin } from './base';
|
|
4
4
|
export declare class InternalLoaderPlugin<T extends Plugin.BaseCompiler> extends InternalBasePlugin<T> {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
5
|
+
readonly name = "loader";
|
|
6
|
+
readonly internalLoaderPath: string;
|
|
7
|
+
apply(compiler: T): void;
|
|
8
|
+
afterPlugins: (compiler: Plugin.BaseCompiler) => void;
|
|
9
|
+
compilation(compiler: Plugin.BaseCompiler, compilation: Plugin.BaseCompilation): void;
|
|
10
|
+
getInterceptRules(compiler: Plugin.BaseCompiler, rules: RuleSetRule[]): RuleSetRule[];
|
|
11
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Plugin } from '@rsdoctor/types';
|
|
2
2
|
import { InternalBasePlugin } from './base';
|
|
3
3
|
export declare class InternalPluginsPlugin<T extends Plugin.BaseCompiler> extends InternalBasePlugin<T> {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
4
|
+
readonly name = "plugins";
|
|
5
|
+
apply(compiler: T): void;
|
|
6
|
+
afterPlugins: (compiler: Plugin.BaseCompiler) => void;
|
|
7
|
+
compilation: (compilation: Plugin.BaseCompilation) => void;
|
|
8
|
+
}
|
|
@@ -2,7 +2,7 @@ import { SDK } from '@rsdoctor/types';
|
|
|
2
2
|
import type { Plugin } from '@rsdoctor/types';
|
|
3
3
|
import { InternalBasePlugin } from './base';
|
|
4
4
|
export declare class InternalProgressPlugin<T extends Plugin.BaseCompiler> extends InternalBasePlugin<T> {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
5
|
+
readonly name = "progress";
|
|
6
|
+
protected currentProgress: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.APIExtends.GetCompileProgess>;
|
|
7
|
+
apply(compiler: T): void;
|
|
8
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { InternalBasePlugin } from '../plugins';
|
|
2
2
|
import { Plugin } from '@rsdoctor/types';
|
|
3
3
|
export declare class InternalRulesPlugin extends InternalBasePlugin<Plugin.BaseCompiler> {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
4
|
+
readonly name = "rules";
|
|
5
|
+
apply(compiler: Plugin.BaseCompiler): void;
|
|
6
|
+
done: (stats: Plugin.BaseStats) => Promise<void>;
|
|
7
|
+
protected lint(compilation: Plugin.BaseCompilation): Promise<void>;
|
|
8
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { Plugin } from '@rsdoctor/types';
|
|
2
2
|
import { InternalBasePlugin } from './base';
|
|
3
3
|
export declare class InternalSummaryPlugin<T extends Plugin.BaseCompiler> extends InternalBasePlugin<T> {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
4
|
+
readonly name = "summary";
|
|
5
|
+
private times;
|
|
6
|
+
private preTimes;
|
|
7
|
+
private postTimes;
|
|
8
|
+
apply(compiler: T): void;
|
|
9
|
+
private mark;
|
|
10
|
+
beforeCompile: () => Promise<void>;
|
|
11
|
+
afterCompile: (compilation: Plugin.BaseCompilation) => Promise<void>;
|
|
12
|
+
done: (compiler: T) => Promise<void>;
|
|
13
|
+
private report;
|
|
14
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const checkCirclePath: (obj: any, record: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}[], res: string[][], level: number, maxLevel?: number) => void;
|
|
2
|
+
prop: string;
|
|
3
|
+
ref: unknown;
|
|
4
|
+
}[], res: string[][], level: number, maxLevel?: number) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Linter, Plugin } from '@rsdoctor/types';
|
|
2
2
|
import { RuleSetCondition as RspackRuleSetCondition } from '@rspack/core';
|
|
3
3
|
import { RuleSetCondition, RuleSetConditionAbsolute, RuleSetRule } from 'webpack';
|
|
4
|
-
import { RsdoctorWebpackPluginOptions, RsdoctorPluginOptionsNormalized } from
|
|
4
|
+
import { RsdoctorWebpackPluginOptions, RsdoctorPluginOptionsNormalized } from '../../types';
|
|
5
5
|
export declare function normalizeUserConfig<Rules extends Linter.ExtendRuleData[]>(config?: RsdoctorWebpackPluginOptions<Rules>): RsdoctorPluginOptionsNormalized<Rules>;
|
|
6
6
|
export declare function makeRuleSetSerializable(item: RuleSetConditionAbsolute | RuleSetCondition | RspackRuleSetCondition | void): void;
|
|
7
|
-
export declare function makeRulesSerializable(rules: Plugin.RuleSetRule[] | RuleSetRule['oneOf']): void;
|
|
7
|
+
export declare function makeRulesSerializable(rules: Plugin.RuleSetRule[] | RuleSetRule['oneOf']): void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="lodash" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
import { SDK, Plugin } from '@rsdoctor/types';
|
|
4
|
-
import { ProxyLoaderInternalOptions, ProxyLoaderOptions } from
|
|
5
|
-
import { Utils as BuildUtils, Types } from
|
|
4
|
+
import { ProxyLoaderInternalOptions, ProxyLoaderOptions } from '../../types';
|
|
5
|
+
import { Utils as BuildUtils, Types } from '../../build-utils/build';
|
|
6
6
|
export declare function getInternalLoaderOptions(loaderContext: Plugin.LoaderContext<ProxyLoaderOptions>): ProxyLoaderInternalOptions;
|
|
7
7
|
export declare function getLoaderOptionsWithoutInternalKeys(loaderContext: Plugin.LoaderContext<ProxyLoaderOptions>): import("lodash").Omit<ProxyLoaderOptions, "__l__">;
|
|
8
8
|
export declare function getOriginLoaderModule(loaderContext: Plugin.LoaderContext<ProxyLoaderOptions>): ReturnType<typeof BuildUtils.loadLoaderModule>;
|
|
9
9
|
export declare function shouldSkipLoader(loaderContext: Plugin.LoaderContext<ProxyLoaderOptions>): boolean;
|
|
10
10
|
export declare function interceptLoader<T extends Plugin.BuildRuleSetRule>(rules: T[], loaderPath: string, options: Omit<ProxyLoaderInternalOptions, 'loader' | 'hasOptions'>, cwd?: string, resolveLoader?: Plugin.Configuration['resolve']): T[];
|
|
11
|
-
export declare function reportLoader(ctx: Plugin.LoaderContext<ProxyLoaderOptions>, start: number, startHRTime: [number, number], isPitch: boolean, sync: boolean, code: string, err: Error | null | undefined, res: string | Buffer | null, sourceMap?: Types.SourceMapInput): Promise<SDK.LoaderData>;
|
|
11
|
+
export declare function reportLoader(ctx: Plugin.LoaderContext<ProxyLoaderOptions>, start: number, startHRTime: [number, number], isPitch: boolean, sync: boolean, code: string, err: Error | null | undefined, res: string | Buffer | null, sourceMap?: Types.SourceMapInput): Promise<SDK.LoaderData>;
|
|
@@ -2,4 +2,4 @@ import type { Hook } from 'tapable';
|
|
|
2
2
|
import type { SDK } from '@rsdoctor/types';
|
|
3
3
|
import type { RsdoctorWebpackSDK } from '@rsdoctor/sdk';
|
|
4
4
|
export declare function reportPluginData(sdk: RsdoctorWebpackSDK, hook: string, tapName: string, start: number, type: SDK.PluginHookData['type'], _res: unknown, err?: Error): void;
|
|
5
|
-
export declare function interceptPluginHook(sdk: RsdoctorWebpackSDK, name: string, hook: Hook<any, any>): void;
|
|
5
|
+
export declare function interceptPluginHook(sdk: RsdoctorWebpackSDK, name: string, hook: Hook<any, any>): void;
|
package/dist/rules/index.d.ts
CHANGED
package/dist/rules/linter.d.ts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { Linter as LinterType, SDK } from '@rsdoctor/types';
|
|
2
2
|
export { LinterType };
|
|
3
3
|
export declare class Linter<Rules extends LinterType.ExtendRuleData[]> {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
private getRules;
|
|
11
|
-
validate(context: SDK.RuntimeContext): Promise<LinterType.ValidateResult>;
|
|
12
|
-
afterValidate(context: LinterType.InternalRuleCheckerContextForCheckEnd): Promise<void>;
|
|
13
|
-
}
|
|
4
|
+
private rules;
|
|
5
|
+
constructor({ rules, extends: extendRules, level, }?: LinterType.Options<Rules>);
|
|
6
|
+
private getRules;
|
|
7
|
+
validate(context: SDK.RuntimeContext): Promise<LinterType.ValidateResult>;
|
|
8
|
+
afterValidate(context: LinterType.InternalRuleCheckerContextForCheckEnd): Promise<void>;
|
|
9
|
+
}
|
package/dist/rules/rule.d.ts
CHANGED
|
@@ -2,30 +2,26 @@ import { Linter, SDK, Rule as RuleTypes } from '@rsdoctor/types';
|
|
|
2
2
|
import { LinterType } from './linter';
|
|
3
3
|
type DefaultRuleConfig = Linter.DefaultRuleConfig;
|
|
4
4
|
export declare class Rule<Config = DefaultRuleConfig> implements Linter.RuleMeta<Config> {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
hooks,
|
|
25
|
-
validateResult,
|
|
26
|
-
data
|
|
27
|
-
}: LinterType.InternalRuleCheckerContextForCheckEnd<Config>): Promise<void>;
|
|
5
|
+
static from<C>(data: Linter.ExtendRuleData<C>): Rule<C>;
|
|
6
|
+
readonly meta: Linter.RuleMeta<Config>;
|
|
7
|
+
private check;
|
|
8
|
+
/**
|
|
9
|
+
* execute when check end
|
|
10
|
+
*/
|
|
11
|
+
private onCheckEnd;
|
|
12
|
+
private _severity;
|
|
13
|
+
private _config?;
|
|
14
|
+
constructor(data: Linter.RuleData<Config>);
|
|
15
|
+
get code(): RuleTypes.RuleMessageCode;
|
|
16
|
+
get title(): string;
|
|
17
|
+
get severity(): Linter.Severity;
|
|
18
|
+
get config(): Config | undefined;
|
|
19
|
+
get category(): "bundle" | RuleTypes.RuleMessageCategory | "compile" | "emo";
|
|
20
|
+
setOption(opt: Linter.RuleConfigItem): void;
|
|
21
|
+
match(level: Linter.Severity): boolean;
|
|
22
|
+
validate(context: SDK.RuntimeContext): Promise<Linter.ValidateResult>;
|
|
23
|
+
afterValidate({ hooks, validateResult, data, }: LinterType.InternalRuleCheckerContextForCheckEnd<Config>): Promise<void>;
|
|
28
24
|
}
|
|
29
25
|
export declare function defineRule<Title extends Linter.DefaultRuleTitle, T = Linter.DefaultRuleConfig>(ruleCreator: Linter.ExtendRuleConstructor<Title, T>): Linter.ExtendRuleData<T, Title>;
|
|
30
26
|
export declare function defineRule<Title extends Linter.DefaultRuleTitle, T = Linter.DefaultRuleConfig>(ruleCreator: Linter.RuleConstructor<Title, T>): Linter.RuleData<T, Title>;
|
|
31
|
-
export {};
|
|
27
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Linter } from '@rsdoctor/types';
|
|
2
2
|
import type { Config } from './types';
|
|
3
3
|
export type { Config } from './types';
|
|
4
|
-
export declare const rule: Linter.RuleData<Config, "default-import-check">;
|
|
4
|
+
export declare const rule: Linter.RuleData<Config, "default-import-check">;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export interface Config {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
2
|
+
/** Packages that need to be ignored */
|
|
3
|
+
ignore: string[];
|
|
4
|
+
}
|
|
@@ -7,4 +7,4 @@ export declare function getDefaultImportByRequest(node: Node.Program, request: s
|
|
|
7
7
|
export declare function hasSameLeftInAssignStatement(node: Node.Program, compare: Node.SyntaxNode[]): Node.Pattern | undefined;
|
|
8
8
|
export declare function importDeclarationToString(node: Node.ImportDeclaration): string;
|
|
9
9
|
export declare function getFixData(module: SDK.ModuleInstance, node: Node.ImportDeclaration, originalRange: Range): Linter.FixData;
|
|
10
|
-
export declare function getSourceRangeFromTransformedOffset(module: SDK.ModuleInstance, node: Node.SyntaxNode): Linter.ReportDocument | undefined;
|
|
10
|
+
export declare function getSourceRangeFromTransformedOffset(module: SDK.ModuleInstance, node: Node.SyntaxNode): Linter.ReportDocument | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Linter } from '@rsdoctor/types';
|
|
2
2
|
import { Config } from './types';
|
|
3
3
|
export type { Config, CheckVersion } from './types';
|
|
4
|
-
export declare const rule: Linter.RuleData<Config, "duplicate-package">;
|
|
4
|
+
export declare const rule: Linter.RuleData<Config, "duplicate-package">;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
export declare enum CheckVersion {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
null = 0,
|
|
3
|
+
prerelease = 1,
|
|
4
|
+
prepatch = 16,
|
|
5
|
+
patch = 256,
|
|
6
|
+
preminor = 4096,
|
|
7
|
+
minor = 65536,
|
|
8
|
+
premajor = 1048576,
|
|
9
|
+
major = 16777216
|
|
10
10
|
}
|
|
11
11
|
export declare enum CheckVersionMap {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
null = 0,
|
|
13
|
+
prerelease = 1,
|
|
14
|
+
prepatch = 17,
|
|
15
|
+
patch = 273,
|
|
16
|
+
preminor = 4369,
|
|
17
|
+
minor = 69905,
|
|
18
|
+
premajor = 1118481,
|
|
19
|
+
major = 17895697
|
|
20
20
|
}
|
|
21
21
|
export interface Config {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
22
|
+
checkVersion: keyof typeof CheckVersion;
|
|
23
|
+
ignore: string[];
|
|
24
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { SDK, Rule } from '@rsdoctor/types';
|
|
2
2
|
export declare function getErrorMsg(packages: SDK.PackageInstance[], root: string): string;
|
|
3
|
-
export declare function getErrorDetail(pkg: SDK.PackageInstance, pkgGraph: SDK.PackageGraphInstance): Rule.PackageRelationData;
|
|
3
|
+
export declare function getErrorDetail(pkg: SDK.PackageInstance, pkgGraph: SDK.PackageGraphInstance): Rule.PackageRelationData;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ECMAVersion } from '@rsdoctor/utils/ruleUtils';
|
|
2
2
|
export interface Config {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
3
|
+
/** Check the ecma version */
|
|
4
|
+
highestVersion: ECMAVersion;
|
|
5
|
+
/** Js files that need to be ignored */
|
|
6
|
+
ignore: string[];
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ECMAVersion } from '@rsdoctor/utils/ruleUtils';
|
|
2
|
-
export declare function getVersionNumber(ECMAString: ECMAVersion): number | undefined;
|
|
2
|
+
export declare function getVersionNumber(ECMAString: ECMAVersion): number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const rules: (import("@rsdoctor/types/dist/linter").RuleData<import("./duplicate-package").Config, "duplicate-package"> | import("@rsdoctor/types/dist/linter").RuleData<import("./default-import-check").Config, "default-import-check"> | import("@rsdoctor/types/dist/linter").RuleData<import("./loader-performance-optimization").Config, "loader-performance-optimization"> | import("@rsdoctor/types/dist/linter").RuleData<import("./ecma-version-check").Config, "ecma-version-check">)[];
|
|
1
|
+
export declare const rules: (import("@rsdoctor/types/dist/linter").RuleData<import("./duplicate-package").Config, "duplicate-package"> | import("@rsdoctor/types/dist/linter").RuleData<import("./default-import-check").Config, "default-import-check"> | import("@rsdoctor/types/dist/linter").RuleData<import("./loader-performance-optimization").Config, "loader-performance-optimization"> | import("@rsdoctor/types/dist/linter").RuleData<import("./ecma-version-check").Config, "ecma-version-check">)[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Linter } from '@rsdoctor/types';
|
|
2
2
|
import { Config } from './types';
|
|
3
3
|
export type { Config } from './types';
|
|
4
|
-
export declare const rule: Linter.RuleData<Config, "loader-performance-optimization">;
|
|
4
|
+
export declare const rule: Linter.RuleData<Config, "loader-performance-optimization">;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import type { SDK } from '@rsdoctor/types';
|
|
2
2
|
export interface Config {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
3
|
+
/**
|
|
4
|
+
* loaders which should be ignore.
|
|
5
|
+
*/
|
|
6
|
+
ignore: (string | RegExp)[];
|
|
7
|
+
/**
|
|
8
|
+
* threshold which the loader total costs.
|
|
9
|
+
* @unit millisecond
|
|
10
|
+
* @default 5000
|
|
11
|
+
*/
|
|
12
|
+
threshold: number;
|
|
13
|
+
/**
|
|
14
|
+
* the file extensions which will be match in rule check.
|
|
15
|
+
* @default ["js", "css", "jpg", "jpeg", "png", "gif", "webp", "svg"]
|
|
16
|
+
*/
|
|
17
|
+
extensions: (string | RegExp)[];
|
|
18
18
|
}
|
|
19
19
|
export interface LoaderMapValue extends SDK.LoaderTransformData {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
20
|
+
__resource__: SDK.ResourceData;
|
|
21
|
+
__costs__: number;
|
|
22
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function match(str: string, partterns: (string | RegExp)[]): boolean;
|
|
1
|
+
export declare function match(str: string, partterns: (string | RegExp)[]): boolean;
|
package/dist/rules/utils.d.ts
CHANGED
package/dist/types/chunks.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Plugin } from '@rsdoctor/types';
|
|
2
2
|
export type AssetsModules = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
label?: string;
|
|
4
|
+
isAsset?: boolean;
|
|
5
|
+
modules?: Plugin.StatsModule[];
|
|
6
6
|
};
|
|
7
7
|
export type ParseBundle = (assetFile: string, modules: Plugin.StatsModule[]) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
8
|
+
modules?: Record<string, any>;
|
|
9
|
+
src?: string;
|
|
10
|
+
runtimeSrc?: string;
|
|
11
|
+
};
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/loader.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { Loader } from '@rsdoctor/utils/common';
|
|
2
2
|
export interface ProxyLoaderInternalOptions {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
cwd: string;
|
|
4
|
+
/**
|
|
5
|
+
* the url host of http server(which used to collect data).
|
|
6
|
+
*/
|
|
7
|
+
host: string;
|
|
8
|
+
/**
|
|
9
|
+
* correct loader path.
|
|
10
|
+
*/
|
|
11
|
+
loader: string;
|
|
12
|
+
/** include the loader option */
|
|
13
|
+
hasOptions: boolean;
|
|
14
|
+
skipLoaders: string[];
|
|
15
15
|
}
|
|
16
16
|
export interface ProxyLoaderOptions {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
[Loader.LoaderInternalPropertyName]: ProxyLoaderInternalOptions;
|
|
19
|
+
}
|