Skip to content

Commit dd0bf9c

Browse files
committed
feat: add export_bindings module for TypeScript bindings generation
Introduced a new module, export_bindings, to facilitate the generation of TypeScript bindings from Rust types. This includes the creation of Cargo.toml and Cargo.lock files for the module, as well as a library and binary for executing the export functionality. Updated the main project to include export_bindings as a dependency, enhancing the integration of TypeScript support in the project.
1 parent 623dbe8 commit dd0bf9c

File tree

8 files changed

+1746
-10
lines changed

8 files changed

+1746
-10
lines changed

export_bindings/Cargo.lock

Lines changed: 1720 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

export_bindings/Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[package]
2+
name = "export_bindings"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
codex-protocol = { git = "https://github.com/openai/codex.git", package = "codex-protocol" }
8+
codex-app-server-protocol = { git = "https://github.com/openai/codex.git", package = "codex-app-server-protocol" }
9+
ts-rs = "11.0"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
fn main() {
2-
codexia_lib::export_ts_bindings();
2+
export_bindings::export_ts_types();
33
println!("Exported TypeScript bindings to src/bindings");
44
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ use codex_app_server_protocol::{
22
AddConversationListenerParams, AddConversationSubscriptionResponse, AuthMode, ClientInfo,
33
ConversationSummary, ExecCommandApprovalParams, InitializeParams, InitializeResponse,
44
InputItem, InterruptConversationParams, InterruptConversationResponse, ListConversationsResponse,
5-
NewConversationParams, NewConversationResponse, SendUserMessageParams, SendUserMessageResponse,
6-
ResumeConversationParams, ResumeConversationResponse, RemoveConversationListenerParams,
7-
TurnStartParams, TurnStartResponse,
5+
NewConversationParams, NewConversationResponse, ResumeConversationParams, ResumeConversationResponse,
6+
RemoveConversationListenerParams, SendUserMessageParams, SendUserMessageResponse, TurnStartParams,
7+
TurnStartResponse,
88
};
9-
use codex_protocol::protocol::{EventMsg};
9+
use codex_protocol::protocol::EventMsg;
1010
use std::path::Path;
1111
use ts_rs::TS;
1212

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"build": "tsc && vite build",
99
"preview": "vite preview",
1010
"tauri": "tauri",
11-
"export:bindings": "cargo run --manifest-path src-tauri/Cargo.toml --bin export_bindings"
11+
"export:bindings": "cargo run --manifest-path export_bindings/Cargo.toml --bin export_bindings"
1212
},
1313
"dependencies": {
1414
"@radix-ui/react-accordion": "^1.2.12",

src-tauri/Cargo.lock

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ version = "0.11.0"
44
description = "A powerful IDE/GUI and Toolkit for Codex CLI"
55
authors = ["milisp"]
66
edition = "2021"
7-
default-run = "codexia"
87

98
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
109

@@ -24,7 +23,6 @@ tauri-plugin-shell = "2"
2423
tauri-plugin-dialog = "2"
2524
serde = { version = "1", features = ["derive"] }
2625
serde_json = "1"
27-
ts-rs = "11.0"
2826
tokio = { version = "1", features = ["full"] }
2927
uuid = { version = "1.0", features = ["v4"] }
3028
anyhow = "1.0"
@@ -47,6 +45,7 @@ notify = "6"
4745
tauri-remote-ui = { git = "https://github.com/DraviaVemal/tauri-remote-ui" }
4846
codex-protocol = { git = "https://github.com/openai/codex.git", package = "codex-protocol" }
4947
codex-app-server-protocol = { git = "https://github.com/openai/codex.git", package = "codex-app-server-protocol"}
48+
export_bindings = { path = "../export_bindings" }
5049
base64 = "0.22.1"
5150
nosleep = "0.2.1"
5251
regex = "1.12.2"

src-tauri/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ mod cmd;
22
mod codex;
33
mod commands;
44
pub mod config;
5-
mod export_bindings;
65
mod filesystem;
76
mod mcp;
87
mod services;

0 commit comments

Comments
 (0)