Skip to content

test(typescript): add browser and Workers Vitest runtimes - #4062

Merged
sxlijin merged 1 commit into
canaryfrom
sam/typescript-vitest-runtimes
Jul 16, 2026
Merged

sxlijin merged 1 commit into
canaryfrom
sam/typescript-vitest-runtimes

Conversation

@sxlijin

@sxlijin sxlijin commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add sdk_test_typescript_web for browser and Cloudflare Workers test generation
  • run Web/Workers ESM and TypeScript validation against the scaffold bridge
  • copy one shared test source tree into every runtime and select runtime-specific suites inline through BAML_TEST_RUNTIME
  • remove the .node.test.ts/.web.test.ts/.workers.test.ts routing convention
  • import the generated SDK in the runtime-selection test
  • generate vitest_web and vitest_workers tests but keep them ignored until feat(typescript-web): implement browser and Workers runtimes #4006

Stack

#4052 is merged. This PR adds the mergeable test scaffolding on canary; #4006 supplies the runtime implementation and removes only the two Vitest ignore annotations.

Validation

  • cargo nextest run -p sdk_test_typescript_web -E all() --no-fail-fast: 18 passed, 8 skipped
  • all Web/Workers ESM and TypeScript checks pass
  • exactly the Web/Workers Vitest checks are skipped
  • mise run fmt, mise run stow, and mise run clippy pass
  • cumulative feat(typescript-web): implement browser and Workers runtimes #4006: 26 passed, 0 skipped

Summary by CodeRabbit

  • New Features

    • Added TypeScript SDK test coverage for browser and Cloudflare Workers runtimes.
    • Added runtime-aware testing for Node, Web, and Workers environments.
    • Expanded validation for cancellation, standard-library functions, media, and handle-based values.
  • Bug Fixes

    • Improved WebAssembly tooling installation reliability across supported build and test workflows.
  • Documentation

    • Updated SDK testing documentation with the new runtime targets, commands, and setup guidance.

@vercel

vercel Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
beps Ready Ready Preview, Comment Jul 16, 2026 9:57pm
promptfiddle Ready Ready Preview, Comment Jul 16, 2026 9:57pm
promptfiddle2 Ready Ready Preview, Comment Jul 16, 2026 9:57pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR separates Node and Web/Workers TypeScript SDK test generation, adds a dedicated web test crate and runtime selection, updates related tests and documentation, and changes wasm-pack installation from the Cargo source to the GitHub source.

Changes

TypeScript SDK test infrastructure

