Skip to content

Commit b2d0d7a

Browse files
committed
🎨 Refactoring CLI
1 parent 87e91ec commit b2d0d7a

38 files changed

+1452
-5106
lines changed

.prettierignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
target
1+
src-tauri/target
22
node_modules
33
dist/**/*
4-
!dist/twitter.css

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ In addition, double-click the title bar to switch to full-screen mode. For Mac u
159159

160160
![Pake](https://gw.alipayobjects.com/zos/k/zd/pake.gif)
161161

162-
**Pake provides a command line tool, making the flow of package customization quicker and easier. See [documentation](./bin/README_EN.md) for more information.**
162+
**Pake provides a command line tool, making the flow of package customization quicker and easier. See [documentation](./bin/README_CN.md) for more information.**
163163

164164
```bash
165165
# Install with npm

README_CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
</kbd>
163163
<br/><br/>
164164

165-
**Pake 提供了命令行工具,可以更快捷方便地一键自定义打你需要的包,详细可见 [文档](./bin/README.md)**
165+
**Pake 提供了命令行工具,可以更快捷方便地一键自定义打你需要的包,详细可见 [文档](./bin/README_CN.md)**
166166

167167
```bash
168168
# 使用 npm 进行安装

bin/README.md

Lines changed: 51 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
## 安装
1+
## Installation
22

3-
请确保 Node 版本>=16 如 16.8,不要使用 sudo 进行安装,假如 npm 报没有权限可以参考 [How to fix npm throwing error without sudo](https://stackoverflow.com/questions/16151018/how-to-fix-npm-throwing-error-without-sudo)
3+
Ensure that your Node.js version is 16.0 or higher (e.g., 16.8). Avoid using `sudo` for the installation. If you encounter permission issues with npm, refer to [How to fix npm throwing error without sudo](https://stackoverflow.com/questions/16151018/how-to-fix-npm-throwing-error-without-sudo).
44

55
```bash
6-
npm install -g pake-cli
6+
npm install pake-cli -g
77
```
88

9-
## Windows/Linux 注意点
9+
## Considerations for Windows & Linux Users
1010

11-
- **十分重要** 查看 Tauri 提供的[依赖指南](https://tauri.app/v1/guides/getting-started/prerequisites)
12-
- 对于 windows(至少安装了`Win10 SDK(10.0.19041.0)` `Visual Studio build tool 2022>=17.2`),还需要额外安装:
11+
- **CRITICAL**: Consult [Tauri prerequisites](https://tauri.app/v1/guides/getting-started/prerequisites) before proceeding.
12+
- For Windows users (ensure that `Win10 SDK (10.0.19041.0)` and `Visual Studio build tool 2022 (>=17.2)` are installed), additional installations are required:
1313

1414
1. Microsoft Visual C++ 2015-2022 Redistributable (x64)
1515
2. Microsoft Visual C++ 2015-2022 Redistributable (x86)
16-
3. Microsoft Visual C++ 2012 Redistributable (x86)(可选)
17-
4. Microsoft Visual C++ 2013 Redistributable (x86)(可选)
18-
5. Microsoft Visual C++ 2008 Redistributable (x86)(可选)
16+
3. Microsoft Visual C++ 2012 Redistributable (x86) (optional)
17+
4. Microsoft Visual C++ 2013 Redistributable (x86) (optional)
18+
5. Microsoft Visual C++ 2008 Redistributable (x86) (optional)
1919

20-
- 此外 Ubuntu 在开始之前可以运行如下命令,安装前期所需依赖。
20+
- For Ubuntu users, execute the following commands to install the required libraries before compiling:
2121

2222
```bash
2323
sudo apt install libdbus-1-dev \
@@ -35,164 +35,162 @@ npm install -g pake-cli
3535
gnome-video-effects-extra
3636
```
3737

38-
## 用法
38+
## Usage
3939

4040
```bash
4141
pake url [options]
4242
```
4343

44-
打包完成后的应用程序默认为当前工作目录,首次打包由于需配置好环境,需要一些时间,请耐心等待即可。
44+
The packaged application will be located in the current working directory by default. The first packaging might take some time due to environment configuration. Please be patient.
4545

46-
> **Note**:
47-
> 打包需要用 `Rust` 环境,如果没有 `Rust`,会提示确认安装。如遇安装失败或超时,可[自行安装](https://www.rust-lang.org/tools/install)
46+
> **Note**: Packaging requires the Rust environment. If Rust is not installed, you will be prompted for installation confirmation. In case of installation failure or timeout, you can [install it manually](https://www.rust-lang.org/tools/install).
4847
4948
### url
5049

51-
url 为你需要打包的网页链接 🔗 或者本地 html 文件,必须提供。
50+
The URL is the link to the web page you want to package or the path to a local HTML file. This is mandatory.
5251

5352
### [options]
5453

55-
提供了一些特定的选项,打包时可以传递对应参数达到定制化的效果。
54+
Various options are available for customization. You can pass corresponding arguments during packaging to achieve the desired configuration.
5655

5756
#### [name]
5857

59-
应用名称,如输入时未指定,会提示你输入,尽量使用英语。
58+
Specify the application name. If not provided, you will be prompted to enter it. It is recommended to use English.
6059

6160
```shell
6261
--name <value>
63-
# 或者
62+
# or
6463
-n <value>
6564
```
6665

6766
#### [icon]
6867

69-
应用 icon,支持本地/远程文件,默认为 Pake 自带图标,定制的可以去 [icon-icons](https://icon-icons.com) [macOSicons](https://macosicons.com/#/) 搜索下载。
68+
Specify the application icon. Supports both local and remote files. By default, it uses the Pake brand icon. For custom icons, visit [icon icons](https://icon-icons.com) or [macOSicons](https://macosicons.com/#/).
7069

71-
- MacOS 下必须为 `.icns`
72-
- Windows 下必须为 `.ico`
73-
- Linux 下必须为 `.png`
70+
- For macOS, use `.icns` format.
71+
- For Windows, use `.ico` format.
72+
- For Linux, use `.png` format.
7473

7574
```shell
7675
--icon <path>
77-
# 或者
78-
-i <path>
7976
```
8077

8178
#### [height]
8279

83-
打包后的应用窗口高度,默认 `780px`
80+
Set the height of the application window. Default is `780px`.
8481

8582
```shell
8683
--height <number>
87-
# 或者
88-
-h <number>
8984
```
9085

9186
#### [width]
9287

93-
打包后的应用窗口宽度,默认 `1200px`
88+
Set the width of the application window. Default is `1200px`.
9489

9590
```shell
9691
--width <number>
97-
# 或者
98-
-w <number>
9992
```
10093

10194
#### [transparent]
10295

103-
是否开启沉浸式头部,默认为 `false` 不开启,输入下面的命令则开启沉浸式,推荐 MacOS 用户开启。
96+
Enable or disable immersive header. Default is `false`. Use the following command to enable this feature.
97+
98+
```
10499
105100
```shell
106101
--transparent
107102
```
108103

109-
#### [resize]
104+
#### [fullscreen]
110105

111-
是否可以拖动大小,默认为 `true` 可拖动,输入下面的命令则不能对窗口大小进行拉伸。
106+
Determine whether the application launches in full screen. Default is `false`. Use the following command to enable full screen.
112107

113108
```shell
114-
--no-resizable
109+
--fullscreen
115110
```
116111

117-
#### [fullscreen]
112+
#### [resize]
118113

119-
打开应用后是否开启全屏,默认为 `false`,输入下面的命令则会自动全屏。
114+
Determine whether the window is resizable. Default is `true`. Use the following command to disable window resizing.
120115

121116
```shell
122-
--fullscreen
117+
--no-resizable
123118
```
124119

125120
#### [multi-arch]
126121

127-
打包结果同时支持英特尔和 m1 芯片,仅适用于 MacOS,默认为 `false`
122+
Package the application to support both Intel and M1 chips, exclusively for macOS. Default is `false`.
128123

129-
##### 准备工作
124+
##### Prerequisites
130125

131-
- 注意:开启该选项后,需要用 rust 官网的 rustup 安装 rust,不支持 brew 安装。
132-
- 对于 intel 芯片用户,需要安装 arm64 跨平台包,使安装包支持 m1 芯片,使用下面命令安装。
126+
- Note: After enabling this option, Rust must be installed using rustup from the official Rust website. Installation via brew is not supported.
127+
- For Intel chip users, install the arm64 cross-platform package to support M1 chips using the following command:
133128

134129
```shell
135130
rustup target add aarch64-apple-darwin
136131
```
137132

138-
- 对于 M1 芯片用户,需要安装 x86 跨平台包,使安装包支持 interl 芯片,使用下面的命令安装。
133+
- For M1 chip users, install the x86 cross-platform package to support Intel chips using the following command:
139134

140135
```shell
141136
rustup target add x86_64-apple-darwin
142137
```
143138

144-
##### 使用方法
139+
##### Usage
145140

146141
```shell
147142
--multi-arch
148-
# 或者
149-
-m
150143
```
151144

152145
#### [targets]
153146

154-
选择输出的包格式,支持 deb/appimage/all,如果选择 all,则同时打包 debappimage,该选项仅支持 Linux,默认为`all`
147+
Select the output package format for Linux. Options include `deb`, `appimage`, or `all`. If `all` is selected, both `deb` and `appimage` will be packaged. Default is `all`.
155148

156149
```shell
157-
--targets xxx
150+
--targets <format>
158151
```
159152

160153
#### [user-agent]
161154

162-
自定义浏览器请求头, 默认为空。
155+
Customize the browser user agent. Default is empty.
163156

164157
```shell
165158
--user-agent <value>
166159
```
167160

168161
#### [show-menu]
169162

170-
显示菜单栏, 默认不显示,输入下面的命令则会显示,推荐MacOS用户开启。
163+
Display the menu bar. Default is not to display. Use the following command to enable the menu bar. Recommended for macOS users.
171164

172165
```shell
173166
--show-menu
174167
```
175168

176169
#### [show-system-tray]
177170

178-
显示通知栏托盘, 默认不显示,输入下面的命令则会显示。
171+
Display the system tray. Default is not to display. Use the following command to enable the system tray.
179172

180173
```shell
181174
--show-system-tray
182175
```
183176

184177
#### [system-tray-icon]
185178

186-
通知栏托盘图标,仅当显示通知栏托盘时有效, 图标必须为.ico或者.png格式的,32x32~256x256像素的图片。
179+
Specify the system tray icon. This is only effective when the system tray is enabled. The icon must be in `.ico` or `.png` format and should be an image with dimensions ranging from 32x32 to 256x256 pixels.
187180

188181
```shell
189-
--system-tray-icon <value>
182+
--system-tray-icon <path>
190183
```
191184

192185
#### [copy-iter-file]
193186

194-
递归拷贝,当url为本地文件路径时候,若开启该选项,则将url路径文件所在文件夹以及所有子文件都拷贝到pake静态文件夹,默认不开启
187+
Enable recursive copying. When the URL is a local file path, enabling this option will copy the folder containing the file specified in the URL, as well as all sub-files, to the Pake static folder. This is disabled by default.
195188

196189
```shell
197190
--copy-iter-file
198191
```
192+
193+
## Conclusion
194+
195+
After completing the above steps, your application should be successfully packaged. Please note that the packaging process may take some time depending on your system configuration and network conditions. Be patient, and once the packaging is complete, you can find the application installer in the specified directory.
196+

0 commit comments

Comments
 (0)