Skip to content

Commit e48bf16

Browse files
authored
release(0.3.8): Merge pull request #948 from ThinkInAIXYZ/dev
Release 0.3.8
2 parents 4f8ff87 + 8ffefdf commit e48bf16

File tree

595 files changed

+7670
-5970
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

595 files changed

+7670
-5970
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ jobs:
106106
- name: Install dependencies
107107
run: pnpm install
108108

109-
- name: Install Node Runtime
110-
run: pnpm run installRuntime:linux:${{ matrix.arch }}
109+
# - name: Install Node Runtime
110+
# run: pnpm run installRuntime:linux:${{ matrix.arch }}
111111

112112
- name: Build Linux
113113
run: pnpm run build:linux:${{ matrix.arch }}

.oxlintrc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
"scripts/**",
1313
"runtime/**",
1414
"docs/**",
15-
"test/**"
15+
"test/**",
16+
"src/shared/**",
17+
"src/shadcn/**"
1618
]
1719
}

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ src/renderer/src/components/ui/*
2323
electron.vite.config.ts
2424
*.md
2525
scripts/*
26+
src/shadcn/**/*

components.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22
"$schema": "https://shadcn-vue.com/schema.json",
33
"style": "new-york",
44
"typescript": true,
5-
"tsConfigPath": "./tsconfig.web.json",
65
"tailwind": {
7-
"config": "tailwind.config.js",
6+
"config": "",
87
"css": "src/renderer/src/assets/style.css",
98
"baseColor": "zinc",
109
"cssVariables": true,
1110
"prefix": ""
1211
},
13-
"framework": "vite",
1412
"aliases": {
15-
"components": "@/components",
16-
"utils": "@/lib/utils"
17-
}
13+
"components": "@shadcn/components",
14+
"composables": "@shadcn/composables",
15+
"utils": "@shadcn/lib/utils",
16+
"ui": "@shadcn/components/ui",
17+
"lib": "@shadcn/lib"
18+
},
19+
"iconLibrary": "lucide"
1820
}

electron-builder-macx64.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ files:
1010
- '!electron.vite.config.{js,ts,mjs,cjs}'
1111
- '!{.eslintignore,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}'
1212
- '!{.env,.env.*,.npmrc,pnpm-lock.yaml}'
13-
- '!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}'
13+
- '!{tsconfig.json,tsconfig.node.json,tsconfig.app.json}'
1414
- '!keys/*'
1515
- '!scripts/*'
1616
- '!.github/*'

electron-builder.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ files:
1313
- '!electron.vite.config.{js,ts,mjs,cjs}'
1414
- '!{.eslintignore,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}'
1515
- '!{.env,.env.*,.npmrc,pnpm-lock.yaml}'
16-
- '!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}'
16+
- '!{tsconfig.json,tsconfig.node.json,tsconfig.app.json}'
1717
- '!electron-builder.yml'
1818
- '!electron-builder-macx64.yml'
1919
- '!test/*'

electron.vite.config.ts

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { resolve } from 'path'
22
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
33
import vue from '@vitejs/plugin-vue'
4-
import autoprefixer from 'autoprefixer'
5-
import tailwind from 'tailwindcss'
64
import vueDevTools from 'vite-plugin-vue-devtools'
75
import svgLoader from 'vite-svg-loader'
86
import monacoEditorPlugin from 'vite-plugin-monaco-editor-esm'
97
import path from 'node:path'
8+
import tailwindcss from '@tailwindcss/vite'
9+
1010

