pake-cli 3.2.17 → 3.2.18
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 +15 -7
- package/dist/cli.js +21 -11
- package/package.json +6 -5
- package/src-tauri/.pake/pake.json +9 -6
- package/src-tauri/.pake/tauri.conf.json +5 -5
- package/src-tauri/.pake/tauri.macos.conf.json +3 -3
- package/src-tauri/Cargo.lock +267 -362
- package/src-tauri/Cargo.toml +6 -6
- package/src-tauri/pake.json +3 -1
- package/src-tauri/src/app/config.rs +1 -0
- package/src-tauri/src/app/window.rs +8 -2
- package/src-tauri/src/lib.rs +11 -2
package/README.md
CHANGED
|
@@ -199,9 +199,10 @@ pnpm run build
|
|
|
199
199
|
|
|
200
200
|
## Documentation
|
|
201
201
|
|
|
202
|
-
- **[CLI Usage](docs/cli-usage.md)**
|
|
203
|
-
- **[Advanced Usage](docs/advanced-usage.md)**
|
|
204
|
-
- **[GitHub Actions](docs/github-actions-usage.md)**
|
|
202
|
+
- **[CLI Usage](docs/cli-usage.md)** | [中文](docs/cli-usage_CN.md) - Command-line interface reference
|
|
203
|
+
- **[Advanced Usage](docs/advanced-usage.md)** | [中文](docs/advanced-usage_CN.md) - Customization and advanced features
|
|
204
|
+
- **[GitHub Actions](docs/github-actions-usage.md)** | [中文](docs/github-actions-usage_CN.md) - Build apps online
|
|
205
|
+
- **[Pake Action](docs/pake-action.md)** - Use Pake as GitHub Action in your projects
|
|
205
206
|
- **[Contributing](CONTRIBUTING.md)** - How to contribute to development
|
|
206
207
|
|
|
207
208
|
## Developers
|
|
@@ -444,6 +445,13 @@ Pake's development can not be without these Hackers. They contributed a lot of c
|
|
|
444
445
|
<sub><b>Jiaqi Gu</b></sub>
|
|
445
446
|
</a>
|
|
446
447
|
</td>
|
|
448
|
+
<td align="center">
|
|
449
|
+
<a href="https://github.com/Jason6987">
|
|
450
|
+
<img src="https://avatars.githubusercontent.com/u/140222795?v=4" width="90;" alt="Jason6987"/>
|
|
451
|
+
<br />
|
|
452
|
+
<sub><b>Luminall</b></sub>
|
|
453
|
+
</a>
|
|
454
|
+
</td>
|
|
447
455
|
<td align="center">
|
|
448
456
|
<a href="https://github.com/Milo123459">
|
|
449
457
|
<img src="https://avatars.githubusercontent.com/u/50248166?v=4" width="90;" alt="Milo123459"/>
|
|
@@ -458,6 +466,8 @@ Pake's development can not be without these Hackers. They contributed a lot of c
|
|
|
458
466
|
<sub><b>Po Chen</b></sub>
|
|
459
467
|
</a>
|
|
460
468
|
</td>
|
|
469
|
+
</tr>
|
|
470
|
+
<tr>
|
|
461
471
|
<td align="center">
|
|
462
472
|
<a href="https://github.com/beautifulrem">
|
|
463
473
|
<img src="https://avatars.githubusercontent.com/u/98527099?v=4" width="90;" alt="beautifulrem"/>
|
|
@@ -465,8 +475,6 @@ Pake's development can not be without these Hackers. They contributed a lot of c
|
|
|
465
475
|
<sub><b>Xie Ruiqi</b></sub>
|
|
466
476
|
</a>
|
|
467
477
|
</td>
|
|
468
|
-
</tr>
|
|
469
|
-
<tr>
|
|
470
478
|
<td align="center">
|
|
471
479
|
<a href="https://github.com/bocanhcam">
|
|
472
480
|
<img src="https://avatars.githubusercontent.com/u/35592955?v=4" width="90;" alt="bocanhcam"/>
|
|
@@ -509,6 +517,8 @@ Pake's development can not be without these Hackers. They contributed a lot of c
|
|
|
509
517
|
<sub><b>Liusishan</b></sub>
|
|
510
518
|
</a>
|
|
511
519
|
</td>
|
|
520
|
+
</tr>
|
|
521
|
+
<tr>
|
|
512
522
|
<td align="center">
|
|
513
523
|
<a href="https://github.com/piaoyidage">
|
|
514
524
|
<img src="https://avatars.githubusercontent.com/u/5135405?v=4" width="90;" alt="piaoyidage"/>
|
|
@@ -516,8 +526,6 @@ Pake's development can not be without these Hackers. They contributed a lot of c
|
|
|
516
526
|
<sub><b>Ranger</b></sub>
|
|
517
527
|
</a>
|
|
518
528
|
</td>
|
|
519
|
-
</tr>
|
|
520
|
-
<tr>
|
|
521
529
|
<td align="center">
|
|
522
530
|
<a href="https://github.com/hetz">
|
|
523
531
|
<img src="https://avatars.githubusercontent.com/u/820141?v=4" width="90;" alt="hetz"/>
|
package/dist/cli.js
CHANGED
|
@@ -22,7 +22,7 @@ import sharp from 'sharp';
|
|
|
22
22
|
import * as psl from 'psl';
|
|
23
23
|
|
|
24
24
|
var name = "pake-cli";
|
|
25
|
-
var version = "3.2.
|
|
25
|
+
var version = "3.2.18";
|
|
26
26
|
var description = "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用。";
|
|
27
27
|
var engines = {
|
|
28
28
|
node: ">=18.0.0"
|
|
@@ -65,6 +65,7 @@ var scripts = {
|
|
|
65
65
|
test: "pnpm run cli:build && cross-env PAKE_CREATE_APP=1 node tests/index.js",
|
|
66
66
|
format: "prettier --write . --ignore-unknown && find tests -name '*.js' -exec sed -i '' 's/[[:space:]]*$//' {} \\; && cd src-tauri && cargo fmt --verbose",
|
|
67
67
|
"format:check": "prettier --check . --ignore-unknown",
|
|
68
|
+
update: "pnpm update --verbose && cd src-tauri && cargo update",
|
|
68
69
|
prepublishOnly: "pnpm run cli:build"
|
|
69
70
|
};
|
|
70
71
|
var type = "module";
|
|
@@ -72,10 +73,10 @@ var exports = "./dist/cli.js";
|
|
|
72
73
|
var license = "MIT";
|
|
73
74
|
var dependencies = {
|
|
74
75
|
"@tauri-apps/api": "^2.8.0",
|
|
75
|
-
"@tauri-apps/cli": "^2.8.
|
|
76
|
+
"@tauri-apps/cli": "^2.8.3",
|
|
76
77
|
axios: "^1.11.0",
|
|
77
78
|
chalk: "^5.6.0",
|
|
78
|
-
commander: "^
|
|
79
|
+
commander: "^12.1.0",
|
|
79
80
|
execa: "^9.6.0",
|
|
80
81
|
"file-type": "^18.7.0",
|
|
81
82
|
"fs-extra": "^11.3.1",
|
|
@@ -84,7 +85,7 @@ var dependencies = {
|
|
|
84
85
|
ora: "^8.2.0",
|
|
85
86
|
prompts: "^2.4.2",
|
|
86
87
|
psl: "^1.15.0",
|
|
87
|
-
sharp: "^0.
|
|
88
|
+
sharp: "^0.34.3",
|
|
88
89
|
"tmp-promise": "^3.0.3",
|
|
89
90
|
"update-notifier": "^7.3.1"
|
|
90
91
|
};
|
|
@@ -103,7 +104,7 @@ var devDependencies = {
|
|
|
103
104
|
"app-root-path": "^3.1.0",
|
|
104
105
|
"cross-env": "^7.0.3",
|
|
105
106
|
prettier: "^3.6.2",
|
|
106
|
-
rollup: "^4.
|
|
107
|
+
rollup: "^4.49.0",
|
|
107
108
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
108
109
|
tslib: "^2.8.1",
|
|
109
110
|
typescript: "^5.9.2"
|
|
@@ -347,8 +348,10 @@ async function mergeConfig(url, options, tauriConf) {
|
|
|
347
348
|
await fsExtra.copy(sourcePath, destPath);
|
|
348
349
|
}
|
|
349
350
|
}));
|
|
350
|
-
const { width, height, fullscreen, hideTitleBar, alwaysOnTop, appVersion, darkMode, disabledWebShortcuts, activationShortcut, userAgent, showSystemTray, systemTrayIcon, useLocalFile, identifier, name, resizable = true, inject, proxyUrl, installerLanguage, hideOnClose, incognito, title, wasm, } = options;
|
|
351
|
+
const { width, height, fullscreen, hideTitleBar, alwaysOnTop, appVersion, darkMode, disabledWebShortcuts, activationShortcut, userAgent, showSystemTray, systemTrayIcon, useLocalFile, identifier, name, resizable = true, inject, proxyUrl, installerLanguage, hideOnClose, incognito, title, wasm, enableDragDrop, } = options;
|
|
351
352
|
const { platform } = process;
|
|
353
|
+
// Platform-specific hide_on_close behavior: macOS keeps true, others default to false
|
|
354
|
+
const platformHideOnClose = hideOnClose ?? platform === 'darwin';
|
|
352
355
|
// Set Windows parameters.
|
|
353
356
|
const tauriConfWindowOptions = {
|
|
354
357
|
width,
|
|
@@ -360,10 +363,11 @@ async function mergeConfig(url, options, tauriConf) {
|
|
|
360
363
|
always_on_top: alwaysOnTop,
|
|
361
364
|
dark_mode: darkMode,
|
|
362
365
|
disabled_web_shortcuts: disabledWebShortcuts,
|
|
363
|
-
hide_on_close:
|
|
366
|
+
hide_on_close: platformHideOnClose,
|
|
364
367
|
incognito: incognito,
|
|
365
368
|
title: title || null,
|
|
366
369
|
enable_wasm: wasm,
|
|
370
|
+
enable_drag_drop: enableDragDrop,
|
|
367
371
|
};
|
|
368
372
|
Object.assign(tauriConf.pake.windows[0], { url, ...tauriConfWindowOptions });
|
|
369
373
|
tauriConf.productName = name;
|
|
@@ -544,11 +548,13 @@ StartupNotify=true
|
|
|
544
548
|
const injectFilePath = path.join(npmDirectory, `src-tauri/src/inject/custom.js`);
|
|
545
549
|
// inject js or css files
|
|
546
550
|
if (inject?.length > 0) {
|
|
547
|
-
|
|
551
|
+
// Ensure inject is an array before calling .every()
|
|
552
|
+
const injectArray = Array.isArray(inject) ? inject : [inject];
|
|
553
|
+
if (!injectArray.every((item) => item.endsWith('.css') || item.endsWith('.js'))) {
|
|
548
554
|
logger.error('The injected file must be in either CSS or JS format.');
|
|
549
555
|
return;
|
|
550
556
|
}
|
|
551
|
-
const files =
|
|
557
|
+
const files = injectArray.map((filepath) => path.isAbsolute(filepath) ? filepath : path.join(process.cwd(), filepath));
|
|
552
558
|
tauriConf.pake.inject = files;
|
|
553
559
|
await combineFiles(files, injectFilePath);
|
|
554
560
|
}
|
|
@@ -1056,9 +1062,10 @@ const DEFAULT_PAKE_OPTIONS = {
|
|
|
1056
1062
|
debug: false,
|
|
1057
1063
|
inject: [],
|
|
1058
1064
|
installerLanguage: 'en-US',
|
|
1059
|
-
hideOnClose: true,
|
|
1065
|
+
hideOnClose: undefined, // Platform-specific: true for macOS, false for others
|
|
1060
1066
|
incognito: false,
|
|
1061
1067
|
wasm: false,
|
|
1068
|
+
enableDragDrop: false,
|
|
1062
1069
|
};
|
|
1063
1070
|
|
|
1064
1071
|
async function checkUpdateTips() {
|
|
@@ -1503,7 +1510,7 @@ program
|
|
|
1503
1510
|
.addOption(new Option('--system-tray-icon <string>', 'Custom system tray icon')
|
|
1504
1511
|
.default(DEFAULT_PAKE_OPTIONS.systemTrayIcon)
|
|
1505
1512
|
.hideHelp())
|
|
1506
|
-
.addOption(new Option('--hide-on-close', 'Hide window on close instead of exiting')
|
|
1513
|
+
.addOption(new Option('--hide-on-close', 'Hide window on close instead of exiting (default: true for macOS, false for others)')
|
|
1507
1514
|
.default(DEFAULT_PAKE_OPTIONS.hideOnClose)
|
|
1508
1515
|
.hideHelp())
|
|
1509
1516
|
.addOption(new Option('--title <string>', 'Window title').hideHelp())
|
|
@@ -1513,6 +1520,9 @@ program
|
|
|
1513
1520
|
.addOption(new Option('--wasm', 'Enable WebAssembly support (Flutter Web, etc.)')
|
|
1514
1521
|
.default(DEFAULT_PAKE_OPTIONS.wasm)
|
|
1515
1522
|
.hideHelp())
|
|
1523
|
+
.addOption(new Option('--enable-drag-drop', 'Enable drag and drop functionality')
|
|
1524
|
+
.default(DEFAULT_PAKE_OPTIONS.enableDragDrop)
|
|
1525
|
+
.hideHelp())
|
|
1516
1526
|
.addOption(new Option('--installer-language <string>', 'Installer language')
|
|
1517
1527
|
.default(DEFAULT_PAKE_OPTIONS.installerLanguage)
|
|
1518
1528
|
.hideHelp())
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pake-cli",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.18",
|
|
4
4
|
"description": "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用。",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.0.0"
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"test": "pnpm run cli:build && cross-env PAKE_CREATE_APP=1 node tests/index.js",
|
|
44
44
|
"format": "prettier --write . --ignore-unknown && find tests -name '*.js' -exec sed -i '' 's/[[:space:]]*$//' {} \\; && cd src-tauri && cargo fmt --verbose",
|
|
45
45
|
"format:check": "prettier --check . --ignore-unknown",
|
|
46
|
+
"update": "pnpm update --verbose && cd src-tauri && cargo update",
|
|
46
47
|
"prepublishOnly": "pnpm run cli:build"
|
|
47
48
|
},
|
|
48
49
|
"type": "module",
|
|
@@ -50,10 +51,10 @@
|
|
|
50
51
|
"license": "MIT",
|
|
51
52
|
"dependencies": {
|
|
52
53
|
"@tauri-apps/api": "^2.8.0",
|
|
53
|
-
"@tauri-apps/cli": "^2.8.
|
|
54
|
+
"@tauri-apps/cli": "^2.8.3",
|
|
54
55
|
"axios": "^1.11.0",
|
|
55
56
|
"chalk": "^5.6.0",
|
|
56
|
-
"commander": "^
|
|
57
|
+
"commander": "^12.1.0",
|
|
57
58
|
"execa": "^9.6.0",
|
|
58
59
|
"file-type": "^18.7.0",
|
|
59
60
|
"fs-extra": "^11.3.1",
|
|
@@ -62,7 +63,7 @@
|
|
|
62
63
|
"ora": "^8.2.0",
|
|
63
64
|
"prompts": "^2.4.2",
|
|
64
65
|
"psl": "^1.15.0",
|
|
65
|
-
"sharp": "^0.
|
|
66
|
+
"sharp": "^0.34.3",
|
|
66
67
|
"tmp-promise": "^3.0.3",
|
|
67
68
|
"update-notifier": "^7.3.1"
|
|
68
69
|
},
|
|
@@ -81,7 +82,7 @@
|
|
|
81
82
|
"app-root-path": "^3.1.0",
|
|
82
83
|
"cross-env": "^7.0.3",
|
|
83
84
|
"prettier": "^3.6.2",
|
|
84
|
-
"rollup": "^4.
|
|
85
|
+
"rollup": "^4.49.0",
|
|
85
86
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
86
87
|
"tslib": "^2.8.1",
|
|
87
88
|
"typescript": "^5.9.2"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"windows": [
|
|
3
3
|
{
|
|
4
|
-
"url": "https://
|
|
4
|
+
"url": "https://example.com",
|
|
5
5
|
"url_type": "web",
|
|
6
|
-
"hide_title_bar":
|
|
6
|
+
"hide_title_bar": false,
|
|
7
7
|
"fullscreen": false,
|
|
8
8
|
"width": 1200,
|
|
9
|
-
"height":
|
|
9
|
+
"height": 780,
|
|
10
10
|
"resizable": true,
|
|
11
11
|
"always_on_top": false,
|
|
12
12
|
"dark_mode": false,
|
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
"disabled_web_shortcuts": false,
|
|
15
15
|
"hide_on_close": true,
|
|
16
16
|
"incognito": false,
|
|
17
|
-
"
|
|
18
|
-
"
|
|
17
|
+
"enable_wasm": false,
|
|
18
|
+
"enable_drag_drop": false,
|
|
19
|
+
"title": null
|
|
19
20
|
}
|
|
20
21
|
],
|
|
21
22
|
"user_agent": {
|
|
@@ -29,6 +30,8 @@
|
|
|
29
30
|
"windows": true
|
|
30
31
|
},
|
|
31
32
|
"system_tray_path": "png/icon_512.png",
|
|
32
|
-
"inject": [
|
|
33
|
+
"inject": [
|
|
34
|
+
"/tmp/test.css"
|
|
35
|
+
],
|
|
33
36
|
"proxy_url": ""
|
|
34
37
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"productName": "
|
|
3
|
-
"identifier": "com.pake.
|
|
2
|
+
"productName": "TestInjectFix",
|
|
3
|
+
"identifier": "com.pake.c984d0",
|
|
4
4
|
"version": "1.0.0",
|
|
5
5
|
"app": {
|
|
6
6
|
"withGlobalTauri": true,
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
},
|
|
14
14
|
"bundle": {
|
|
15
15
|
"icon": [
|
|
16
|
-
"/private/var/folders/v3/4mpcxc0564j9qhpf8jpf6r_r0000gp/T/tmp-
|
|
16
|
+
"/private/var/folders/v3/4mpcxc0564j9qhpf8jpf6r_r0000gp/T/tmp-93786-OSC4Bs2UNKIN/converted-icons/testinjectfix.icns"
|
|
17
17
|
],
|
|
18
18
|
"active": true,
|
|
19
19
|
"targets": [
|
|
20
|
-
"
|
|
20
|
+
"dmg"
|
|
21
21
|
],
|
|
22
22
|
"resources": [
|
|
23
|
-
"icons/
|
|
23
|
+
"icons/testinjectfix.icns"
|
|
24
24
|
]
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bundle": {
|
|
3
3
|
"icon": [
|
|
4
|
-
"/private/var/folders/v3/4mpcxc0564j9qhpf8jpf6r_r0000gp/T/tmp-
|
|
4
|
+
"/private/var/folders/v3/4mpcxc0564j9qhpf8jpf6r_r0000gp/T/tmp-93786-OSC4Bs2UNKIN/converted-icons/testinjectfix.icns"
|
|
5
5
|
],
|
|
6
6
|
"active": true,
|
|
7
7
|
"targets": [
|
|
8
|
-
"
|
|
8
|
+
"dmg"
|
|
9
9
|
],
|
|
10
10
|
"resources": [
|
|
11
|
-
"icons/
|
|
11
|
+
"icons/testinjectfix.icns"
|
|
12
12
|
]
|
|
13
13
|
}
|
|
14
14
|
}
|