Skip to content

Commit 8ab9fe7

Browse files
authored
Merge branch 'main' into ss/DOCS-10983
2 parents f5a92f9 + d64638d commit 8ab9fe7

File tree

164 files changed

+3192
-1038
lines changed

Some content is hidden

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

164 files changed

+3192
-1038
lines changed

.changeset/afraid-papers-see.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@clerk/localizations': patch
3+
---
4+
5+
Improve Korean (ko-KR) localization by translating missing strings
6+
7+
- Translated undefined values to Korean

.changeset/fuzzy-keys-smell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/shared': patch
3+
---
4+
5+
Build internal variants of all paginated hooks that use React Query instead of SWR.

.changeset/honest-pears-play.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@clerk/clerk-react": patch
3+
"@clerk/vue": patch
4+
"@clerk/astro": patch
5+
---
6+
7+
Fixed missing API keys props within `<UserButton />`

.changeset/ripe-ants-carry.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

.changeset/ripe-banks-pay.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.changeset/shaggy-numbers-attack.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.cursor/rules/monorepo.mdc

Lines changed: 18 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,6 +44,7 @@ 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
4349
- `@clerk/clerk-react` - React hooks and components
4450
- `@clerk/vue` - Vue.js composables and components
@@ -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,32 @@ 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
83-
- `@clerk/types` provides TypeScript definitions used across packages
94+
- `@clerk/shared/types` provides TypeScript definitions used across packages
95+
- `@clerk/types` is an alias for `@clerk/shared/types`, but its usage is deprecated. Prefer using `@clerk/shared/types`.
96+
- If a TypeScript error comes from a type imported from `@clerk/shared/types`, run `turbo build --filter=@clerk/shared --filter=@clerk/types` to make sure the latest version of the packages are being used.
8497
- `@clerk/backend` is independent and used for server-side operations
8598
- Framework packages depend on `@clerk/clerk-js` for core functionality
8699
- Integration packages build upon framework-specific packages
87100

88101
Release Management
102+
89103
- Automated releases with Changesets
90104
- Semantic versioning across all packages
91105
- Canary and snapshot releases for testing

.github/workflows/ci.yml

Lines changed: 53 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ jobs:
191191
unit-tests:
192192
needs: [check-permissions, build-packages]
193193
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
194-
name: Unit Tests
194+
name: Unit Tests (${{ matrix.node-version }}, ${{ matrix.filter-label }}${{ matrix.clerk-use-rq == 'true' && ', RQ' || '' }})
195195
permissions:
196196
contents: read
197197
actions: write # needed for actions/upload-artifact
@@ -205,11 +205,17 @@ jobs:
205205
TURBO_SUMMARIZE: false
206206

207207
strategy:
208-
fail-fast: true
208+
fail-fast: false
209209
matrix:
210210
include:
211211
- node-version: 22
212212
test-filter: "**"
213+
clerk-use-rq: "false"
214+
filter-label: "**"
215+
- node-version: 22
216+
test-filter: "--filter=@clerk/shared --filter=@clerk/clerk-js"
217+
clerk-use-rq: "true"
218+
filter-label: "shared, clerk-js"
213219

214220
steps:
215221
- name: Checkout Repo
@@ -229,22 +235,35 @@ jobs:
229235
turbo-team: ${{ vars.TURBO_TEAM }}
230236
turbo-token: ${{ secrets.TURBO_TOKEN }}
231237

238+
- name: Rebuild @clerk/shared with CLERK_USE_RQ=true
239+
if: ${{ matrix.clerk-use-rq == 'true' }}
240+
run: pnpm turbo build $TURBO_ARGS --filter=@clerk/shared --force
241+
env:
242+
CLERK_USE_RQ: true
243+
244+
- name: Rebuild dependent packages with CLERK_USE_RQ=true
245+
if: ${{ matrix.clerk-use-rq == 'true' }}
246+
run: pnpm turbo build $TURBO_ARGS --filter=@clerk/shared^... --force
247+
env:
248+
CLERK_USE_RQ: true
249+
232250
- name: Run tests in packages
233251
run: |
234252
if [ "${{ matrix.test-filter }}" = "**" ]; then
235-
echo "Running full test suite on Node ${{ matrix.node-version }}."
253+
echo "Running full test suite on Node ${{ matrix.node-version }}"
236254
pnpm turbo test $TURBO_ARGS
237255
else
238-
echo "Running LTS subset on Node ${{ matrix.node-version }}."
256+
echo "Running tests: ${{ matrix.filter-label }}"
239257
pnpm turbo test $TURBO_ARGS ${{ matrix.test-filter }}
240258
fi
241259
env:
242260
NODE_VERSION: ${{ matrix.node-version }}
261+
CLERK_USE_RQ: ${{ matrix.clerk-use-rq }}
243262

244263
- name: Run Typedoc tests
245264
run: |
246-
# Only run Typedoc tests for one matrix version
247-
if [ "${{ matrix.node-version }}" == "22" ]; then
265+
# Only run Typedoc tests for one matrix version and main test run
266+
if [ "${{ matrix.node-version }}" == "22" ] && [ "${{ matrix.test-filter }}" = "**" ]; then
248267
pnpm test:typedoc
249268
fi
250269
env:
@@ -255,14 +274,14 @@ jobs:
255274
if: ${{ env.TURBO_SUMMARIZE == 'true' }}
256275
continue-on-error: true
257276
with:
258-
name: turbo-summary-report-unit-${{ github.run_id }}-${{ github.run_attempt }}-node-${{ matrix.node-version }}
277+
name: turbo-summary-report-unit-${{ github.run_id }}-${{ github.run_attempt }}-node-${{ matrix.node-version }}${{ matrix.clerk-use-rq == 'true' && '-rq' || '' }}
259278
path: .turbo/runs
260279
retention-days: 5
261280

