@atlaspack/reporter-bundle-stats 2.14.5-canary.19 → 2.14.5-canary.191

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,214 @@
1
1
  # @atlaspack/reporter-bundle-stats
2
2
 
3
+ ## 2.14.30
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies []:
8
+ - @atlaspack/core@2.23.5
9
+ - @atlaspack/utils@2.19.1
10
+ - @atlaspack/plugin@2.14.29
11
+
12
+ ## 2.14.29
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [[`f0349a6`](https://github.com/atlassian-labs/atlaspack/commit/f0349a6b9b04755088f121095ca6301a2ada3767)]:
17
+ - @atlaspack/utils@2.19.0
18
+ - @atlaspack/core@2.23.4
19
+ - @atlaspack/plugin@2.14.28
20
+
21
+ ## 2.14.28
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies []:
26
+ - @atlaspack/core@2.23.3
27
+ - @atlaspack/utils@2.18.4
28
+ - @atlaspack/plugin@2.14.27
29
+
30
+ ## 2.14.27
31
+
32
+ ### Patch Changes
33
+
34
+ - [#742](https://github.com/atlassian-labs/atlaspack/pull/742) [`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd) Thanks [@yamadapc](https://github.com/yamadapc)! - Internal changes and bug fixes to environmentDeduplication flag
35
+
36
+ - Updated dependencies [[`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd), [`889c65c`](https://github.com/atlassian-labs/atlaspack/commit/889c65cd25b811045e26a117e7404f694dde77a2), [`b6e72b6`](https://github.com/atlassian-labs/atlaspack/commit/b6e72b6dd2b517cbb0e700fa69e63332d3eacb1e)]:
37
+ - @atlaspack/plugin@2.14.26
38
+ - @atlaspack/utils@2.18.3
39
+ - @atlaspack/core@2.23.2
40
+
41
+ ## 2.14.26
42
+
43
+ ### Patch Changes
44
+
45
+ - Updated dependencies []:
46
+ - @atlaspack/core@2.23.1
47
+ - @atlaspack/utils@2.18.2
48
+ - @atlaspack/plugin@2.14.25
49
+
50
+ ## 2.14.25
51
+
52
+ ### Patch Changes
53
+
54
+ - Updated dependencies [[`7f5841c`](https://github.com/atlassian-labs/atlaspack/commit/7f5841c39df049f9546cccbeea2a7337e0337b45)]:
55
+ - @atlaspack/core@2.23.0
56
+ - @atlaspack/utils@2.18.1
57
+ - @atlaspack/plugin@2.14.24
58
+
59
+ ## 2.14.24
60
+
61
+ ### Patch Changes
62
+
63
+ - Updated dependencies [[`23d561e`](https://github.com/atlassian-labs/atlaspack/commit/23d561e51e68b0c38fd1ff4e4fb173e5e7b01cf2)]:
64
+ - @atlaspack/utils@2.18.0
65
+ - @atlaspack/core@2.22.0
66
+ - @atlaspack/plugin@2.14.23
67
+
68
+ ## 2.14.23
69
+
70
+ ### Patch Changes
71
+
72
+ - [#720](https://github.com/atlassian-labs/atlaspack/pull/720) [`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94) Thanks [@alshdavid](https://github.com/alshdavid)! - Migrate to TypeScript
73
+
74
+ - Updated dependencies [[`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94), [`43fdd22`](https://github.com/atlassian-labs/atlaspack/commit/43fdd223860fbc97af17d68c65419b97412cb888), [`12bee0e`](https://github.com/atlassian-labs/atlaspack/commit/12bee0e23f0464d7f6bd3e24fbe0d19c126d587d)]:
75
+ - @atlaspack/plugin@2.14.22
76
+ - @atlaspack/utils@2.17.4
77
+ - @atlaspack/core@2.21.0
78
+
79
+ ## 2.14.22
80
+
81
+ ### Patch Changes
82
+
83
+ - Updated dependencies [[`069de47`](https://github.com/atlassian-labs/atlaspack/commit/069de478e64fb5889f6f2ce023eb510782767fbd)]:
84
+ - @atlaspack/core@2.20.0
85
+ - @atlaspack/utils@2.17.3
86
+ - @atlaspack/plugin@2.14.21
87
+
88
+ ## 2.14.21
89
+
90
+ ### Patch Changes
91
+
92
+ - Updated dependencies [[`daaa768`](https://github.com/atlassian-labs/atlaspack/commit/daaa7688786772d7e3713b71c5bba6b89ec704aa), [`a0b959f`](https://github.com/atlassian-labs/atlaspack/commit/a0b959fbf61fc3f820ff03c7e8988945fe40a91a)]:
93
+ - @atlaspack/plugin@2.14.20
94
+ - @atlaspack/core@2.19.2
95
+ - @atlaspack/utils@2.17.2
96
+
97
+ ## 2.14.20
98
+
99
+ ### Patch Changes
100
+
101
+ - Updated dependencies []:
102
+ - @atlaspack/core@2.19.1
103
+ - @atlaspack/utils@2.17.1
104
+ - @atlaspack/plugin@2.14.19
105
+
106
+ ## 2.14.19
107
+
108
+ ### Patch Changes
109
+
110
+ - 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)]:
111
+ - @atlaspack/utils@2.17.0
112
+ - @atlaspack/core@2.19.0
113
+ - @atlaspack/plugin@2.14.18
114
+
115
+ ## 2.14.18
116
+
117
+ ### Patch Changes
118
+
119
+ - Updated dependencies []:
120
+ - @atlaspack/core@2.18.8
121
+ - @atlaspack/utils@2.16.1
122
+ - @atlaspack/plugin@2.14.17
123
+
124
+ ## 2.14.17
125
+
126
+ ### Patch Changes
127
+
128
+ - 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)]:
129
+ - @atlaspack/core@2.18.7
130
+ - @atlaspack/utils@2.16.0
131
+ - @atlaspack/plugin@2.14.16
132
+
133
+ ## 2.14.16
134
+
135
+ ### Patch Changes
136
+
137
+ - Updated dependencies [[`5ded263`](https://github.com/atlassian-labs/atlaspack/commit/5ded263c7f11b866e8885b81c73e20dd060b25be), [`74fd942`](https://github.com/atlassian-labs/atlaspack/commit/74fd94236ac697207082c4b755b079e56f5564fb)]:
138
+ - @atlaspack/core@2.18.6
139
+ - @atlaspack/utils@2.15.3
140
+ - @atlaspack/plugin@2.14.15
141
+
142
+ ## 2.14.15
143
+
144
+ ### Patch Changes
145
+
146
+ - Updated dependencies [[`644b157`](https://github.com/atlassian-labs/atlaspack/commit/644b157dee72a871acc2d0facf0b87b8eea51956)]:
147
+ - @atlaspack/core@2.18.5
148
+ - @atlaspack/utils@2.15.2
149
+ - @atlaspack/plugin@2.14.14
150
+
151
+ ## 2.14.14
152
+
153
+ ### Patch Changes
154
+
155
+ - 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)]:
156
+ - @atlaspack/core@2.18.4
157
+ - @atlaspack/utils@2.15.1
158
+ - @atlaspack/plugin@2.14.13
159
+
160
+ ## 2.14.13
161
+
162
+ ### Patch Changes
163
+
164
+ - Updated dependencies [[`e39c6cf`](https://github.com/atlassian-labs/atlaspack/commit/e39c6cf05f7e95ce5420dbcea66f401b1cbd397c)]:
165
+ - @atlaspack/utils@2.15.0
166
+ - @atlaspack/core@2.18.3
167
+ - @atlaspack/plugin@2.14.12
168
+
169
+ ## 2.14.12
170
+
171
+ ### Patch Changes
172
+
173
+ - Updated dependencies []:
174
+ - @atlaspack/core@2.18.2
175
+ - @atlaspack/utils@2.14.11
176
+ - @atlaspack/plugin@2.14.11
177
+
178
+ ## 2.14.11
179
+
180
+ ### Patch Changes
181
+
182
+ - Updated dependencies []:
183
+ - @atlaspack/core@2.18.1
184
+
185
+ ## 2.14.10
186
+
187
+ ### Patch Changes
188
+
189
+ - 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)]:
190
+ - @atlaspack/core@2.18.0
191
+ - @atlaspack/plugin@2.14.10
192
+ - @atlaspack/utils@2.14.10
193
+
194
+ ## 2.14.9
195
+
196
+ ### Patch Changes
197
+
198
+ - 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)]:
199
+ - @atlaspack/core@2.17.4
200
+ - @atlaspack/utils@2.14.9
201
+ - @atlaspack/plugin@2.14.9
202
+
203
+ ## 2.14.8
204
+
205
+ ### Patch Changes
206
+
207
+ - 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)]:
208
+ - @atlaspack/core@2.17.3
209
+ - @atlaspack/utils@2.14.8
210
+ - @atlaspack/plugin@2.14.8
211
+
3
212
  ## 2.14.7
4
213
 
5
214
  ### 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.19+a63b1da4d",
3
+ "version": "2.14.5-canary.191+eedcbc408",
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,17 @@
13
14
  "node": ">= 16.0.0"
14
15
  },
15
16
  "dependencies": {
16
- "@atlaspack/core": "2.16.2-canary.19+a63b1da4d",
17
- "@atlaspack/plugin": "2.14.5-canary.19+a63b1da4d",
18
- "@atlaspack/utils": "2.14.5-canary.19+a63b1da4d"
17
+ "@atlaspack/core": "2.16.2-canary.191+eedcbc408",
18
+ "@atlaspack/plugin": "2.14.5-canary.191+eedcbc408",
19
+ "@atlaspack/utils": "2.14.5-canary.191+eedcbc408"
19
20
  },
20
21
  "devDependencies": {
21
- "@atlaspack/types": "2.14.5-canary.19+a63b1da4d"
22
+ "@atlaspack/types": "2.14.5-canary.191+eedcbc408"
22
23
  },
23
24
  "type": "commonjs",
24
- "gitHead": "a63b1da4d98a7eda8a2130700dc844a56aa8308e"
25
- }
25
+ "scripts": {
26
+ "check-ts": "tsc --emitDeclarationOnly --rootDir src",
27
+ "build:lib": "gulp build --gulpfile ../../../gulpfile.js --cwd ."
28
+ },
29
+ "gitHead": "eedcbc408fc1e86a2a8e25f1a41c57146d8529e1"
30
+ }
@@ -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
+ }