-
Notifications
You must be signed in to change notification settings - Fork 381
fix(types, clerk-js): Update Errors interface to allow null for raw and global error arrays #6677
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
Conversation
…nd global error arrays
🦋 Changeset detectedLatest commit: 89b099d The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 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 |
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughError handling now treats raw and global error collections as nullable, initializing them to null and creating arrays only when needed. Parsing logic in clerk-js was updated to lazily initialize these arrays. The Errors interface reflects this nullability, and React state proxies now default raw/global to null. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant Parser as parseErrors (clerk-js)
participant Types as Errors (types)
participant React as stateProxy
Caller->>Parser: handle error(e)
alt Clerk API response (structured)
Parser->>Types: for each error -> ensure raw/global exist, then push
else Non-Clerk error (unstructured)
Parser->>Types: set raw = [e], global = [e] (lazy-init)
end
React-->>Caller: defaultErrors (raw=null, global=null)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/elements
@clerk/clerk-expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/clerk-react
@clerk/react-router
@clerk/remix
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/themes
@clerk/types
@clerk/upgrade
@clerk/vue
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
packages/types/src/state.ts (1)
25-26
: Document new nullability on public API.Add JSDoc so integrators know to guard with a truthy check instead of
.length
.Apply:
export interface Errors { fields: FieldErrors; - raw: unknown[] | null; - global: unknown[] | null; + /** Null when there are no raw errors. Prefer `if (errors.raw)` over checking `.length`. */ + raw: unknown[] | null; + /** Null when there are no global errors. Prefer `if (errors.global)` over checking `.length`. */ + global: unknown[] | null; }packages/clerk-js/src/core/signals.ts (2)
70-75
: Condense lazy initialization and avoid shadowing.Use nullish-assignment to remove duplication and rename the loop variable to prevent shadowing the outer
error
.Apply:
- error.errors.forEach(error => { - if (parsedErrors.raw) { - parsedErrors.raw.push(error); - } else { - parsedErrors.raw = [error]; - } + error.errors.forEach(apiError => { + (parsedErrors.raw ??= []).push(apiError); - if ('meta' in error && error.meta && 'paramName' in error.meta) { - const name = snakeToCamel(error.meta.paramName); - parsedErrors.fields[name as keyof typeof parsedErrors.fields] = error; + if ('meta' in apiError && apiError.meta && 'paramName' in apiError.meta) { + const name = snakeToCamel(apiError.meta.paramName); + parsedErrors.fields[name as keyof typeof parsedErrors.fields] = apiError; return; } - if (parsedErrors.global) { - parsedErrors.global.push(error); - } else { - parsedErrors.global = [error]; - } + (parsedErrors.global ??= []).push(apiError); });Also applies to: 82-86
76-80
: Guard unknown param names to avoid writing outside known fields.If
snakeToCamel(paramName)
doesn’t matchFieldErrors
keys, fall back to global.Apply:
- if ('meta' in apiError && apiError.meta && 'paramName' in apiError.meta) { - const name = snakeToCamel(apiError.meta.paramName); - parsedErrors.fields[name as keyof typeof parsedErrors.fields] = apiError; - return; - } + if ('meta' in apiError && apiError.meta && 'paramName' in apiError.meta) { + const name = snakeToCamel(apiError.meta.paramName); + if (name && (name in parsedErrors.fields)) { + parsedErrors.fields[name as keyof typeof parsedErrors.fields] = apiError; + return; + } + }Also applies to: 82-86
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
packages/clerk-js/src/core/signals.ts
(1 hunks)packages/types/src/state.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
**/*.{js,jsx,ts,tsx}
: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels
Files:
packages/clerk-js/src/core/signals.ts
packages/types/src/state.ts
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use Prettier for consistent code formatting
Files:
packages/clerk-js/src/core/signals.ts
packages/types/src/state.ts
packages/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
TypeScript is required for all packages
Files:
packages/clerk-js/src/core/signals.ts
packages/types/src/state.ts
packages/**/*.{ts,tsx,d.ts}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Packages should export TypeScript types alongside runtime code
Files:
packages/clerk-js/src/core/signals.ts
packages/types/src/state.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use proper TypeScript error types
**/*.{ts,tsx}
: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoidany
type - preferunknown
when type is uncertain, then narrow with type guards
Useinterface
for object shapes that might be extended
Usetype
for unions, primitives, and computed types
Preferreadonly
properties for immutable data structures
Useprivate
for internal implementation details
Useprotected
for inheritance hierarchies
Usepublic
explicitly for clarity in public APIs
Preferreadonly
for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Useconst assertions
for literal types:as const
Usesatisfies
operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports:import type { ... } from ...
Noany
types without justification
Proper error handling with typed errors
Consistent use ofreadonly
for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)
Files:
packages/clerk-js/src/core/signals.ts
packages/types/src/state.ts
**/*.{js,ts,tsx,jsx}
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.
Files:
packages/clerk-js/src/core/signals.ts
packages/types/src/state.ts
🧬 Code graph analysis (1)
packages/clerk-js/src/core/signals.ts (1)
packages/shared/src/underscore.ts (1)
snakeToCamel
(51-53)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Formatting | Dedupe | Changeset
- GitHub Check: Build Packages
- GitHub Check: semgrep/ci
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (4)
packages/types/src/state.ts (2)
25-26
: Change aligns types with runtime (nullable raw/global).This matches the lazy initialization in clerk-js and enables simple truthy checks by consumers.
25-26
: No actionable call‐site changes needed.
Searches forerrors.global.length
,errors.raw.length
, optional‐chained/non‐null‐asserted.length
, and direct indexing returned no matches—there are no existing call sites to update.packages/clerk-js/src/core/signals.ts (2)
55-57
: Initialize to null to match updated types.Correctly mirrors
Errors
nullability.
64-66
: Non-API errors routed to raw/global as singletons.Good default; avoids empty arrays and keeps semantics consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.changeset/red-tools-eat.md
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/**
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Automated releases must use Changesets.
Files:
.changeset/red-tools-eat.md
🪛 LanguageTool
.changeset/red-tools-eat.md
[grammar] ~1-~1: Hier könnte ein Fehler sein.
Context: --- ---
(QB_NEW_DE)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (23)
- GitHub Check: Integration Tests (nextjs, chrome, 14)
- GitHub Check: Integration Tests (react-router, chrome)
- GitHub Check: Integration Tests (nuxt, chrome)
- GitHub Check: Integration Tests (billing, chrome)
- GitHub Check: Integration Tests (tanstack-react-start, chrome)
- GitHub Check: Integration Tests (tanstack-react-router, chrome)
- GitHub Check: Integration Tests (expo-web, chrome)
- GitHub Check: Integration Tests (astro, chrome)
- GitHub Check: Integration Tests (vue, chrome)
- GitHub Check: Integration Tests (localhost, chrome)
- GitHub Check: Integration Tests (sessions, chrome)
- GitHub Check: Integration Tests (generic, chrome)
- GitHub Check: Integration Tests (ap-flows, chrome)
- GitHub Check: Integration Tests (express, chrome)
- GitHub Check: Integration Tests (quickstart, chrome)
- GitHub Check: Static analysis
- GitHub Check: Unit Tests (18, --filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@c...
- GitHub Check: Unit Tests (22, **)
- GitHub Check: Publish with pkg-pr-new
- GitHub Check: semgrep/ci
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: semgrep-cloud-platform/scan
.changeset/red-tools-eat.md
Outdated
--- | ||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Changeset is empty/invalid — specify package bumps and summary.
Without valid frontmatter, CI release won’t pick this up. Given errors.raw/global
can now be null
at runtime and in types, this is plausibly a breaking change for TS consumers; consider a major bump (or confirm desired semver).
Apply this diff (adjust semver if you decide it’s minor/patch):
----
----
+---
+"@clerk/clerk-js": major
+"@clerk/types": major
+---
+
+Make `Errors.raw` and `Errors.global` nullable (`unknown[] | null`) and lazily initialized in clerk-js parsing.
+
+BREAKING (types/runtime): Code assuming arrays must now handle `null`.
+Migration:
+```ts
+if (errors.global) {
+ render(errors.global[0]?.message);
+}
+// or
+for (const e of errors.raw ?? []) { /* ... */ }
+```
🏁 Script executed:
#!/bin/bash
# Inspect the changeset file for missing frontmatter
cat .changeset/red-tools-eat.md
Length of output: 41
Populate .changeset/red-tools-eat.md
frontmatter
The file currently contains only empty markers; add valid package bumps and a summary so CI can detect this breaking change. Since errors.raw
/errors.global
now allow null
, this warrants a major bump (or confirm the desired semver).
----
----
+---
+"@clerk/clerk-js": major
+"@clerk/types": major
+---
+
+Make `Errors.raw` and `Errors.global` nullable (`unknown[] | null`) and lazily initialized in clerk-js parsing.
+
+BREAKING (types/runtime): Code assuming arrays must now handle `null`.
+Migration:
+```ts
+if (errors.global) {
+ render(errors.global[0]?.message);
+}
+// or
+for (const e of errors.raw ?? []) { /* ... */ }
+```
🧰 Tools
🪛 LanguageTool
[grammar] ~1-~1: Hier könnte ein Fehler sein.
Context: --- ---
(QB_NEW_DE)
🤖 Prompt for AI Agents
In .changeset/red-tools-eat.md around lines 1 to 2, the file contains only empty
markers and needs valid Changeset frontmatter so CI recognizes the release;
replace the empty frontmatter with a YAML block listing the affected package(s)
and their bump type (use "major" because errors.raw/errors.global now accept
null), and add a short summary sentence describing the breaking change (mention
errors.raw/errors.global allowing null and recommended migration notes). Ensure
the file has the standard three-dash delimiters, a "packages:" mapping with the
package names and "major" as the bump, and a non-empty body paragraph explaining
the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's verify if an empty changeset is appropriate.
@@ -52,30 +52,38 @@ function errorsToParsedErrors(error: unknown): Errors { | |||
captcha: null, | |||
legalAccepted: null, | |||
}, | |||
raw: [], | |||
global: [], | |||
raw: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hate that this is the case, but we need to update the default errors in the state proxy in clerk-react as well 😭
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
Ill try to prioritize some tests to catch these sooner and a (potential) refactor later. Fixing...
e644e1f
to
72f1c15
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/react/src/stateProxy.ts (1)
7-22
: Usesatisfies Errors
to catch drift without wideningValidates the object literal against
Errors
while keeping precise literal types; future field additions will surface here at compile time.-const defaultErrors = (): Errors => ({ - fields: { - firstName: null, - lastName: null, - emailAddress: null, - identifier: null, - phoneNumber: null, - password: null, - username: null, - code: null, - captcha: null, - legalAccepted: null, - }, - raw: null, - global: null, -}); +const defaultErrors = (): Errors => { + const e = { + fields: { + firstName: null, + lastName: null, + emailAddress: null, + identifier: null, + phoneNumber: null, + password: null, + username: null, + code: null, + captcha: null, + legalAccepted: null, + }, + raw: null, + global: null, + } satisfies Errors; + return e; +};
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
packages/react/src/stateProxy.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
**/*.{js,jsx,ts,tsx}
: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels
Files:
packages/react/src/stateProxy.ts
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use Prettier for consistent code formatting
Files:
packages/react/src/stateProxy.ts
packages/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
TypeScript is required for all packages
Files:
packages/react/src/stateProxy.ts
packages/**/*.{ts,tsx,d.ts}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Packages should export TypeScript types alongside runtime code
Files:
packages/react/src/stateProxy.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use proper TypeScript error types
**/*.{ts,tsx}
: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoidany
type - preferunknown
when type is uncertain, then narrow with type guards
Useinterface
for object shapes that might be extended
Usetype
for unions, primitives, and computed types
Preferreadonly
properties for immutable data structures
Useprivate
for internal implementation details
Useprotected
for inheritance hierarchies
Usepublic
explicitly for clarity in public APIs
Preferreadonly
for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Useconst assertions
for literal types:as const
Usesatisfies
operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports:import type { ... } from ...
Noany
types without justification
Proper error handling with typed errors
Consistent use ofreadonly
for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)
Files:
packages/react/src/stateProxy.ts
**/*.{js,ts,tsx,jsx}
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.
Files:
packages/react/src/stateProxy.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
packages/react/src/stateProxy.ts (1)
20-21
: Confirm no length-based checks on nullable errors
Search across the codebase returned no occurrences oferrors.global.length
orerrors.raw.length
, so defaulting these to null aligns with the updated Errors contract. Please manually audit any call sites to ensure none assume these properties are always arrays.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.changeset/smart-seas-breathe.md (1)
6-7
: Remove stray character and add a succinct migration note.There’s an orphan “7” rendered in the release notes. Also, consider adding a one‑line migration cue.
-Update the experimental `Errors` interface to allow null for raw and global error arrays -7 +Update the experimental `Errors` interface to allow null for `raw` and `global` error arrays. + +Migration (experimental): check for presence before indexing, e.g.: +if (errors.global) { render(errors.global[0].message) }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.changeset/smart-seas-breathe.md
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/**
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Automated releases must use Changesets.
Files:
.changeset/smart-seas-breathe.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (17)
- GitHub Check: Integration Tests (billing, chrome)
- GitHub Check: Integration Tests (nuxt, chrome)
- GitHub Check: Integration Tests (sessions, chrome)
- GitHub Check: Integration Tests (tanstack-react-router, chrome)
- GitHub Check: Integration Tests (generic, chrome)
- GitHub Check: Integration Tests (quickstart, chrome)
- GitHub Check: Integration Tests (express, chrome)
- GitHub Check: Integration Tests (localhost, chrome)
- GitHub Check: Integration Tests (expo-web, chrome)
- GitHub Check: Unit Tests (22, **)
- GitHub Check: Publish with pkg-pr-new
- GitHub Check: Static analysis
- GitHub Check: Formatting | Dedupe | Changeset
- GitHub Check: semgrep/ci
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
.changeset/smart-seas-breathe.md (1)
2-3
: Confirm semver level (nullable type can be breaking for TS consumers).Widening
Errors.raw/global
toT[] | null
may break code that assumed arrays. If the interface is truly experimental and excluded from semver guarantees, patch is fine; otherwise consider minor/major or at least call out “BREAKING (experimental)” in the note.
--- | ||
"@clerk/clerk-js": patch | ||
"@clerk/types": patch | ||
--- | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Changeset likely missing affected React package.
PR modifies packages/react/src/stateProxy.ts but this changeset only bumps @clerk/clerk-js and @clerk/types. If React package code changed, include it here so it’s released together.
Run to verify and catch omissions:
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Detect React package name (if present)
react_pkg="$(jq -r '.name' packages/react/package.json 2>/dev/null || true)"
if [[ -n "${react_pkg}" && "${react_pkg}" != "null" ]]; then
echo "Detected React package: ${react_pkg}"
# Check if included in any changeset file
if ! rg -n --fixed-strings --glob '.changeset/*.md' "\"${react_pkg}\":" >/dev/null; then
echo "ERROR: ${react_pkg} not listed in any changeset file."
echo "Add a '${react_pkg}: patch' entry to this changeset."
exit 1
else
echo "OK: ${react_pkg} is included in a changeset."
fi
else
echo "No packages/react/package.json found; skip."
fi
Length of output: 750
Add missing changeset entry for the React package
packages/react/src/stateProxy.ts
was updated, but the changeset .changeset/smart-seas-breathe.md
only lists @clerk/clerk-js
and @clerk/types
. Add
"@clerk/clerk-react": patch
to that file so the React package is released together.
🤖 Prompt for AI Agents
.changeset/smart-seas-breathe.md lines 1-5: the changeset currently only lists
"@clerk/clerk-js" and "@clerk/types" but the React package was changed; update
the file to also include the React package by adding the entry
"\"@clerk/clerk-react\": patch" so the React package is included in the release
alongside the others.
Description
errors.global
can now be used without checking for the.length
property:Checklist
pnpm test
runs as expected.pnpm build
runs as expected.Type of change
Summary by CodeRabbit
Bug Fixes
Refactor