Skip to content

Commit

Permalink
Merge branch 'main' into elef/e2e-middleware-placement
Browse files Browse the repository at this point in the history
  • Loading branch information
panteliselef authored Jan 30, 2025
2 parents 70c6699 + 26225f2 commit 02e2780
Show file tree
Hide file tree
Showing 67 changed files with 344 additions and 118 deletions.
2 changes: 0 additions & 2 deletions .changeset/angry-crabs-arrive.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/brown-jeans-search.md

This file was deleted.

13 changes: 13 additions & 0 deletions .changeset/brown-suns-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"@clerk/astro": patch
"@clerk/nextjs": patch
"@clerk/shared": patch
---

Previously the `createPathMatcher()` function was re-implemented both in `@clerk/astro` and `@clerk/nextjs`, this PR moves this logic to `@clerk/shared`.

You can use it like so:

```ts
import { createPathMatcher } from '@clerk/shared/pathMatcher'
```
5 changes: 0 additions & 5 deletions .changeset/clever-crabs-smell.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/cool-teachers-join.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/cyan-kids-boil.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/early-apples-return.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/eighty-beds-behave.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/eleven-pants-juggle.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/fuzzy-ghosts-kneel.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/kind-crabs-unite.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/nasty-houses-boil.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/new-adults-admire.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/nine-ears-jump.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/silent-ducks-wait.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/stale-badgers-scream.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/weak-phones-retire.md

This file was deleted.

9 changes: 9 additions & 0 deletions packages/astro/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @clerk/astro

## 2.1.17

### Patch Changes

