更新项目文件说明

This commit is contained in:
Tlntin
2022-12-11 17:24:21 +08:00
parent 23d3a750d6
commit f130a40b88
2 changed files with 148 additions and 0 deletions

View File

@@ -149,6 +149,80 @@ npm run build
```
### 文档说明
- 总的项目文档树
```bash
.
├── app.csv
├── bin
│ ├── builders
│ ├── cli.ts
│ ├── defaults.ts
│ ├── helpers
│ ├── options
│ ├── README_EN.md
│ ├── README.md
│ ├── types.ts
│ └── utils
├── cli.js
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── dist
│ └── cli.js
├── icns2png.py
├── LICENSE
├── package.json
├── pake-default.icns
├── README_EN.md
├── README.md
├── rollup.config.js
├── script
│ ├── build.bat
│ ├── build.sh
│ ├── sd-apple-x64
│ ├── sd.exe
│ └── sd-linux-x64
├── src-tauri
│ ├── assets
│ ├── build.rs
│ ├── Cargo.lock
│ ├── Cargo.toml
│ ├── icons
│ ├── png
│ ├── src
│ ├ ├──main.rs
│ ├ └──pake.js
│ ├── tauri.conf.json
│ ├── tauri.linux.conf.json
│ ├── tauri.macos.conf.json
│ └── tauri.windows.conf.json
└── tsconfig.json
```
- app.csv用于bash/bat命令批量替换打包。
- bin采用TypeScript编写为pake-cli即pake命令行打包工具的源码可以使用`npm run cli:build`来生成最终配置文件`dist\cli.js`
- cli.jspake-cli的入口文件该文件调用`dist\cli.js`文件,基本不用修改,可以忽略。
- dist\cli.js`npm run cli:build`生成。
- icns2png.pypython3编写用于将Mac默认的icns图标转化为windows/Linux的ico与png格式图标。
- package.jsonnpm模块依赖配置文件运行`npm i``npm run xxx`时候需要用到该文件,用于构建基础开发环境。
- pake-default.icnspake默认的图标适用于MacOS。
- script用于批量打包多个app的脚本内置了[sd](https://github.com/chmln/sd)二进制包。可以用`npm run build:all-unix``npm run build:all-windows`分别调用Mac/Linux与Windows的批量打包功能。
- src-tauri/assets储存了一个Linux的desktop图标配置文件和Windows msi安装配置文件。
- src-tauri/build.rstauri编译入口基本不用修改可忽略。
- src-tauri/Cargo.lockcargo包管理配置结果文件可忽略。
- src-tauri/Cargo.tomlcargo包依赖配置文件用于管理各个crate版本信息基本不用修改可忽略。
- src-tauri/icons储存了一系列icns格式的图标文件适用于MacOS应用图标。
- src-tauri/png由上面的icons文件夹生成储存了ico与png格式文件适用于Linux/Windows的应用图标。
- src-tauri/src/main.rc主程序文件需要修改程序跨平台移植方案重点修改这个。
- src-tauri/src/pake.js主程序文件配套的js代码用于添加快捷键监听页面渲染效果等等。
- src-tauri/tauri.conf.json主配置文件用于控制包名版本号打开链接窗口大小等等。
- src-tauri/tauri.linux.conf.jsonLinux平台编译时用到的配置文件包含Linux专用图标维护者二进制格式映射相关等等。
- src-tauri/tauri.macos.conf.jsonMacOS平台编译时用到的配置文件包含MacOS专用图标维护者二进制格式等等。
- src-tauri/tauri.windows.conf.jsonWindows平台编译时用到的配置文件包含Windows专用图标维护者二进制格式左上角小图标映射相关等等。
- tsconfig.jsonTypeScript配置基本不需要修改可忽略。
## 打新包
1. 修改 `src-tauri` 目录下的 `tauri.conf.json` 中的 `url、productName、icon、identifier` 这 4 个字段,其中 icon 可以从 icons 目录选择一个,也可以去 [macOSicons](https://macosicons.com/#/) 下载符合产品名称的

View File

@@ -148,6 +148,80 @@ npm run build
```
### Document Description
- file tree
```bash
.
├── app.csv
├── bin
│ ├── builders
│ ├── cli.ts
│ ├── defaults.ts
│ ├── helpers
│ ├── options
│ ├── README_EN.md
│ ├── README.md
│ ├── types.ts
│ └── utils
├── cli.js
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── dist
│ └── cli.js
├── icns2png.py
├── LICENSE
├── package.json
├── pake-default.icns
├── README_EN.md
├── README.md
├── rollup.config.js
├── script
│ ├── build.bat
│ ├── build.sh
│ ├── sd-apple-x64
│ ├── sd.exe
│ └── sd-linux-x64
├── src-tauri
│ ├── assets
│ ├── build.rs
│ ├── Cargo.lock
│ ├── Cargo.toml
│ ├── icons
│ ├── png
│ ├── src
│ ├ ├──main.rs
│ ├ └──pake.js
│ ├── tauri.conf.json
│ ├── tauri.linux.conf.json
│ ├── tauri.macos.conf.json
│ └── tauri.windows.conf.json
└── tsconfig.json
```
- app.csvUsed for batch replacement and packaging of bash/bat command.
- binIt is written in TypeScript and is the source code of the Pake cli, the Pake command line packaging tool. You can use `npm run cli: build` to generate the final configuration file 'dist cli. js'.
- cli.jsThe entry file of pake-cli. This file calls the 'dist cli. js' file, which is basically not modified and can be ignored.
- dist\cli.jsGenerated by `npm run cli: build`.
- icns2png.pyWritten in python 3, it is used to convert Mac default icns icons to windows/Linux icons in ico and png formats.
- package.jsonThe npm module depends on the configuration file, which is used to build the basic development environment when running `npm i` and `npm run xxx`.
- pake-default.icnsThe default icon of pake, applicable to MacOS.
- scriptA script for batch packaging multiple apps, with [sd]( https://github.com/chmln/sd) built-inBinary package. You can use `npm run build: all unix` and `npm run build: all windows` to call the batch packaging function of Mac/Linux and Windows respectively.
- src-tauri/assetsIt stores a Linux desktop icon configuration file and a Windows msi installation configuration file.
- src-tauri/build.rsThe tauri compiler entry does not need to be modified and can be ignored.
- src-tauri/Cargo.lockThe cargo package management configuration result file can be ignored.
- src-tauri/Cargo.tomlThe cargo package depends on the configuration file, which is used to manage the information of various crate versions. It basically does not need to be modified and can be ignored.
- src-tauri/iconsA series of icon files in icns format are stored, which are suitable for MacOS application icons.
- src-tauri/pngGenerated from the icons folder above, it stores ico and png files, which are applicable to Linux/Windows application icons.
- src-tauri/src/main.rcThe main program file needs to be modified. The cross platform migration scheme focuses on this.
- src-tauri/src/pake.jsThe js code matched with the main program file is used to add shortcut key monitoring, page rendering effects, and so on.
- src-tauri/tauri.conf.jsonThe main configuration file is used to control the package name, version number, open link, window size, etc.
- src-tauri/tauri.linux.conf.jsonThe configuration file used when compiling the Linux platform, including Linux specific icons, maintainers, binary formats, mapping, etc.
- src-tauri/tauri.macos.conf.jsonConfiguration files used for compiling the MacOS platform, including MacOS specific icons, maintainers, binary formats, and so on.
- src-tauri/tauri.windows.conf.jsonThe configuration file used when compiling the Windows platform, including Windows specific icons, maintainers, binary formats, small icon mapping in the upper left corner, and so on.
- tsconfig.jsonTypeScript configuration. It basically does not need to be modified and can be ignored.
## New pack
1. Modify the `tauri.conf.json` in the `src-tauri` directory to include 4 fields `url, productName, icon, identifier`, icon can be selected from the `icons` directory or downloaded from [macOSicons](https://macosicons.com/#/) to match the product.