Open timotheeguerin opened 1 year ago
emit:
- @azure-tools/cadl-python
options:
global-options
common-option: "abc"
@azure-tools/cadl-python:
python-specfic: "def"
@azure-tools/cadl-csharp:
csharp-specfic: "xyz"
@azure-tools/cadl-autorest:
unrelated-option: "xyz"
emit:
- @azure-tools/cadl-python
options:
@azure-tools/cadl-python:
common-option: "abc"
python-specfic: "def"
@azure-tools/cadl-csharp:
common-option: "abc"
csharp-specfic: "xyz"
Alternatives
Currently we have a way for emitter to define options but no way for a library to do so.
We kept the design of option configuration open for this purpose but didn't have a real use case. Dpg teams want to be able to define some shared DPG options.
And then the dpg library can expose those common options via an helper.
Would need to expand the
createLibrary
definition to include non emitter options and a way to retrieve the typed options for your library.Alternative we could have:
sharedOptions
field in the config that contains a free form option set(means no validation for typo or missing emitter/library)