ai / size-limit

Calculate the real cost to run your JS app or lib to keep good performance. Show error in pull request if the cost exceeds the limit.
MIT License
6.52k stars 1.82k forks source link

Add the limit to the JSON object #284

Closed elliotwestlake closed 1 year ago

elliotwestlake commented 2 years ago

It'd be great to have the limit there in the JSON object.

We could then use this in the size-limit action so if it exceeds the limit you can easily see by how much

ai commented 2 years ago

Do you ask about webpack or rebuild plugins of Size Limit?

The @size-limit/file should work with any types of files.

elliotwestlake commented 2 years ago

esbuild

When running: npx size-limit --json

The response currently looks like:

[
  {
    "name": "account",
    "passed": true,
    "size": 4306
  },
  {
    "name": "diaries",
    "passed": true,
    "size": 510
  }
]

However it would be good if it looked like this:

[
  {
    "name": "account",
    "passed": true,
    "limit": 10000,
    "size": 4306
  },
  {
    "name": "diaries",
    "passed": true,
    "limit": 1000,
    "size": 510
  }
]
ai commented 2 years ago

Sure. Let's add it.

Do you want to send PR to save your name in project history. It should be easy

elliotwestlake commented 2 years ago

Awesome, sounds good to me!

elliotwestlake commented 2 years ago

@ai not sure I can submit a pr, think I may need permissions

ai commented 2 years ago

All users have right to open PR.

Click Fork on top left corner, clone your fork to your computer, create branch git checkout -b add-limit-to-json, add changes, push them to GitHub, then you will have Open pull request button on GitHub.

equinusocio commented 1 year ago

THE END

ai commented 1 year ago

sizeLimit was already added to JSON output

equinusocio commented 1 year ago

Yes, i meant when asking to contribute to OSS and opening PR people disappear :D

elliotwestlake commented 2 months ago

Sorry about this! I had intended to get round to contributing, wasn't intentional :)