- Remote (Live anywhere)
- Global Pay (Literally)
- ESOP (For everybody)
- Open Source (As you see)
- Awesome Colleagues (Hell Yeah!)
👉 Click here to check all open positions
- 远程 (生活在哪个城市都可以)
- 全球一致的薪酬 (真的)
- 全员持股计划 (每个人都有)
- 开源 (如你所见)
- 超级棒的同事 (爽呆!)
- Community Forum. Best for: help with building, discussion about best practices.
- GitHub Issues. Best for: bugs and errors you encounter using OneKey.
- Discord. Best for: sharing your ideas and hanging out with the community.
- Alpha: We are testing Supabase with a closed set of customers
- Public: Production-ready
We really need your support, star or watch this repo for latest updates.
- Install node.js LTS version (>= 16)
- Install yarn package management tool
- Install git lfs (some binaries are required for pulling and updating)
After pulling the latest code via the git command line tool, install the project dependencies in the root directory via the yarn
command
# Install all JS dependencies and submodule dependencies
yarn
# Install the expo command line tool globally
npm install -g expo-cli
Execute the following commands in the root directory to develop different business code
yarn web
: Develop web mode, which starts a static server on port 3000 locallyyarn ios
: connect to iphone device via USB for development debuggingyarn android
: develop androidyarn desktop
: development in desktop mode
The repositories are organized using the monorepo model to keep the code on different ends centralized and unaffected, while making it as reusable as possible during the packaging and compilation process
packages/components
holds UI componentspackages/kit
holds reusable page-level UI contentpackages/app
APP codepackages/desktop
Desktop electron codepackages/web
web-side codepackages/extension
Plugin-side code
Each subdirectory under the packages/
directory is a separate project, and the corresponding monorepo name is the value of the name
field in the corresponding directory package.json.
When you need to install a dependency for a subdirectory, just use yarn workspace @onekeyhq/web add axios
. With a prefix like yarn workspace @onekeyhq/web
, the axios module can eventually be installed in the root directory in the web subproject.
Some of the dependencies have native parts, so you need to go into the packages/app/ios
directory and do a pod install
after installing the JS dependencies.
- The app does not start
Clear the packaging tool cache with the --reset-cache
command in yarn native
in the root directory. Also run yarn clean
in the root directory to clear all dependencies and generated files and then re-run yarn
to install the dependencies.
- 安装 node.js LTS 版本(>= 16)
- 安装 yarn 包管理工具
- 安装 git lfs(部分二进制文件在拉取和更新时需要)
通过 git 命令行工具拉取最新的代码之后,通过 yarn
命令在根目录安装项目依赖
# 安装所有 JS 依赖及子模块依赖
yarn
# 全局安装 expo 命令行工具
npm install -g expo-cli
在根目录执行以下命令,从而开发不同的业务代码
yarn web
: 开发网页模式,会启动静态服务器在本地 3000 端口yarn ios
: 通过 USB 连接 iphone 设备进行开发调试yarn android
: 调试安卓yarn desktop
: 开发桌面端模式
在 packages/app/android/lib-keys-secret/src/main/cpp/keys.c
中配置相关 key,也可以使用默认选项。可能一些 API 会有限制。
- 前往加密仓库获取
debug.keystore
文件,放入packages/app/android/keystores
目录中,没有该目录请自行创建。 - 前往加密仓库获取
keys.secret
文件,放入packages/app/android
目录中。
仓库使用 monorepo 模式进行组织,在保证不同端的代码集中且互相不影响的大前提下,又尽可能的在打包和编译过程中让代码复用
packages/components
存放 UI 组件packages/kit
存放可复用页面级别 UI 内容packages/app
APP 代码packages/desktop
桌面端 electron 代码packages/web
网页端代码packages/extension
插件端代码
packages/
目录下的每一个子目录即一个独立的项目,对应在 monorepo 名称即为对应目录中 package.json 的 name
字段的值。
当需要给某一个子目录安装依赖时,只需要使用 yarn workspace @onekeyhq/web add axios
。通过 yarn workspace @onekeyhq/web
这样的前缀,最终可以在根目录把 axios 模块安装到 web 这个子项目当中。
部分依赖有原生部分,所以执行安装完 JS 依赖后需要进入 packages/app/ios
目录下执行 pod install
。
- app 无法启动
通过根目录下的 yarn native
中 --reset-cache
命令清除打包工具缓存。同时配合根目录下命令 yarn clean
清除所有依赖及生成文件后重新执行 yarn
安装依赖。