Open slorber opened 2 months ago
Interesting, would you only want the folder and file types inside of it, replacing individual files altogether then? Something like the following maybe:
Directory | Type | Size | Change | |
---|---|---|---|---|
compat/dist/foo |
CSS | 3.53 kB | -567 B (-13.83%) | đ |
compat/dist/foo |
JS | 3.44 kB | -582 B (-14.46%) | đ |
compat/dist/foo |
HTML | 3.6 kB | -571 B (-13.71%) | đ |
Or perhaps:
Directory | Type | Size | Change | |
---|---|---|---|---|
compat/dist/foo |
All | 9.53 kB | -567 B (-13.83%) | đ |
CSS | 3.53 kB | -567 B (-13.83%) | đ | |
JS | 3.44 kB | -582 B (-14.46%) | đ | |
HTML | 3.6 kB | -571 B (-13.71%) | đ | |
compat/dist/bar |
All | 9.53 kB | -567 B (-13.83%) | đ |
(Ignore the nonsensical sizes that don't add up, I quickly copy/pasted from Preact đ)
Or in addition to the existing output? Just thinking if it's a toggled either/or situation or just a new output table.
I think it would be a reasonable addition though!
Thanks!
I think a separate table makes more sense. I guess something like this could be nice, with the ability to count the number of files and the change too.
For flexibility, I'd break it down by extension and not just CSS/JS/HTML.
Folders | Count | Size | Change |
---|---|---|---|
website/build1 |
278 (+1 â ī¸) | 666 kB | +34 B (+0.01%) |
website/build2 |
10 (+0) | 10 kB | +34 B (+0.01%) |
TOTAL | 288 (+1 â ī¸) | 676 kB | +34 B (+0.01%) |
For flexibility, I'd break it down by extension and not just CSS/JS/HTML.
Yeah that was just for a quick example, albeit using the names instead of the proper extension.
But this seems reasonable and I can see how many might want this. I'll take a look at this later this week if I get some time.
+1 this sounds like a really nice addition, in a monorepo the stats comment starts to get very noisy and unwieldy
Suggestion: would be nice to retain individual file stats in a collapsed section. Ie if you find a certain folder has increased you can then drill down to more indepth stats.
I'm using this project on Docusaurus, a static site generator, to monitor the build output size
Example PR comment: https://github.com/facebook/docusaurus/pull/10470#issuecomment-2324697764
Monitoring by file size is great, but in our case, we emit too many output files to monitor them all without creating noise, so I only added a "representative" list of output files.
What would be a great addition for us would be to have the ability to compare the before/after size of a whole folder. Eventually be able to break it down by file type, so that we could detect if JS, CSS, or HTML total output size increases after a PR.
I'm wondering if this could be part of this project, or if it's out of scope and should be a separate tool.