Skip to content

Commit

Permalink
test js pdk v1.3.3 (#14)
Browse files Browse the repository at this point in the history
* test js pdk v1.3.3

* install v1.3.3 in release pipeline too

* fix build
  • Loading branch information
mhmd-azeez authored Jan 21, 2025
1 parent 2ac46e8 commit 04a6ded
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- name: Setup Extism
run: |
curl https://raw.githubusercontent.com/extism/js-pdk/main/install.sh | bash
curl -L https://raw.githubusercontent.com/extism/js-pdk/main/install.sh | bash -s v1.3.3
- name: Set up Node.js
uses: actions/setup-node@v2
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- name: Setup Extism and XTP
run: |
curl https://raw.githubusercontent.com/extism/js-pdk/main/install.sh | bash
curl -L https://raw.githubusercontent.com/extism/js-pdk/main/install.sh | bash -s v1.3.3
curl https://static.dylibso.com/cli/install.sh | bash
- name: Set up Node.js
Expand Down Expand Up @@ -47,6 +47,8 @@ jobs:
- name: Run Bindgen Test
run: |
extism-js --version
sh bindgen-test.sh install
sh bindgen-test.sh run
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"typescript": "^5.3.2"
},
"dependencies": {
"@dylibso/xtp-bindgen": "1.0.0-rc.8",
"@dylibso/xtp-bindgen": "1.0.0-rc.16",
"ejs": "^3.1.10"
}
}
5 changes: 1 addition & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@ function addStdImport(schema: XtpSchema) {
// in the generated `main.zig` this would include a reference to
// std.json.ArrayHashMap and std.json.Value, so we import "std".
const exportHasJsonObject = schema.exports.some((f) => {
return (f.input?.contentType === "application/json" &&
f.input.type === "object") ||
(f.output?.contentType === "application/json" &&
f.output.type === "object");
return (helpers.isJsonEncoded(f.input!)) || (helpers.isJsonEncoded(f.output!));
});

return exportHasJsonObject /* || others here */
Expand Down

0 comments on commit 04a6ded

Please sign in to comment.