Generate the API reference; export the types public signatures name - #51
Merged
Conversation
…ignatures name
`npm run docs:api` renders every public entry point with TypeDoc, and CI
runs it with warnings as errors. Setting that up found what the warnings
exist to find: types that public signatures name — the port a tree
provider returns, the surface a fake hands back, the options
`setting.boolean` takes, the reason on a cancelled operation — which the
package never exported, so a consumer could receive one and not be able
to write its type. They are exported now, from the entry whose
signatures name them. `{@link}` tags that pointed at internal symbols
became plain code.
`ApplicationPlan` and `ModuleDefinition` keep their members internal:
both are handles — `defineExtension` and `createTestHost` consume them —
and `describePlan` is the readable form.
The output lands in `docs/api/`, ignored by git; hosting it is a
separate step.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Merged
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
npm run docs:apirenders every public entry point (.,./testing,./testing/vitest,./testing/vitest-config,./testing/mock,./vscode,./std,./ui) with TypeDoc, and CI runs it with warnings as errors.Setting that up found what the warnings exist to find: types that public signatures name but the package never exported. A consumer who got a
TreeItemLikeback from a tree source, aStatusBarItemHandlefrom a fake, aSettingBaseOptionsfromsetting.boolean, or aCancellationReasonoff anOperationCancelledErrorcould hold the value and not be able to write its type. They are exported now — type-only, from the entry whose signatures name them.CancellationReasonandOperationKindare exported as values too, since they are compared against.ApplicationPlanandModuleDefinitionare handled differently: their members are marked@internal. Both are handles —defineExtensionandcreateTestHostconsume them — anddescribePlanis the readable form. Exporting fifteen registration record types would have widened the public surface without giving a consumer anythingdescribePlandoes not.What changed
typedoc.json,npm run docs:api, a CI step after knip, anddocs/api/in.gitignore.npm run qualityincludes the step.TreeItemLike,PlatformRegistration,ProgressReporterLike,QuickPickItemLike,QuickInputButtonLike,TreeDataSource,TreeDragAndDrop,MarkdownLike,TooltipLike,LanguageSelectorLike,LanguageFilterLike,CommandLike,CommandLinkLike,AccessibilityInformationLike,RelativePatternLike,NotificationSeverity,ProgressArea,QuickInputCapability), plusDisposableLike,SubscriptionsHost,WebviewLike,WebviewCspSourceLike,DefineExtensionOptionsWithExports,StandardSchemaResult,SettingBaseOptions(previously the unexportedBaseOptions),CommandDescriptor,SchemaPathSegment,RememberedChoice,Emitter,StatusBarItemDefinition,LanguageStatusItemDefinition,CancellationReason,OperationKind../testingexports: the port types the fakes implement or hand back (CancellationTokenLike,FileWatcherHandle,InputBoxLike,QuickPickLike,LanguageStatusItemHandle,LanguageStatusItemFields,StatusBarItemHandle,StatusBarItemFields,NotificationActionLike,LocalizedMessage,SettingsChangeSource,ActiveTextEditor,WebviewPanelSurface,WebviewViewSurface) and the host typesTestHostexposes (Application,ApplicationHost,ExtensionHostContext,HostInspection,HostState,StopReason).{@link}tags that pointed at internal symbols became plain code.No runtime behaviour changes. The API reference is generated, not hosted yet; publishing it is a separate step.
Verification
npm run quality(now includingdocs:api): 1074 tests, 0 TypeDoc warnings withtreatWarningsAsErrors.npm run verify:package: the tarball installs and type-checks from a consumer; the CLI runs from the installed package.🤖 Generated with Claude Code