Skip to content

Commit a95fece

Browse files
authored
chore(repo): Update rules for types (#7196)
1 parent 67b98a9 commit a95fece

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

.changeset/wild-animals-call.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.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

0 commit comments

Comments
 (0)