chore: bump version to 0.1.5 and add version synchronization script

- Updated version in package.json, Cargo.toml, Cargo.lock, and tauri.conf.json to 0.1.5.
- Introduced a new script (sync-version.mjs) to synchronize version across configuration files.
- Modified build and release scripts to include version synchronization.
This commit is contained in:
Kang committed 2026-03-06 10:13:42 +08:00
1 parent fca033fe29
commit 7894e410c4
5 files changed
+36 -6

No files matched your search

+4 -2
View File
@@ -1,7 +1,7 @@
{
"name": "dragonfly",
"private": true,
"version": "0.1.0",
"version": "0.1.5",
"description": "A modern, high-performance SSH client built with Tauri and React.",
"author": "CoderKang",
"homepage": "https://github.com/CoderKang/Dragonfly",
@@ -14,8 +14,10 @@
},
"type": "module",
"scripts": {
"version-sync": "node scripts/sync-version.mjs",
"release": "node scripts/sync-version.mjs --commit && tsc && vite build",
"dev": "vite",
"build": "tsc && vite build",
"build": "node scripts/sync-version.mjs && tsc && vite build",
"preview": "vite preview",
"tauri": "tauri",
"lint": "biome check src/",
+28
View File
@@ -0,0 +1,28 @@
import { readFileSync, writeFileSync } from 'fs';
import { execSync } from 'child_process';
const pkg = JSON.parse(readFileSync('package.json', 'utf-8'));
const version = pkg.version;
// 同步到 tauri.conf.json
const tauriConf = JSON.parse(readFileSync('src-tauri/tauri.conf.json', 'utf-8'));
tauriConf.version = version;
writeFileSync('src-tauri/tauri.conf.json', JSON.stringify(tauriConf, null, 2) + '\n');
// 同步到 Cargo.toml(仅替换 [package] 下的 version,不影响依赖项的 version)
let cargo = readFileSync('src-tauri/Cargo.toml', 'utf-8');
cargo = cargo.replace(
/(\[package\]\s*\nname\s*=\s*"[^"]*"\s*\n)version\s*=\s*"[^"]*"/,
`$1version = "${version}"`
);
writeFileSync('src-tauri/Cargo.toml', cargo);
console.log(`✅ Version synced to ${version}`);
// 如果传入 --commit 参数,自动提交版本变更
if (process.argv.includes('--commit')) {
const files = ['package.json', 'src-tauri/tauri.conf.json', 'src-tauri/Cargo.toml'];
execSync(`git add ${files.join(' ')}`, { stdio: 'inherit' });
execSync(`git commit -m "chore: bump version to v${version}"`, { stdio: 'inherit' });
console.log(`✅ Committed: chore: bump version to v${version}`);
}
+1 -1
View File
@@ -1237,7 +1237,7 @@ dependencies = [
[[package]]
name = "dragonfly"
version = "0.1.0"
version = "0.1.5"
dependencies = [
"aes-gcm",
"async-http-proxy",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "dragonfly"
version = "0.1.0"
version = "0.1.5"
description = "A Tauri App"
authors = ["Kang"]
edition = "2021"
+2 -2
View File
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Dragonfly",
"version": "0.1.0",
"version": "0.1.5",
"identifier": "com.kang.dragonfly",
"build": {
"beforeDevCommand": "pnpm dev",
@@ -34,4 +34,4 @@
"icons/icon.ico"
]
}
}
}