Skip to content

feat: compile CI to a binary with bun #3101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Conversation

cabljac
Copy link
Contributor

@cabljac cabljac commented Jun 18, 2025

This is a draft PR to:

  • make the cli compatible with bun
  • add CI to compile genkit-tools cli to binary targets using bun
  • push those binaries somewhere (to be decided)

Checklist (if applicable):

@cabljac cabljac changed the title @invertase/cli binary feat: compile CI to a binary with bun Jun 18, 2025
@cabljac cabljac requested a review from Copilot June 18, 2025 13:44
Copilot

This comment was marked as outdated.

@@ -15,22 +15,14 @@
*/
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will move this out to ../commands, just here for now while in draft.

@@ -63,61 +64,61 @@
},
"author": "genkit",
"license": "Apache-2.0",
"types": "./lib/types/types/index.d.ts",
"types": "./lib/types/src/types/index.d.ts",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is required as the package.json is included in the build now, which lives above src

@cabljac cabljac force-pushed the @invertase/cli-binary branch 3 times, most recently from e72b3b3 to a22d785 Compare June 18, 2025 14:16
@cabljac cabljac force-pushed the @invertase/cli-binary branch 2 times, most recently from 036207a to b2afcc7 Compare June 18, 2025 15:43
@cabljac cabljac force-pushed the @invertase/cli-binary branch from b2afcc7 to 9e8229c Compare June 18, 2025 15:49
@cabljac cabljac requested a review from Copilot June 20, 2025 11:34
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This draft PR introduces changes to enable compiling the CLI into binaries using Bun and integrates a new CI workflow to build and test these binaries on multiple platforms. Key changes include:

  • Updates to tsconfig and package.json files to support Bun-specific compiler options and type definitions.
  • Refactoring of error handling utilities and removal of legacy argument parsing in favor of Commander commands.
  • Addition of a new GitHub Actions workflow for building and testing CLI binaries.

Reviewed Changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
genkit-tools/common/tsconfig.json Added "resolveJsonModule" and a trailing comma for proper JSON configuration.
genkit-tools/common/src/utils/utils.ts Refactored error handling to use the new isConnectionRefusedError helper.
genkit-tools/common/src/utils/package.ts Simplified package import by using direct JSON import instead of file system reads.
genkit-tools/common/src/utils/errors.ts Added utility functions to normalize error handling across Node.js and Bun environments.
genkit-tools/common/package.json Updated types paths in exports and added "bun-types" as a dependency.
genkit-tools/cli/tsconfig.json Included "bun-types" and enabled "resolveJsonModule" for improved module resolution.
genkit-tools/cli/src/utils/server-harness.ts Replaced legacy argument parsing with a Commander command for starting the server and redirecting output.
genkit-tools/cli/src/commands/ui-start.ts Updated to spawn the process using process.execPath along with the new CLI command interface.
genkit-tools/cli/src/cli.ts Integrated the new uiStartServer command based on process arguments.
genkit-tools/cli/package.json Introduced a new "compile:bun" script and updated Bun-related dependencies.
.github/workflows/build-cli-binaries.yml Added a CI workflow to compile CLI binaries across various OS and architecture targets using Bun.
Files not reviewed (1)
  • genkit-tools/pnpm-lock.yaml: Language not supported

@cabljac cabljac force-pushed the @invertase/cli-binary branch from 648d085 to 8394ced Compare June 20, 2025 11:55
@cabljac cabljac marked this pull request as ready for review June 23, 2025 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant