pake-cli 3.6.3 โ†’ 3.7.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/dist/cli.js CHANGED
@@ -22,12 +22,12 @@ import * as psl from 'psl';
22
22
  import { InvalidArgumentError, program as program$1, Option } from 'commander';
23
23
 
24
24
  var name = "pake-cli";
25
- var version = "3.6.3";
25
+ var version = "3.7.2";
26
26
  var description = "๐Ÿคฑ๐Ÿป Turn any webpage into a desktop app with one command. ๐Ÿคฑ๐Ÿป ไธ€้”ฎๆ‰“ๅŒ…็ฝ‘้กต็”Ÿๆˆ่ฝป้‡ๆกŒ้ขๅบ”็”จใ€‚";
27
27
  var engines = {
28
28
  node: ">=18.0.0"
29
29
  };
30
- var packageManager = "pnpm@10.15.0";
30
+ var packageManager = "pnpm@10.26.2";
31
31
  var bin = {
32
32
  pake: "./dist/cli.js"
33
33
  };
@@ -68,45 +68,50 @@ var scripts = {
68
68
  prepublishOnly: "pnpm run cli:build"
69
69
  };
70
70
  var type = "module";
71
- var exports = "./dist/cli.js";
71
+ var exports$1 = "./dist/cli.js";
72
72
  var license = "MIT";
73
73
  var dependencies = {
74
- "@tauri-apps/api": "^2.9.0",
75
- "@tauri-apps/cli": "^2.9.0",
74
+ "@tauri-apps/api": "^2.9.1",
75
+ "@tauri-apps/cli": "^2.9.6",
76
76
  chalk: "^5.6.2",
77
- commander: "^12.1.0",
78
- execa: "^9.6.0",
79
- "file-type": "^18.7.0",
80
- "fs-extra": "^11.3.2",
77
+ commander: "^14.0.2",
78
+ execa: "^9.6.1",
79
+ "file-type": "^21.1.1",
80
+ "fs-extra": "^11.3.3",
81
81
  "icon-gen": "^5.0.0",
82
82
  loglevel: "^1.9.2",
83
- ora: "^8.2.0",
83
+ ora: "^9.0.0",
84
84
  prompts: "^2.4.2",
85
85
  psl: "^1.15.0",
86
- sharp: "^0.33.5",
86
+ sharp: "^0.34.5",
87
87
  "tmp-promise": "^3.0.3",
88
88
  "update-notifier": "^7.3.1"
89
89
  };
90
90
  var devDependencies = {
91
- "@rollup/plugin-alias": "^5.1.1",
92
- "@rollup/plugin-commonjs": "^28.0.8",
91
+ "@rollup/plugin-alias": "^6.0.0",
92
+ "@rollup/plugin-commonjs": "^29.0.0",
93
93
  "@rollup/plugin-json": "^6.1.0",
94
- "@rollup/plugin-replace": "^6.0.2",
94
+ "@rollup/plugin-replace": "^6.0.3",
95
95
  "@rollup/plugin-terser": "^0.4.4",
96
96
  "@types/fs-extra": "^11.0.4",
97
- "@types/node": "^20.19.23",
97
+ "@types/node": "^25.0.3",
98
98
  "@types/page-icon": "^0.3.6",
99
99
  "@types/prompts": "^2.4.9",
100
100
  "@types/tmp": "^0.2.6",
101
101
  "@types/update-notifier": "^6.0.8",
102
102
  "app-root-path": "^3.1.0",
103
- "cross-env": "^7.0.3",
104
- prettier: "^3.6.2",
105
- rollup: "^4.52.5",
103
+ "cross-env": "^10.1.0",
104
+ prettier: "^3.7.4",
105
+ rollup: "^4.54.0",
106
106
  "rollup-plugin-typescript2": "^0.36.0",
107
107
  tslib: "^2.8.1",
108
108
  typescript: "^5.9.3",
109
- vitest: "^4.0.15"
109
+ vitest: "^4.0.16"
110
+ };
111
+ var pnpm = {
112
+ overrides: {
113
+ sharp: "^0.34.5"
114
+ }
110
115
  };
