@rsdoctor/components 1.2.0 → 1.2.1
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/components/Alert/change.d.ts +3 -0
- package/dist/components/Alert/ecma-version-check.d.ts +2 -0
- package/dist/components/Alert/file-relation.d.ts +3 -0
- package/dist/components/Alert/package-relation.d.ts +16 -0
- package/dist/components/Alert/types.d.ts +33 -0
- package/dist/components/Alert/view.d.ts +4 -0
- package/dist/components/Alerts/bundle-alert.d.ts +14 -0
- package/dist/components/Alerts/bundle.d.ts +11 -0
- package/dist/components/Alerts/collapse-cross-chunks.d.ts +6 -0
- package/dist/components/Alerts/collapse.d.ts +6 -0
- package/dist/components/Alerts/compile.d.ts +10 -0
- package/dist/components/Alerts/index.d.ts +3 -0
- package/dist/components/Alerts/list.d.ts +4 -0
- package/dist/components/Alerts/overlay.d.ts +26 -0
- package/dist/components/Badge/index.d.ts +21 -0
- package/dist/components/Card/diff.d.ts +24 -0
- package/dist/components/Card/index.d.ts +9 -0
- package/dist/components/Card/size.d.ts +22 -0
- package/dist/components/Card/statistic.d.ts +10 -0
- package/dist/components/Charts/TimelineCharts/index.d.ts +13 -0
- package/dist/components/Charts/TreeMap.d.ts +23 -0
- package/dist/components/Charts/TreeMap.mjs +1 -1
- package/dist/components/Charts/TreeMap.mjs.map +1 -1
- package/dist/components/Charts/bootstrap.d.ts +5 -0
- package/dist/components/Charts/common.d.ts +15 -0
- package/dist/components/Charts/constants.d.ts +19 -0
- package/dist/components/Charts/done.d.ts +5 -0
- package/dist/components/Charts/index.d.ts +10 -0
- package/dist/components/Charts/loader.d.ts +4 -0
- package/dist/components/Charts/minify.d.ts +5 -0
- package/dist/components/Charts/treemap_module.css +1 -1
- package/dist/components/Charts/treemap_module.css.map +1 -1
- package/dist/components/Charts/types.d.ts +61 -0
- package/dist/components/Charts/utils.d.ts +13 -0
- package/dist/components/Configuration/builder.d.ts +13 -0
- package/dist/components/Configuration/index.d.ts +1 -0
- package/dist/components/FileTree/index.d.ts +5 -0
- package/dist/components/Form/keyword.d.ts +14 -0
- package/dist/components/Keyword/index.d.ts +6 -0
- package/dist/components/Layout/builder-select.d.ts +2 -0
- package/dist/components/Layout/constants.d.ts +1 -0
- package/dist/components/Layout/header.d.ts +3 -0
- package/dist/components/Layout/index.d.ts +5 -0
- package/dist/components/Layout/menus.d.ts +8 -0
- package/dist/components/Layout/progress.d.ts +8 -0
- package/dist/components/Loader/Analysis/files.d.ts +9 -0
- package/dist/components/Loader/Analysis/index.d.ts +11 -0
- package/dist/components/Loader/executions.d.ts +9 -0
- package/dist/components/Manifest/api.d.ts +34 -0
- package/dist/components/Manifest/data.d.ts +8 -0
- package/dist/components/Manifest/index.d.ts +2 -0
- package/dist/components/Opener/code.d.ts +20 -0
- package/dist/components/Opener/index.d.ts +2 -0
- package/dist/components/Opener/vscode.d.ts +11 -0
- package/dist/components/Overall/DataSummary.d.ts +8 -0
- package/dist/components/Overall/bundle.d.ts +11 -0
- package/dist/components/Overall/compile.d.ts +5 -0
- package/dist/components/Overall/help-center.d.ts +1 -0
- package/dist/components/Overall/index.d.ts +3 -0
- package/dist/components/Overall/overview.d.ts +8 -0
- package/dist/components/Overall/project.d.ts +7 -0
- package/dist/components/Plugins/webpack.d.ts +18 -0
- package/dist/components/Resolver/analysis.d.ts +15 -0
- package/dist/components/Select/index.d.ts +18 -0
- package/dist/components/Status/failed.d.ts +9 -0
- package/dist/components/Status/index.d.ts +1 -0
- package/dist/components/TextDrawer/duplicate.d.ts +17 -0
- package/dist/components/TextDrawer/index.d.ts +12 -0
- package/dist/components/Title/index.d.ts +15 -0
- package/dist/components/base/CodeViewer/index.d.ts +5 -0
- package/dist/components/base/CodeViewer/interface.d.ts +45 -0
- package/dist/components/base/CodeViewer/useCodeDrawer.d.ts +9 -0
- package/dist/components/base/CodeViewer/utils.d.ts +18 -0
- package/dist/components/base/DiffViewer/index.d.ts +5 -0
- package/dist/components/base/DiffViewer/interface.d.ts +47 -0
- package/dist/components/base/DiffViewer/useDiffDrawer.d.ts +9 -0
- package/dist/components/base/DiffViewer/utils.d.ts +7 -0
- package/dist/components/base/index.d.ts +5 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/config.d.ts +19 -0
- package/dist/constants.d.ts +50 -0
- package/dist/index.d.ts +3 -0
- package/dist/pages/BundleSize/components/asset.d.ts +26 -0
- package/dist/pages/BundleSize/components/cards.d.ts +7 -0
- package/dist/pages/BundleSize/components/index.d.ts +16 -0
- package/dist/pages/BundleSize/components/search-modal.d.ts +8 -0
- package/dist/pages/BundleSize/config.d.ts +6 -0
- package/dist/pages/BundleSize/constants.d.ts +5 -0
- package/dist/pages/BundleSize/index.d.ts +3 -0
- package/dist/pages/ModuleAnalyze/chunks.d.ts +6 -0
- package/dist/pages/ModuleAnalyze/components/fileTreeCom.d.ts +15 -0
- package/dist/pages/ModuleAnalyze/constants.d.ts +7 -0
- package/dist/pages/ModuleAnalyze/dependency.d.ts +9 -0
- package/dist/pages/ModuleAnalyze/fileTree.d.ts +10 -0
- package/dist/pages/ModuleAnalyze/index.d.ts +15 -0
- package/dist/pages/ModuleAnalyze/utils/hooks.d.ts +21 -0
- package/dist/pages/ModuleAnalyze/utils/index.d.ts +3 -0
- package/dist/pages/ModuleResolve/constants.d.ts +3 -0
- package/dist/pages/ModuleResolve/index.d.ts +3 -0
- package/dist/pages/Overall/constants.d.ts +3 -0
- package/dist/pages/Overall/index.d.ts +9 -0
- package/dist/pages/Overall/responsiveLayout.d.ts +6 -0
- package/dist/pages/Resources/BundleDiff/DiffContainer/assets.d.ts +7 -0
- package/dist/pages/Resources/BundleDiff/DiffContainer/cards.d.ts +3 -0
- package/dist/pages/Resources/BundleDiff/DiffContainer/changes.d.ts +15 -0
- package/dist/pages/Resources/BundleDiff/DiffContainer/constants.d.ts +11 -0
- package/dist/pages/Resources/BundleDiff/DiffContainer/index.d.ts +3 -0
- package/dist/pages/Resources/BundleDiff/DiffContainer/modules.d.ts +8 -0
- package/dist/pages/Resources/BundleDiff/DiffContainer/overview.d.ts +5 -0
- package/dist/pages/Resources/BundleDiff/DiffContainer/packages.d.ts +19 -0
- package/dist/pages/Resources/BundleDiff/DiffContainer/row.d.ts +9 -0
- package/dist/pages/Resources/BundleDiff/DiffContainer/types.d.ts +44 -0
- package/dist/pages/Resources/BundleDiff/DiffContainer/utils.d.ts +2 -0
- package/dist/pages/Resources/BundleDiff/DiffServerAPIProvider/index.d.ts +3 -0
- package/dist/pages/Resources/BundleDiff/constants.d.ts +11 -0
- package/dist/pages/Resources/BundleDiff/index.d.ts +4 -0
- package/dist/pages/Resources/RuleIndex/constants.d.ts +3 -0
- package/dist/pages/Resources/RuleIndex/index.d.ts +3 -0
- package/dist/pages/TreeShaking/constants.d.ts +3 -0
- package/dist/pages/TreeShaking/editor.d.ts +11 -0
- package/dist/pages/TreeShaking/index.d.ts +8 -0
- package/dist/pages/TreeShaking/open-tag.d.ts +11 -0
- package/dist/pages/TreeShaking/range.d.ts +282 -0
- package/dist/pages/TreeShaking/space.d.ts +1 -0
- package/dist/pages/TreeShaking/table.d.ts +13 -0
- package/dist/pages/TreeShaking/types.d.ts +3 -0
- package/dist/pages/TreeShaking/utils.d.ts +7 -0
- package/dist/pages/WebpackLoaders/Analysis/constants.d.ts +3 -0
- package/dist/pages/WebpackLoaders/Analysis/index.d.ts +3 -0
- package/dist/pages/WebpackLoaders/Overall/constants.d.ts +3 -0
- package/dist/pages/WebpackLoaders/Overall/index.d.ts +3 -0
- package/dist/pages/WebpackLoaders/constants.d.ts +2 -0
- package/dist/pages/WebpackPlugins/constants.d.ts +3 -0
- package/dist/pages/WebpackPlugins/index.d.ts +4 -0
- package/dist/pages/index.d.ts +10 -0
- package/dist/utils/data/base.d.ts +24 -0
- package/dist/utils/data/brief.d.ts +11 -0
- package/dist/utils/data/index.d.ts +5 -0
- package/dist/utils/data/local.d.ts +14 -0
- package/dist/utils/data/remote.d.ts +10 -0
- package/dist/utils/file.d.ts +47 -0
- package/dist/utils/hooks.d.ts +30 -0
- package/dist/utils/i18n/cn.d.ts +3 -0
- package/dist/utils/i18n/en.d.ts +40 -0
- package/dist/utils/i18n/index.d.ts +2 -0
- package/dist/utils/index.d.ts +15 -0
- package/dist/utils/loader.d.ts +7 -0
- package/dist/utils/locale.d.ts +4 -0
- package/dist/utils/manifest.d.ts +24 -0
- package/dist/utils/request.d.ts +29 -0
- package/dist/utils/routes.d.ts +3 -0
- package/dist/utils/size.d.ts +2 -0
- package/dist/utils/socket.d.ts +7 -0
- package/dist/utils/storage.d.ts +15 -0
- package/dist/utils/string.d.ts +2 -0
- package/dist/utils/time.d.ts +3 -0
- package/dist/utils/url.d.ts +7 -0
- package/dist/utils/worker/index.d.ts +4 -0
- package/dist/utils/worker/master.d.ts +8 -0
- package/dist/utils/worker/types.d.ts +9 -0
- package/dist/utils/worker/utils.d.ts +7 -0
- package/dist/utils/worker/worker.d.ts +13 -0
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Space(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SDK } from '@rsdoctor/types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { TableKind, SetEditorStatus } from './types';
|
|
4
|
+
interface TableProps {
|
|
5
|
+
module: SDK.ModuleInstance;
|
|
6
|
+
moduleGraph: SDK.ModuleGraphInstance;
|
|
7
|
+
setEditorData: SetEditorStatus;
|
|
8
|
+
kind: TableKind;
|
|
9
|
+
}
|
|
10
|
+
export declare const SideEffectTable: React.FC<TableProps>;
|
|
11
|
+
export declare const ExportTable: React.FC<TableProps>;
|
|
12
|
+
export declare const TreeShakingTable: React.FC<TableProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SDK } from '@rsdoctor/types';
|
|
2
|
+
import type { editor } from 'monaco-editor';
|
|
3
|
+
export declare function useFileStructures(modules: SDK.ModuleInstance[], moduleGraph: SDK.ModuleGraphInstance, searchInput: string, selectedModule: SDK.ModuleInstance, onItemClick: (file: string) => void, cwd: string): import("../..").DataNode[];
|
|
4
|
+
export declare function getTreeFilesDefaultExpandedKeys(files: any[]): (string | number)[];
|
|
5
|
+
export declare function ellipsisPath(full: string): string;
|
|
6
|
+
export declare function getModulePositionString(statement: SDK.StatementInstance, module: SDK.ModuleInstance): string;
|
|
7
|
+
export declare function getHoverMessageInModule(module: SDK.ModuleInstance, moduleGraph: SDK.ModuleGraphInstance): editor.IModelDecoration[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * as Overall from './Overall';
|
|
2
|
+
export * as BundleSize from './BundleSize';
|
|
3
|
+
export * as ModuleAnalyze from './ModuleAnalyze';
|
|
4
|
+
export * as LoaderTimeline from './WebpackLoaders/Overall';
|
|
5
|
+
export * as LoaderFiles from './WebpackLoaders/Analysis';
|
|
6
|
+
export * as PluginsAnalyze from './WebpackPlugins';
|
|
7
|
+
export * as ModuleResolve from './ModuleResolve';
|
|
8
|
+
export * as RuleIndex from './Resources/RuleIndex';
|
|
9
|
+
export * as TreeShaking from './TreeShaking';
|
|
10
|
+
export * as BundleDiff from './Resources/BundleDiff';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Common, Manifest, SDK } from '@rsdoctor/types';
|
|
2
|
+
import { Data } from '@rsdoctor/utils/common';
|
|
3
|
+
export declare abstract class BaseDataLoader implements Manifest.ManifestDataLoader {
|
|
4
|
+
protected manifest: Manifest.RsdoctorManifestWithShardingFiles;
|
|
5
|
+
protected pool: Map<string, Promise<unknown>>;
|
|
6
|
+
protected loader: Data.APIDataLoader;
|
|
7
|
+
protected disposed: boolean;
|
|
8
|
+
protected shardingDataMap: Map<keyof Manifest.RsdoctorManifestData, Promise<any>>;
|
|
9
|
+
constructor(manifest: Manifest.RsdoctorManifestWithShardingFiles);
|
|
10
|
+
protected get<T extends keyof Manifest.RsdoctorManifestWithShardingFiles>(key: T): void | Manifest.RsdoctorManifestWithShardingFiles[T];
|
|
11
|
+
protected getData<T extends keyof Manifest.RsdoctorManifestData>(key: T, scope?: 'data' | 'cloudData'): void | Manifest.RsdoctorManifestWithShardingFiles['data'][T];
|
|
12
|
+
protected getKeys(key: string): string[];
|
|
13
|
+
protected joinKeys(keys: string[]): string;
|
|
14
|
+
dispose(): void;
|
|
15
|
+
limit<T>(key: string, fn: Common.Function<unknown[], Promise<T>>): Promise<T>;
|
|
16
|
+
log(...args: unknown[]): void;
|
|
17
|
+
loadManifest(): Promise<Manifest.RsdoctorManifestWithShardingFiles>;
|
|
18
|
+
abstract loadData<T extends string, P>(key: T): Promise<void | P>;
|
|
19
|
+
abstract loadData<T extends Manifest.RsdoctorManifestMappingKeys>(key: T): Promise<void | Manifest.InferManifestDataValue<T>>;
|
|
20
|
+
abstract isLocal(): boolean;
|
|
21
|
+
abstract loadAPI<T extends SDK.ServerAPI.API, B extends SDK.ServerAPI.InferRequestBodyType<T> = SDK.ServerAPI.InferRequestBodyType<T>, R extends SDK.ServerAPI.InferResponseType<T> = SDK.ServerAPI.InferResponseType<T>>(...args: B extends void ? [api: T] : [api: T, body: B]): Promise<R>;
|
|
22
|
+
abstract onDataUpdate<T extends SDK.ServerAPI.API | SDK.ServerAPI.APIExtends>(api: T, fn: (response: SDK.ServerAPI.SocketResponseType<T>) => void): void;
|
|
23
|
+
abstract removeOnDataUpdate<T extends SDK.ServerAPI.API | SDK.ServerAPI.APIExtends>(api: T, fn: (response: SDK.ServerAPI.SocketResponseType<T>) => void): void;
|
|
24
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Manifest, SDK } from '@rsdoctor/types';
|
|
2
|
+
import { BaseDataLoader } from './base';
|
|
3
|
+
export declare class BriefDataLoader extends BaseDataLoader {
|
|
4
|
+
isLocal(): boolean;
|
|
5
|
+
loadData<T extends Manifest.RsdoctorManifestMappingKeys>(key: T): Promise<Manifest.InferManifestDataValue<T>>;
|
|
6
|
+
getData(scope: keyof Manifest.RsdoctorManifestData): any;
|
|
7
|
+
loadAPI<T extends SDK.ServerAPI.API, B extends SDK.ServerAPI.InferRequestBodyType<T> = SDK.ServerAPI.InferRequestBodyType<T>, R extends SDK.ServerAPI.InferResponseType<T> = SDK.ServerAPI.InferResponseType<T>>(...args: B extends void ? [api: T] : [api: T, body: B]): Promise<R>;
|
|
8
|
+
dispose(): void;
|
|
9
|
+
onDataUpdate(): void;
|
|
10
|
+
removeOnDataUpdate(): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Common, Manifest, SDK } from '@rsdoctor/types';
|
|
2
|
+
import { BaseDataLoader } from './base';
|
|
3
|
+
export declare class LocalServerDataLoader extends BaseDataLoader {
|
|
4
|
+
protected events: Map<SDK.ServerAPI.API | SDK.ServerAPI.APIExtends, Set<Common.Function>>;
|
|
5
|
+
isLocal(): boolean;
|
|
6
|
+
loadData<T extends keyof Manifest.RsdoctorManifestData>(key: T): Promise<void | Manifest.RsdoctorManifestData[T]>;
|
|
7
|
+
loadAPI<T extends SDK.ServerAPI.API, B extends SDK.ServerAPI.InferRequestBodyType<T> = SDK.ServerAPI.InferRequestBodyType<T>, R extends SDK.ServerAPI.InferResponseType<T> = SDK.ServerAPI.InferResponseType<T>>(...args: B extends void ? [api: T] : [api: T, body: B]): Promise<R>;
|
|
8
|
+
dispose(): void;
|
|
9
|
+
/**
|
|
10
|
+
* add event listener when received data from server.
|
|
11
|
+
*/
|
|
12
|
+
onDataUpdate<T extends SDK.ServerAPI.API | SDK.ServerAPI.APIExtends>(api: T, fn: (response: SDK.ServerAPI.SocketResponseType<T>) => void): void;
|
|
13
|
+
removeOnDataUpdate<T extends SDK.ServerAPI.API | SDK.ServerAPI.APIExtends>(api: T, fn: (response: SDK.ServerAPI.SocketResponseType<T>) => void): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Manifest, SDK } from '@rsdoctor/types';
|
|
2
|
+
import { BaseDataLoader } from './base';
|
|
3
|
+
export declare class RemoteDataLoader extends BaseDataLoader {
|
|
4
|
+
isLocal(): boolean;
|
|
5
|
+
loadData<T extends Manifest.RsdoctorManifestMappingKeys>(key: T): Promise<Manifest.InferManifestDataValue<T>>;
|
|
6
|
+
loadAPI<T extends SDK.ServerAPI.API, B extends SDK.ServerAPI.InferRequestBodyType<T> = SDK.ServerAPI.InferRequestBodyType<T>, R extends SDK.ServerAPI.InferResponseType<T> = SDK.ServerAPI.InferResponseType<T>>(...args: B extends void ? [api: T] : [api: T, body: B]): Promise<R>;
|
|
7
|
+
dispose(): void;
|
|
8
|
+
onDataUpdate(): void;
|
|
9
|
+
removeOnDataUpdate(): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Common, SDK } from '@rsdoctor/types';
|
|
2
|
+
import { TreeNodeProps, UploadFile } from 'antd';
|
|
3
|
+
import { FieldDataNode } from 'rc-tree';
|
|
4
|
+
export type DataNode = FieldDataNode<{
|
|
5
|
+
key: string | number;
|
|
6
|
+
title?: React.ReactNode | ((data: DataNode) => React.ReactNode);
|
|
7
|
+
}> & {
|
|
8
|
+
__BASENAME__?: any;
|
|
9
|
+
__RESOURCEPATH__?: any;
|
|
10
|
+
children?: DataNode[];
|
|
11
|
+
};
|
|
12
|
+
export declare const rootDirname: (file: string, sep?: string) => string | null;
|
|
13
|
+
export declare function mapFileKey(arr: DataNode[], depth?: number, filter?: (node: DataNode) => boolean): DataNode['key'][];
|
|
14
|
+
export declare function flattenDirectory(n: DataNode, parent: DataNode, sep: string | undefined, inlinedResourcePathKey: keyof DataNode, dirTitle?: (_dir: DataNode, defaultTitle: string) => JSX.Element | string): void;
|
|
15
|
+
export declare function createFileStructures({ files, sep, inlinedResourcePathKey, fileTitle, dirTitle, page, }: {
|
|
16
|
+
files: string[];
|
|
17
|
+
cwd?: string;
|
|
18
|
+
sep?: string;
|
|
19
|
+
inlinedResourcePathKey?: keyof DataNode;
|
|
20
|
+
dirTitle?(dir: DataNode, defaultTitle: string): JSX.Element | string;
|
|
21
|
+
fileTitle?(file: string, basename: string): JSX.Element | string;
|
|
22
|
+
page?: 'bundle' | 'other';
|
|
23
|
+
}): DataNode[];
|
|
24
|
+
export declare function beautifyPath(path: string, cwd: string): string;
|
|
25
|
+
export declare function readJSONByFileReader<T extends Common.PlainObject>(file: UploadFile): Promise<T>;
|
|
26
|
+
export declare function readJSONByFileReader<T extends Common.PlainObject>(file: Blob): Promise<T>;
|
|
27
|
+
/**
|
|
28
|
+
* beautify module path, will replace cwd & last 'node_modules'
|
|
29
|
+
*/
|
|
30
|
+
export declare function beautifyModulePath(modulePath: string, cwd: string): {
|
|
31
|
+
alias: string;
|
|
32
|
+
inNodeModules: boolean;
|
|
33
|
+
};
|
|
34
|
+
export declare function getFileIcon(props: TreeNodeProps, addRowIcon?: boolean): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
type TreeNode = {
|
|
36
|
+
name: string;
|
|
37
|
+
value?: number;
|
|
38
|
+
children?: TreeNode[];
|
|
39
|
+
path?: string;
|
|
40
|
+
sourceSize?: number;
|
|
41
|
+
bundledSize?: number;
|
|
42
|
+
gzipSize?: number;
|
|
43
|
+
_map?: Map<string, TreeNode>;
|
|
44
|
+
};
|
|
45
|
+
export declare function buildTreemapData(modules: SDK.ModuleData[], rootName?: string): TreeNode;
|
|
46
|
+
export declare function flattenTreemapData(modules: SDK.ModuleData[], rootName?: string): TreeNode;
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Manifest, Rule, SDK } from '@rsdoctor/types';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import './i18n';
|
|
4
|
+
export declare const useI18n: typeof useTranslation;
|
|
5
|
+
export declare function useRuleIndexNavigate(code: string, link?: string | undefined): () => void;
|
|
6
|
+
export declare function useUrlQuery(): Record<string, string | undefined>;
|
|
7
|
+
export declare function useLoading(defaultLoading?: boolean): {
|
|
8
|
+
loading: boolean;
|
|
9
|
+
setLoading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
10
|
+
withLoading(func: (...args: unknown[]) => Promise<unknown> | unknown): Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
export declare function useProjectRootByManifest(manifest: Manifest.RsdoctorManifest): string;
|
|
13
|
+
export declare function useHashByManifest(manifest: Manifest.RsdoctorManifest): string;
|
|
14
|
+
export declare function useCloudManifestUrlByManifest(manifest: Manifest.RsdoctorManifest | Manifest.RsdoctorManifestWithShardingFiles | void): void;
|
|
15
|
+
export declare function useChunkGraphByManifest(manifest: Manifest.RsdoctorManifest): SDK.ChunkGraphData;
|
|
16
|
+
export declare function useConfigOutputFileNameByManifest(manifest: Manifest.RsdoctorManifest): string;
|
|
17
|
+
export declare function useModuleGraphByManifest(manifest: Manifest.RsdoctorManifest): SDK.ModuleGraphData;
|
|
18
|
+
export declare function useModuleGraph(moduleGraph: SDK.ModuleGraphData): SDK.ModuleGraphData;
|
|
19
|
+
export declare function usePackageGraphByManifest(manifest: Manifest.RsdoctorManifest): SDK.PackageGraphData;
|
|
20
|
+
export declare function useUniqModulesByManifest(manifest: Manifest.RsdoctorManifest): SDK.ModuleData[];
|
|
21
|
+
export declare function useUniqModules(modules: SDK.ModuleData[]): SDK.ModuleData[];
|
|
22
|
+
export declare function useErrorsByManifest(manifest: Manifest.RsdoctorManifest): Rule.RuleStoreData;
|
|
23
|
+
export declare function useBundleAlertsByManifest(manifest: Manifest.RsdoctorManifest): Rule.RuleStoreDataItem[];
|
|
24
|
+
export declare function useDuplicatePackagesByManifest(manifest: Manifest.RsdoctorManifest): Rule.PackageRelationDiffRuleStoreData[];
|
|
25
|
+
export declare function useCompileAlertsByErrors(errors: Manifest.RsdoctorManifestData['errors']): Rule.RuleStoreDataItem[];
|
|
26
|
+
export declare function useBundleAlertsByErrors(errors: Manifest.RsdoctorManifestData['errors']): Rule.RuleStoreDataItem[];
|
|
27
|
+
export declare function useDuplicatePackagesByErrors(errors: Manifest.RsdoctorManifestData['errors']): Rule.PackageRelationDiffRuleStoreData[];
|
|
28
|
+
export declare function useWebpackConfigurationByConfigs(configs?: SDK.ConfigData): SDK.WebpackConfigData | null | undefined;
|
|
29
|
+
export declare function useDetectIfCloudIdeEnv(): boolean;
|
|
30
|
+
export declare function useWindowWidth(): number;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
declare const en: {
|
|
2
|
+
Overall: string;
|
|
3
|
+
'Compile Analysis': string;
|
|
4
|
+
'Bundle Alerts': string;
|
|
5
|
+
'Help Center': string;
|
|
6
|
+
LoadersAnalysis: string;
|
|
7
|
+
'Loaders Timeline': string;
|
|
8
|
+
'Loaders Analysis': string;
|
|
9
|
+
'Rsdoctor Introduction': string;
|
|
10
|
+
'Compilation Alerts': string;
|
|
11
|
+
'Plugins Analysis': string;
|
|
12
|
+
PluginsAnalysis: string;
|
|
13
|
+
ModuleResolve: string;
|
|
14
|
+
'Bundle Analysis': string;
|
|
15
|
+
BundleSize: string;
|
|
16
|
+
ViewBundleSize: string;
|
|
17
|
+
'Module Graph': string;
|
|
18
|
+
TreeShaking: string;
|
|
19
|
+
'Rule Index': string;
|
|
20
|
+
Resources: string;
|
|
21
|
+
'Project Overall': string;
|
|
22
|
+
'Compile Overall': string;
|
|
23
|
+
'Bundle Overall': string;
|
|
24
|
+
'Expand Omitted': string;
|
|
25
|
+
'Concatenated Tag': string;
|
|
26
|
+
'the file content not changed after transpiled by this loader': string;
|
|
27
|
+
/** Bundle Size */
|
|
28
|
+
'Output Assets List': string;
|
|
29
|
+
'filter the output assets which size is greater than the input value': string;
|
|
30
|
+
'filter the modules which size is greater than the input value': string;
|
|
31
|
+
'After Compile': string;
|
|
32
|
+
'After Bundle': string;
|
|
33
|
+
CodeModeExplain: string;
|
|
34
|
+
DuplicatePakCodeExplain: string;
|
|
35
|
+
AsyncLoaderInfo: string;
|
|
36
|
+
Details: string;
|
|
37
|
+
Expand: string;
|
|
38
|
+
Collapse: string;
|
|
39
|
+
};
|
|
40
|
+
export default en;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './data';
|
|
2
|
+
export * from './file';
|
|
3
|
+
export * from './hooks';
|
|
4
|
+
export * from './loader';
|
|
5
|
+
export * from './locale';
|
|
6
|
+
export * from './manifest';
|
|
7
|
+
export * from './request';
|
|
8
|
+
export * from './routes';
|
|
9
|
+
export * from './size';
|
|
10
|
+
export * from './socket';
|
|
11
|
+
export * from './storage';
|
|
12
|
+
export * from './string';
|
|
13
|
+
export * from './time';
|
|
14
|
+
export * from './url';
|
|
15
|
+
export * from './worker';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Loader } from '@rsdoctor/utils/common';
|
|
2
|
+
import { SDK } from '@rsdoctor/types';
|
|
3
|
+
declare const findLoaderTotalTiming: typeof Loader.findLoaderTotalTiming, getLoaderCosts: typeof Loader.getLoaderCosts;
|
|
4
|
+
export { findLoaderTotalTiming, getLoaderCosts };
|
|
5
|
+
export declare function flattenLoaderData(loaderData: SDK.LoaderData): SDK.LoaderTransformData[];
|
|
6
|
+
export declare function filterLoaders(loaderData: SDK.ResourceLoaderData, keyword: string, loaderNames: string[], layer?: string): SDK.LoaderTransformData[];
|
|
7
|
+
export declare function filterLoader(resourcePath: string, loader: string, keyword: string, loaderNames: string[], resorceLayer?: string, layer?: string): boolean;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ModuleGraph } from '@rsdoctor/graph';
|
|
2
|
+
import { Manifest, SDK } from '@rsdoctor/types';
|
|
3
|
+
import { Theme, ViewMode } from '../constants';
|
|
4
|
+
export declare function useManifestJson(): Manifest.RsdoctorManifest;
|
|
5
|
+
export declare function useLocale(): import("../constants").Language;
|
|
6
|
+
export declare function useTheme(): {
|
|
7
|
+
theme: Theme;
|
|
8
|
+
setTheme: (theme: import("../config").Config["theme"]) => void;
|
|
9
|
+
isDark: boolean;
|
|
10
|
+
isLight: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare function useViewMode(): {
|
|
13
|
+
viewMode: {
|
|
14
|
+
bundleAlerts: ViewMode;
|
|
15
|
+
compileAlerts: ViewMode;
|
|
16
|
+
};
|
|
17
|
+
setViewMode: (mode: Partial<import("../config").Config["viewMode"]>, saveStorage?: boolean) => void;
|
|
18
|
+
setCompileAlertsViewMode(mode: ViewMode): void;
|
|
19
|
+
setBundleAlertsViewMode(mode: ViewMode): void;
|
|
20
|
+
isCompileList: boolean;
|
|
21
|
+
isBundleList: boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare function useManifest(url: string): Manifest.RsdoctorManifestWithShardingFiles | undefined;
|
|
24
|
+
export declare function useModuleGraphInstanceByModuleGraph(moduleGraph: SDK.ModuleGraphData): ModuleGraph;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Manifest, SDK } from '@rsdoctor/types';
|
|
2
|
+
export declare function fetchShardingFile(url: string): Promise<string>;
|
|
3
|
+
export declare function loadManifestByUrl(url: string): Promise<{
|
|
4
|
+
data: Manifest.RsdoctorManifestData;
|
|
5
|
+
cloudData?: Record<keyof Manifest.RsdoctorManifestData, string[] | string>;
|
|
6
|
+
__LOCAL__SERVER__?: boolean;
|
|
7
|
+
__SOCKET__PORT__?: string;
|
|
8
|
+
__SOCKET__URL__?: string;
|
|
9
|
+
client: Manifest.RsdoctorManifestClient;
|
|
10
|
+
cloudManifestUrl?: string | undefined;
|
|
11
|
+
name?: string | undefined;
|
|
12
|
+
series?: Manifest.RsdoctorManifestSeriesData[] | undefined;
|
|
13
|
+
}>;
|
|
14
|
+
export declare function fetchJSONByUrl(url: string): Promise<Manifest.RsdoctorManifestWithShardingFiles>;
|
|
15
|
+
export declare function fetchJSONByUrls(urls: string[]): Promise<Manifest.RsdoctorManifestWithShardingFiles[]>;
|
|
16
|
+
export declare function parseManifest(json: Manifest.RsdoctorManifestWithShardingFiles): Promise<{
|
|
17
|
+
data: Manifest.RsdoctorManifestData;
|
|
18
|
+
cloudData?: Record<keyof Manifest.RsdoctorManifestData, string[] | string>;
|
|
19
|
+
__LOCAL__SERVER__?: boolean;
|
|
20
|
+
__SOCKET__PORT__?: string;
|
|
21
|
+
__SOCKET__URL__?: string;
|
|
22
|
+
client: Manifest.RsdoctorManifestClient;
|
|
23
|
+
cloudManifestUrl?: string | undefined;
|
|
24
|
+
name?: string | undefined;
|
|
25
|
+
series?: Manifest.RsdoctorManifestSeriesData[] | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
export declare function getManifestUrl(): string;
|
|
28
|
+
export declare function fetchManifest(url?: string): Promise<Manifest.RsdoctorManifestWithShardingFiles>;
|
|
29
|
+
export declare function postServerAPI<T extends SDK.ServerAPI.API, B extends SDK.ServerAPI.InferRequestBodyType<T> = SDK.ServerAPI.InferRequestBodyType<T>, R extends SDK.ServerAPI.InferResponseType<T> = SDK.ServerAPI.InferResponseType<T>>(...args: B extends void ? [api: T] : [api: T, body: B]): Promise<R>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Config } from '../config';
|
|
2
|
+
import { APILoaderMode4Dev } from '../constants';
|
|
3
|
+
export declare function getStorage(key: string): string | null;
|
|
4
|
+
export declare function setStorage(key: string, value: string): boolean;
|
|
5
|
+
export declare function getThemeFromStorage(): Config['theme'];
|
|
6
|
+
export declare function setThemeToStorage(theme: Config['theme']): void;
|
|
7
|
+
export declare function getLocaleFromStorage(): Config['locale'];
|
|
8
|
+
export declare function setLocaleToStorage(locale: Config['locale']): void;
|
|
9
|
+
export declare function getViewModeFromStorage(): Config['viewMode'];
|
|
10
|
+
export declare function setViewModeToStorage(viewMode: Config['viewMode']): void;
|
|
11
|
+
export declare function hasViewModeFromStorage(): boolean;
|
|
12
|
+
export declare function setAPILoaderModeToStorage(mode: APILoaderMode4Dev): void;
|
|
13
|
+
export declare function getAPILoaderModeFromStorage(): string;
|
|
14
|
+
export declare function getFirstVisitFromStorage(): string | null;
|
|
15
|
+
export declare function setFirstVisitToStorage(value: '1'): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function isJsDataUrl(path: string): boolean;
|
|
2
|
+
export declare function getManifestUrlFromUrlQuery(): string | void;
|
|
3
|
+
export declare function changeOrigin(origin: string): string;
|
|
4
|
+
export declare function getSharingUrl(manifestCloudUrl: string): string;
|
|
5
|
+
export declare function getDemoUrl(): string | null;
|
|
6
|
+
export declare const getShortPath: (path: string) => string;
|
|
7
|
+
export declare function isDef<E = unknown>(data: E): data is NonNullable<E>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type CreateWorker = () => Worker;
|
|
2
|
+
export type NativeWorkerMessage<T = unknown> = MessageEvent<WorkerMessage<T>>;
|
|
3
|
+
export type WorkerMessage<T = unknown> = {
|
|
4
|
+
id: number | string;
|
|
5
|
+
data: T;
|
|
6
|
+
};
|
|
7
|
+
export type InternalWorkerEventCallback<T> = (message: WorkerMessage<T>) => unknown;
|
|
8
|
+
export type UserWorkerEventCallback<T = unknown> = (data: T) => unknown;
|
|
9
|
+
export type UserWorkerEventHandler<T = unknown, R = unknown> = (data: T) => R | Promise<R>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NativeWorkerMessage, UserWorkerEventHandler, WorkerMessage } from './types';
|
|
2
|
+
export declare function sendMessageInClient<T>(msg: WorkerMessage<T>, worker: Worker): void;
|
|
3
|
+
export declare function sendMessageInWorker<T>(receivedMsg: NativeWorkerMessage, response: T): void;
|
|
4
|
+
export declare function handleMessageInWorker<T, R>({ handler, }: {
|
|
5
|
+
workerName: string;
|
|
6
|
+
handler: UserWorkerEventHandler<T, R>;
|
|
7
|
+
}): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { UserWorkerEventCallback } from './types';
|
|
2
|
+
export declare class ChildWorker {
|
|
3
|
+
protected worker: Worker;
|
|
4
|
+
private timer;
|
|
5
|
+
private callbacks;
|
|
6
|
+
constructor(worker: Worker);
|
|
7
|
+
protected setup(): void;
|
|
8
|
+
protected createEventId(): string;
|
|
9
|
+
emit<T, P = unknown>(data: P, callback: UserWorkerEventCallback<T>): {
|
|
10
|
+
abort: () => boolean;
|
|
11
|
+
};
|
|
12
|
+
dispose(): void;
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/components",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"repository": {
|
|
@@ -76,9 +76,9 @@
|
|
|
76
76
|
"react-router-dom": "6.4.3",
|
|
77
77
|
"socket.io-client": "4.6.1",
|
|
78
78
|
"url-parse": "1.5.10",
|
|
79
|
-
"@rsdoctor/graph": "1.2.
|
|
80
|
-
"@rsdoctor/
|
|
81
|
-
"@rsdoctor/
|
|
79
|
+
"@rsdoctor/graph": "1.2.1",
|
|
80
|
+
"@rsdoctor/types": "1.2.1",
|
|
81
|
+
"@rsdoctor/utils": "1.2.1"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
84
|
"react": ">=18.3.1",
|