Skip to content

Commit e2fc340

Browse files
authored
Merge branch 'main' into chris/supported_factors
2 parents 08b96da + ebc0f74 commit e2fc340

File tree

8 files changed

+50
-8
lines changed

8 files changed

+50
-8
lines changed

integration/tests/middleware-placement.test.ts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,31 @@ function parseSemverMajor(range?: string): number | undefined {
1515
return match ? Number.parseInt(match[0], 10) : undefined;
1616
}
1717

18-
async function detectNext(app: Application): Promise<{ isNext: boolean; version?: string }> {
18+
/**
19+
* Detects the installed Next.js version for a given application.
20+
* Reads the version from node_modules/next/package.json to ensure
21+
* we get the actual installed version rather than a tag like "latest" or "canary".
22+
*/
23+
async function detectNext(app: Application): Promise<{ version: string | undefined | null }> {
1924
// app.appDir exists for normal Application; for long-running apps, read it from the state file by serverUrl
2025
const appDir =
2126
(app as any).appDir ||
2227
Object.values(stateFile.getLongRunningApps() || {}).find(a => a.serverUrl === app.serverUrl)?.appDir;
2328

2429
if (!appDir) {
25-
return { isNext: false };
30+
return { version: null };
2631
}
2732

28-
const pkg = await fs.readJSON(path.join(appDir, 'package.json'));
29-
const nextRange: string | undefined = pkg.dependencies?.next || pkg.devDependencies?.next;
33+
let installedVersion: string | undefined;
34+
try {
35+
const nextPkg = await fs.readJSON(path.join(appDir, 'node_modules', 'next', 'package.json'));
36+
installedVersion = String(nextPkg?.version || '');
37+
} catch {
38+
// ignore
39+
}
3040

31-
return { isNext: Boolean(nextRange), version: nextRange };
41+
console.log('---detectNext---', installedVersion);
42+
return { version: installedVersion };
3243
}
3344

3445
const middlewareFileContents = `

packages/chrome-extension/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Change Log
22

3+
## 2.7.10
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [[`3410bc6`](https://github.com/clerk/javascript/commit/3410bc6f85d1d87c9ed35c9aa4ec764a684cc4ec)]:
8+
- @clerk/clerk-js@5.103.1
9+
310
## 2.7.9
411

512
### Patch Changes

packages/chrome-extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@clerk/chrome-extension",
3-
"version": "2.7.9",
3+
"version": "2.7.10",
44
"description": "Clerk SDK for Chrome extensions",
55
"keywords": [
66
"auth",

packages/clerk-js/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Change Log
22

3+
## 5.103.1
4+
5+
### Patch Changes
6+
7+
- Bring back OrgPreview within the OrgSwitcher component ([#7091](https://github.com/clerk/javascript/pull/7091)) by [@alexcarpenter](https://github.com/alexcarpenter)
8+
39
## 5.103.0
410

511
### Minor Changes

packages/clerk-js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@clerk/clerk-js",
3-
"version": "5.103.0",
3+
"version": "5.103.1",
44
"description": "Clerk JS library",
55
"keywords": [
66
"clerk",

packages/clerk-js/src/ui/components/OrganizationSwitcher/OrganizationSwitcherTrigger.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useOrganization, useOrganizationList, useUser } from '@clerk/shared/react';
22
import { forwardRef } from 'react';
33

4+
import { OrganizationPreview } from '@/ui/elements/OrganizationPreview';
45
import { PersonalWorkspacePreview } from '@/ui/elements/PersonalWorkspacePreview';
56
import { withAvatarShimmer } from '@/ui/elements/withAvatarShimmer';
67

@@ -51,6 +52,16 @@ export const OrganizationSwitcherTrigger = withAvatarShimmer(
5152
aria-haspopup='dialog'
5253
{...rest}
5354
>
55+
{organization && (
56+
<OrganizationPreview
57+
elementId={'organizationSwitcherTrigger'}
58+
gap={3}
59+
size='xs'
60+
organization={organization}
61+
sx={{ maxWidth: '30ch' }}
62+
/>
63+
)}
64+
5465
{!organization && (
5566
<PersonalWorkspacePreview
5667
size='xs'

packages/expo/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Change Log
22

3+
## 2.17.3
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [[`3410bc6`](https://github.com/clerk/javascript/commit/3410bc6f85d1d87c9ed35c9aa4ec764a684cc4ec)]:
8+
- @clerk/clerk-js@5.103.1
9+
310
## 2.17.2
411

512
### Patch Changes

packages/expo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@clerk/clerk-expo",
3-
"version": "2.17.2",
3+
"version": "2.17.3",
44
"description": "Clerk React Native/Expo library",
55
"keywords": [
66
"react",

0 commit comments

Comments
 (0)