feat: 渲染器增加 sentry 上报错误
This commit is contained in:
		
							parent
							
								
									898ab51736
								
							
						
					
					
						commit
						e677d4fc9e
					
				| @ -30,8 +30,7 @@ const config = createViteConfig({ | ||||
| 
 | ||||
| export default defineConfig(({ mode }) => { | ||||
|   console.log('mode', mode); | ||||
|   // 加载环境变量(支持 .env.development/.env.production)
 | ||||
|   const env = loadEnv(mode, process.cwd(), ['VITE_', 'VTJ_', 'SY_', 'Y_CODE_']); | ||||
|   const env = loadEnv(mode, process.cwd(), ['VITE_']); | ||||
|   return { | ||||
|     ...config, | ||||
|     server: { | ||||
| @ -43,9 +42,5 @@ export default defineConfig(({ mode }) => { | ||||
|       // 注入环境变量到客户端
 | ||||
|       __APP_ENV__: JSON.stringify(env) | ||||
|     } | ||||
|     // build: {
 | ||||
|     // outDir: path.resolve(process.cwd(), '../../dist/designer'),
 | ||||
|     // emptyOutDir: true // 构建前清空目录
 | ||||
|     // }
 | ||||
|   }; | ||||
| }); | ||||
|  | ||||
| @ -58,8 +58,8 @@ const routes: RouteRecordRaw[] = [ | ||||
|   //   ],
 | ||||
|   // },
 | ||||
|   { | ||||
|     name: 'VbenAbout', | ||||
|     path: '/vben-admin/about', | ||||
|     name: 'AdminAbout', | ||||
|     path: '/admin/about', | ||||
|     component: () => import('#/views/_core/about/index.vue'), | ||||
|     meta: { | ||||
|       icon: 'lucide:copyright', | ||||
| @ -22,15 +22,15 @@ const routes: RouteRecordRaw[] = [ | ||||
|           title: $t('page.dashboard.analytics'), | ||||
|         }, | ||||
|       }, | ||||
|       { | ||||
|         name: 'Workspace', | ||||
|         path: '/workspace', | ||||
|         component: () => import('#/views/dashboard/workspace/index.vue'), | ||||
|         meta: { | ||||
|           icon: 'carbon:workspace', | ||||
|           title: $t('page.dashboard.workspace'), | ||||
|         }, | ||||
|       }, | ||||
|       // {
 | ||||
|       //   name: 'Workspace',
 | ||||
|       //   path: '/workspace',
 | ||||
|       //   component: () => import('#/views/dashboard/workspace/index.vue'),
 | ||||
|       //   meta: {
 | ||||
|       //     icon: 'carbon:workspace',
 | ||||
|       //     title: $t('page.dashboard.workspace'),
 | ||||
|       //   },
 | ||||
|       // },
 | ||||
|     ], | ||||
|   }, | ||||
| ]; | ||||
|  | ||||
| @ -30,13 +30,6 @@ export default defineConfig(({ mode }) => { | ||||
|         // 注入环境变量到客户端
 | ||||
|         'process.env': JSON.stringify(env), | ||||
|       }, | ||||
|       // output: {
 | ||||
|       //   path: path.resolve(process.cwd(), "../../dist/renderer"),
 | ||||
|       //   clean: true,
 | ||||
|       // },
 | ||||
|       script: { | ||||
|         target: 'es2022', | ||||
|       }, | ||||
|     }, | ||||
|   }; | ||||
| }); | ||||
|  | ||||
| @ -4,11 +4,11 @@ | ||||
|     <meta charset="utf-8" /> | ||||
|     <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||||
|     <link rel="icon" type="image/svg+xml" href="/favicon.ico" /> | ||||
|     <title>Farm + Vue3 + TS</title> | ||||
|     <title>悦码渲染器</title> | ||||
|   </head> | ||||
| 
 | ||||
