@rsdoctor/components 0.0.2-beta.2 → 0.1.0

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.
@@ -135,7 +135,7 @@ const PackageRelationAlert = ({
135
135
  /* @__PURE__ */ jsx(
136
136
  Typography.Paragraph,
137
137
  {
138
- style: { marginBottom: 0, width: windowWith > 1500 ? "50vw" : windowWith > 1200 ? "40vw" : "30vw" },
138
+ style: { marginBottom: 0, width: windowWith > 1500 ? "40rem" : windowWith > 1200 ? "30rem" : "20rem" },
139
139
  copyable: { text: el.root },
140
140
  ellipsis: { rows: 1, expandable: true, symbol: /* @__PURE__ */ jsx(ExpandAltOutlined, {}), tooltip: el.root },
141
141
  code: true,
@@ -3,7 +3,6 @@ import './tooltips.scss';
3
3
  import { DurationMetric, ITraceEventData } from './types';
4
4
  export declare function getTooltipHtmlForLoader(loader: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderChartData>[0]): string;
5
5
  export declare function renderTotalLoadersTooltip(loaderName: string, loaders: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderChartData>, cwd: string): string;
6
- export declare function replaceSlashWithNewline(input: string): string;
7
6
  export declare function transformDurationMetric(rawData: DurationMetric[]): ITraceEventData[];
8
7
  export declare function processTrans(rawData: DurationMetric[]): ITraceEventData[];
9
8
  export declare function formatterForPlugins(raw: {
@@ -70,21 +70,6 @@ function renderTotalLoadersTooltip(loaderName, loaders, cwd) {
70
70
  </div>
71
71
  `.trim();
72
72
  }
73
- function replaceSlashWithNewline(input) {
74
- let result = "";
75
- for (let i = 0; i < input.length; i++) {
76
- if (input[i] === "/") {
77
- if (true) {
78
- result += "/\n";
79
- } else {
80
- result += "/";
81
- }
82
- } else {
83
- result += input[i];
84
- }
85
- }
86
- return result;
87
- }
88
73
  function transformDurationMetric(rawData) {
89
74
  return rawData.reduce((acc, cur) => {
90
75
  if (cur.c) {
@@ -198,6 +183,5 @@ export {
198
183
  getTooltipHtmlForLoader,
199
184
  processTrans,
200
185
  renderTotalLoadersTooltip,
201
- replaceSlashWithNewline,
202
186
  transformDurationMetric
203
187
  };
@@ -72,15 +72,15 @@ const ModuleCodeViewer = ({ data }) => {
72
72
  title: /* @__PURE__ */ jsx(Typography.Title, { level: 5, children: "Explain" }),
73
73
  content: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", marginBottom: 30 }, children: [
74
74
  /* @__PURE__ */ jsxs("div", { children: [
75
- /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: "source: " }),
75
+ /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: "Source: " }),
76
76
  /* @__PURE__ */ jsx(Typography.Text, { children: TAB_MAP.source })
77
77
  ] }),
78
78
  /* @__PURE__ */ jsxs("div", { children: [
79
- /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: "transformed: " }),
79
+ /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: "Transformed: " }),
80
80
  /* @__PURE__ */ jsx(Typography.Text, { children: TAB_MAP.transformed })
81
81
  ] }),
82
82
  /* @__PURE__ */ jsxs("div", { children: [
83
- /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: "parsedSource: " }),
83
+ /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: "Bundled Source: " }),
84
84
  /* @__PURE__ */ jsx(Typography.Text, { children: TAB_MAP.parsedSource })
85
85
  ] }),
86
86
  /* @__PURE__ */ jsx("br", {}),
@@ -163,7 +163,7 @@ const ModulesStatistics = ({ modules, chunks, filteredModules }) => {
163
163
  {
164
164
  title: /* @__PURE__ */ jsxs(Space, { direction: "vertical", children: [
165
165
  /* @__PURE__ */ jsxs(Typography.Text, { style: { color: "inherit" }, children: [
166
- "Total modules parsed size: ",
166
+ "Total modules bundled size: ",
167
167
  formatSize(parsedSize)
168
168
  ] }),
169
169
  /* @__PURE__ */ jsxs(Typography.Text, { style: { color: "inherit" }, children: [
@@ -171,7 +171,7 @@ const ModulesStatistics = ({ modules, chunks, filteredModules }) => {
171
171
  formatSize(sourceSize)
172
172
  ] }),
173
173
  /* @__PURE__ */ jsxs(Typography.Text, { style: { color: "inherit" }, children: [
174
- "Filtered modules parsed size: ",
174
+ "Filtered modules bundled size: ",
175
175
  formatSize(filteredParsedSize)
176
176
  ] }),
177
177
  /* @__PURE__ */ jsxs(Typography.Text, { style: { color: "inherit" }, children: [
@@ -245,11 +245,11 @@ const AssetDetail = ({ asset, chunks: includeChunks, modules: includeModules, mo
245
245
  Tooltip,
246
246
  {
247
247
  title: /* @__PURE__ */ jsxs(Space, { direction: "vertical", children: [
248
- /* @__PURE__ */ jsx(Tag, { color: "orange", children: "Parsed Size:" + formatSize(parsedSize) }),
248
+ /* @__PURE__ */ jsx(Tag, { color: "orange", children: "Bundled Size:" + formatSize(parsedSize) }),
249
249
  /* @__PURE__ */ jsx(Tag, { color: "volcano", children: "Source Size:" + formatSize(sourceSize) })
250
250
  ] }),
251
251
  color: "white",
252
- children: /* @__PURE__ */ jsx(Tag, { color: "purple", style: tagStyle, children: "Parsed: " + formatSize(parsedSize) })
252
+ children: /* @__PURE__ */ jsx(Tag, { color: "purple", style: tagStyle, children: "Bundled: " + formatSize(parsedSize) })
253
253
  }
254
254
  ) : sourceSize !== 0 ? (
255
255
  // fallback to display tag for source size
@@ -315,7 +315,7 @@ const AssetDetail = ({ asset, chunks: includeChunks, modules: includeModules, mo
315
315
  const parsedSize = sumBy(mods, (e) => e.size?.parsedSize || 0);
316
316
  return /* @__PURE__ */ jsxs(Space, { children: [
317
317
  /* @__PURE__ */ jsx(Typography.Text, { children: defaultTitle }),
318
- parsedSize > 0 ? /* @__PURE__ */ jsx(Tag, { style: tagStyle, color: "orange", children: "Parsed:" + formatSize(parsedSize) }) : null
318
+ parsedSize > 0 ? /* @__PURE__ */ jsx(Tag, { style: tagStyle, color: "orange", children: "Bundled:" + formatSize(parsedSize) }) : null
319
319
  ] });
320
320
  }
321
321
  return defaultTitle;
@@ -208,8 +208,8 @@ const WebpackModulesOverallBase = ({
208
208
  /* @__PURE__ */ jsx(Typography.Text, { children: ": View the module dependency, that is, module reasons in stats.json." })
209
209
  ] }) }),
210
210
  /* @__PURE__ */ jsx(Row, { children: /* @__PURE__ */ jsxs(Col, { children: [
211
- /* @__PURE__ */ jsx(Tag, { color: "purple", children: "Parsed: 15.77 KB" }),
212
- /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: "Parsed Size" }),
211
+ /* @__PURE__ */ jsx(Tag, { color: "purple", children: "Bundled: 15.77 KB" }),
212
+ /* @__PURE__ */ jsx(Typography.Text, { strong: true, children: "Bundled Size" }),
213
213
  /* @__PURE__ */ jsx(Typography.Text, { children: "The size of the code which bundled. That is, after bundle and tree-shaking." })
214
214
  ] }) }),
215
215
  /* @__PURE__ */ jsx(Row, { children: /* @__PURE__ */ jsxs(Col, { children: [
@@ -68,7 +68,7 @@ const FileTree = (props) => {
68
68
  {
69
69
  className: `${prefix}-node-title-tag`,
70
70
  color: TAG_PALLETE.COLOR_B,
71
- children: `Parsed: ${node.data.size}`
71
+ children: `Bundled: ${node.data.size}`
72
72
  },
73
73
  `${node.data.name}-size-tag`
74
74
  ) : /* @__PURE__ */ jsx(Fragment, {}),
@@ -16,7 +16,7 @@ const cn = {
16
16
  "Compile Overall": "编译数据概览",
17
17
  "Bundle Overall": "产物数据概览",
18
18
  "Expand Omitted": " reasons 树会默认折叠中间的第三方引入的模块,点击这个图标可以查看完整树图",
19
- "Concatenated Tag": "串联模块,hover 上去可以显示聚合成的主模块名称。注:聚合模块 parsed size 为零,有可能是因为被聚合到了主模块中。",
19
+ "Concatenated Tag": "串联模块,hover 上去可以显示聚合成的主模块名称。注:聚合模块 bundled size 为零,有可能是因为被聚合到了主模块中。",
20
20
  "the file content not changed after transpiled by this loader": "该文件内容在 loader 处理前后没有发生变化",
21
21
  /** Bundle Size */
22
22
  "Output Assets List": "产物文件列表",
@@ -16,7 +16,7 @@ const en = {
16
16
  "Compile Overall": "Compile Overall",
17
17
  "Bundle Overall": "Bundle Overall",
18
18
  "Expand Omitted": "By default, the reasons tree collapses to the middle of the module introduced by a third party. Click on this icon to view the full tree diagram",
19
- "Concatenated Tag": "Concatenated Module,hover can display the name of the concatenated main module. Note: the parsed size of the concatenated module is zero, possibly because it is aggregated into the main module.",
19
+ "Concatenated Tag": "Concatenated Module,hover can display the name of the concatenated main module. Note: the bundled size of the concatenated module is zero, possibly because it is aggregated into the main module.",
20
20
  "the file content not changed after transpiled by this loader": "the file content not changed after transpiled by this loader",
21
21
  /** Bundle Size */
22
22
  "Output Assets List": "Output Assets List",
@@ -6,7 +6,12 @@ function flattenLoaderData(loaderData) {
6
6
  }
7
7
  function filterLoaders(loaderData, keyword, loaderNames) {
8
8
  return loaderData.loaders.filter((item) => {
9
- return filterLoader(loaderData.resource.path, item.loader, keyword, loaderNames);
9
+ return filterLoader(
10
+ loaderData.resource.path,
11
+ item.loader,
12
+ keyword,
13
+ loaderNames
14
+ );
10
15
  });
11
16
  }
12
17
  function filterLoader(resourcePath, loader, keyword, loaderNames) {
@@ -14,7 +19,7 @@ function filterLoader(resourcePath, loader, keyword, loaderNames) {
14
19
  if (resourcePath.indexOf(keyword) === -1)
15
20
  return false;
16
21
  }
17
- if (loaderNames && loaderNames.length) {
22
+ if (loaderNames?.length) {
18
23
  if (!includes(loaderNames, loader))
19
24
  return false;
20
25
  }
@@ -80,7 +80,7 @@ if (process.env.NODE_ENV === "development") {
80
80
  if (getAPILoaderModeFromStorage() === APILoaderMode4Dev.Local) {
81
81
  axios.interceptors.request.use((c) => {
82
82
  c.withCredentials = false;
83
- if (c.url && c.url.startsWith("/")) {
83
+ if (c.url?.startsWith("/")) {
84
84
  if (c.url === manifestUrlForDev) {
85
85
  c.url = SDK.ServerAPI.API.Manifest;
86
86
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsdoctor/components",
3
- "version": "0.0.2-beta.2",
3
+ "version": "0.1.0",
4
4
  "main": "./dist/index.js",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",
@@ -73,9 +73,9 @@
73
73
  "terser": "^5.26.0",
74
74
  "typescript": "^5.2.2",
75
75
  "url-parse": "1.5.10",
76
- "@rsdoctor/utils": "0.0.2-beta.2",
77
- "@rsdoctor/types": "0.0.2-beta.2",
78
- "@rsdoctor/graph": "0.0.2-beta.2"
76
+ "@rsdoctor/graph": "0.1.0",
77
+ "@rsdoctor/types": "0.1.0",
78
+ "@rsdoctor/utils": "0.1.0"
79
79
  },
80
80
  "publishConfig": {
81
81
  "access": "public",