Layer / File(s) Summary
wasm-pack source updates
.github/actions/setup-mise/action.yml, .github/workflows/*, mise.toml
wasm-pack installation references use github:rustwasm/wasm-pack instead of cargo:wasm-pack.
Web and Workers harness
baml_language/sdk_tests/crates/typescript_web/*, baml_language/sdk_tests/harness_setup/src/typescript_web.rs, baml_language/sdk_tests/harness_runner/src/lib.rs, baml_language/.config/nextest.toml
A separate harness generates Web and Workers SDK trees, configures Chromium and bridge packages, and registers the new test crate.
Node-only harness generation
baml_language/sdk_tests/harness_setup/src/typescript.rs, baml_language/sdk_tests/crates/typescript/setup.*, baml_language/sdk_tests/harness_setup/src/templates/package_node.json
The existing TypeScript harness now generates Node output and Node-specific test scaffolding only.
Runtime-aware TypeScript tests
baml_language/sdk_tests/harness_setup/src/templates/*, baml_language/sdk_tests/crates/typescript/**
Tests use BAML_TEST_RUNTIME and runtime gating while adding or retaining Node coverage for cancellation, streaming, entrypoints, handles, media, and documentation.
SDK test documentation
baml_language/sdk_tests/README.md, baml_language/sdk_tests/DEVELOPMENT.md
Documentation describes the split crates, generated layouts, runtime selection, setup behavior, and target-specific commands.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Nextest
  participant TypeScriptWebHarness
  participant GeneratedSDK
  participant Vitest
  Nextest->>TypeScriptWebHarness: prepare web test crate
  TypeScriptWebHarness->>GeneratedSDK: generate web and workers outputs
  GeneratedSDK->>Vitest: execute runtime-specific checks
Loading

Possibly related PRs

  • BoundaryML/baml#3553 — established the setup-mise installation pattern that this PR updates for wasm-pack.
  • BoundaryML/baml#4006 — overlaps with the TypeScript Web bridge and typescript_web test setup.
  • BoundaryML/baml#4051 — overlaps with the TypeScript SDK harness refactor for Node, Web, and Workers.

Poem

A rabbit hops through Node and Web,
With wasm-pack tucked in its web.
Three runtimes bloom, tests softly run,
Chromium shines beneath the sun.
Separate crates now neatly grow—
Hop, hop, ship the SDK flow!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.53% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding browser and Workers Vitest runtimes for TypeScript tests.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sam/typescript-vitest-runtimes

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

⏭️ Performance benchmarks were skipped

Perf benchmarks (CodSpeed) are opt-in on pull requests — they no longer run on every push. They always run automatically after merge to canary/main.

To run them on this PR, do any of the following, then push a commit (or re-run CI):

  • Add RUN_CODSPEED=1 to the PR description, or
  • Include run-perf or /perf in the PR title or any commit message.

@vercel
vercel Bot temporarily deployed to Preview – beps July 16, 2026 20:04 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 16, 2026 20:12 Inactive
@github-actions

github-actions Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

Binary size checks passed

✅ 7 passed

Artifact Platform File Gzip Gated on Baseline Delta Status
✅ baml-cli Linux 🔒 23.1 MB 9.8 MB file 22.8 MB +305.2 KB (+1.3%) OK
✅ packed-program Linux 🔒 16.4 MB 6.9 MB file 16.3 MB +154.0 KB (+0.9%) OK
✅ baml-cli macOS 🔒 17.8 MB 8.6 MB file 17.6 MB +252.5 KB (+1.4%) OK
✅ packed-program macOS 🔒 12.8 MB 6.0 MB file 12.6 MB +116.3 KB (+0.9%) OK
✅ baml-cli Windows 🔒 19.3 MB 8.7 MB file 19.2 MB +113.7 KB (+0.6%) OK
✅ packed-program Windows 🔒 13.7 MB 6.1 MB file 13.5 MB +134.6 KB (+1.0%) OK
✅ bridge_wasm WASM 15.3 MB 🔒 4.3 MB gzip 4.3 MB +25.5 KB (+0.6%) OK

🔒 = the size this artifact is GATED on (ceiling + delta). Binaries gate on file size (installed binary); WASM gates on gzip (download size). The other size is shown for information only.


Generated by cargo size-gate · workflow run

Base automatically changed from sam/typescript-web-scaffold to canary July 16, 2026 20:23
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle July 16, 2026 20:26 Inactive
@sxlijin
sxlijin force-pushed the sam/typescript-vitest-runtimes branch from f6ad214 to f5fe46c Compare July 16, 2026 20:42
@vercel
vercel Bot temporarily deployed to Preview – beps July 16, 2026 20:43 Inactive
@sxlijin
sxlijin force-pushed the sam/typescript-vitest-runtimes branch from f5fe46c to d4c4543 Compare July 16, 2026 20:48
@vercel
vercel Bot temporarily deployed to Preview – beps July 16, 2026 20:49 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 16, 2026 20:56 Inactive
@sxlijin
sxlijin force-pushed the sam/typescript-vitest-runtimes branch from d4c4543 to 1b59380 Compare July 16, 2026 20:57
@vercel
vercel Bot temporarily deployed to Preview – beps July 16, 2026 20:58 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 16, 2026 21:05 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle July 16, 2026 21:22 Inactive
@sxlijin
sxlijin force-pushed the sam/typescript-vitest-runtimes branch from 1b59380 to 16f7ba2 Compare July 16, 2026 21:35
@vercel
vercel Bot temporarily deployed to Preview – beps July 16, 2026 21:36 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 16, 2026 21:43 Inactive
@sxlijin
sxlijin marked this pull request as ready for review July 16, 2026 21:43

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 16f7ba2a3f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

buffer.push_str(
r#"
#[test]
#[ignore = "typescript/web runtime lands in the Web implementation change"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Enable generated Web/Workers Vitest tests

When a fixture has browser tests, this emits #[ignore] on vitest_web (and the same pattern is used for vitest_workers just below), so the CI step that runs cargo nextest run -p sdk_test_typescript_web -E 'package(=sdk_test_typescript_web)' will skip the new browser/Workers Vitest commands entirely unless --run-ignored is added. That leaves only the ESM/tsc checks running and defeats the runtime coverage added by this crate; remove these ignores or explicitly run ignored tests.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@baml_language/sdk_tests/DEVELOPMENT.md`:
- Around line 119-120: Update the setup-guard section in DEVELOPMENT.md to
include SDK_TEST_TYPESCRIPT_WEB_SETUP=1 and reference
harness_setup/src/typescript_web.rs, alongside the existing Python and Node
setup entries, so the Web TypeScript harness contract is documented.

In `@baml_language/sdk_tests/harness_setup/src/templates/test_runtime.ts`:
- Around line 9-10: Update the configuredRuntime initialization to guard access
to process before reading process.env, while preserving the
import.meta.env.BAML_TEST_RUNTIME value and fallback behavior. Ensure
environments without a global process do not throw a ReferenceError.

In `@baml_language/sdk_tests/harness_setup/src/typescript.rs`:
- Around line 79-89: Update the harness setup flow around write_codegen_output
so it creates the baml_sdk directory itself and reports directory-creation
failures through BuildDiagnostics instead of unwrapping. Replace the
test_runtime.ts fs::write unwrap with diagnostic-aware error handling,
preserving the build’s soft-fail behavior and allowing workspace builds to
continue.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4e0aaa0f-03d7-49b3-b3b9-6dc27b41aa9c

📥 Commits

Reviewing files that changed from the base of the PR and between 8af9bbc and 16f7ba2.

⛔ Files ignored due to path filters (2)
  • baml_language/Cargo.lock is excluded by !**/*.lock
  • baml_language/sdks/typescript/bridge_typescript_web/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (45)
  • .github/actions/setup-mise/action.yml
  • .github/workflows/build2-web-sdk.reusable.yaml
  • .github/workflows/cargo-tests.reusable.yaml
  • .github/workflows/wasm-pack-tests.reusable.yaml
  • .github/workflows/webview-tests.reusable.yaml
  • baml_language/.config/nextest.toml
  • baml_language/Cargo.toml
  • baml_language/sdk_tests/DEVELOPMENT.md
  • baml_language/sdk_tests/README.md
  • baml_language/sdk_tests/crates/typescript/build.rs
  • baml_language/sdk_tests/crates/typescript/docstrings_etc/customizable/main.test.ts
  • baml_language/sdk_tests/crates/typescript/function_calls/customizable/cancellation.node.test.ts
  • baml_language/sdk_tests/crates/typescript/function_calls/customizable/cancellation.test.ts
  • baml_language/sdk_tests/crates/typescript/function_calls/customizable/runtime.node.test.ts
  • baml_language/sdk_tests/crates/typescript/function_calls/customizable/runtime.test.ts
  • baml_language/sdk_tests/crates/typescript/function_calls/customizable/stdlib_entrypoints.node.test.ts
  • baml_language/sdk_tests/crates/typescript/function_calls/customizable/stdlib_entrypoints.test.ts
  • baml_language/sdk_tests/crates/typescript/llm_functions/customizable/replay_harness.ts
  • baml_language/sdk_tests/crates/typescript/llm_functions/customizable/streaming_e2e.test.ts
  • baml_language/sdk_tests/crates/typescript/setup.ps1
  • baml_language/sdk_tests/crates/typescript/setup.sh
  • baml_language/sdk_tests/crates/typescript/src/lib.rs
  • baml_language/sdk_tests/crates/typescript/type_shapes/customizable/roundtrip_handles.node.test.ts
  • baml_language/sdk_tests/crates/typescript/type_shapes/customizable/roundtrip_handles.test.ts
  • baml_language/sdk_tests/crates/typescript/type_shapes/customizable/roundtrip_media.node.test.ts
  • baml_language/sdk_tests/crates/typescript/type_shapes/customizable/roundtrip_media.test.ts
  • baml_language/sdk_tests/crates/typescript_web/Cargo.toml
  • baml_language/sdk_tests/crates/typescript_web/build.rs
  • baml_language/sdk_tests/crates/typescript_web/setup.ps1
  • baml_language/sdk_tests/crates/typescript_web/setup.sh
  • baml_language/sdk_tests/crates/typescript_web/src/lib.rs
  • baml_language/sdk_tests/harness_runner/Cargo.toml
  • baml_language/sdk_tests/harness_runner/src/lib.rs
  • baml_language/sdk_tests/harness_setup/src/lib.rs
  • baml_language/sdk_tests/harness_setup/src/templates/package_node.json
  • baml_language/sdk_tests/harness_setup/src/templates/package_web.json
  • baml_language/sdk_tests/harness_setup/src/templates/test_runtime.ts
  • baml_language/sdk_tests/harness_setup/src/templates/tsconfig_web.json
  • baml_language/sdk_tests/harness_setup/src/templates/vitest_node.config.ts
  • baml_language/sdk_tests/harness_setup/src/templates/vitest_web.config.ts
  • baml_language/sdk_tests/harness_setup/src/templates/vitest_workers.config.ts
  • baml_language/sdk_tests/harness_setup/src/typescript.rs
  • baml_language/sdk_tests/harness_setup/src/typescript_web.rs
  • baml_language/sdks/typescript/bridge_typescript_web/package.json
  • mise.toml
