Skip to content

Commit 6a05d0c

Browse files
deps: update amaro to 1.2.2
1 parent 9b5d938 commit 6a05d0c

16 files changed

Lines changed: 1631 additions & 594 deletions

‎deps/amaro/README.md‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
11
# Amaro
22

3-
Amaro is a wrapper around `@swc/wasm-typescript`, a WebAssembly port of the SWC TypeScript parser.
3+
Amaro is a Node.js wrapper around the [SWC](https://swc.rs) TypeScript parser and type stripper. Its Rust core in `crates/amaro` depends on the published SWC crates and is compiled to WebAssembly.
44
It's used as an internal in Node.js for [Type Stripping](https://nodejs.org/api/typescript.html#type-stripping) but can also be used as a standalone package.
55

66
> Amaro means "bitter" in Italian. It's a reference to [Mount Amaro](https://en.wikipedia.org/wiki/Monte_Amaro_(Abruzzo)) on whose slopes this package was conceived.
77
88
This package provides a stable API for the TypeScript parser and allows users to upgrade to the latest version of TypeScript transpiler independently from the one used internally in Node.js.
99

10+
## Building from source
11+
12+
The WebAssembly module is not checked in. Building it requires Docker, which
13+
runs the Rust build inside the [Node.js wasm-builder](https://github.com/nodejs/wasm-builder)
14+
container:
15+
16+
```bash
17+
npm run build:wasm
18+
npm run build
19+
npm test
20+
```
21+
22+
Releases build the module in CI before publishing.
23+
1024
## How to Install
1125

1226
To install Amaro, run:

‎deps/amaro/dist/LICENSE‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,4 @@ Unless required by applicable law or agreed to in writing, software
198198
distributed under the License is distributed on an "AS IS" BASIS,
199199
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200200
See the License for the specific language governing permissions and
201-
limitations under the License.
201+
limitations under the License.

‎deps/amaro/dist/errors.js‎

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,31 @@
11
"use strict";
2-
export function isSwcError(error) {
2+
var __defProp = Object.defineProperty;
3+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4+
var __getOwnPropNames = Object.getOwnPropertyNames;
5+
var __hasOwnProp = Object.prototype.hasOwnProperty;
6+
var __export = (target, all) => {
7+
for (var name in all)
8+
__defProp(target, name, { get: all[name], enumerable: true });
9+
};
10+
var __copyProps = (to, from, except, desc) => {
11+
if (from && typeof from === "object" || typeof from === "function") {
12+
for (let key of __getOwnPropNames(from))
13+
if (!__hasOwnProp.call(to, key) && key !== except)
14+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15+
}
16+
return to;
17+
};
18+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19+
var errors_exports = {};
20+
__export(errors_exports, {
21+
isSwcError: () => isSwcError,
22+
wrapAndReThrowSwcError: () => wrapAndReThrowSwcError
23+
});
24+
module.exports = __toCommonJS(errors_exports);
25+
function isSwcError(error) {
326
return error.code !== void 0;
427
}
5-
export function wrapAndReThrowSwcError(error) {
28+
function wrapAndReThrowSwcError(error) {
629
const errorHints = `${error.filename}:${error.startLine}
730
${error.snippet}
831
`;
@@ -22,3 +45,8 @@ ${error.snippet}
2245
throw new Error(error.message);
2346
}
2447
}
48+
// Annotate the CommonJS export names for ESM import in node:
49+
0 && (module.exports = {
50+
isSwcError,
51+
wrapAndReThrowSwcError
52+
});

‎deps/amaro/dist/index.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { transformSync } from "./transform.ts";
1+
export { transformSync } from "./internal.js";

0 commit comments

Comments
 (0)