From ede4e7781d94d860b9d2f32777312f1a3f24fc3e Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Tue, 11 Aug 2026 09:24:47 +0200 Subject: [PATCH] unbreak the JSR publish of the typescript client (#10627) * fix(sdk): unbreak the JSR publish of the typescript client `Sql` is `export type Sql = string`, but build.jsr.sh re-exported it as a value, so `deno publish` fails type-checking with TS1205 under isolatedModules. Every `v*` tag since has published nothing to JSR. The npm build never noticed because it lists the same symbol as `type Sql`; the two scripts keep separate copies of the export list. Record both JSR-only constraints next to the list, since neither shows up until a release tag runs publish.jsr.sh. Co-Authored-By: Claude Opus 5 (1M context) * fix(sdk): scope the slow-types note to what deno actually rejects Deno's fast check only rejects a return type it cannot trivially infer; setClient, appendToResultStream and streamResult are all exported without one and publish fine. The previous wording read as if the current list were already non-compliant. Co-Authored-By: Claude Opus 5 (1M context) --------- Co-authored-by: Claude Opus 5 (1M context) --- typescript-client/build.jsr.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/typescript-client/build.jsr.sh b/typescript-client/build.jsr.sh index 91a01aafb6..08c06f586f 100755 --- a/typescript-client/build.jsr.sh +++ b/typescript-client/build.jsr.sh @@ -13,9 +13,15 @@ cp "${script_dirpath}/client.ts" "${script_dirpath}/src/" cp "${script_dirpath}/wacError.ts" "${script_dirpath}/src/" cp "${script_dirpath}/s3Types.ts" "${script_dirpath}/src/" cp "${script_dirpath}/sqlUtils.ts" "${script_dirpath}/src/" +# Two JSR-only rules, enforced by `jsr publish` (which publish.jsr.sh runs +# without --allow-slow-types) and so not reachable before a release tag: +# a type must be re-exported as `type X`, or deno fails with TS1205 under +# isolatedModules; and an exported function whose return type deno cannot +# trivially infer needs an explicit annotation, or it is a "slow type". +# `./build.jsr.sh && deno publish --dry-run` checks both. echo "" >> "${script_dirpath}/src/index.ts" echo 'export type { 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, setProgress, getProgress, getState, getIdToken, denoS3LightClientSettings, cancelJob, loadS3FileStream, loadS3File, writeS3File, deleteS3File, signS3Objects, signS3Object, getPresignedS3PublicUrls, getPresignedS3PublicUrl, task, runScript, runScriptAsync, runScriptByPath, runScriptByHash, runScriptByPathAsync, runScriptByHashAsync, runFlow, runFlowAsync, waitJob, getRootJobId, setFlowUserState, getFlowUserState, usernameToEmail, requestInteractiveSlackApproval, Sql, requestInteractiveTeamsApproval, appendToResultStream, streamResult, datatable, ducklake, upsertPartition, appendPartition, type DucklakeMaterializeOptions, type SqlStatement, type DatatableSqlTemplateFunction, type SqlTemplateFunction, type S3Object, type S3ObjectRecord, type S3ObjectURI } from "./client";' >> "${script_dirpath}/src/index.ts" +echo 'export { type Base64, setClient, getVariable, setVariable, getResource, setResource, getResumeUrls, setState, setProgress, getProgress, getState, getIdToken, denoS3LightClientSettings, cancelJob, loadS3FileStream, loadS3File, writeS3File, deleteS3File, signS3Objects, signS3Object, getPresignedS3PublicUrls, getPresignedS3PublicUrl, task, runScript, runScriptAsync, runScriptByPath, runScriptByHash, runScriptByPathAsync, runScriptByHashAsync, runFlow, runFlowAsync, waitJob, getRootJobId, setFlowUserState, getFlowUserState, usernameToEmail, requestInteractiveSlackApproval, type Sql, requestInteractiveTeamsApproval, appendToResultStream, streamResult, datatable, ducklake, upsertPartition, appendPartition, type DucklakeMaterializeOptions, type SqlStatement, type DatatableSqlTemplateFunction, type SqlTemplateFunction, type S3Object, type S3ObjectRecord, type S3ObjectURI } from "./client";' >> "${script_dirpath}/src/index.ts"