Repository navigation
generate: map encodings in comline.toml (core#120 B3) - #105
Merged
Merged
Conversation
added 3 commits
October 31, 2026 22:19
[generate] and [[generate.target]] take
encodings = { "<name>" = "<type>" | { type, package, version } },
the target's over the section's by canonical name. generate gathers the
encodings the package and its dependencies declare, with the official
ones, and fills GenerateRequest.encodings through
comline_codegen::encodings::fill: comline.toml's mapping, else the
declaring package's suggestion, else an error naming the encoding, the
language and the comline.toml syntax, for an encoding the package uses.
Pins generation b116831, comline-rust 650c684 and comline-typescript
765fc2d (the encodings-mapping branches), the fixture generators too.
Generated output for chat_project, simple_project and validated_project
is byte-identical to main's, Rust and TypeScript, code and lib.
…d-encoding error; pin comline-rust 0e5c60e
Closed
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step B3 of core#120, the CLI's half.
comline.toml
{ type, package, version }withpackage/versionoptional and unknown keys refused.[generate]'s by canonical name, sojsonrpc@1in one andjson-rpcin the other are the same entry.comline new's template mentions the key.generate
FrozenUnit::Encodings the package and its dependencies declare, plusofficial::units(), and fillsGenerateRequest.encodingswithcomline_codegen::encodings::fill, the resolver the playground will share (codegen: resolve encodings to a target's mappings (core#120 B3) generation#88).map, then an error. The error only fires for an encoding the package uses, and names the encoding, the language and the comline.toml syntax.Pins: generation
b116831, comline-rust650c684(ComlineProject/comline-rust#80) and comline-typescript765fc2d(ComlineProject/comline-typescript#92), in the fixture generators as well.cargo tree -dshows one copy of each comline crate.Byte-identical:
chat_project,simple_projectandvalidated_project, each also declaringtypescript#5.0, generated incodeandlibforrustandtypescriptbymainand by this branch:diff -rover the 39 files is empty.Tests
a_dependencys_framing_generates_its_mapped_type:appdepends onacme, which declarescom.acme.lines@1. The generated code uses acme's suggestion, then[generate]'s mapping, then the target's over it.an_unmapped_dependency_framing_is_an_error_naming_it: acme suggests a TypeScript class only, so the rust target fails with the error and writes nothing.an_unknown_framing_is_an_error: the cli#81 case, a framing nothing declares, fails before anything is generated.a_bad_comline_toml_encoding_entry_is_refused, plus a unit test for the merge.cargo test,cargo fmt --checkand both clippy runs pass locally.Merge last: after ComlineProject/generation#88, then ComlineProject/comline-rust#80 and ComlineProject/comline-typescript#92.