1111
export default defineConfig({
1212
main: {
@@ -23,7 +23,7 @@ export default defineConfig({
2323
},
2424
build: {
2525
rollupOptions: {
26-
external: ['sharp','@duckdb/node-api'],
26+
external: ['sharp', '@duckdb/node-api'],
2727
output: {
2828
inlineDynamicImports: true,
2929
manualChunks: undefined, // Disable automatic chunk splitting
@@ -48,6 +48,11 @@ export default defineConfig({
4848
}
4949
},
5050
renderer: {
51+
define: {
52+
'import.meta.env.VITE_ENABLE_PLAYGROUND': JSON.stringify(
53+
process.env.VITE_ENABLE_PLAYGROUND ?? 'false'
54+
)
55+
},
5156
optimizeDeps: {
5257
include: [
5358
'monaco-editor',
@@ -59,19 +64,15 @@ export default defineConfig({
5964
'@': resolve('src/renderer/src'),
6065
'@shell': resolve('src/renderer/shell'),
6166
'@shared': resolve('src/shared'),
67+
"@shadcn": resolve('src/shadcn'),
6268
vue: 'vue/dist/vue.esm-bundler.js'
6369
}
6470
},
65-
css: {
66-
postcss: {
67-
// @ts-ignore
68-
plugins: [tailwind(), autoprefixer()]
69-
}
70-
},
7171
server: {
7272
host: '0.0.0.0' // 防止代理干扰,导致vite-electron之间ws://localhost:5713和http://localhost:5713通信失败、页面组件无法加载
7373
},
7474
plugins: [
75+
tailwindcss(),
7576
monacoEditorPlugin({
7677
languageWorkers: ['editorWorkerService', 'typescript', 'css', 'html', 'json'],
7778
customDistPath(_root, buildOutDir, _base) {
@@ -80,10 +81,7 @@ export default defineConfig({
8081
}),
8182
vue(),
8283
svgLoader(),
83-
vueDevTools({
84-
// use export LAUNCH_EDITOR=cursor instead
85-
// launchEditor: 'cursor'
86-
})
84+
vueDevTools()
8785
],
8886
build: {
8987
minify: 'esbuild',

package.json

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "DeepChat",
3-
"version": "0.3.7",
3+
"version": "0.3.8",
44
"description": "DeepChat,一个简单易用的AI客户端",
55
"main": "./out/main/index.js",
66
"author": "ThinkInAIXYZ",
@@ -22,10 +22,10 @@
2222
"format": "prettier --write .",
2323
"lint": "npx -y oxlint .",
2424
"typecheck:node": "tsc --noEmit -p tsconfig.node.json --composite false",
25-
"typecheck:web": "vue-tsc --noEmit -p tsconfig.web.json --composite false",
25+
"typecheck:web": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
2626
"typecheck": "pnpm run typecheck:node && pnpm run typecheck:web",
2727
"start": "electron-vite preview",
28-
"dev": "electron-vite dev --watch",
28+
"dev": "VITE_ENABLE_PLAYGROUND=true electron-vite dev --watch",
2929
"dev:inspect": "electron-vite dev --watch --inspect=9229",
3030
"dev:linux": "electron-vite dev --watch --noSandbox",
3131
"build": "pnpm run typecheck && electron-vite build",
@@ -53,7 +53,8 @@
5353
"i18n": "i18n-check -s zh-CN -f i18next --locales src/renderer/src/i18n",
5454
"i18n:en": "i18n-check -s en-US -f i18next --locales src/renderer/src/i18n",
5555
"i18n:types": "node scripts/generate-i18n-types.js",
56-
"cleanRuntime": "rm -rf runtime/uv runtime/bun runtime/node"
56+
"cleanRuntime": "rm -rf runtime/uv runtime/bun runtime/node",
57+
"update-shadcn": "node scripts/update-shadcn.js"
5758
},
5859
"dependencies": {
5960
"@anthropic-ai/sdk": "^0.53.0",
@@ -102,10 +103,11 @@
102103
"@iconify-json/lucide": "^1.2.66",
103104
"@iconify-json/vscode-icons": "^1.2.30",
104105
"@iconify/vue": "^5.0.0",
106+
"@internationalized/date": "^3.9.0",
105107
"@lingual/i18n-check": "^0.8.6",
106108
"@radix-icons/vue": "^1.0.0",
107-
"@tailwindcss/typography": "^0.5.16",
108-
"@tailwindcss/vite": "^4.1.12",
109+
"@tailwindcss/typography": "^0.5.19",
110+
"@tailwindcss/vite": "^4.1.13",
109111
"@tiptap/core": "^2.11.7",
110112
"@tiptap/extension-code-block": "^2.11.9",
111113
"@tiptap/extension-document": "^2.11.7",
@@ -129,26 +131,28 @@
129131
"autoprefixer": "^10.4.21",
130132
"class-variance-authority": "^0.7.1",
131133
"clsx": "^2.1.1",
132-
"electron": "^37.3.0",
134+
"electron": "^37.6.0",
133135
"electron-builder": "26.0.12",
134136
"electron-vite": "^4.0.0",
135137
"jsdom": "^26.1.0",
136138
"katex": "^0.16.22",
137139
"lint-staged": "^16.1.6",
138-
"lucide-vue-next": "^0.511.0",
140+
"lucide-vue-next": "^0.544.0",
139141
"mermaid": "^11.10.1",
140142
"minimatch": "^10.0.3",
141143
"monaco-editor": "^0.52.2",
142144
"picocolors": "^1.1.1",
143145
"pinia": "^3.0.3",
144146
"prettier": "^3.5.3",
145147
"radix-vue": "^1.9.17",
148+
"reka-ui": "^2.5.0",
146149
"simple-git-hooks": "^2.13.1",
147150
"tailwind-merge": "^3.3.1",
148-
"tailwind-scrollbar-hide": "^2.0.0",
149-
"tailwindcss": "3.4.17",
151+
"tailwind-scrollbar-hide": "^4.0.0",
152+
"tailwindcss": "^4.1.13",
150153
"tailwindcss-animate": "^1.0.7",
151154
"tippy.js": "^6.3.7",
155+
"tw-animate-css": "^1.4.0",
152156
"typescript": "^5.8.3",
153157
"vite": "7.1.5",
154158
"vite-plugin-monaco-editor-esm": "^2.0.2",
@@ -157,13 +161,19 @@
157161
"vitest": "^3.2.4",
158162
"vue": "^3.5.21",
159163
"vue-i18n": "^11.1.11",
160-
"vue-renderer-markdown": "0.0.54-beta.6",
164+
"vue-renderer-markdown": "0.0.54-beta.8",
161165
"vue-router": "4",
166+
"vue-sonner": "^2.0.8",
162167
"vue-tsc": "^2.2.12",
163-
"vue-use-monaco": "^0.0.31",
168+
"vue-use-monaco": "^0.0.33",
164169
"vue-virtual-scroller": "^2.0.0-beta.8",
165170
"vuedraggable": "^4.1.0",
166171
"yaml": "^2.8.1",
172+
"@tanstack/vue-table": "^8.21.3",
173+
"@vee-validate/zod": "^4.15.1",
174+
"embla-carousel-vue": "^8.6.0",
175+
"vaul-vue": "^0.4.1",
176+
"vee-validate": "^4.15.1",
167177
"zod-to-json-schema": "^3.24.6"
168178
},
169179
"simple-git-hooks": {

scripts/update-shadcn.js

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/usr/bin/env node
2+
3+
import { execSync } from 'child_process'
4+
import { join, dirname } from 'path'
5+
import { fileURLToPath } from 'url'
6+
7+
const __filename = fileURLToPath(import.meta.url)
8+
const __dirname = dirname(__filename)
9+
const projectRoot = join(__dirname, '..')
10+
11+
// 这里放你要维护的shadcn组件列表
12+
const components = [
13+
"accordion",
14+
"alert",
15+
"alert-dialog",
16+
"aspect-ratio",
17+
"avatar",
18+
"badge",
19+
"breadcrumb",
20+
"button",
21+
"card",
22+
"checkbox",
23+
"collapsible",
24+
"context-menu",
25+
"dialog",
26+
"dropdown-menu",
27+
"hover-card",
28+
"input",
29+
"label",
30+
"menubar",
31+
"navigation-menu",
32+
"popover",
33+
"progress",
34+
"radio-group",
35+
"select",
36+
"separator",
37+
"sheet",
38+
"sidebar",
39+
"skeleton",
40+
"switch",
41+
"tabs",
42+
"textarea",
43+
"tooltip",
44+
"toggle",
45+
'sonner',
46+
'table',
47+
'form',
48+
'calendar',
49+
'drawer',
50+
'combobox',
51+
'slider',
52+
'scroll-area'
53+
]
54+
55+
// 批量更新组件
56+
function updateComponents() {
57+
if (components.length === 0) {
58+
console.log('组件列表为空,请在脚本中配置组件')
59+
return
60+
}
61+
62+
console.log(`正在更新 ${components.length} 个组件: ${components.join(', ')}`)
63+
64+
try {
65+
const command = `cd "${projectRoot}" && pnpm dlx shadcn-vue@latest add ${components.join(' ')} -o`
66+
execSync(command, { stdio: 'inherit' })
67+
console.log('组件更新完成 ✓')
68+
} catch (error) {
69+
console.error('更新组件时出错:', error.message)
70+
}
71+
}
72+
73+
// 执行更新
74+
updateComponents()

src/main/presenter/knowledgePresenter/knowledgeStorePresenter.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,11 @@ export class KnowledgeStorePresenter {
7575
}
7676
} as KnowledgeFileMessage
7777

78-
fileId
79-
? await this.vectorP.updateFile(fileMessage)
80-
: await this.vectorP.insertFile(fileMessage)
78+
if (fileId) {
79+
await this.vectorP.updateFile(fileMessage)
80+
} else {
81+
await this.vectorP.insertFile(fileMessage)
82+
}
8183

8284
this.processFileAsync(fileMessage)
8385

0 commit comments

Comments
 (0)