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 +1 -1
- package/README.md +35 -1
- package/dist/index.js +152 -104
- package/package.json +5 -11
- package/dist/index.js.map +0 -1
package/LICENSE.md
CHANGED
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
|
|
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).
|