Code Monkey home page Code Monkey logo

size-plugin-bot's Introduction

All Contributors

size-plugin

size-plugin

A GitHub ๐Ÿค– built with Probot that helps you to keep an ๐Ÿ‘๏ธ on static asset ๐Ÿ“ฆ sizes of your application and gives instant feedback ๐Ÿ“ for developer whenever they make change.

๐Ÿค– comments the gzipped sizes of your webpack assets and the changes since the last build into the relevant PR

Usage

First add an instance of the size-plugin to your webpack configuration:

using rollup ? use rollup-plugin-size

// webpack.config.js
+ const SizePlugin = require('size-plugin');

module.exports = {
  plugins: [
+    new SizePlugin({publish:true})
  ]
}

Second Simply install the app and make some changes, open a pr and watch the magic happen ๐Ÿ˜Š

size-plugin commenting on a PR with bundle stats

Currently works with Travis CI, CircleCI, Wercker, and Drone.

Using a different CI? Under the hood, size-plugin uses ci-env to extract meta information which works perfectly with Custom CI ๐Ÿ™ƒ

Configure Bot

Create a file .github/size-plugin.yml.

example ๐Ÿ‘‡

base-branches: # base branches against which bot can open a pull request.
    - master
    - next
size-files: # list(string/object) of size*.json files
    ## In case of multiple builds.
    - sizes-browser.json
    - sizes-server.json
    ## In case of multiple packages in a single repo or mono repo
    - dir: packages/a
      filename: sizes-a.json
    - dir: packages/b
      filename: sizes-b.json
    - dir: packages/c
      filename: sizes-c-browser.json
    - dir: packages/c
      filename: sizes-c-server.json

Note: filename must be unique

Contributing

If you have suggestions for how size-plugin could be improved, or want to report a bug, open an issue! We'd love all and any contributions.

For more, check out the Contributing Guide.

like it?

โญ๏ธ this repo

ย 

License

ISC ยฉ 2019 kuldeepkeshwar [email protected]

Contributors โœจ

Thanks goes to these wonderful people (emoji key):

anotherjsguy
anotherjsguy

๐Ÿ’ป

This project follows the all-contributors specification. Contributions of any kind welcome!

size-plugin-bot's People

Contributors

allcontributors[bot] avatar dependabot[bot] avatar kuldeepkeshwar avatar squat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

size-plugin-bot's Issues

Show total size/delta in comment

Currently, we are showing comment in PR like ๐Ÿ‘‡

size-plugin-browser:

   main.js โค  1.11 kB (-24.8 kB โœ…)
 1.main.js โค  207 B (-2 B)


I would like to add overall size/delta to the comment something like ๐Ÿ‘‡

size-plugin-browser: Overall Size 1.11 kB (-24.8 kB โœ…)

   main.js โค  1.11 kB (-24.8 kB โœ…)
 1.main.js โค  207 B (-2 B)


Bot Analytics

Add a way to collect data on work done by bot

Things to collect

  • number of comments in pull request
  • number of pull request open by bot

help configure size-plugin on bot installation

Many times users install bot but failed to configure the size-plugin/rollup-plugin-size correctly to work with bot.

May be bot can open an issue on installation guiding the setup process.

Reuse comments instead of posting new ones

On some PRs with many pushes and commits there is a bit of comment noise caused by size-plugin-bot. See preactjs/preact-www#415 for an example of that. I wonder if there is a way to edit an existing comment if there is any instead of always making a new one. That would clean up the thread considerably.

Deal with branch having branch protection

Current bot try to directly update the size*.json file on a push event.
In case of branch having enabled branch protection, the update results in a failure.
A workaround can be opening a pr to update the size*.json files

Close stale pull request

if the pull request created by bot is not merged & base branch is updated with some other changes, the bot might end up opening multiple pull request(against the same base) over time.

To avoid such cases, the bot should close the existing pull requests as they might have become stale.

Mono repo configuration

Currently size-plugin-bot lookup for sizes with an identifier which is a combo of repo, branch, sha.
In the case of Mono repo, multiple packages can use the size-plugin for which identifier(with the current implementation) will be same on a particular commit, hence we end up missing the sizes.

dot file

Add dot file(.github/size-plugin.yaml) which can be used to configure the bot.

size-files: 
- size-plugin-browser.json
- size-plugin-server.json

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.