|   <body> | ||||
|     <div id="y-code-renderer"></div> | ||||
|     <script src="./src/index.ts"></script> | ||||
|     <script type="module" src="/src/index.ts"></script> | ||||
|   </body> | ||||
| </html> | ||||
|  | ||||
| @ -15,6 +15,7 @@ | ||||
|   }, | ||||
|   "dependencies": { | ||||
|     "@iframe-resizer/child": "^5.3.3", | ||||
|     "@sentry/vue": "^9.5.0", | ||||
|     "@sy/web-vitals": "workspace:*", | ||||
|     "@tanstack/vue-query": "^5.66.9", | ||||
|     "@vtj/core": "^0.10.12", | ||||
| @ -28,7 +29,7 @@ | ||||
|     "axios": "catalog:", | ||||
|     "core-js": "^3.40.0", | ||||
|     "element-plus": "catalog:", | ||||
|     "licia-es": "^1.46.0", | ||||
|     "licia-es": "catalog:", | ||||
|     "postmate": "catalog:", | ||||
|     "rrweb": "2.0.0-alpha.4", | ||||
|     "vue": "catalog:" | ||||
|  | ||||
| @ -1,5 +1,6 @@ | ||||
| import { createApp } from 'vue'; | ||||
| 
 | ||||
| import * as Sentry from '@sentry/vue'; | ||||
| import { VueQueryPlugin } from '@tanstack/vue-query'; | ||||
| import { IconsPlugin } from '@vtj/icons'; | ||||
| import * as VtjUI from '@vtj/ui'; | ||||
| @ -7,13 +8,17 @@ import ElementPlus from 'element-plus'; | ||||
| 
 | ||||
| import App from './App.vue'; | ||||
| 
 | ||||
| import '@sy/web-vitals'; | ||||
| 
 | ||||
| // import '@sy/web-vitals';
 | ||||
| import 'element-plus/dist/index.css'; | ||||
| import '@vtj/ui/dist/style.css'; | ||||
| 
 | ||||
| const app = createApp(App); | ||||
| 
 | ||||
| Sentry.init({ | ||||
|   app, | ||||
|   dsn: 'https://5bcf1344794fea64fc5e5fe7da4821c1@o4508962650783744.ingest.de.sentry.io/4508962653143120', | ||||
| }); | ||||
| 
 | ||||
| // 批量注册组件
 | ||||
| Object.entries(VtjUI).forEach(([name, component]) => { | ||||
|   app.component(name, component); | ||||
|  | ||||
| @ -1,4 +1,4 @@ | ||||
| import { BlockSchema } from '@vtj/core'; | ||||
| import type { BlockSchema } from '@vtj/core'; | ||||
| 
 | ||||
| import instance from './instance'; | ||||
| 
 | ||||
|  | ||||
| @ -1,12 +1,10 @@ | ||||
| { | ||||
|   "extends": "./node_modules/@vtj/cli/config/tsconfig.web.json", | ||||
|   "compilerOptions": { | ||||
|     "lib": ["ESNext", "DOM"], | ||||
|     "baseUrl": "./", | ||||
|     "module": "nodenext", | ||||
|     "moduleResolution": "nodenext", | ||||
|     "paths": { | ||||
|       "@/*": ["src/*"] | ||||
|       "@/*": ["src/*"], | ||||
|       "$vtj/*": [".vtj/*"] | ||||
|     }, | ||||
|     "noUnusedLocals": false, | ||||
|     "noUnusedParameters": false | ||||
|  | ||||
| @ -6,5 +6,5 @@ | ||||
|     "allowSyntheticDefaultImports": true, | ||||
|     "skipLibCheck": true | ||||
|   }, | ||||
|   "include": ["vite.config.ts"] | ||||
|   "include": ["vite.config.ts", "proxy.config.ts"] | ||||
| } | ||||
|  | ||||
| @ -5,7 +5,6 @@ import { defineConfig, loadEnv } from 'vite'; | ||||
| import mkcert from 'vite-plugin-mkcert'; | ||||
| 
 | ||||
| export default defineConfig(({ mode }) => { | ||||
|   console.log('mode', mode); | ||||
|   const env = loadEnv(mode, process.cwd(), ['VITE_']); | ||||
|   const isDev = env.VITE_NODE_ENV === 'development'; | ||||
| 
 | ||||
| @ -15,7 +14,6 @@ export default defineConfig(({ mode }) => { | ||||
|       ? { | ||||
|           port: Number(env.VITE_PORT), | ||||
|           cors: true, | ||||
|           https: true, // mkcert 需要 https
 | ||||
|         } | ||||
|       : undefined, | ||||
| 
 | ||||
| @ -34,22 +32,5 @@ export default defineConfig(({ mode }) => { | ||||
|     define: { | ||||
|       'process.env': JSON.stringify(env), | ||||
|     }, | ||||
| 
 | ||||
|     // 构建配置
 | ||||
|     build: { | ||||
|       // outDir: path.resolve(process.cwd(), "../../dist/renderer"),
 | ||||
|       // emptyOutDir: true,
 | ||||
|       target: 'es2022', | ||||
|     }, | ||||
| 
 | ||||
|     // 优化依赖
 | ||||
|     optimizeDeps: { | ||||
|       include: [], | ||||
|     }, | ||||
| 
 | ||||
|     // CSS 配置
 | ||||
|     css: { | ||||
|       // 预处理器配置
 | ||||
|     }, | ||||
|   }; | ||||
| }); | ||||
|  | ||||
| @ -1,6 +1,4 @@ | ||||
| # 关于悦码 | ||||
| 
 | ||||
| ::: info 你正在阅读的是 [悦码](https://yue-code-platform.shiyuegame.com) `2.0`版本的文档 | ||||
| # 关于低代码管理平台 | ||||
| 
 | ||||
| ## 特点 | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										0
									
								
								docs/src/platform/index.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								docs/src/platform/index.md
									
									
									
									
									
										Normal file
									
								
							| @ -6,7 +6,8 @@ export const LOGIN_PATH = '/auth/login'; | ||||
| /** | ||||
|  * @zh_CN 默认首页地址 | ||||
|  */ | ||||
| export const DEFAULT_HOME_PATH = '/analytics'; | ||||
| // export const DEFAULT_HOME_PATH = '/analytics';
 | ||||
| export const DEFAULT_HOME_PATH = '/admin/about'; | ||||
| 
 | ||||
| export interface LanguageOption { | ||||
|   label: string; | ||||
|  | ||||
							
								
								
									
										1059
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										1059
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -189,4 +189,4 @@ catalog: | ||||
|   vite-plugin-mkcert: ^1.17.7 | ||||
|   postmate: ^1.5.2 | ||||
|   core-js: ^3.41.0 | ||||
|   licia-es: ^1.46.0 | ||||
|   licia-es: ^1.47.0 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 wangxuefeng
						wangxuefeng