-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new: proto PDK for JavaScript & TypeScript
- Loading branch information
Showing
58 changed files
with
4,330 additions
and
2 deletions.
There are no files selected for viewing
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 @@ | ||
lib |
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,11 @@ | ||
node = "20.12.1" | ||
npm = "10.5.0" | ||
extism-js = "1.0.0-rc9" | ||
|
||
[plugins] | ||
extism-js = "source:./extism-js.toml" | ||
|
||
# TODO: add a binaryen plugin - requires a more fine grain version interpolation though | ||
|
||
# silly workaround for root .prototools potentially pointing at non-existing plugin | ||
wasm-test = "source:./extism-js.toml" |
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,26 @@ | ||
# Contributing to @moonrepo/proto-pdk | ||
|
||
## Prerequisites | ||
|
||
Everything except [binaryen](https://github.com/WebAssembly/binaryen) is currently | ||
managed via the .prototools. | ||
|
||
## Building | ||
|
||
```shell | ||
npm run build | ||
``` | ||
|
||
## Testing | ||
|
||
```shell | ||
# run tests and watch for changes | ||
npm test | ||
|
||
# run tests and exit | ||
npm test run | ||
``` | ||
|
||
## E2E tests | ||
|
||
Refer to [the test plugin](./test/README.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# @moonrepo/proto-pdk | ||
|
||
A plugin development kit for creating proto WASM plugins using JS/TS. | ||
|
||
> [!IMPORTANT] | ||
> The Extism JavaScript PDK does not currently provide filesystem APIs, hence | ||
> some functionality, such as custom checksumming, is difficult to achieve using | ||
> this PDK. | ||
> | ||
> If you need this you're better off using the [Rust PDK](../crates/pdk) for now. | ||
## Prerequisites | ||
|
||
You will need: | ||
|
||
- [binaryen >=v117](https://github.com/WebAssembly/binaryen) | ||
- [extism-js >=v1.0.0-rc9](https://github.com/extism/js-pdk) | ||
|
||
## Installation | ||
|
||
Not yet published, please check back later. | ||
|
||
<!-- | ||
```shell | ||
npm i @moonrepo/proto-pdk | ||
``` | ||
--> | ||
|
||
## Usage | ||
|
||
[The test plugin](./test) is currently the best reference for a complete TypeScript-based example, | ||
until we get the PDK properly documented. | ||
|
||
Neither TypeScript or ESBuild is a requirement. A bundler (like ESBuild) is however, and the bundled output | ||
should target at ES2020 or below, while using CommonJS as the format. | ||
|
||
It is strongly recommended to minify your bundled JavaScript, as it greatly affects the final WASM file size. |
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,24 @@ | ||
name = "extism-js" | ||
type = "cli" | ||
|
||
[resolve] | ||
git-url = "https://github.com/extism/js-pdk" | ||
|
||
[platform.linux] | ||
archs = ["x86_64", "aarch64"] | ||
download-file = "extism-js-{arch}-linux-v{version}.gz" | ||
checksum-file = "extism-js-{arch}-linux-v{version}.gz.sha256" | ||
bin-path = "extism-js-{arch}-linux-v{version}" | ||
|
||
[platform.macos] | ||
archs = ["x86_64", "aarch64"] | ||
download-file = "extism-js-{arch}-macos-v{version}.gz" | ||
checksum-file = "extism-js-{arch}-macos-v{version}.gz.sha256" | ||
bin-path = "extism-js-{arch}-macos-v{version}" | ||
|
||
[platform.windows] | ||
archs = [] | ||
|
||
[install] | ||
download-url = "https://github.com/extism/js-pdk/releases/download/v{version}/{download_file}" | ||
checksum-url = "https://github.com/extism/js-pdk/releases/download/v{version}/{checksum_file}" |
Oops, something went wrong.