Commit graph

13 commits

Author SHA1 Message Date
Boshen
4d0b40ad10
fix(napi/transform): fix wrong isolated declarations emit 2024-08-08 14:36:41 +08:00
DonIsaac
9b51e045c7 refactor: overhaul napi transformer package (#4592)
## What This PR Does
- Support declaration emit with `transform()`
- Consolidate shared parsing and error reporting logic into a `TransformContext`
- Add JSDoc comments to options

I'm getting this package ready for consumption in [oxc-jest](https://github.com/oxc-project/oxc-jest).
2024-08-06 01:14:10 +00:00
Boshen
725571aad1 feat(napi/transformer): add jsx option to force parsing with jsx (#4133)
To mimic the esbuild `loader=jsx` or babel `babel-plugin-syntax-jsx` behavior.
2024-07-10 11:12:10 +00:00
Boshen
720983a965
feat(napi/transform): allow setting sourceType to transform (#4113)
closes #4071

Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2024-07-08 19:09:45 +08:00
Boshen
150f4d90fc
fix(napi/transform): display error with spanned messages 2024-07-05 23:41:39 +08:00
underfin
0b56d50899
chore(napi): make transformer options optional (#3989) 2024-07-01 16:45:00 +08:00
Boshen
5845057bff refactor(transformer): pass in symbols and scopes (#3978)
This PR adds a new method `build_with_symbols_and_scopes` to make semantic building optional, there may be prior steps that has the semantic data already built.
2024-06-30 06:33:48 +00:00
underfin
d3cd3ea2de
feat: oxc transform binding (#3896)
closes #3877

---------

Co-authored-by: Boshen <boshenc@gmail.com>
2024-06-26 21:57:19 +08:00
Boshen
05e97b615d
chore: fix clippy warning 2024-06-20 23:22:01 +08:00
Boshen
fe38a20715
refactor(napi/transform): output normal error messages 2024-06-20 23:14:17 +08:00
Boshen
051ceb6539
chore: improve some format by running cargo +nightly fmt 2024-06-19 00:48:30 +08:00
Boshen
5c38a0fd69 feat(codegen)!: new code gen API (#3740)
This PR introduces two type alias to avoid the confusing const generic `pub struct Codegen<'a, const MINIFY: bool>`

* CodeGenerator - Code generator without whitespace removal.
* WhitespaceRemover - Code generator with whitespace removal.

Usage is changed to a builder pattern:

```rust
CodeGenerator::new()
  .enable_comment(...)
  .enable_sourcemap(...)
  .build(&program);
```
2024-06-18 15:50:12 +00:00
Boshen
f42c325a06 refactor(napi): change "isolated declarations" to "transform" (#3721) 2024-06-17 14:09:18 +00:00