diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml index e71df428..dbc7749d 100644 --- a/.github/workflows/release-plz.yml +++ b/.github/workflows/release-plz.yml @@ -62,11 +62,19 @@ jobs: fi # Update the version of lumina-node-wasm dependency npm pkg set "dependencies[lumina-node-wasm]=$node_wasm_version" + # Update the types definition for lumina-node + npm i + npm run tsc + + wasm-pack build .. + npm run update-readme # push a commit to release-plz's pr # prepare graphql query branch_sha="$(git rev-parse "$pr_branch_name")" package_json="$(base64 --wrap 0 package.json)" + readme="$(base64 --wrap 0 README.md)" + types_definitions="$(base64 --wrap 0 index.d.ts)" query='{"query": "mutation { createCommitOnBranch(input: { branch: { @@ -78,10 +86,20 @@ jobs: }, expectedHeadOid: \"'"$branch_sha"'\", fileChanges: { - additions: [{ - path: \"node-wasm/js/package.json\", - contents: \"'"$package_json"'\" - }] + additions: [ + { + path: \"node-wasm/js/package.json\", + contents: \"'"$package_json"'\" + }, + { + path: \"node-wasm/js/README.md\", + contents: \"'"$readme"'\" + }, + { + path: \"node-wasm/js/index.d.ts\", + contents: \"'"$types_definitions"'\" + } + ] } }) { commit { commitUrl } } diff --git a/node-wasm/js/index.d.ts b/node-wasm/js/index.d.ts index e340079a..015e261e 100644 --- a/node-wasm/js/index.d.ts +++ b/node-wasm/js/index.d.ts @@ -3,3 +3,4 @@ */ export function spawnNode(): Promise; export * from "lumina-node-wasm"; +import { NodeClient } from "lumina-node-wasm"; diff --git a/node-wasm/js/package.json b/node-wasm/js/package.json index 6268e746..298a8dd4 100644 --- a/node-wasm/js/package.json +++ b/node-wasm/js/package.json @@ -31,9 +31,11 @@ "devDependencies": { "concat-md": "^0.5.1", "typedoc": "^0.26.7", - "typedoc-plugin-markdown": "^4.2.9" + "typedoc-plugin-markdown": "^4.2.9", + "typescript": "^5.6.2" }, "scripts": { + "tsc": "tsc index.js --declaration --allowJs --emitDeclarationOnly", "update-readme": "typedoc --plugin typedoc-plugin-markdown --out ./docs --readme ../README.md ../pkg/lumina_node_wasm.d.ts && concat-md --decrease-title-levels --dir-name-as-title docs > README.md" } }