From 7ce60b860c4f7982add0da3dfedccd8cf6e0f18e Mon Sep 17 00:00:00 2001 From: Seven Date: Tue, 30 Dec 2025 17:48:18 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20@riwa/api-types=20?= =?UTF-8?q?=E7=9A=84=E4=BE=9D=E8=B5=96=E5=9C=B0=E5=9D=80=EF=BC=9B=E8=B0=83?= =?UTF-8?q?=E6=95=B4=20pnpm=20=E9=94=81=E5=AE=9A=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/copilot-instructions.md | 50 ++++++--------------------------- package.json | 2 +- pnpm-lock.yaml | 10 +++---- 3 files changed, 15 insertions(+), 47 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index deff8e5..a082f43 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -70,77 +70,45 @@ API 集成: 使用 TypeScript 严格模式,避免 any 类型 组件命名使用 PascalCase,文件名使用 PascalCase 或 kebab-case 使用 @/ 作为 src 目录的别名 +使用 #/ 作为类型定义的别名 颜色主题使用ion-color 变量,支持深色模式和浅色模式 -2. 项目结构 -``` -src/ -├── api/ # API 接口层 -│ ├── enum.ts # 枚举定义 -│ ├── index.ts # API 客户端配置 -│ └── types.ts # API 类型定义 -├── auth/ # 认证模块 -│ ├── index.ts # 认证逻辑 -│ ├── type.ts # 认证类型定义 -│ └── components/ # 登录/注册组件 -├── components/ # 可复用组件 -│ ├── layout/ # 布局组件 -│ └── ui/ # UI 基础组件 -├── composables/ # Vue 组合式函数 -├── locales/ # 国际化文件 -├── router/ # 路由配置 -├── store/ # Pinia 状态管理 -├── theme/ # 主题样式文件 -├── types/ # TypeScript 类型定义 -├── utils/ # 工具函数 -└── views/ # 页面组件 - ├── chat/ # 聊天页面 - ├── deposit/ # 充值页面 - ├── issue/ # 发行申请页面 - ├── market/ # 市场页面 - ├── onchain-address/ # 链上地址管理 - ├── riwa/ # 主页面 - ├── trade/ # 交易页面及相关组件 - ├── trade-settings/ # 交易设置(银行管理等) - ├── user/ # 用户中心及设置 - └── withdraw/ # 提现页面 -``` -3. 组件结构 +2. 组件结构 使用 Ionic 组件库(IonPage, IonHeader, IonContent, IonToolbar 等) 页面组件放在 views 目录 可复用组件放在 components 目录 每个页面组件必须包裹在 中 -4. 路由配置 +3. 路由配置 使用 @ionic/vue-router 创建路由 采用嵌套路由结构,主要页面在 /layout 下 懒加载页面组件以优化性能 路由配置在 router/index.ts 支持路由守卫 (router/guard.ts) -5. 样式管理 +4. 样式管理 TailwindCSS 4.x 作为主要样式框架,集成 Ionic CSS Variables 支持深色模式和浅色模式切换 TailwindCSS 配置扩展了 Ionic 颜色变量 主题文件:theme/variables.css, theme/ionic.css -6. 自动导入配置 +5. 自动导入配置 Vue 组合式函数自动导入:composables、utils、store 目录 Vue 生态自动导入:vue、vue-router、@vueuse/core、vue-i18n、pinia 组件自动导入:IonicResolver、@iconify 图标 支持目录作为命名空间 -7. 原生功能集成 +6. 原生功能集成 通过 Capacitor 插件访问原生功能 配置文件:capacitor.config.ts iOS 构建目录:ios 使用前检查平台兼容性 -8. API 集成模式 +7. API 集成模式 使用 @elysiajs/eden 进行类型安全的 API 调用 项目专用 API 类型定义:@riwa/api-types API 配置集中在 src/api/index.ts 枚举定义统一在 src/api/enum.ts -9. 认证系统 +8. 认证系统 集成 better-auth 提供现代认证功能 认证逻辑封装在 src/auth/index.ts 支持登录、注册组件复用 认证状态管理通过 useAuth composable -10.图表集成 +9. 图表集成 使用 TradingView Charting Library 集成金融图表 图表组件封装在 src/tradingview/index.tsx TradingView 官方文档:https://www.tradingview.com/charting-library-docs/latest/getting_started/ diff --git a/package.json b/package.json index b82fc8b..c2f0264 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "@elysiajs/eden": "^1.4.5", "@ionic/vue": "^8.7.11", "@ionic/vue-router": "^8.7.11", - "@riwa/api-types": "http://192.168.1.27:9527/api/riwa-api-types-0.0.67.tgz", + "@riwa/api-types": "http://192.168.1.3:9527/api/riwa-api-types-0.0.67.tgz", "@tailwindcss/vite": "^4.1.18", "@vee-validate/yup": "^4.15.1", "@vueuse/core": "^14.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index de29a6f..0a9730f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,8 +57,8 @@ importers: specifier: ^8.7.11 version: 8.7.11(@stencil/core@4.39.0)(vue-router@4.6.3(vue@3.5.25(typescript@5.9.3)))(vue@3.5.25(typescript@5.9.3)) '@riwa/api-types': - specifier: http://192.168.1.27:9527/api/riwa-api-types-0.0.67.tgz - version: http://192.168.1.27:9527/api/riwa-api-types-0.0.67.tgz(@elysiajs/eden@1.4.5(elysia@1.4.18(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3))) + specifier: http://192.168.1.3:9527/api/riwa-api-types-0.0.67.tgz + version: http://192.168.1.3:9527/api/riwa-api-types-0.0.67.tgz(@elysiajs/eden@1.4.5(elysia@1.4.18(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3))) '@tailwindcss/vite': specifier: ^4.1.18 version: 4.1.18(vite@7.2.7(@types/node@24.10.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.1)(yaml@2.8.2)) @@ -1401,8 +1401,8 @@ packages: resolution: {integrity: sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - '@riwa/api-types@http://192.168.1.27:9527/api/riwa-api-types-0.0.67.tgz': - resolution: {tarball: http://192.168.1.27:9527/api/riwa-api-types-0.0.67.tgz} + '@riwa/api-types@http://192.168.1.3:9527/api/riwa-api-types-0.0.67.tgz': + resolution: {tarball: http://192.168.1.3:9527/api/riwa-api-types-0.0.67.tgz} version: 0.0.67 peerDependencies: '@elysiajs/eden': ^1.4.5 @@ -6644,7 +6644,7 @@ snapshots: '@pkgr/core@0.2.9': {} - '@riwa/api-types@http://192.168.1.27:9527/api/riwa-api-types-0.0.67.tgz(@elysiajs/eden@1.4.5(elysia@1.4.18(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3)))': + '@riwa/api-types@http://192.168.1.3:9527/api/riwa-api-types-0.0.67.tgz(@elysiajs/eden@1.4.5(elysia@1.4.18(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3)))': dependencies: '@elysiajs/eden': 1.4.5(elysia@1.4.18(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3))