@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.
Files changed (149) hide show
  1. package/dist/e.js +6030 -888
  2. package/dist/e.js.LICENSE.txt +1 -1
  3. package/dist/index.d.ts +458 -7
  4. package/dist/index.js +2519 -1684
  5. package/dist/index.js.LICENSE.txt +8 -2
  6. package/dist/probe-loader.d.ts +13 -0
  7. package/dist/proxy-loader.d.ts +36 -1
  8. package/dist/r.js +9218 -241
  9. package/dist/r.js.LICENSE.txt +57 -0
  10. package/package.json +26 -26
  11. package/dist/build-utils/build/chunks/assetsModules.d.ts +0 -23
  12. package/dist/build-utils/build/chunks/index.d.ts +0 -2
  13. package/dist/build-utils/build/chunks/rspack/transform.d.ts +0 -13
  14. package/dist/build-utils/build/envinfo.d.ts +0 -13
  15. package/dist/build-utils/build/file/cache.d.ts +0 -5
  16. package/dist/build-utils/build/file/index.d.ts +0 -3
  17. package/dist/build-utils/build/file/sharding.d.ts +0 -21
  18. package/dist/build-utils/build/index.d.ts +0 -10
  19. package/dist/build-utils/build/json.d.ts +0 -3
  20. package/dist/build-utils/build/loader/index.d.ts +0 -2
  21. package/dist/build-utils/build/loader/probeLoader.d.ts +0 -9
  22. package/dist/build-utils/build/loader/probeLoaderPlugin.d.ts +0 -6
  23. package/dist/build-utils/build/module-graph/index.d.ts +0 -1
  24. package/dist/build-utils/build/module-graph/rspack/transform.d.ts +0 -26
  25. package/dist/build-utils/build/process.d.ts +0 -2
  26. package/dist/build-utils/build/server.d.ts +0 -14
  27. package/dist/build-utils/build/utils/index.d.ts +0 -3
  28. package/dist/build-utils/build/utils/loader.d.ts +0 -20
  29. package/dist/build-utils/build/utils/parseBundle.d.ts +0 -12
  30. package/dist/build-utils/build/utils/plugin.d.ts +0 -5
  31. package/dist/build-utils/index.d.ts +0 -11
  32. package/dist/common/global-config.d.ts +0 -21
  33. package/dist/compat.d.ts +0 -34
  34. package/dist/error/error.d.ts +0 -35
  35. package/dist/error/index.d.ts +0 -2
  36. package/dist/error/transform.d.ts +0 -3
  37. package/dist/error/utils.d.ts +0 -4
  38. package/dist/inner-plugins/constants.d.ts +0 -6
  39. package/dist/inner-plugins/index.d.ts +0 -2
  40. package/dist/inner-plugins/loaders/proxy.d.ts +0 -7
  41. package/dist/inner-plugins/plugins/base.d.ts +0 -12
  42. package/dist/inner-plugins/plugins/bundle.d.ts +0 -15
  43. package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.ts +0 -34
  44. package/dist/inner-plugins/plugins/errors.d.ts +0 -12
  45. package/dist/inner-plugins/plugins/index.d.ts +0 -10
  46. package/dist/inner-plugins/plugins/loader.d.ts +0 -12
  47. package/dist/inner-plugins/plugins/plugins.d.ts +0 -8
  48. package/dist/inner-plugins/plugins/progress.d.ts +0 -8
  49. package/dist/inner-plugins/plugins/resolver.d.ts +0 -12
  50. package/dist/inner-plugins/plugins/rspack.d.ts +0 -9
  51. package/dist/inner-plugins/plugins/rules.d.ts +0 -8
  52. package/dist/inner-plugins/plugins/sourcemapTool.d.ts +0 -47
  53. package/dist/inner-plugins/plugins/summary.d.ts +0 -15
  54. package/dist/inner-plugins/utils/circleDetect.d.ts +0 -4
  55. package/dist/inner-plugins/utils/config.d.ts +0 -6
  56. package/dist/inner-plugins/utils/index.d.ts +0 -9
  57. package/dist/inner-plugins/utils/loader.d.ts +0 -10
  58. package/dist/inner-plugins/utils/normalize-config.d.ts +0 -32
  59. package/dist/inner-plugins/utils/openBrowser.d.ts +0 -1
  60. package/dist/inner-plugins/utils/plugin-common.d.ts +0 -11
  61. package/dist/inner-plugins/utils/plugin.d.ts +0 -4
  62. package/dist/inner-plugins/utils/ruleWarnings.d.ts +0 -2
  63. package/dist/inner-plugins/utils/sdk.d.ts +0 -8
  64. package/dist/logger.d.ts +0 -9
  65. package/dist/rspack-plugin/constants.d.ts +0 -9
  66. package/dist/rspack-plugin/index.d.ts +0 -1
  67. package/dist/rspack-plugin/plugin.d.ts +0 -55
  68. package/dist/rspack-plugin/session.d.ts +0 -19
  69. package/dist/rspack-plugin/writeStore.d.ts +0 -2
  70. package/dist/rule-utils/document/document.d.ts +0 -16
  71. package/dist/rule-utils/document/index.d.ts +0 -3
  72. package/dist/rule-utils/document/server.d.ts +0 -4
  73. package/dist/rule-utils/document/types.d.ts +0 -31
  74. package/dist/rule-utils/index.d.ts +0 -2
  75. package/dist/rule-utils/parser/asserts.d.ts +0 -81
  76. package/dist/rule-utils/parser/index.d.ts +0 -4
  77. package/dist/rule-utils/parser/parser.d.ts +0 -118
  78. package/dist/rule-utils/parser/types.d.ts +0 -30
  79. package/dist/rule-utils/parser/utils.d.ts +0 -27
  80. package/dist/rules/index.d.ts +0 -3
  81. package/dist/rules/linter.d.ts +0 -9
  82. package/dist/rules/rule.d.ts +0 -27
  83. package/dist/rules/rules/cjs-require/index.d.ts +0 -4
  84. package/dist/rules/rules/cjs-require/types.d.ts +0 -7
  85. package/dist/rules/rules/cross-chunks-package/index.d.ts +0 -4
  86. package/dist/rules/rules/cross-chunks-package/types.d.ts +0 -3
  87. package/dist/rules/rules/cross-chunks-package/utils.d.ts +0 -1
  88. package/dist/rules/rules/default-import-check/index.d.ts +0 -4
  89. package/dist/rules/rules/default-import-check/types.d.ts +0 -4
  90. package/dist/rules/rules/default-import-check/utils.d.ts +0 -10
  91. package/dist/rules/rules/duplicate-package/index.d.ts +0 -4
  92. package/dist/rules/rules/duplicate-package/types.d.ts +0 -24
  93. package/dist/rules/rules/duplicate-package/utils.d.ts +0 -3
  94. package/dist/rules/rules/ecma-version-check/htmlParserStub.d.ts +0 -3
  95. package/dist/rules/rules/ecma-version-check/index.d.ts +0 -5
  96. package/dist/rules/rules/ecma-version-check/types.d.ts +0 -13
  97. package/dist/rules/rules/esm-resolved-to-cjs/index.d.ts +0 -4
  98. package/dist/rules/rules/esm-resolved-to-cjs/types.d.ts +0 -8
  99. package/dist/rules/rules/index.d.ts +0 -2
  100. package/dist/rules/rules/loader-performance-optimization/index.d.ts +0 -4
  101. package/dist/rules/rules/loader-performance-optimization/types.d.ts +0 -22
  102. package/dist/rules/rules/loader-performance-optimization/utils.d.ts +0 -1
  103. package/dist/rules/rules/module-mixed-chunks/index.d.ts +0 -4
  104. package/dist/rules/rules/module-mixed-chunks/types.d.ts +0 -3
  105. package/dist/rules/rules/side-effects-only-imports/index.d.ts +0 -4
  106. package/dist/rules/rules/side-effects-only-imports/types.d.ts +0 -9
  107. package/dist/rules/utils.d.ts +0 -3
  108. package/dist/sdk/index.d.ts +0 -2
  109. package/dist/sdk/multiple/controller.d.ts +0 -26
  110. package/dist/sdk/multiple/index.d.ts +0 -2
  111. package/dist/sdk/multiple/primary.d.ts +0 -41
  112. package/dist/sdk/multiple/server.d.ts +0 -7
  113. package/dist/sdk/sdk/core.d.ts +0 -34
  114. package/dist/sdk/sdk/index.d.ts +0 -54
  115. package/dist/sdk/sdk/types.d.ts +0 -26
  116. package/dist/sdk/server/apis/alerts.d.ts +0 -5
  117. package/dist/sdk/server/apis/base.d.ts +0 -11
  118. package/dist/sdk/server/apis/bundle-diff.d.ts +0 -6
  119. package/dist/sdk/server/apis/data.d.ts +0 -6
  120. package/dist/sdk/server/apis/fs.d.ts +0 -5
  121. package/dist/sdk/server/apis/graph.d.ts +0 -12
  122. package/dist/sdk/server/apis/index.d.ts +0 -10
  123. package/dist/sdk/server/apis/loader.d.ts +0 -15
  124. package/dist/sdk/server/apis/plugin.d.ts +0 -6
  125. package/dist/sdk/server/apis/project.d.ts +0 -8
  126. package/dist/sdk/server/apis/renderer.d.ts +0 -6
  127. package/dist/sdk/server/apis/resolver.d.ts +0 -6
  128. package/dist/sdk/server/client.d.ts +0 -3
  129. package/dist/sdk/server/fakeServer.d.ts +0 -9
  130. package/dist/sdk/server/index.d.ts +0 -44
  131. package/dist/sdk/server/json-body.d.ts +0 -6
  132. package/dist/sdk/server/router.d.ts +0 -24
  133. package/dist/sdk/server/security.d.ts +0 -5
  134. package/dist/sdk/server/socket/api.d.ts +0 -15
  135. package/dist/sdk/server/socket/index.d.ts +0 -48
  136. package/dist/sdk/server/utils.d.ts +0 -6
  137. package/dist/sdk/utils/base.d.ts +0 -1
  138. package/dist/sdk/utils/constant.d.ts +0 -1
  139. package/dist/sdk/utils/date.d.ts +0 -1
  140. package/dist/sdk/utils/index.d.ts +0 -4
  141. package/dist/sdk/utils/manifestSharding.d.ts +0 -16
  142. package/dist/sdk/utils/openBrowser.d.ts +0 -4
  143. package/dist/sdk/utils/upload.d.ts +0 -2
  144. package/dist/sdk/utils/writeJson.d.ts +0 -1
  145. package/dist/sdk.d.ts +0 -1
  146. package/dist/types/index.d.ts +0 -3
  147. package/dist/types/loader.d.ts +0 -24
  148. package/dist/types/plugin.d.ts +0 -22
  149. package/dist/types/rules.d.ts +0 -7
