Skip to content
This repository was archived by the owner on Feb 1, 2021. It is now read-only.

Commit 6c4cf84

Browse files
committed
feat: add CLI to upload stats
1 parent 0295c00 commit 6c4cf84

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2841
-149
lines changed

.eslintignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
node_modules/
2-
lib/
2+
lib/
3+
dist.js
4+
__fixtures__

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules/
2-
lib/
2+
lib/
3+
dist.js

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules/
22
package.json
3-
CHANGELOG.md
3+
CHANGELOG.md
4+
dist.js

jest.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
testEnvironment: 'node',
3+
}

package.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
],
66
"scripts": {
77
"build": "lerna run build",
8-
"ci": "yarn build && yarn lint",
8+
"ci": "yarn build && yarn lint && yarn test --ci",
9+
"dev": "lerna run build --parallel -- --watch",
910
"format": "prettier --write \"**/*.{js,json,md}\"",
1011
"lint": "eslint .",
11-
"release": "lerna publish --conventional-commits && conventional-github-releaser --preset angular"
12+
"release": "lerna publish --conventional-commits && conventional-github-releaser --preset angular",
13+
"test": "jest"
1214
},
1315
"devDependencies": {
1416
"@babel/cli": "^7.4.4",
@@ -17,15 +19,19 @@
1719
"@babel/preset-env": "^7.4.5",
1820
"babel-eslint": "^10.0.1",
1921
"conventional-github-releaser": "^3.1.3",
20-
"eslint": "^6.0.1",
22+
"eslint": "^6.4.0",
2123
"eslint-config-airbnb": "^18.0.1",
22-
"eslint-config-prettier": "^6.2.0",
24+
"eslint-config-prettier": "^6.3.0",
2325
"eslint-config-smooth": "^2.1.1",
2426
"eslint-plugin-import": "^2.18.2",
2527
"eslint-plugin-jsx-a11y": "^6.2.3",
2628
"eslint-plugin-react": "^7.14.3",
2729
"eslint-plugin-react-hooks": "^2.0.1",
30+
"jest": "^24.9.0",
2831
"lerna": "^3.14.1",
29-
"prettier": "^1.18.2"
32+
"memory-fs": "^0.4.1",
33+
"nock": "^11.3.4",
34+
"prettier": "^1.18.2",
35+
"webpack": "^4.40.2"
3036
}
3137
}

packages/cli/.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/*
2+
!/lib/**/*.js
3+
*.test.js

packages/cli/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# @bundle-analyzer/cli
2+
3+
Official CLI compatible with [Bundle Analyzer service](https://www.bundle-analyzer.com).
4+
5+
## Install
6+
7+
```
8+
npm install --save-dev @bundle-analyzer/cli
9+
```
10+
11+
## Usage
12+
13+
```js
14+
webpack --json | bundle-analyzer --token <your-token>
15+
```
16+
17+
## Complete documentation
18+
19+
👉 [See full documentation](https://docs.bundle-analyzer.com/)
20+
21+
## License
22+
23+
MIT

packages/cli/__fixtures__/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log('hello world!')

packages/cli/bin/bundle-analyzer

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env node
2+
3+
require('../lib/index')

packages/cli/package.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "@bundle-analyzer/cli",
3+
"description": "Bundle Analyzer CLI.",
4+
"version": "0.2.1",
5+
"main": "lib/index.js",
6+
"repository": "https://github.com/smooth-code/bundle-analyzer-javascript/tree/master/packages/cli",
7+
"author": "Greg Bergé <[email protected]>",
8+
"publishConfig": {
9+
"access": "public"
10+
},
11+
"keywords": [
12+
"bundle-analyzer",
13+
"bundlesize"
14+
],
15+
"engines": {
16+
"node": ">=8"
17+
},
18+
"license": "MIT",
19+
"scripts": {
20+
"prebuild": "rm -rf lib/",
21+
"build": "babel --config-file ../../babel.config.js -d lib --ignore \"**/*.test.js\" src",
22+
"prepublishOnly": "yarn run build"
23+
},
24+
"dependencies": {
25+
"@bundle-analyzer/core": "^0.2.1",
26+
"commander": "^3.0.1"
27+
},
28+
"devDependencies": {
29+
"webpack-cli": "^3.3.8"
30+
}
31+
}

0 commit comments

Comments
 (0)