Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/hub-client/src/hub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
7 changes: 6 additions & 1 deletion packages/tool-registry-publish/src/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
12 changes: 9 additions & 3 deletions scripts/checks/browser-safe-subpaths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion scripts/e2e/browser/walkthrough.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,9 @@ async function run(): Promise<void> {

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")
Expand Down Expand Up @@ -595,6 +597,9 @@ async function run(): Promise<void> {
? { ...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(", ")}`,
Expand Down
2 changes: 1 addition & 1 deletion scripts/e2e/harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
5 changes: 4 additions & 1 deletion scripts/e2e/smoke-library.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
{
Expand Down
5 changes: 3 additions & 2 deletions scripts/run-all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,12 @@ async function narrowToAffected(jobs: readonly Job[]): Promise<Job[]> {
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 <script-name>");
process.exit(1);
}
const script: string = scriptArg;

let concurrency: number;
try {
Expand Down
Loading