@atlaspack/reporter-bundle-stats 2.14.5-canary.16 → 2.14.5-canary.161

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,185 @@
1
1
  # @atlaspack/reporter-bundle-stats
2
2
 
3
+ ## 2.14.26
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies []:
8
+ - @atlaspack/core@2.23.1
9
+ - @atlaspack/utils@2.18.2
10
+ - @atlaspack/plugin@2.14.25
11
+
12
+ ## 2.14.25
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [[`7f5841c`](https://github.com/atlassian-labs/atlaspack/commit/7f5841c39df049f9546cccbeea2a7337e0337b45)]:
17
+ - @atlaspack/core@2.23.0
18
+ - @atlaspack/utils@2.18.1
19
+ - @atlaspack/plugin@2.14.24
20
+
21
+ ## 2.14.24
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies [[`23d561e`](https://github.com/atlassian-labs/atlaspack/commit/23d561e51e68b0c38fd1ff4e4fb173e5e7b01cf2)]:
26
+ - @atlaspack/utils@2.18.0
27
+ - @atlaspack/core@2.22.0
28
+ - @atlaspack/plugin@2.14.23
29
+
30
+ ## 2.14.23
31
+
32
+ ### Patch Changes
33
+
34
+ - [#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
35
+
36
+ - 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)]:
37
+ - @atlaspack/plugin@2.14.22
38
+ - @atlaspack/utils@2.17.4
39
+ - @atlaspack/core@2.21.0
40
+
41
+ ## 2.14.22
42
+
43
+ ### Patch Changes
44
+
45
+ - Updated dependencies [[`069de47`](https://github.com/atlassian-labs/atlaspack/commit/069de478e64fb5889f6f2ce023eb510782767fbd)]:
46
+ - @atlaspack/core@2.20.0
47
+ - @atlaspack/utils@2.17.3
48
+ - @atlaspack/plugin@2.14.21
49
+
50
+ ## 2.14.21
51
+
52
+ ### Patch Changes
53
+
54
+ - Updated dependencies [[`daaa768`](https://github.com/atlassian-labs/atlaspack/commit/daaa7688786772d7e3713b71c5bba6b89ec704aa), [`a0b959f`](https://github.com/atlassian-labs/atlaspack/commit/a0b959fbf61fc3f820ff03c7e8988945fe40a91a)]:
55
+ - @atlaspack/plugin@2.14.20
56
+ - @atlaspack/core@2.19.2
57
+ - @atlaspack/utils@2.17.2
58
+
59
+ ## 2.14.20
60
+
61
+ ### Patch Changes
62
+
63
+ - Updated dependencies []:
64
+ - @atlaspack/core@2.19.1
65
+ - @atlaspack/utils@2.17.1
66
+ - @atlaspack/plugin@2.14.19
67
+
68
+ ## 2.14.19
69
+
70
+ ### Patch Changes
71
+
72
+ - 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)]:
73
+ - @atlaspack/utils@2.17.0
74
+ - @atlaspack/core@2.19.0
75
+ - @atlaspack/plugin@2.14.18
76
+
77
+ ## 2.14.18
78
+
79
+ ### Patch Changes
80
+
81
+ - Updated dependencies []:
82
+ - @atlaspack/core@2.18.8
83
+ - @atlaspack/utils@2.16.1
84
+ - @atlaspack/plugin@2.14.17
85
+
86
+ ## 2.14.17
87
+
88
+ ### Patch Changes
89
+
90
+ - 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)]:
91
+ - @atlaspack/core@2.18.7
92
+ - @atlaspack/utils@2.16.0
93
+ - @atlaspack/plugin@2.14.16
94
+
95
+ ## 2.14.16
96
+
97
+ ### Patch Changes
98
+
99
+ - Updated dependencies [[`5ded263`](https://github.com/atlassian-labs/atlaspack/commit/5ded263c7f11b866e8885b81c73e20dd060b25be), [`74fd942`](https://github.com/atlassian-labs/atlaspack/commit/74fd94236ac697207082c4b755b079e56f5564fb)]:
100
+ - @atlaspack/core@2.18.6
101
+ - @atlaspack/utils@2.15.3
102
+ - @atlaspack/plugin@2.14.15
103
+
104
+ ## 2.14.15
105
+
106
+ ### Patch Changes
107
+
108
+ - Updated dependencies [[`644b157`](https://github.com/atlassian-labs/atlaspack/commit/644b157dee72a871acc2d0facf0b87b8eea51956)]:
109
+ - @atlaspack/core@2.18.5
110
+ - @atlaspack/utils@2.15.2
111
+ - @atlaspack/plugin@2.14.14
112
+
113
+ ## 2.14.14
114
+
115
+ ### Patch Changes
116
+
117
+ - 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)]:
118
+ - @atlaspack/core@2.18.4
119
+ - @atlaspack/utils@2.15.1
120
+ - @atlaspack/plugin@2.14.13
121
+
122
+ ## 2.14.13
123
+
124
+ ### Patch Changes
125
+
126
+ - Updated dependencies [[`e39c6cf`](https://github.com/atlassian-labs/atlaspack/commit/e39c6cf05f7e95ce5420dbcea66f401b1cbd397c)]:
127
+ - @atlaspack/utils@2.15.0
128
+ - @atlaspack/core@2.18.3
129
+ - @atlaspack/plugin@2.14.12
130
+
131
+ ## 2.14.12
132
+
133
+ ### Patch Changes
134
+
135
+ - Updated dependencies []:
136
+ - @atlaspack/core@2.18.2
137
+ - @atlaspack/utils@2.14.11
138
+ - @atlaspack/plugin@2.14.11
139
+
140
+ ## 2.14.11
141
+
142
+ ### Patch Changes
143
+
144
+ - Updated dependencies []:
145
+ - @atlaspack/core@2.18.1
146
+
147
+ ## 2.14.10
148
+
149
+ ### Patch Changes
150
+
151
+ - 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)]:
152
+ - @atlaspack/core@2.18.0
153
+ - @atlaspack/plugin@2.14.10
154
+ - @atlaspack/utils@2.14.10
155
+
156
+ ## 2.14.9
157
+
158
+ ### Patch Changes
159
+
160
+ - 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)]:
161
+ - @atlaspack/core@2.17.4
162
+ - @atlaspack/utils@2.14.9
163
+ - @atlaspack/plugin@2.14.9
164
+
165
+ ## 2.14.8
166
+
167
+ ### Patch Changes
168
+
169
+ - 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)]:
170
+ - @atlaspack/core@2.17.3
171
+ - @atlaspack/utils@2.14.8
172
+ - @atlaspack/plugin@2.14.8
173
+
174
+ ## 2.14.7
175
+
176
+ ### Patch Changes
177
+
178
+ - Updated dependencies []:
179
+ - @atlaspack/core@2.17.2
180
+ - @atlaspack/utils@2.14.7
181
+ - @atlaspack/plugin@2.14.7
182
+
3
183
  ## 2.14.6
4
184
 
5
185
  ### 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.16+4b2b575b9",
3
+ "version": "2.14.5-canary.161+ee040bb64",
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/types/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.16+4b2b575b9",
17
- "@atlaspack/plugin": "2.14.5-canary.16+4b2b575b9",
18
- "@atlaspack/utils": "2.14.5-canary.16+4b2b575b9"
17
+ "@atlaspack/core": "2.16.2-canary.161+ee040bb64",
18
+ "@atlaspack/plugin": "2.14.5-canary.161+ee040bb64",
19
+ "@atlaspack/utils": "2.14.5-canary.161+ee040bb64"
19
20
  },
20
21
  "devDependencies": {
21
- "@atlaspack/types": "2.14.5-canary.16+4b2b575b9"
22
+ "@atlaspack/types": "2.14.5-canary.161+ee040bb64"
22
23
  },
23
24
  "type": "commonjs",
24
- "gitHead": "4b2b575b98951f2dcf0c45ed8e94359b23b43815"
25
+ "scripts": {
26
+ "check-ts": "tsc --emitDeclarationOnly --rootDir src",
27
+ "build:lib": "gulp build --gulpfile ../../../gulpfile.js --cwd ."
28
+ },
29
+ "gitHead": "ee040bb6428f29b57d892ddd8107e29077d08ffd"
25
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
+ }