@rsdoctor/graph 1.0.0-rc.0 → 1.0.1-beta.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.
package/README.md CHANGED
@@ -1,14 +1,7 @@
1
- # Rsdoctor graph
1
+ # @rsdoctor/graph
2
2
 
3
3
  This package is the intermediate data layer of Rsdoctor.
4
4
 
5
- ## features
6
-
7
- - Rsdoctor is a one-stop tool for diagnosing and analyzing the build process and build artifacts.
8
- - Rsdoctor is a tool that supports Webpack and Rspack build analysis.
9
- - Rsdoctor is an analysis tool that can display the time-consuming and behavioral details of the compilation.
10
- - Rsdoctor is a tool that provides bundle Diff and other anti-degradation capabilities simultaneously.
11
-
12
5
  ## Documentation
13
6
 
14
7
  https://rsdoctor.dev/
@@ -22,6 +22,7 @@ __export(asset_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(asset_exports);
24
24
  var import_types = require("@rsdoctor/types");
25
+ var import_node_zlib = require("node:zlib");
25
26
  let id = 1;
26
27
  class Asset {
27
28
  static init() {
@@ -39,6 +40,7 @@ class Asset {
39
40
  id: this.id,
40
41
  path: this.path,
41
42
  size: this.size,
43
+ gzipSize: this.gzipSize,
42
44
  chunks: this.chunks?.map((ck) => ck.id),
43
45
  content: types === import_types.SDK.ToDataType.NoSourceAndAssets || types === import_types.SDK.ToDataType.NoCode ? "" : this.content
44
46
  };
@@ -50,6 +52,9 @@ class Asset {
50
52
  setId(id2) {
51
53
  this.id = id2;
52
54
  }
55
+ setGzipSize(content) {
56
+ this.gzipSize = (0, import_node_zlib.gzipSync)(content, { level: 9 }).length;
57
+ }
53
58
  }
54
59
  // Annotate the CommonJS export names for ESM import in node:
55
60
  0 && (module.exports = {
@@ -1,4 +1,5 @@
1
1
  import { SDK } from "@rsdoctor/types";
2
+ import { gzipSync } from "node:zlib";
2
3
  let id = 1;
3
4
  class Asset {
4
5
  static init() {
@@ -16,6 +17,7 @@ class Asset {
16
17
  id: this.id,
17
18
  path: this.path,
18
19
  size: this.size,
20
+ gzipSize: this.gzipSize,
19
21
  chunks: this.chunks?.map((ck) => ck.id),
20
22
  content: types === SDK.ToDataType.NoSourceAndAssets || types === SDK.ToDataType.NoCode ? "" : this.content
21
23
  };
@@ -27,6 +29,9 @@ class Asset {
27
29
  setId(id2) {
28
30
  this.id = id2;
29
31
  }
32
+ setGzipSize(content) {
33
+ this.gzipSize = gzipSync(content, { level: 9 }).length;
34
+ }
30
35
  }
31
36
  export {
32
37
  Asset
@@ -6,9 +6,11 @@ export declare class Asset implements SDK.AssetInstance {
6
6
  size: number;
7
7
  content: string;
8
8
  chunks: SDK.ChunkInstance[];
9
+ gzipSize: number | undefined;
9
10
  constructor(path: string, size: number, chunks: SDK.ChunkInstance[], content: string);
10
11
  toData(types: SDK.ToDataType): SDK.AssetData;
11
12
  setChunks(chunks: SDK.ChunkInstance[]): void;
12
13
  setId(id: number): void;
14
+ setGzipSize(content: string): void;
13
15
  }
14
16
  //# sourceMappingURL=asset.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../../../../src/graph/chunk-graph/asset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAItC,qBAAa,KAAM,YAAW,GAAG,CAAC,aAAa;IAC7C,MAAM,CAAC,IAAI;IAIX,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,GAAG,CAAC,aAAa,EAAE,CAAC;gBAG1B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,GAAG,CAAC,aAAa,EAAE,EAC3B,OAAO,EAAE,MAAM;IASjB,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC,SAAS;IAe5C,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,aAAa,EAAE;IAIrC,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;CAGxB"}
1
+ {"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../../../../src/graph/chunk-graph/asset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAItC,qBAAa,KAAM,YAAW,GAAG,CAAC,aAAa;IAC7C,MAAM,CAAC,IAAI;IAIX,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,GAAG,CAAC,aAAa,EAAE,CAAC;IAC5B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;gBAG3B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,GAAG,CAAC,aAAa,EAAE,EAC3B,OAAO,EAAE,MAAM;IASjB,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC,SAAS;IAgB5C,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,aAAa,EAAE;IAIrC,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAIvB,WAAW,CAAC,OAAO,EAAE,MAAM;CAG5B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsdoctor/graph",
3
- "version": "1.0.0-rc.0",
3
+ "version": "1.0.1-beta.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/web-infra-dev/rsdoctor",
@@ -17,8 +17,8 @@
17
17
  "lodash.unionby": "^4.8.0",
18
18
  "socket.io": "4.8.1",
19
19
  "source-map": "^0.7.4",
20
- "@rsdoctor/types": "1.0.0-rc.0",
21
- "@rsdoctor/utils": "1.0.0-rc.0"
20
+ "@rsdoctor/types": "1.0.1-beta.0",
21
+ "@rsdoctor/utils": "1.0.1-beta.0"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@types/body-parser": "1.19.5",