@rsdoctor/components 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.
Files changed (141) hide show
  1. package/README.md +10 -3
  2. package/dist/components/Alert/change.d.ts +2 -2
  3. package/dist/components/Alert/file-relation.d.ts +1 -1
  4. package/dist/components/Alert/index.d.ts +1 -1
  5. package/dist/components/Alert/link.d.ts +1 -1
  6. package/dist/components/Alert/package-relation.d.ts +9 -9
  7. package/dist/components/Alert/package-relation.js +188 -94
  8. package/dist/components/Alert/types.d.ts +15 -15
  9. package/dist/components/Alert/view.d.ts +1 -1
  10. package/dist/components/Alerts/bundle.d.ts +4 -4
  11. package/dist/components/Alerts/common.d.ts +8 -8
  12. package/dist/components/Alerts/common.js +46 -23
  13. package/dist/components/Alerts/compile.d.ts +4 -4
  14. package/dist/components/Alerts/index.d.ts +1 -1
  15. package/dist/components/Alerts/overlay.d.ts +12 -12
  16. package/dist/components/Badge/index.d.ts +13 -13
  17. package/dist/components/Card/diff.d.ts +11 -11
  18. package/dist/components/Card/index.d.ts +4 -4
  19. package/dist/components/Card/size.d.ts +16 -16
  20. package/dist/components/Card/statistic.d.ts +7 -7
  21. package/dist/components/Charts/TimelineCharts/index.d.ts +5 -5
  22. package/dist/components/Charts/TimelineCharts/index.js +31 -9
  23. package/dist/components/Charts/bootstrap.d.ts +1 -1
  24. package/dist/components/Charts/common.d.ts +4 -4
  25. package/dist/components/Charts/constants.d.ts +2 -0
  26. package/dist/components/Charts/constants.js +46 -0
  27. package/dist/components/Charts/done.d.ts +1 -1
  28. package/dist/components/Charts/index.d.ts +4 -4
  29. package/dist/components/Charts/loader.d.ts +1 -1
  30. package/dist/components/Charts/loader.js +55 -26
  31. package/dist/components/Charts/minify.d.ts +1 -1
  32. package/dist/components/Charts/types.d.ts +45 -45
  33. package/dist/components/Charts/utils.d.ts +5 -4
  34. package/dist/components/Charts/utils.js +32 -13
  35. package/dist/components/CodeViewer/config.d.ts +1 -1
  36. package/dist/components/CodeViewer/diff.d.ts +6 -6
  37. package/dist/components/CodeViewer/hightlight.d.ts +5 -5
  38. package/dist/components/CodeViewer/index.d.ts +1 -1
  39. package/dist/components/CodeViewer/viewer.d.ts +6 -6
  40. package/dist/components/Configuration/builder.d.ts +6 -6
  41. package/dist/components/Configuration/index.d.ts +1 -1
  42. package/dist/components/FileTree/index.d.ts +1 -1
  43. package/dist/components/Form/keyword.d.ts +10 -10
  44. package/dist/components/Keyword/index.d.ts +3 -3
  45. package/dist/components/Layout/builder-select.d.ts +1 -1
  46. package/dist/components/Layout/constants.d.ts +1 -1
  47. package/dist/components/Layout/header.d.ts +1 -1
  48. package/dist/components/Layout/index.d.ts +2 -2
  49. package/dist/components/Layout/menus.d.ts +4 -4
  50. package/dist/components/Layout/menus.js +42 -14
  51. package/dist/components/Layout/progress.d.ts +3 -3
  52. package/dist/components/Loader/Analysis/files.d.ts +5 -5
  53. package/dist/components/Loader/Analysis/index.d.ts +6 -6
  54. package/dist/components/Loader/executions.d.ts +5 -9
  55. package/dist/components/Manifest/api.d.ts +14 -21
  56. package/dist/components/Manifest/data.d.ts +1 -1
  57. package/dist/components/Manifest/index.d.ts +1 -1
  58. package/dist/components/Opener/code.d.ts +17 -25
  59. package/dist/components/Opener/index.d.ts +1 -1
  60. package/dist/components/Opener/vscode.d.ts +7 -12
  61. package/dist/components/Overall/NumberButton.d.ts +6 -12
  62. package/dist/components/Overall/bundle.d.ts +3 -3
  63. package/dist/components/Overall/compile.d.ts +2 -2
  64. package/dist/components/Overall/index.d.ts +1 -1
  65. package/dist/components/Overall/project.d.ts +5 -5
  66. package/dist/components/Plugins/webpack.d.ts +9 -9
  67. package/dist/components/Resolver/analysis.d.ts +7 -7
  68. package/dist/components/Select/index.d.ts +9 -9
  69. package/dist/components/Status/failed.d.ts +4 -4
  70. package/dist/components/Status/index.d.ts +1 -1
  71. package/dist/components/TextDrawer/duplicate.d.ts +7 -7
  72. package/dist/components/TextDrawer/index.d.ts +6 -6
  73. package/dist/components/Title/index.d.ts +11 -11
  74. package/dist/components/index.d.ts +1 -1
  75. package/dist/components/worker/ecmaversion/client.d.ts +4 -4
  76. package/dist/components/worker/ecmaversion/worker.d.ts +1 -1
  77. package/dist/components/worker/jsequal/client.d.ts +6 -6
  78. package/dist/components/worker/jsequal/worker.d.ts +1 -1
  79. package/dist/config.d.ts +13 -13
  80. package/dist/constants.d.ts +30 -30
  81. package/dist/index.d.ts +1 -1
  82. package/dist/pages/BundleSize/components/asset.d.ts +15 -15
  83. package/dist/pages/BundleSize/components/cards.d.ts +4 -4
  84. package/dist/pages/BundleSize/components/editor.d.ts +3 -3
  85. package/dist/pages/BundleSize/components/index.d.ts +7 -7
  86. package/dist/pages/BundleSize/config.d.ts +3 -3
  87. package/dist/pages/BundleSize/constants.d.ts +1 -1
  88. package/dist/pages/BundleSize/index.d.ts +1 -1
  89. package/dist/pages/ModuleAnalyze/chunks.d.ts +2 -2
  90. package/dist/pages/ModuleAnalyze/components/fileTreeCom.d.ts +9 -9
  91. package/dist/pages/ModuleAnalyze/constants.d.ts +2 -2
  92. package/dist/pages/ModuleAnalyze/dependncy.d.ts +4 -4
  93. package/dist/pages/ModuleAnalyze/fileTree.d.ts +6 -6
  94. package/dist/pages/ModuleAnalyze/index.d.ts +4 -4
  95. package/dist/pages/ModuleAnalyze/utils/hooks.d.ts +16 -16
  96. package/dist/pages/ModuleAnalyze/utils/index.d.ts +1 -1
  97. package/dist/pages/ModuleResolve/constants.d.ts +1 -1
  98. package/dist/pages/ModuleResolve/index.d.ts +1 -1
  99. package/dist/pages/Overall/constants.d.ts +1 -1
  100. package/dist/pages/Overall/index.d.ts +4 -4
  101. package/dist/pages/Overall/index.js +19 -8
  102. package/dist/pages/Overall/responsiveGridList.d.ts +6 -0
  103. package/dist/pages/Overall/responsiveGridList.js +28 -0
  104. package/dist/pages/Resources/RuleIndex/constants.d.ts +1 -1
  105. package/dist/pages/Resources/RuleIndex/index.d.ts +1 -1
  106. package/dist/pages/WebpackLoaders/Analysis/constants.d.ts +1 -1
  107. package/dist/pages/WebpackLoaders/Analysis/index.d.ts +1 -1
  108. package/dist/pages/WebpackLoaders/Overall/constants.d.ts +1 -1
  109. package/dist/pages/WebpackLoaders/Overall/index.d.ts +1 -1
  110. package/dist/pages/WebpackLoaders/constants.d.ts +1 -1
  111. package/dist/pages/WebpackPlugins/constants.d.ts +1 -1
  112. package/dist/pages/WebpackPlugins/index.d.ts +1 -1
  113. package/dist/pages/index.d.ts +1 -1
  114. package/dist/utils/data/base.d.ts +21 -21
  115. package/dist/utils/data/index.d.ts +2 -2
  116. package/dist/utils/data/local.d.ts +11 -11
  117. package/dist/utils/data/remote.d.ts +7 -7
  118. package/dist/utils/file.d.ts +15 -21
  119. package/dist/utils/hooks.d.ts +4 -4
  120. package/dist/utils/i18n/cn.d.ts +1 -1
  121. package/dist/utils/i18n/en.d.ts +28 -28
  122. package/dist/utils/i18n/index.d.ts +1 -1
  123. package/dist/utils/index.d.ts +1 -1
  124. package/dist/utils/loader.d.ts +1 -1
  125. package/dist/utils/locale.d.ts +1 -1
  126. package/dist/utils/manifest.d.ts +17 -17
  127. package/dist/utils/monaco.d.ts +4 -4
  128. package/dist/utils/request.d.ts +13 -13
  129. package/dist/utils/routes.d.ts +1 -1
  130. package/dist/utils/size.d.ts +1 -1
  131. package/dist/utils/socket.d.ts +1 -1
  132. package/dist/utils/storage.d.ts +1 -1
  133. package/dist/utils/string.d.ts +1 -1
  134. package/dist/utils/time.d.ts +1 -1
  135. package/dist/utils/url.d.ts +1 -1
  136. package/dist/utils/worker/index.d.ts +1 -1
  137. package/dist/utils/worker/master.d.ts +3 -3
  138. package/dist/utils/worker/types.d.ts +3 -3
  139. package/dist/utils/worker/utils.d.ts +4 -6
  140. package/dist/utils/worker/worker.d.ts +11 -11
  141. package/package.json +4 -6
