Skip to content

Commit

Permalink
8th Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Shyam-Chen committed May 21, 2018
1 parent 70507a1 commit 50c8365
Show file tree
Hide file tree
Showing 5 changed files with 229 additions and 156 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
npm
coverage
*.log
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,47 @@

## Getting Started

1. Clone this boilerplate

```bash
$ git clone https://github.com/Vanilla-IceCream/Library-Boilerplate
$ cd Library-Boilerplate
```

2. Install dependencies

```bash
$ yarn install && yarn typed
```

3. Watch files and recompile whenever they change

```bash
$ yarn start
```

`yarn start` builds the library, then keeps rebuilding it whenever the source files change using `rollup-watch`.

4. Compile and bundle code

```bash
$ yarn build
```

`yarn build` builds the library to `dist`, generating three major files:

* `dist/LIB_NAME.cjs.js` A CommonJS bundle, suitable for use in Node.js, that requires the external dependency. This corresponds to the `"main"` field in package.json
* `dist/LIB_NAME.esm.js` an ES module bundle, suitable for use in other people's libraries and applications, that imports the external dependency. This corresponds to the `"module"` field in package.json
* `dist/LIB_NAME.umd.js` a UMD build, suitable for use in any environment (including the browser, as a <script> tag), that includes the external dependency. This corresponds to the `"browser"` field in package.json

5. Check the code quality

```bash
$ yarn lint
```

6. Run the unit tests

```bash
$ yarn test
```
20 changes: 11 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"module": "dist/LIB_NAME.esm.js",
"browser": "dist/LIB_NAME.umd.js",
"scripts": {
"start": "rollup -c -w",
"build": "rollup -c",
"lint": "eslint 'src' 'test'",
"test": "jest --coverage",
"coverage": "cat ./coverage/lcov.info | coveralls",
"typed": "flow-typed install"
Expand All @@ -25,29 +27,29 @@
"peerDependencies": {},
"dependencies": {},
"devDependencies": {
"babel-core": "^6.26.2",
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.3",
"babel-jest": "^22.4.3",
"babel-jest": "^22.4.4",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-root-import": "^5.1.0",
"babel-preset-env": "^1.6.1",
"babel-preset-env": "^1.7.0",
"babel-preset-flow": "^6.23.0",
"babel-preset-stage-0": "^6.24.1",
"coveralls": "^3.0.0",
"coveralls": "^3.0.1",
"eslint": "^4.19.1",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-import-resolver-babel-plugin-root-import": "^1.1.1",
"eslint-plugin-flowtype": "^2.46.3",
"eslint-plugin-flowtype-errors": "^3.5.1",
"eslint-plugin-import": "^2.11.0",
"flow-bin": "^0.71.0",
"eslint-plugin-import": "^2.12.0",
"flow-bin": "^0.72.0",
"flow-typed": "^2.4.0",
"jest": "^22.4.3",
"rollup": "^0.58.2",
"jest": "^22.4.4",
"rollup": "^0.59.1",
"rollup-plugin-babel": "^3.0.4",
"rollup-plugin-commonjs": "^9.1.3",
"rollup-plugin-node-resolve": "^3.3.0",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-uglify": "^3.0.0"
"rollup-plugin-uglify": "^4.0.0"
}
}
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';
import replace from 'rollup-plugin-replace';
import uglify from 'rollup-plugin-uglify';
import { uglify } from 'rollup-plugin-uglify';

import pkg from './package.json';

Expand Down
Loading

0 comments on commit 50c8365

Please sign in to comment.