-
Notifications
You must be signed in to change notification settings - Fork 341
Auto-generate experimental warnings and usage docs for typekits from library metadata #9564
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
Open
Copilot
wants to merge
21
commits into
main
Choose a base branch
from
copilot/fix-http-typekits-documentation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+90
−7
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
ecd4435
Initial plan
Copilot b002ac5
Add usage instructions and experimental warning to HTTP typekits docu…
Copilot 0e0dc1e
Merge latest main to fix website build issues
Copilot f6c5749
Merge latest main to fix website build issues
Copilot aa2b623
Revert "Merge latest main to fix website build issues"
Copilot 7b6e19e
Add experimental warning and usage docs to auto-generated typekit doc…
Copilot 27e2db9
Merge latest main branch
Copilot cb879ff
Merge branch 'main' into copilot/fix-http-typekits-documentation
markcowl 22f90fe
Fix formatting and add changeset for tspd
Copilot f88c271
Merge latest main
Copilot 1bd3d39
Refactor to use generic @usageDoc mechanism instead of HTTP-specific …
Copilot e5d4397
Add changeset for @typespec/http package
Copilot 02c2ea8
Use TSDoc custom block for @usageDoc instead of file I/O
Copilot 8329284
Merge branch 'main' into copilot/fix-http-typekits-documentation
markcowl 55ff5d7
Merge latest main
Copilot f454442
Address review comments: update changeset description and simplify ex…
Copilot 499a3a7
Simplify changeset description per review feedback
Copilot 5bb12a1
Merge latest main
Copilot 5b5706c
Auto-generate usage info from library metadata, remove @usageDoc mech…
Copilot 584f40f
Merge latest main
Copilot 843912c
Remove package-specific logic and skip usage instructions for compile…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
.chronus/changes/copilot-fix-http-typekits-documentation-2026-2-3-20-11-24.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| changeKind: feature | ||
| packages: | ||
| - "@typespec/tspd" | ||
| --- | ||
|
|
||
| Auto-generate experimental warnings and usage documentation for typekits |
7 changes: 7 additions & 0 deletions
7
.chronus/changes/copilot-fix-http-typekits-documentation-2026-2-3-22-21-43.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| changeKind: internal | ||
| packages: | ||
| - "@typespec/http" | ||
| --- | ||
|
|
||
| Provide example usage of the experimental typekit in reference documentation | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,16 +12,52 @@ import { format as prettierFormat } from "prettier"; | |
| import { TypekitCollection } from "../typekit-docs.js"; | ||
| import { TypekitSection } from "./typekit-section.js"; | ||
|
|
||
| export function createTypekitDocs(typekit: TypekitCollection) { | ||
| export function createTypekitDocs(typekit: TypekitCollection, packageName: string) { | ||
| const isCompilerPackage = packageName === "@typespec/compiler"; | ||
|
|
||
| // Construct import path: for experimental typekits, use /experimental/typekit pattern | ||
| const typekitImportPath = typekit.isExperimental | ||
| ? `${packageName}/experimental/typekit` | ||
| : `${packageName}/typekit`; | ||
|
|
||
| const jsxContent = ( | ||
| <Output> | ||
| <md.SourceFile path={`typekits.mdx`}> | ||
| <> | ||
| <md.Frontmatter jsValue={{ title: "[API] Typekits" }} /> | ||
| {code` | ||
| import { Badge } from '@astrojs/starlight/components'; | ||
| import { Badge${typekit.isExperimental ? ", Aside" : ""} } from '@astrojs/starlight/components'; | ||
| `} | ||
| </> | ||
| {typekit.isExperimental && !isCompilerPackage && ( | ||
| <> | ||
| {code` | ||
|
|
||
| <Aside type="caution"> | ||
| **Experimental Feature**: These typekits are currently experimental. The API surface is volatile and may have breaking changes without notice. Use with caution in production environments. | ||
| </Aside> | ||
|
|
||
| To use these typekits in your TypeSpec emitter or tool, you need to import the typekit module: | ||
|
|
||
| \`\`\`ts | ||
| import "${typekitImportPath}"; | ||
| import { $ } from "@typespec/compiler/typekit"; | ||
|
Contributor
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. You would not repeat this for the compiler typekit |
||
| \`\`\` | ||
|
|
||
| The first import registers the typekit extensions. This import only needs to exist once in your compilation as only its side effects are important. | ||
| `} | ||
| </> | ||
| )} | ||
| {typekit.isExperimental && isCompilerPackage && ( | ||
| <> | ||
| {code` | ||
|
|
||
| <Aside type="caution"> | ||
| **Experimental Feature**: These typekits are currently experimental. The API surface is volatile and may have breaking changes without notice. Use with caution in production environments. | ||
| </Aside> | ||
| `} | ||
| </> | ||
| )} | ||
| <md.Section> | ||
| <For each={Object.values(typekit.namespaces)}> | ||
| {(x) => <TypekitSection typekit={x} />} | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.