Skip to content

docs: external_std applies to both generators, and document two missing keys - #31

Merged
Kinflou merged 1 commit into
mainfrom
docs/typescript-external-std
Oct 13, 2026
Merged

Kinflou merged 1 commit into
mainfrom
docs/typescript-external-std

Conversation

@Kinflou

@Kinflou Kinflou commented Oct 13, 2026

Copy link
Copy Markdown
Member

Follows comline-typescript#33, which gave typescript its own std package (@comline/std, the counterpart of comline_std).

--external-std was documented as a Rust feature

cli.md read "makes generated Rust reference comline_std". It now names
both packages.

Two keys were undocumented in comline-toml.md

  • external_std — not documented at all, and since it defaults on in
    lib mode, the behaviour it controls was the undocumented default. Now
    has its own section: what it does, the package per language, why code mode
    defaults it off, and the fact that neither package is published yet.
  • only — added by cli#59; it reached the codegen guide but never the
    reference. It's also the documented escape hatch when a declared language
    has no generator in your build, which made its absence worse than cosmetic.

Also in that file: the [[generate.target]] intro described a block as
something you "pin or override" without saying it doesn't decide whether a
language is generated — the distinction cli#59 turned into a hard error — and
the mode row still claimed lib was implemented for rust only.

The lib examples used std to show nesting

library-generation.md illustrated nested namespaces with std/http, which
is now the one namespace a lib build specifically does not carry. That
would have read as a contradiction against the new external_std section, so
the examples use a plain nested namespace and std gets its own short section
explaining that it's a dependency rather than a copy.

The cross-schema reference sections in generating-code.md also said every
non-local schema "is inlined", for both languages; both now note the std
exception, with the subpath form for typescript
(import type { Request } from "@comline/std/http").

Both drift scripts clean.

…sing keys

comline-typescript#33 gave typescript its own std package (`@comline/std`,
the counterpart of `comline_std`), so `--external-std` is no longer a Rust
thing: `cli.md` said "makes generated Rust reference `comline_std`".

Two keys turned out to be undocumented in `comline-toml.md` altogether:

- `external_std` — never documented, and it defaults *on* in `lib` mode, so
  the behaviour it controls was the undocumented default
- `only` — the narrowing key cli#59 added; it reached the codegen guide but
  not the reference, and it is also the escape hatch for a declared language
  with no compiled-in generator

Both now have their own sections. The `[[generate.target]]` intro still
described a block as something you "pin or override" without saying it
doesn't decide *whether* a language is generated — the distinction cli#59
turned into an error — so that's stated here too, and the `mode` row still
claimed `lib` was rust-only.

The `lib` examples in `library-generation.md` used `std/http` to illustrate
nesting, which `external_std` now makes a misleading choice — std is exactly
the namespace a `lib` build doesn't carry. Switched to a plain nested
namespace, with std's own behaviour given its own short section.
@Kinflou
Kinflou merged commit 071da27 into main Oct 13, 2026
3 checks passed
@Kinflou
Kinflou deleted the docs/typescript-external-std branch October 13, 2026 10:11
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