Huge News!Announcing our $40M Series B led by Abstract Ventures.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.0.0 to 0.1.0

lib/app/reporting/BundleWatchService/index.js

2

lib/app/config/ciEnv.js

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

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

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

@@ -47,15 +47,15 @@ 'use strict';

if (missingOptions.length === 0) {
if (!config.bundlesizeServiceHost) {
_logger2.default.warn(`bundlesizeServiceHost was not supplied, bundlesize comparisons unavilable:
Learn more at: http://bundlesize.io/#/getting-started/the-best-parts
if (!config.bundlewatchServiceHost) {
_logger2.default.warn(`bundlewatchServiceHost was not supplied, bundlewatch comparisons unavilable:
Learn more at: http://bundlewatch.io/#/getting-started/the-best-parts
`);
} else {
if (!config.ci.repoBranchBase) {
_logger2.default.warn(`The ci.repoBranchCase was not supplied, bundlesize comparisons unavailable:
Learn more at: http://bundlesize.io/#/getting-started/the-best-parts
_logger2.default.warn(`The ci.repoBranchCase was not supplied, bundlewatch comparisons unavailable:
Learn more at: http://bundlewatch.io/#/getting-started/the-best-parts
`);
}
if (!config.ci.repoCurrentBranch) {
_logger2.default.warn(`The ci.repoCurrentBranch was not supplied, bundlesize results with not be saved:
Learn more at: http://bundlesize.io/#/getting-started/the-best-parts
_logger2.default.warn(`The ci.repoCurrentBranch was not supplied, bundlewatch results with not be saved:
Learn more at: http://bundlewatch.io/#/getting-started/the-best-parts
`);

@@ -66,4 +66,4 @@ }

_logger2.default.warn(`Some CI configuration options were not found (${missingOptions.join(', ')}):
bundlesize will be unable to report build status, or save comparison data
Learn more at: http://bundlesize.io/#/getting-started/the-best-parts
bundlewatch will be unable to report build status, or save comparison data
Learn more at: http://bundlewatch.io/#/getting-started/the-best-parts
`);

@@ -70,0 +70,0 @@ }

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

files: [],
bundlesizeServiceHost: 'https://service.bundlesize.io', // Can be a custom service, or set to NUll
bundlewatchServiceHost: 'https://service.bundlewatch.io', // Can be a custom service, or set to NUll
ci: {

@@ -26,0 +26,0 @@ githubAccessToken: _ciEnv2.default.githubAccessToken,

@@ -14,5 +14,5 @@ 'use strict';

var _BundlesizeService = require('./reporting/BundlesizeService');
var _BundleWatchService = require('./reporting/BundleWatchService');
var _BundlesizeService2 = _interopRequireDefault(_BundlesizeService);
var _BundleWatchService2 = _interopRequireDefault(_BundleWatchService);

@@ -44,3 +44,3 @@ var _GitHubService = require('./reporting/GitHubService');

files,
bundlesizeServiceHost,
bundlewatchServiceHost,
ci,

@@ -54,3 +54,3 @@ defaultCompression

const bundlesizeService = new _BundlesizeService2.default({
const bundlewatchService = new _BundleWatchService2.default({
repoOwner: ci.repoOwner,

@@ -61,8 +61,8 @@ repoName: ci.repoName,

commitSha: ci.commitSha,
bundlesizeServiceHost,
bundlewatchServiceHost,
githubAccessToken: ci.githubAccessToken
});
const baseBranchFileDetails = yield bundlesizeService.getFileDetailsForBaseBranch();
yield bundlesizeService.saveFileDetailsForCurrentBranch({
const baseBranchFileDetails = yield bundlewatchService.getFileDetailsForBaseBranch();
yield bundlewatchService.saveFileDetailsForCurrentBranch({
fileDetailsByPath: currentBranchFileDetails,

@@ -80,3 +80,3 @@ trackBranches: ci.trackBranches

results,
bundlesizeServiceHost,
bundlewatchServiceHost,
repoOwner: ci.repoOwner,

@@ -99,3 +99,3 @@ repoName: ci.repoName,

const bundleSizeApi = (() => {
const bundlewatchApi = (() => {
var _ref2 = _asyncToGenerator(function* (customConfig) {

@@ -109,3 +109,3 @@ const config = (0, _getConfig2.default)(customConfig);

});
yield githubService.start({ message: 'Checking bundlesize...' });
yield githubService.start({ message: 'Checking bundlewatch...' });

@@ -145,3 +145,3 @@ try {

return function bundleSizeApi(_x2) {
return function bundlewatchApi(_x2) {
return _ref2.apply(this, arguments);

@@ -151,3 +151,3 @@ };

exports.default = bundleSizeApi;
exports.default = bundlewatchApi;
exports.STATUSES = _analyzeFiles.STATUSES;

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

const getContextForFilePath = filePath => {
let context = 'bundlesize';
let context = 'bundlewatch';
if (filePath) {

@@ -21,0 +21,0 @@ const TRUNCATE_TO_LENGTH = 35;

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

results,
bundlesizeServiceHost,
bundlewatchServiceHost,
repoOwner,

@@ -52,3 +52,3 @@ repoName,

const urlResultData = encodeURIComponent(packedJSON);
const longURL = `${bundlesizeServiceHost}/results?d=${urlResultData}`;
const longURL = `${bundlewatchServiceHost}/results?d=${urlResultData}`;
const shortURL = yield (0, _shortenURL2.default)(longURL);

@@ -55,0 +55,0 @@ return shortURL;

@@ -71,6 +71,6 @@ 'use strict';

const pkgJson = _readPkgUp2.default.sync().pkg;
let pkgJsonBundlesize = pkgJson.bundlesize;
let pkgJsonbundlewatch = pkgJson.bundlewatch;
if (cliOptions.args && cliOptions.args.length > 0) {
if (pkgJsonBundlesize) {
if (pkgJsonbundlewatch) {
_logger2.default.warn(`CLI files supplied, config in package.json will be ignored`);

@@ -96,3 +96,3 @@ }

if (cliOptions.config) {
if (pkgJsonBundlesize) {
if (pkgJsonbundlewatch) {
_logger2.default.warn(`configFilePath supplied, config in package.json will be ignored`);

@@ -103,9 +103,9 @@ }

if (pkgJsonBundlesize) {
if (Array.isArray(pkgJsonBundlesize)) {
if (pkgJsonbundlewatch) {
if (Array.isArray(pkgJsonbundlewatch)) {
return {
files: pkgJsonBundlesize
files: pkgJsonbundlewatch
};
}
return pkgJsonBundlesize;
return pkgJsonbundlewatch;
}

@@ -112,0 +112,0 @@

@@ -68,3 +68,3 @@ #!/usr/bin/env node

if (results.status === _app.STATUSES.FAIL) {
_logger2.default.log(_chalk2.default.redBright(`bundlesize FAIL`));
_logger2.default.log(_chalk2.default.redBright(`bundlewatch FAIL`));
_logger2.default.log(results.summary);

@@ -76,3 +76,3 @@ _logger2.default.log('');

if (results.status === _app.STATUSES.WARN) {
_logger2.default.log(_chalk2.default.redBright(`bundlesize WARN`));
_logger2.default.log(_chalk2.default.redBright(`bundlewatch WARN`));
_logger2.default.log(results.summary);

@@ -83,3 +83,3 @@ _logger2.default.log('');

_logger2.default.log(_chalk2.default.greenBright(`bundlesize PASS`));
_logger2.default.log(_chalk2.default.greenBright(`bundlewatch PASS`));
_logger2.default.log(results.summary);

@@ -92,4 +92,4 @@ _logger2.default.log('');

_logger2.default.error(`Configuration missing:
Run ${_chalk2.default.italic('bundlesize --help')} for examples and options
Documentation available at: http://bundlesize.io/`);
Run ${_chalk2.default.italic('bundlewatch --help')} for examples and options
Documentation available at: http://bundlewatch.io/`);
return 1;

@@ -131,9 +131,9 @@ });

_logger2.default.log(' Read configuration from package.json');
_logger2.default.log(' $ bundlesize ');
_logger2.default.log(' $ bundlewatch ');
_logger2.default.log('');
_logger2.default.log(' Read configuration from file');
_logger2.default.log(' $ bundlesize --config internals/bundlesize.config.js');
_logger2.default.log(' $ bundlewatch --config internals/bundlewatch.config.js');
_logger2.default.log('');
_logger2.default.log(' Use command line');
_logger2.default.log(' $ bundlesize --max-size 100KB ./src/*.js /lib/*.js');
_logger2.default.log(' $ bundlewatch --max-size 100KB ./src/*.js /lib/*.js');
_logger2.default.log('');

@@ -140,0 +140,0 @@ _logger2.default.log('');

{
"name": "bundlewatch",
"version": "0.0.0",
"description": "Keep your library size in check",
"version": "0.1.0",
"description": "Keep watch of your bundle size",
"repository": {
"type": "git",
"url": "git+https://github.com/bundlesize/bundlesize.git"
"url": "git+https://github.com/bundlewatch/bundlewatch.git"
},
"main": "lib/index.js",
"bin": {
"bundlesize": "lib/bin/index.js"
"bundlewatch": "lib/bin/index.js"
},

@@ -31,3 +31,3 @@ "files": [

],
"author": "bundlesize",
"author": "bundlewatch",
"license": "MIT",

@@ -70,3 +70,3 @@ "dependencies": {

},
"bundlesize": {
"bundlewatch": {
"files": [

@@ -73,0 +73,0 @@ {

<div align="center">
<a href="http://bundlesize.io">
<img src="https://cdn.rawgit.com/bundlesize/bundlesize.io/master/docs/_assets/logo-large.svg" height="100px">
<a href="http://bundlewatch.io">
<img src="https://cdn.rawgit.com/bundlewatch/bundlewatch.io/master/docs/_assets/logo-large.svg" height="100px">
</a>

@@ -9,3 +9,3 @@ <br>

[![npm][npm]][npm-url]
[![bundlesize][bundlesize]][bundlesize-url]
[![bundlewatch][bundlewatch]][bundlewatch-url]

@@ -19,25 +19,25 @@ [![node][node]][node-url]

<br>
<a href="https://npmcharts.com/compare/@bundlesize/bundlesize?minimal=true">
<img src="https://img.shields.io/npm/dm/@bundlesize/bundlesize.svg">
<a href="https://npmcharts.com/compare/bundlewatch?minimal=true">
<img src="https://img.shields.io/npm/dm/bundlewatch.svg">
</a>
<a href="https://github.com/bundlesize/bundlesize/graphs/contributors">
<img src="https://img.shields.io/github/contributors/bundlesize/bundlesize.svg">
<a href="https://github.com/bundlewatch/bundlewatch/graphs/contributors">
<img src="https://img.shields.io/github/contributors/bundlewatch/bundlewatch.svg">
</a>
<h1>bundlesize</h1>
<h1>BundleWatch</h1>
<p>
bundlesize is a file size checker. Its main purpose is to ensure bundled browser assets don't jump in file size. <br />
Sharp increases in bundlesize can signal something is wrong: added a package that bloaded the slug, wrong import, forgot to minify.
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 something is wrong: added a package that bloaded the slug, wrong import, forgot to minify.
</p>
</div>
Inspired by [Siddharth Kshetrapal original Bundlesize](https://github.com/siddharthkp/bundlesize)
Inspired by [Siddharth Kshetrapal bundlesize](https://github.com/siddharthkp/bundlesize)
# Getting Started and Configuration
To get started with bundlesize, head over to the [documentation on bundlesize.io](http://bundlesize.io/)
To get started with BundleWatch, head over to the [documentation on bundlewatch.io](http://bundlewatch.io/)
## Why the change in direction from the original?
- The original bundlesize has entered maintenance mode, pull requests are left hanging, we wanted to reboost the community and start growing bundlesize out
- Split store into seperate app -> bundlesize/service with infrastructure as code
## Why the change in direction from bundlesize?
- bundlesize has entered maintenance mode, pull requests are left hanging, we wanted to reboost the community and start growing BundleWatch out
- Split store into seperate app -> bundlewatch/service with infrastructure as code
- Launched documentation website

@@ -50,3 +50,3 @@ - Enough test coverage to support CD

### Additional features:
- [x] Config validation to stop users guessing why bundlesize won't work
- [x] Config validation to stop users guessing why bundlewatch won't work
- [x] Better details breakdown

@@ -56,25 +56,25 @@ - [x] Better comparisons between branches, support branches other than master

- [x] New and improved CI behaviour
- [ ] Show history of bundlesizes over time (Coming soon)
- [ ] Show history of bundlewatchs over time (Coming soon)
## Want to help?
[See the Contributing docs](CONTRIBUTING.md) or [Join us on Slack](https://join.slack.com/t/bundlesize-bundlesize/shared_invite/enQtMzUwNjYxNTMwMzcyLWE5NGI4MzZjMjM4MTRlYzllOTMwYzIzZWNjM2MyMjBmMzNjNGM0ZGVhODc2YjFkNzIwMzNkYjk3NzE0MjZkOTc) and start contributing
[See the Contributing docs](CONTRIBUTING.md) or [Join us on Slack](https://join.slack.com/t/bundlewatch/shared_invite/enQtMzUwNjYxNTMwMzcyLWE5NGI4MzZjMjM4MTRlYzllOTMwYzIzZWNjM2MyMjBmMzNjNGM0ZGVhODc2YjFkNzIwMzNkYjk3NzE0MjZkOTc) and start contributing
[npm]: https://img.shields.io/npm/v/@bundlesize/bundlesize.svg
[npm-url]: https://npmjs.com/package/@bundlesize/bundlesize
[npm]: https://img.shields.io/npm/v/bundlewatch.svg
[npm-url]: https://npmjs.com/package/bundlewatch
[node]: https://img.shields.io/node/v/@bundlesize/bundlesize.svg
[node]: https://img.shields.io/node/v/bundlewatch.svg
[node-url]: https://nodejs.org
[bundlesize]: https://img.shields.io/badge/bundlesize-checked-green.svg
[bundlesize-url]: http://bundlesize.io
[bundlewatch]: https://img.shields.io/badge/bundle-watched-blue.svg
[bundlewatch-url]: http://bundlewatch.io
[deps]: https://img.shields.io/david/bundlesize/bundlesize.svg
[deps-url]: https://david-dm.org/bundlesize/bundlesize
[deps]: https://img.shields.io/david/bundlewatch/bundlewatch.svg
[deps-url]: https://david-dm.org/bundlewatch/bundlewatch
[builds]: https://img.shields.io/circleci/project/github/bundlesize/bundlesize.svg
[builds-url]: https://circleci.com/gh/bundlesize/bundlesize
[builds]: https://img.shields.io/circleci/project/github/bundlewatch/bundlewatch.svg
[builds-url]: https://circleci.com/gh/bundlewatch/bundlewatch
[licenses]: https://img.shields.io/npm/l/@bundlesize/bundlesize.svg
[licenses-url]: https://github.com/bundlesize/bundlesize/blob/master/LICENSE
[licenses]: https://img.shields.io/npm/l/bundlewatch.svg
[licenses-url]: https://github.com/bundlewatch/bundlewatch/blob/master/LICENSE
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