Skip to content

feat: --external-std / comline.toml external_std for comline generate - #50

Merged
Kinflou merged 3 commits into
mainfrom
feat/external-std-cli
Oct 10, 2026
Merged

Kinflou merged 3 commits into
mainfrom
feat/external-std-cli

Conversation

@Kinflou

@Kinflou Kinflou commented Oct 10, 2026

Copy link
Copy Markdown
Member

Summary

  • Wires comline-rust#30's external_std opt-in through the CLI: a new comline.toml [generate] external_std field (per-target override, COMLINE_GENERATE_EXTERNAL_STD env var, --external-std flag) - same precedence chain mode/out/layout already use.
  • Real gap found while testing end-to-end (not caught by any crate-level test, since it's specifically a CLI-driver concern): code mode's own driver in commands/generate.rs independently expects a generated file for every schema it knows about, erroring "generator produced no file for X" otherwise - this breaks the moment a generator deliberately drops one, which is exactly what external_std does for std's own schemas. Fixed by skipping that check specifically for std-originated namespaces when external_std is on, mirroring the same namespace-prefix convention the generator itself already uses to decide what to drop.
  • Bumps comline-codegen/-rust/-typescript to the revs carrying GenRequest.external_std (generation#40, comline-rust#30, comline-typescript#25 - all branch-tip, pending those PRs' merge, per established precedent in this project).
  • docs/cli.md updated with the new field/flag/env var.

Test plan

  • cargo test clean (74 tests: 17 unit + 57 integration, including 6 new external_std-specific ones covering both the config precedence chain and real end-to-end CLI behavior in both code and lib mode)
  • cargo clippy --all-targets clean
  • Manual: cargo run -- generate --help shows the new flag correctly

Kinflou added 3 commits October 11, 2026 04:54
Wires comline-rust#30's external_std opt-in through the CLI: a new
comline.toml [generate] external_std field (per-target override,
COMLINE_GENERATE_EXTERNAL_STD env var, --external-std flag), same
precedence chain mode/out/layout already use.

Also fixes a real gap found while testing end-to-end: code mode's own
driver independently expects a generated file for every schema it
knows about, which breaks once a generator deliberately drops one
(std's own schemas, under external_std) - skip that check for std
specifically, mirroring the same namespace-prefix convention the
generator itself uses to decide what to drop.

Bumps comline-codegen/-rust/-typescript to revs carrying
GenRequest.external_std (generation#40, comline-rust#30,
comline-typescript#25 - all branch-tip, pending merge).
comline-rust's branch had the wrong Cargo.toml dependency key
(comline-std, hyphen) for a package whose real name is comline_std
(underscore) - caught by actually cargo build-ing a generated crate
against the real dependency, not just string-matching in tests. Bump
the pin to the fixed commit and correct this repo's own test
assertions to match.
@Kinflou
Kinflou merged commit e730935 into main Oct 10, 2026
2 checks passed
@Kinflou
Kinflou deleted the feat/external-std-cli branch October 10, 2026 21:05
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