CLI and Catalog Plugin Input Is Checked
Applies to
@connectum/cliand@connectum/protoc-gen-catalog1.3.0.
Does this apply to you?
You need to act only if a script, a CI job or a buf.gen.yaml of yours does one of these:
- passes
connectum init,connectum proto syncorconnectum generate servicea flag the command does not define (a typo such as--evnts nats, or a flag from another tool). Before, it was dropped without a word; now the command stops withError: connectum init: unknown option --evnts. Valid options: ...and exit code 1; - runs
connectum init --runtime bun --node-exec <raw|tsx>. Bun runs TypeScript itself, so the flag selected nothing; the command now refuses the combination and names both flags; - runs
connectum generate servicein a directory with nopackage.json, or with--with-eventsin a project whosepackage.jsonhas no@connectum/eventsindependencies,devDependencies,peerDependenciesoroptionalDependencies. Before, the files were written anyway, and the event handler failedtscwithTS2307andTS7006; - generates the service catalog with
protoc-gen-connectum-catalogwithouttarget=tsinopt(notargetat all,target=js,target=dts, or a combination such asts+js); - gives
protoc-gen-connectum-catalogtheoutput_fileoption more than once.
If none of these applies, nothing changes for you except the wording of errors (see below).
Required changes
- Unknown flag. Remove it, or correct the spelling. The error lists every flag the command has.
--node-execwith Bun. Leave--node-execout when scaffolding for Bun.generate serviceoutside a project. Run it from the project root. To use--with-events, add@connectum/eventsand an adapter first (npm install @connectum/events @connectum/events-nats), or scaffold the project withconnectum init --events <adapter>.- Catalog
target. Puttarget=tsin the plugin'sopt, as the catalog generation guide does. Without atarget, buf readsjs+dts; the plugin wrotecatalog.gen.jsandcatalog.gen.d.ts, which carry nodeclare module "@connectum/core"augmentation, so everyctx.callkey was untyped. If you importedcatalog.gen.jsorcatalog.gen.d.ts, import the generatedcatalog.gen.tsinstead. - Repeated
output_file. Keep one. The last one used to win.
yaml
# Before: no target, the plugin wrote catalog.gen.js and catalog.gen.d.ts
- local: protoc-gen-connectum-catalog
strategy: all
out: gen
# After
- local: protoc-gen-connectum-catalog
strategy: all
out: gen
opt: [target=ts, import_extension=.js]Behavior that changed without an action on your side
- The
@generated by protoc-gen-connectum-catalogline is now the first line ofcatalog.gen.ts, above the imports. Regenerate to get it; nothing else in the file changes. - Failures of
connectum proto syncthat are caused by the input are one line (Error: ..., exit code 1): a closed port names the address andECONNREFUSED, an empty or malformed--fromis refused before any connection, a--templatethat is not a file is refused before any connection, a missingbufsays it is not on the PATH, and a server that speaks only HTTP/1.1 is named as such. The exit code was 1 before as well. - A project scaffolded with
--authnow answers the gRPC Health and reflection services without a token. Projects scaffolded earlier keep theirsrc/auth.ts; see What--authgenerates for the change to make there. - A project scaffolded with
--no-healthcheckhas noHEALTHCHECKin its Dockerfiles and no dependency on@connectum/healthcheck.
Verify the upgrade
Run each command you use once and read the output. A flag the command does not define now ends the run with unknown option; buf generate with the catalog plugin writes catalog.gen.ts and nothing else, and a missing target=ts fails with a message that names it.