pake-cli 3.5.0 → 3.5.2
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 +45 -15
- package/package.json +1 -1
- package/src-tauri/src/inject/event.js +3 -0
package/README.md
CHANGED
|
@@ -400,6 +400,13 @@ Pake's development can not be without these Hackers. They contributed a lot of c
|
|
|
400
400
|
</td>
|
|
401
401
|
</tr>
|
|
402
402
|
<tr>
|
|
403
|
+
<td align="center">
|
|
404
|
+
<a href="https://github.com/claude">
|
|
405
|
+
<img src="https://avatars.githubusercontent.com/u/81847?v=4" width="90;" alt="claude"/>
|
|
406
|
+
<br />
|
|
407
|
+
<sub><b>Claude</b></sub>
|
|
408
|
+
</a>
|
|
409
|
+
</td>
|
|
403
410
|
<td align="center">
|
|
404
411
|
<a href="https://github.com/turkyden">
|
|
405
412
|
<img src="https://avatars.githubusercontent.com/u/24560160?v=4" width="90;" alt="turkyden"/>
|
|
@@ -442,6 +449,8 @@ Pake's development can not be without these Hackers. They contributed a lot of c
|
|
|
442
449
|
<sub><b>Johannlai</b></sub>
|
|
443
450
|
</a>
|
|
444
451
|
</td>
|
|
452
|
+
</tr>
|
|
453
|
+
<tr>
|
|
445
454
|
<td align="center">
|
|
446
455
|
<a href="https://github.com/Jason6987">
|
|
447
456
|
<img src="https://avatars.githubusercontent.com/u/140222795?v=4" width="90;" alt="Jason6987"/>
|
|
@@ -449,8 +458,6 @@ Pake's development can not be without these Hackers. They contributed a lot of c
|
|
|
449
458
|
<sub><b>Luminall</b></sub>
|
|
450
459
|
</a>
|
|
451
460
|
</td>
|
|
452
|
-
</tr>
|
|
453
|
-
<tr>
|
|
454
461
|
<td align="center">
|
|
455
462
|
<a href="https://github.com/Milo123459">
|
|
456
463
|
<img src="https://avatars.githubusercontent.com/u/50248166?v=4" width="90;" alt="Milo123459"/>
|
|
@@ -493,6 +500,8 @@ Pake's development can not be without these Hackers. They contributed a lot of c
|
|
|
493
500
|
<sub><b>Hyzhao</b></sub>
|
|
494
501
|
</a>
|
|
495
502
|
</td>
|
|
503
|
+
</tr>
|
|
504
|
+
<tr>
|
|
496
505
|
<td align="center">
|
|
497
506
|
<a href="https://github.com/lakca">
|
|
498
507
|
<img src="https://avatars.githubusercontent.com/u/16255922?v=4" width="90;" alt="lakca"/>
|
|
@@ -500,8 +509,6 @@ Pake's development can not be without these Hackers. They contributed a lot of c
|
|
|
500
509
|
<sub><b>Null</b></sub>
|
|
501
510
|
</a>
|
|
502
511
|
</td>
|
|
503
|
-
</tr>
|
|
504
|
-
<tr>
|
|
505
512
|
<td align="center">
|
|
506
513
|
<a href="https://github.com/liudonghua123">
|
|
507
514
|
<img src="https://avatars.githubusercontent.com/u/2276718?v=4" width="90;" alt="liudonghua123"/>
|
package/dist/cli.js
CHANGED
|
@@ -23,7 +23,7 @@ import sharp from 'sharp';
|
|
|
23
23
|
import * as psl from 'psl';
|
|
24
24
|
|
|
25
25
|
var name = "pake-cli";
|
|
26
|
-
var version = "3.5.
|
|
26
|
+
var version = "3.5.2";
|
|
27
27
|
var description = "🤱🏻 Turn any webpage into a desktop app with one command. 🤱🏻 一键打包网页生成轻量桌面应用。";
|
|
28
28
|
var engines = {
|
|
29
29
|
node: ">=18.0.0"
|
|
@@ -730,7 +730,8 @@ class BaseBuilder {
|
|
|
730
730
|
: undefined;
|
|
731
731
|
}
|
|
732
732
|
getInstallTimeout() {
|
|
733
|
-
|
|
733
|
+
// Windows needs more time due to native compilation and antivirus scanning
|
|
734
|
+
return process.platform === 'win32' ? 900000 : 600000;
|
|
734
735
|
}
|
|
735
736
|
getBuildTimeout() {
|
|
736
737
|
return 900000;
|
|
@@ -786,25 +787,54 @@ class BaseBuilder {
|
|
|
786
787
|
const rustProjectDir = path.join(tauriSrcPath, '.cargo');
|
|
787
788
|
const projectConf = path.join(rustProjectDir, 'config.toml');
|
|
788
789
|
await fsExtra.ensureDir(rustProjectDir);
|
|
789
|
-
//
|
|
790
|
+
// Detect available package manager
|
|
790
791
|
const packageManager = await this.detectPackageManager();
|
|
791
|
-
const registryOption =
|
|
792
|
-
? ' --registry=https://registry.npmmirror.com'
|
|
793
|
-
: '';
|
|
794
|
-
// 根据包管理器类型设置依赖冲突解决选项
|
|
792
|
+
const registryOption = ' --registry=https://registry.npmmirror.com';
|
|
795
793
|
const peerDepsOption = packageManager === 'npm' ? ' --legacy-peer-deps' : '';
|
|
796
794
|
const timeout = this.getInstallTimeout();
|
|
797
795
|
const buildEnv = this.getBuildEnvironment();
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
796
|
+
// Show helpful message for first-time users
|
|
797
|
+
if (!tauriTargetPathExists) {
|
|
798
|
+
logger.info(process.platform === 'win32'
|
|
799
|
+
? '✺ First-time setup may take 10-15 minutes on Windows (compiling dependencies)...'
|
|
800
|
+
: '✺ First-time setup may take 5-10 minutes (installing dependencies)...');
|
|
803
801
|
}
|
|
804
|
-
|
|
805
|
-
|
|
802
|
+
let usedMirror = isChina;
|
|
803
|
+
try {
|
|
804
|
+
if (isChina) {
|
|
805
|
+
logger.info(`✺ Located in China, using ${packageManager}/rsProxy CN mirror.`);
|
|
806
|
+
const projectCnConf = path.join(tauriSrcPath, 'rust_proxy.toml');
|
|
807
|
+
await fsExtra.copy(projectCnConf, projectConf);
|
|
808
|
+
await shellExec(`cd "${npmDirectory}" && ${packageManager} install${registryOption}${peerDepsOption}`, timeout, buildEnv);
|
|
809
|
+
}
|
|
810
|
+
else {
|
|
811
|
+
await shellExec(`cd "${npmDirectory}" && ${packageManager} install${peerDepsOption}`, timeout, buildEnv);
|
|
812
|
+
}
|
|
813
|
+
spinner.succeed(chalk.green('Package installed!'));
|
|
814
|
+
}
|
|
815
|
+
catch (error) {
|
|
816
|
+
// If installation times out and we haven't tried the mirror yet, retry with mirror
|
|
817
|
+
if (error.message?.includes('timed out') && !usedMirror) {
|
|
818
|
+
spinner.fail(chalk.yellow('Installation timed out, retrying with CN mirror...'));
|
|
819
|
+
logger.info('✺ Retrying installation with CN mirror for better speed...');
|
|
820
|
+
const retrySpinner = getSpinner('Retrying installation...');
|
|
821
|
+
usedMirror = true;
|
|
822
|
+
try {
|
|
823
|
+
const projectCnConf = path.join(tauriSrcPath, 'rust_proxy.toml');
|
|
824
|
+
await fsExtra.copy(projectCnConf, projectConf);
|
|
825
|
+
await shellExec(`cd "${npmDirectory}" && ${packageManager} install${registryOption}${peerDepsOption}`, timeout, buildEnv);
|
|
826
|
+
retrySpinner.succeed(chalk.green('Package installed with CN mirror!'));
|
|
827
|
+
}
|
|
828
|
+
catch (retryError) {
|
|
829
|
+
retrySpinner.fail(chalk.red('Installation failed'));
|
|
830
|
+
throw retryError;
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
else {
|
|
834
|
+
spinner.fail(chalk.red('Installation failed'));
|
|
835
|
+
throw error;
|
|
836
|
+
}
|
|
806
837
|
}
|
|
807
|
-
spinner.succeed(chalk.green('Package installed!'));
|
|
808
838
|
if (!tauriTargetPathExists) {
|
|
809
839
|
logger.warn('✼ The first packaging may be slow, please be patient and wait, it will be faster afterwards.');
|
|
810
840
|
}
|
package/package.json
CHANGED