Skip to content

feat(runtime-core): Export runtime-core helper functions#339

Merged
tkislan merged 2 commits intomainfrom
tk/export-runtime-core-helper-functions
Mar 10, 2026
Merged

feat(runtime-core): Export runtime-core helper functions#339
tkislan merged 2 commits intomainfrom
tk/export-runtime-core-helper-functions

Conversation

@tkislan
Copy link
Contributor

@tkislan tkislan commented Mar 9, 2026

Summary by CodeRabbit

  • New Features

    • Expanded public API with three new utility functions: WebSocket factory creation, server port discovery, and server readiness verification.
  • Tests

    • Added comprehensive test coverage for JavaScript-to-Python value conversion, including null/undefined, booleans, numbers, strings, arrays, objects, and error handling for unsupported types.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 009bccd8-1065-453e-b107-6dc9db241b53

📥 Commits

Reviewing files that changed from the base of the PR and between 5ca1fcc and b71d40c.

📒 Files selected for processing (6)
  • packages/runtime-core/src/execution-engine.ts
  • packages/runtime-core/src/index.ts
  • packages/runtime-core/src/javascript.test.ts
  • packages/runtime-core/src/javascript.ts
  • packages/runtime-core/src/kernel-client.ts
  • packages/runtime-core/src/server-starter.ts

📝 Walkthrough

Walkthrough

This pull request expands the public API surface of the runtime-core package by exporting three utility functions: createJsonWebSocketFactory, findConsecutiveAvailablePorts, and waitForServer. Concurrently, a new toPythonLiteral utility function is introduced to convert JavaScript values to Python literal syntax, with the execution-engine refactored to depend on this shared utility rather than maintaining its own implementation. The new functionality is covered by a comprehensive test suite.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Updates Docs ⚠️ Warning PR exports three new public API functions but includes no documentation updates for these additions. Add documentation for createJsonWebSocketFactory, findConsecutiveAvailablePorts, and waitForServer to relevant docs files.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: exporting previously internal helper functions from runtime-core for external use.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.49%. Comparing base (5ca1fcc) to head (b71d40c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #339      +/-   ##
==========================================
+ Coverage   83.47%   83.49%   +0.02%     
==========================================
  Files         123      124       +1     
  Lines        7375     7375              
  Branches     1985     1985              
==========================================
+ Hits         6156     6158       +2     
+ Misses       1219     1217       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tkislan tkislan marked this pull request as ready for review March 9, 2026 15:00
@tkislan tkislan requested a review from a team as a code owner March 9, 2026 15:00
Copy link
Contributor

@saltenasl saltenasl left a comment

Choose a reason for hiding this comment

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

good call on extracting toPythonLiteral to a standalone file

@tkislan tkislan merged commit 6dd0d02 into main Mar 10, 2026
21 checks passed
@tkislan tkislan deleted the tk/export-runtime-core-helper-functions branch March 10, 2026 09:43
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.

2 participants