From 460f97f889d03be15a9a6845be8898e27ae8a1df Mon Sep 17 00:00:00 2001 From: Tlntin Date: Mon, 10 Apr 2023 22:14:05 +0800 Subject: [PATCH] restore document --- bin/README.md | 89 ++++++++++++++++-------------------- bin/README_EN.md | 116 +++++++++++++++++++++++------------------------ dist/cli.js | 2 +- 3 files changed, 99 insertions(+), 108 deletions(-) diff --git a/bin/README.md b/bin/README.md index eac62df..a8a6ecc 100644 --- a/bin/README.md +++ b/bin/README.md @@ -1,15 +1,39 @@ ## 安装 +请确保 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)。 + ```bash npm install -g pake-cli ``` -如果安装失败提示没有权限,请参考该贴解决:[链接](https://gist.github.com/Giancarlos/d087f8a9e6516716da98ad0c0f5a8f58)。 +## Windows/Linux 注意点 -此外,请确保你使用的是正确的 Node.js 版本(`^14.13 || >=16.0.0`)。如果你在使用 [nvm](https://github.com/nvm-sh/nvm) 进行 Node.js 版本管理,可以尝试在项目的目录下运行 `nvm use`,就会拿到正确的版本;其他一众 Node.js 版本工具,比如 [fnm](https://github.com/Schniz/fnm)、[tj/n](https://github.com/tj/n) 应该也有类似的功能。 +- **十分重要** 查看 Tauri 提供的[依赖指南](https://tauri.app/v1/guides/getting-started/prerequisites) +- 对于 windows(至少安装了`Win10 SDK(10.0.19041.0)` 与`Visual Studio build tool 2022(>=17.2)`),还需要额外安装: -**尽量不要使用 `sudo` 权限**。 如果实在要用 sudo,请手动安装 rust 到系统环境。Mac 可以用 brew 命令安装,Linux 如 Ubuntu 可以用 apt 命令安装。 + 1. Microsoft Visual C++ 2015-2022 Redistributable (x64) + 2. Microsoft Visual C++ 2015-2022 Redistributable (x86) + 3. Microsoft Visual C++ 2012 Redistributable (x86)(可选) + 4. Microsoft Visual C++ 2013 Redistributable (x86)(可选) + 5. Microsoft Visual C++ 2008 Redistributable (x86)(可选) +- 此外 Ubuntu 在开始之前可以运行如下命令,安装前期所需依赖。 + + ```bash + sudo apt install libdbus-1-dev \ + libsoup2.4-dev \ + libjavascriptcoregtk-4.0-dev \ + libwebkit2gtk-4.0-dev \ + build-essential \ + curl \ + wget \ + libssl-dev \ + libgtk-3-dev \ + libayatana-appindicator3-dev \ + librsvg2-dev \ + gnome-video-effects \ + gnome-video-effects-extra + ``` ## 用法 @@ -19,11 +43,12 @@ pake url [options] 打包完成后的应用程序默认为当前工作目录,首次打包由于需配置好环境,需要一些时间,请耐心等待即可。 -Note: 打包需要用 `Rust` 环境,如果没有 `Rust`,会提示确认安装。如遇安装失败或超时,可[自行安装](https://www.rust-lang.org/tools/install)。 +> **Note**: +> 打包需要用 `Rust` 环境,如果没有 `Rust`,会提示确认安装。如遇安装失败或超时,可[自行安装](https://www.rust-lang.org/tools/install)。 ### url -url 为你需要打包的网页链接 🔗或者本地html文件,必须提供。 +url 为你需要打包的网页链接 🔗 或者本地 html 文件,必须提供。 ### [options] @@ -35,6 +60,8 @@ url 为你需要打包的网页链接 🔗或者本地html文件,必须提供 ```shell --name +# 或者 +-n ``` #### [icon] @@ -47,6 +74,8 @@ url 为你需要打包的网页链接 🔗或者本地html文件,必须提供 ```shell --icon +# 或者 +-i ``` #### [height] @@ -55,6 +84,8 @@ url 为你需要打包的网页链接 🔗或者本地html文件,必须提供 ```shell --height +# 或者 +-h ``` #### [width] @@ -63,11 +94,13 @@ url 为你需要打包的网页链接 🔗或者本地html文件,必须提供 ```shell --width +# 或者 +-w ``` #### [transparent] -是否开启沉浸式头部,默认为 `false` 不开启,输入下面的命令则开启沉浸式,推荐MacOS用户开启。 +是否开启沉浸式头部,默认为 `false` 不开启,输入下面的命令则开启沉浸式,推荐 MacOS 用户开启。 ```shell --transparent @@ -89,48 +122,6 @@ url 为你需要打包的网页链接 🔗或者本地html文件,必须提供 --fullscreen ``` -#### [user-agent] - -自定义浏览器请求头, 默认为空。 - -```shell ---user-agent -``` - -#### [show-menu] - -显示菜单栏, 默认不显示,输入下面的命令则会显示,推荐MacOS用户开启。 - -```shell ---show-menu -``` - -#### [show-system-tray] - -显示通知栏托盘, 默认不显示,输入下面的命令则会显示。 - -```shell ---show-system-tray -``` - -#### [system-tray-icon] - -通知栏托盘图标,仅当显示通知栏托盘时有效, 图标必须为.ico或者.png格式的,512*512像素的图片。 - -```shell ---system-tray-icon -``` - - -#### [copy-iter-file] - -递归拷贝,当url为本地文件路径时候,若开启该选项,则将url路径文件所在文件夹以及所有子文件都拷贝到pake静态文件夹,默认不开启 - -```shell ---copy-iter-file -``` - - #### [multi-arch] 打包结果同时支持英特尔和 m1 芯片,仅适用于 MacOS,默认为 `false`。 @@ -160,7 +151,7 @@ rustup target add x86_64-apple-darwin #### [targets] -选择输出的包格式,支持deb/appimage/all,如果选择all,则同时打包deb和appimage,该选项仅支持Linux,默认为`all`。 +选择输出的包格式,支持 deb/appimage/all,如果选择 all,则同时打包 deb 和 appimage,该选项仅支持 Linux,默认为`all`。 ```shell --targets xxx diff --git a/bin/README_EN.md b/bin/README_EN.md index 62a9396..b0e4859 100644 --- a/bin/README_EN.md +++ b/bin/README_EN.md @@ -1,14 +1,39 @@ ## Install +Ensure the version of your installed Node.js is greater than `16.0` such as `16.8`. Do not use `sudo` to install. If you encountered permission issues/problems while installing using npm, see [How to fix npm throwing error without sudo](https://stackoverflow.com/questions/16151018/how-to-fix-npm-throwing-error-without-sudo). + ```bash npm install -g pake-cli ``` -If the installation fails and you are prompted that you do not have permission, please see this [website](https://gist.github.com/Giancarlos/d087f8a9e6516716da98ad0c0f5a8f58) . +## Notes for Windows & Linux users -Also make sure that you're using a correct Node.js version (`^14.13 || >=16.0.0`). If you're using [nvm](https://github.com/nvm-sh/nvm) for Node.js version management you may run `nvm use` from the root folder of the project and the correct version will be picked up. Other Node.js version management tools, such as [fnm](https://github.com/Schniz/fnm) and [tj/n](https://github.com/tj/n), should also have similar feature. +- **VERY IMPORTANT**: Check out [the Tauri prerequisites](https://tauri.app/v1/guides/getting-started/prerequisites) before proceeding. +- For Windows users who had been installed `Win10 SDK (10.0.19041.0)` and `Visual Studio build tool 2022(>=17.2)`, you may need to install these additionally: -**try not to use `sudo` permissions**, If you must use sudo, you need install rust in you system environment. For Mac, you can use brew to install it. For Linux like Ubuntu, you need apt to install it. + 1. Microsoft Visual C++ 2015-2022 Redistributable (x64) + 2. Microsoft Visual C++ 2015-2022 Redistributable (x86) + 3. Microsoft Visual C++ 2012 Redistributable (x86) (optional) + 4. Microsoft Visual C++ 2013 Redistributable (x86) (optional) + 5. Microsoft Visual C++ 2008 Redistributable (x86) (optional) + +- For Ubuntu users, run the following commands to install the required libraries before compiling: + + ```bash + sudo apt install libdbus-1-dev \ + libsoup2.4-dev \ + libjavascriptcoregtk-4.0-dev \ + libwebkit2gtk-4.0-dev \ + build-essential \ + curl \ + wget \ + libssl-dev \ + libgtk-3-dev \ + libayatana-appindicator3-dev \ + librsvg2-dev \ + gnome-video-effects \ + gnome-video-effects-extra + ``` ## Usage @@ -16,36 +41,41 @@ Also make sure that you're using a correct Node.js version (`^14.13 || >=16.0.0` pake url [options] ``` -After the packaging, the application defaults to the current working directory. Since the environment needs to be configured for the first packaging, it will take some time. Please wait patiently. +The packaged application will be placed in the current working directory by default. Since the environment needs to be configured for the first packaging, it will take some time. Please wait patiently. -Note: The Rust environment is required for packaging. If you do not have Rust, you will be prompted to confirm the installation. If the installation fails or times out, you can [install](https://www.rust-lang.org/tools/install) it yourself. +> **Note**: +> The Rust environment is required for packaging. If you have not installed Rust, you will be prompted to confirm the installation. If the installation fails or times out, you can [install](https://www.rust-lang.org/tools/install) by yourself. ### url -The url🔗 is the webpage link or local html file you need to package, Must be provided. +The url🔗 is the link to the website you want to package. Required. ### [options] -Some specific options are provided. When packaging, corresponding parameters can be passed to achieve customized effects. +We provide some options for customization. When packaging, the corresponding arguments can be passed to configure your app. #### [name] -The application name, if not specified when entering, will prompt you to enter, input must be English. +The name of your application. We will prompt you to enter this if you do not provide it in this phase. Input must be in English. ```shell --name +# or +-n ``` #### [icon] -The application icon, support local and remote files, the default is brand icon of Pake. Customized product icon can go to [icon icons](https://icon-icons.com) Or [macOSicons](https://macosicons.com/#/) download it. +The application icon. Supports local and remote files. By default, it is the brand icon of Pake. For customizing the icon of your product, go to [icon icons](https://icon-icons.com) or [macOSicons](https://macosicons.com/#/) to download it. -- MacOS must be `.icns` +- macOS must be `.icns` - Windows must be `.ico` - Linux must be `.png` ```shell --icon +# or +-i ``` #### [height] @@ -54,6 +84,8 @@ The height of the packaged application window. The default is `780px`. ```shell --height +# or +-h ``` #### [width] @@ -62,74 +94,42 @@ The width of the packaged application window. The default is `1200px`. ```shell --width +# or +-w ``` #### [transparent] -Whether to enable the immersive header. The default is `false`, enter the following command to enable immersive, recommended for MacOS users to enable +Whether to enable the immersive header. The default is `false`. Use the command below to enable this feature. ```shell --transparent -``` - -#### [resize] - -Whether the size can be dragged. The default value is `true`, the window size cannot be stretched by entering the following command. - -```shell ---no-resizable +# or +-t ``` #### [fullscreen] -Whether to open the full screen after opening the application. The default is `false`, enter the following command to automatically full screen +Indicates if the window should be full screen on application launch. The default is `false`. +Use the command below to enable this feature. ```shell ---fullscreen +--fullscreen +# or +-f ``` -#### [user-agent] +#### [resize] -Custom browser user agent, default is empty. +Indicates if the window can be resized. The default value is `true`. +Use the command below to disable this feature. ```shell ---user-agent +--no-resizable +#or +-r ``` -#### [show-menu] - -Display the menu bar, not display it by default, enter the following command and it will be displayed. MacOS users are recommended to enable. - -```shell ---show-menu -``` - -#### [show-system-tray] - -Display the notification tray, not display it by default, entering the following command will display. - -```shell ---show-system-tray -``` - -#### [system-tray-icon] - -The notification tray icon is only valid when the notification tray is displayed. The icon must be a 512*512 pixel image in .ico or .png format. - -```shell ---system-tray-icon -``` - - -#### [copy-iter-file] - -Recursive copy, when the url is a local file path, if this option is enabled, the folder where the url path file is located and all sub-files are copied to the pake static folder, which is not enabled by default - -```shell ---copy-iter-file -``` - - #### [multi-arch] Package results support both Intel and m1 chips, only for MacOS. The default is `false`. diff --git a/dist/cli.js b/dist/cli.js index 6d4d2b8..7573096 100644 --- a/dist/cli.js +++ b/dist/cli.js @@ -2497,7 +2497,7 @@ class BuilderFactory { } var name = "pake-cli"; -var version = "2.0.0-alpha1"; +var version = "2.0.0-alpha2"; var description = "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App。"; var engines = { node: ">=16.0.0"