diff --git a/typescript-client/build.jsr.sh b/typescript-client/build.jsr.sh new file mode 100755 index 0000000000..a3ee691b60 --- /dev/null +++ b/typescript-client/build.jsr.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -eou pipefail +script_dirpath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +rm -rf "${script_dirpath}/dist" + +npx --yes @hey-api/openapi-ts --input "${script_dirpath}/../backend/windmill-api/openapi.yaml" --output "${script_dirpath}/dist" --useOptions --schemas false + +# Add explicit type as it's missing in the client source code. This will be unnecessary in newer openapi-ts versions +sed -i 's/get \[Symbol\.toStringTag\]() {/get \[Symbol\.toStringTag\]() : string {/g' "${script_dirpath}/dist/core/CancelablePromise.ts" + diff --git a/typescript-client/jsr.json b/typescript-client/jsr.json new file mode 100644 index 0000000000..f6f5aa27fd --- /dev/null +++ b/typescript-client/jsr.json @@ -0,0 +1,8 @@ +{ + "name": "@windmill-labs/windmill", + "version": "1.317.1", + "exports": "./dist/index.ts", + "publish": { + "exclude": ["!dist"] + } +} diff --git a/typescript-client/publish.jsr.sh b/typescript-client/publish.jsr.sh new file mode 100755 index 0000000000..2f4aabc2d8 --- /dev/null +++ b/typescript-client/publish.jsr.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -eou pipefail +script_dirpath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +args=${1:-} + +npx jsr publish ${args}