@@ -1,17 +1,28 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Col, Row } from "antd";
3
2
  import { SDK } from "@rsdoctor/types";
4
- import { Size } from "../../constants";
5
- import { BundleOverall, ProjectOverall, CompileOverall } from "../../components/Overall";
6
- import { CompileAlerts, BundleAlerts } from "../../components/Alerts";
3
+ import { BundleAlerts, CompileAlerts } from "../../components/Alerts";
7
4
  import { withServerAPI } from "../../components/Manifest";
5
+ import {
6
+ BundleOverall,
7
+ CompileOverall,
8
+ ProjectOverall
9
+ } from "../../components/Overall";
10
+ import { ResponsiveGridLayout } from "./responsiveGridList";
8
11
  const Component = ({ project }) => {
9
12
  const { summary, configs, root: cwd, envinfo, errors } = project;
10
13
  return /* @__PURE__ */ jsxs("div", { children: [
11
- /* @__PURE__ */ jsxs(Row, { gutter: Size.BasePadding, children: [
12
- /* @__PURE__ */ jsx(Col, { span: 8, children: /* @__PURE__ */ jsx(ProjectOverall, { configs, cwd, envinfo, alerts: errors }) }),
13
- /* @__PURE__ */ jsx(Col, { span: 8, children: /* @__PURE__ */ jsx(BundleOverall, { errors, cwd }) }),
14
- /* @__PURE__ */ jsx(Col, { span: 8, children: /* @__PURE__ */ jsx(CompileOverall, { summary }) })
14
+ /* @__PURE__ */ jsxs(ResponsiveGridLayout, { children: [
15
+ /* @__PURE__ */ jsx(
16
+ ProjectOverall,
17
+ {
18
+ configs,
19
+ cwd,
20
+ envinfo,
21
+ alerts: errors
22
+ }
23
+ ),
24
+ /* @__PURE__ */ jsx(BundleOverall, { errors, cwd }),
25
+ /* @__PURE__ */ jsx(CompileOverall, { summary })
15
26
  ] }),
16
27
  /* @__PURE__ */ jsx(CompileAlerts, {}),
17
28
  /* @__PURE__ */ jsx(BundleAlerts, {})
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ children: React.ReactNode[];
4
+ }
5
+ export declare const ResponsiveGridLayout: ({ children }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,28 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Col, Grid, Row } from "antd";
3
+ import { useMemo } from "react";
4
+ import { Size } from "../../constants";
5
+ const ResponsiveGridLayout = ({ children }) => {
6
+ const { sm, xxl } = Grid.useBreakpoint();
7
+ const gutters = useMemo(() => {
8
+ if (xxl) {
9
+ return [Size.BasePadding * 2, Size.BasePadding];
10
+ } else {
11
+ return [Size.BasePadding, Size.BasePadding];
12
+ }
13
+ }, [sm, xxl]);
14
+ return /* @__PURE__ */ jsx(
15
+ Row,
16
+ {
17
+ gutter: gutters,
18
+ wrap: true,
19
+ style: {
20
+ marginBottom: Size.BasePadding
21
+ },
22
+ children: children.map((e, i) => /* @__PURE__ */ jsx(Col, { xs: 24, sm: 24, md: 12, lg: 8, children: e }, i))
23
+ }
24
+ );
25
+ };
26
+ export {
27
+ ResponsiveGridLayout
28
+ };
@@ -1,3 +1,3 @@
1
1
  import { Client } from '@rsdoctor/types';
2
2
  export declare const name = "Rule Index";
3
- export declare const route = Client.RsdoctorClientRoutes.RuleIndex;
3
+ export declare const route = Client.RsdoctorClientRoutes.RuleIndex;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  export declare const Page: React.FC;
3
- export * from './constants';
3
+ export * from './constants';
@@ -1,3 +1,3 @@
1
1
  import { Client } from '@rsdoctor/types';
2
2
  export declare const name = "Loaders Analysis";
3
- export declare const route = Client.RsdoctorClientRoutes.WebpackLoaderAnalysis;
3
+ export declare const route = Client.RsdoctorClientRoutes.WebpackLoaderAnalysis;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  export declare const Page: React.FC;
3
- export * from './constants';
3
+ export * from './constants';
@@ -1,3 +1,3 @@
1
1
  import { Client } from '@rsdoctor/types';
2
2
  export declare const name = "Loaders Timeline";
3
- export declare const route = Client.RsdoctorClientRoutes.WebpackLoaderOverall;
3
+ export declare const route = Client.RsdoctorClientRoutes.WebpackLoaderOverall;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  export declare const Page: React.FC;
3
- export * from './constants';
3
+ export * from './constants';
@@ -1,2 +1,2 @@
1
1
  export declare const name = "Loaders";
2
- export declare const route = "/webpack/loaders";
2
+ export declare const route = "/webpack/loaders";
@@ -1,3 +1,3 @@
1
1
  import { Client } from '@rsdoctor/types';
2
2
  export declare const name = "Plugins Analysis";
3
- export declare const route = Client.RsdoctorClientRoutes.WebpackPlugins;
3
+ export declare const route = Client.RsdoctorClientRoutes.WebpackPlugins;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  export declare const Page: React.FC;
3
- export * from './constants';
3
+ export * from './constants';
@@ -5,4 +5,4 @@ export * as LoaderTimeline from './WebpackLoaders/Overall';
5
5
  export * as LoaderFiles from './WebpackLoaders/Analysis';
6
6
  export * as PluginsAnalyze from './WebpackPlugins';
7
7
  export * as ModuleResolve from './ModuleResolve';
8
- export * as RuleIndex from './Resources/RuleIndex';
8
+ export * as RuleIndex from './Resources/RuleIndex';
@@ -1,24 +1,24 @@
1
1
  import { Common, Manifest, SDK } from '@rsdoctor/types';
2
2
  import { Data } from '@rsdoctor/utils/common';
3
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'): 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
- }
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'): 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
+ }
@@ -1,5 +1,5 @@
1
1
  import { Manifest } from '@rsdoctor/types';
2
2
  import { BaseDataLoader } from './base';
3
3
  export declare function useDataLoader(manifest: Manifest.RsdoctorManifestWithShardingFiles | void): {
4
- loader: void | BaseDataLoader;
5
- };
4
+ loader: void | BaseDataLoader;
5
+ };
@@ -1,14 +1,14 @@
1
1
  import { Common, Manifest, SDK } from '@rsdoctor/types';
2
2
  import { BaseDataLoader } from './base';
3
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
- }
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
+ }
@@ -1,10 +1,10 @@
1
1
  import { Manifest, SDK } from '@rsdoctor/types';
2
2
  import { BaseDataLoader } from './base';
3
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
- }
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
+ }
@@ -3,29 +3,23 @@ import { Common } from '@rsdoctor/types';
3
3
  import { UploadFile } from 'antd';
