@lobehub/chat 1.22.16 → 1.22.17
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,31 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.22.17](https://github.com/lobehub/lobe-chat/compare/v1.22.16...v1.22.17)
|
6
|
+
|
7
|
+
<sup>Released on **2024-10-22**</sup>
|
8
|
+
|
9
|
+
#### ♻ Code Refactoring
|
10
|
+
|
11
|
+
- **misc**: Fix dynamic import in rsc layout.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### Code refactoring
|
19
|
+
|
20
|
+
- **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))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
5
30
|
### [Version 1.22.16](https://github.com/lobehub/lobe-chat/compare/v1.22.15...v1.22.16)
|
6
31
|
|
7
32
|
<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.
|
3
|
+
"version": "1.22.17",
|
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.
|
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",
|
@@ -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.
|
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",
|
@@ -284,7 +284,6 @@
|
|
284
284
|
"lodash": "^4.17.21",
|
285
285
|
"markdown-table": "^3.0.3",
|
286
286
|
"node-fetch": "^3.3.2",
|
287
|
-
"node-gyp": "^10.2.0",
|
288
287
|
"openapi-typescript": "^6.7.6",
|
289
288
|
"p-map": "^7.0.2",
|
290
289
|
"prettier": "^3.3.3",
|
@@ -293,7 +292,6 @@
|
|
293
292
|
"semantic-release": "^21.1.2",
|
294
293
|
"serwist": "^9.0.9",
|
295
294
|
"stylelint": "^15.11.0",
|
296
|
-
"supports-color": "^8.1.1",
|
297
295
|
"tsx": "^4.19.1",
|
298
296
|
"typescript": "^5.6.3",
|
299
297
|
"unified": "^11.0.5",
|
@@ -302,7 +300,7 @@
|
|
302
300
|
"vitest": "~1.2.2",
|
303
301
|
"vitest-canvas-mock": "^0.3.3"
|
304
302
|
},
|
305
|
-
"packageManager": "pnpm@9.12.
|
303
|
+
"packageManager": "pnpm@9.12.2",
|
306
304
|
"publishConfig": {
|
307
305
|
"access": "public",
|
308
306
|
"registry": "https://registry.npmjs.org"
|
package/src/app/layout.tsx
CHANGED
@@ -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
|
4
|
-
import {
|
5
|
-
|
6
|
-
import {
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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,10 +1,8 @@
|
|
1
|
-
import dynamic from 'next/dynamic';
|
2
1
|
import { cookies, headers } from 'next/headers';
|
3
|
-
import {
|
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:
|