💤 Files with no reviewable changes (5)
  • baml_language/sdk_tests/crates/typescript/type_shapes/customizable/roundtrip_media.node.test.ts
  • baml_language/sdk_tests/crates/typescript/function_calls/customizable/stdlib_entrypoints.node.test.ts
  • baml_language/sdk_tests/crates/typescript/type_shapes/customizable/roundtrip_handles.node.test.ts
  • baml_language/sdk_tests/crates/typescript/function_calls/customizable/cancellation.node.test.ts
  • baml_language/sdk_tests/crates/typescript/function_calls/customizable/runtime.node.test.ts

Comment on lines +119 to +120
- For Node TypeScript: `sdk_test_typescript` builds only `bridge_typescript`, installs Node-only fixture manifests, and runs `esm_node`, `tsc_node`, `vitest_node`, and `attw`.
- For Web TypeScript: `sdk_test_typescript_web` builds only `bridge_typescript_web`, copies the canonical sibling tests into local generated Web/Workers trees, installs Chromium, and runs the Web and Workers ESM and TypeScript checks. The Web and Workers Vitest checks remain ignored until the Web implementation change is applied.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Document the Web setup breadcrumb.

The setup-guard section below still lists only Python and Node. Add SDK_TEST_TYPESCRIPT_WEB_SETUP=1 and reference harness_setup/src/typescript_web.rs so the documented contract covers the newly introduced harness.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@baml_language/sdk_tests/DEVELOPMENT.md` around lines 119 - 120, Update the
setup-guard section in DEVELOPMENT.md to include SDK_TEST_TYPESCRIPT_WEB_SETUP=1
and reference harness_setup/src/typescript_web.rs, alongside the existing Python
and Node setup entries, so the Web TypeScript harness contract is documented.

Comment on lines +9 to +10
const configuredRuntime =
import.meta.env.BAML_TEST_RUNTIME ?? process.env.BAML_TEST_RUNTIME;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Safeguard process.env access to prevent ReferenceError in non-Node environments.

In standard browser or Cloudflare Workers environments, process may be undefined. If import.meta.env.BAML_TEST_RUNTIME evaluates to undefined, the fallback to process.env will throw a ReferenceError. Safely check if process is defined before accessing process.env.

🛡️ Proposed fix to safely access `process`
 const configuredRuntime =
-  import.meta.env.BAML_TEST_RUNTIME ?? process.env.BAML_TEST_RUNTIME;
+  import.meta.env.BAML_TEST_RUNTIME ?? (typeof process !== "undefined" ? process.env?.BAML_TEST_RUNTIME : undefined);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const configuredRuntime =
import.meta.env.BAML_TEST_RUNTIME ?? process.env.BAML_TEST_RUNTIME;
const configuredRuntime =
import.meta.env.BAML_TEST_RUNTIME ?? (typeof process !== "undefined" ? process.env?.BAML_TEST_RUNTIME : undefined);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@baml_language/sdk_tests/harness_setup/src/templates/test_runtime.ts` around
lines 9 - 10, Update the configuredRuntime initialization to guard access to
process before reading process.env, while preserving the
import.meta.env.BAML_TEST_RUNTIME value and fallback behavior. Ensure
environments without a global process do not throw a ReferenceError.

