This commit is contained in:
강동윤 2020-08-23 02:41:39 +09:00 committed by GitHub
parent c475ab7f92
commit c6a10251c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 7 deletions

View File

@ -206,8 +206,8 @@ export class Compiler extends wrapNativeSuper(native.Compiler) {
}
const plugin = options.plugin;
delete options.plugin;
const plugin = options?.plugin;
delete options?.plugin;
if (plugin) {
const m = this.parseFileSync(path, options?.jsc?.parser);

View File

@ -203,6 +203,14 @@ export type Swcrc = Config | Config[];
* .swcrc
*/
export interface Config {
/**
* Note: The type is string beacuse it follow rust's regex syntax.
*/
test?: string | string[];
/**
* Note: The type is string beacuse it follow rust's regex syntax.
*/
exclude?: string | string[];
env?: EnvConfig;
jsc?: JscConfig;
module?: ModuleConfig;
@ -295,9 +303,9 @@ export interface EsParserConfig {
/**
* Defaults to false.
*/
jsc?: boolean;
jsx?: boolean;
/**
* Defaults to `false`. This is not implemented yet.
* Defaults to `false`.
*/
numericSeparator?: boolean;
/**

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -eu
export RUST_MIN_STACK=$((1024*1024*16))
export RUST_MIN_STACK=16777216
export CARGO_INCREMENTAL=0
export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests"
export RUSTDOCFLAGS="-Cpanic=abort"
@ -10,9 +10,9 @@ export CARGO_TARGET_DIR=".COVERAGE_DIR"
git clone https://github.com/swc-project/ts-parser-test-ref.git ecmascript/parser/tests/typescript/tsc || true
(cd ecmascript/parser/tests/typescript/tsc && git pull)
cargo test --all --all-features --exclude node-swc --exclude wasm --exclude spack
cargo test --all --all-features --exclude node-swc --exclude wasm
zip -0 ccov.zip `find $CARGO_TARGET_DIR \( -name "swc*.gc*" -o -name 'ast_node*.gc*' -o -name 'enum_kind*.gc*' -o -name 'string-enum*.gc*' -o -name 'from_variant*.gc*' \) -print`;
zip -0 ccov.zip `find $CARGO_TARGET_DIR \( -name "swc*.gc*" -o -name 'spack*.gc*' -o -name 'ast_node*.gc*' -o -name 'enum_kind*.gc*' -o -name 'string-enum*.gc*' -o -name 'from_variant*.gc*' \) -print`;
grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore "/*" -o lcov.info;