4
4
  import { FieldDataNode } from 'rc-tree';
5
5
  export type DataNode = FieldDataNode<{
6
- key: string | number;
7
- title?: React.ReactNode | ((data: DataNode) => React.ReactNode);
6
+ key: string | number;
7
+ title?: React.ReactNode | ((data: DataNode) => React.ReactNode);
8
8
  }> & {
9
- __BASENAME__?: any;
10
- __RESOURCEPATH__?: any;
11
- children?: DataNode[];
9
+ __BASENAME__?: any;
10
+ __RESOURCEPATH__?: any;
11
+ children?: DataNode[];
12
12
  };
13
13
  export declare const rootDirname: (file: string, sep?: string) => string | null;
14
14
  export declare function mapFileKey(arr: DataNode[], depth?: number, filter?: (node: DataNode) => boolean): DataNode['key'][];
15
15
  export declare function flattenDirectory(n: DataNode, parent: DataNode, sep: string | undefined, inlinedResourcePathKey: keyof DataNode, dirTitle?: (_dir: DataNode, defaultTitle: string) => JSX.Element | string): void;
16
- export declare function createFileStructures({
17
- files,
18
- sep,
19
- inlinedResourcePathKey,
20
- fileTitle,
21
- dirTitle
22
- }: {
23
- files: string[];
24
- cwd?: string;
25
- sep?: string;
26
- inlinedResourcePathKey?: keyof DataNode;
27
- dirTitle?(dir: DataNode, defaultTitle: string): JSX.Element | string;
28
- fileTitle?(file: string, basename: string): JSX.Element | string;
16
+ export declare function createFileStructures({ files, sep, inlinedResourcePathKey, fileTitle, dirTitle, }: {
17
+ files: string[];
18
+ cwd?: string;
19
+ sep?: string;
20
+ inlinedResourcePathKey?: keyof DataNode;
21
+ dirTitle?(dir: DataNode, defaultTitle: string): JSX.Element | string;
22
+ fileTitle?(file: string, basename: string): JSX.Element | string;
29
23
  }): DataNode[];
30
24
  export declare function beautifyPath(path: string, cwd: string): string;
31
25
  export declare function readJSONByFileReader<T extends Common.PlainObject>(file: UploadFile): Promise<T>;
@@ -34,6 +28,6 @@ export declare function readJSONByFileReader<T extends Common.PlainObject>(file:
34
28
  * beautify module path, will replace cwd & last 'node_modules'
35
29
  */
36
30
  export declare function beautifyModulePath(modulePath: string, cwd: string): {
37
- alias: string;
38
- inNodeModules: boolean;
39
- };
31
+ alias: string;
32
+ inNodeModules: boolean;
33
+ };
@@ -6,9 +6,9 @@ export declare const useI18n: typeof useTranslation;
6
6
  export declare function useRuleIndexNavigate(code: string, link?: string | undefined): () => void;
7
7
  export declare function useUrlQuery(): Record<string, string | undefined>;
8
8
  export declare function useLoading(defaultLoading?: boolean): {
9
- loading: boolean;
10
- setLoading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
11
- withLoading(func: (...args: unknown[]) => Promise<unknown> | unknown): Promise<void>;
9
+ loading: boolean;
10
+ setLoading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
11
+ withLoading(func: (...args: unknown[]) => Promise<unknown> | unknown): Promise<void>;
12
12
  };
13
13
  export declare function useProjectRootByManifest(manifest: Manifest.RsdoctorManifest): string;
14
14
  export declare function useHashByManifest(manifest: Manifest.RsdoctorManifest): string;
@@ -28,4 +28,4 @@ export declare function useBundleAlertsByErrors(errors: Manifest.RsdoctorManifes
28
28
  export declare function useDuplicatePackagesByErrors(errors: Manifest.RsdoctorManifestData['errors']): Rule.PackageRelationDiffRuleStoreData[];
29
29
  export declare function useWebpackConfigurationByConfigs(configs?: SDK.ConfigData): SDK.WebpackConfigData | null | undefined;
30
30
  export declare function useDetectIfCloudIdeEnv(): boolean;
31
- export declare function useWindowWidth(): number;
31
+ export declare function useWindowWidth(): number;
@@ -1,3 +1,3 @@
1
1
  import en from './en';
2
2
  declare const cn: typeof en;
3
- export default cn;
3
+ export default cn;
@@ -1,30 +1,30 @@
1
1
  declare const en: {
2
- Overall: string;
3
- 'Compile Analysis': string;
4
- LoadersAnalysis: string;
5
- 'Loaders Timeline': string;
6
- 'Loaders Analysis': string;
7
- PluginsAnalysis: string;
8
- ModuleResolve: string;
9
- 'Bundle Analysis': string;
10
- BundleSize: string;
11
- 'Module Graph': string;
12
- TreeShaking: string;
13
- 'Rule Index': string;
14
- Resources: string;
15
- 'Project Overall': string;
16
- 'Compile Overall': string;
17
- 'Bundle Overall': string;
18
- 'Expand Omitted': string;
19
- 'Concatenated Tag': string;
20
- 'the file content not changed after transpiled by this loader': string;
21
- /** Bundle Size */
22
- 'Output Assets List': string;
23
- 'filter the output assets which size is greater than the input value': string;
24
- 'filter the modules which size is greater than the input value': string;
25
- 'After Compile': string;
26
- 'After Bundle': string;
27
- CodeModeExplain: string;
28
- DuplicatePakCodeExplain: string;
2
+ Overall: string;
3
+ 'Compile Analysis': string;
4
+ LoadersAnalysis: string;
5
+ 'Loaders Timeline': string;
6
+ 'Loaders Analysis': string;
7
+ PluginsAnalysis: string;
8
+ ModuleResolve: string;
9
+ 'Bundle Analysis': string;
10
+ BundleSize: string;
11
+ 'Module Graph': string;
12
+ TreeShaking: string;
13
+ 'Rule Index': string;
14
+ Resources: string;
15
+ 'Project Overall': string;
16
+ 'Compile Overall': string;
17
+ 'Bundle Overall': string;
18
+ 'Expand Omitted': string;
19
+ 'Concatenated Tag': string;
20
+ 'the file content not changed after transpiled by this loader': string;
21
+ /** Bundle Size */
22
+ 'Output Assets List': string;
23
+ 'filter the output assets which size is greater than the input value': string;
24
+ 'filter the modules which size is greater than the input value': string;
25
+ 'After Compile': string;
26
+ 'After Bundle': string;
27
+ CodeModeExplain: string;
28
+ DuplicatePakCodeExplain: string;
29
29
  };
30
- export default en;
30
+ export default en;
@@ -1,2 +1,2 @@
1
1
  import i18n from 'i18next';
2
- export default i18n;
2
+ export default i18n;
@@ -13,4 +13,4 @@ export * from './string';
13
13
  export * from './time';
14
14
  export * from './url';
15
15
  export * from './worker';
16
- export * from './loader';
16
+ export * from './loader';
@@ -4,4 +4,4 @@ declare const findLoaderTotalTiming: typeof Loader.findLoaderTotalTiming, getLoa
4
4
  export { findLoaderTotalTiming, getLoaderCosts };
5
5
  export declare function flattenLoaderData(loaderData: SDK.LoaderData): SDK.LoaderTransformData[];
6
6
  export declare function filterLoaders(loaderData: SDK.ResourceLoaderData, keyword: string, loaderNames: string[]): SDK.LoaderTransformData[];
7
- export declare function filterLoader(resourcePath: string, loader: string, keyword: string, loaderNames: string[]): boolean;
7
+ export declare function filterLoader(resourcePath: string, loader: string, keyword: string, loaderNames: string[]): boolean;
@@ -1,2 +1,2 @@
1
1
  import type { Locale } from 'antd/es/locale';
2
- export declare function getLocale(locale: string): Locale;
2
+ export declare function getLocale(locale: string): Locale;
@@ -4,24 +4,24 @@ import { Theme, ViewMode } from '../constants';
4
4
  export declare function useManifestJson(): Manifest.RsdoctorManifest;
5
5
  export declare function useLocale(): import("../constants").Language;
6
6
  export declare function useTheme(): {
7
- theme: Theme;
8
- setTheme: (theme: Theme) => void;
9
- isDark: boolean;
10
- isLight: boolean;
7
+ theme: Theme;
8
+ setTheme: (theme: Theme) => void;
9
+ isDark: boolean;
10
+ isLight: boolean;
11
11
  };
12
12
  export declare function useViewMode(): {
13
- viewMode: {
14
- bundleAlerts: ViewMode;
15
- compileAlerts: ViewMode;
16
- };
17
- setViewMode: (mode: Partial<{
18
- bundleAlerts: ViewMode;
19
- compileAlerts: ViewMode;
20
- }>, saveStorage?: boolean | undefined) => void;
21
- setCompileAlertsViewMode(mode: ViewMode): void;
22
- setBundleAlertsViewMode(mode: ViewMode): void;
23
- isCompileList: boolean;
24
- isBundleList: boolean;
13
+ viewMode: {
14
+ bundleAlerts: ViewMode;
15
+ compileAlerts: ViewMode;
16
+ };
17
+ setViewMode: (mode: Partial<{
18
+ bundleAlerts: ViewMode;
19
+ compileAlerts: ViewMode;
20
+ }>, saveStorage?: boolean | undefined) => void;
21
+ setCompileAlertsViewMode(mode: ViewMode): void;
22
+ setBundleAlertsViewMode(mode: ViewMode): void;
23
+ isCompileList: boolean;
24
+ isBundleList: boolean;
25
25
  };
26
26
  export declare function useManifest(url: string): Manifest.RsdoctorManifestWithShardingFiles | undefined;
27
- export declare function useModuleGraphInstanceByModuleGraph(moduleGraph: SDK.ModuleGraphData): ModuleGraph;
27
+ export declare function useModuleGraphInstanceByModuleGraph(moduleGraph: SDK.ModuleGraphData): ModuleGraph;
@@ -3,10 +3,10 @@ import type { Range as RangeClass } from 'monaco-editor';
3
3
  export declare function getOriginalLanguage(filepath: string): string;
4
4
  export declare function getModifiedLanguage(filepath: string): string;
5
5
  export declare function getRevealPositionForViewer(startLineNumber: number, startColumn: number): {
6
- lineNumber: number;
7
- column: number;
6
+ lineNumber: number;
7
+ column: number;
8
8
  };
9
9
  export declare function getSelectionRange(source: SDK.SourceRange, Range: typeof RangeClass): RangeClass;
10
10
  export declare function useMonacoEditor(): {
11
- initMonaco: (monacoRef: any) => Promise<void>;
12
- };
11
+ initMonaco: (monacoRef: any) => Promise<void>;
12
+ };
@@ -1,23 +1,23 @@
1
1
  import { Manifest, SDK } from '@rsdoctor/types';
2
2
  export declare function fetchShardingFile(url: string): Promise<string>;
3
3
  export declare function loadManifestByUrl(url: string): Promise<{
4
- data: Manifest.RsdoctorManifestData;
5
- __LOCAL__SERVER__?: boolean | undefined;
6
- __SOCKET__URL__?: string | undefined;
7
- client: Manifest.RsdoctorManifestClient;
8
- name?: string | undefined;
9
- series?: Manifest.RsdoctorManifestSeriesData[] | undefined;
4
+ data: Manifest.RsdoctorManifestData;
5
+ __LOCAL__SERVER__?: boolean | undefined;
6
+ __SOCKET__URL__?: string | undefined;
7
+ client: Manifest.RsdoctorManifestClient;
8
+ name?: string | undefined;
9
+ series?: Manifest.RsdoctorManifestSeriesData[] | undefined;
10
10
  }>;
11
11
  export declare function fetchJSONByUrl(url: string): Promise<Manifest.RsdoctorManifestWithShardingFiles>;
12
12
  export declare function fetchJSONByUrls(urls: string[]): Promise<Manifest.RsdoctorManifestWithShardingFiles[]>;
13
13
  export declare function parseManifest(json: Manifest.RsdoctorManifestWithShardingFiles): Promise<{
14
- data: Manifest.RsdoctorManifestData;
15
- __LOCAL__SERVER__?: boolean | undefined;
16
- __SOCKET__URL__?: string | undefined;
17
- client: Manifest.RsdoctorManifestClient;
18
- name?: string | undefined;
19
- series?: Manifest.RsdoctorManifestSeriesData[] | undefined;
14
+ data: Manifest.RsdoctorManifestData;
15
+ __LOCAL__SERVER__?: boolean | undefined;
16
+ __SOCKET__URL__?: string | undefined;
17
+ client: Manifest.RsdoctorManifestClient;
18
+ name?: string | undefined;
19
+ series?: Manifest.RsdoctorManifestSeriesData[] | undefined;
20
20
  }>;
21
21
  export declare function getManifestUrl(): string;
22
22
  export declare function fetchManifest(url?: string): Promise<Manifest.RsdoctorManifestWithShardingFiles>;
23
- 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>;
23
+ 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>;
@@ -1,3 +1,3 @@
1
1
  import { Manifest } from '@rsdoctor/types';
2
2
  export declare function hasCompile(routes: Manifest.RsdoctorManifestClientRoutes[]): boolean;
3
- export declare function hasBundle(routes: Manifest.RsdoctorManifestClientRoutes[]): boolean;
3
+ export declare function hasBundle(routes: Manifest.RsdoctorManifestClientRoutes[]): boolean;
@@ -1,2 +1,2 @@
1
1
  export declare function formatSize(bytes: number): string;
2
- export declare function formatPercent(percent: number): string;
2
+ export declare function formatPercent(percent: number): string;
@@ -1,2 +1,2 @@
1
1
  import { Socket } from 'socket.io-client';
2
- export declare function getSocket(socketUrl?: string): Socket;
2
+ export declare function getSocket(socketUrl?: string): Socket;
@@ -10,4 +10,4 @@ export declare function getViewModeFromStorage(): Config['viewMode'];
10
10
  export declare function setViewModeToStorage(viewMode: Config['viewMode']): void;
11
11
  export declare function hasViewModeFromStorage(): boolean;
12
12
  export declare function setAPILoaderModeToStorage(mode: APILoaderMode4Dev): void;
13
- export declare function getAPILoaderModeFromStorage(): string;
13
+ export declare function getAPILoaderModeFromStorage(): string;
@@ -1,2 +1,2 @@
1
1
  export declare function ensurePrefix(str: string, prefix: string): string;
2
- export declare function removePrefix(str: string, prefix: string): string;
2
+ export declare function removePrefix(str: string, prefix: string): string;
@@ -1,3 +1,3 @@
1
1
  import { Time } from '@rsdoctor/utils/common';
2
2
  declare const toFixedDigits: typeof Time.toFixedDigits, getUnit: typeof Time.getUnit, formatCosts: typeof Time.formatCosts;
3
- export { toFixedDigits as toFixed, getUnit, formatCosts };
3
+ export { toFixedDigits as toFixed, getUnit, formatCosts };
@@ -3,4 +3,4 @@ export declare function getManifestUrlFromUrlQuery(): string | void;
3
3
  export declare function changeOrigin(origin: string): string;
4
4
  export declare function getSharingUrl(manifestCloudUrl: string): string;
5
5
  export declare function getDemoUrl(): string | null;
6
- export declare const getShortPath: (path: string) => string;
6
+ export declare const getShortPath: (path: string) => string;
@@ -1,4 +1,4 @@
1
1
  export * from './utils';
2
2
  export * from './types';
3
3
  export * from './master';
4
- export * from './worker';
4
+ export * from './worker';
@@ -1,8 +1,8 @@
1
1
  import { CreateWorker } from './types';
2
2
  import { ChildWorker } from './worker';
3
3
  declare class Master {
4
- private _workerMap;
5
- detectWorker(create: CreateWorker): ChildWorker;
4
+ private _workerMap;
5
+ detectWorker(create: CreateWorker): ChildWorker;
6
6
  }
7
7
  export declare const master: Master;
8
- export {};
8
+ export {};
@@ -1,9 +1,9 @@
1
1
  export type CreateWorker = () => Worker;
2
2
  export type NativeWorkerMessage<T = unknown> = MessageEvent<WorkerMessage<T>>;
3
3
  export type WorkerMessage<T = unknown> = {
4
- id: number | string;
5
- data: T;
4
+ id: number | string;
5
+ data: T;
6
6
  };
7
7
  export type InternalWorkerEventCallback<T> = (message: WorkerMessage<T>) => unknown;
8
8
  export type UserWorkerEventCallback<T = unknown> = (data: T) => unknown;
9
- export type UserWorkerEventHandler<T = unknown, R = unknown> = (data: T) => R | Promise<R>;
9
+ export type UserWorkerEventHandler<T = unknown, R = unknown> = (data: T) => R | Promise<R>;
@@ -1,9 +1,7 @@
1
1
  import { NativeWorkerMessage, UserWorkerEventHandler, WorkerMessage } from './types';
2
2
  export declare function sendMessageInClient<T>(msg: WorkerMessage<T>, worker: Worker): void;
3
3
  export declare function sendMessageInWorker<T>(receivedMsg: NativeWorkerMessage, response: T): void;
4
- export declare function handleMessageInWorker<T, R>({
5
- handler
6
- }: {
7
- workerName: string;
8
- handler: UserWorkerEventHandler<T, R>;
9
- }): void;
4
+ export declare function handleMessageInWorker<T, R>({ handler, }: {
5
+ workerName: string;
6
+ handler: UserWorkerEventHandler<T, R>;
7
+ }): void;
@@ -1,13 +1,13 @@
1
1
  import { UserWorkerEventCallback } from './types';
2
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
- }
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
+ }