Added instructions to fork the repo in order to setup. (#10973)

* Added instructions to fork the repo to setup

* Capitalized Github and Indented the guidelines

[skip ci]
This commit is contained in:
Siddhant N Trivedi 2020-01-11 00:35:58 +05:30 committed by Nicolò Ribaudo
parent bfc56ebbab
commit 3dcb8ca99e

View File

@ -1,4 +1,4 @@
----
---
<p align="center" class="toc">
<strong><a href="#setup">Setup</a></strong>
@ -12,8 +12,7 @@
<strong><a href="#internals">Internals</a></strong>
</p>
----
---
# Contributing
@ -49,8 +48,12 @@ Installation instructions can be found here: https://yarnpkg.com/en/docs/install
### Setup
Fork the `babel` repository to your GitHub Account.
Then, run:
```sh
$ git clone https://github.com/babel/babel
$ git clone https://github.com/<your-github-username>/babel
$ cd babel
$ make bootstrap
```
@ -177,6 +180,7 @@ For example, in [`@babel/plugin-transform-exponentiation-operator/test`](https:/
- There is an `index.js` file. It imports our [test helper](https://github.com/babel/babel/tree/master/packages/babel-helper-plugin-test-runner). (You don't have to worry about this).
- There can be multiple folders under [`/fixtures`](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures)
- There is an [`options.json`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/options.json) file whose function is similar to a `.babelrc` file, allowing you to pass in the plugins and settings you need for your tests.
- For this test, we only need the relevant plugin, so it's just `{ "plugins": ["@babel/plugin-transform-exponentiation-operator"] }`.
- If necessary, you can have an `options.json` with different options in each subfolder.
@ -200,6 +204,7 @@ and the expected output after transforming it with your `options.json` in `outpu
// output.js
Math.pow(2, 2);
```
In an `exec.js` test, we run or check that the code actually does what it's supposed to do rather than just check the static output.
```js
@ -235,9 +240,9 @@ Inside the `packages/babel-parser/test/fixtures` folder are categories/groupings
etc.). To add a test, create a folder under one of these groupings (or create a new one) with a
descriptive name, and add the following:
* Create an `input.js` file that contains the code you want the babel parser to parse.
- Create an `input.js` file that contains the code you want the babel parser to parse.
* Add an `output.json` file with the expected parser output. For added convenience, if there is no `output.json` present, the test runner will generate one for you.
- Add an `output.json` file with the expected parser output. For added convenience, if there is no `output.json` present, the test runner will generate one for you.
After writing tests for @babel/parser, just build it by running:
@ -317,6 +322,7 @@ Note that the code shown in Chrome DevTools is compiled code and therefore diffe
- Start working about the Babel transform itself!
## Internals
- AST spec ([babel-parser/ast/spec.md](https://github.com/babel/babel/blob/master/packages/babel-parser/ast/spec.md))
- Versioning ([doc/design/versioning.md](https://github.com/babel/babel/blob/master/doc/design/versioning.md))
- Monorepo ([doc/design/monorepo.md](https://github.com/babel/babel/blob/master/doc/design/monorepo.md))