From 03b1abc840b563ab8d1656e5421fcf7be3b2b1a4 Mon Sep 17 00:00:00 2001 From: wendrul <53628737+wendrul@users.noreply.github.com> Date: Thu, 25 Apr 2024 17:58:42 +0200 Subject: [PATCH] Add publish to jsr scripts (#3614) * Add publish to jsr scripts * Remove tsc logic for jsr build and publish --- typescript-client/build.jsr.sh | 11 +++++++++++ typescript-client/jsr.json | 8 ++++++++ typescript-client/publish.jsr.sh | 7 +++++++ 3 files changed, 26 insertions(+) create mode 100755 typescript-client/build.jsr.sh create mode 100644 typescript-client/jsr.json create mode 100755 typescript-client/publish.jsr.sh 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}