Files
SoonDesign/README.md
T
2025-12-19 19:37:41 +08:00

161 lines
2.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# SoonDesign 设计工具
简单易用的桌面设计软件,支持光盘和卡片模板设计。
---
## 🚀 快速开始
### 第一次使用
```bash
# 1. 安装依赖(只需一次)
yarn install
# 2. 启动程序
yarn start
```
> **前置要求**:需要安装 [Node.js](https://nodejs.org/)(推荐 16 或更高版本)
---
## 📦 发布流程(傻瓜式操作)
### 方式一:一键发布 ⭐ 推荐
```bash
# Windows 系统
yarn release:win
# Mac 系统
yarn release:mac
# Linux 系统
yarn release:linux
```
**自动完成**:加密 → 测试 → 清理 → 打包
**安装包位置**`build` 文件夹
---
### 方式二:分步操作(手动控制)
#### 步骤 1:加密代码
```bash
yarn encrypt:win # Windows
yarn encrypt:linux # Mac/Linux
```
✅ 生成 `.jsc` 加密文件(自动覆盖旧文件)
#### 步骤 2:测试
```bash
yarn start
```
✅ 确认程序正常运行,无报错
#### 步骤 3:清理源文件
```bash
yarn cleanup
```
✅ 删除 `.js` 源文件,自动备份到 `.backup` 文件夹
#### 步骤 4:打包
```bash
yarn build:win # Windows
yarn build:mac # Mac
yarn build:linux # Linux
```
✅ 生成安装包到 `build` 文件夹
---
## 🔧 其他常用命令
### 恢复源文件
```bash
yarn restore
```
> 从 `.backup` 文件夹恢复所有源文件(误删除时使用)
### 清理加密文件
```bash
yarn cleanup:jsc
```
> 删除所有 `.jsc` 文件(重新加密前使用)
### 修改文件名映射
编辑 `lib/module-map.json`
```json
{
"mappings": {
"design1": {
"core": "core1", // 修改这里
"output": "output1",
"ui": "ui1"
}
}
}
```
然后重新运行 `yarn encrypt:win`
---
## ⚠️ 注意事项
- **开发时**:保留 `.js` 源文件,不要运行 `cleanup`
- **发布时**:必须先加密、再清理、最后打包
- **备份在**`.backup` 文件夹(不会被打包进应用)
---
## 📁 项目结构
```
lib/
├── module-map.json - 文件名映射配置
├── index.js - 首页入口
├── design1.js - 光盘模板入口
├── design2.js - 卡片模板入口
├── design1/ - 光盘模板功能模块
│ ├── core.js - 核心功能
│ ├── output.js - 导出/保存
│ └── ui.js - 界面交互
└── design2/ - 卡片模板功能模块
├── core.js
├── output.js
└── ui.js
scripts/encrypt/ - 加密脚本(不会被打包)
.backup/ - 源文件备份(不会被打包)
```
---
## 🔧 调试模式
`F12``Ctrl+Shift+I` 打开开发者工具查看错误信息。
---
## 📚 更多文档
- [加密详细说明](scripts/encrypt/README.md)
- 当前版本:v2.3.017