111
116
  var packageJson = {
112
117
  name: name,
@@ -121,10 +126,11 @@ var packageJson = {
121
126
  files: files,
122
127
  scripts: scripts,
123
128
  type: type,
124
- exports: exports,
129
+ exports: exports$1,
125
130
  license: license,
126
131
  dependencies: dependencies,
127
- devDependencies: devDependencies
132
+ devDependencies: devDependencies,
133
+ pnpm: pnpm
128
134
  };
129
135
 
130
136
  // Convert the current module URL to a file path
@@ -504,9 +510,12 @@ async function mergeConfig(url, options, tauriConf) {
504
510
  tauriConf.productName = name;
505
511
  tauriConf.identifier = identifier;
506
512
  tauriConf.version = appVersion;
507
- if (platform === 'linux') {
508
- tauriConf.mainBinaryName = `pake-${generateIdentifierSafeName(name)}`;
509
- }
513
+ // Always set mainBinaryName to ensure binary uniqueness
514
+ const linuxBinaryName = `pake-${generateLinuxPackageName(name)}`;
515
+ tauriConf.mainBinaryName =
516
+ platform === 'linux'
517
+ ? linuxBinaryName
518
+ : `pake-${generateIdentifierSafeName(name)}`;
510
519
  if (platform == 'win32') {
511
520
  tauriConf.bundle.windows.wix.language[0] = installerLanguage;
512
521
  }
@@ -551,9 +560,9 @@ async function mergeConfig(url, options, tauriConf) {
551
560
  // Remove hardcoded desktop files and regenerate with correct app name
552
561
  delete tauriConf.bundle.linux.deb.files;
553
562
  // Generate correct desktop file configuration
554
- const appNameSafe = getSafeAppName(name);
555
- const identifier = `com.pake.${appNameSafe}`;
556
- const desktopFileName = `${identifier}.desktop`;
563
+ const linuxName = generateLinuxPackageName(name);
564
+ const desktopFileName = `com.pake.${linuxName}.desktop`;
565
+ const iconName = `${linuxName}_512`;
557
566
  // Create desktop file content
558
567
  // Determine if title contains Chinese characters for Name[zh_CN]
559
568
  const chineseName = title && /[\u4e00-\u9fa5]/.test(title) ? title : null;
@@ -563,11 +572,12 @@ Type=Application
563
572
  Name=${name}
564
573
  ${chineseName ? `Name[zh_CN]=${chineseName}` : ''}
565
574
  Comment=${name}
566
- Exec=pake-${appNameSafe}
567
- Icon=${appNameSafe}_512
568
- Categories=Network;WebBrowser;
575
+ Exec=${linuxBinaryName}
576
+ Icon=${iconName}
577
+ Categories=Network;WebBrowser;Utility;
569
578
  MimeType=text/html;text/xml;application/xhtml_xml;
570
579
  StartupNotify=true
580
+ Terminal=false
571
581
  `;
572
582
  // Write desktop file to src-tauri/assets directory where Tauri expects it
573
583
  const srcAssetsDir = path.join(npmDirectory, 'src-tauri/assets');
@@ -576,8 +586,16 @@ StartupNotify=true
576
586
  await fsExtra.writeFile(srcDesktopFilePath, desktopContent);
577
587
  // Set up desktop file in bundle configuration
578
588
  // Use absolute path from src-tauri directory to assets
589
+ const desktopInstallPath = `/usr/share/applications/${desktopFileName}`;
579
590
  tauriConf.bundle.linux.deb.files = {
580
- [`/usr/share/applications/${desktopFileName}`]: `assets/${desktopFileName}`,
591
+ [desktopInstallPath]: `assets/${desktopFileName}`,
592
+ };
593
+ // Add desktop file support for RPM
594
+ if (!tauriConf.bundle.linux.rpm) {
595
+ tauriConf.bundle.linux.rpm = {};
596
+ }
597
+ tauriConf.bundle.linux.rpm.files = {
598
+ [desktopInstallPath]: `assets/${desktopFileName}`,
581
599
  };
582
600
  const validTargets = [
583
601
  'deb',
@@ -615,7 +633,7 @@ StartupNotify=true
615
633
  },
616
634
  linux: {
617
635
  fileExt: '.png',
618
- path: `png/${safeAppName}_512.png`,
636
+ path: `png/${generateLinuxPackageName(name)}_512.png`,
619
637
  defaultIcon: 'png/icon_512.png',
620
638
  message: 'Linux icon must be .png and 512x512px.',
621
639
  },
@@ -679,6 +697,10 @@ StartupNotify=true
679
697
  logger.warn(`โœผ Default system tray icon will remain unchanged.`);
680
698
  }
681
699
  }
700
+ // Ensure trayIcon object exists before setting iconPath
701
+ if (!tauriConf.app.trayIcon) {
702
+ tauriConf.app.trayIcon = {};
703
+ }
682
704
  tauriConf.app.trayIcon.iconPath = trayIconPath;
683
705
  tauriConf.pake.system_tray_path = trayIconPath;
684
706
  delete tauriConf.app.trayIcon;
@@ -1083,12 +1105,11 @@ class BaseBuilder {
1083
1105
  */
1084
1106
  getBinaryName(appName) {
1085
1107
  const extension = process.platform === 'win32' ? '.exe' : '';
1086
- // Linux uses the unique binary name we set in merge.ts
1087
- if (process.platform === 'linux') {
1088
- return `pake-${generateIdentifierSafeName(appName)}${extension}`;
1089
- }
1090
- // Windows and macOS use 'pake' as binary name
1091
- return `pake${extension}`;
1108
+ // Use unique binary name for all platforms to avoid conflicts
1109
+ const nameToUse = process.platform === 'linux'
1110
+ ? generateLinuxPackageName(appName)
1111
+ : generateIdentifierSafeName(appName);
1112
+ return `pake-${nameToUse}${extension}`;
1092
1113
  }
1093
1114
  /**
1094
1115
  * Check if this build has architecture-specific target
@@ -1287,8 +1308,11 @@ class LinuxBuilder extends BaseBuilder {
1287
1308
  }
1288
1309
  async build(url) {
1289
1310
  const targetTypes = ['deb', 'appimage', 'rpm'];
1311
+ const requestedTargets = this.options.targets
1312
+ .split(',')
1313
+ .map((t) => t.trim());
1290
1314
  for (const target of targetTypes) {
1291
- if (this.options.targets === target) {
1315
+ if (requestedTargets.includes(target)) {
1292
1316
  await this.buildAndCopy(url, target);
1293
1317
  }
1294
1318
  }
@@ -1374,9 +1398,7 @@ const API_KEYS = {
1374
1398
  brandfetch: ['1idqvJC0CeFSeyp3Yf7', '1idej-yhU_ThggIHFyG'],
1375
1399
  };
1376
1400
  function generateIconPath(appName, isDefault = false) {
1377
- const safeName = isDefault
1378
- ? 'icon'
1379
- : generateSafeFilename(appName).toLowerCase();
1401
+ const safeName = isDefault ? 'icon' : getIconBaseName(appName);
1380
1402
  const baseName = safeName;
1381
1403
  if (IS_WIN) {
1382
1404
  return path.join(npmDirectory, 'src-tauri', 'png', `${baseName}_256.ico`);
@@ -1386,6 +1408,12 @@ function generateIconPath(appName, isDefault = false) {
1386
1408
  }
1387
1409
  return path.join(npmDirectory, 'src-tauri', 'icons', `${baseName}.icns`);
1388
1410
  }
1411
+ function getIconBaseName(appName) {
1412
+ const baseName = IS_LINUX
1413
+ ? generateLinuxPackageName(appName)
1414
+ : generateSafeFilename(appName).toLowerCase();
1415
+ return baseName || 'pake-app';
1416
+ }
1389
1417
  async function copyWindowsIconIfNeeded(convertedPath, appName) {
1390
1418
  if (!IS_WIN || !convertedPath.endsWith('.ico')) {
1391
1419
  return convertedPath;
@@ -1490,7 +1518,7 @@ async function convertIconFormat(inputPath, appName) {
1490
1518
  const platformOutputDir = path.join(outputDir, 'converted-icons');
1491
1519
  await fsExtra.ensureDir(platformOutputDir);
1492
1520
  const processedInputPath = await preprocessIcon(inputPath);
1493
- const iconName = generateSafeFilename(appName).toLowerCase();
1521
+ const iconName = getIconBaseName(appName);
1494
1522
  // Generate platform-specific format
1495
1523
  if (IS_WIN) {
1496
1524
  // Support multiple sizes for better Windows compatibility
@@ -1669,16 +1697,6 @@ async function tryGetFavicon(url, appName) {
1669
1697
  if (error instanceof Error) {
1670
1698
  logger.debug(`Icon service ${serviceUrl} failed: ${error.message}`);
1671
1699
  }
1672
- // Network error handling
1673
- if ((IS_LINUX || IS_WIN) && error.code === 'ENOTFOUND') {
1674
- return null;
1675
- }
1676
- // Icon generation error on Windows
1677
- if (IS_WIN &&
1678
- error instanceof Error &&
1679
- error.message.includes('icongen')) {
1680
- return null;
1681
- }
1682
1700
  continue;
1683
1701
  }
1684
1702
  }
@@ -1790,6 +1808,18 @@ function resolveAppName(name, platform) {
1790
1808
  const domain = getDomain(name) || 'pake';
1791
1809
  return platform !== 'linux' ? capitalizeFirstLetter(domain) : domain;
1792
1810
  }
1811
+ function resolveLocalAppName(filePath, platform) {
1812
+ const baseName = path.parse(filePath).name || 'pake-app';
1813
+ if (platform === 'linux') {
1814
+ return generateLinuxPackageName(baseName) || 'pake-app';
1815
+ }
1816
+ const normalized = baseName
1817
+ .replace(/[^a-zA-Z0-9\u4e00-\u9fff -]/g, '')
1818
+ .replace(/^[ -]+/, '')
1819
+ .replace(/\s+/g, ' ')
1820
+ .trim();
1821
+ return normalized || 'pake-app';
1822
+ }
1793
1823
  function isValidName(name, platform) {
1794
1824
  const platformRegexMapping = {
1795
1825
  linux: /^[a-z0-9\u4e00-\u9fff][a-z0-9\u4e00-\u9fff-]*$/,
@@ -1804,10 +1834,12 @@ async function handleOptions(options, url) {
1804
1834
  let name = options.name;
1805
1835
  const pathExists = await fsExtra.pathExists(url);
1806
1836
  if (!options.name) {
1807
- const defaultName = pathExists ? '' : resolveAppName(url, platform);
1837
+ const defaultName = pathExists
1838
+ ? resolveLocalAppName(url, platform)
1839
+ : resolveAppName(url, platform);
1808
1840
  const promptMessage = 'Enter your application name';
1809
1841
  const namePrompt = await promptText(promptMessage, defaultName);
1810
- name = namePrompt || defaultName;
1842
+ name = namePrompt?.trim() || defaultName;
1811
1843
  }
1812
1844
  if (name && platform === 'linux') {
1813
1845
  name = generateLinuxPackageName(name);
@@ -0,0 +1 @@
1
+ <html><body><h1>Hello Pake</h1></body></html>
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "pake-cli",
3
- "version": "3.6.3",
3
+ "version": "3.7.2",
4
4
  "description": "๐Ÿคฑ๐Ÿป Turn any webpage into a desktop app with one command. ๐Ÿคฑ๐Ÿป ไธ€้”ฎๆ‰“ๅŒ…็ฝ‘้กต็”Ÿๆˆ่ฝป้‡ๆกŒ้ขๅบ”็”จใ€‚",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
7
7
  },
8
- "packageManager": "pnpm@10.15.0",
8
+ "packageManager": "pnpm@10.26.2",
9
9
  "bin": {
10
10
  "pake": "./dist/cli.js"
11
11
  },
@@ -49,41 +49,46 @@
49
49
  "exports": "./dist/cli.js",
50
50
  "license": "MIT",
51
51
  "dependencies": {
52
- "@tauri-apps/api": "^2.9.0",
53
- "@tauri-apps/cli": "^2.9.0",
52
+ "@tauri-apps/api": "^2.9.1",
53
+ "@tauri-apps/cli": "^2.9.6",
54
54
  "chalk": "^5.6.2",
55
- "commander": "^12.1.0",
56
- "execa": "^9.6.0",
57
- "file-type": "^18.7.0",
58
- "fs-extra": "^11.3.2",
55
+ "commander": "^14.0.2",
56
+ "execa": "^9.6.1",
57
+ "file-type": "^21.1.1",
58
+ "fs-extra": "^11.3.3",
59
59
  "icon-gen": "^5.0.0",
60
60
  "loglevel": "^1.9.2",
61
- "ora": "^8.2.0",
61
+ "ora": "^9.0.0",
62
62
  "prompts": "^2.4.2",
63
63
  "psl": "^1.15.0",
64
- "sharp": "^0.33.5",
64
+ "sharp": "^0.34.5",
65
65
  "tmp-promise": "^3.0.3",
66
66
  "update-notifier": "^7.3.1"
67
67
  },
68
68
  "devDependencies": {
69
- "@rollup/plugin-alias": "^5.1.1",
70
- "@rollup/plugin-commonjs": "^28.0.8",
69
+ "@rollup/plugin-alias": "^6.0.0",
70
+ "@rollup/plugin-commonjs": "^29.0.0",
71
71
  "@rollup/plugin-json": "^6.1.0",
72
- "@rollup/plugin-replace": "^6.0.2",
72
+ "@rollup/plugin-replace": "^6.0.3",
73
73
  "@rollup/plugin-terser": "^0.4.4",
74
74
  "@types/fs-extra": "^11.0.4",
75
- "@types/node": "^20.19.23",
75
+ "@types/node": "^25.0.3",
76
76
  "@types/page-icon": "^0.3.6",
77
77
  "@types/prompts": "^2.4.9",
78
78
  "@types/tmp": "^0.2.6",
79
79
  "@types/update-notifier": "^6.0.8",
80
80
  "app-root-path": "^3.1.0",
81
- "cross-env": "^7.0.3",
82
- "prettier": "^3.6.2",
83
- "rollup": "^4.52.5",
81
+ "cross-env": "^10.1.0",
82
+ "prettier": "^3.7.4",
83
+ "rollup": "^4.54.0",
84
84
  "rollup-plugin-typescript2": "^0.36.0",
85
85
  "tslib": "^2.8.1",
86
86
  "typescript": "^5.9.3",
87
- "vitest": "^4.0.15"
87
+ "vitest": "^4.0.16"
88
+ },
89
+ "pnpm": {
90
+ "overrides": {
91
+ "sharp": "^0.34.5"
92
+ }
88
93
  }
89
94
  }