amaro 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 Marco Ippolito
3
+ Copyright (c) Marco Ippolito and Amaro contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -11,9 +11,43 @@ The main goal of this package is to provide a stable API for TypeScript parser,
11
11
  To install Amaro, run:
12
12
 
13
13
  ```shell
14
- npm install -g amaro
14
+ npm install amaro
15
15
  ```
16
16
 
17
+ ## How to Use
18
+
19
+ By default Amaro exports a `transformSync` function that performs type stripping.
20
+ Stack traces are preserved, by replacing removed types with white spaces.
21
+
22
+ ```javascript
23
+ const amaro = require('amaro');
24
+ const { code } = amaro.transformSync("const foo: string = 'bar';");
25
+ console.log(code); // "const foo = 'bar';"
26
+ ```
27
+
28
+ ### How to update SWC
29
+
30
+ To update the SWC version, run:
31
+
32
+ ```shell
33
+ ./tools/update-swc.sh
34
+ git add deps
35
+ git commit -m "chore: update swc to vX.Y.Z"
36
+ ```
37
+
38
+ Once you have updated the rust source code we must build the wasm.
39
+ To build the wasm it is necessary to have Docker installed.
40
+
41
+ ```shell
42
+ node ./tools/build-wasm.js
43
+ git add lib
44
+ git commit -m "chore: build wasm from swc vX.Y.Z"
45
+ ```
46
+
47
+ ### TypeScript Version
48
+
49
+ The supported TypeScript version is 5.5.4.
50
+
17
51
  ## License (MIT)
18
52
 
19
53
  See [`LICENSE.md`](./LICENSE.md).