@@ -1,27 +0,0 @@
1
- import { ecmaVersion } from 'acorn';
2
- import { Node, ECMAVersion } from './types.js';
3
- /**
4
- * Recursively compare node semantics while ignoring comments, positions, and
5
- * string quote styles. String templates and string addition remain distinct.
6
- */
7
- export declare function isSameSyntax(node1: Node.SyntaxNode, node2: Node.SyntaxNode): boolean;
8
- /**
9
- * Get all default reference statements
10
- */
11
- export declare function getDefaultImports(node: Node.Program): Node.ImportDeclaration[];
12
- /** Get the literal in the text. */
13
- export declare function getIdentifierInPattern(name: string, node: Node.Pattern): Node.Identifier | undefined;
14
- /** Get the variable declaration statement identifier. */
15
- export declare function getIdentifierInDeclaration(name: string, node: Node.SyntaxNode): Node.Identifier | undefined;
16
- /** Get the reference declaration statement identifier. */
17
- export declare function getIdentifierInImport(name: string, node: Node.SyntaxNode): Node.Identifier | undefined;
18
- /** Get the export statement identifier. */
19
- export declare function getIdentifierInExport(name: string, node: Node.SyntaxNode): Node.Identifier | undefined;
20
- /** Determine that it can be resolved using the specified ECMA version */
21
- export declare function canParse(code: string, ecmaVersion: ecmaVersion): boolean;
22
- /** Determine whether it is all ES5 version code. */
23
- export declare function isES5(code: string): boolean;
24
- /** Determine whether it is all ES6 version code. */
25
- export declare function isES6(code: string): boolean;
26
- /** Detect ECMA version. */
27
- export declare function detectECMAVersion(code: string): ECMAVersion;
@@ -1,3 +0,0 @@
1
- export * from './linter.js';
2
- export * from './rule.js';
3
- export { rules } from './rules/index.js';
@@ -1,9 +0,0 @@
1
- import { Linter as LinterType, SDK } from '@rsdoctor/shared/types';
2
- export { LinterType };
3
- export declare class Linter<Rules extends LinterType.ExtendRuleData[]> {
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
- }
@@ -1,27 +0,0 @@
1
- import { Linter, SDK, Rule as RuleTypes } from '@rsdoctor/shared/types';
2
- import { LinterType } from './linter.js';
3
- type DefaultRuleConfig = Linter.DefaultRuleConfig;
4
- export declare class Rule<Config = DefaultRuleConfig> implements Linter.RuleMeta<Config> {
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" | "compile" | "emo" | RuleTypes.RuleMessageCategory;
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>;
24
- }
25
- export declare function defineRule<Title extends Linter.DefaultRuleTitle, T = Linter.DefaultRuleConfig>(ruleCreator: Linter.ExtendRuleConstructor<Title, T>): Linter.ExtendRuleData<T, Title>;
26
- export declare function defineRule<Title extends Linter.DefaultRuleTitle, T = Linter.DefaultRuleConfig>(ruleCreator: Linter.RuleConstructor<Title, T>): Linter.RuleData<T, Title>;
27
- export {};
@@ -1,4 +0,0 @@
1
- import { Linter } from '@rsdoctor/shared/types';
2
- import type { Config } from './types.js';
3
- export type { Config } from './types.js';
4
- export declare const rule: Linter.RuleData<Config, "cjs-require">;
@@ -1,7 +0,0 @@
1
- export interface Config {
2
- /**
3
- * Module path patterns to ignore (applied to both issuer and required module paths).
4
- * Defaults to [].
5
- */
6
- ignore: string[];
7
- }
@@ -1,4 +0,0 @@
1
- import { Linter } from '@rsdoctor/shared/types';
2
- import { Config } from './types.js';
3
- export type { Config } from './types.js';
4
- export declare const rule: Linter.RuleData<Config, "cross-chunks-package">;
@@ -1,3 +0,0 @@
1
- export interface Config {
2
- ignore: string[];
3
- }
@@ -1 +0,0 @@
1
- export declare function getErrorMsgForDupPckChunks(chunks: string[], pkgName: string): string;
@@ -1,4 +0,0 @@
1
- import { Linter } from '@rsdoctor/shared/types';
2
- import type { Config } from './types.js';
3
- export type { Config } from './types.js';
4
- export declare const rule: Linter.RuleData<Config, "default-import-check">;
@@ -1,4 +0,0 @@
1
- export interface Config {
2
- /** Packages that need to be ignored */
3
- ignore: string[];
4
- }
@@ -1,10 +0,0 @@
1
- import { Node, Range } from '../../../rule-utils/index.js';
2
- import type { SDK, Linter } from '@rsdoctor/shared/types';
3
- export declare function getDefaultImportByRequest(node: Node.Program, request: string): Node.ImportDeclaration | undefined;
4
- /**
5
- * Determine that it contains the same left value assignment expression in the enumeration.
6
- */
7
- export declare function hasSameLeftInAssignStatement(node: Node.Program, compare: Node.SyntaxNode[]): Node.Pattern | undefined;
8
- export declare function importDeclarationToString(node: Node.ImportDeclaration): string;
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;
@@ -1,4 +0,0 @@
1
- import { Linter } from '@rsdoctor/shared/types';
2
- import type { Config } from './types.js';
3
- export type { Config, CheckVersion } from './types.js';
4
- export declare const rule: Linter.RuleData<Config, "duplicate-package">;
@@ -1,24 +0,0 @@
1
- export declare enum CheckVersion {
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
- }
11
- export declare enum CheckVersionMap {
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
- }
21
- export interface Config {
22
- checkVersion: keyof typeof CheckVersion;
23
- ignore: string[];
24
- }
@@ -1,3 +0,0 @@
1
- import type { SDK, Rule } from '@rsdoctor/shared/types';
2
- export declare function getErrorMsg(packages: SDK.PackageInstance[], root: string): string;
3
- export declare function getErrorDetail(pkg: SDK.PackageInstance, pkgGraph: SDK.PackageGraphInstance): Rule.PackageRelationData;
@@ -1,3 +0,0 @@
1
- export declare class Parser {
2
- constructor();
3
- }
@@ -1,5 +0,0 @@
1
- import type { Config } from './types.js';
2
- import { Linter } from '@rsdoctor/shared/types';
3
- export type { Config } from './types.js';
4
- declare const title = "ecma-version-check";
5
- export declare const rule: Linter.RuleData<Config, typeof title>;
@@ -1,13 +0,0 @@
1
- import type { ecmaVersion as EcmaVersion } from 'acorn';
2
- type Condition = string | RegExp | ((filepath: string) => boolean);
3
- type CheckSyntaxExclude = Condition | Condition[];
4
- type SyntaxErrorKey = 'source' | 'output' | 'reason' | 'code';
5
- export type Config = {
6
- targets?: string[];
7
- exclude?: CheckSyntaxExclude;
8
- excludeOutput?: CheckSyntaxExclude;
9
- excludeErrorMessage?: RegExp | RegExp[];
10
- excludeErrorLogs?: SyntaxErrorKey[];
11
- ecmaVersion?: EcmaVersion;
12
- };
13
- export {};
@@ -1,4 +0,0 @@
1
- import { Linter } from '@rsdoctor/shared/types';
2
- import type { Config } from './types.js';
3
- export type { Config } from './types.js';
4
- export declare const rule: Linter.RuleData<Config, "esm-resolved-to-cjs">;
@@ -1,8 +0,0 @@
1
- export interface Config {
2
- /**
3
- * Package name patterns to ignore (substring match against the import request).
4
- * @example ['my-legacy-pkg', '@internal/']
5
- * @default []
6
- */
7
- ignore: string[];
8
- }
@@ -1,2 +0,0 @@
1
- import type { Linter } from '@rsdoctor/shared/types';
2
- export declare const rules: Linter.RuleData[];
@@ -1,4 +0,0 @@
1
- import { Linter } from '@rsdoctor/shared/types';
2
- import { Config } from './types.js';
3
- export type { Config } from './types.js';
4
- export declare const rule: Linter.RuleData<Config, "loader-performance-optimization">;
@@ -1,22 +0,0 @@
1
- import type { SDK } from '@rsdoctor/shared/types';
2
- export interface Config {
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
- }
19
- export interface LoaderMapValue extends SDK.LoaderTransformData {
20
- __resource__: SDK.ResourceData;
21
- __costs__: number;
22
- }
@@ -1 +0,0 @@
1
- export declare function match(str: string, patterns: (string | RegExp)[]): boolean;
@@ -1,4 +0,0 @@
1
- import { Linter } from '@rsdoctor/shared/types';
2
- import { Config } from './types.js';
3
- export type { Config } from './types.js';
4
- export declare const rule: Linter.RuleData<Config, "module-mixed-chunks">;
@@ -1,3 +0,0 @@
1
- export interface Config {
2
- ignore: string[];
3
- }
@@ -1,4 +0,0 @@
1
- import { Linter } from '@rsdoctor/shared/types';
2
- import type { Config } from './types.js';
3
- export type { Config } from './types.js';
4
- export declare const rule: Linter.RuleData<Config, "tree-shaking-side-effects-only">;
@@ -1,9 +0,0 @@
1
- export interface Config {
2
- /** Module path patterns to ignore */
3
- ignore: string[];
4
- /**
5
- * Module path patterns to include when the module is under node_modules.
6
- * Example: ['react', '@babel/runtime']
7
- */
8
- include: string[];
9
- }
@@ -1,3 +0,0 @@
1
- import { Linter } from '@rsdoctor/shared/types';
2
- export declare function toSeverity(input: Linter.SeverityInput, defaultLevel: Linter.Severity): Linter.Severity;
3
- export declare function noop(): void;
@@ -1,2 +0,0 @@
1
- export * from './sdk/index.js';
2
- export * from './multiple/index.js';
@@ -1,26 +0,0 @@
1
- import { Manifest } from '@rsdoctor/shared/types';
2
- import { RsdoctorPrimarySDK } from './primary.js';
3
- export declare class RsdoctorSDKController {
4
- readonly slaves: RsdoctorPrimarySDK[];
5
- private readonly activeSlaves;
6
- private outputDir;
7
- private outputOwner?;
8
- private refreshManifestTask;
9
- private readonly compilerDirectories;
10
- private readonly briefReports;
11
- root: string;
12
- constructor(root?: string);
13
- get master(): RsdoctorPrimarySDK;
14
- get isMultiple(): boolean;
15
- getLastSdk(): RsdoctorPrimarySDK;
16
- hasName(name: string, exclude?: RsdoctorPrimarySDK): boolean;
17
- registerSlave(slave: RsdoctorPrimarySDK): void;
18
- setOutputDir(slave: RsdoctorPrimarySDK, outputDir: string): void;
19
- getCompilerOutputDir(slave: RsdoctorPrimarySDK): string;
20
- writeBriefJson(current: RsdoctorPrimarySDK, data: Manifest.RsdoctorBriefData): void;
21
- getSeriesData(serverUrl?: boolean): Manifest.RsdoctorManifestSeriesData[];
22
- getBriefSeriesData(current: RsdoctorPrimarySDK): Manifest.RsdoctorManifestSeriesData[];
23
- createSlave({ name, displayName, compilerPath, parentCompilerPath, isChild, stage, extraConfig, type, }: Omit<ConstructorParameters<typeof RsdoctorPrimarySDK>[0], 'controller'>): RsdoctorPrimarySDK;
24
- refreshManifestSeries(): Promise<void>;
25
- private getActiveSlaves;
26
- }
@@ -1,2 +0,0 @@
1
- export * from './controller.js';
2
- export * from './primary.js';
@@ -1,41 +0,0 @@
1
- import { Common, Manifest, SDK } from '@rsdoctor/shared/types';
2
- import { RsdoctorSDK } from '../sdk/index.js';
3
- import type { RsdoctorSDKController } from './controller.js';
4
- interface RsdoctorSlaveSDKOptions {
5
- name: string;
6
- displayName?: string;
7
- compilerPath?: string;
8
- parentCompilerPath?: string;
9
- isChild?: boolean;
10
- /**
11
- * use to sort for display in the client page.
12
- * the smaller the front.
13
- * @default 1
14
- */
15
- stage?: number;
16
- extraConfig?: SDK.SDKOptionsType;
17
- controller: RsdoctorSDKController;
18
- type: SDK.ToDataType;
19
- }
20
- export declare class RsdoctorPrimarySDK extends RsdoctorSDK implements SDK.RsdoctorBuilderSDKInstance {
21
- id: number;
22
- parent: RsdoctorSDKController;
23
- readonly stage: number;
24
- displayName: string;
25
- readonly compilerPath: string;
26
- readonly parentCompilerPath?: string;
27
- readonly isChild: boolean;
28
- dependencies: Array<string> | undefined;
29
- reportFileName: string;
30
- constructor({ name, displayName, compilerPath, parentCompilerPath, isChild, stage, controller, extraConfig, type, }: RsdoctorSlaveSDKOptions);
31
- get isMaster(): boolean;
32
- protected writeBriefJson(data: Manifest.RsdoctorBriefData): void;
33
- protected writePieces(_storeData: Common.PlainObject, options?: SDK.WriteStoreOptionsType): Promise<void>;
34
- protected writeManifest(): Promise<string>;
35
- refreshManifestSeries(): Promise<void>;
36
- getSeriesData(serverUrl?: boolean): Manifest.RsdoctorManifestSeriesData[];
37
- setName(name: string): void;
38
- getManifestData(): Manifest.RsdoctorManifestWithShardingFiles;
39
- addRsdoctorDataToHTML(storeData: SDK.BuilderStoreData, htmlContent: string): string;
40
- }
41
- export {};
@@ -1,7 +0,0 @@
1
- import { RsdoctorServer, type RsdoctorServerOptions } from '../server/index.js';
2
- import type { RsdoctorPrimarySDK } from './primary.js';
3
- export declare class RsdoctorSlaveServer extends RsdoctorServer {
4
- protected sdk: RsdoctorPrimarySDK;
5
- constructor(sdk: RsdoctorPrimarySDK, port?: number, config?: RsdoctorServerOptions);
6
- openClientPage(...args: unknown[]): Promise<void>;
7
- }
@@ -1,34 +0,0 @@
1
- import { Common, Manifest, SDK } from '@rsdoctor/shared/types';
2
- import { RsdoctorSDKOptions, DataWithUrl } from './types.js';
3
- export declare abstract class SDKCore<T extends RsdoctorSDKOptions> implements SDK.RsdoctorSDKInstance {
4
- protected _name: string;
5
- protected hash: string;
6
- extraConfig: SDK.SDKOptionsType | undefined;
7
- readonly root: string;
8
- readonly pid: number;
9
- readonly hooks: SDK.Hooks;
10
- protected _envinfo: SDK.EnvInfo;
11
- private _clientRoutes;
12
- private _outputDir;
13
- diskManifestPath: string;
14
- cloudData?: Manifest.RsdoctorManifestWithShardingFiles;
15
- constructor({ name, root }: T);
16
- get outputDir(): string;
17
- get name(): string;
18
- bootstrap(): Promise<void>;
19
- dispose(): Promise<void>;
20
- setOutputDir(outputDir: string): void;
21
- setName(name: string): void;
22
- setHash(hash: string): void;
23
- getHash(): string;
24
- getClientRoutes(): Manifest.RsdoctorManifestClientRoutes[];
25
- addClientRoutes(routes: Manifest.RsdoctorManifestClientRoutes[]): void;
26
- /** Upload analysis data pieces */
27
- protected writePieces(storeData: Common.PlainObject, options?: SDK.WriteStoreOptionsType): Promise<void>;
28
- /** Upload manifest file */
29
- protected writeManifest(): Promise<string>;
30
- saveManifest(data: Common.PlainObject, options: SDK.WriteStoreOptionsType): Promise<string>;
31
- protected writeToFolder(jsonStr: string, dir: string, key: string, index?: number, compressionLevel?: number): Promise<DataWithUrl>;
32
- protected writeJsonFragmentsToFolder(jsonFragments: string[], dir: string, key: string, index?: number, compressionLevel?: number): Promise<DataWithUrl>;
33
- abstract onDataReport(): void | Promise<void>;
34
- }
@@ -1,54 +0,0 @@
1
- import { Manifest, SDK } from '@rsdoctor/shared/types';
2
- import { RawSourceMap, SourceMapConsumer } from 'source-map';
3
- import { RsdoctorServer } from '../server/index.js';
4
- import { RsdoctorRspackSDKOptions } from './types.js';
5
- import { SDKCore } from './core.js';
6
- export * from '../utils/openBrowser.js';
7
- export * from '../utils/base.js';
8
- export { resolveClientDiffHtmlPath } from '../server/client.js';
9
- export declare class RsdoctorSDK<T extends RsdoctorRspackSDKOptions = RsdoctorRspackSDKOptions> extends SDKCore<T> implements SDK.RsdoctorBuilderSDKInstance {
10
- server: RsdoctorServer;
11
- extraConfig: SDK.SDKOptionsType | undefined;
12
- type: SDK.ToDataType;
13
- root: string;
14
- private _summary;
15
- private _configs;
16
- private _errors;
17
- private _loader;
18
- private _loaderStart;
19
- private _resolver;
20
- private _plugin;
21
- private _moduleGraph;
22
- private _chunkGraph;
23
- private _rawSourceMapCache;
24
- private _sourceMap;
25
- private _packageGraph;
26
- constructor(options: T);
27
- bootstrap(): Promise<void>;
28
- dispose(): Promise<void>;
29
- applyErrorFix(id: number): Promise<void>;
30
- clear(): void;
31
- clearSourceMapCache(): void;
32
- getSourceMap(file: string): Promise<SourceMapConsumer | undefined>;
33
- reportSourceMap(data: RawSourceMap): void;
34
- reportConfiguration(config: SDK.ConfigData[0]): void;
35
- reportError(errors: Error[]): void;
36
- reportLoader(data: SDK.LoaderData): void;
37
- reportLoaderStartOrEnd(data: SDK.ResourceLoaderData): void;
38
- reportResolver(data: SDK.ResolverData): void;
39
- reportPlugin(data: SDK.PluginData): void;
40
- reportModuleGraph(data: SDK.ModuleGraphInstance): void;
41
- reportPackageGraph(data: SDK.PackageGraphInstance): void;
42
- reportChunkGraph(data: SDK.ChunkGraphInstance): void;
43
- reportSummaryData(part: Partial<SDK.SummaryData>): void;
44
- createPackageGraph(): void;
45
- getBriefJsonPath(outputDir?: string): string | undefined;
46
- protected writeBriefJson(data: Manifest.RsdoctorBriefData): void;
47
- writeStore(options?: SDK.WriteStoreOptionsType): Promise<string>;
48
- getStoreData(): SDK.BuilderStoreData;
49
- getManifestData(): Manifest.RsdoctorManifestWithShardingFiles;
50
- getRuleContext(_options: SDK.RuntimeContextOptions): SDK.RuntimeContext;
51
- onDataReport(): void | Promise<void>;
52
- addRsdoctorDataToHTML(storeData: SDK.BuilderStoreData, htmlContent: string): string;
53
- inlineScriptsAndStyles(htmlFilePath: string): string;
54
- }
@@ -1,26 +0,0 @@
1
- import { SDK } from '@rsdoctor/shared/types';
2
- export interface DataWithUrl {
3
- name: string;
4
- files: {
5
- path: string;
6
- basename: string;
7
- content?: Buffer;
8
- }[] | string;
9
- }
10
- export interface RsdoctorSDKOptions {
11
- name: string;
12
- root: string;
13
- }
14
- /**
15
- * sdk options for builder.
16
- */
17
- export interface RsdoctorBuilderSDK extends RsdoctorSDKOptions {
18
- type?: SDK.ToDataType;
19
- /**
20
- * port for client server
21
- */
22
- port?: number;
23
- config?: SDK.SDKOptionsType;
24
- }
25
- export type RsdoctorRspackSDKOptions = RsdoctorBuilderSDK;
26
- export type RsdoctorEMOSDKOptions = RsdoctorSDKOptions;
@@ -1,5 +0,0 @@
1
- import { SDK } from '@rsdoctor/shared/types';
2
- import { BaseAPI } from './base.js';
3
- export declare class AlertsAPI extends BaseAPI {
4
- getPackageRelationAlertDetails(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetPackageRelationAlertDetails>>;
5
- }
@@ -1,11 +0,0 @@
1
- import { Data } from '@rsdoctor/shared/common-browser';
2
- import { Manifest, SDK } from '@rsdoctor/shared/types';
3
- export declare class BaseAPI implements Manifest.ManifestDataLoader {
4
- [key: string | symbol]: any;
5
- readonly ctx: SDK.ServerAPI.APIContext;
6
- protected dataLoader: Data.APIDataLoader;
7
- constructor(sdk: SDK.RsdoctorSDKInstance, server: SDK.RsdoctorServerInstance);
8
- loadManifest(): Promise<Manifest.RsdoctorManifestWithShardingFiles>;
9
- loadData<T extends Manifest.RsdoctorManifestMappingKeys>(key: T): Promise<Manifest.InferManifestDataValue<T>>;
10
- loadData(key: string): Promise<void>;
11
- }
@@ -1,6 +0,0 @@
1
- import { SDK } from '@rsdoctor/shared/types';
2
- import { BaseAPI } from './base.js';
3
- export declare class BundleDiffAPI extends BaseAPI {
4
- getBundleDiffSummary(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetBundleDiffSummary>>;
5
- bundleDiffManifest(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.BundleDiffManifest>>;
6
- }
@@ -1,6 +0,0 @@
1
- import { SDK } from '@rsdoctor/shared/types';
2
- import { BaseAPI } from './base.js';
3
- export declare class DataAPI extends BaseAPI {
4
- loadDataByKey(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.LoadDataByKey>>;
5
- sendMessageToClient(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.SendAPIDataToClient>>;
6
- }
@@ -1,5 +0,0 @@
1
- import { SDK } from '@rsdoctor/shared/types';
2
- import { BaseAPI } from './base.js';
3
- export declare class FileSystemAPI extends BaseAPI {
4
- applyErrorFix(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.ApplyErrorFix>>;
5
- }
@@ -1,12 +0,0 @@
1
- import { SDK } from '@rsdoctor/shared/types';
2
- import { BaseAPI } from './base.js';
3
- export declare class GraphAPI extends BaseAPI {
4
- getAssetsSummary(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetAssetsSummary>>;
5
- getModuleGraphForAsset(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetAssetDetails>>;
6
- getChunksByModuleId(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetChunksByModuleId>>;
7
- getModuleDetails(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetModuleDetails>>;
8
- getDependencyByResolvedRequest(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetModulesByModuleIds>>;
9
- getModuleCodeByModuleId(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetModuleCodeByModuleId>>;
10
- getModuleCodeByModuleIds(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetModuleCodeByModuleIds>>;
11
- getEntryModulesSummary(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetEntryPoints>>;
12
- }
@@ -1,10 +0,0 @@
1
- export * from './alerts.js';
2
- export * from './bundle-diff.js';
3
- export { DataAPI } from './data.js';
4
- export * from './fs.js';
5
- export * from './loader.js';
6
- export * from './graph.js';
7
- export * from './plugin.js';
8
- export * from './project.js';
9
- export * from './renderer.js';
10
- export * from './resolver.js';
@@ -1,15 +0,0 @@
1
- import { SDK } from '@rsdoctor/shared/types';
2
- import { BaseAPI } from './base.js';
3
- export declare class LoaderAPI extends BaseAPI {
4
- /** report loader data api */
5
- reportLoader(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.ReportLoader>>;
6
- /** report sourcemap data api */
7
- reportSourceMap(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.ReportLoader>>;
8
- getLoaderNames(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderNames>>;
9
- getLoaderChartData(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderChartData>>;
10
- getLoaderFileTree(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderFileTree>>;
11
- getLoaderFileDetails(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderFileDetails>>;
12
- getLoaderFolderStatistics(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderFolderStatistics>>;
13
- getLoaderFileFirstInput(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderFileFirstInput>>;
14
- getLoaderFileInputAndOutput(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderFileInputAndOutput>>;
15
- }
@@ -1,6 +0,0 @@
1
- import { SDK } from '@rsdoctor/shared/types';
2
- import { BaseAPI } from './base.js';
3
- export declare class PluginAPI extends BaseAPI {
4
- getPluginSummary(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetPluginSummary>>;
5
- getPluginData(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetPluginData>>;
6
- }
@@ -1,8 +0,0 @@
1
- import { SDK } from '@rsdoctor/shared/types';
2
- import { BaseAPI } from './base.js';
3
- export declare class ProjectAPI extends BaseAPI {
4
- env(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.Env>>;
5
- manifest(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.Manifest>>;
6
- getProjectInfo(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetProjectInfo>>;
7
- getClientRoutes(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetClientRoutes>>;
8
- }
@@ -1,6 +0,0 @@
1
- import { SDK } from '@rsdoctor/shared/types';
2
- import { BaseAPI } from './base.js';
3
- export declare class RendererAPI extends BaseAPI {
4
- /** sdk manifest api */
5
- entryHtml(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.EntryHtml>>;
6
- }
@@ -1,6 +0,0 @@
1
- import { SDK } from '@rsdoctor/shared/types';
2
- import { BaseAPI } from './base.js';
3
- export declare class ResolverAPI extends BaseAPI {
4
- getResolverFileTree(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetResolverFileTree>>;
5
- getResolverFileDetails(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetResolverFileDetails>>;
6
- }
@@ -1,3 +0,0 @@
1
- export declare const resolveClientHtmlPath: (innerClientPath?: string) => string;
2
- export declare const resolveClientDistPath: (innerClientPath?: string) => string;
3
- export declare const resolveClientDiffHtmlPath: (innerClientPath?: string) => string;
@@ -1,9 +0,0 @@
1
- import { SDK } from '@rsdoctor/shared/types';
2
- import { RsdoctorServer } from './index.js';
3
- export declare class RsdoctorFakeServer extends RsdoctorServer {
4
- protected sdk: SDK.RsdoctorBuilderSDKInstance;
5
- constructor(sdk: SDK.RsdoctorBuilderSDKInstance, port?: number);
6
- bootstrap(): Promise<void>;
7
- openClientPage(): Promise<void>;
8
- dispose: () => Promise<void>;
9
- }