🎨 Restructuring

This commit is contained in:
Tw93
2023-01-26 15:07:05 +08:00
parent 4590f35079
commit 14e5415f8f
5 changed files with 52 additions and 31 deletions

38
bin/README.md vendored
View File

@@ -64,7 +64,6 @@ url 为你需要打包的网页链接 🔗,必须提供。
-n <value>
```
#### [icon]
应用 icon支持本地/远程文件,默认为 Pake 自带图标,定制的可以去 [icon-icons](https://icon-icons.com) 或 [macOSicons](https://macosicons.com/#/) 搜索下载。
@@ -85,6 +84,8 @@ url 为你需要打包的网页链接 🔗,必须提供。
```shell
--height <number>
# 或者
-h <number>
```
#### [width]
@@ -107,14 +108,6 @@ url 为你需要打包的网页链接 🔗,必须提供。
-t
```
#### [resize]
是否可以拖动大小,默认为 `true` 可拖动。使用下面的命令来关闭该功能。
```shell
--no-resizable
```
#### [fullscreen]
打开应用后是否开启全屏,默认为 `false`,使用下面的命令开启该功能。
@@ -125,22 +118,39 @@ url 为你需要打包的网页链接 🔗,必须提供。
-f
```
#### [resize]
是否可以拖动大小,默认为 `true` 可拖动。使用下面的命令来关闭该功能。
```shell
--no-resizable
# 或者
-r
```
#### [multi-arch]
打包结果同时支持英特尔和m1芯片仅适用于MacOS默认为 `false`。
打包结果同时支持英特尔和 m1 芯片,仅适用于 MacOS默认为 `false`。
##### 准备工作
- 注意开启该选项后需要用rust官网的rustup安装rust不支持brew安装。
- 对于intel芯片用户需要安装arm64跨平台包使安装包支持m1芯片使用下面命令安装。
- 注意:开启该选项后,需要用 rust 官网的 rustup 安装 rust不支持 brew 安装。
- 对于 intel 芯片用户,需要安装 arm64 跨平台包,使安装包支持 m1 芯片,使用下面命令安装。
```shell
rustup target add aarch64-apple-darwin
```
- 对于M1芯片用户需要安装x86跨平台包使安装包支持interl芯片使用下面的命令安装。
- 对于 M1 芯片用户,需要安装 x86 跨平台包,使安装包支持 interl 芯片,使用下面的命令安装。
```shell
rustup target add x86_64-apple-darwin
```
##### 使用方法
```shell
--multi-arch
# 或者
-m
```
```

29
bin/README_EN.md vendored
View File

@@ -84,6 +84,8 @@ The height of the packaged application window. The default is `780px`.
```shell
--height <number>
# or
-h <number>
```
#### [width]
@@ -106,15 +108,6 @@ Whether to enable the immersive header. The default is `false`. Use the command
-t
```
#### [resize]
Indicates if the window can be resized. The default value is `true`.
Use the command below to disable this feature.
```shell
--no-resizable
```
#### [fullscreen]
Indicates if the window should be full screen on application launch. The default is `false`.
@@ -126,20 +119,38 @@ Use the command below to enable this feature.
-f
```
#### [resize]
Indicates if the window can be resized. The default value is `true`.
Use the command below to disable this feature.
```shell
--no-resizable
#or
-r
```
#### [multi-arch]
Package results support both Intel and m1 chips, only for MacOS. The default is `false`.
##### Preparation
- Note: After enabling this option, you need to use rustup on the rust official website to install rust, brew installation is not supported.
- For intel chip users, you need to install the arm64 cross-platform package to make the installation package support the m1 chip, and use the following command to install.
```shell
rustup target add aarch64-apple-darwin
```
- For M1 chip users, you need to install the x86 cross-platform package to make the installation package support the interl chip, and use the following command to install.
```shell
rustup target add x86_64-apple-darwin
```
##### Instructions
```shell
--multi-arch
# or

4
bin/cli.ts vendored
View File

@@ -16,11 +16,11 @@ program
.argument('[url]', 'the web url you want to package', validateUrlInput)
.option('-n, --name <string>', 'application name')
.option('-i, --icon <string>', 'application icon', DEFAULT_PAKE_OPTIONS.icon)
.option('--height <number>', 'window height', validateNumberInput, DEFAULT_PAKE_OPTIONS.height)
.option('-w, --width <number>', 'window width', validateNumberInput, DEFAULT_PAKE_OPTIONS.width)
.option('--no-resizable', 'whether the window can be resizable', DEFAULT_PAKE_OPTIONS.resizable)
.option('-h, --height <number>', 'window height', validateNumberInput, DEFAULT_PAKE_OPTIONS.height)
.option('-f, --fullscreen', 'makes the packaged app start in full screen', DEFAULT_PAKE_OPTIONS.fullscreen)
.option('-t, --transparent', 'transparent title bar', DEFAULT_PAKE_OPTIONS.transparent)
.option('-r, --no-resizable', 'whether the window can be resizable', DEFAULT_PAKE_OPTIONS.resizable)
.option('-d, --debug', 'debug', DEFAULT_PAKE_OPTIONS.debug)
.option('-m, --multi-arch', "Supports both Intel and m1 chips, only for Mac.", DEFAULT_PAKE_OPTIONS.multiArch)
.action(async (url: string, options: PakeCliOptions) => {