mirror of
https://github.com/swc-project/swc.git
synced 2024-11-26 09:54:22 +03:00
doc(repo): Update contributing docs (#3298)
This commit is contained in:
parent
ca2598391c
commit
5af79f634b
@ -65,41 +65,59 @@ Steps to get started:
|
||||
|
||||
## Getting your development environment set up
|
||||
|
||||
After cloning the project there are a few steps required to get the project running.
|
||||
After cloning the project there are a few steps required to get the project running.
|
||||
For running all tests, take the following steps:
|
||||
|
||||
1. Fetch submodules to pull ECMAScript test suites.
|
||||
1. Fetch submodules to pull ECMAScript test suites.
|
||||
|
||||
```bash
|
||||
git submodule update --init --recursive
|
||||
```
|
||||
|
||||
2. Install js dependencies.
|
||||
2. Install js dependencies.
|
||||
Ensure [Yarn Package Manager is installed](https://yarnpkg.com/getting-started/install)
|
||||
|
||||
```bash
|
||||
yarn
|
||||
( cd crates/swc_ecma_transforms; yarn )
|
||||
```
|
||||
```bash
|
||||
yarn
|
||||
```
|
||||
|
||||
3. Setup some environment variables which is required for tests.
|
||||
3. Setup some environment variables which is required for tests.
|
||||
|
||||
```bash
|
||||
export RUST_BACKTRACE=full
|
||||
export PATH="$PATH:$PWD/crates/swc_ecma_transforms/node_modules/.bin"
|
||||
export PATH="$PATH:$PWD/node_modules/.bin"
|
||||
export RUST_MIN_STACK=16777216
|
||||
```
|
||||
|
||||
4. Install deno, if you are going to work on the bundler.
|
||||
4. Install deno
|
||||
|
||||
See [official install guide of deno](https://deno.land/manual/getting_started/installation) to install it.
|
||||
|
||||
5. Ensure you're using Node.JS >= 16
|
||||
5. Add wasm32-wasi target
|
||||
|
||||
`rustup target add wasm32-wasi`
|
||||
|
||||
6. Ensure you're using Node.JS >= 16
|
||||
|
||||
Since tests make use of `atob` which was only introduced in node 16.
|
||||
|
||||
6. Run tests
|
||||
7. Run tests
|
||||
|
||||
```bash
|
||||
cargo test --all --all-features
|
||||
cargo test --all --no-default-features --features swc_v1
|
||||
```
|
||||
Or
|
||||
```bash
|
||||
cargo test --all --no-default-features --features swc_v2
|
||||
```
|
||||
|
||||
## Running tests per package
|
||||
|
||||
While working on specific packages, individual tests can be run by specifying a package to the
|
||||
cargo test runner, e.g.
|
||||
|
||||
```bash
|
||||
cargo test -p swc_ecma_transforms --all-features
|
||||
```
|
||||
|
||||
## Pull requests
|
||||
|
@ -73,7 +73,7 @@ fn fixture(input: PathBuf) {
|
||||
})
|
||||
.expect_err("should fail");
|
||||
|
||||
let output = NormalizedOutput::from(format!("{:?}", err));
|
||||
let output = NormalizedOutput::from(format!("{}", err));
|
||||
|
||||
output.compare_to_file(&output_path).unwrap();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user