@atlaspack/reporter-bundle-stats 2.14.5-canary.14 → 2.14.5-canary.141

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/CHANGELOG.md CHANGED
@@ -1,5 +1,156 @@
1
1
  # @atlaspack/reporter-bundle-stats
2
2
 
3
+ ## 2.14.22
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`069de47`](https://github.com/atlassian-labs/atlaspack/commit/069de478e64fb5889f6f2ce023eb510782767fbd)]:
8
+ - @atlaspack/core@2.20.0
9
+ - @atlaspack/utils@2.17.3
10
+ - @atlaspack/plugin@2.14.21
11
+
12
+ ## 2.14.21
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [[`daaa768`](https://github.com/atlassian-labs/atlaspack/commit/daaa7688786772d7e3713b71c5bba6b89ec704aa), [`a0b959f`](https://github.com/atlassian-labs/atlaspack/commit/a0b959fbf61fc3f820ff03c7e8988945fe40a91a)]:
17
+ - @atlaspack/plugin@2.14.20
18
+ - @atlaspack/core@2.19.2
19
+ - @atlaspack/utils@2.17.2
20
+
21
+ ## 2.14.20
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies []:
26
+ - @atlaspack/core@2.19.1
27
+ - @atlaspack/utils@2.17.1
28
+ - @atlaspack/plugin@2.14.19
29
+
30
+ ## 2.14.19
31
+
32
+ ### Patch Changes
33
+
34
+ - Updated dependencies [[`dbb4072`](https://github.com/atlassian-labs/atlaspack/commit/dbb40721ebeb45990a14ba04e6b44e7f836fb32d), [`c4415a4`](https://github.com/atlassian-labs/atlaspack/commit/c4415a455543d984ca28452c2cb87a794d22497c), [`f0f7c71`](https://github.com/atlassian-labs/atlaspack/commit/f0f7c7168a1d3d18c6f30d2daed611275692b7c5), [`de23e0c`](https://github.com/atlassian-labs/atlaspack/commit/de23e0ce49d5504fe3947ac26640a3d951087da3), [`18a57cf`](https://github.com/atlassian-labs/atlaspack/commit/18a57cf8a4789b2de5ad8e2676f317a26cc91417), [`a5ed1b4`](https://github.com/atlassian-labs/atlaspack/commit/a5ed1b414498560f393ff491af4da25b6e8dde56), [`3ba1aee`](https://github.com/atlassian-labs/atlaspack/commit/3ba1aee6a794a26b2f0255aaf6d003981532d0ae)]:
35
+ - @atlaspack/utils@2.17.0
36
+ - @atlaspack/core@2.19.0
37
+ - @atlaspack/plugin@2.14.18
38
+
39
+ ## 2.14.18
40
+
41
+ ### Patch Changes
42
+
43
+ - Updated dependencies []:
44
+ - @atlaspack/core@2.18.8
45
+ - @atlaspack/utils@2.16.1
46
+ - @atlaspack/plugin@2.14.17
47
+
48
+ ## 2.14.17
49
+
50
+ ### Patch Changes
51
+
52
+ - Updated dependencies [[`1ff31f1`](https://github.com/atlassian-labs/atlaspack/commit/1ff31f10391c48780c9fcfc243b4e828a1b285e0), [`e8a60ff`](https://github.com/atlassian-labs/atlaspack/commit/e8a60ffbea41caef265786bbf73349771760081c), [`30ee2cf`](https://github.com/atlassian-labs/atlaspack/commit/30ee2cfcd34cf2646ded0eda13fdb80a2a5de529)]:
53
+ - @atlaspack/core@2.18.7
54
+ - @atlaspack/utils@2.16.0
55
+ - @atlaspack/plugin@2.14.16
56
+
57
+ ## 2.14.16
58
+
59
+ ### Patch Changes
60
+
61
+ - Updated dependencies [[`5ded263`](https://github.com/atlassian-labs/atlaspack/commit/5ded263c7f11b866e8885b81c73e20dd060b25be), [`74fd942`](https://github.com/atlassian-labs/atlaspack/commit/74fd94236ac697207082c4b755b079e56f5564fb)]:
62
+ - @atlaspack/core@2.18.6
63
+ - @atlaspack/utils@2.15.3
64
+ - @atlaspack/plugin@2.14.15
65
+
66
+ ## 2.14.15
67
+
68
+ ### Patch Changes
69
+
70
+ - Updated dependencies [[`644b157`](https://github.com/atlassian-labs/atlaspack/commit/644b157dee72a871acc2d0facf0b87b8eea51956)]:
71
+ - @atlaspack/core@2.18.5
72
+ - @atlaspack/utils@2.15.2
73
+ - @atlaspack/plugin@2.14.14
74
+
75
+ ## 2.14.14
76
+
77
+ ### Patch Changes
78
+
79
+ - Updated dependencies [[`ef3d622`](https://github.com/atlassian-labs/atlaspack/commit/ef3d6228f4e006702198a19c61e051d194d325cb), [`6b1f5ff`](https://github.com/atlassian-labs/atlaspack/commit/6b1f5fff68d7131fae075e14f4d2c02606dc6058), [`26aa9c5`](https://github.com/atlassian-labs/atlaspack/commit/26aa9c599d2be45ce1438a74c5fa22f39b9b554b), [`c8f7df4`](https://github.com/atlassian-labs/atlaspack/commit/c8f7df4eadfc4718040fceb065dae6e96a4051e7), [`0501255`](https://github.com/atlassian-labs/atlaspack/commit/05012550da35b05ce7d356a8cc29311e7f9afdca)]:
80
+ - @atlaspack/core@2.18.4
81
+ - @atlaspack/utils@2.15.1
82
+ - @atlaspack/plugin@2.14.13
83
+
84
+ ## 2.14.13
85
+
86
+ ### Patch Changes
87
+
88
+ - Updated dependencies [[`e39c6cf`](https://github.com/atlassian-labs/atlaspack/commit/e39c6cf05f7e95ce5420dbcea66f401b1cbd397c)]:
89
+ - @atlaspack/utils@2.15.0
90
+ - @atlaspack/core@2.18.3
91
+ - @atlaspack/plugin@2.14.12
92
+
93
+ ## 2.14.12
94
+
95
+ ### Patch Changes
96
+
97
+ - Updated dependencies []:
98
+ - @atlaspack/core@2.18.2
99
+ - @atlaspack/utils@2.14.11
100
+ - @atlaspack/plugin@2.14.11
101
+
102
+ ## 2.14.11
103
+
104
+ ### Patch Changes
105
+
106
+ - Updated dependencies []:
107
+ - @atlaspack/core@2.18.1
108
+
109
+ ## 2.14.10
110
+
111
+ ### Patch Changes
112
+
113
+ - Updated dependencies [[`51aba5f`](https://github.com/atlassian-labs/atlaspack/commit/51aba5fc0e49235ee06bbc3c376f48c3e7da5c4b), [`1e32d4e`](https://github.com/atlassian-labs/atlaspack/commit/1e32d4eae6b3af3968e8a0ef97d35b4347fd4196), [`0b2f6f5`](https://github.com/atlassian-labs/atlaspack/commit/0b2f6f55794d3ff6e2f5a41f963e7e5dd8ad9f8d), [`6dd4ccb`](https://github.com/atlassian-labs/atlaspack/commit/6dd4ccb753541de32322d881f973d571dd57e4ca)]:
114
+ - @atlaspack/core@2.18.0
115
+ - @atlaspack/plugin@2.14.10
116
+ - @atlaspack/utils@2.14.10
117
+
118
+ ## 2.14.9
119
+
120
+ ### Patch Changes
121
+
122
+ - Updated dependencies [[`1940859`](https://github.com/atlassian-labs/atlaspack/commit/194085942f0e86532e9d039fc3f8039badce4594), [`15b6155`](https://github.com/atlassian-labs/atlaspack/commit/15b61556e9114203ebbc9de94b864118ca764598), [`209692f`](https://github.com/atlassian-labs/atlaspack/commit/209692ffb11eae103a0d65c5e1118a5aa1625818), [`d04de26`](https://github.com/atlassian-labs/atlaspack/commit/d04de26af684d7abfba5091fbe3df16a12cd0ebc)]:
123
+ - @atlaspack/core@2.17.4
124
+ - @atlaspack/utils@2.14.9
125
+ - @atlaspack/plugin@2.14.9
126
+
127
+ ## 2.14.8
128
+
129
+ ### Patch Changes
130
+
131
+ - Updated dependencies [[`30f6017`](https://github.com/atlassian-labs/atlaspack/commit/30f60175ba4d272c5fc193973c63bc298584775b), [`3a3e8e7`](https://github.com/atlassian-labs/atlaspack/commit/3a3e8e7be9e2dffd7304436d792f0f595d59665a), [`15c1e3c`](https://github.com/atlassian-labs/atlaspack/commit/15c1e3c0628bae4c768d76cf3afc53d6d0d7ce7c)]:
132
+ - @atlaspack/core@2.17.3
133
+ - @atlaspack/utils@2.14.8
134
+ - @atlaspack/plugin@2.14.8
135
+
136
+ ## 2.14.7
137
+
138
+ ### Patch Changes
139
+
140
+ - Updated dependencies []:
141
+ - @atlaspack/core@2.17.2
142
+ - @atlaspack/utils@2.14.7
143
+ - @atlaspack/plugin@2.14.7
144
+
145
+ ## 2.14.6
146
+
147
+ ### Patch Changes
148
+
149
+ - Updated dependencies []:
150
+ - @atlaspack/core@2.17.1
151
+ - @atlaspack/utils@2.14.6
152
+ - @atlaspack/plugin@2.14.6
153
+
3
154
  ## 2.14.5
4
155
 
5
156
  ### Patch Changes
@@ -0,0 +1,23 @@
1
+ import type { PackagedBundle, PluginOptions } from '@atlaspack/types';
2
+ import { Reporter } from '@atlaspack/plugin';
3
+ export type AssetStat = {
4
+ size: number;
5
+ name: string;
6
+ bundles: Array<string>;
7
+ };
8
+ export type BundleStat = {
9
+ size: number;
10
+ id: string;
11
+ assets: Array<string>;
12
+ };
13
+ export type BundleStats = {
14
+ bundles: {
15
+ [key: string]: BundleStat;
16
+ };
17
+ assets: {
18
+ [key: string]: AssetStat;
19
+ };
20
+ };
21
+ declare const _default: Reporter;
22
+ export default _default;
23
+ export declare function getBundleStats(bundles: Array<PackagedBundle>, options: PluginOptions): BundleStats;
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@atlaspack/reporter-bundle-stats",
3
- "version": "2.14.5-canary.14+267b0d591",
3
+ "version": "2.14.5-canary.141+2f29297bd",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "main": "lib/BundleStatsReporter.js",
8
- "source": "src/BundleStatsReporter.js",
7
+ "main": "./lib/BundleStatsReporter.js",
8
+ "source": "./src/BundleStatsReporter.ts",
9
+ "types": "./lib/BundleStatsReporter.d.ts",
9
10
  "bin": {
10
11
  "atlaspack-bundle-stats": "bin.js"
11
12
  },
@@ -13,13 +14,16 @@
13
14
  "node": ">= 16.0.0"
14
15
  },
15
16
  "dependencies": {
16
- "@atlaspack/core": "2.16.2-canary.14+267b0d591",
17
- "@atlaspack/plugin": "2.14.5-canary.14+267b0d591",
18
- "@atlaspack/utils": "2.14.5-canary.14+267b0d591"
17
+ "@atlaspack/core": "2.16.2-canary.141+2f29297bd",
18
+ "@atlaspack/plugin": "2.14.5-canary.141+2f29297bd",
19
+ "@atlaspack/utils": "2.14.5-canary.141+2f29297bd"
19
20
  },
20
21
  "devDependencies": {
21
- "@atlaspack/types": "2.14.5-canary.14+267b0d591"
22
+ "@atlaspack/types": "2.14.5-canary.141+2f29297bd"
22
23
  },
23
24
  "type": "commonjs",
24
- "gitHead": "267b0d59131c00e4cd1526bbf87aa84b9c8fd411"
25
- }
25
+ "scripts": {
26
+ "check-ts": "tsc --emitDeclarationOnly --rootDir src"
27
+ },
28
+ "gitHead": "2f29297bd550840c9840871559349ef773bcbf6d"
29
+ }
@@ -1,5 +1,3 @@
1
- // @flow strict-local
2
-
3
1
  import type {PackagedBundle, PluginOptions} from '@atlaspack/types';
4
2
 
5
3
  import {Reporter} from '@atlaspack/plugin';
@@ -8,24 +6,28 @@ import {DefaultMap} from '@atlaspack/utils';
8
6
  import assert from 'assert';
9
7
  import path from 'path';
10
8
 
11
- export type AssetStat = {|
12
- size: number,
13
- name: string,
14
- bundles: Array<string>,
15
- |};
16
-
17
- export type BundleStat = {|
18
- size: number,
19
- id: string,
20
- assets: Array<string>,
21
- |};
22
-
23
- export type BundleStats = {|
24
- bundles: {[key: string]: BundleStat},
25
- assets: {[key: string]: AssetStat},
26
- |};
9
+ export type AssetStat = {
10
+ size: number;
11
+ name: string;
12
+ bundles: Array<string>;
13
+ };
14
+
15
+ export type BundleStat = {
16
+ size: number;
17
+ id: string;
18
+ assets: Array<string>;
19
+ };
20
+
21
+ export type BundleStats = {
22
+ bundles: {
23
+ [key: string]: BundleStat;
24
+ };
25
+ assets: {
26
+ [key: string]: AssetStat;
27
+ };
28
+ };
27
29
 
28
- export default (new Reporter({
30
+ export default new Reporter({
29
31
  async report({event, options}) {
30
32
  if (event.type !== 'buildSuccess') {
31
33
  return;
@@ -33,7 +35,7 @@ export default (new Reporter({
33
35
 
34
36
  let bundlesByTarget: DefaultMap<
35
37
  string /* target name */,
36
- Array<PackagedBundle>,
38
+ Array<PackagedBundle>
37
39
  > = new DefaultMap(() => []);
38
40
  for (let bundle of event.bundleGraph.getBundles()) {
39
41
  bundlesByTarget.get(bundle.target.name).push(bundle);
@@ -43,7 +45,7 @@ export default (new Reporter({
43
45
  await options.outputFS.mkdirp(reportsDir);
44
46
 
45
47
  await Promise.all(
46
- [...bundlesByTarget.entries()].map(([targetName, bundles]) =>
48
+ [...bundlesByTarget.entries()].map(([targetName, bundles]: [any, any]) =>
47
49
  options.outputFS.writeFile(
48
50
  path.join(reportsDir, `${targetName}-stats.json`),
49
51
  JSON.stringify(getBundleStats(bundles, options), null, 2),
@@ -51,7 +53,7 @@ export default (new Reporter({
51
53
  ),
52
54
  );
53
55
  },
54
- }): Reporter);
56
+ }) as Reporter;
55
57
 
56
58
  export function getBundleStats(
57
59
  bundles: Array<PackagedBundle>,
@@ -72,7 +74,7 @@ export function getBundleStats(
72
74
  continue;
73
75
  }
74
76
 
75
- let assets = [];
77
+ let assets: Array<string> = [];
76
78
  bundle.traverseAssets(({id, filePath, stats: {size}}) => {
77
79
  assets.push(id);
78
80
  let assetName = path.relative(options.projectRoot, filePath);
package/tsconfig.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "../../../tsconfig.json",
3
+ "include": ["src"]
4
+ }