From 39b623ca891a12e7d082f280da87a63b7c01ca7f Mon Sep 17 00:00:00 2001 From: wendrul Date: Thu, 25 Apr 2024 17:51:38 +0200 Subject: [PATCH] Remove tsc logic for jsr build and publish --- typescript-client/build.jsr.sh | 12 +++--------- typescript-client/jsr.json | 6 +++--- typescript-client/publish.jsr.sh | 9 --------- 3 files changed, 6 insertions(+), 21 deletions(-) diff --git a/typescript-client/build.jsr.sh b/typescript-client/build.jsr.sh index e9c0bd9829..a3ee691b60 100755 --- a/typescript-client/build.jsr.sh +++ b/typescript-client/build.jsr.sh @@ -2,16 +2,10 @@ set -eou pipefail script_dirpath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -rm -rf "${script_dirpath}/src" +rm -rf "${script_dirpath}/dist" -npx --yes @hey-api/openapi-ts --input "${script_dirpath}/../backend/windmill-api/openapi.yaml" --output "${script_dirpath}/src" --useOptions --schemas false +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}/src/core/CancelablePromise.ts" +sed -i 's/get \[Symbol\.toStringTag\]() {/get \[Symbol\.toStringTag\]() : string {/g' "${script_dirpath}/dist/core/CancelablePromise.ts" -cp "${script_dirpath}/client.ts" "${script_dirpath}/src/" -cp "${script_dirpath}/s3Types.ts" "${script_dirpath}/src/" -echo "" >> "${script_dirpath}/src/index.ts" -echo 'export type { S3Object, DenoS3LightClientSettings } from "./s3Types";' >> "${script_dirpath}/src/index.ts" -echo "" >> "${script_dirpath}/src/index.ts" -echo 'export { type Base64, setClient, getVariable, setVariable, getResource, setResource, getResumeUrls, setState, getState, getIdToken, denoS3LightClientSettings, loadS3FileStream, loadS3File, writeS3File, task, runScript, runScriptAsync, waitJob, getRootJobId, setFlowUserState, getFlowUserState } from "./client";' >> "${script_dirpath}/src/index.ts" diff --git a/typescript-client/jsr.json b/typescript-client/jsr.json index 4fd78d4b34..f6f5aa27fd 100644 --- a/typescript-client/jsr.json +++ b/typescript-client/jsr.json @@ -1,8 +1,8 @@ { "name": "@windmill-labs/windmill", - "version": "1.0.0", - "exports": "./src/index.ts", + "version": "1.317.1", + "exports": "./dist/index.ts", "publish": { - "exclude": ["!src"] + "exclude": ["!dist"] } } diff --git a/typescript-client/publish.jsr.sh b/typescript-client/publish.jsr.sh index 8b71e8adf7..2f4aabc2d8 100755 --- a/typescript-client/publish.jsr.sh +++ b/typescript-client/publish.jsr.sh @@ -4,13 +4,4 @@ script_dirpath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" args=${1:-} -rm -rf "${script_dirpath}/dist" - -${script_dirpath}/build.jsr.sh -rm "${script_dirpath}/client.ts" -rm "${script_dirpath}/s3Types.ts" -npm install -tsc -cp "${script_dirpath}/src/client.ts" ${script_dirpath} -cp "${script_dirpath}/src/s3Types.ts" ${script_dirpath} npx jsr publish ${args}