🐛 更新一下文档结构

This commit is contained in:
Tw93
2022-12-11 18:44:00 +08:00
parent f130a40b88
commit 1d0eaaf3bc
2 changed files with 18 additions and 165 deletions

View File

@@ -93,7 +93,6 @@
</tr>
</table>
## 命令行打包
<kbd>
@@ -149,86 +148,13 @@ 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/#/) 下载符合产品名称的
2. 关于窗口属性设置,可以在 `tauri.conf.json` 修改 `windows` 属性对应的 `width/height`,是否全屏 `fullscreen`,是否可以调整大小 `resizable`,假如想适配 Mac 沉浸式头部,可以将 `transparent` 设置成 `true`,找到 Header 元素加一个 `padding-top` 样式即可,不想适配改成 `false` 也行
3. `npm run dev` 本地调试看看效果,此外可以使用 `npm run dev:debug` 进行容器调试
4. `npm run build` 运行即可打生产包
1. 关于 Pake 的代码结构可以参考[wiki](https://github.com/tw93/Pake/wiki/Pake-%E7%9A%84%E4%BB%A3%E7%A0%81%E7%BB%93%E6%9E%84%E8%AF%B4%E6%98%8E)
2. 修改 `src-tauri` 目录下的 `tauri.conf.json` 中的 `url、productName、icon、identifier` 这 4 个字段,其中 icon 可以从 icons 目录选择一个,也可以去 [macOSicons](https://macosicons.com/#/) 下载符合产品名称的
3. 关于窗口属性设置,可以在 `tauri.conf.json` 修改 `windows` 属性对应的 `width/height`,是否全屏 `fullscreen`,是否可以调整大小 `resizable`,假如想适配 Mac 沉浸式头部,可以将 `transparent` 设置成 `true`,找到 Header 元素加一个 `padding-top` 样式即可,不想适配改成 `false` 也行
4. `npm run dev` 本地调试看看效果,此外可以使用 `npm run dev:debug` 进行容器调试
5. `npm run build` 运行即可打生产包
## 高级用法
@@ -355,9 +281,9 @@ Pake 的发展离不开这些 Hacker 们,一起贡献了大量能力,也欢
## 支持
- 我有两只猫,一只叫汤圆,一只叫可乐,假如觉得 Pake 让你生活更美好,可以给汤圆可乐 <a href="https://miaoyan.app/cats.html?name=Pake" target="_blank">喂罐头 🥩🍤</a>。
- 如果你喜欢 Pake可以在 Github Star更欢迎 [推荐](https://twitter.com/intent/tweet?url=https://github.com/tw93/Pake&text=Pake%20%E4%B8%80%E4%B8%AA%E5%BE%88%E7%AE%80%E5%8D%95%E7%9A%84%E7%94%A8%20Rust%20%E6%89%93%E5%8C%85%E7%BD%91%E9%A1%B5%E7%94%9F%E6%88%90%20Mac%20App%20%E7%9A%84%E5%B7%A5%E5%85%B7%EF%BC%8C%E7%9B%B8%E6%AF%94%E4%BC%A0%E7%BB%9F%E7%9A%84%20Electron%20%E5%A5%97%E5%A3%B3%E6%89%93%E5%8C%85%EF%BC%8C%E5%A4%A7%E5%B0%8F%E8%A6%81%E5%B0%8F%E5%B0%86%E8%BF%91%2040%20%E5%80%8D%EF%BC%8C%E4%B8%80%E8%88%AC%202M%20%E5%B7%A6%E5%8F%B3%EF%BC%8C%E5%BA%95%E5%B1%82%E4%BD%BF%E7%94%A8Tauri%20%EF%BC%8C%E6%80%A7%E8%83%BD%E4%BD%93%E9%AA%8C%E8%BE%83%20JS%20%E6%A1%86%E6%9E%B6%E8%A6%81%E8%BD%BB%E5%BF%AB%E4%B8%8D%E5%B0%91%EF%BC%8C%E5%86%85%E5%AD%98%E5%B0%8F%E5%BE%88%E5%A4%9A%EF%BC%8C%E6%94%AF%E6%8C%81%E5%BE%AE%E4%BF%A1%E8%AF%BB%E4%B9%A6%E3%80%81Twitter%E3%80%81Youtube%E3%80%81RunCode%E3%80%81Flomo%E3%80%81%E8%AF%AD%E9%9B%80%E7%AD%89%EF%BC%8C%E5%8F%AF%E4%BB%A5%E5%BE%88%E6%96%B9%E4%BE%BF%E4%BA%8C%E6%AC%A1%E5%BC%80%E5%8F%91~) 给你志同道合的朋友使用。
- 可以关注我的 [Twitter](https://twitter.com/HiTw93) 获取到最新的 Pake 更新消息,也欢迎加入 [Telegram](https://t.me/miaoyan) 聊天群。
- 我有两只猫,一只叫汤圆,一只叫可乐,假如觉得 Pake 让你生活更美好,可以给汤圆可乐 <a href="https://miaoyan.app/cats.html?name=Pake" target="_blank">喂罐头 🥩🍤</a>。
- 如果你喜欢 Pake可以在 Github Star更欢迎 [推荐](https://twitter.com/intent/tweet?url=https://github.com/tw93/Pake&text=Pake%20%E4%B8%80%E4%B8%AA%E5%BE%88%E7%AE%80%E5%8D%95%E7%9A%84%E7%94%A8%20Rust%20%E6%89%93%E5%8C%85%E7%BD%91%E9%A1%B5%E7%94%9F%E6%88%90%20Mac%20App%20%E7%9A%84%E5%B7%A5%E5%85%B7%EF%BC%8C%E7%9B%B8%E6%AF%94%E4%BC%A0%E7%BB%9F%E7%9A%84%20Electron%20%E5%A5%97%E5%A3%B3%E6%89%93%E5%8C%85%EF%BC%8C%E5%A4%A7%E5%B0%8F%E8%A6%81%E5%B0%8F%E5%B0%86%E8%BF%91%2040%20%E5%80%8D%EF%BC%8C%E4%B8%80%E8%88%AC%202M%20%E5%B7%A6%E5%8F%B3%EF%BC%8C%E5%BA%95%E5%B1%82%E4%BD%BF%E7%94%A8Tauri%20%EF%BC%8C%E6%80%A7%E8%83%BD%E4%BD%93%E9%AA%8C%E8%BE%83%20JS%20%E6%A1%86%E6%9E%B6%E8%A6%81%E8%BD%BB%E5%BF%AB%E4%B8%8D%E5%B0%91%EF%BC%8C%E5%86%85%E5%AD%98%E5%B0%8F%E5%BE%88%E5%A4%9A%EF%BC%8C%E6%94%AF%E6%8C%81%E5%BE%AE%E4%BF%A1%E8%AF%BB%E4%B9%A6%E3%80%81Twitter%E3%80%81Youtube%E3%80%81RunCode%E3%80%81Flomo%E3%80%81%E8%AF%AD%E9%9B%80%E7%AD%89%EF%BC%8C%E5%8F%AF%E4%BB%A5%E5%BE%88%E6%96%B9%E4%BE%BF%E4%BA%8C%E6%AC%A1%E5%BC%80%E5%8F%91~) 给你志同道合的朋友使用。
- 可以关注我的 [Twitter](https://twitter.com/HiTw93) 获取到最新的 Pake 更新消息,也欢迎加入 [Telegram](https://t.me/miaoyan) 聊天群。
## 最后

View File

@@ -148,86 +148,13 @@ npm run build
```
### Document Description
## Custom Usage
- 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.
2. For window property settings, you can modify the `width/height` of the `windows` property in `tauri.conf.json`, whether it is `fullscreen`, whether it is `resizable`, If you want to adapt the immersive header under Mac, you can set `transparent` to `true` and then find header element and add the `padding-top` style.
3. `npm run dev` for local debugging; `npm run dev:debug` to open the devtools for container debugging.
4. `npm run build` can be run to package for production.
1. The code structure of Pake can be referred to [wiki](https://github.com/tw93/Pake/wiki/Description-of-Pake's-code-structure).
2. 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.
3. For window property settings, you can modify the `width/height` of the `windows` property in `tauri.conf.json`, whether it is `fullscreen`, whether it is `resizable`, If you want to adapt the immersive header under Mac, you can set `transparent` to `true` and then find header element and add the `padding-top` style.
4. `npm run dev` for local debugging; `npm run dev:debug` to open the devtools for container debugging.
5. `npm run build` can be run to package for production.
## Advanced
@@ -245,9 +172,9 @@ Refer to the communication code in `pake.js` with `postMessage`, write the event
## Support
- I have two cats, one is called TangYuan, and one is called Coke, If you think Pake makes your life better, you can give my cats <a href="https://miaoyan.app/cats.html?name=Pake" target="_blank">feed canned food 🥩🍤</a>.
- If you like Pake, you can star it in Github. We are more welcome to [recommend Pake](https://twitter.com/intent/tweet?url=https://github.com/tw93/Pake&text=Pake%20-%20A%20simple%20Rust%20packaged%20web%20pages%20to%20generate%20Mac%20App%20tool,%20compared%20to%20traditional%20Electron%20package,%20the%20size%20of%20nearly%2040%20times%20smaller,%20generally%20about%202M,%20the%20underlying%20use%20of%20Tauri,%20performance%20experience%20than%20the%20JS%20framework%20is%20much%20lighter~) to your like-minded friends.
- You can follow my [Twitter](https://twitter.com/HiTw93) to get the latest news of Pake, or join [Telegram](https://t.me/miaoyan) chat group.
- I have two cats, one is called TangYuan, and one is called Coke, If you think Pake makes your life better, you can give my cats <a href="https://miaoyan.app/cats.html?name=Pake" target="_blank">feed canned food 🥩🍤</a>.
- If you like Pake, you can star it in Github. We are more welcome to [recommend Pake](https://twitter.com/intent/tweet?url=https://github.com/tw93/Pake&text=Pake%20-%20A%20simple%20Rust%20packaged%20web%20pages%20to%20generate%20Mac%20App%20tool,%20compared%20to%20traditional%20Electron%20package,%20the%20size%20of%20nearly%2040%20times%20smaller,%20generally%20about%202M,%20the%20underlying%20use%20of%20Tauri,%20performance%20experience%20than%20the%20JS%20framework%20is%20much%20lighter~) to your like-minded friends.
- You can follow my [Twitter](https://twitter.com/HiTw93) to get the latest news of Pake, or join [Telegram](https://t.me/miaoyan) chat group.
## Finally