SuperAPI AI 工具集

1k-dev-commands

编程与开发

查看项目

更新于 10-16 02:39

技能介绍

用途:为 OneKey 应用仓库提供统一的开发命令与协作规范,覆盖多平台开发、生产构建、代码校验与测试。分支命名、提交格式、rebase 和 PR 约定见 git-workflow.md。

主要能力与用法: 开发启动:yarn app:desktop(桌面 Electron + Rspack,30-60 秒);yarn app:web:rspack(Web 开发服务器,端口 3000,15-30 秒);yarn app:ext(浏览器扩展,20-40 秒);yarn app:ios 与 yarn app:android(经 Mobile DevSession 启动器,1-2 分钟,含 Metro);yarn app:web-embed(可嵌入组件)。仅在明确要求或诊断启动器时,才用 yarn workspace @onekeyhq/mobile ios / android 直接本地原生构建。

生产构建:yarn app:desktop:build(5-10 分钟,产物在 apps/desktop/dist/);yarn app:ext:build(2-3 分钟,产物在 apps/ext/build/chrome_v3/);yarn app:web:build(3-5 分钟,产物在 apps/web/dist/);yarn app:native-bundle(3-5 分钟)。

校验与测试:提交前用 yarn agent:check --profile commit 做暂存区 lint 与类型检查,可接 git commit;CI 用 yarn lint(约 1 分钟,零容忍所有警告与错误)和 yarn test(Jest)。不要运行 yarn eslint、npx eslint 或 node_modules/.bin/eslint,ESLint 条目仅为遗留兼容,实际校验走 oxlint。辅助命令:yarn clean、yarn reinstall。

适用场景:本地多平台开发、提交前快速校验、CI 全量检查与生产构建验证。

限制与注意:各命令有前置条件(如 Xcode、iOS 模拟器、Android Studio/SDK/模拟器、原生依赖),启动失败可尝试 yarn clean && yarn reinstall;端口占用、Manifest v3 校验、代码签名、包体积与环境变量等为常见问题。Jest 配置在 jest.config.js,测试位于各包的 @tests/ 目录,移动端使用 jest-expo 预设。