pake-cli 1.2.2 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,11 +1,12 @@
1
- <h4 align="right"><strong>中文</strong> | <a href="https://github.com/tw93/Pake/blob/master/README_EN.md">English</a></h4>
1
+ <h4 align="right"><strong>English</strong> | <a href="https://github.com/tw93/Pake/blob/master/README_CN.md">简体中文</a></h4>
2
2
  <p align="center">
3
3
  <img src=https://gw.alipayobjects.com/zos/k/fa/logo-modified.png width=138/>
4
4
  </p>
5
5
  <h1 align="center">Pake</h1>
6
+ <p align="center"><strong>Turn any webpage into a desktop app with Rust <em>with ease</em>.</strong></p>
6
7
  <div align="center">
7
8
  <a href="https://twitter.com/HiTw93" target="_blank">
8
- <img alt="twitter" src="https://img.shields.io/twitter/follow/Hitw93?color=%231D9BF0&label=Pake%20%F0%9F%93%A2%20&logo=Twitter&style=flat-square"></a>
9
+ <img alt="twitter" src="https://img.shields.io/badge/follow-Tw93-red?style=flat-square&logo=Twitter"></a>
9
10
  <a href="https://t.me/miaoyan" target="_blank">
10
11
  <img alt="telegram" src="https://img.shields.io/badge/chat-telegram-blueviolet?style=flat-square&logo=Telegram"></a>
11
12
  <a href="https://github.com/tw93/Pake/releases" target="_blank">
@@ -15,25 +16,26 @@
15
16
  <a href="https://github.com/tw93/Pake/issues?q=is%3Aissue+is%3Aclosed" target="_blank">
16
17
  <img alt="GitHub closed issues" src="https://img.shields.io/github/issues-closed/tw93/Pake.svg?style=flat-square"></a>
17
18
  </div>
18
- <div align="left">很简单的用 Rust 打包网页生成很小的桌面 App,支持 Mac / Windows / Linux 系统,常用包下载、<a href="#命令行一键打包">命令行一键打包</a>、<a href="#定制开发">定制开发</a> 可见下面文档,也欢迎去 <a href=https://github.com/tw93/Pake/discussions>讨论区</a> 交流。</div>
19
19
 
20
- ## 特征
20
+ <div align="left">Pake supports Mac, Windows, and Linux. Check out README for <a href="#popular-packages">Popular Packages</a>, <a href="#command-line-packaging">Command-Line Packaging</a>, and <a href="#development">Customized Development</a> information. Feel free to share your suggestions in <a href=https://github.com/tw93/Pake/discussions>Discussions</a>.</div>
21
21
 
22
- 🏂 **小**:相比传统的 Electron 套壳打包,要小将近 40 倍,不到 3M。
23
- 😂 **快**:Pake 的底层使用的 Rust Tauri 框架,性能体验较 JS 框架要轻快不少,内存小很多。
24
- 🩴 **特**:不是单纯打包,实现了快捷键的透传、沉浸式的窗口、拖动、样式改写、去广告、产品的极简风格定制。
25
- 🐶 **玩**:只是一个很简单的小玩具,用 Rust 替代之前套壳网页打包的老思路,其实 PWA 也很好。
22
+ ## Features
26
23
 
27
- ## 常用包下载
24
+ - 🎐 Nearly 40 times smaller than an Electron package (less than 3M!)
25
+ - 🚀 With Rust Tauri, Pake is much more lightweight and faster than JS-based frameworks.
26
+ - 📦 Battery-included package — shortcut pass-through, immersive windows, and minimalist customization.
27
+ - 👻 Pake is just a simple tool — replace the old bundle approach with Rust (though PWA is good enough).
28
+
29
+ ## Popular Packages
28
30
 
29
31
  <table>
30
32
  <tr>
31
- <td>WeRead
33
+ <td>WeRead
32
34
  <a href="https://github.com/tw93/Pake/releases/latest/download/WeRead.dmg">Mac</a>
33
35
  <a href="https://github.com/tw93/Pake/releases/latest/download/WeRead_x64.msi">Windows</a>
34
36
  <a href="https://github.com/tw93/Pake/releases/latest/download/WeRead_amd64.deb">Linux</a>
35
37
  </td>
