You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the Buf CLI provides options for include-imports and include-wkt, which handles the generation of imports and WKT.
--include-imports Also generate all imports except for Well-Known Types.
--include-wkt Also generate Well-Known Types. Cannot be set without --include-imports.
However, because this is at the command level, this will be applied to every plugin in buf.gen.yaml, which works fine for some languages (such as JS) but can be problematic for languages such as Go because of how go_package works.
A better approach might be to move these commands inside buf.gen.yaml and scoped to individual plugins. That way, each plugin can be told what files to generate code for independently.
For further context and a real-world example of the difficulties this causes, see connectrpc/connect-es#262.
The text was updated successfully, but these errors were encountered:
smaye81
changed the title
Provider better support for imports at the plugin level
Provide better support for imports at the plugin level
Sep 15, 2022
We might want to re-think buf.gen.yaml in a v2 of the config definition. Originally, the motivation was to have buf.gen.yaml be input-independent - all input-related functionality was in flags, all input-independent plugin config was in buf.gen.yaml. This would let you reuse buf.gen.yamls across different inputs.
Real-world usage has not played out this way - most people check a buf.gen.yaml into the root of their repository. Managed mode also blurred the lines. We may want to have an updated buf.gen.yaml that allows inputs to be specified.
Currently, the Buf CLI provides options for
include-imports
andinclude-wkt
, which handles the generation of imports and WKT.However, because this is at the command level, this will be applied to every plugin in
buf.gen.yaml
, which works fine for some languages (such as JS) but can be problematic for languages such as Go because of howgo_package
works.A better approach might be to move these commands inside
buf.gen.yaml
and scoped to individual plugins. That way, each plugin can be told what files to generate code for independently.For further context and a real-world example of the difficulties this causes, see connectrpc/connect-es#262.
The text was updated successfully, but these errors were encountered: