chore(shared): Add JSDocs to all organization resources#8748
chore(shared): Add JSDocs to all organization resources#8748LauraBeatris wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 581b5c2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 packages
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 |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/expo
@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: |
API Changes Report
Summary
🔴 Breaking changes index (1)Every breaking change, up front. Full diffs are in the package sections below.
@clerk/sharedCurrent version: 4.15.0 Subpath
|
📝 WalkthroughWalkthroughThis PR adds comprehensive JSDoc documentation to organization-related resource types in ChangesOrganization types documentation improvements
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/shared/src/types/organizationMembershipRequest.ts (1)
41-47: ⚡ Quick winAdd tests for the newly exposed
reject()contract.This PR introduces/documents a new public API surface on
OrganizationMembershipRequestResource; please add or update tests to coverreject()behavior and return-shape expectations.As per coding guidelines, "If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/shared/src/types/organizationMembershipRequest.ts` around lines 41 - 47, Add unit tests that cover the newly exposed OrganizationMembershipRequestResource.reject() contract: write tests that call reject() on a mocked OrganizationMembershipRequestResource instance (or via the factory that produces it), assert it returns a Promise resolving to the expected OrganizationMembershipRequestResource-shaped object, and verify side effects (e.g., status/state changes or API call invocation) and error handling. Ensure tests check the returned object's shape/fields match the documented OrganizationMembershipRequest (including any status field indicating rejection), mock the underlying API/HTTP client to assert the correct endpoint/method is invoked, and add cases for successful resolve and failure/rejection behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/shared/src/types/organizationMembershipRequest.ts`:
- Around line 41-47: Add unit tests that cover the newly exposed
OrganizationMembershipRequestResource.reject() contract: write tests that call
reject() on a mocked OrganizationMembershipRequestResource instance (or via the
factory that produces it), assert it returns a Promise resolving to the expected
OrganizationMembershipRequestResource-shaped object, and verify side effects
(e.g., status/state changes or API call invocation) and error handling. Ensure
tests check the returned object's shape/fields match the documented
OrganizationMembershipRequest (including any status field indicating rejection),
mock the underlying API/HTTP client to assert the correct endpoint/method is
invoked, and add cases for successful resolve and failure/rejection behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: e4fc9d15-2d56-4a92-837b-94f5d4cc9f8c
📒 Files selected for processing (8)
.changeset/good-bottles-deny.mdpackages/shared/src/types/organizationCreationDefaults.tspackages/shared/src/types/organizationDomain.tspackages/shared/src/types/organizationInvitation.tspackages/shared/src/types/organizationMembership.tspackages/shared/src/types/organizationMembershipRequest.tspackages/shared/src/types/organizationSettings.tspackages/shared/src/types/organizationSuggestion.ts
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/shared/src/types/organizationDomain.ts (1)
25-26: ⚡ Quick winConsider exporting
OrganizationDomainVerificationStrategyfor consistency.The type alias
OrganizationDomainVerificationStrategyis not exported, while similar types likeOrganizationDomainVerificationStatus(line 29) andOrganizationEnrollmentMode(line 40) are both exported. This inconsistency may prevent TypeScript consumers from directly referencing the strategy type when needed (e.g., in type guards or conditional logic).For consistency and to match the backend implementation (which exports this type), consider adding
export:-/** `@inline` */ -type OrganizationDomainVerificationStrategy = 'email_code'; +/** `@inline` */ +export type OrganizationDomainVerificationStrategy = 'email_code';🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/shared/src/types/organizationDomain.ts` around lines 25 - 26, The type alias OrganizationDomainVerificationStrategy is currently unexported while related types like OrganizationDomainVerificationStatus and OrganizationEnrollmentMode are exported; update the declaration of OrganizationDomainVerificationStrategy to export it so consumers can import and reference it (i.e., make OrganizationDomainVerificationStrategy exported to match the other exported types and the backend contract).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/shared/src/types/organizationDomain.ts`:
- Around line 25-26: The type alias OrganizationDomainVerificationStrategy is
currently unexported while related types like
OrganizationDomainVerificationStatus and OrganizationEnrollmentMode are
exported; update the declaration of OrganizationDomainVerificationStrategy to
export it so consumers can import and reference it (i.e., make
OrganizationDomainVerificationStrategy exported to match the other exported
types and the backend contract).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Repository UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 3dca1cce-30f6-4fa6-ae76-686f7ff8efbf
📒 Files selected for processing (6)
packages/shared/src/types/organizationCreationDefaults.tspackages/shared/src/types/organizationDomain.tspackages/shared/src/types/organizationInvitation.tspackages/shared/src/types/organizationMembership.tspackages/shared/src/types/organizationMembershipRequest.tspackages/shared/src/types/organizationSettings.ts
✅ Files skipped from review due to trivial changes (2)
- packages/shared/src/types/organizationInvitation.ts
- packages/shared/src/types/organizationSettings.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- packages/shared/src/types/organizationMembership.ts
- packages/shared/src/types/organizationMembershipRequest.ts
| enabled: boolean; | ||
| }; | ||
| /** | ||
| * @internal |
There was a problem hiding this comment.
We need to use @hidden to hide this from the documentation tooling, but still maintain the type as being part of the public API contract.
| * @internal | |
| * @hidden |
Description
This PR introduces JSDocs coverage on all types from organization resources to improve docs generation
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
New Features
reject()method to organization membership requests for improved request handling.Documentation