Comment on lines +79 to +89
fs::create_dir_all(node.join("baml_sdk")).unwrap();
let output = sdkgen_typescript::to_source_code_with_bytecode(
&loaded.pool,
&loaded.baml_bytecode,
NamingConvention::PreserveCase,
);
write_codegen_output(
generated.join("node/baml_sdk"),
node_output,
fixture,
diagnostics,
);
let web_output = sdkgen_typescript_web::to_source_code_with_bytecode(
&pool,
&baml_bytecode,
NamingConvention::PreserveCase,
);
write_codegen_output(
generated.join("web/baml_sdk"),
web_output.clone(),
fixture,
diagnostics,
);
write_codegen_output(
generated.join("workers/baml_sdk"),
web_output,
fixture,
diagnostics,
);

for runtime in TestRuntime::ALL {
if custom.exists() {
copy_customizable_for_runtime(custom, &generated.join(runtime.dir()), runtime);
}
write_codegen_output(node.join("baml_sdk"), output, fixture, diagnostics);
if custom.exists() {
copy_customizable(custom, &node);
}
rewrite_test_bridge_imports(&generated.join("web"));
rewrite_test_bridge_imports(&generated.join("workers"));
fs::write(node.join("test_runtime.ts"), TEST_RUNTIME).unwrap();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Preserve the build script’s soft-fail contract.

Directory creation and test_runtime.ts writes panic here, bypassing BuildDiagnostics and aborting workspace builds. Let write_codegen_output create the SDK directory and record the runtime-template write failure.

Proposed fix
     let node = generated.join("node");
-    fs::create_dir_all(node.join("baml_sdk")).unwrap();
     let output = sdkgen_typescript::to_source_code_with_bytecode(
         &loaded.pool,
         &loaded.baml_bytecode,
         NamingConvention::PreserveCase,
     );
     write_codegen_output(node.join("baml_sdk"), output, fixture, diagnostics);
     if custom.exists() {
         copy_customizable(custom, &node);
     }
-    fs::write(node.join("test_runtime.ts"), TEST_RUNTIME).unwrap();
+    if let Err(error) = fs::write(node.join("test_runtime.ts"), TEST_RUNTIME) {
+        diagnostics.record("test_runtime_write", fixture, error);
+    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
fs::create_dir_all(node.join("baml_sdk")).unwrap();
let output = sdkgen_typescript::to_source_code_with_bytecode(
&loaded.pool,
&loaded.baml_bytecode,
NamingConvention::PreserveCase,
);
write_codegen_output(
generated.join("node/baml_sdk"),
node_output,
fixture,
diagnostics,
);
let web_output = sdkgen_typescript_web::to_source_code_with_bytecode(
&pool,
&baml_bytecode,
NamingConvention::PreserveCase,
);
write_codegen_output(
generated.join("web/baml_sdk"),
web_output.clone(),
fixture,
diagnostics,
);
write_codegen_output(
generated.join("workers/baml_sdk"),
web_output,
fixture,
diagnostics,
);
for runtime in TestRuntime::ALL {
if custom.exists() {
copy_customizable_for_runtime(custom, &generated.join(runtime.dir()), runtime);
}
write_codegen_output(node.join("baml_sdk"), output, fixture, diagnostics);
if custom.exists() {
copy_customizable(custom, &node);
}
rewrite_test_bridge_imports(&generated.join("web"));
rewrite_test_bridge_imports(&generated.join("workers"));
fs::write(node.join("test_runtime.ts"), TEST_RUNTIME).unwrap();
let output = sdkgen_typescript::to_source_code_with_bytecode(
&loaded.pool,
&loaded.baml_bytecode,
NamingConvention::PreserveCase,
);
write_codegen_output(node.join("baml_sdk"), output, fixture, diagnostics);
if custom.exists() {
copy_customizable(custom, &node);
}
if let Err(error) = fs::write(node.join("test_runtime.ts"), TEST_RUNTIME) {
diagnostics.record("test_runtime_write", fixture, error);
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@baml_language/sdk_tests/harness_setup/src/typescript.rs` around lines 79 -
89, Update the harness setup flow around write_codegen_output so it creates the
baml_sdk directory itself and reports directory-creation failures through
BuildDiagnostics instead of unwrapping. Replace the test_runtime.ts fs::write
unwrap with diagnostic-aware error handling, preserving the build’s soft-fail
behavior and allowing workspace builds to continue.

@vercel
vercel Bot temporarily deployed to Preview – promptfiddle July 16, 2026 21:57 Inactive
Merged via the queue into canary with commit 1268171 Jul 16, 2026
62 checks passed

This branch was previously deployed

3 inactive deployments
Preview – promptfiddle — 16f7ba2a Deployed Jul 16, 2026 by vercel[bot]
Preview – promptfiddle2 — 16f7ba2a Deployed Jul 16, 2026 by vercel[bot]
Preview – beps — 16f7ba2a Deployed Jul 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant