-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0aeedc3
commit 343b71f
Showing
9 changed files
with
70 additions
and
63 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Changelog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Contributing to Amaro | ||
|
||
If you want to build Amaro yourself, you can build the project like this: | ||
|
||
1. Clone this repository. | ||
2. Run `npm install`. | ||
3. Run `npm run build`. | ||
|
||
The `dist/` directory now contains the Amaro build. | ||
You can run the tests with `npm test`. | ||
|
||
## Developer's Certificate of Origin 1.1 | ||
|
||
By making a contribution to this project, I certify that: | ||
|
||
- (a) The contribution was created in whole or in part by me and I | ||
have the right to submit it under the open source license | ||
indicated in the file; or | ||
|
||
- (b) The contribution is based upon previous work that, to the best | ||
of my knowledge, is covered under an appropriate open source | ||
license and I have the right under that license to submit that | ||
work with modifications, whether created in whole or in part | ||
by me, under the same open source license (unless I am | ||
permitted to submit under a different license), as indicated | ||
in the file; or | ||
|
||
- (c) The contribution was provided directly to me by some other | ||
person who certified (a), (b) or (c) and I have not modified | ||
it. | ||
|
||
- (d) I understand and agree that this project and the contribution | ||
are public and that a record of the contribution (including all | ||
personal information I submit with it, including my sign-off) is | ||
maintained indefinitely and may be redistributed consistent with | ||
this project or the open source license(s) involved. | ||
|
||
## Moderation Policy | ||
|
||
The [Node.js Moderation Policy] applies to this project. | ||
|
||
[Node.js Moderation Policy]: | ||
https://github.com/nodejs/admin/blob/master/Moderation-Policy.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
const { transformSync } = require("../lib/swc/wasm"); | ||
const swc = require("../lib/swc/wasm.js"); | ||
|
||
const DEFAULT_OPTIONS = { | ||
mode: "strip-only", | ||
}; | ||
|
||
// biome-ignore lint/suspicious/noExplicitAny: Swc types are not available | ||
function transform(source: string, options?: any): string { | ||
const { code } = transformSync(source, { | ||
function transformSync(source: string, options?: any): string { | ||
return swc.transformSync(source, { | ||
...DEFAULT_OPTIONS, | ||
...options, | ||
}); | ||
return code; | ||
} | ||
|
||
module.exports = { | ||
transform, | ||
transformSync, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
const { test } = require("node:test"); | ||
const assert = require("node:assert"); | ||
const { transform } = require("../dist/index.js"); | ||
const { transformSync } = require("../dist/index.js"); | ||
|
||
test("should perform type stripping", () => { | ||
assert.strictEqual(typeof transform, "function"); | ||
assert.strictEqual( | ||
transform("const foo: string = 'bar';"), | ||
"const foo = 'bar';", | ||
); | ||
assert.strictEqual(typeof transformSync, "function"); | ||
const { code } = transformSync("const foo: string = 'bar';"); | ||
assert.strictEqual(code, "const foo = 'bar';"); | ||
}); |