fix(shared,testing): ship self-contained published types for shared/cookie and testing/cypress#8841
Conversation
…ookie and testing/cypress
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: e9ab171 The changes in this PR will be included in the next version bump. This PR includes changesets to release 21 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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Repository UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR fixes TypeScript declaration resolution issues across two packages. It exports a self-contained ChangesTypeScript Declaration Fixes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/shared/src/cookie.ts (1)
9-46: AlignCookieAttributeswith@types/js-cookie(partitioned already supported via index signature)
@types/js-cookie’sCookieAttributesdoes not define a namedpartitionedproperty; it relies on the[property: string]: anyindex signature to allow additional attributes. The current interface matches that approach, sopartitionedis already type-accepted.Optional: add
partitioned?: booleanonly if you specifically want better autocomplete/type safety rather than relying on the index signature.🤖 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/cookie.ts` around lines 9 - 46, The CookieAttributes interface already allows unrecognized attributes like partitioned via its index signature ([property: string]: any), so no change is required; if you prefer stronger typing/autocomplete for "partitioned" add an explicit optional property partitioned?: boolean to the CookieAttributes interface (referencing the CookieAttributes declaration and its [property: string]: any index signature) and leave the rest unchanged.
🤖 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.
Inline comments:
In `@packages/shared/src/cookie.ts`:
- Line 77: The public method remove(cookieAttributes?: CookieAttributes) is
missing an explicit return type; update its signature to include an explicit
return type (e.g., change to remove(cookieAttributes?: CookieAttributes): void {
... }) to match its synchronous implementation so the public API has a declared
return type.
---
Nitpick comments:
In `@packages/shared/src/cookie.ts`:
- Around line 9-46: The CookieAttributes interface already allows unrecognized
attributes like partitioned via its index signature ([property: string]: any),
so no change is required; if you prefer stronger typing/autocomplete for
"partitioned" add an explicit optional property partitioned?: boolean to the
CookieAttributes interface (referencing the CookieAttributes declaration and its
[property: string]: any index signature) and leave the rest unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Repository UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 5cd3ee9f-a376-408b-a922-e5abb635bfa4
📒 Files selected for processing (7)
.changeset/shared-cookie-self-contained-types.md.changeset/testing-cypress-preserve-types-reference.mdpackages/shared/src/cookie.tspackages/testing/src/cypress/agent-task.tspackages/testing/src/cypress/custom-commands.tspackages/testing/src/cypress/setup.tspackages/testing/src/cypress/setupClerkTestingToken.ts
@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
@clerk/sharedCurrent version: 4.17.1 Subpath
|
Break Check has been skipping
@clerk/shared./cookieand@clerk/testing./cypress(see the report on #8827) because the published d.ts for both is not self-contained. For shared, the dts bundler drops theimport Cookies from 'js-cookie'and ships bareCookies.CookieAttributesreferences that no consumer can resolve, since@types/js-cookieis only a devDependency;cookie.tsnow declares its ownCookieAttributes(same shape as js-cookie's) and uses it in the public signatures. For testing, tsc drops the/// <reference types="cypress" />directives during declaration emit, so the emitted types lean on the globalCypressnamespace without declaring it;preserve="true"carries the directive into the output.One behavior change to weigh: importing
@clerk/testing/cypressnow loads cypress's ambient globals (chai/jquery/mocha) in the consumer's program. That is the intended semantics for a cypress-only subpath, and the directive lands only in the cypress d.ts files, but it is new. Verified by rebuilding both packages and re-running break-check: both subpaths snapshot cleanly, and the shipped files compile in isolation with skipLibCheck off.Summary by CodeRabbit