Skip to content

Commit a566bb2

Browse files
committed
🐛 update prerequisites url
1 parent 9a28784 commit a566bb2

File tree

7 files changed

+69
-55
lines changed

7 files changed

+69
-55
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ In addition, double-click the title bar to switch to full-screen mode. For Mac u
138138
## Before starting
139139

140140
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/Online-Compilation-(used-by-ordinary-users)>). Don't hesitate to reach for assistance at [Discussion](https://github.com/tw93/Pake/discussions)!
141-
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.
141+
2. **For developers**: “Command-Line Packaging” supports macOS fully. For Windows/Linux users, it requires some tinkering. [Configure your environment](https://tauri.app/start/prerequisites/) before getting started.
142142
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)?
143143

144144
## Command-Line Packaging
@@ -163,7 +163,7 @@ If you are new to the command line, you can compile packages online with _GitHub
163163

164164
## Development
165165

166-
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).
166+
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/start/prerequisites/).
167167

168168
If you are unfamiliar with these, it is better to try out the above tool to pack with one click.
169169

README_CN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
## 开始之前
139139

140140
1. **小白用户**:使用 「常用包下载」 方式来把玩 Pake 的能力,可去 [讨论群](https://github.com/tw93/Pake/discussions) 寻求帮助,也可试试 [Action](https://github.com/tw93/Pake/wiki/%E5%9C%A8%E7%BA%BF%E7%BC%96%E8%AF%91%EF%BC%88%E6%99%AE%E9%80%9A%E7%94%A8%E6%88%B7%E4%BD%BF%E7%94%A8%EF%BC%89) 方式。
141-
2. **开发用户**:使用 「命令行一键打包」,对 Mac 比较友好,Windows / Linux 需折腾下 [环境配置](https://tauri.app/v1/guides/getting-started/prerequisites)
141+
2. **开发用户**:使用 「命令行一键打包」,对 Mac 比较友好,Windows / Linux 需折腾下 [环境配置](https://tauri.app/start/prerequisites/)
142142
3. **折腾用户**:假如你前端和 Rust 都会,那可试试下面的 「[定制开发](#定制开发)」,可深度二次开发定制你的功能。
143143

144144
## 命令行一键打包
@@ -162,7 +162,7 @@ pake https://weekly.tw93.fun --name Weekly --hide-title-bar
162162

163163
## 定制开发
164164

165-
开始前请确保电脑已经安装了 Rust `>=1.63` 和 Node `>=16 如 16.18.1` 的环境,此外需参考 [Tauri 文档](https://tauri.app/v1/guides/getting-started/prerequisites) 快速配置好环境才可以开始使用,假如你太不懂,使用上面的命令行打包会更加合适。
165+
开始前请确保电脑已经安装了 Rust `>=1.63` 和 Node `>=16 如 16.18.1` 的环境,此外需参考 [Tauri 文档](https://tauri.app/start/prerequisites/) 快速配置好环境才可以开始使用,假如你太不懂,使用上面的命令行打包会更加合适。
166166

167167
```sh
168168
# 安装依赖

README_JP.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
## 始める前に
139139

140140
1. **初心者の方へ**: 「人気のパッケージ」を使用して Pake の機能を試してみてください。または、[GitHub Actions](<https://github.com/tw93/Pake/wiki/Online-Compilation-(used-by-ordinary-users)>)を使用してアプリケーションをパッケージ化してみてください。[ディスカッション](https://github.com/tw93/Pake/discussions)で助けを求めることもできます!
141-
2. **開発者の方へ**: 「コマンドラインパッケージング」を使用してください。macOS では完全にサポートされています。Windows/Linux ユーザーは、[環境を設定](https://tauri.app/v1/guides/getting-started/prerequisites)する必要があります。
141+
2. **開発者の方へ**: 「コマンドラインパッケージング」を使用してください。macOS では完全にサポートされています。Windows/Linux ユーザーは、[環境を設定](https://tauri.app/start/prerequisites/)する必要があります。
142142
3. **ハッカーの方へ**: フロントエンド開発と Rust の両方が得意な方は、以下の[カスタマイズ開発](#開発)でアプリの機能をさらにカスタマイズしてみてください。
143143

144144
## コマンドラインパッケージング
@@ -162,7 +162,7 @@ pake https://weekly.tw93.fun --name Weekly --hide-title-bar
162162

163163
## 開発
164164

165-
開始する前に、Rust `>=1.63` と Node `>=16` (例: `16.18.1`) がコンピュータにインストールされていることを確認してください。インストールガイドについては、[Tauri ドキュメント](https://tauri.app/v1/guides/getting-started/prerequisites)を参照してください。
165+
開始する前に、Rust `>=1.63` と Node `>=16` (例: `16.18.1`) がコンピュータにインストールされていることを確認してください。インストールガイドについては、[Tauri ドキュメント](https://tauri.app/start/prerequisites/)を参照してください。
166166

167167
これらに不慣れな場合は、上記のツールを使用してワンクリックでパッケージを作成することをお勧めします。
168168

bin/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ npm install pake-cli -g
1010

1111
## Considerations for Windows & Linux Users
1212

13-
- **CRITICAL**: Consult [Tauri prerequisites](https://tauri.app/v1/guides/getting-started/prerequisites) before proceeding.
13+
- **CRITICAL**: Consult [Tauri prerequisites](https://tauri.app/start/prerequisites/) before proceeding.
1414
- 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:
1515

1616
1. Microsoft Visual C++ 2015-2022 Redistributable (x64)

bin/README_CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ npm install pake-cli -g
1010

1111
## Windows/Linux 注意事项
1212

13-
- **非常重要**:请参阅 Tauri 的 [依赖项指南](https://tauri.app/v1/guides/getting-started/prerequisites)
13+
- **非常重要**:请参阅 Tauri 的 [依赖项指南](https://tauri.app/start/prerequisites/)
1414
- 对于 Windows 用户,请确保至少安装了 `Win10 SDK(10.0.19041.0)``Visual Studio Build Tools 2022(版本 17.2 或更高)`,此外还需要安装以下组件:
1515

1616
1. Microsoft Visual C++ 2015-2022 Redistributable (x64)

bin/builders/BaseBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default abstract class BaseBuilder {
2828

2929
if (!IS_MAC && !tauriTargetPathExists) {
3030
logger.warn('✼ The first use requires installing system dependencies.');
31-
logger.warn('✼ See more in https://tauri.app/v1/guides/getting-started/prerequisites.');
31+
logger.warn('✼ See more in https://tauri.app/guides/getting-started/prerequisites.');
3232
}
3333

3434
if (!checkRustInstalled()) {

dist/cli.js

Lines changed: 60 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ import updateNotifier from 'update-notifier';
1616
import axios from 'axios';
1717
import { dir } from 'tmp-promise';
1818
import { fileTypeFromBuffer } from 'file-type';
19-
import psl from 'psl';
19+
import * as psl from 'psl';
2020
import isUrl from 'is-url';
2121

2222
var name = "pake-cli";
23-
var version$1 = "2.5.2";
23+
var version$1 = "3.0.0-beta";
2424
var description = "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用。";
2525
var engines = {
2626
node: ">=16.0.0"
@@ -67,31 +67,31 @@ var type = "module";
6767
var exports = "./dist/pake.js";
6868
var license = "MIT";
6969
var dependencies = {
70-
"@tauri-apps/api": "^1.5.4",
71-
"@tauri-apps/cli": "^2.0.0-beta.22",
72-
axios: "^1.6.8",
70+
"@tauri-apps/api": "^1.6.0",
71+
"@tauri-apps/cli": "^2.1.0",
72+
axios: "^1.7.8",
7373
chalk: "^5.3.0",
7474
commander: "^11.1.0",
7575
"file-type": "^18.7.0",
7676
"fs-extra": "^11.2.0",
7777
"is-url": "^1.2.4",
78-
loglevel: "^1.9.1",
78+
loglevel: "^1.9.2",
7979
ora: "^7.0.1",
8080
prompts: "^2.4.2",
81-
psl: "^1.9.0",
81+
psl: "^1.15.0",
8282
shelljs: "^0.8.5",
8383
"tmp-promise": "^3.0.3",
84-
"update-notifier": "^7.0.0"
84+
"update-notifier": "^7.3.1"
8585
};
8686
var devDependencies = {
87-
"@rollup/plugin-alias": "^5.1.0",
88-
"@rollup/plugin-commonjs": "^25.0.7",
87+
"@rollup/plugin-alias": "^5.1.1",
88+
"@rollup/plugin-commonjs": "^25.0.8",
8989
"@rollup/plugin-json": "^6.1.0",
90-
"@rollup/plugin-replace": "^5.0.5",
90+
"@rollup/plugin-replace": "^5.0.7",
9191
"@rollup/plugin-terser": "^0.4.4",
9292
"@types/fs-extra": "^11.0.4",
9393
"@types/is-url": "^1.2.32",
94-
"@types/node": "^20.12.10",
94+
"@types/node": "^20.17.9",
9595
"@types/page-icon": "^0.3.6",
9696
"@types/prompts": "^2.4.9",
9797
"@types/psl": "^1.1.3",
@@ -100,10 +100,10 @@ var devDependencies = {
100100
"@types/update-notifier": "^6.0.8",
101101
"app-root-path": "^3.1.0",
102102
"cross-env": "^7.0.3",
103-
rollup: "^4.17.2",
103+
rollup: "^4.28.0",
104104
"rollup-plugin-typescript2": "^0.36.0",
105-
tslib: "^2.6.2",
106-
typescript: "^5.4.5"
105+
tslib: "^2.8.1",
106+
typescript: "^5.7.2"
107107
};
108108
var packageJson = {
109109
name: name,
@@ -133,6 +133,7 @@ var windows = [
133133
height: 780,
134134
resizable: true,
135135
always_on_top: false,
136+
dark_mode: false,
136137
activation_shortcut: "",
137138
disabled_web_shortcuts: false
138139
}
@@ -147,43 +148,49 @@ var system_tray = {
147148
linux: true,
148149
windows: true
149150
};
151+
var system_tray_path = "icons/icon.png";
150152
var inject = [
151153
];
154+
var proxy_url = "";
152155
var pakeConf = {
153156
windows: windows,
154157
user_agent: user_agent,
155158
system_tray: system_tray,
156-
inject: inject
159+
system_tray_path: system_tray_path,
160+
inject: inject,
161+
proxy_url: proxy_url
157162
};
158163

159-
var build = {
160-
beforeBuildCommand: "",
161-
frontendDist: "../dist",
162-
beforeDevCommand: ""
163-
};
164+
var productName$1 = "WeRead";
165+
var identifier = "com.pake.weread";
166+
var version = "2.0.0";
164167
var plugins = {
165168
};
166-
var productName = "WeRead";
167-
var version = "1.0.0";
168169
var app = {
169170
security: {
170171
csp: null
171172
},
172173
trayIcon: {
173-
iconPath: "png/icon_512.png",
174-
iconAsTemplate: false
174+
iconPath: "png/weread_512.png",
175+
iconAsTemplate: false,
176+
id: "pake-tray"
175177
},
176178
withGlobalTauri: true
177179
};
180+
var build = {
181+
beforeBuildCommand: "",
182+
frontendDist: "../dist",
183+
beforeDevCommand: ""
184+
};
178185
var CommonConf = {
179-
build: build,
180-
plugins: plugins,
181-
productName: productName,
186+
productName: productName$1,
187+
identifier: identifier,
182188
version: version,
183-
app: app
189+
plugins: plugins,
190+
app: app,
191+
build: build
184192
};
185193

186-
var identifier$2 = "com.pake.weread";
187194
var bundle$2 = {
188195
icon: [
189196
"png/weread_256.ico",
@@ -215,11 +222,9 @@ var bundle$2 = {
215222
}
216223
};
217224
var WinConf = {
218-
identifier: identifier$2,
219225
bundle: bundle$2
220226
};
221227

222-
var identifier$1 = "com.pake.weread";
223228
var bundle$1 = {
224229
icon: [
225230
"icons/weread.icns"
@@ -246,11 +251,10 @@ var bundle$1 = {
246251
]
247252
};
248253
var MacConf = {
249-
identifier: identifier$1,
250254
bundle: bundle$1
251255
};
252256

253-
var identifier = "com.pake.weread";
257+
var productName = "weread";
254258
var bundle = {
255259
icon: [
256260
"png/weread_512.png"
@@ -281,7 +285,7 @@ var bundle = {
281285
]
282286
};
283287
var LinuxConf = {
284-
identifier: identifier,
288+
productName: productName,
285289
bundle: bundle
286290
};
287291

@@ -300,7 +304,7 @@ let tauriConfig = {
300304
...CommonConf.app,
301305
trayIcon: {
302306
...CommonConf.app.trayIcon,
303-
...platformConfig.app.trayIcon,
307+
...(platformConfig?.app?.trayIcon ?? {}),
304308
},
305309
},
306310
build: CommonConf.build,
@@ -460,7 +464,7 @@ async function combineFiles(files, output) {
460464
}
461465

462466
async function mergeConfig(url, options, tauriConf) {
463-
const { width, height, fullscreen, hideTitleBar, alwaysOnTop, disabledWebShortcuts, activationShortcut, userAgent, showSystemTray, systemTrayIcon, useLocalFile, identifier, name, resizable = true, inject, } = options;
467+
const { width, height, fullscreen, hideTitleBar, alwaysOnTop, darkMode, disabledWebShortcuts, activationShortcut, userAgent, showSystemTray, systemTrayIcon, useLocalFile, identifier, name, resizable = true, inject, proxyUrl, installerLanguage, } = options;
464468
const { platform } = process;
465469
// Set Windows parameters.
466470
const tauriConfWindowOptions = {
@@ -471,11 +475,15 @@ async function mergeConfig(url, options, tauriConf) {
471475
hide_title_bar: hideTitleBar,
472476
activation_shortcut: activationShortcut,
473477
always_on_top: alwaysOnTop,
478+
dark_mode: darkMode,
474479
disabled_web_shortcuts: disabledWebShortcuts,
475480
};
476481
Object.assign(tauriConf.pake.windows[0], { url, ...tauriConfWindowOptions });
477-
tauriConf.productName = name;
478-
tauriConf.identifier = identifier;
482+
tauriConf.package.productName = name;
483+
tauriConf.tauri.bundle.identifier = identifier;
484+
if (platform == "win32") {
485+
tauriConf.tauri.bundle.windows.wix.language[0] = installerLanguage;
486+
}
479487
//Judge the type of URL, whether it is a file or a website.
480488
const pathExists = await fsExtra.pathExists(url);
481489
if (pathExists) {
@@ -516,9 +524,9 @@ async function mergeConfig(url, options, tauriConf) {
516524
// Processing targets are currently only open to Linux.
517525
if (platform === 'linux') {
518526
delete tauriConf.bundle.linux.deb.files;
519-
const validTargets = ['all', 'deb', 'appimage'];
527+
const validTargets = ['all', 'deb', 'appimage', 'rpm'];
520528
if (validTargets.includes(options.targets)) {
521-
tauriConf.bundle.targets = options.targets === 'all' ? ['deb', 'appimage'] : [options.targets];
529+
tauriConf.bundle.targets = options.targets === 'all' ? ['deb', 'appimage', 'rpm'] : [options.targets];
522530
}
523531
else {
524532
logger.warn(`✼ The target must be one of ${validTargets.join(', ')}, the default 'deb' will be used.`);
@@ -594,6 +602,8 @@ async function mergeConfig(url, options, tauriConf) {
594602
}
595603
}
596604
tauriConf.app.trayIcon.iconPath = trayIconPath;
605+
tauriConf.pake.system_tray_path = trayIconPath;
606+
delete tauriConf.app.trayIcon;
597607
const injectFilePath = path.join(npmDirectory, `src-tauri/src/inject/custom.js`);
598608
// inject js or css files
599609
if (inject?.length > 0) {
@@ -609,6 +619,7 @@ async function mergeConfig(url, options, tauriConf) {
609619
tauriConf.pake.inject = [];
610620
await fsExtra.writeFile(injectFilePath, '');
611621
}
622+
tauriConf.pake.proxy_url = proxyUrl || "";
612623
// Save config file.
613624
const platformConfigPaths = {
614625
win32: 'tauri.windows.conf.json',
@@ -617,6 +628,7 @@ async function mergeConfig(url, options, tauriConf) {
617628
};
618629
const configPath = path.join(tauriConfigDirectory, platformConfigPaths[platform]);
619630
const bundleConf = { bundle: tauriConf.bundle };
631+
console.log('pakeConfig', tauriConf.pake);
620632
await fsExtra.outputJSON(configPath, bundleConf, { spaces: 4 });
621633
const pakeConfigPath = path.join(tauriConfigDirectory, 'pake.json');
622634
await fsExtra.outputJSON(pakeConfigPath, tauriConf.pake, { spaces: 4 });
@@ -636,7 +648,7 @@ class BaseBuilder {
636648
const tauriTargetPathExists = await fsExtra.pathExists(tauriTargetPath);
637649
if (!IS_MAC && !tauriTargetPathExists) {
638650
logger.warn('✼ The first use requires installing system dependencies.');
639-
logger.warn('✼ See more in https://tauri.app/v1/guides/getting-started/prerequisites.');
651+
logger.warn('✼ See more in https://tauri.app/guides/getting-started/prerequisites.');
640652
}
641653
if (!checkRustInstalled()) {
642654
const res = await prompts({
@@ -799,6 +811,7 @@ const DEFAULT_PAKE_OPTIONS = {
799811
resizable: true,
800812
hideTitleBar: false,
801813
alwaysOnTop: false,
814+
darkMode: false,
802815
disabledWebShortcuts: false,
803816
activationShortcut: '',
804817
userAgent: '',
@@ -807,9 +820,10 @@ const DEFAULT_PAKE_OPTIONS = {
807820
targets: 'deb',
808821
useLocalFile: false,
809822
systemTrayIcon: '',
823+
proxyUrl: "",
810824
debug: false,
811825
inject: [],
812-
safeDomain: [],
826+
installerLanguage: 'en-US',
813827
};
814828

815829
async function checkUpdateTips() {
@@ -995,17 +1009,17 @@ program
9951009
.option('--multi-arch', 'Only for Mac, supports both Intel and M1', DEFAULT_PAKE_OPTIONS.multiArch)
9961010
.option('--inject [injects...]', 'Injection of .js or .css Files', DEFAULT_PAKE_OPTIONS.inject)
9971011
.option('--debug', 'Debug build and more output', DEFAULT_PAKE_OPTIONS.debug)
1012+
.option('--proxy-url', "Proxy URL", DEFAULT_PAKE_OPTIONS.proxyUrl)
9981013
.addOption(new Option('--user-agent <string>', 'Custom user agent').default(DEFAULT_PAKE_OPTIONS.userAgent).hideHelp())
9991014
.addOption(new Option('--targets <string>', 'Only for Linux, option "deb" or "appimage"').default(DEFAULT_PAKE_OPTIONS.targets).hideHelp())
10001015
.addOption(new Option('--always-on-top', 'Always on the top level').default(DEFAULT_PAKE_OPTIONS.alwaysOnTop).hideHelp())
1016+
.addOption(new Option('--dark-mode', 'Force Mac app to use dark mode').default(DEFAULT_PAKE_OPTIONS.darkMode).hideHelp())
10011017
.addOption(new Option('--disabled-web-shortcuts', 'Disabled webPage shortcuts')
10021018
.default(DEFAULT_PAKE_OPTIONS.disabledWebShortcuts)
10031019
.hideHelp())
1004-
.addOption(new Option('--safe-domain [domains...]', 'Domains that Require Security Configuration')
1005-
.default(DEFAULT_PAKE_OPTIONS.safeDomain)
1006-
.hideHelp())
10071020
.addOption(new Option('--show-system-tray', 'Show system tray in app').default(DEFAULT_PAKE_OPTIONS.showSystemTray).hideHelp())
10081021
.addOption(new Option('--system-tray-icon <string>', 'Custom system tray icon').default(DEFAULT_PAKE_OPTIONS.systemTrayIcon).hideHelp())
1022+
.addOption(new Option('--installer-language <string>', 'Installer language').default(DEFAULT_PAKE_OPTIONS.installerLanguage).hideHelp())
10091023
.version(packageJson.version, '-v, --version', 'Output the current version')
10101024
.action(async (url, options) => {
10111025
await checkUpdateTips();

0 commit comments

Comments
 (0)