pake-cli 3.4.1 โ†’ 3.4.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/README.md CHANGED
@@ -156,17 +156,17 @@ In addition, double-click the title bar to switch to full-screen mode. For Mac u
156
156
 
157
157
  ## Command-Line Packaging
158
158
 
159
- ![Pake](https://raw.githubusercontent.com/tw93/static/main/pake/pake.gif)
159
+ ![Pake](https://raw.githubusercontent.com/tw93/static/main/pake/pake1.gif)
160
160
 
161
161
  ```bash
162
- # Install
162
+ # Install Pake CLI
163
163
  pnpm install -g pake-cli
164
164
 
165
- # Basic usage (auto-fetch website icon)
166
- pake https://weekly.tw93.fun --name Weekly
165
+ # Basic usage - automatically fetches website icon
166
+ pake https://github.com --name GitHub
167
167
 
168
- # Common options: --name app name, --icon custom icon, --width/--height window size, --hide-title-bar macOS immersive
169
- pake https://weekly.tw93.fun --name Weekly --icon https://cdn.tw93.fun/pake/weekly.icns --hide-title-bar
168
+ # Advanced usage with custom options
169
+ pake https://weekly.tw93.fun --name Weekly --icon https://cdn.tw93.fun/pake/weekly.icns --width 1200 --height 800 --hide-title-bar
170
170
  ```
171
171
 
172
172
  First-time packaging requires environment setup and may be slower, subsequent builds are fast. For complete parameter documentation, see [CLI Usage Guide](docs/cli-usage.md). Don't want to use CLI? Try [GitHub Actions Online Building](docs/github-actions-usage.md).
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.4.1";
26
+ var version = "3.4.3";
27
27
  var description = "๐Ÿคฑ๐Ÿป Turn any webpage into a desktop app with one command. ๐Ÿคฑ๐Ÿป ไธ€้”ฎๆ‰“ๅŒ…็ฝ‘้กต็”Ÿๆˆ่ฝป้‡ๆกŒ้ขๅบ”็”จใ€‚";
28
28
  var engines = {
29
29
  node: ">=18.0.0"
@@ -73,8 +73,8 @@ var type = "module";
73
73
  var exports = "./dist/cli.js";
74
74
  var license = "MIT";
75
75
  var dependencies = {
76
- "@tauri-apps/api": "^2.8.0",
77
- "@tauri-apps/cli": "^2.8.4",
76
+ "@tauri-apps/api": "^2.9.0",
77
+ "@tauri-apps/cli": "^2.9.0",
78
78
  axios: "^1.12.2",
79
79
  chalk: "^5.6.2",
80
80
  commander: "^12.1.0",
@@ -92,12 +92,12 @@ var dependencies = {
92
92
  };
93
93
  var devDependencies = {
94
94
  "@rollup/plugin-alias": "^5.1.1",
95
- "@rollup/plugin-commonjs": "^28.0.6",
95
+ "@rollup/plugin-commonjs": "^28.0.8",
96
96
  "@rollup/plugin-json": "^6.1.0",
97
97
  "@rollup/plugin-replace": "^6.0.2",
98
98
  "@rollup/plugin-terser": "^0.4.4",
99
99
  "@types/fs-extra": "^11.0.4",
100
- "@types/node": "^20.19.21",
100
+ "@types/node": "^20.19.23",
101
101
  "@types/page-icon": "^0.3.6",
102
102
  "@types/prompts": "^2.4.9",
103
103
  "@types/tmp": "^0.2.6",
@@ -105,7 +105,7 @@ var devDependencies = {
105
105
  "app-root-path": "^3.1.0",
106
106
  "cross-env": "^7.0.3",
107
107
  prettier: "^3.6.2",
108
- rollup: "^4.52.4",
108
+ rollup: "^4.52.5",
109
109
  "rollup-plugin-typescript2": "^0.36.0",
110
110
  tslib: "^2.8.1",
111
111
  typescript: "^5.9.3"
@@ -223,10 +223,11 @@ async function shellExec(command, timeout = 300000, env) {
223
223
  let errorMsg = `Error occurred while executing command "${command}". Exit code: ${exitCode}. Details: ${errorMessage}`;
224
224
  // Provide helpful guidance for common Linux AppImage build failures
225
225
  // caused by strip tool incompatibility with modern glibc (2.38+)
226
+ const lowerError = errorMessage.toLowerCase();
226
227
  if (process.platform === 'linux' &&
227
- (errorMessage.includes('linuxdeploy') ||
228
- errorMessage.includes('appimage') ||
229
- errorMessage.includes('strip'))) {
228
+ (lowerError.includes('linuxdeploy') ||
229
+ lowerError.includes('appimage') ||
230
+ lowerError.includes('strip'))) {
230
231
  errorMsg +=
231
232
  '\n\nโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”\n' +
232
233
  'Linux AppImage Build Failed\n' +
@@ -240,6 +241,15 @@ async function shellExec(command, timeout = 300000, env) {
240
241
  ' โ€ข Update binutils: sudo apt install binutils (or pacman -S binutils)\n' +
241
242
  ' โ€ข Detailed guide: https://github.com/tw93/Pake/blob/main/docs/faq.md\n' +
242
243
  'โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”';
244
+ if (lowerError.includes('fuse') ||
245
+ lowerError.includes('operation not permitted') ||
246
+ lowerError.includes('/dev/fuse')) {
247
+ errorMsg +=
248
+ '\n\nDocker / Container hint:\n' +
249
+ ' AppImage tooling needs access to /dev/fuse. When running inside Docker, add:\n' +
250
+ ' --privileged --device /dev/fuse --security-opt apparmor=unconfined\n' +
251
+ ' or run on the host directly.';
252
+ }
243
253
  }
244
254
  throw new Error(errorMsg);
245
255
  }
@@ -816,10 +826,12 @@ class BaseBuilder {
816
826
  buildSpinner.stop();
817
827
  // Show static message to keep the status visible
818
828
  logger.warn('โœธ Building app...');
819
- const buildEnv = {
820
- ...this.getBuildEnvironment(),
821
- ...(process.env.NO_STRIP && { NO_STRIP: process.env.NO_STRIP }),
829
+ const baseEnv = this.getBuildEnvironment();
830
+ let buildEnv = {
831
+ ...(baseEnv ?? {}),
832
+ ...(process.env.NO_STRIP ? { NO_STRIP: process.env.NO_STRIP } : {}),
822
833
  };
834
+ const resolveExecEnv = () => Object.keys(buildEnv).length > 0 ? buildEnv : undefined;
823
835
  // Warn users about potential AppImage build failures on modern Linux systems.
824
836
  // The linuxdeploy tool bundled in Tauri uses an older strip tool that doesn't
825
837
  // recognize the .relr.dyn section introduced in glibc 2.38+.
@@ -829,7 +841,28 @@ class BaseBuilder {
829
841
  logger.warn('โš  If build fails, retry with: NO_STRIP=1 pake <url> --targets appimage');
830
842
  }
831
843
  }
832
- await shellExec(`cd "${npmDirectory}" && ${this.getBuildCommand(packageManager)}`, this.getBuildTimeout(), buildEnv);
844
+ const buildCommand = `cd "${npmDirectory}" && ${this.getBuildCommand(packageManager)}`;
845
+ const buildTimeout = this.getBuildTimeout();
846
+ try {
847
+ await shellExec(buildCommand, buildTimeout, resolveExecEnv());
848
+ }
849
+ catch (error) {
850
+ const shouldRetryWithoutStrip = process.platform === 'linux' &&
851
+ this.options.targets === 'appimage' &&
852
+ !buildEnv.NO_STRIP &&
853
+ this.isLinuxDeployStripError(error);
854
+ if (shouldRetryWithoutStrip) {
855
+ logger.warn('โš  AppImage build failed during linuxdeploy strip step, retrying with NO_STRIP=1 automatically.');
856
+ buildEnv = {
857
+ ...buildEnv,
858
+ NO_STRIP: '1',
859
+ };
860
+ await shellExec(buildCommand, buildTimeout, resolveExecEnv());
861
+ }
862
+ else {
863
+ throw error;
864
+ }
865
+ }
833
866
  // Copy app
834
867
  const fileName = this.getFileName();
835
868
  const fileType = this.getFileType(target);
@@ -852,6 +885,18 @@ class BaseBuilder {
852
885
  getFileType(target) {
853
886
  return target;
854
887
  }
888
+ isLinuxDeployStripError(error) {
889
+ if (!(error instanceof Error) || !error.message) {
890
+ return false;
891
+ }
892
+ const message = error.message.toLowerCase();
893
+ return (message.includes('linuxdeploy') ||
894
+ message.includes('failed to run linuxdeploy') ||
895
+ message.includes('strip:') ||
896
+ message.includes('unable to recognise the format of the input file') ||
897
+ message.includes('appimage tool failed') ||
898
+ message.includes('strip tool'));
899
+ }
855
900
  /**
856
901
  * ่งฃๆž็›ฎๆ ‡ๆžถๆž„
857
902
  */
@@ -1209,7 +1254,8 @@ class LinuxBuilder extends BaseBuilder {
1209
1254
  // Enable verbose output for AppImage builds when debugging or PAKE_VERBOSE is set.
1210
1255
  // AppImage builds often fail with minimal error messages from linuxdeploy,
1211
1256
  // so verbose mode helps diagnose issues like strip failures and missing dependencies.
1212
- if (this.options.targets === 'appimage' && (this.options.debug || process.env.PAKE_VERBOSE)) {
1257
+ if (this.options.targets === 'appimage' &&
1258
+ (this.options.debug || process.env.PAKE_VERBOSE)) {
1213
1259
  fullCommand += ' --verbose';
1214
1260
  }
1215
1261
  return fullCommand;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pake-cli",
3
- "version": "3.4.1",
3
+ "version": "3.4.3",
4
4
  "description": "๐Ÿคฑ๐Ÿป Turn any webpage into a desktop app with one command. ๐Ÿคฑ๐Ÿป ไธ€้”ฎๆ‰“ๅŒ…็ฝ‘้กต็”Ÿๆˆ่ฝป้‡ๆกŒ้ขๅบ”็”จใ€‚",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -50,8 +50,8 @@
50
50
  "exports": "./dist/cli.js",
51
51
  "license": "MIT",
52
52
  "dependencies": {
53
- "@tauri-apps/api": "^2.8.0",
54
- "@tauri-apps/cli": "^2.8.4",
53
+ "@tauri-apps/api": "^2.9.0",
54
+ "@tauri-apps/cli": "^2.9.0",
55
55
  "axios": "^1.12.2",
56
56
  "chalk": "^5.6.2",
57
57
  "commander": "^12.1.0",
@@ -69,12 +69,12 @@
69
69
  },
70
70
  "devDependencies": {
71
71
  "@rollup/plugin-alias": "^5.1.1",
72
- "@rollup/plugin-commonjs": "^28.0.6",
72
+ "@rollup/plugin-commonjs": "^28.0.8",
73
73
  "@rollup/plugin-json": "^6.1.0",
74
74
  "@rollup/plugin-replace": "^6.0.2",
75
75
  "@rollup/plugin-terser": "^0.4.4",
76
76
  "@types/fs-extra": "^11.0.4",
77
- "@types/node": "^20.19.21",
77
+ "@types/node": "^20.19.23",
78
78
  "@types/page-icon": "^0.3.6",
79
79
  "@types/prompts": "^2.4.9",
80
80
  "@types/tmp": "^0.2.6",
@@ -82,7 +82,7 @@
82
82
  "app-root-path": "^3.1.0",
83
83
  "cross-env": "^7.0.3",
84
84
  "prettier": "^3.6.2",
85
- "rollup": "^4.52.4",
85
+ "rollup": "^4.52.5",
86
86
  "rollup-plugin-typescript2": "^0.36.0",
87
87
  "tslib": "^2.8.1",
88
88
  "typescript": "^5.9.3"