diff --git a/package.json b/package.json index 8af8aa2cc..4370bf3c8 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "scripts": { "check": "bun run typecheck && bun run lint && bun run test && bun run check:structural", "check:all": "bun run check && bun run check:packages", - "typecheck": "bun run scripts/run-all.ts typecheck", + "typecheck": "bun run scripts/run-all.ts typecheck && bunx tsc -p tsconfig.json --noEmit && bunx tsc -p test/isolation/tsconfig.json --noEmit", "lint": "prettier --check --cache . && eslint --cache .", "format": "prettier --write .", "build": "bun run scripts/run-all.ts build", diff --git a/packages/hub-client/src/hub.ts b/packages/hub-client/src/hub.ts index d7016ae6d..547b6e94e 100644 --- a/packages/hub-client/src/hub.ts +++ b/packages/hub-client/src/hub.ts @@ -40,7 +40,7 @@ export function createHubAPI( response = await fetchImpl(`${baseUrl}${path}`, { method, headers, - body: body === undefined ? undefined : JSON.stringify(body), + ...(body !== undefined ? { body: JSON.stringify(body) } : {}), redirect: "manual", }); } catch (cause) { diff --git a/packages/tool-registry-publish/src/publish.ts b/packages/tool-registry-publish/src/publish.ts index a8e940fc2..a5fe6f3a3 100644 --- a/packages/tool-registry-publish/src/publish.ts +++ b/packages/tool-registry-publish/src/publish.ts @@ -208,7 +208,12 @@ async function putTarball( if (cookies.length > 0) headers["Cookie"] = cookies.join("; "); const response = await fetchImpl( `${hubUrl}/api/tenants/${tenantId}/assets/${assetId}/tarballs/${tarball.filename}`, - { method: "PUT", headers, body: tarball.bytes, redirect: "manual" }, + { + method: "PUT", + headers, + body: Uint8Array.from(tarball.bytes), + redirect: "manual", + }, ); if (response.status !== 200) { const text = await response.text(); diff --git a/scripts/checks/browser-safe-subpaths.ts b/scripts/checks/browser-safe-subpaths.ts index 95c4e557d..afce6a839 100644 --- a/scripts/checks/browser-safe-subpaths.ts +++ b/scripts/checks/browser-safe-subpaths.ts @@ -121,17 +121,23 @@ export function parseImportSpecifiers(source: string): ImportSpecifier[] { const fromPattern = /\b(import|export)\s+(type\s+)?[^;]*?\bfrom\s+["']([^"']+)["']/g; for (const match of contents.matchAll(fromPattern)) { - results.push({ specifier: match[3], typeOnly: match[2] !== undefined }); + const specifier = match[3]; + if (specifier === undefined) continue; + results.push({ specifier, typeOnly: match[2] !== undefined }); } const dynamicPattern = /\bimport\s*\(\s*["']([^"']+)["']/g; for (const match of contents.matchAll(dynamicPattern)) { - results.push({ specifier: match[1], typeOnly: false }); + const specifier = match[1]; + if (specifier === undefined) continue; + results.push({ specifier, typeOnly: false }); } const sideEffectPattern = /\bimport\s+["']([^"']+)["']\s*;/g; for (const match of contents.matchAll(sideEffectPattern)) { - results.push({ specifier: match[1], typeOnly: false }); + const specifier = match[1]; + if (specifier === undefined) continue; + results.push({ specifier, typeOnly: false }); } return results; diff --git a/scripts/e2e/browser/walkthrough.ts b/scripts/e2e/browser/walkthrough.ts index 06ea5e648..c154fd665 100644 --- a/scripts/e2e/browser/walkthrough.ts +++ b/scripts/e2e/browser/walkthrough.ts @@ -433,7 +433,9 @@ async function run(): Promise { function wireDiagnostics(target: Page): void { target.on("pageerror", (error) => - console.error(` [page error] ${error.message}`), + console.error( + ` [page error] ${error instanceof Error ? error.message : String(error)}`, + ), ); target.on("console", (msg) => { if (msg.type() === "error") @@ -595,6 +597,9 @@ async function run(): Promise { ? { ...seedArgs, baseURLOverride: ollamaBaseUrl } : seedArgs, ); + if (seeded.kind === "seeded-pending-agents") { + throw new Error(seeded.message); + } return { status: "pass", detail: `stub credential stored and every default workflow deployed: ${seeded.workflows.join(", ")}`, diff --git a/scripts/e2e/harness.ts b/scripts/e2e/harness.ts index 33ea0c1ef..3704c9ae7 100644 --- a/scripts/e2e/harness.ts +++ b/scripts/e2e/harness.ts @@ -411,7 +411,7 @@ export async function api( const res = await fetch(`${base}${route}`, { method, headers, - body: body === undefined ? undefined : JSON.stringify(body), + ...(body !== undefined ? { body: JSON.stringify(body) } : {}), redirect: "manual", }); const nextCookies = mergeCookies(cookies, res.headers.getSetCookie()); diff --git a/scripts/e2e/smoke-library.test.ts b/scripts/e2e/smoke-library.test.ts index 7f6f03923..755bf08f9 100644 --- a/scripts/e2e/smoke-library.test.ts +++ b/scripts/e2e/smoke-library.test.ts @@ -88,7 +88,10 @@ async function uploadArtifact( bytes: Uint8Array, ): Promise<{ status: number; data: unknown }> { const form = new FormData(); - form.append("file", new File([bytes], fileName, { type: "application/pdf" })); + form.append( + "file", + new File([Uint8Array.from(bytes)], fileName, { type: "application/pdf" }), + ); const res = await fetch( `${baseUrl}/api/tenants/${tenantId}/artifacts/upload`, { diff --git a/scripts/run-all.ts b/scripts/run-all.ts index 455f25e9e..19830635e 100644 --- a/scripts/run-all.ts +++ b/scripts/run-all.ts @@ -136,11 +136,12 @@ async function narrowToAffected(jobs: readonly Job[]): Promise { return narrowed; } -const script = process.argv[2]; -if (!script) { +const scriptArg = process.argv[2]; +if (!scriptArg) { console.error("usage: bun run scripts/run-all.ts "); process.exit(1); } +const script: string = scriptArg; let concurrency: number; try {