Skip to content

Commit

Permalink
added tests and broke up code
Browse files Browse the repository at this point in the history
  • Loading branch information
gregtillbrook committed Mar 8, 2018
1 parent a36e3ec commit 39e6186
Show file tree
Hide file tree
Showing 17 changed files with 4,354 additions and 5,444 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module.exports = {
"env": {
"es6": true,
"node": true
"node": true,
"jest": true
},
"extends": "eslint:recommended",
"rules": {
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
node_modules
.vscode
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: node_js
node_js:
- '6'
- '8'
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

A plugin for the [Parcel bundler](https://parceljs.org/) to visualise bundle contents.

[![NPM Version][npm-image]][npm-url]
[![Linux CI Build][travis-image]][travis-url]
[![Windows CI Build][appveyor-image]][appveyor-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]

![Screenshot showing treemap of a bundle](/docs/bundle-report-example.png?raw=true)

This plugin aims to make it easier to visualise a bundles contents and aid in troubleshooting and optimisation. If you know [webpack-bundle-analyzer](https://www.npmjs.com/package/webpack-bundle-analyzer/) then this plugin will be very familiar. Bundle contents is presented in a treemap that gives eash asset/folder an area relative to its size on disc.
Expand All @@ -19,11 +24,19 @@ The next time you run your parcel build a bundle report will be saved to `<proje

# Still TODO
- Show details for assets on mouse hover
- Some unit tests
- Config to choose the name and output folder of the report
- Command line arg for parcel so it's possible to generate report only when required


# Credits
- [webpack-bundle-analyzer](https://www.npmjs.com/package/webpack-bundle-analyzer/) - this plugin takes heavy inspiration from it and wouldnt exist without it
- [Parcel](https://parceljs.org/) - A nice alternative bundler for when you dont need/want lots of configuration
- [Parcel](https://parceljs.org/) - A nice alternative bundler for when you dont need/want lots of configuration.

[npm-image]: https://img.shields.io/npm/v/parcel-plugin-bundle-visualiser.svg
[npm-url]: https://npmjs.org/package/parcel-plugin-bundle-visualiser
[travis-image]: https://img.shields.io/travis/gregtillbrook/parcel-plugin-bundle-visualiser/master.svg?label=Linux%20CI%20Build
[travis-url]: https://travis-ci.org/gregtillbrook/parcel-plugin-bundle-visualiser
[appveyor-image]: https://img.shields.io/appveyor/ci/gregtillbrook/parcel-plugin-bundle-visualiser/master.svg?label=Windows%20CI%20Build
[appveyor-url]: https://ci.appveyor.com/project/gregtillbrook/parcel-plugin-bundle-visualiser
[snyk-image]: https://snyk.io/test/github/gregtillbrook/parcel-plugin-bundle-visualiser/badge.svg
[snyk-url]: https://snyk.io/test/github/gregtillbrook/parcel-plugin-bundle-visualiser
19 changes: 19 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
environment:
matrix:
- nodejs_version: '8'
install:
- ps: Install-Product node $env:nodejs_version
- set CI=true
- npm install --global npm@latest
- set PATH=%APPDATA%\npm;%PATH%
- npm install
matrix:
fast_finish: true
build: off
shallow_clone: true
test_script:
- node --version
- npm --version
- npm test
cache:
- '%APPDATA%\npm-cache'
3,183 changes: 0 additions & 3,183 deletions dist/carrotsearch.foamtree.js

This file was deleted.

227 changes: 0 additions & 227 deletions dist/index.js

This file was deleted.

Loading

0 comments on commit 39e6186

Please sign in to comment.