pake-cli 3.6.4 โ†’ 3.7.3

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.4";
25
+ var version = "3.7.3";
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,54 @@ 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
+ },
115
+ onlyBuiltDependencies: [
116
+ "esbuild",
117
+ "sharp"
118
+ ]
110
119
  };
111
120
  var packageJson = {
112
121
  name: name,
@@ -121,10 +130,11 @@ var packageJson = {
121
130
  files: files,
122
131
  scripts: scripts,
123
132
  type: type,
124
- exports: exports,
133
+ exports: exports$1,
125
134
  license: license,
126
135
  dependencies: dependencies,
127
- devDependencies: devDependencies
136
+ devDependencies: devDependencies,
137
+ pnpm: pnpm
128
138
  };
129
139
 
130
140
  // Convert the current module URL to a file path
@@ -506,7 +516,10 @@ async function mergeConfig(url, options, tauriConf) {
506
516
  tauriConf.version = appVersion;
507
517
  // Always set mainBinaryName to ensure binary uniqueness
508
518
  const linuxBinaryName = `pake-${generateLinuxPackageName(name)}`;
509
- tauriConf.mainBinaryName = platform === 'linux' ? linuxBinaryName : `pake-${generateIdentifierSafeName(name)}`;
519
+ tauriConf.mainBinaryName =
520
+ platform === 'linux'
521
+ ? linuxBinaryName
522
+ : `pake-${generateIdentifierSafeName(name)}`;
510
523
  if (platform == 'win32') {
511
524
  tauriConf.bundle.windows.wix.language[0] = installerLanguage;
512
525
  }
@@ -688,6 +701,10 @@ Terminal=false
688
701
  logger.warn(`โœผ Default system tray icon will remain unchanged.`);
689
702
  }
690
703
  }
704
+ // Ensure trayIcon object exists before setting iconPath
705
+ if (!tauriConf.app.trayIcon) {
706
+ tauriConf.app.trayIcon = {};
707
+ }
691
708
  tauriConf.app.trayIcon.iconPath = trayIconPath;
692
709
  tauriConf.pake.system_tray_path = trayIconPath;
693
710
  delete tauriConf.app.trayIcon;
