@lobehub/chat 1.43.1 → 1.43.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,56 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.43.3](https://github.com/lobehub/lobe-chat/compare/v1.43.2...v1.43.3)
6
+
7
+ <sup>Released on **2025-01-04**</sup>
8
+
9
+ #### ♻ Code Refactoring
10
+
11
+ - **misc**: Upgrade `@clerk/nextjs` to v6.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Code refactoring
19
+
20
+ - **misc**: Upgrade `@clerk/nextjs` to v6, closes [#5291](https://github.com/lobehub/lobe-chat/issues/5291) ([de09895](https://github.com/lobehub/lobe-chat/commit/de09895))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
30
+ ### [Version 1.43.2](https://github.com/lobehub/lobe-chat/compare/v1.43.1...v1.43.2)
31
+
32
+ <sup>Released on **2025-01-04**</sup>
33
+
34
+ #### 🐛 Bug Fixes
35
+
36
+ - **misc**: Fix heatmap and manifest.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### What's fixed
44
+
45
+ - **misc**: Fix heatmap and manifest, closes [#5289](https://github.com/lobehub/lobe-chat/issues/5289) ([3973249](https://github.com/lobehub/lobe-chat/commit/3973249))
46
+
47
+ </details>
48
+
49
+ <div align="right">
50
+
51
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
52
+
53
+ </div>
54
+
5
55
  ### [Version 1.43.1](https://github.com/lobehub/lobe-chat/compare/v1.43.0...v1.43.1)
6
56
 
7
57
  <sup>Released on **2025-01-03**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,22 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "improvements": [
5
+ "Upgrade @clerk/nextjs to v6."
6
+ ]
7
+ },
8
+ "date": "2025-01-04",
9
+ "version": "1.43.3"
10
+ },
11
+ {
12
+ "children": {
13
+ "fixes": [
14
+ "Fix heatmap and manifest."
15
+ ]
16
+ },
17
+ "date": "2025-01-04",
18
+ "version": "1.43.2"
19
+ },
2
20
  {
3
21
  "children": {
4
22
  "fixes": [
@@ -2,6 +2,12 @@
2
2
  "$schema": "https://github.com/lobehub/lobe-chat/blob/main/docs/changelog/schema.json",
3
3
  "cloud": [],
4
4
  "community": [
5
+ {
6
+ "image": "https://github.com/user-attachments/assets/3d80e0f5-d32a-4412-85b2-e709731460a0",
7
+ "id": "2025-01-03-user-profile",
8
+ "date": "2025-01-03",
9
+ "versionRange": ["1.43.0", "1.43.1"]
10
+ },
5
11
  {
6
12
  "image": "https://github.com/user-attachments/assets/2048b4c2-4a56-4029-acf9-71e35ff08652",
7
13
  "id": "2024-11-27-forkable-chat",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.43.1",
3
+ "version": "1.43.3",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -115,7 +115,7 @@
115
115
  "@baiducloud/qianfan": "^0.1.9",
116
116
  "@cfworker/json-schema": "^4.0.0",
117
117
  "@clerk/localizations": "^3.3.0",
118
- "@clerk/nextjs": "^5.7.5",
118
+ "@clerk/nextjs": "^6.9.6",
119
119
  "@clerk/themes": "^2.1.37",
120
120
  "@codesandbox/sandpack-react": "^2.19.9",
121
121
  "@cyntler/react-doc-viewer": "^1.17.0",
@@ -1,7 +1,15 @@
1
+ import { Suspense } from 'react';
2
+
3
+ import SkeletonLoading from '@/components/Loading/SkeletonLoading';
4
+
1
5
  import CategoryContent from './features/CategoryContent';
2
6
 
3
7
  const Category = () => {
4
- return <CategoryContent />;
8
+ return (
9
+ <Suspense fallback={<SkeletonLoading paragraph={{ rows: 7 }} title={false} />}>
10
+ <CategoryContent />
11
+ </Suspense>
12
+ );
5
13
  };
6
14
 
7
15
  Category.displayName = 'SettingCategory';
@@ -1,10 +1,12 @@
1
1
  'use client';
2
2
 
3
3
  import { createStyles } from 'antd-style';
4
+ import { Suspense } from 'react';
4
5
  import { useTranslation } from 'react-i18next';
5
6
  import { Flexbox, FlexboxProps } from 'react-layout-kit';
6
7
 
7
8
  import BrandWatermark from '@/components/BrandWatermark';
9
+ import CircleLoading from '@/components/Loading/CircleLoading';
8
10
  import PanelTitle from '@/components/PanelTitle';
9
11
 
10
12
  const useStyles = createStyles(({ token, css }) => ({
@@ -33,7 +35,7 @@ const SidebarLayout = ({ children, className, title, desc, ...rest }: SidebarLay
33
35
  {...rest}
34
36
  >
35
37
  <PanelTitle desc={desc || t('header.desc')} title={title || t('header.title')} />
36
- {children}
38
+ <Suspense fallback={<CircleLoading />}>{children}</Suspense>
37
39
  <BrandWatermark paddingInline={12} />
38
40
  </Flexbox>
39
41
  );
@@ -3,13 +3,10 @@ import type { MetadataRoute } from 'next';
3
3
 
4
4
  import { BRANDING_LOGO_URL, BRANDING_NAME } from '@/const/branding';
5
5
  import { manifestModule } from '@/server/manifest';
6
- import { translation } from '@/server/translation';
7
-
8
- const manifest = async (): Promise<MetadataRoute.Manifest | any> => {
9
- const { t } = await translation('metadata');
10
6
 
7
+ const manifest = (): MetadataRoute.Manifest | any => {
11
8
  return manifestModule.generate({
12
- description: t('chat.description', { appName: BRANDING_NAME }),
9
+ description: `${BRANDING_NAME} brings you the best UI experience for ChatGPT, Claude, Gemini, and OLLaMA.`,
13
10
  icons: [
14
11
  {
15
12
  purpose: 'any',
@@ -1278,14 +1278,14 @@ describe('MessageModel', () => {
1278
1278
  (item) => item.date === today.subtract(2, 'day').format('YYYY-MM-DD'),
1279
1279
  );
1280
1280
  expect(twoDaysAgo?.count).toBe(2);
1281
- expect(twoDaysAgo?.level).toBe(0);
1281
+ expect(twoDaysAgo?.level).toBe(1);
1282
1282
 
1283
1283
  // 检查一天前的数据
1284
1284
  const oneDayAgo = result.find(
1285
1285
  (item) => item.date === today.subtract(1, 'day').format('YYYY-MM-DD'),
1286
1286
  );
1287
1287
  expect(oneDayAgo?.count).toBe(1);
1288
- expect(oneDayAgo?.level).toBe(0);
1288
+ expect(oneDayAgo?.level).toBe(1);
1289
1289
 
1290
1290
  // 检查今天的数据
1291
1291
  const todayData = result.find((item) => item.date === today.format('YYYY-MM-DD'));
@@ -1356,25 +1356,25 @@ describe('MessageModel', () => {
1356
1356
  (item) => item.date === today.subtract(4, 'day').format('YYYY-MM-DD'),
1357
1357
  );
1358
1358
  expect(fourDaysAgo?.count).toBe(1);
1359
- expect(fourDaysAgo?.level).toBe(0);
1359
+ expect(fourDaysAgo?.level).toBe(1);
1360
1360
 
1361
1361
  const threeDaysAgo = result.find(
1362
1362
  (item) => item.date === today.subtract(3, 'day').format('YYYY-MM-DD'),
1363
1363
  );
1364
1364
  expect(threeDaysAgo?.count).toBe(6);
1365
- expect(threeDaysAgo?.level).toBe(1);
1365
+ expect(threeDaysAgo?.level).toBe(2);
1366
1366
 
1367
1367
  const twoDaysAgo = result.find(
1368
1368
  (item) => item.date === today.subtract(2, 'day').format('YYYY-MM-DD'),
1369
1369
  );
1370
1370
  expect(twoDaysAgo?.count).toBe(11);
1371
- expect(twoDaysAgo?.level).toBe(2);
1371
+ expect(twoDaysAgo?.level).toBe(3);
1372
1372
 
1373
1373
  const oneDayAgo = result.find(
1374
1374
  (item) => item.date === today.subtract(1, 'day').format('YYYY-MM-DD'),
1375
1375
  );
1376
1376
  expect(oneDayAgo?.count).toBe(16);
1377
- expect(oneDayAgo?.level).toBe(3);
1377
+ expect(oneDayAgo?.level).toBe(4);
1378
1378
 
1379
1379
  const todayData = result.find((item) => item.date === today.format('YYYY-MM-DD'));
1380
1380
  expect(todayData?.count).toBe(21);
@@ -378,7 +378,7 @@ export class MessageModel {
378
378
  );
379
379
 
380
380
  const count = matchingResult ? matchingResult.count : 0;
381
- const levelCount = count > 0 ? Math.floor(count / 5) : 0;
381
+ const levelCount = count > 0 ? Math.ceil(count / 5) : 0;
382
382
  const level = levelCount > 4 ? 4 : levelCount;
383
383
 
384
384
  heatmapData.push({
@@ -44,6 +44,7 @@ const Clerk = memo(({ children }: PropsWithChildren) => {
44
44
  return (
45
45
  <ClerkProvider
46
46
  appearance={updatedAppearance}
47
+ dynamic
47
48
  localization={localization}
48
49
  signUpUrl={!enableClerkSignUp ? '/login' : '/signup'} // Redirect sign-up to sign-in if disabled
49
50
  >
package/src/middleware.ts CHANGED
@@ -54,8 +54,8 @@ const isProtectedRoute = createRouteMatcher([
54
54
 
55
55
  export default authEnv.NEXT_PUBLIC_ENABLE_CLERK_AUTH
56
56
  ? clerkMiddleware(
57
- (auth, req) => {
58
- if (isProtectedRoute(req)) auth().protect();
57
+ async (auth, req) => {
58
+ if (isProtectedRoute(req)) await auth.protect();
59
59
  },
60
60
  {
61
61
  // https://github.com/lobehub/lobe-chat/pull/3084
@@ -5,7 +5,7 @@ import NextAuthEdge from '@/libs/next-auth/edge';
5
5
 
6
6
  export const getUserAuth = async () => {
7
7
  if (enableClerk) {
8
- const clerkAuth = auth();
8
+ const clerkAuth = await auth();
9
9
 
10
10
  const userId = clerkAuth.userId;
11
11
  return { clerkAuth: auth, userId };