36
- <td>Twitter
38
+ <td>Twitter
37
39
  <a href="https://github.com/tw93/Pake/releases/latest/download/Twitter.dmg">Mac</a>
38
40
  <a href="https://github.com/tw93/Pake/releases/latest/download/Twitter_x64.msi">Windows</a>
39
41
  <a href="https://github.com/tw93/Pake/releases/latest/download/Twitter_amd64.deb">Linux</a>
@@ -44,12 +46,12 @@
44
46
  <td><img src=https://cdn.fliggy.com/upic/mc41xq.jpg width=600/></td>
45
47
  </tr>
46
48
  <tr>
47
- <td>LiZhi
49
+ <td>LiZhi
48
50
  <a href="https://github.com/tw93/Pake/releases/latest/download/LiZhi.dmg">Mac</a>
49
51
  <a href="https://github.com/tw93/Pake/releases/latest/download/LiZhi_x64.msi">Windows</a>
50
52
  <a href="https://github.com/tw93/Pake/releases/latest/download/LiZhi_amd64.deb">Linux</a>
51
53
  </td>
52
- <td>YouTube
54
+ <td>YouTube
53
55
  <a href="https://github.com/tw93/Pake/releases/latest/download/YouTube.dmg">Mac</a>
54
56
  <a href="https://github.com/tw93/Pake/releases/latest/download/YouTube_x64.msi">Windows</a>
55
57
  <a href="https://github.com/tw93/Pake/releases/latest/download/YouTube_amd64.deb">Linux</a>
@@ -60,12 +62,12 @@
60
62
  <td><img src=https://cdn.fliggy.com/upic/Ea5ZRw.png width=600/></td>
61
63
  </tr>
62
64
  <tr>
63
- <td>Qwerty
65
+ <td>Qwerty
64
66
  <a href="https://github.com/tw93/Pake/releases/latest/download/Qwerty.dmg">Mac</a>
65
67
  <a href="https://github.com/tw93/Pake/releases/latest/download/Qwerty_x64.msi">Windows</a>
66
68
  <a href="https://github.com/tw93/Pake/releases/latest/download/Qwerty_amd64.deb">Linux</a>
67
69
  </td>
68
- <td>Reference
70
+ <td>Reference
69
71
  <a href="https://github.com/tw93/Pake/releases/latest/download/Reference.dmg">Mac</a>
70
72
  <a href="https://github.com/tw93/Pake/releases/latest/download/Reference_x64.msi">Windows</a>
71
73
  <a href="https://github.com/tw93/Pake/releases/latest/download/Reference_amd64.deb">Linux</a>
@@ -75,104 +77,101 @@
75
77
  <td><img src=https://cdn.fliggy.com/upic/CJjagn.jpg width=600/></td>
76
78
  <td><img src=https://cdn.fliggy.com/upic/KFsZIY.png width=600/></td>
77
79
  </tr>
78
- <tr>
79
- <td>Library
80
+ <tr>
81
+ <td>Book
80
82
  <a href="https://github.com/tw93/Pake/releases/latest/download/ZLibrary.dmg">Mac</a>
81
83
  <a href="https://github.com/tw93/Pake/releases/latest/download/ZLibrary_x64.msi">Windows</a>
82
84
  <a href="https://github.com/tw93/Pake/releases/latest/download/ZLibrary_amd64.deb">Linux</a>
83
85
  </td>
84
- <td>ChatGPT
86
+ <td>ChatGPT
85
87
  <a href="https://github.com/tw93/Pake/releases/latest/download/ChatGPT.dmg">Mac</a>
86
88
  <a href="https://github.com/tw93/Pake/releases/latest/download/ChatGPT_x64.msi">Windows</a>
87
89
  <a href="https://github.com/tw93/Pake/releases/latest/download/ChatGPT_amd64.deb">Linux</a>
88
90
  </td>
89
91
  </tr>
90
92
  <tr>
91
- <td><img src=https://cdn.fliggy.com/upic/2vPptL.png width=600/></td>
93
+ <td><img src=https://cdn.fliggy.com/upic/lJiTRc.jpg width=600/></td>
92
94
  <td><img src=https://cdn.fliggy.com/upic/sfnTXf.png width=600/></td>
93
95
  </tr>
94
96
  </table>
