From 14e5415f8fdf2e9edccf44d635422570408d5033 Mon Sep 17 00:00:00 2001 From: Tw93 Date: Thu, 26 Jan 2023 15:07:05 +0800 Subject: [PATCH] :art: Restructuring --- bin/README.md | 38 ++++++++++++++++++++++++-------------- bin/README_EN.md | 29 ++++++++++++++++++++--------- bin/cli.ts | 4 ++-- dist/cli.js | 8 ++++---- package.json | 4 ++-- 5 files changed, 52 insertions(+), 31 deletions(-) diff --git a/bin/README.md b/bin/README.md index 7aa7928..7b31e0d 100644 --- a/bin/README.md +++ b/bin/README.md @@ -64,7 +64,6 @@ url 为你需要打包的网页链接 🔗,必须提供。 -n ``` - #### [icon] 应用 icon,支持本地/远程文件,默认为 Pake 自带图标,定制的可以去 [icon-icons](https://icon-icons.com) 或 [macOSicons](https://macosicons.com/#/) 搜索下载。 @@ -85,6 +84,8 @@ url 为你需要打包的网页链接 🔗,必须提供。 ```shell --height +# 或者 +-h ``` #### [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 -``` \ No newline at end of file +``` diff --git a/bin/README_EN.md b/bin/README_EN.md index 7f6b359..571dc94 100644 --- a/bin/README_EN.md +++ b/bin/README_EN.md @@ -84,6 +84,8 @@ The height of the packaged application window. The default is `780px`. ```shell --height +# or +-h ``` #### [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 diff --git a/bin/cli.ts b/bin/cli.ts index cdb586a..1aaae84 100644 --- a/bin/cli.ts +++ b/bin/cli.ts @@ -16,11 +16,11 @@ program .argument('[url]', 'the web url you want to package', validateUrlInput) .option('-n, --name ', 'application name') .option('-i, --icon ', 'application icon', DEFAULT_PAKE_OPTIONS.icon) - .option('--height ', 'window height', validateNumberInput, DEFAULT_PAKE_OPTIONS.height) .option('-w, --width ', 'window width', validateNumberInput, DEFAULT_PAKE_OPTIONS.width) - .option('--no-resizable', 'whether the window can be resizable', DEFAULT_PAKE_OPTIONS.resizable) + .option('-h, --height ', '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) => { diff --git a/dist/cli.js b/dist/cli.js index 57a912e..3080600 100644 --- a/dist/cli.js +++ b/dist/cli.js @@ -2170,8 +2170,8 @@ class BuilderFactory { } var name = "pake-cli"; -var version = "1.2.2"; -var description = "🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App 🤱🏻 A simple way to make any web page a desktop application using Rust."; +var version = "1.2.3"; +var description = "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App。"; var engines = { node: ">=16.0.0" }; @@ -2279,11 +2279,11 @@ program .argument('[url]', 'the web url you want to package', validateUrlInput) .option('-n, --name ', 'application name') .option('-i, --icon ', 'application icon', DEFAULT_PAKE_OPTIONS.icon) - .option('--height ', 'window height', validateNumberInput, DEFAULT_PAKE_OPTIONS.height) .option('-w, --width ', 'window width', validateNumberInput, DEFAULT_PAKE_OPTIONS.width) - .option('--no-resizable', 'whether the window can be resizable', DEFAULT_PAKE_OPTIONS.resizable) + .option('-h, --height ', '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((url, options) => __awaiter(void 0, void 0, void 0, function* () { diff --git a/package.json b/package.json index 607e170..d522868 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pake-cli", - "version": "1.2.2", - "description": "🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App 🤱🏻 A simple way to make any web page a desktop application using Rust.", + "version": "1.2.3", + "description": "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App。", "engines": { "node": ">=16.0.0" },