New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bundlewatch

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bundlewatch - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

2

lib/app/config/ciEnv.js

@@ -53,3 +53,3 @@ 'use strict';

const githubAccessToken = process.env.GITHUB_ACCESS_TOKEN || process.env.BUNDLEWATCH_GITHUB_TOKEN;
const githubAccessToken = process.env.BUNDLEWATCH_GITHUB_TOKEN || process.env.GITHUB_ACCESS_TOKEN;

@@ -56,0 +56,0 @@ repoBranchBase = env.CI_BRANCH_BASE;

@@ -18,4 +18,10 @@ 'use strict';

if (process.env.DEBUG) {
const debugObject = error.response ? error.response.data : error.response;
stdout(_chalk2.default.greenBright(`[DEBUG] ${error.message}`));
stderr(error);
try {
stderr(JSON.stringify(debugObject, undefined, 2));
} catch (e) {
// eat it
}
}

@@ -22,0 +28,0 @@ };

{
"name": "bundlewatch",
"version": "0.1.1",
"version": "0.1.2",
"description": "Keep watch of your bundle size",

@@ -5,0 +5,0 @@ "repository": {

@@ -26,4 +26,4 @@ <div align="center">

<p>
BundleWatch is a file size checker. Its main purpose is to ensure bundled browser assets don't jump in file size. <br />
Sharp increases in BundleWatch can signal that something is wrong: adding a package that bloated the slug, a wrong import, forgetting to minify.
BundleWatch checks file sizes, ensuring bundled browser assets don't jump in file size. <br />
Sharp increases in BundleWatch can signal that something is wrong - adding a package that bloats the slug, a wrong import, or forgetting to minify.
</p>

@@ -34,8 +34,76 @@ </div>

# Getting Started and Configuration
To get started with BundleWatch, head over to the [documentation on bundlewatch.io](http://bundlewatch.io/)
# Getting Started:
Install the BundleWatch package:
- NPM: `npm install bundlewatch --save-dev`
- Yarn: `yarn add bundlewatch --dev`
Add some basic configuration to your .package.json`
```json
{
"name": "my package name",
"version": "0.0.1",
"bundlewatch" : {
"files": [
{
"path": "myfolder/*.js",
"maxSize": "100kB"
}
]
}
}
```
How to run:
- NPM: `npm run bundlewatch`
- Yarn: `yarn run bundlewatch`
## Why BundleWatch over bundlesize?
This will give you command line output. If you want BundleWatch to report build status on your pull requests, see below.
# Adding Build Status:
BundleWatch can report its status on your GitHub Pull Requests.
<div align="center">
<img alt="build status preview" src="https://raw.githubusercontent.com/bundlewatch/bundlewatch.io/master/docs/_assets/build-status-preview.png" width="700px">
</div>
## CI Variables Needed by BundleWatch:
The most efficient way to get this running is to ensure that some environment variables are available for BundleWatch to find.
- `CI_REPO_OWNER` github.com/**facebook**/react
- `CI_REPO_NAME` github.com/facebook/**react**
- `CI_BRANCH`
- `CI_COMMIT_SHA`
If you're using, _Travis_, _CircleCI_ or _Wrecker_ these should all work out of the box.
> Have a look at the source code to see which variables are automatically found: https://github.com/bundlewatch/bundlewatch/blob/master/src/app/config/ciEnv.js#L36-L39
## CI Auth Variables Needed by BundleWatch:
- `BUNDLEWATCH_GITHUB_TOKEN`
You will need to give BundleWatch access to your GitHub Statuses, which can be done by heading to:
https://service.bundlewatch.io/setup-github
This will give you your `BUNDLEWATCH_GITHUB_TOKEN`. You will need to set this as an environment variable in CI.
## That's It
After setting up the above you will have BuildStatus on your Pull Requests. Clicking the _details_ link on the reported status will show you a results file breakdown.
<div align="center">
<img alt="build results preview" src="https://raw.githubusercontent.com/bundlewatch/bundlewatch.io/master/docs/_assets/build-results-preview.png" width="700px">
</div>
<hr>
# Additional Documentation:
Full [documentation avialable on bundlewatch.io](http://bundlewatch.io/)
# I use bundlesize, why should I switch to BundleWatch?
- Bundlesize has entered maintenance mode and pull requests are left hanging, so we wanted to reboot the community through creating BundleWatch

@@ -48,5 +116,5 @@ - [BundleWatch/service](https://github.com/bundlewatch/service) with infrastructure as code

### Additional Features:
- [x] Config validation to stop users from guessing why BundleWatch won't work
- [x] Support for config file path
- [x] Better results breakdown page [see diffing against branches](http://bundlewatch.io/#/getting-started/the-best-parts?id=diffing-against-branches-other-than-master)

@@ -59,6 +127,8 @@ - [x] Better comparisons between branches, support branches other than master

## Want to help?
[See the Contributing docs](CONTRIBUTING.md) or [Join us on Slack](https://join.slack.com/t/bundlewatch/shared_invite/enQtMzUwNjYxNTMwMzcyLWE5NGI4MzZjMjM4MTRlYzllOTMwYzIzZWNjM2MyMjBmMzNjNGM0ZGVhODc2YjFkNzIwMzNkYjk3NzE0MjZkOTc) and start contributing
# Want to Help? Become a Contributor
[See the Contributing docs](CONTRIBUTING.md) or [Join us on Slack](https://join.slack.com/t/bundlewatch/shared_invite/enQtMzUwNjYxNTMwMzcyLWE5NGI4MzZjMjM4MTRlYzllOTMwYzIzZWNjM2MyMjBmMzNjNGM0ZGVhODc2YjFkNzIwMzNkYjk3NzE0MjZkOTc) and start contributing.
&copy; 2018 BundleWatch
[npm]: https://img.shields.io/npm/v/bundlewatch.svg

@@ -71,3 +141,3 @@ [npm-url]: https://npmjs.com/package/bundlewatch

[bundlewatch]: https://img.shields.io/badge/bundle-watched-blue.svg
[bundlewatch-url]: http://bundlewatch.io
[bundlewatch-url]: https://bundlewatch.io

@@ -74,0 +144,0 @@ [deps]: https://img.shields.io/david/bundlewatch/bundlewatch.svg

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc