Skip to content

Commit df16d8d

Browse files
authored
feat(*): Change name to @clerk/react (#6911)
1 parent 67a6d8a commit df16d8d

File tree

130 files changed

+249
-237
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+249
-237
lines changed

.changeset/strong-bars-learn.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@clerk/chrome-extension': patch
3+
'@clerk/elements': patch
4+
'@clerk/clerk-expo': patch
5+
'@clerk/nextjs': patch
6+
'@clerk/react-router': patch
7+
'@clerk/tanstack-react-start': patch
8+
---
9+
10+
Use new `@clerk/react` package.

.changeset/tame-suits-try.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/react': major
3+
---
4+
5+
Change package name to `@clerk/react`.

.cursor/rules/monorepo.mdc

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description:
3-
globs:
2+
description:
3+
globs:
44
alwaysApply: true
55
---
6+
67
Monorepo Architecture and Structure
78

89
Repository Overview
10+
911
- This is the official Clerk JavaScript SDK monorepo containing all Clerk authentication packages
1012
- Clerk provides streamlined user experiences for sign up, sign in, and profile management
1113
- All packages are published under the @clerk namespace on npm
1214
- Uses pnpm as the package manager with Turbo for build orchestration
1315
- Supports multiple JavaScript frameworks and environments
1416

1517
Core Package Categories
18+
1619
- **Core SDK**: `@clerk/clerk-js` - Core browser SDK with UI components
1720
- **Framework Integrations**: Next.js, React, Vue, Astro, Nuxt, Remix, Express, Fastify
1821
- **Platform Support**: Expo (React Native), Chrome Extension
@@ -23,6 +26,7 @@ Core Package Categories
2326
- **Specialized**: `@clerk/agent-toolkit` - AI agent integration tools
2427

2528
Directory Structure
29+
2630
- `packages/` - All publishable packages
2731
- `integration/` - End-to-end tests and integration templates
2832
- `playground/` - Development and testing applications
@@ -31,6 +35,7 @@ Directory Structure
3135
- `tools/` - Internal development tools
3236

3337
Development Workflow
38+
3439
- Use `pnpm dev` to start development mode for all packages
3540
- Use `pnpm build` to build all packages
3641
- Use `pnpm test` to run unit tests across all packages
@@ -39,8 +44,9 @@ Development Workflow
3944
- Changesets for version management and release automation
4045

4146
Framework-Specific Packages
47+
4248
- `@clerk/nextjs` - Next.js App Router and Pages Router support
43-
- `@clerk/clerk-react` - React hooks and components
49+
- `@clerk/react` - React hooks and components
4450
- `@clerk/vue` - Vue.js composables and components
4551
- `@clerk/astro` - Astro integration with SSR support
4652
- `@clerk/nuxt` - Nuxt.js module
@@ -50,6 +56,7 @@ Framework-Specific Packages
5056
- `@clerk/expo` - React Native/Expo SDK
5157

5258
Testing Architecture
59+
5360
- Unit tests with Jest and Vitest
5461
- Integration tests with Playwright
5562
- Component testing with React Testing Library
@@ -58,6 +65,7 @@ Testing Architecture
5865
- Separate test configurations per framework
5966

6067
Build System
68+
6169
- Turbo for monorepo orchestration and caching
6270
- tsup for TypeScript compilation and bundling
6371
- ESLint with custom configurations for different package types
@@ -66,26 +74,30 @@ Build System
6674
- Type checking with TypeScript and publint
6775

6876
Environment Configuration
69-
- Supports multiple Clerk environment variables (CLERK_*, NEXT_PUBLIC_CLERK_*, etc.)
77+
78+
- Supports multiple Clerk environment variables (CLERK*\*, NEXT_PUBLIC_CLERK*\*, etc.)
7079
- Development, staging, and production configurations
7180
- Verdaccio for local npm registry testing
7281
- Docker support for integration testing
7382
- CI/CD with GitHub Actions
7483

7584
Localization Support
85+
7686
- `packages/localizations/` contains translations for 30+ languages
7787
- Modular localization system allowing partial imports
7888
- Support for RTL languages
7989
- Framework-agnostic translation utilities
8090

8191
Package Interdependency Rules
92+
8293
- `@clerk/shared` is a common dependency for most packages
8394
- `@clerk/types` provides TypeScript definitions used across packages
8495
- `@clerk/backend` is independent and used for server-side operations
8596
- Framework packages depend on `@clerk/clerk-js` for core functionality
8697
- Integration packages build upon framework-specific packages
8798

8899
Release Management
100+
89101
- Automated releases with Changesets
90102
- Semantic versioning across all packages
91103
- Canary and snapshot releases for testing

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ jobs:
209209
matrix:
210210
include:
211211
- node-version: 20
212-
test-filter: '--filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@clerk/nextjs --filter=@clerk/clerk-react --filter=@clerk/shared --filter=@clerk/remix --filter=@clerk/tanstack-react-start --filter=@clerk/elements --filter=@clerk/vue --filter=@clerk/nuxt --filter=@clerk/clerk-expo'
212+
test-filter: '--filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@clerk/nextjs --filter=@clerk/react --filter=@clerk/shared --filter=@clerk/remix --filter=@clerk/tanstack-react-start --filter=@clerk/elements --filter=@clerk/vue --filter=@clerk/nuxt --filter=@clerk/clerk-expo'
213213
- node-version: 22
214214
test-filter: '**'
215215

.typedoc/__tests__/__snapshots__/file-structure.test.ts.snap

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,30 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = `
199199
"shared/use-user.mdx",
200200
"shared/user-agent-is-robot.mdx",
201201
"shared/version-selector.mdx",
202+
"react/api-keys.mdx",
203+
"react/checkout-button-props.mdx",
204+
"react/checkout-button.mdx",
205+
"react/clerk-provider-props.mdx",
206+
"react/plan-details-button-props.mdx",
207+
"react/plan-details-button.mdx",
208+
"react/protect.mdx",
209+
"react/redirect-to-create-organization.mdx",
210+
"react/redirect-to-organization-profile.mdx",
211+
"react/redirect-to-user-profile.mdx",
212+
"react/subscription-details-button-props.mdx",
213+
"react/subscription-details-button.mdx",
214+
"react/use-auth.mdx",
215+
"react/use-clerk.mdx",
216+
"react/use-organization-list.mdx",
217+
"react/use-organization.mdx",
218+
"react/use-reverification.mdx",
219+
"react/use-session-list.mdx",
220+
"react/use-session.mdx",
221+
"react/use-sign-in-signal.mdx",
222+
"react/use-sign-in.mdx",
223+
"react/use-sign-up-signal.mdx",
224+
"react/use-sign-up.mdx",
225+
"react/use-user.mdx",
202226
"nextjs/auth.mdx",
203227
"nextjs/build-clerk-props.mdx",
204228
"nextjs/clerk-middleware-auth-object.mdx",
@@ -208,30 +232,6 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = `
208232
"nextjs/create-sync-get-auth.mdx",
209233
"nextjs/current-user.mdx",
210234
"nextjs/get-auth.mdx",
211-
"clerk-react/api-keys.mdx",
212-
"clerk-react/checkout-button-props.mdx",
213-
"clerk-react/checkout-button.mdx",
214-
"clerk-react/clerk-provider-props.mdx",
215-
"clerk-react/plan-details-button-props.mdx",
216-
"clerk-react/plan-details-button.mdx",
217-
"clerk-react/protect.mdx",
218-
"clerk-react/redirect-to-create-organization.mdx",
219-
"clerk-react/redirect-to-organization-profile.mdx",
220-
"clerk-react/redirect-to-user-profile.mdx",
221-
"clerk-react/subscription-details-button-props.mdx",
222-
"clerk-react/subscription-details-button.mdx",
223-
"clerk-react/use-auth.mdx",
224-
"clerk-react/use-clerk.mdx",
225-
"clerk-react/use-organization-list.mdx",
226-
"clerk-react/use-organization.mdx",
227-
"clerk-react/use-reverification.mdx",
228-
"clerk-react/use-session-list.mdx",
229-
"clerk-react/use-session.mdx",
230-
"clerk-react/use-sign-in-signal.mdx",
231-
"clerk-react/use-sign-in.mdx",
232-
"clerk-react/use-sign-up-signal.mdx",
233-
"clerk-react/use-sign-up.mdx",
234-
"clerk-react/use-user.mdx",
235235
"backend/allowlist-identifier.mdx",
236236
"backend/auth-object.mdx",
237237
"backend/authenticate-request-options.mdx",

.typedoc/__tests__/file-structure.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ describe('Typedoc output', () => {
3333
expect(folders).toMatchInlineSnapshot(`
3434
[
3535
"backend",
36-
"clerk-react",
3736
"nextjs",
37+
"react",
3838
"shared",
3939
"types",
4040
]

docs/CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ All packages of the monorepo are inside [packages](../packages). For package spe
4444

4545
- [`@clerk/backend`](../packages/backend): Functionalities regarded as "core" for Clerk to operate with. _Authentication resolution, API Resources etc._
4646
- [`@clerk/clerk-js`](../packages/clerk-js): Core JavaScript implementation used by Clerk in the browser.
47-
- [`@clerk/clerk-react`](../packages/react) Clerk package for React applications.
47+
- [`@clerk/react`](../packages/react) Clerk package for React applications.
4848
- [`@clerk/types`](../packages/types): Main TypeScript typings for Clerk libraries.
4949
- Browse [packages](../packages) to see more
5050

@@ -186,10 +186,10 @@ To review your changes locally, you can run `pnpm run typedoc:generate` to gener
186186

187187
Create a PR that includes your changes to any Typedoc comments. Once the PR has been merged and a release is published, a PR will [automatically](https://github.com/clerk/clerk-docs/blob/main/.github/workflows/typedoc.yml) be opened in `clerk-docs` to merge in the Typedoc changes.
188188

189-
Typedoc output is embedded in `clerk-docs` files with the `<Typedoc />` component. For example, if you updated Typedoc comments for the `useAuth()` hook in `clerk/javascript`, you'll need to make sure that in `clerk-docs`, in the `/hooks/use-auth.mdx` file, there's a `<Typedoc />` component linked to the `./clerk-typedoc/clerk-react/use-auth.mdx` file, like:
189+
Typedoc output is embedded in `clerk-docs` files with the `<Typedoc />` component. For example, if you updated Typedoc comments for the `useAuth()` hook in `clerk/javascript`, you'll need to make sure that in `clerk-docs`, in the `/hooks/use-auth.mdx` file, there's a `<Typedoc />` component linked to the `./clerk-typedoc/react/use-auth.mdx` file, like:
190190

191191
```mdx
192-
<Typedoc src='clerk-react/use-auth' />
192+
<Typedoc src='react/use-auth' />
193193
```
194194

195195
Read more about this in the [`clerk-docs` CONTRIBUTING.md](https://github.com/clerk/clerk-docs/blob/main/CONTRIBUTING.md#typedoc-).

integration/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ Assuming you have a `react-parcel` template defined in `integration/templates`,
364364
.setName('react-parcel')
365365
.useTemplate(templates['react-parcel'])
366366
.setEnvFormatter('public', key => `${key}`)
367-
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || clerkReactLocal);
367+
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || clerkReactLocal);
368368
```
369369
370370
Here's what each thing is doing:

integration/presets/custom-flows.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const reactVite = applicationConfig()
1111
.addScript('dev', 'pnpm dev')
1212
.addScript('build', 'pnpm build')
1313
.addScript('serve', 'pnpm preview')
14-
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || linkPackage('react'))
14+
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || linkPackage('react'))
1515
.addDependency('@clerk/themes', constants.E2E_CLERK_VERSION || linkPackage('themes'));
1616

1717
export const customFlows = {

integration/presets/react.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const cra = applicationConfig()
1111
.addScript('dev', 'pnpm start')
1212
.addScript('build', 'pnpm build')
1313
.addScript('serve', 'pnpm start')
14-
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || linkPackage('react'))
14+
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || linkPackage('react'))
1515
.addDependency('@clerk/themes', constants.E2E_CLERK_VERSION || linkPackage('themes'));
1616

1717
const vite = cra

0 commit comments

Comments
 (0)