@lobehub/chat 1.22.16 → 1.22.18

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,48 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.22.18](https://github.com/lobehub/lobe-chat/compare/v1.22.17...v1.22.18)
6
+
7
+ <sup>Released on **2024-10-22**</sup>
8
+
9
+ <br/>
10
+
11
+ <details>
12
+ <summary><kbd>Improvements and Fixes</kbd></summary>
13
+
14
+ </details>
15
+
16
+ <div align="right">
17
+
18
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
19
+
20
+ </div>
21
+
22
+ ### [Version 1.22.17](https://github.com/lobehub/lobe-chat/compare/v1.22.16...v1.22.17)
23
+
24
+ <sup>Released on **2024-10-22**</sup>
25
+
26
+ #### ♻ Code Refactoring
27
+
28
+ - **misc**: Fix dynamic import in rsc layout.
29
+
30
+ <br/>
31
+
32
+ <details>
33
+ <summary><kbd>Improvements and Fixes</kbd></summary>
34
+
35
+ #### Code refactoring
36
+
37
+ - **misc**: Fix dynamic import in rsc layout, closes [#4445](https://github.com/lobehub/lobe-chat/issues/4445) ([011d62a](https://github.com/lobehub/lobe-chat/commit/011d62a))
38
+
39
+ </details>
40
+
41
+ <div align="right">
42
+
43
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
44
+
45
+ </div>
46
+
5
47
  ### [Version 1.22.16](https://github.com/lobehub/lobe-chat/compare/v1.22.15...v1.22.16)
6
48
 
7
49
  <sup>Released on **2024-10-21**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.22.16",
3
+ "version": "1.22.18",
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",
@@ -149,7 +149,7 @@
149
149
  "debug": "^4.3.7",
150
150
  "dexie": "^3.2.7",
151
151
  "diff": "^5.2.0",
152
- "drizzle-orm": "^0.34.1",
152
+ "drizzle-orm": "^0.35.0",
153
153
  "drizzle-zod": "^0.5.1",
154
154
  "fast-deep-equal": "^3.1.3",
155
155
  "file-type": "^19.6.0",
@@ -230,7 +230,7 @@
230
230
  "yaml": "^2.6.0",
231
231
  "yjs": "^13.6.20",
232
232
  "zod": "^3.23.8",
233
- "zustand": "^4.5.5",
233
+ "zustand": "^5.0.0",
234
234
  "zustand-utils": "^1.3.2"
235
235
  },
236
236
  "devDependencies": {
@@ -270,7 +270,7 @@
270
270
  "consola": "^3.2.3",
271
271
  "dotenv": "^16.4.5",
272
272
  "dpdm": "^3.14.0",
273
- "drizzle-kit": "^0.25.0",
273
+ "drizzle-kit": "^0.26.0",
274
274
  "eslint": "^8.57.1",
275
275
  "eslint-plugin-mdx": "^2.3.4",
276
276
  "eslint-plugin-unused-imports": "4.0.1",
@@ -293,7 +293,6 @@
293
293
  "semantic-release": "^21.1.2",
294
294
  "serwist": "^9.0.9",
295
295
  "stylelint": "^15.11.0",
296
- "supports-color": "^8.1.1",
297
296
  "tsx": "^4.19.1",
298
297
  "typescript": "^5.6.3",
299
298
  "unified": "^11.0.5",
@@ -302,7 +301,7 @@
302
301
  "vitest": "~1.2.2",
303
302
  "vitest-canvas-mock": "^0.3.3"
304
303
  },
305
- "packageManager": "pnpm@9.12.1",
304
+ "packageManager": "pnpm@9.12.2",
306
305
  "publishConfig": {
307
306
  "access": "public",
308
307
  "registry": "https://registry.npmjs.org"
@@ -1,17 +1,16 @@
1
1
  import { SpeedInsights } from '@vercel/speed-insights/next';
2
2
  import { ResolvingViewport } from 'next';
3
- import dynamic from 'next/dynamic';
4
3
  import { cookies } from 'next/headers';
5
4
  import { ReactNode } from 'react';
6
5
  import { isRtlLang } from 'rtl-detect';
7
6
 
8
7
  import Analytics from '@/components/Analytics';
9
8
  import { DEFAULT_LANG, LOBE_LOCALE_COOKIE } from '@/const/locale';
9
+ import PWAInstall from '@/features/PWAInstall';
10
10
  import AuthProvider from '@/layout/AuthProvider';
11
11
  import GlobalProvider from '@/layout/GlobalProvider';
12
12
  import { isMobileDevice } from '@/utils/responsive';
13
13
 
14
- const PWAInstall = dynamic(() => import('@/features/PWAInstall'), { ssr: false });
15
14
  const inVercel = process.env.VERCEL === '1';
16
15
 
17
16
  type RootLayoutProps = {
@@ -0,0 +1,35 @@
1
+
2
+ import { Icon } from '@lobehub/ui';
3
+ import { App, FloatButton, Spin } from 'antd';
4
+ import { DatabaseIcon, Loader2 } from 'lucide-react';
5
+ import { memo, useState } from 'react';
6
+
7
+ import { debugService } from '@/services/debug';
8
+
9
+ const DebugUI = memo(() => {
10
+ const [loading, setLoading] = useState(false);
11
+ const { message } = App.useApp();
12
+ return (
13
+ <>
14
+ {loading && <Spin fullscreen />}
15
+ <FloatButton
16
+ icon={<Icon icon={loading ? Loader2 : DatabaseIcon} spin={loading} />}
17
+ onClick={async () => {
18
+ setLoading(true);
19
+
20
+ const startTime = Date.now();
21
+
22
+ await debugService.insertLargeDataToDB();
23
+
24
+ const duration = Date.now() - startTime;
25
+
26
+ setLoading(false);
27
+ message.success(`插入成功,耗时:${(duration / 1000).toFixed(1)} s`);
28
+ }}
29
+ tooltip={'性能压测,插入100w数据'}
30
+ />
31
+ </>
32
+ );
33
+ });
34
+
35
+ export default DebugUI;
@@ -1,36 +1,20 @@
1
1
  'use client';
2
2
 
3
- import { Icon } from '@lobehub/ui';
4
- import { App, FloatButton, Spin } from 'antd';
5
- import { DatabaseIcon, Loader2 } from 'lucide-react';
6
- import { memo, useState } from 'react';
7
-
8
- import { debugService } from '@/services/debug';
9
-
10
- const DebugUI = memo(() => {
11
- const [loading, setLoading] = useState(false);
12
- const { message } = App.useApp();
13
- return (
14
- <>
15
- {loading && <Spin fullscreen />}
16
- <FloatButton
17
- icon={<Icon icon={loading ? Loader2 : DatabaseIcon} spin={loading} />}
18
- onClick={async () => {
19
- setLoading(true);
20
-
21
- const startTime = Date.now();
22
-
23
- await debugService.insertLargeDataToDB();
24
-
25
- const duration = Date.now() - startTime;
26
-
27
- setLoading(false);
28
- message.success(`插入成功,耗时:${(duration / 1000).toFixed(1)} s`);
29
- }}
30
- tooltip={'性能压测,插入100w数据'}
31
- />
32
- </>
33
- );
34
- });
3
+ import dynamic from 'next/dynamic';
4
+ import { FC } from 'react';
5
+
6
+ import { getDebugConfig } from '@/config/debug';
7
+
8
+ let DebugUI: FC = () => null;
9
+
10
+ // we need use Constant Folding to remove code below in production
11
+ // refs: https://webpack.js.org/plugins/internal-plugins/#constplugin
12
+ if (process.env.NODE_ENV === 'development') {
13
+ // eslint-disable-next-line unicorn/no-lonely-if
14
+ if (getDebugConfig().DEBUG_MODE) {
15
+ // @ts-ignore
16
+ DebugUI = dynamic(() => import('./Content'), { ssr: false });
17
+ }
18
+ }
35
19
 
36
20
  export default DebugUI;
@@ -1,6 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import { ConfigProvider, NeutralColors, PrimaryColors, ThemeProvider } from '@lobehub/ui';
4
+ import { ConfigProvider as AntdConfigProvider } from 'antd';
4
5
  import { ThemeAppearance, createStyles } from 'antd-style';
5
6
  import 'antd/dist/reset.css';
6
7
  import Image from 'next/image';
@@ -103,31 +104,33 @@ const AppTheme = memo<AppThemeProps>(
103
104
  }, [neutralColor]);
104
105
 
105
106
  return (
106
- <ThemeProvider
107
- className={cx(styles.app, styles.scrollbar, styles.scrollbarPolyfill)}
108
- customTheme={{
109
- neutralColor: neutralColor ?? defaultNeutralColor,
110
- primaryColor: primaryColor ?? defaultPrimaryColor,
111
- }}
112
- defaultAppearance={defaultAppearance}
113
- onAppearanceChange={(appearance) => {
114
- setCookie(LOBE_THEME_APPEARANCE, appearance);
115
- }}
116
- themeMode={themeMode}
117
- >
118
- <GlobalStyle />
119
- <AntdStaticMethods />
120
- <ConfigProvider
121
- config={{
122
- aAs: Link,
123
- imgAs: Image,
124
- imgUnoptimized: true,
125
- proxy: globalCDN ? 'unpkg' : undefined,
107
+ <AntdConfigProvider theme={{ cssVar: true }}>
108
+ <ThemeProvider
109
+ className={cx(styles.app, styles.scrollbar, styles.scrollbarPolyfill)}
110
+ customTheme={{
111
+ neutralColor: neutralColor ?? defaultNeutralColor,
112
+ primaryColor: primaryColor ?? defaultPrimaryColor,
126
113
  }}
114
+ defaultAppearance={defaultAppearance}
115
+ onAppearanceChange={(appearance) => {
116
+ setCookie(LOBE_THEME_APPEARANCE, appearance);
117
+ }}
118
+ themeMode={themeMode}
127
119
  >
128
- {children}
129
- </ConfigProvider>
130
- </ThemeProvider>
120
+ <GlobalStyle />
121
+ <AntdStaticMethods />
122
+ <ConfigProvider
123
+ config={{
124
+ aAs: Link,
125
+ imgAs: Image,
126
+ imgUnoptimized: true,
127
+ proxy: globalCDN ? 'unpkg' : undefined,
128
+ }}
129
+ >
130
+ {children}
131
+ </ConfigProvider>
132
+ </ThemeProvider>
133
+ </AntdConfigProvider>
131
134
  );
132
135
  },
133
136
  );
@@ -1,10 +1,8 @@
1
- import dynamic from 'next/dynamic';
2
1
  import { cookies, headers } from 'next/headers';
3
- import { FC, PropsWithChildren } from 'react';
2
+ import { PropsWithChildren } from 'react';
4
3
  import { resolveAcceptLanguage } from 'resolve-accept-language';
5
4
 
6
5
  import { appEnv } from '@/config/app';
7
- import { getDebugConfig } from '@/config/debug';
8
6
  import { getServerFeatureFlagsValue } from '@/config/featureFlags';
9
7
  import { LOBE_LOCALE_COOKIE } from '@/const/locale';
10
8
  import {
@@ -12,6 +10,7 @@ import {
12
10
  LOBE_THEME_NEUTRAL_COLOR,
13
11
  LOBE_THEME_PRIMARY_COLOR,
14
12
  } from '@/const/theme';
13
+ import DebugUI from '@/features/DebugUI';
15
14
  import { locales } from '@/locales/resources';
16
15
  import { getServerGlobalConfig } from '@/server/globalConfig';
17
16
  import { ServerConfigStoreProvider } from '@/store/serverConfig';
@@ -24,17 +23,6 @@ import QueryProvider from './Query';
24
23
  import StoreInitialization from './StoreInitialization';
25
24
  import StyleRegistry from './StyleRegistry';
26
25
 
27
- let DebugUI: FC = () => null;
28
-
29
- // we need use Constant Folding to remove code below in production
30
- // refs: https://webpack.js.org/plugins/internal-plugins/#constplugin
31
- if (process.env.NODE_ENV === 'development') {
32
- // eslint-disable-next-line unicorn/no-lonely-if
33
- if (getDebugConfig().DEBUG_MODE) {
34
- DebugUI = dynamic(() => import('@/features/DebugUI'), { ssr: false }) as FC;
35
- }
36
- }
37
-
38
26
  const parserFallbackLang = () => {
39
27
  /**
40
28
  * The arguments are as follows: