-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[tcgc] add flags docs #2216
base: main
Are you sure you want to change the base?
[tcgc] add flags docs #2216
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# TCGC `tspconfig.yaml` flags | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes,
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh yep! I can't believe I missed |
||
## 1. `generate-protocol-methods` | ||
|
||
When set to `true`, the emitter will generate low-level protocol methods for each service operation if `@protocolAPI` is not set for an operation. Default value is `true`. | ||
|
||
## 2. `generate-convenience-methods` | ||
|
||
When set to `true`, the emitter will generate low-level protocol methods for each service operation if `@convenientAPI` is not set for an operation. Default value is `true`. | ||
|
||
## 3. `package-name` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wasn't aware we had a Yeah, we can use this, if we agree there would be no need to setting a version. Though unsure whether there would be another There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Python is fine to add nit: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For now package name, version and description would be useful for JS. And in Azure scope the package name is required but others are optional. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the |
||
|
||
The `package-name` override you would like for your generated library. By default individual language emitters should calculate the package name for their library from the `SdkPackage.namespaces` that `tcgc` returns to them. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Feels like we may want to kill it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we have been talking about coalescing to |
||
|
||
Currently, emitters don't really use it, but it would be great to move language emitters to use this flag. Java should be excluded from this list because it doesn't apply to their naming structure. | ||
|
||
Should remove any logic that derives namespace names from the value of `package-name`. | ||
|
||
Default value is `none`. | ||
iscai-msft marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## 4. `flatten-union-as-enum` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. another point is even we could expose this flag to customers that doesn't mean the customer's config would always take effective. it depends on how emitter handled them and is allowed to override or not. for example generate-protocol-methods is always true for js no matter what config yaml set. |
||
|
||
Whether you want TCGC to return unions of strings as enums. Default value is `true`. I feel this should not be a `tspconfig.yaml` flag, but an option you can pass to TCGC when calling `createSdkContext` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How do we configure it if it's not a flag? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it can be passed in as an option to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That doesnt' reply to my question :). We made it a flag so users can decide the behavior they want, how do a user decide what behavior they want, if it's not through a flag? |
||
|
||
## 5. `examples-dir` | ||
|
||
Specifies the directory where the emitter will look for example files. If the flag isn’t set, the emitter defaults to using an `examples` directory located at the project root. | ||
|
||
## 6. `emitter-name` | ||
|
||
The name of the emitter you are calling TCGC from. TCGC uses this to keep track of what scope you belong to, and what information to set for you. I feel this should not be a `tspconfig.yaml` flag, but an option you can pass to TCGC when calling `createSdkContext` | ||
iscai-msft marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## 7. `namespace` | ||
|
||
If you want to override the namespaces set in the spec. In the process of adding, see [this](https://github.com/Azure/typespec-azure/pull/2161) PR. Affects the values in `SdkPackage.namespaces`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to clarify the concept of tcgc flags here, does that mean 1) tcgc would use these flags or 2) the common flags cross all emitters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any flag tcgc will use and get from emitter's config in
tspconfig.yaml
.