- Updated dependencies [[`a309be354275b91a7b17d5a67e8ef6aa230a9935`](https://github.com/clerk/javascript/commit/a309be354275b91a7b17d5a67e8ef6aa230a9935), [`4773d0ad4ed27928fa53357906c0f3a349b9f871`](https://github.com/clerk/javascript/commit/4773d0ad4ed27928fa53357906c0f3a349b9f871), [`1345cb487970a7347351897e80dfb829d85c41ea`](https://github.com/clerk/javascript/commit/1345cb487970a7347351897e80dfb829d85c41ea)]:
- @clerk/shared@2.20.16
- @clerk/backend@1.23.9
- @clerk/types@4.44.2

## 2.1.16

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clerk/astro",
"version": "2.1.16",
"version": "2.1.17",
"description": "Clerk SDK for Astro",
"keywords": [
"auth",
Expand Down
19 changes: 4 additions & 15 deletions packages/astro/src/server/route-matcher.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import { pathToRegexp } from '@clerk/shared/pathToRegexp';
import type { Autocomplete } from '@clerk/types';
import { createPathMatcher, type PathMatcherParam } from '@clerk/shared/pathMatcher';

type WithPathPatternWildcard<T = string> = `${T & string}(.*)`;
export type RouteMatcherParam = PathMatcherParam;

type RouteMatcherRoutes = Autocomplete<WithPathPatternWildcard>;

export type RouteMatcherParam = Array<RegExp | RouteMatcherRoutes> | RegExp | RouteMatcherRoutes;

// TODO-SHARED: This can be moved to @clerk/shared as an identical implementation exists in @clerk/nextjs
/**
* Returns a function that accepts a `Request` object and returns whether the request matches the list of
* predefined routes that can be passed in as the first argument.
Expand All @@ -17,11 +11,6 @@ export type RouteMatcherParam = Array<RegExp | RouteMatcherRoutes> | RegExp | Ro
* For more information, see: https://clerk.com/docs
*/
export const createRouteMatcher = (routes: RouteMatcherParam) => {
const routePatterns = [routes || ''].flat().filter(Boolean);
const matchers = precomputePathRegex(routePatterns);
return (req: Request) => matchers.some(matcher => matcher.test(new URL(req.url).pathname));
};

const precomputePathRegex = (patterns: Array<string | RegExp>) => {
return patterns.map(pattern => (pattern instanceof RegExp ? pattern : pathToRegexp(pattern)));
const matcher = createPathMatcher(routes);
return (req: Request) => matcher(new URL(req.url).pathname);
};
10 changes: 10 additions & 0 deletions packages/backend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Change Log

## 1.23.9

### Patch Changes

- Mark keyless onboarding as complete when stored keys match explicit keys ([#4971](https://github.com/clerk/javascript/pull/4971)) by [@panteliselef](https://github.com/panteliselef)

- Updated dependencies [[`a309be354275b91a7b17d5a67e8ef6aa230a9935`](https://github.com/clerk/javascript/commit/a309be354275b91a7b17d5a67e8ef6aa230a9935), [`1345cb487970a7347351897e80dfb829d85c41ea`](https://github.com/clerk/javascript/commit/1345cb487970a7347351897e80dfb829d85c41ea)]:
- @clerk/shared@2.20.16
- @clerk/types@4.44.2

## 1.23.8

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clerk/backend",
"version": "1.23.8",
"version": "1.23.9",
"description": "Clerk Backend SDK - REST Client for Backend API & JWT verification utilities",
"homepage": "https://clerk.com/",
"bugs": {
Expand Down
9 changes: 9 additions & 0 deletions packages/chrome-extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change Log

## 2.2.3

### Patch Changes

- Updated dependencies [[`a309be354275b91a7b17d5a67e8ef6aa230a9935`](https://github.com/clerk/javascript/commit/a309be354275b91a7b17d5a67e8ef6aa230a9935), [`cf23178c8b6829e99cb4756a0f2b51e94425e00a`](https://github.com/clerk/javascript/commit/cf23178c8b6829e99cb4756a0f2b51e94425e00a), [`8dc2e63aa37f453f9161c5701d8c4916f13adc3f`](https://github.com/clerk/javascript/commit/8dc2e63aa37f453f9161c5701d8c4916f13adc3f), [`02ec26a67f9b1a9b679f7b4f302b569632818e0f`](https://github.com/clerk/javascript/commit/02ec26a67f9b1a9b679f7b4f302b569632818e0f), [`1aa5bb6e2abf45121274e072bd5e5bbbd73a7362`](https://github.com/clerk/javascript/commit/1aa5bb6e2abf45121274e072bd5e5bbbd73a7362), [`1345cb487970a7347351897e80dfb829d85c41ea`](https://github.com/clerk/javascript/commit/1345cb487970a7347351897e80dfb829d85c41ea), [`65f313abadece443122f6193d28d2d6795236927`](https://github.com/clerk/javascript/commit/65f313abadece443122f6193d28d2d6795236927), [`fa7e40c1cb5a2984e8eceb37e4117c6e58064975`](https://github.com/clerk/javascript/commit/fa7e40c1cb5a2984e8eceb37e4117c6e58064975)]:
- @clerk/shared@2.20.16
- @clerk/clerk-js@5.50.1
- @clerk/clerk-react@5.22.8

## 2.2.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/chrome-extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clerk/chrome-extension",
"version": "2.2.2",
"version": "2.2.3",
"description": "Clerk SDK for Chrome extensions",
"keywords": [
"auth",
Expand Down
23 changes: 23 additions & 0 deletions packages/clerk-js/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Change Log

## 5.50.1

### Patch Changes

- Removes Turnstile remotely-hosted code from builds for unsupported environments ([#5039](https://github.com/clerk/javascript/pull/5039)) by [@tmilewski](https://github.com/tmilewski)

- Opt out of combined flow when sign up mode is restricted. ([#5020](https://github.com/clerk/javascript/pull/5020)) by [@alexcarpenter](https://github.com/alexcarpenter)

- Use a cookie instead of localStorage for the active org ID to avoid issues when localStorage is disabled at the browser level. ([#4394](https://github.com/clerk/javascript/pull/4394)) by [@brkalow](https://github.com/brkalow)

- Removes web3 provider options from progressive sign up step. web3 providers don't have the ability to fill in missing fields. ([#5036](https://github.com/clerk/javascript/pull/5036)) by [@alexcarpenter](https://github.com/alexcarpenter)

- Remove `'virtual'` from the `routing` option. The `'virtual'` value is only used internally and should not be part of the public API. ([#4977](https://github.com/clerk/javascript/pull/4977)) by [@alexcarpenter](https://github.com/alexcarpenter)

- Do not throw error on `captchaHeartbeat` if `displayConfig` is `null`. ([#5032](https://github.com/clerk/javascript/pull/5032)) by [@jacekradko](https://github.com/jacekradko)

- Pass the `signInUrl` throught to the sign up context when within the combined flow. ([#5042](https://github.com/clerk/javascript/pull/5042)) by [@alexcarpenter](https://github.com/alexcarpenter)

- Updated dependencies [[`a309be354275b91a7b17d5a67e8ef6aa230a9935`](https://github.com/clerk/javascript/commit/a309be354275b91a7b17d5a67e8ef6aa230a9935), [`1345cb487970a7347351897e80dfb829d85c41ea`](https://github.com/clerk/javascript/commit/1345cb487970a7347351897e80dfb829d85c41ea)]:
- @clerk/[email protected]
- @clerk/[email protected]
- @clerk/[email protected]

## 5.50.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/clerk-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clerk/clerk-js",
"version": "5.50.0",
"version": "5.50.1",
"description": "Clerk JS library",
"keywords": [
"clerk",
Expand Down
1 change: 1 addition & 0 deletions packages/clerk-js/src/ui/components/SignIn/SignIn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ function SignInRoot() {
ssoCallbackUrl: signInContext.ssoCallbackUrl,
forceRedirectUrl: signInContext.signUpForceRedirectUrl,
fallbackRedirectUrl: signInContext.signUpFallbackRedirectUrl,
signInUrl: signInContext.signInUrl,
...normalizeRoutingOptions({ routing: signInContext?.routing, path: signInContext?.path }),
} as SignUpContextType;

Expand Down
9 changes: 9 additions & 0 deletions packages/elements/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @clerk/elements

## 0.22.17

### Patch Changes

- Updated dependencies [[`a309be354275b91a7b17d5a67e8ef6aa230a9935`](https://github.com/clerk/javascript/commit/a309be354275b91a7b17d5a67e8ef6aa230a9935), [`1345cb487970a7347351897e80dfb829d85c41ea`](https://github.com/clerk/javascript/commit/1345cb487970a7347351897e80dfb829d85c41ea)]:
- @clerk/shared@2.20.16
- @clerk/types@4.44.2
- @clerk/clerk-react@5.22.8

## 0.22.16

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/elements/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clerk/elements",
"version": "0.22.16",
"version": "0.22.17",
"description": "Clerk Elements",
"keywords": [
"clerk",
Expand Down
8 changes: 8 additions & 0 deletions packages/expo-passkeys/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @clerk/expo-passkeys

## 0.1.16

### Patch Changes

- Updated dependencies [[`a309be354275b91a7b17d5a67e8ef6aa230a9935`](https://github.com/clerk/javascript/commit/a309be354275b91a7b17d5a67e8ef6aa230a9935), [`1345cb487970a7347351897e80dfb829d85c41ea`](https://github.com/clerk/javascript/commit/1345cb487970a7347351897e80dfb829d85c41ea)]:
- @clerk/shared@2.20.16
- @clerk/types@4.44.2

## 0.1.15

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/expo-passkeys/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clerk/expo-passkeys",
"version": "0.1.15",
"version": "0.1.16",
"description": "Passkeys library to be used with Clerk for expo",
"keywords": [
"react-native",
Expand Down
10 changes: 10 additions & 0 deletions packages/expo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Change Log

## 2.7.1

### Patch Changes

- Updated dependencies [[`a309be354275b91a7b17d5a67e8ef6aa230a9935`](https://github.com/clerk/javascript/commit/a309be354275b91a7b17d5a67e8ef6aa230a9935), [`cf23178c8b6829e99cb4756a0f2b51e94425e00a`](https://github.com/clerk/javascript/commit/cf23178c8b6829e99cb4756a0f2b51e94425e00a), [`8dc2e63aa37f453f9161c5701d8c4916f13adc3f`](https://github.com/clerk/javascript/commit/8dc2e63aa37f453f9161c5701d8c4916f13adc3f), [`02ec26a67f9b1a9b679f7b4f302b569632818e0f`](https://github.com/clerk/javascript/commit/02ec26a67f9b1a9b679f7b4f302b569632818e0f), [`1aa5bb6e2abf45121274e072bd5e5bbbd73a7362`](https://github.com/clerk/javascript/commit/1aa5bb6e2abf45121274e072bd5e5bbbd73a7362), [`1345cb487970a7347351897e80dfb829d85c41ea`](https://github.com/clerk/javascript/commit/1345cb487970a7347351897e80dfb829d85c41ea), [`65f313abadece443122f6193d28d2d6795236927`](https://github.com/clerk/javascript/commit/65f313abadece443122f6193d28d2d6795236927), [`fa7e40c1cb5a2984e8eceb37e4117c6e58064975`](https://github.com/clerk/javascript/commit/fa7e40c1cb5a2984e8eceb37e4117c6e58064975)]:
- @clerk/[email protected]
- @clerk/[email protected]
- @clerk/[email protected]
- @clerk/[email protected]

## 2.7.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/expo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clerk/clerk-expo",
"version": "2.7.0",
"version": "2.7.1",
"description": "Clerk React Native/Expo library",
"keywords": [
"react",
Expand Down
9 changes: 9 additions & 0 deletions packages/express/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change Log

## 1.3.44

### Patch Changes

- Updated dependencies [[`a309be354275b91a7b17d5a67e8ef6aa230a9935`](https://github.com/clerk/javascript/commit/a309be354275b91a7b17d5a67e8ef6aa230a9935), [`4773d0ad4ed27928fa53357906c0f3a349b9f871`](https://github.com/clerk/javascript/commit/4773d0ad4ed27928fa53357906c0f3a349b9f871), [`1345cb487970a7347351897e80dfb829d85c41ea`](https://github.com/clerk/javascript/commit/1345cb487970a7347351897e80dfb829d85c41ea)]:
- @clerk/[email protected]
- @clerk/[email protected]
- @clerk/[email protected]

## 1.3.43

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/express/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clerk/express",
"version": "1.3.43",
"version": "1.3.44",
"description": "Clerk server SDK for usage with Express",
"keywords": [
"clerk",
Expand Down
9 changes: 9 additions & 0 deletions packages/fastify/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change Log

## 2.1.17

### Patch Changes

- Updated dependencies [[`a309be354275b91a7b17d5a67e8ef6aa230a9935`](https://github.com/clerk/javascript/commit/a309be354275b91a7b17d5a67e8ef6aa230a9935), [`4773d0ad4ed27928fa53357906c0f3a349b9f871`](https://github.com/clerk/javascript/commit/4773d0ad4ed27928fa53357906c0f3a349b9f871), [`1345cb487970a7347351897e80dfb829d85c41ea`](https://github.com/clerk/javascript/commit/1345cb487970a7347351897e80dfb829d85c41ea)]:
- @clerk/[email protected]
- @clerk/[email protected]
- @clerk/[email protected]

## 2.1.16

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/fastify/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clerk/fastify",
"version": "2.1.16",
"version": "2.1.17",
"description": "Clerk SDK for Fastify",
"keywords": [
"auth",
Expand Down
7 changes: 7 additions & 0 deletions packages/localizations/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## 3.10.2

### Patch Changes

- Updated dependencies [[`1345cb487970a7347351897e80dfb829d85c41ea`](https://github.com/clerk/javascript/commit/1345cb487970a7347351897e80dfb829d85c41ea)]:
- @clerk/[email protected]

## 3.10.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/localizations/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clerk/localizations",
"version": "3.10.1",
"version": "3.10.2",
"description": "Localizations for the Clerk components",
"keywords": [
"react",
Expand Down
Loading

0 comments on commit 02e2780

Please sign in to comment.