@@ -1093,7 +1110,9 @@ class BaseBuilder {
1093
1110
  getBinaryName(appName) {
1094
1111
  const extension = process.platform === 'win32' ? '.exe' : '';
1095
1112
  // Use unique binary name for all platforms to avoid conflicts
1096
- const nameToUse = process.platform === 'linux' ? generateLinuxPackageName(appName) : generateIdentifierSafeName(appName);
1113
+ const nameToUse = process.platform === 'linux'
1114
+ ? generateLinuxPackageName(appName)
1115
+ : generateIdentifierSafeName(appName);
1097
1116
  return `pake-${nameToUse}${extension}`;
1098
1117
  }
1099
1118
  /**
@@ -1293,8 +1312,11 @@ class LinuxBuilder extends BaseBuilder {
1293
1312
  }
1294
1313
  async build(url) {
1295
1314
  const targetTypes = ['deb', 'appimage', 'rpm'];
1315
+ const requestedTargets = this.options.targets
1316
+ .split(',')
1317
+ .map((t) => t.trim());
1296
1318
  for (const target of targetTypes) {
1297
- if (this.options.targets === target) {
1319
+ if (requestedTargets.includes(target)) {
1298
1320
  await this.buildAndCopy(url, target);
1299
1321
  }
1300
1322
  }
@@ -1380,9 +1402,7 @@ const API_KEYS = {
1380
1402
  brandfetch: ['1idqvJC0CeFSeyp3Yf7', '1idej-yhU_ThggIHFyG'],
1381
1403
  };
1382
1404
  function generateIconPath(appName, isDefault = false) {
1383
- const safeName = isDefault
1384
- ? 'icon'
1385
- : generateSafeFilename(appName).toLowerCase();
1405
+ const safeName = isDefault ? 'icon' : getIconBaseName(appName);
1386
1406
  const baseName = safeName;
1387
1407
  if (IS_WIN) {
1388
1408
  return path.join(npmDirectory, 'src-tauri', 'png', `${baseName}_256.ico`);
@@ -1392,6 +1412,12 @@ function generateIconPath(appName, isDefault = false) {
1392
1412
  }
1393
1413
  return path.join(npmDirectory, 'src-tauri', 'icons', `${baseName}.icns`);
1394
1414
  }
1415
+ function getIconBaseName(appName) {
1416
+ const baseName = IS_LINUX
1417
+ ? generateLinuxPackageName(appName)
1418
+ : generateSafeFilename(appName).toLowerCase();
1419
+ return baseName || 'pake-app';
1420
+ }
1395
1421
  async function copyWindowsIconIfNeeded(convertedPath, appName) {
1396
1422
  if (!IS_WIN || !convertedPath.endsWith('.ico')) {
1397
1423
  return convertedPath;
@@ -1496,7 +1522,7 @@ async function convertIconFormat(inputPath, appName) {
1496
1522
  const platformOutputDir = path.join(outputDir, 'converted-icons');
1497
1523
  await fsExtra.ensureDir(platformOutputDir);
1498
1524
  const processedInputPath = await preprocessIcon(inputPath);
1499
- const iconName = generateSafeFilename(appName).toLowerCase();
1525
+ const iconName = getIconBaseName(appName);
1500
1526
  // Generate platform-specific format
1501
1527
  if (IS_WIN) {
1502
1528
  // Support multiple sizes for better Windows compatibility
@@ -1618,6 +1644,14 @@ async function handleIcon(options, url) {
1618
1644
  const result = await processIcon(resolvedPath, options.name || '');
1619
1645
  return result || resolvedPath;
1620
1646
  }
1647
+ // Check for existing local icon before downloading
1648
+ if (options.name) {
1649
+ const localIconPath = generateIconPath(options.name);
1650
+ if (await fsExtra.pathExists(localIconPath)) {
1651
+ logger.info(`โœผ Using existing local icon: ${localIconPath}`);
1652
+ return localIconPath;
1653
+ }
1654
+ }
1621
1655
  // Try favicon from website
1622
1656
  if (url && options.name) {
1623
1657
  const faviconPath = await tryGetFavicon(url, options.name);
@@ -1675,16 +1709,6 @@ async function tryGetFavicon(url, appName) {
1675
1709
  if (error instanceof Error) {
1676
1710
  logger.debug(`Icon service ${serviceUrl} failed: ${error.message}`);
1677
1711
  }
1678
- // Network error handling
1679
- if ((IS_LINUX || IS_WIN) && error.code === 'ENOTFOUND') {
1680
- return null;
1681
- }
1682
- // Icon generation error on Windows
1683
- if (IS_WIN &&
1684
- error instanceof Error &&
1685
- error.message.includes('icongen')) {
1686
- return null;
1687
- }
1688
1712
  continue;
1689
1713
  }
1690
1714
  }
@@ -1796,6 +1820,18 @@ function resolveAppName(name, platform) {
1796
1820
  const domain = getDomain(name) || 'pake';
1797
1821
  return platform !== 'linux' ? capitalizeFirstLetter(domain) : domain;
1798
1822
  }
1823
+ function resolveLocalAppName(filePath, platform) {
1824
+ const baseName = path.parse(filePath).name || 'pake-app';
1825
+ if (platform === 'linux') {
1826
+ return generateLinuxPackageName(baseName) || 'pake-app';
1827
+ }
1828
+ const normalized = baseName
1829
+ .replace(/[^a-zA-Z0-9\u4e00-\u9fff -]/g, '')
1830
+ .replace(/^[ -]+/, '')
1831
+ .replace(/\s+/g, ' ')
1832
+ .trim();
1833
+ return normalized || 'pake-app';
1834
+ }
1799
1835
  function isValidName(name, platform) {
1800
1836
  const platformRegexMapping = {
1801
1837
  linux: /^[a-z0-9\u4e00-\u9fff][a-z0-9\u4e00-\u9fff-]*$/,
@@ -1810,10 +1846,12 @@ async function handleOptions(options, url) {
1810
1846
  let name = options.name;
1811
1847
  const pathExists = await fsExtra.pathExists(url);
1812
1848
  if (!options.name) {
1813
- const defaultName = pathExists ? '' : resolveAppName(url, platform);
1849
+ const defaultName = pathExists
1850
+ ? resolveLocalAppName(url, platform)
1851
+ : resolveAppName(url, platform);
1814
1852
  const promptMessage = 'Enter your application name';
1815
1853
  const namePrompt = await promptText(promptMessage, defaultName);
1816
- name = namePrompt || defaultName;
1854
+ name = namePrompt?.trim() || defaultName;
1817
1855
  }
1818
1856
  if (name && platform === 'linux') {
1819
1857
  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.4",
3
+ "version": "3.7.3",
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,50 @@
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
+ },
93
+ "onlyBuiltDependencies": [
94
+ "esbuild",
95
+ "sharp"
96
+ ]
88
97
  }
89
98
  }