Skip to content

Commit 8a71eea

Browse files
committed
chore(browserslist): update caniuse-lite DB; feat(vite): config + env bridge; ci: Node 20.18
1 parent 599b6b9 commit 8a71eea

14 files changed

Lines changed: 1677 additions & 461 deletions

File tree

.env

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
REACT_APP_ganacheAddress =0x425f8Caf35a6D87906E6d60bb2570EB2010D724f
2-
REACT_APP_ganacheRpc = "HTTP://127.0.0.1:7545"
1+
REACT_APP_ganacheAddress =0x425f8Caf35a6D87906E6d60bb2570EB2010D724f
2+
REACT_APP_ganacheRpc = "HTTP://127.0.0.1:7545"
33
REACT_APP_BASE_URL=http://localhost:3000
44
PORT=9754
5+
6+
# Vite style envs (preferred going forward)
7+
VITE_ganacheAddress=0x425f8Caf35a6D87906E6d60bb2570EB2010D724f
8+
VITE_ganacheRpc=http://127.0.0.1:7545
9+
VITE_BASE_URL=http://localhost:3000

.github/workflows/tauri-nightly.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup Node
2222
uses: actions/setup-node@v4
2323
with:
24-
node-version: 18
24+
node-version: 20.18.0
2525
cache: 'npm'
2626

2727
- name: Setup Rust
@@ -59,4 +59,3 @@ jobs:
5959
6060
# If you want a prerelease on every push, replace the two steps above with tauri-action like in release workflow,
6161
# and set `prerelease: true`, `releaseDraft: false`, and use a tag like `nightly-${{ github.sha }}`.
62-

.github/workflows/tauri-release.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Setup Node
2828
uses: actions/setup-node@v4
2929
with:
30-
node-version: 18
30+
node-version: 20.18.0
3131
cache: 'npm'
3232

3333
- name: Setup Rust
@@ -76,4 +76,3 @@ jobs:
7676
releaseBody: 'Automated release for version __VERSION__.'
7777
releaseDraft: false
7878
prerelease: false
79-

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18.20.4
1+
20.18.0

README.md

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
**当前状态**
66
- 仅保留主分支 `main`,历史快照以 tag 方式保留:`pre-merge-master``pre-merge-tauri-version`、发布点 `v0.2.7`
7-
- `src-tauri/` 已并入,Tauri 与 CRA 联动开发,端口一致为 `9754`
7+
- 已迁移到 Vite(保留 CRA 以便回退),Tauri 联动端口为 `9754`
88

99
**功能概览(持续完善)**
1010
- 钱包基础:创建、助记词恢复、转账、基础数据
@@ -26,23 +26,24 @@
2626
- `.env`:本地环境变量(含 `PORT=9754`
2727

2828
## 环境要求
29-
- Node.js 18+ 与 npm(或 pnpm/yarn 自行替代)
29+
- Node.js ≥ 20.18(推荐 20.18.0)与 npm(或 pnpm/yarn 自行替代)
3030
- Rust 稳定版工具链:`rustup`, `cargo`
3131
- Windows(开发/打包):需安装 Visual Studio C++ 构建工具(Desktop development with C++)
3232

3333
## 快速开始
3434
- 安装依赖:
3535
- `npm install`
36-
- 开发(浏览器预览):
37-
- `npm start``http://localhost:9754`
38-
-`.env:1``PORT=9754` 指定端口
39-
- 开发(桌面版调试):
36+
- 开发(Vite 浏览器预览,推荐):
37+
- `npm run dev:vite``http://localhost:9754`
38+
- 开发(Tauri 桌面版调试,走 Vite):
4039
- `npm run tauri:dev`
41-
- Tauri 会执行 `beforeDevCommand: npm start` 并指向 `devUrl: http://localhost:9754`
42-
- 构建(Web 静态站点):
43-
- `npm run build` → 输出到 `build/`
40+
- 构建(Web 静态站点 via Vite):
41+
- `npm run build:vite` → 输出到 `dist/`
4442
- 构建(Tauri 桌面应用):
4543
- `npm run tauri:build` → 输出到 `src-tauri/target/release/bundle/`
44+
- 兼容保留(可选):
45+
- CRA 开发:`npm start`(端口仍取 `.env``PORT=9754`
46+
- CRA 构建:`npm run build``build/`
4647

4748
## 版本管理(自动同步)
4849
- 版本统一以 `package.json:1` 为准,执行 `npm version` 自动同步到:
@@ -64,18 +65,22 @@
6465
## 关键配置
6566
- 端口(开发):
6667
- `.env:1` 设置 `PORT=9754`
67-
- `src-tauri/tauri.conf.json:1``build.devUrl = "http://localhost:9754"`
68+
- `src-tauri/tauri.conf.json:6``build.devUrl = "http://localhost:9754"`
6869
- 构建路径(生产):
69-
- CRA 输出 `build/`
70-
- `src-tauri/tauri.conf.json:1``build.frontendDist = "../build"`
71-
- 常用脚本(`package.json:1`):
72-
- `start``build`(CRA)
73-
- `tauri``tauri:dev``tauri:build`(Tauri)
70+
- Vite 输出 `dist/``src-tauri/tauri.conf.json:6``build.frontendDist = "../dist"`
71+
- CRA 输出 `build/`(兼容保留)
72+
- 常用脚本(`package.json:33` 起):
73+
- Vite:`dev:vite``build:vite``preview:vite`
74+
- CRA:`start``build`
75+
- Tauri:`tauri:dev``tauri:build`
7476

7577
## 环境变量与外部服务
76-
- `.env:1` 示例(已包含)
78+
- `.env:1` 示例:
7779
- `PORT=9754`(开发端口)
78-
- 其他案例变量:`REACT_APP_ganacheAddress``REACT_APP_ganacheRpc``REACT_APP_BASE_URL`
80+
- 已兼容两种风格:
81+
- CRA:`REACT_APP_ganacheAddress``REACT_APP_ganacheRpc``REACT_APP_BASE_URL`
82+
- Vite:`VITE_ganacheAddress``VITE_ganacheRpc``VITE_BASE_URL`
83+
- 代码中已提供兼容读取(见 `src/env.js:1`),可逐步迁移为 `VITE_*`
7984
- 如使用 Etherscan API(合约验证/查询),请自行配置 API Key(可放入 `.env``REACT_APP_...` 形式)。
8085
- 访问主网/测试网请配置可靠的 RPC(Infura/Alchemy/自建节点等)。
8186

index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>blockchain_interact_tools</title>
7+
</head>
8+
<body>
9+
<div id="root"></div>
10+
<script type="module" src="/src/index.jsx"></script>
11+
</body>
12+
13+
</html>

0 commit comments

Comments
 (0)