Skip to content

[python] add emitter options and docs#6537

Merged
tadelesh merged 34 commits intomicrosoft:mainfrom
iscai-msft:python/updateOptions
Mar 24, 2025
Merged

[python] add emitter options and docs#6537
tadelesh merged 34 commits intomicrosoft:mainfrom
iscai-msft:python/updateOptions

Conversation

@iscai-msft
Copy link
Member

@iscai-msft iscai-msft commented Mar 19, 2025

  1. Update to @azure-tools/typespec-client-generator-core version 0.53.0 (and update corresponding libraries
  2. Have your library's emitter options in lib.ts extend from tcgc's SdkEmitterOptions (code)
  3. Spread SdkEmitterOptionsSchema.properties into the implementation of your options (code)
    • If you haven't added documentation for each of your emitter options, be sure to include them so they properly render in the website
  4. Split your flags between your unbranded and branded emitter. Include only azure specific flags in your branded emitter
  5. Now, we need to make sure these changes get published to the website. Follow the remaining steps if you haven't already started adding website documentation
  6. Suggestion is to add "regen-docs": "node ../../packages/tspd/cmd/tspd.js doc . --enable-experimental --output-dir ../../website/src/content/docs/docs/emitters/clients/http-client-<emitter-name>/reference --skip-js" to your package.json
    • Make sure you pull from main before doing this step and building tspd
    • If you have any custom documentation in your README.md, this will overwrite everything. If you have any extra handwritten content you'd like to add, you can add .tspd/docs/usage.md file, and that will get injected into your readme
  7. Add npm run regen-docs to your generation pipeline
  8. Add an entry into website/src/content/current-sidebar.ts with your emitter

@github-actions
Copy link
Contributor

No changes needing a change description found.

@azure-sdk
Copy link
Collaborator

azure-sdk commented Mar 19, 2025

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@iscai-msft iscai-msft enabled auto-merge March 21, 2025 18:28
@tadelesh tadelesh force-pushed the python/updateOptions branch from 67a9791 to 4e42816 Compare March 24, 2025 07:06
@tadelesh tadelesh disabled auto-merge March 24, 2025 09:59
@tadelesh tadelesh added this pull request to the merge queue Mar 24, 2025
Merged via the queue into microsoft:main with commit a2bc295 Mar 24, 2025
33 checks passed
mario-guerra pushed a commit that referenced this pull request Apr 2, 2025
1. Update to `@azure-tools/typespec-client-generator-core` version
`0.53.0` (and update corresponding libraries
2. Have your library's emitter options in `lib.ts` extend from tcgc's
`SdkEmitterOptions`
([code](https://github.com/microsoft/typespec/pull/6537/files#diff-312d0aa386e3732696ebc167c3a63647ce3d44791fbe44392b01042119635f87R9))
3. Spread `SdkEmitterOptionsSchema.properties` into the implementation
of your options
([code](https://github.com/microsoft/typespec/pull/6537/files#diff-312d0aa386e3732696ebc167c3a63647ce3d44791fbe44392b01042119635f87R57))
- If you haven't added documentation for each of your emitter options,
be sure to include them so they properly render in the website
4. Split your flags between your unbranded and branded emitter. Include
only `azure` specific flags in your branded emitter
5. Now, we need to make sure these changes get published to the website.
Follow the remaining steps if you haven't already started adding website
documentation
6. Suggestion is to add `"regen-docs": "node
../../packages/tspd/cmd/tspd.js doc . --enable-experimental --output-dir
../../website/src/content/docs/docs/emitters/clients/http-client-<emitter-name>/reference
--skip-js"` to your `package.json`
- Make sure you pull from main before doing this step and building
`tspd`
- If you have any custom documentation in your `README.md`, this will
overwrite everything. If you have any extra handwritten content you'd
like to add, you can add `.tspd/docs/usage.md` file, and that will get
injected into your readme
7. Add `npm run regen-docs` to your generation pipeline
- I added it in
[`Generate.ps1`](https://github.com/microsoft/typespec/pull/6537/files#diff-d01183da000e95538fa4d2d813fb61cc208ffc624c406f53a0a8c22047d106a0R13)
8. Add an entry into
[`website/src/content/current-sidebar.ts`](https://github.com/microsoft/typespec/pull/6537/files#diff-2dedc394c7548f077bab3ebbc97904b254707dc4107e83bbd841d34900b7a202R153)
with your emitter

---------

Co-authored-by: iscai-msft <isabellavcai@gmail.com>
Co-authored-by: tadelesh <tadelesh.shi@live.cn>
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.

5 participants