feat(ipc-codegen): human-authored JSONC schema format#24086
Open
charlielye wants to merge 1 commit into
Open
Conversation
917aa13 to
66ff2af
Compare
8cec13b to
561b762
Compare
66ff2af to
14b6dd9
Compare
561b762 to
a5dc5dd
Compare
14b6dd9 to
993c25a
Compare
a5dc5dd to
dae506d
Compare
Add a friendly JSONC schema front-end to schema_visitor.ts that lowers a single per-service object (service/aliases/types/error/commands with shorthand string type refs) to the positional named_union form the generators already consume, so the four generators are untouched and the produced CompiledSchema is identical. The type prefix and method-prefix stripping fold into the 'service' field, retiring --prefix/--strip-method-prefix and detectPrefix for friendly schemas. aliases support bin32 (nominal) and scalar synonyms (e.g. MerkleTreeId = u32). Convert the echo example schema to schema.jsonc and update its bootstraps; remove the schema_reflection_test (it asserted the old positional shape). Add scripts/convert_schema.ts, a one-shot positional->friendly converter used to migrate the remaining service schemas. Goldens unchanged; full echo test matrix (golden x4, UDS 4x4, SHM, ts_package) passes.
993c25a to
0ac3119
Compare
dae506d to
a0d859e
Compare
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.
Replaces the positional/reflection-shaped IPC schema with a human-authored JSONC format and drops the C++ schema-reflection machinery.
schema_visitor.ts: one object per service (service/aliases/types/error/commands) with shorthand string type refs, lowered to the positionalnamed_unionform the generators already consume — generators untouched, producedCompiledSchemaidentical. Type prefix + method-prefix-stripping fold intoservice, retiring--prefix/--strip-method-prefix. Aliases cover bin32 (nominal) and scalar synonyms (e.g.MerkleTreeId: u32).templates/cpp/ipc_codegen/schema.hpp,get_*_schema_as_json(), the<Prefix>Api/<Prefix>Commandreflection aggregates, per-typemsgpack_schemamethods, and the rust__typenamefield.MSGPACK_SCHEMA_NAME(NamedUnion dispatch tag) and theNamedUniontype are kept; wire format is unchanged.schema.jsonc;scripts/convert_schema.tsadded (one-shot positional→friendly converter);SCHEMA_SPEC.mdrewritten.Goldens byte-unchanged; full echo matrix (golden ×4, UDS 4×4, SHM, ts_package) passes.