95
97
 
96
98
  <details>
97
-
98
- <summary>🏂 更多应用如 Flomo / 语雀 / RunCode 可去 <a href="https://github.com/tw93/Pake/releases">Release</a>下载,<b>此外点击可展开快捷键说明</b></summary>
99
+ <summary>🏂 You can download more applications (such as Flomo / YuQue / RunCode) from <a href="https://github.com/tw93/Pake/releases">Releases</a>. <b>Click here to expand the shortcuts reference!</b></summary>
99
100
 
100
101
  <br/>
101
102
 
102
- | Mac | Windows/Linux | 功能 |
103
- | --------------------------- | ------------------------------ | ------------------ |
104
- | <kbd>⌘</kbd> + <kbd>[</kbd> | <kbd>Ctrl</kbd> + <kbd>←</kbd> | 返回上一个页面 |
105
- | <kbd>⌘</kbd> + <kbd>]</kbd> | <kbd>Ctrl</kbd> + <kbd>→</kbd> | 去下一个页面 |
106
- | <kbd>⌘</kbd> + <kbd>↑</kbd> | <kbd>Ctrl</kbd> + <kbd>↑</kbd> | 自动滚动到页面顶部 |
107
- | <kbd>⌘</kbd> + <kbd>↓</kbd> | <kbd>Ctrl</kbd> + <kbd>↓</kbd> | 自动滚动到页面底部 |
108
- | <kbd>⌘</kbd> + <kbd>r</kbd> | <kbd>Ctrl</kbd> + <kbd>r</kbd> | 刷新页面 |
109
- | <kbd>⌘</kbd> + <kbd>w</kbd> | <kbd>Ctrl</kbd> + <kbd>w</kbd> | 隐藏窗口,非退出 |
110
- | <kbd>⌘</kbd> + <kbd>-</kbd> | <kbd>Ctrl</kbd> + <kbd>-</kbd> | 缩小页面 |
111
- | <kbd>⌘</kbd> + <kbd>+</kbd> | <kbd>Ctrl</kbd> + <kbd>+</kbd> | 放大页面 |
112
- | <kbd>⌘</kbd> + <kbd>=</kbd> | <kbd>Ctrl</kbd> + <kbd>=</kbd> | 放大页面 |
113
- | <kbd>⌘</kbd> + <kbd>0</kbd> | <kbd>Ctrl</kbd> + <kbd>0</kbd> | 重置页面缩放 |
114
-
115
- 此外还支持双击头部进行全屏切换,拖拽头部进行移动窗口,Mac 用户支持手势方式返回和去下一页,还有其他需求,欢迎提过来。
103
+ | Mac | Windows/Linux | Function |
104
+ | --------------------------- | ------------------------------ | ----------------------------- |
105
+ | <kbd>⌘</kbd> + <kbd>[</kbd> | <kbd>Ctrl</kbd> + <kbd>←</kbd> | Return to the previous page |
106
+ | <kbd>⌘</kbd> + <kbd>]</kbd> | <kbd>Ctrl</kbd> + <kbd>→</kbd> | Go to the next page |
107
+ | <kbd>⌘</kbd> + <kbd>↑</kbd> | <kbd>Ctrl</kbd> + <kbd>↑</kbd> | Auto scroll to top of page |
108
+ | <kbd>⌘</kbd> + <kbd>↓</kbd> | <kbd>Ctrl</kbd> + <kbd>↓</kbd> | Auto scroll to bottom of page |
109
+ | <kbd>⌘</kbd> + <kbd>r</kbd> | <kbd>Ctrl</kbd> + <kbd>r</kbd> | Refresh Page |
110
+ | <kbd>⌘</kbd> + <kbd>w</kbd> | <kbd>Ctrl</kbd> + <kbd>w</kbd> | Hide window, not quite |
111
+ | <kbd>⌘</kbd> + <kbd>-</kbd> | <kbd>Ctrl</kbd> + <kbd>-</kbd> | Zoom out the page |
112
+ | <kbd>⌘</kbd> + <kbd>+</kbd> | <kbd>Ctrl</kbd> + <kbd>+</kbd> | Zoom in the page |
113
+ | <kbd>⌘</kbd> + <kbd>=</kbd> | <kbd>Ctrl</kbd> + <kbd>=</kbd> | Zoom in the Page |
114
+ | <kbd>⌘</kbd> + <kbd>0</kbd> | <kbd>Ctrl</kbd> + <kbd>0</kbd> | Reset the page zoom |
115
+
116
+ In addition, double-click the title bar to switch to full-screen mode. For Mac users, you can also use the gesture to go to the previous or next page and drag the title bar to move the window.
116
117
 
