Skip to content

Commit

Permalink
Update Contributing.md [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
boopathi committed Mar 17, 2017
1 parent b014c3f commit a871bde
Showing 1 changed file with 55 additions and 17 deletions.
72 changes: 55 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,54 +8,92 @@ $ npm install
$ npm run bootstrap
```

Then you can either run:
#### Build

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

to build Babel **once** or:
to build **once**

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

to have Babel build itself then incrementally build files on change.
to do incremental builds in watch mode

To run all tests:
#### Lint

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

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

or run tests for a specific package:
will run prettier and eslint to report formatting and linting errors. You can run them individually using -

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

To run lint:
##### Lint Fix

To fix formatting and auto-fixable eslint errors,

```sh
$ npm run lint
npm run fix
```

To run lint autofixes:
You can run them separately using -

```sh
$ npm run fix
# prettier
npm run format
# eslint
npm run eslint-fix
```

To run current benchmarks on a file:
#### Test

To run all tests,

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

To run current plugin timing on a file:
To run tests for a specific package,

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

#### Benchmarks

##### [benchmark.js](scripts/benchmark.js)

[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
./scripts/benchmark.js [file...]
```

##### [plugin-timing.js](scripts/plugin-timing.js)

[plugin-timing.js](scripts/plugin-timing.js) is used to calculate and compare the time spent in each plugin.

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

##### [plugin-contribution.js](scripts/plugin-contribution.js)

[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 a871bde

Please sign in to comment.