Skip to content

Commit

Permalink
Update Contributing.md [skip ci] (#480)
Browse files Browse the repository at this point in the history
* Update Contributing.md [skip ci]

* Fix wording [skip ci]

* Remove $ [skip ci]
  • Loading branch information
boopathi authored Mar 17, 2017
1 parent b014c3f commit 2379fc1
Showing 1 changed file with 53 additions and 17 deletions.
70 changes: 53 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,54 +8,90 @@ $ npm install
$ npm run bootstrap
```

Then you can either run:
#### Build

To build **once**:

```sh
$ npm run build
npm run build
```

to build Babel **once** or:
Or to do an incremental build in watch mode:

```sh
$ npm run watch
npm run watch
```

#### Lint

This project uses [prettier](https://github.com/prettier/prettier) for formatting code and [eslint](https://github.com/eslint/eslint) for other linting.

To check both:

```sh
npm run lint
```

You can also run them each individually:

```sh
# prettier
npm run format-check

# eslint
npm run eslint
```

to have Babel build itself then incrementally build files on change.
##### Lint Fix

To run all tests:
To fix formatting and auto-fixable eslint errors,

```sh
$ npm test
npm run fix
```

or run tests for a specific package:
You can also run them each individually:

```sh
$ npm test packages/babel-preset-babili
# prettier
npm run format

# eslint
npm run eslint-fix
```

To run lint:
#### Test

To run all tests,

```sh
$ npm run lint
npm test
```

To run lint autofixes:
To run tests for a specific package,

```sh
npm test packages/babel-preset-babili
```

#### Benchmarks

[benchmark.js](scripts/benchmark.js) compares Babili with [Uglify](https://github.com/mishoo/UglifyJS2), [Closure Compiler](https://github.com/google/closure-compiler) and [Closure Compiler JS](https://github.com/google/closure-compiler-js)

```sh
$ npm run fix
./scripts/benchmark.js [file...]
```

To run current benchmarks on a file:
[plugin-timing.js](scripts/plugin-timing.js) is used to calculate and compare the time spent in each plugin.

```sh
$ ./scripts/benchmark.js [file...]
./scripts/plugin-timing.js file.js
```

To run current plugin timing on a file:
[plugin-contribution.js](scripts/plugin-contribution.js) calculates how much each plugin of babili contributes to size reduction.

```sh
$ ./scripts/plugin-timing.js file.js
./scripts/plugin-contribution.js file.js
```

### Debugging
Expand Down

0 comments on commit 2379fc1

Please sign in to comment.