262281
integration-tests:
263282
needs: [check-permissions, build-packages]
264283
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
265-
name: Integration Tests
284+
name: Integration Tests (${{ matrix.test-name }}, ${{ matrix.test-project }}${{ matrix.next-version && format(', {0}', matrix.next-version) || '' }}${{ matrix.clerk-use-rq == 'true' && ', RQ' || '' }})
266285
permissions:
267286
contents: read
268287
actions: write # needed for actions/upload-artifact
@@ -291,18 +310,28 @@ jobs:
291310
'vue',
292311
'nuxt',
293312
'react-router',
294-
'billing',
295313
'machine',
296314
'custom',
297315
]
298316
test-project: ["chrome"]
299317
include:
318+
- test-name: 'billing'
319+
test-project: 'chrome'
320+
clerk-use-rq: 'false'
321+
- test-name: 'billing'
322+
test-project: 'chrome'
323+
clerk-use-rq: 'true'
300324
- test-name: 'nextjs'
301325
test-project: 'chrome'
302326
next-version: '14'
303327
- test-name: 'nextjs'
304328
test-project: 'chrome'
305329
next-version: '15'
330+
clerk-use-rq: 'false'
331+
- test-name: 'nextjs'
332+
test-project: 'chrome'
333+
next-version: '15'
334+
clerk-use-rq: 'true'
306335
- test-name: 'nextjs'
307336
test-project: 'chrome'
308337
next-version: '16'
@@ -360,12 +389,24 @@ jobs:
360389
echo "affected=${AFFECTED}"
361390
echo "affected=${AFFECTED}" >> $GITHUB_OUTPUT
362391
392+
- name: Rebuild @clerk/shared with CLERK_USE_RQ=true
393+
if: ${{ steps.task-status.outputs.affected == '1' && matrix.clerk-use-rq == 'true' }}
394+
run: pnpm turbo build $TURBO_ARGS --filter=@clerk/shared --force
395+
env:
396+
CLERK_USE_RQ: true
397+
398+
- name: Rebuild dependent packages with CLERK_USE_RQ=true
399+
if: ${{ steps.task-status.outputs.affected == '1' && matrix.clerk-use-rq == 'true' }}
400+
run: pnpm turbo build $TURBO_ARGS --filter=@clerk/shared^... --force
401+
env:
402+
CLERK_USE_RQ: true
403+
363404
- name: Verdaccio
364405
if: ${{ steps.task-status.outputs.affected == '1' }}
365406
uses: ./.github/actions/verdaccio
366407
with:
367408
publish-cmd: |
368-
if [ "$(pnpm config get registry)" = "https://registry.npmjs.org/" ]; then echo 'Error: Using default registry' && exit 1; else pnpm turbo build $TURBO_ARGS --only && pnpm changeset publish --no-git-tag; fi
409+
if [ "$(pnpm config get registry)" = "https://registry.npmjs.org/" ]; then echo 'Error: Using default registry' && exit 1; else CLERK_USE_RQ=${{ matrix.clerk-use-rq }} pnpm turbo build $TURBO_ARGS --only && pnpm changeset publish --no-git-tag; fi
369410
370411
- name: Edit .npmrc [link-workspace-packages=false]
371412
run: sed -i -E 's/link-workspace-packages=(deep|true)/link-workspace-packages=false/' .npmrc
@@ -425,6 +466,7 @@ jobs:
425466
E2E_NEXTJS_VERSION: ${{ matrix.next-version }}
426467
E2E_PROJECT: ${{ matrix.test-project }}
427468
E2E_CLERK_ENCRYPTION_KEY: ${{ matrix.clerk-encryption-key }}
469+
CLERK_USE_RQ: ${{ matrix.clerk-use-rq }}
428470
INTEGRATION_INSTANCE_KEYS: ${{ secrets.INTEGRATION_INSTANCE_KEYS }}
429471
MAILSAC_API_KEY: ${{ secrets.MAILSAC_API_KEY }}
430472
NODE_EXTRA_CA_CERTS: ${{ github.workspace }}/integration/certs/rootCA.pem
@@ -433,7 +475,7 @@ jobs:
433475
if: ${{ cancelled() || failure() }}
434476
uses: actions/upload-artifact@v4
435477
with:
436-
name: playwright-traces-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.test-name }}
478+
name: playwright-traces-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.test-name }}${{ matrix.next-version && format('-next{0}', matrix.next-version) || '' }}${{ matrix.clerk-use-rq == 'true' && '-rq' || '' }}
437479
path: integration/test-results
438480
retention-days: 1
439481

integration/testUtils/usersService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export const createUserService = (clerkClient: ClerkClient) => {
200200

201201
const apiKey = await clerkClient.apiKeys.create({
202202
subject: userId,
203-
name: `Integration Test - ${userId}`,
203+
name: `Integration Test - ${faker.string.uuid()}`,
204204
secondsUntilExpiration: TWENTY_MINUTES,
205205
});
206206

0 commit comments

Comments
 (0)