pake-cli 3.3.6 โ 3.3.7-beta
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 +11 -4
- package/dist/cli.js +20 -4
- package/package.json +1 -1
- package/src-tauri/src/inject/event.js +30 -22
package/README.md
CHANGED
|
@@ -434,6 +434,13 @@ Pake's development can not be without these Hackers. They contributed a lot of c
|
|
|
434
434
|
<sub><b>Jiaqi Gu</b></sub>
|
|
435
435
|
</a>
|
|
436
436
|
</td>
|
|
437
|
+
<td align="center">
|
|
438
|
+
<a href="https://github.com/JohannLai">
|
|
439
|
+
<img src="https://avatars.githubusercontent.com/u/10769405?v=4" width="90;" alt="JohannLai"/>
|
|
440
|
+
<br />
|
|
441
|
+
<sub><b>Johannlai</b></sub>
|
|
442
|
+
</a>
|
|
443
|
+
</td>
|
|
437
444
|
<td align="center">
|
|
438
445
|
<a href="https://github.com/Jason6987">
|
|
439
446
|
<img src="https://avatars.githubusercontent.com/u/140222795?v=4" width="90;" alt="Jason6987"/>
|
|
@@ -441,6 +448,8 @@ Pake's development can not be without these Hackers. They contributed a lot of c
|
|
|
441
448
|
<sub><b>Luminall</b></sub>
|
|
442
449
|
</a>
|
|
443
450
|
</td>
|
|
451
|
+
</tr>
|
|
452
|
+
<tr>
|
|
444
453
|
<td align="center">
|
|
445
454
|
<a href="https://github.com/Milo123459">
|
|
446
455
|
<img src="https://avatars.githubusercontent.com/u/50248166?v=4" width="90;" alt="Milo123459"/>
|
|
@@ -448,8 +457,6 @@ Pake's development can not be without these Hackers. They contributed a lot of c
|
|
|
448
457
|
<sub><b>Milo</b></sub>
|
|
449
458
|
</a>
|
|
450
459
|
</td>
|
|
451
|
-
</tr>
|
|
452
|
-
<tr>
|
|
453
460
|
<td align="center">
|
|
454
461
|
<a href="https://github.com/princemaple">
|
|
455
462
|
<img src="https://avatars.githubusercontent.com/u/1329716?v=4" width="90;" alt="princemaple"/>
|
|
@@ -492,6 +499,8 @@ Pake's development can not be without these Hackers. They contributed a lot of c
|
|
|
492
499
|
<sub><b>Null</b></sub>
|
|
493
500
|
</a>
|
|
494
501
|
</td>
|
|
502
|
+
</tr>
|
|
503
|
+
<tr>
|
|
495
504
|
<td align="center">
|
|
496
505
|
<a href="https://github.com/liudonghua123">
|
|
497
506
|
<img src="https://avatars.githubusercontent.com/u/2276718?v=4" width="90;" alt="liudonghua123"/>
|
|
@@ -499,8 +508,6 @@ Pake's development can not be without these Hackers. They contributed a lot of c
|
|
|
499
508
|
<sub><b>Liudonghua</b></sub>
|
|
500
509
|
</a>
|
|
501
510
|
</td>
|
|
502
|
-
</tr>
|
|
503
|
-
<tr>
|
|
504
511
|
<td align="center">
|
|
505
512
|
<a href="https://github.com/liusishan">
|
|
506
513
|
<img src="https://avatars.githubusercontent.com/u/33129823?v=4" width="90;" alt="liusishan"/>
|
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.3.
|
|
25
|
+
var version = "3.3.7-beta";
|
|
26
26
|
var description = "๐คฑ๐ป Turn any webpage into a desktop app with one command. ๐คฑ๐ป ไธ้ฎๆๅ
็ฝ้กต็ๆ่ฝป้ๆก้ขๅบ็จใ";
|
|
27
27
|
var engines = {
|
|
28
28
|
node: ">=18.0.0"
|
|
@@ -343,9 +343,23 @@ function generateLinuxPackageName(name) {
|
|
|
343
343
|
.replace(/-+/g, '-');
|
|
344
344
|
}
|
|
345
345
|
function generateIdentifierSafeName(name) {
|
|
346
|
-
|
|
347
|
-
.replace(/[^a-zA-Z0-9]/g, '')
|
|
346
|
+
const cleaned = name
|
|
347
|
+
.replace(/[^a-zA-Z0-9\u4e00-\u9fff]/g, '')
|
|
348
348
|
.toLowerCase();
|
|
349
|
+
if (cleaned === '') {
|
|
350
|
+
const fallback = Array.from(name)
|
|
351
|
+
.map(char => {
|
|
352
|
+
const code = char.charCodeAt(0);
|
|
353
|
+
if ((code >= 48 && code <= 57) || (code >= 65 && code <= 90) || (code >= 97 && code <= 122)) {
|
|
354
|
+
return char.toLowerCase();
|
|
355
|
+
}
|
|
356
|
+
return code.toString(16);
|
|
357
|
+
})
|
|
358
|
+
.join('')
|
|
359
|
+
.slice(0, 50);
|
|
360
|
+
return fallback || 'pake-app';
|
|
361
|
+
}
|
|
362
|
+
return cleaned;
|
|
349
363
|
}
|
|
350
364
|
|
|
351
365
|
async function mergeConfig(url, options, tauriConf) {
|
|
@@ -1190,7 +1204,9 @@ const API_KEYS = {
|
|
|
1190
1204
|
brandfetch: ['1idqvJC0CeFSeyp3Yf7', '1idej-yhU_ThggIHFyG'],
|
|
1191
1205
|
};
|
|
1192
1206
|
function generateIconPath(appName, isDefault = false) {
|
|
1193
|
-
const safeName = isDefault
|
|
1207
|
+
const safeName = isDefault
|
|
1208
|
+
? 'icon'
|
|
1209
|
+
: generateSafeFilename(appName).toLowerCase();
|
|
1194
1210
|
const baseName = safeName;
|
|
1195
1211
|
if (IS_WIN) {
|
|
1196
1212
|
return path.join(npmDirectory, 'src-tauri', 'png', `${baseName}_256.ico`);
|
package/package.json
CHANGED
|
@@ -273,29 +273,31 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
273
273
|
binary: Array.from(binary),
|
|
274
274
|
language: userLanguage,
|
|
275
275
|
},
|
|
276
|
-
}).catch(error => {
|
|
277
|
-
console.error(
|
|
276
|
+
}).catch((error) => {
|
|
277
|
+
console.error("Failed to download data URI file:", filename, error);
|
|
278
278
|
});
|
|
279
279
|
} catch (error) {
|
|
280
|
-
console.error(
|
|
280
|
+
console.error("Failed to process data URI:", dataURI, error);
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
function downloadFromBlobUrl(blobUrl, filename) {
|
|
285
|
-
convertBlobUrlToBinary(blobUrl)
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
285
|
+
convertBlobUrlToBinary(blobUrl)
|
|
286
|
+
.then((binary) => {
|
|
287
|
+
const userLanguage = navigator.language || navigator.userLanguage;
|
|
288
|
+
invoke("download_file_by_binary", {
|
|
289
|
+
params: {
|
|
290
|
+
filename,
|
|
291
|
+
binary,
|
|
292
|
+
language: userLanguage,
|
|
293
|
+
},
|
|
294
|
+
}).catch((error) => {
|
|
295
|
+
console.error("Failed to download blob file:", filename, error);
|
|
296
|
+
});
|
|
297
|
+
})
|
|
298
|
+
.catch((error) => {
|
|
299
|
+
console.error("Failed to convert blob to binary:", blobUrl, error);
|
|
295
300
|
});
|
|
296
|
-
}).catch(error => {
|
|
297
|
-
console.error('Failed to convert blob to binary:', blobUrl, error);
|
|
298
|
-
});
|
|
299
301
|
}
|
|
300
302
|
|
|
301
303
|
// detect blob download by createElement("a")
|
|
@@ -335,14 +337,14 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
335
337
|
const handleExternalLink = (url) => {
|
|
336
338
|
// Don't try to open blob: or data: URLs with shell
|
|
337
339
|
if (isSpecialDownload(url)) {
|
|
338
|
-
console.warn(
|
|
340
|
+
console.warn("Cannot open special URL with shell:", url);
|
|
339
341
|
return;
|
|
340
342
|
}
|
|
341
343
|
|
|
342
344
|
invoke("plugin:shell|open", {
|
|
343
345
|
path: url,
|
|
344
|
-
}).catch(error => {
|
|
345
|
-
console.error(
|
|
346
|
+
}).catch((error) => {
|
|
347
|
+
console.error("Failed to open URL with shell:", url, error);
|
|
346
348
|
});
|
|
347
349
|
};
|
|
348
350
|
|
|
@@ -370,7 +372,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
370
372
|
|
|
371
373
|
const detectAnchorElementClick = (e) => {
|
|
372
374
|
// Safety check: ensure e.target exists and is an Element with closest method
|
|
373
|
-
if (!e.target || typeof e.target.closest !==
|
|
375
|
+
if (!e.target || typeof e.target.closest !== "function") {
|
|
374
376
|
return;
|
|
375
377
|
}
|
|
376
378
|
const anchorElement = e.target.closest("a");
|
|
@@ -723,7 +725,10 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
723
725
|
}
|
|
724
726
|
|
|
725
727
|
// Check for parent elements with background images
|
|
726
|
-
const parentWithBg =
|
|
728
|
+
const parentWithBg =
|
|
729
|
+
target && typeof target.closest === "function"
|
|
730
|
+
? target.closest('[style*="background-image"]')
|
|
731
|
+
: null;
|
|
727
732
|
if (parentWithBg) {
|
|
728
733
|
const bgImage = parentWithBg.style.backgroundImage;
|
|
729
734
|
const urlMatch = bgImage.match(/url\(["']?([^"')]+)["']?\)/);
|
|
@@ -792,7 +797,10 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
792
797
|
const mediaInfo = getMediaInfo(target);
|
|
793
798
|
|
|
794
799
|
// Check for links (but not if it's media)
|
|
795
|
-
const linkElement =
|
|
800
|
+
const linkElement =
|
|
801
|
+
target && typeof target.closest === "function"
|
|
802
|
+
? target.closest("a")
|
|
803
|
+
: null;
|
|
796
804
|
const isLink = linkElement && linkElement.href && !mediaInfo.isMedia;
|
|
797
805
|
|
|
798
806
|
// Only show custom menu for media or links
|