Skip to content

feat(generate): comline.toml default_framing - #27

Merged
Kinflou merged 1 commit into
mainfrom
feat/comline-toml-default-framing
Sep 2, 2026
Merged

feat(generate): comline.toml default_framing#27
Kinflou merged 1 commit into
mainfrom
feat/comline-toml-default-framing

Conversation

@Kinflou

@Kinflou Kinflou commented Sep 2, 2026

Copy link
Copy Markdown
Member

Final code PR of the default_framing chain (after generation#17, comline-rust#10, comline-typescript#3).

comline.toml can now say a package speaks JSON-RPC without annotating every protocol:

[generate]
default_framing = "jsonrpc"     # protocols with no @framing use this

[[generate.target]]
language = "rust"
default_framing = "datagram"    # per-target override

Resolved [[target]][generate] → unset (mirrors package_versions), then carried to the generator on GenRequest.default_framing. No CLI flag or env override — it shapes the generated API surface, not a per-run detail. comline new's template gains the commented key.

Rev bumps (kept in lockstep so the build resolves one comline-codegen):

  • comline-codegen → generation c70336d
  • comline-codegen-rust → comline-rust 85fd967
  • comline-codegen-typescript → comline-typescript f72bc3e

Tests

  • gen_config: section value reaches a declared target; [[target]] beats [generate]; absent ⇒ None.
  • tests/cli/generate: default_framing = "jsonrpc" in comline.toml makes the generated chat.rs emit JsonRpcFraming + connect_with_framing; with no comline.toml, it stays on FRAMING_DATAGRAM.
  • The existing protocol round-trip e2e still passes on the bumped generator.

`[generate] default_framing` (and per-`[[generate.target]]` override) names
the wire framing protocols use when they don't pick one with `@framing`.
Resolved `[[target]]` → `[generate]` → unset, then handed to the generator
on `GenRequest.default_framing`. No flag / env override — it shapes the
generated API, it's not a per-run knob.

Rev bumps: comline-codegen → generation c70336d, comline-codegen-rust →
comline-rust 85fd967, comline-codegen-typescript → comline-typescript f72bc3e
(kept in lockstep so the build resolves one comline-codegen).

tests:
  - gen_config: section value reaches a declared target; `[[target]]` wins;
    absent ⇒ None
  - tests/cli/generate: `default_framing = "jsonrpc"` in comline.toml makes
    the generated `chat.rs` emit the JSON-RPC stack; without it, datagram
@Kinflou
Kinflou merged commit 4340bef into main Sep 2, 2026
2 checks passed
@Kinflou
Kinflou deleted the feat/comline-toml-default-framing branch September 2, 2026 07:49
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