117
118
  </details>
118
119
 
119
- ## 开始之前
120
+ ## Before starting
120
121
 
121
- 1. **小白用户**:使用 「常用包下载」 方式来把玩 Pake 的能力,可去 [讨论群](https://github.com/tw93/Pake/discussions) 寻求帮助,也可试试 [Action](https://github.com/tw93/Pake/wiki/GitHub-Actions-%E5%9C%A8%E7%BA%BF%E7%BC%96%E8%AF%91%E5%A4%9A%E7%B3%BB%E7%BB%9F%E7%89%88%E6%9C%AC) 方式。
122
- 2. **开发用户**:使用 「命令行一键打包」,对 Mac 比较友好,Windows / Linux 需折腾下 [环境配置](https://tauri.app/v1/guides/getting-started/prerequisites)
123
- 3. **折腾用户**:假如你前端和 Rust 都会,那可试试下面的 [定制开发](#定制开发)」,可深度二次开发定制你的功能。
122
+ 1. **For beginners**: Play with Popular Packages to find out Pake's capabilities, or try to pack your application with [GitHub Actions](https://github.com/tw93/Pake/wiki/GitHub-Actions-Online-Compilation-Multi-system-Version). Don't hesitate to reach for assistance at [Discussion](https://github.com/tw93/Pake/discussions)!
123
+ 2. **For developers**: “Command-Line Packaging” supports macOS fully. For Windows/Linux users, it requires some tinkering. [Configure your environment](https://tauri.app/v1/guides/getting-started/prerequisites) before getting started.
124
+ 3. **For hackers**: For people who are good at both front-end development and Rust, how about customizing your apps' function more with the following [Customized Development](#development)?
124
125
 
125
- ## 命令行一键打包
126
+ ## Command-Line Packaging
126
127
 
127
- <kbd>
128
- <img src="https://gw.alipayobjects.com/zos/k/zd/pake.gif" width="100%">
129
- </kbd>
130
- <br/><br/>
128
+ ![Pake](https://gw.alipayobjects.com/zos/k/zd/pake.gif)
131
129
 
132
- **Pake 提供了命令行工具,可以更快捷方便地一键自定义打你需要的包,详细可见 [文档](./bin/README.md)。**
130
+ **Pake provides a command line tool, making the flow of package customization quicker and easier. See [documentation](./bin/README_EN.md) for more information.**
133
131
 
134
132
  ```bash
135
- // 使用 npm 进行安装
133
+ # Install with npm
136
134
  npm install -g pake-cli
137
135
 
138
- // 命令使用
139
- pake url [options]
136
+ # Command usage
137
+ pake url [OPTIONS]...
140
138
 
141
- // 随便玩玩,首次由于安装环境会有些慢,后面就快了
139
+ # Feel free to play with Pake! It might take a while to prepare the environment the first time you launch Pake.
142
140
  pake https://weekly.tw93.fun --name Weekly --transparent
143
141
  ```
144
142
 
145
- 假如你不太会使用命令行,或许使用 **GitHub Actions 在线编译多系统版本** 是一个不错的选择,可查看 [文档](https://github.com/tw93/Pake/wiki/GitHub-Actions-%E5%9C%A8%E7%BA%BF%E7%BC%96%E8%AF%91%E5%A4%9A%E7%B3%BB%E7%BB%9F%E7%89%88%E6%9C%AC)
143
+ If you are new to the command line, you can compile packages online with _GitHub Actions_. See the [Tutorial](https://github.com/tw93/Pake/wiki/GitHub-Actions-Online-Compilation-Multi-system-Version) for more information.
146
144
 
147
- ## 定制开发
145
+ ## Development
148
146
 
149
- 开始前请确保电脑已经安装了 Rust `>=1.63` Node `>=16 16.18.1` 的环境,此外需参考 [Tauri 文档](https://tauri.app/v1/guides/getting-started/prerequisites) 快速配置好环境才可以开始使用,假如你太不懂,使用上面的命令行打包会更加合适。
147
+ Prepare your environment before starting. Make sure you have Rust `>=1.63` and Node `>=16` (e.g., `16.18.1`) installed on your computer. For installation guidance, see [Tauri documentation](https://tauri.app/v1/guides/getting-started/prerequisites).
148
+
149
+ If you are unfamiliar with these, it is better to try out the above tool to pack with one click.
150
150
 
151
151
  ```sh
152
- // 安装依赖
152
+ # Install Dependencies
153
153
  npm i
154
154
 
155
- // 本地开发
155
+ # Local development
156
156
  npm run dev
157
157
 
158
- // 本地调试
158
+ # Local debug
159
159
  npm run dev:debug
160
160
 
161
- // 打包应用
161
+ # Pack application
162
162
  npm run build
163
-
164
163
  ```
165
164
 
166
- ## 高级使用
165
+ ## Advanced Usage
167
166
 
168
- 1. 代码结构可参考 [文档](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),便于你在开发前了解更多。
169
- 2. 修改 src-tauri 目录下的 `tauri.conf.json`以及 `tauri.xxx.conf.json` 中的 url、productName、icon、identifier 4 个字段,其中 icon 可以从 icons 目录选择一个,也可以去 [macOSicons](https://macosicons.com/#/) 下载符合效果的。
170
- 3. 关于窗口属性设置,可以在 `tauri.conf.json` 修改 windows 属性对应的 `width/height`,fullscreen 是否全屏,resizable 是否可以调整大小,假如想适配 Mac 沉浸式头部,可以将 transparent 设置成 `true`,找到 Header 元素加一个 padding-top 样式即可,不想适配改成 `false` 也行。
171
- 4. 此外样式改写、屏蔽广告、逻辑代码注入、容器消息通信、自定义快捷键可见 [高级用法](https://github.com/tw93/Pake/wiki/Pake-%E7%9A%84%E9%AB%98%E7%BA%A7%E7%94%A8%E6%B3%95)
167
+ 1. You can refer to the [codebase structure](https://github.com/tw93/Pake/wiki/Description-of-Pake's-code-structure) before working on Pake, which will help you much in development.
168
+ 2. Add four fields (`url`, `productName`, `icon`, and `identifier`) to the `tauri.conf.json` and `tauri.xxx.conf.json` in the `src-tauri` directory. You can select a `icon` from the `icons` directory or download one from [macOSicons](https://macosicons.com/#/) to match your product needs.
169
+ 3. For configurations on window properties, you can modify the `tauri.conf.json` file to change the value of `width`, `height`, `fullscreen` (or not), `resizable` (or not) of the `windows` property. To adapt to the immersive header on Mac, change `transparent` to `true`, look for the `Header` element, and add the `padding-top` property.
170
+ 4. For advanced usages such as style rewriting, advertisement removal, JS injection, container message communication, and user-defined shortcut keys, see [Advanced Usage of Make](https://github.com/tw93/Pake/wiki/Advanced-Usage-of-Make).
172
171
 
173
- ## 开发者
172
+ ## Developer
174
173
 
175
- Pake 的发展离不开这些 Hacker 们,一起贡献了大量能力,也欢迎关注他们 ❤️
174
+ Pake's development can not be without these Hackers. They contributed a lot of capabilities for Pake. Also, welcome to follow them! ❤️
176
175
 
177
176
  <!-- readme: contributors -start -->
178
177
  <table>
@@ -301,9 +300,9 @@ Pake 的发展离不开这些 Hacker 们,一起贡献了大量能力,也欢
301
300
  </table>
302
301
  <!-- readme: contributors -end -->
303
302
 
304
- ## 支持
303
+ ## Support
305
304
 
306
- 1. 我有两只猫,一只叫汤圆,一只叫可乐,假如觉得 Pake 让你生活更美好,可以给汤圆可乐 <a href="https://miaoyan.app/cats.html?name=Pake" target="_blank">喂罐头 🥩🍤</a>。
307
- 2. 如果你喜欢 Pake,可以在 Github Star,更欢迎 [推荐](https://twitter.com/intent/tweet?url=https://github.com/tw93/Pake&text=%23Pake%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~) 给你志同道合的朋友使用。
308
- 3. 可以关注我的 [Twitter](https://twitter.com/HiTw93) 获取到最新的 Pake 更新消息,也欢迎加入 [Telegram](https://t.me/miaoyan) 聊天群。
309
- 4. 希望大伙玩的过程中有一种学习新技术的喜悦感,假如你发现有很适合做成桌面 App 的网页也很欢迎告诉我。
305
+ 1. I have two cats, TangYuan and Coke. If you think Pake delights your life, you can feed them <a href="https://miaoyan.app/cats.html?name=Pake" target="_blank">some canned food 🥩</a>.
306
+ 2. If you like Pake, you can star it on GitHub. Also, welcome to [recommend Pake](https://twitter.com/intent/tweet?url=https://github.com/tw93/Pake&text=%23Pake%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 friends.
307
+ 3. You can follow my [Twitter](https://twitter.com/HiTw93) to get the latest news of Pake or join our [Telegram](https://t.me/miaoyan) chat group.
308
+ 4. I hope that you enjoy playing with it. Let us know if you find a website that would be great for a Mac App!
package/dist/cli.js CHANGED
@@ -48,6 +48,7 @@ const DEFAULT_PAKE_OPTIONS = {
48
48
  resizable: true,
49
49
  transparent: false,
50
50
  debug: false,
51
+ multiArch: false,
51
52
  };
52
53
 
53
54
  const tlds = [
@@ -1795,7 +1796,7 @@ function handleOptions(options, url) {
1795
1796
 
1796
1797
  function shellExec(command) {
1797
1798
  return new Promise((resolve, reject) => {
1798
- shelljs.exec(command, { async: true, silent: false }, (code) => {
1799
+ shelljs.exec(command, { async: true, silent: false, cwd: npmDirectory }, (code) => {
1799
1800
  if (code === 0) {
1800
1801
  resolve(0);
1801
1802
  }
@@ -2016,10 +2017,23 @@ class MacBuilder {
2016
2017
  log.debug('PakeAppOptions', options);
2017
2018
  const { name } = options;
2018
2019
  yield mergeTauriConfig(url, options, tauriConf);
2019
- //这里直接使用 universal-apple-darwin 的打包,而非当前系统的包
2020
- yield shellExec(`cd ${npmDirectory} && npm install && npm run build:mac`);
2021
- const dmgName = `${name}_${tauriConf.package.version}_universal.dmg`;
2022
- const appPath = this.getBuildAppPath(npmDirectory, dmgName);
2020
+ let dmgName;
2021
+ if (options.multiArch) {
2022
+ yield shellExec(`cd ${npmDirectory} && npm install && npm run build:mac`);
2023
+ dmgName = `${name}_${tauriConf.package.version}_universal.dmg`;
2024
+ }
2025
+ else {
2026
+ yield shellExec(`cd ${npmDirectory} && npm install && npm run build`);
2027
+ let arch = "x64";
2028
+ if (process.arch === "arm64") {
2029
+ arch = "aarch64";
2030
+ }
2031
+ else {
2032
+ arch = process.arch;
2033
+ }
2034
+ dmgName = `${name}_${tauriConf.package.version}_${arch}.dmg`;
2035
+ }
2036
+ const appPath = this.getBuildAppPath(npmDirectory, dmgName, options.multiArch);
2023
2037
  const distPath = path.resolve(`${name}.dmg`);
2024
2038
  yield fs.copyFile(appPath, distPath);
2025
2039
  yield fs.unlink(appPath);
@@ -2027,8 +2041,15 @@ class MacBuilder {
2027
2041
  logger.success('You can find the app installer in', distPath);
2028
2042
  });
2029
2043
  }
2030
- getBuildAppPath(npmDirectory, dmgName) {
2031
- return path.join(npmDirectory, 'src-tauri/target/universal-apple-darwin/release/bundle/dmg', dmgName);
2044
+ getBuildAppPath(npmDirectory, dmgName, multiArch) {
2045
+ let dmgPath;
2046
+ if (multiArch) {
2047
+ dmgPath = 'src-tauri/target/universal-apple-darwin/release/bundle/dmg';
2048
+ }
2049
+ else {
2050
+ dmgPath = 'src-tauri/target/release/bundle/dmg';
2051
+ }
2052
+ return path.join(npmDirectory, dmgPath, dmgName);
2032
2053
  }
2033
2054
  }
2034
2055
 
@@ -2149,8 +2170,8 @@ class BuilderFactory {
2149
2170
  }
2150
2171
 
2151
2172
  var name = "pake-cli";
2152
- var version = "1.2.2";
2153
- var description = "🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App 🤱🏻 A simple way to make any web page a desktop application using Rust.";
2173
+ var version = "1.2.4";
2174
+ var description = "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App。";
2154
2175
  var engines = {
2155
2176
  node: ">=16.0.0"
2156
2177
  };
@@ -2252,18 +2273,19 @@ function checkUpdateTips() {
2252
2273
  });
2253
2274
  }
2254
2275
 
2255
- program.version(packageJson.version).description('A cli application can package a web page to desktop application.');
2276
+ program.version(packageJson.version).description('A cli application can turn any webpage into a desktop app with Rust.');
2256
2277
  program
2257
2278
  .showHelpAfterError()
2258
2279
  .argument('[url]', 'the web url you want to package', validateUrlInput)
2259
- .option('--name <string>', 'application name')
2260
- .option('--icon <string>', 'application icon', DEFAULT_PAKE_OPTIONS.icon)
2261
- .option('--height <number>', 'window height', validateNumberInput, DEFAULT_PAKE_OPTIONS.height)
2262
- .option('--width <number>', 'window width', validateNumberInput, DEFAULT_PAKE_OPTIONS.width)
2263
- .option('--no-resizable', 'whether the window can be resizable', DEFAULT_PAKE_OPTIONS.resizable)
2264
- .option('--fullscreen', 'makes the packaged app start in full screen', DEFAULT_PAKE_OPTIONS.fullscreen)
2265
- .option('--transparent', 'transparent title bar', DEFAULT_PAKE_OPTIONS.transparent)
2266
- .option('--debug', 'debug', DEFAULT_PAKE_OPTIONS.transparent)
2280
+ .option('-n, --name <string>', 'application name')
2281
+ .option('-i, --icon <string>', 'application icon', DEFAULT_PAKE_OPTIONS.icon)
2282
+ .option('-w, --width <number>', 'window width', validateNumberInput, DEFAULT_PAKE_OPTIONS.width)
2283
+ .option('-h, --height <number>', 'window height', validateNumberInput, DEFAULT_PAKE_OPTIONS.height)
2284
+ .option('-f, --fullscreen', 'makes the packaged app start in full screen', DEFAULT_PAKE_OPTIONS.fullscreen)
2285
+ .option('-t, --transparent', 'transparent title bar', DEFAULT_PAKE_OPTIONS.transparent)
2286
+ .option('-r, --no-resizable', 'whether the window can be resizable', DEFAULT_PAKE_OPTIONS.resizable)
2287
+ .option('-d, --debug', 'debug', DEFAULT_PAKE_OPTIONS.debug)
2288
+ .option('-m, --multi-arch', "Supports both Intel and m1 chips, only for Mac.", DEFAULT_PAKE_OPTIONS.multiArch)
2267
2289
  .action((url, options) => __awaiter(void 0, void 0, void 0, function* () {
2268
2290
  yield checkUpdateTips();
2269
2291
  if (!url) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pake-cli",
3
- "version": "1.2.2",
4
- "description": "🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App 🤱🏻 A simple way to make any web page a desktop application using Rust.",
3
+ "version": "1.2.4",
4
+ "description": "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App。",
5
5
  "engines": {
6
6
  "node": ">=16.0.0"
7
7
  },
@@ -60,7 +60,8 @@ window.addEventListener("DOMContentLoaded", (_event) => {
60
60
  .chakra-ui-dark #app .chakra-heading,
61
61
  .chakra-ui-light #app .chakra-stack,
62
62
  .chakra-ui-dark #app .chakra-stack,
63
- .app-main .sidebar-mouse-in-out {
63
+ .app-main .sidebar-mouse-in-out,
64
+ .chakra-modal__content-container .chakra-modal__header > div > div {
64
65
  padding-top: 10px;
65
66
  }
66
67