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

Update Contributing.md [skip ci] #480

Merged
merged 3 commits into from
Mar 17, 2017
Merged
Changes from all commits
Commits
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
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