Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 3: Split reporting UI from dependency graph size calculation #97

Closed
wants to merge 71 commits into from
Closed
Show file tree
Hide file tree
Changes from 67 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
bed16d6
Trim trailing whitespace in analyzer bin
valscion May 27, 2017
92725f7
Move chartData calculation to outer layer of code
valscion May 27, 2017
013cec6
Pass logger instance form bin to viewer
valscion May 27, 2017
6324701
Force the presence of logger in viewer functions
valscion May 27, 2017
8a78d1b
Force the presence of logger in analyzer functions
valscion May 27, 2017
7484107
Move client and views directories under reporter root directory
valscion May 27, 2017
1887ecb
Remove start from main entry point
valscion May 27, 2017
14068fa
Update changelog with unreleased changes
valscion May 27, 2017
59c3926
Update package.json files array to match reporter changes
valscion May 27, 2017
4f405cf
Merge branch 'master' into split-reporter-2
valscion Jul 14, 2017
318f588
Merge pull request #81 from th0r/split-reporter-2
valscion Jul 14, 2017
0dea700
Run lerna init
valscion Jul 14, 2017
d218b3e
Move code-related files 1:1 under packages/webpack-bundle-analyzer-pl…
valscion Jul 14, 2017
9d2e4d3
Add root-level package.json
valscion Jul 14, 2017
88c4256
Configure lerna to use yarn as npm client
valscion Jul 14, 2017
3d4f895
Move lerna dep to root-level package.json
valscion Jul 14, 2017
2cb55a6
Use exact version for lerna
valscion Jul 14, 2017
e579dad
Run yarn in root of repo
valscion Jul 14, 2017
31b443b
Add some info about lerna to CONTRIBUTING.md
valscion Jul 14, 2017
a18dc45
Split Treemap reporter to new package
valscion Jul 14, 2017
14b6356
Update .gitignore to work with monorepo
valscion Jul 14, 2017
aab16e4
Move linting setup to root level
valscion Jul 14, 2017
c6afe54
Run bootstrap in CI
valscion Jul 14, 2017
8af93ed
Replace global lerna usage instruction with npm script
valscion Jul 14, 2017
2ae76b4
Cache sub-package node_modules in TravisCI as well
valscion Jul 14, 2017
0c7403f
v3.0.0-alpha.0
valscion Jul 14, 2017
ad1304f
Merge pull request #98 from th0r/lerna
valscion Jul 14, 2017
b45c783
Fix .gitignore being too eager
valscion Jul 14, 2017
a62bcad
Merge pull request #99 from th0r/fix-git-ignore
valscion Jul 14, 2017
dcd2336
Point URLs in reporter-treemap package.json to main repo
valscion Jul 14, 2017
d7c74f1
Remove unnecessary reporter/ subdir in reporter package
valscion Jul 14, 2017
2b96d9a
Remove obsolete reporter-related package.json/files setup in plugin
valscion Jul 14, 2017
c259b77
Merge pull request #100 from th0r/clean-up-reporter
valscion Jul 14, 2017
5806437
Add npm run dev script
valscion Jul 14, 2017
b7906da
Move publish script to root package
valscion Jul 15, 2017
560339d
Stream output of tests while running
valscion Jul 15, 2017
5ffe9d9
Merge pull request #101 from th0r/improve-dev-experience
valscion Jul 15, 2017
6de3a6b
Move plugin code to @webpack-bundle-analyzer/plugin npm package
valscion Jul 15, 2017
a8d8b91
Run yarn in every package
valscion Jul 15, 2017
f6d99c0
v3.0.0-alpha.1
valscion Jul 15, 2017
1826eae
Remove deprecated startAnalyzer plugin option
valscion Jul 15, 2017
1498e7c
Add --reporter and --reporterOptions to configure reporter
valscion Jul 15, 2017
82780ca
Add test-dev npm script
valscion Jul 17, 2017
e989f78
Define static report output path on the outer edge
valscion Jul 17, 2017
1d97eec
Move process.cwd() fallback for outputPath to plugin
valscion Jul 17, 2017
ebf60e7
Always set CLI outputPath as current working directory
valscion Jul 17, 2017
a72fccd
Remove outputPath fallback from plugin code
valscion Jul 17, 2017
e3a70d5
Fix test invocations
valscion Jul 17, 2017
e73619d
Remove unnecessary tmp directory setup for dev-server tests
valscion Jul 17, 2017
fec9b6d
Merge pull request #102 from th0r/new-options
valscion Jul 17, 2017
d4e1915
Merge master to version-3 branch to bring it up-to-date (#117)
valscion Sep 24, 2017
17ef047
Merge branch 'master' into version-3
valscion Sep 24, 2017
b881a78
Upgrade lerna to v2.2.0
valscion Sep 24, 2017
11a930e
Point nightmare package to a version that pins electron
valscion Sep 24, 2017
e4440a0
Configure lerna and yarn to use workspaces
valscion Sep 24, 2017
214d7cb
Remove yarn.lock from sub-deps to have it only on root level
valscion Sep 24, 2017
2cefa35
Configure Travis to use yarn@1.0.2
valscion Sep 24, 2017
9bc8b43
Merge pull request #118 from th0r/yarn-workspaces-and-version-1
valscion Sep 24, 2017
6e02730
Merge commit 'ce41c97' into version-3
valscion Dec 9, 2017
57b341f
Merge commit 'e6fbbe7' into version-3
valscion Dec 9, 2017
40c06e7
Merge commit 'ceef5be' into version-3
valscion Dec 9, 2017
082bb9a
Merge branch 'master' into version-3
valscion Dec 9, 2017
d73ea19
Merge branch 'master' into version-3
valscion Jan 13, 2018
9ea963d
Setup viewer specific tests properly
valscion Jan 13, 2018
acbc837
Merge commit '5cb03bad2195506189c2cefedbf601fd5d3252f7' into version-3
valscion Feb 4, 2018
282c1e1
Merge branch 'master' into version-3
valscion Feb 4, 2018
61dabf9
Run CI for pull requests targeting version-3 branch
valscion Feb 4, 2018
faf24a3
Split bundle parsing to new package (#143)
valscion Feb 4, 2018
15caf72
Extract Logger class to own package (#151)
valscion Feb 4, 2018
241f500
v3.0.0-alpha.2
valscion Feb 4, 2018
b63ca72
Fix bundle-parser README.md API example
valscion Feb 4, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# node_modules in sub-packages
packages/*/node_modules

# Generated code
lib
public
packages/*/lib
packages/reporter-treemap/public

# Vendor code
client/vendor
packages/reporter-treemap/client/vendor

# Test fixtures
test/bundles
test/webpack.config.js
packages/*/test/bundles
packages/*/test/webpack.config.js

# Test results
test/output
packages/*/test/output

samples
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
lib
public
# node_modules in sub-packages
packages/*/node_modules

# Generated code
packages/*/lib
packages/reporter-treemap/public

samples

node_modules
npm-debug.log
lerna-debug.log
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ sudo: false
branches:
only:
- master
- version-3
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be removed right before merging. This is needed here so that branches against this version-3 branch have their tests ran in CI. See #143 (comment)

node_js:
- "4"
- "6"
Expand All @@ -12,13 +13,17 @@ cache:
- yarn: true
- directories:
- node_modules
- packages/reporter-treemap/node_modules
- packages/plugin/node_modules
addons:
apt:
packages:
# Required by Electron
# https://github.com/juliangruber/electron-stream#travis
- xvfb
before_script:
# Install packages in subdirectories
- npm run bootstrap
# Required by Electron
- export DISPLAY=':99.0'
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ _Note: Gaps between patch versions are faulty, broken or test releases._

<!-- Add changelog entries for new changes under this section -->

* **Internal**
* Moved internal, treemap reporter related code around (@valscion at [#81](https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/81)).
* Removed undocumented `require('webpack-bundle-analyzer').start` accessor. If you try to
use the `start` function now, it will raise an error.

## 2.10.0

* **Bug Fix**
Expand Down
8 changes: 7 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ To contribute to `webpack-bundle-analyzer`, fork the repository and clone it to

## Setup packages

Then install [`yarn`](https://yarnpkg.com/):
Install [`yarn`](https://yarnpkg.com/):

```sh
npm install --global yarn
Expand All @@ -16,6 +16,12 @@ Next, install this package's dependencies with `yarn`:
yarn install
```

Bootstrap the Lerna project (installs all node_modules in monorepo packages)

```sh
npm run bootstrap
```

## Develop with your own project

Run the following to build this library and watch its source files for changes:
Expand Down
6 changes: 6 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"lerna": "2.0.0",
"npmClient": "yarn",
"useWorkspaces": true,
"version": "3.0.0-alpha.1"
}
93 changes: 13 additions & 80 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,90 +1,23 @@
{
"name": "webpack-bundle-analyzer",
"version": "2.10.0",
"description": "Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap",
"author": "Yury Grunin <grunin.ya@ya.ru>",
"license": "MIT",
"homepage": "https://github.com/webpack-contrib/webpack-bundle-analyzer",
"changelog": "https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/master/CHANGELOG.md",
"bugs": {
"url": "https://github.com/webpack-contrib/webpack-bundle-analyzer/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/webpack-contrib/webpack-bundle-analyzer.git"
},
"main": "lib/index.js",
"bin": "lib/bin/analyzer.js",
"engines": {
"node": ">= 4"
},
"scripts": {
"start": "gulp watch",
"build": "gulp build",
"npm-publish": "npm run lint && npm run build && npm test && npm publish",
"lint": "eslint --ext js,jsx .",
"test": "mocha --exit --require babel-core/register",
"test-dev": "mocha --watch --require babel-core/register"
},
"files": [
"public",
"lib",
"src",
"views"
"private": true,
"workspaces": [
"packages/*"
],
"dependencies": {
"acorn": "^5.3.0",
"bfj-node4": "^5.2.0",
"chalk": "^2.3.0",
"commander": "^2.13.0",
"ejs": "^2.5.7",
"express": "^4.16.2",
"filesize": "^3.5.11",
"gzip-size": "^4.1.0",
"lodash": "^4.17.4",
"mkdirp": "^0.5.1",
"opener": "^1.4.3",
"ws": "^4.0.0"
"scripts": {
"bootstrap": "lerna bootstrap",
"build": "lerna run build --stream",
"dev": "lerna run start --parallel",
"npm-publish": "npm run lint && npm run build && npm test && lerna publish",
"test": "lerna run test --stream",
"test-dev": "lerna run test-dev --parallel",
"lint": "eslint --ext js,jsx ."
},
"devDependencies": {
"babel-core": "6.26.0",
"babel-eslint": "8.2.1",
"babel-loader": "7.1.2",
"babel-plugin-transform-class-properties": "6.24.1",
"babel-plugin-transform-object-rest-spread": "6.26.0",
"babel-plugin-transform-react-jsx": "6.24.1",
"babel-preset-env": "1.6.1",
"chai": "4.1.2",
"chai-subset": "1.6.0",
"classnames": "2.2.5",
"css-loader": "0.28.9",
"del": "3.0.0",
"eslint": "4.16.0",
"eslint-config-th0r": "1.0.0",
"eslint-config-th0r-react": "1.0.0",
"eslint-plugin-react": "7.6.1",
"exports-loader": "0.6.4",
"gulp": "4.0.0",
"gulp-babel": "7.0.1",
"mocha": "5.0.0",
"nightmare": "2.10.0",
"preact": "8.2.7",
"sinon": "4.2.2",
"stream-combiner2": "1.1.1",
"style-loader": "0.20.1",
"webpack": "3.10.0",
"webpack-dev-server": "2.11.1"
},
"keywords": [
"webpack",
"bundle",
"analyzer",
"modules",
"size",
"interactive",
"chart",
"treemap",
"zoomable",
"zoom"
]
"lerna": "2.2.0"
}
}
File renamed without changes.
32 changes: 32 additions & 0 deletions packages/plugin/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
'use strict';

const gulp = require('gulp');

const NODE_SRC = './src/**/*.js';
const NODE_DEST = './lib';

gulp.task('clean', gulp.parallel(cleanNodeScripts));
gulp.task('build', gulp.series('clean', compileNodeScripts));
gulp.task('watch', gulp.series('build', watch));
gulp.task('default', gulp.task('watch'));

function watch() {
gulp
.watch(NODE_SRC, gulp.series(cleanNodeScripts, compileNodeScripts))
// TODO: replace with `emitErrors: false` option after https://github.com/gulpjs/glob-watcher/pull/34 will be merged
.on('error', () => {});
}

function cleanNodeScripts() {
const del = require('del');
return del(NODE_DEST);
}

function compileNodeScripts() {
const babel = require('gulp-babel');

return gulp
.src(NODE_SRC)
.pipe(babel())
.pipe(gulp.dest(NODE_DEST));
}
83 changes: 83 additions & 0 deletions packages/plugin/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"name": "@webpack-bundle-analyzer/plugin",
"version": "3.0.0-alpha.1",
"description": "Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap",
"author": "Yury Grunin <grunin.ya@ya.ru>",
"license": "MIT",
"homepage": "https://github.com/webpack-contrib/webpack-bundle-analyzer",
"changelog": "https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/master/CHANGELOG.md",
"bugs": {
"url": "https://github.com/webpack-contrib/webpack-bundle-analyzer/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/webpack-contrib/webpack-bundle-analyzer.git"
},
"main": "lib/index.js",
"bin": "lib/bin/analyzer.js",
"engines": {
"node": ">= 4"
},
"scripts": {
"start": "gulp watch",
"build": "gulp build",
"test": "mocha --exit --require babel-core/register",
"test-dev": "mocha --watch --require babel-core/register"
},
"files": [
"lib",
"src"
],
"dependencies": {
"@webpack-bundle-analyzer/reporter-treemap": "^3.0.0-alpha.1",
"acorn": "^5.3.0",
"bfj-node4": "^5.2.0",
"chalk": "^2.3.0",
"commander": "^2.13.0",
"ejs": "^2.5.7",
"express": "^4.16.2",
"filesize": "^3.5.11",
"gzip-size": "^4.1.0",
"lodash": "^4.17.4",
"mkdirp": "^0.5.1",
"opener": "^1.4.3",
"ws": "^4.0.0"
},
"devDependencies": {
"babel-core": "6.26.0",
"babel-loader": "7.1.2",
"babel-plugin-transform-class-properties": "6.24.1",
"babel-plugin-transform-object-rest-spread": "6.26.0",
"babel-plugin-transform-react-jsx": "6.24.1",
"babel-preset-env": "1.6.1",
"chai": "4.1.2",
"chai-subset": "1.6.0",
"classnames": "2.2.5",
"css-loader": "0.28.9",
"del": "3.0.0",
"exports-loader": "0.6.4",
"gulp": "4.0.0",
"gulp-babel": "7.0.1",
"gulp-plumber": "1.2.0",
"mocha": "5.0.0",
"nightmare": "git://github.com/segmentio/nightmare.git#7d1b8a40b6f5857a06e7f20440fc4f416c54e9a1",
"preact": "8.2.7",
"sinon": "4.2.2",
"stream-combiner2": "1.1.1",
"style-loader": "0.20.1",
"webpack": "3.10.0",
"webpack-dev-server": "2.11.1"
},
"keywords": [
"webpack",
"bundle",
"analyzer",
"modules",
"size",
"interactive",
"chart",
"treemap",
"zoomable",
"zoom"
]
}
Loading