fix(repo): flatten Pick parameters in TypeDoc output - #9701
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: fe3a2f3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (1)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Included review availability: 6 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 8 reviews per hour. 📝 WalkthroughWalkthroughThe Typedoc custom theme now resolves Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Merge Risk: ⚪ Minimal · up to The reviewed localization changes are formatting-only and do not alter behavior. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Warning Linked repositories: Your configuration references 7 linked repositories, but your current plan allows 5. Analyzed Comment |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-google-signin
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
Export getPickPropertyNames and extend custom-theme.test.mts with the multi-key case and the fail-closed branches (missing keys, non-literal keys, Omit) that the generated-output snapshot does not exercise. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Pushed some changes directly in c0af671.
Leaving a comment for one more thing. |
API Changes Report
Summary
No API Changes DetectedAll packages have stable APIs with no detected changes. Report generated by Break Check Last ran on |
a077bef to
c6fd683
Compare
Thanks Michael! Not seeing the comment you're referring to? @manovotny |
| return undefined; | ||
| } | ||
| const selected = new Set(propertyNames); | ||
| const children = sourceWithChildren.children.filter(child => selected.has(child.name)); |
There was a problem hiding this comment.
For a generic source like Pick<Box<string>, 'value'>, this reuses Box<T>'s child reflections, so the flattened row documents the property's type as T rather than string — TypeDoc keeps the instantiation in the use-site typeArguments and doesn't rewrite the referenced declaration's children.
Nothing in the entry points hits this today (CreateOrganizationDomainParams isn't generic), and it's a pre-existing trait of the reference-flatten path, not something this PR introduces. The one wrinkle: this branch fails open (a wrong type) rather than closed.
Worth bailing to the opaque output when the source is a generic instantiation — returning undefined here when sourceType.typeArguments?.length — so it degrades instead of documenting T?
Description
OrganizationResource.createDomain()accepts the domain name as its first argument and onlyenrollmentModein its optionalparamsobject:The TypeDoc parameter-table renderer understands inline objects, interfaces, and type aliases, but it did not resolve TypeScript's built-in
Pick<T, K>. As a result, the generated table documented only the opaqueparams?: Pick<...>parameter and did not surfaceparams?.enrollmentMode?, its allowed values, description, or default.The current docs work around that limitation by embedding the complete
CreateOrganizationDomainParamsdeclaration below the method. That declaration contains bothnameandenrollmentMode, even though this method receivesnameseparately asdomainName. OnceenrollmentModeis flattened into the method table, retaining the workaround would also document it twice.This PR teaches the parameter-table renderer to resolve the built-in
Pick<T, K>whenKis composed of string literal keys. It filters the source declaration to exactly the selected properties and passes that shape through the existing nested-parameter renderer. The parent parameter remains in the table, followed by rows for the selected properties with their original types and JSDoc.Because the selected shape is documented inline, the source type is rendered without a link to the full unpicked declaration. Unsupported or partially resolved
Pickshapes retain the existing output rather than producing incomplete documentation.Adds an end-to-end snapshot for
organization.createDomain(), which now documentsparams?.enrollmentMode?without leaking the omittednameproperty.Although the repository contains other source-level
Pickusages,createDomain()is currently the only generated standalone parameter table that enters this code path. Tests, internal types, packages outside the TypeDoc entry points, property tables, and function-valued resource-summary properties use different paths and remain unchanged.Required merge flow:
clerk/clerk.The Clerk cleanup should not merge directly into
main; combining it with the generated output prevents an intermediate state with missing or duplicated parameter documentation.Resolves DOCS-11879.
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change