Skip to content

Commit 3f5ee1e

Browse files
committed
Merge branch 'dev'
2 parents ccdea61 + a8d614e commit 3f5ee1e

File tree

18 files changed

+219
-42
lines changed

18 files changed

+219
-42
lines changed

โ€ŽCLAUDE.mdโ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,14 @@ pnpm run dev # Development with hot reload
5757
- **CLI Tool** (`bin/`): Main entry point, builders, options processing
5858
- **Tauri App** (`src-tauri/`): Rust application, window/tray management, injection logic
5959
- **Config Files**: `pake.json`, `tauri.conf.json`, platform-specific configs
60+
- **Injection System** (`src-tauri/src/inject/event.js`): Custom event handlers, shortcuts, downloads, notifications
6061

6162
## Documentation Guidelines
6263

6364
- **Main README**: Common parameters only
6465
- **CLI Documentation** (`docs/cli-usage.md`): ALL parameters with examples
6566
- **Rare parameters**: Full docs in CLI usage, minimal in main README
67+
- **NO technical documentation files**: Do not create separate technical docs, design docs, or implementation notes - keep technical details in memory/conversation only
6668

6769
## Platform Specifics
6870

โ€Žbin/builders/BaseBuilder.tsโ€Ž

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,12 @@ export default abstract class BaseBuilder {
123123
`cd "${npmDirectory}" && ${packageManager} install${registryOption}${peerDepsOption}`,
124124
timeout,
125125
buildEnv,
126-
this.options.debug,
127126
);
128127
} else {
129128
await shellExec(
130129
`cd "${npmDirectory}" && ${packageManager} install${peerDepsOption}`,
131130
timeout,
132131
buildEnv,
133-
this.options.debug,
134132
);
135133
}
136134
spinner.succeed(chalk.green('Package installed!'));
@@ -169,11 +167,24 @@ export default abstract class BaseBuilder {
169167
...(process.env.NO_STRIP && { NO_STRIP: process.env.NO_STRIP }),
170168
};
171169

170+
// Warn users about potential AppImage build failures on modern Linux systems.
171+
// The linuxdeploy tool bundled in Tauri uses an older strip tool that doesn't
172+
// recognize the .relr.dyn section introduced in glibc 2.38+.
173+
if (process.platform === 'linux' && this.options.targets === 'appimage') {
174+
if (!buildEnv.NO_STRIP) {
175+
logger.warn(
176+
'โš  Building AppImage on Linux may fail due to strip incompatibility with glibc 2.38+',
177+
);
178+
logger.warn(
179+
'โš  If build fails, retry with: NO_STRIP=1 pake <url> --targets appimage',
180+
);
181+
}
182+
}
183+
172184
await shellExec(
173185
`cd "${npmDirectory}" && ${this.getBuildCommand(packageManager)}`,
174186
this.getBuildTimeout(),
175187
buildEnv,
176-
this.options.debug,
177188
);
178189

179190
// Copy app
@@ -280,6 +291,12 @@ export default abstract class BaseBuilder {
280291
fullCommand += ` --target ${target}`;
281292
}
282293

294+
// Enable verbose output in debug mode to help diagnose build issues.
295+
// This provides detailed logs from Tauri CLI and bundler tools.
296+
if (this.options.debug) {
297+
fullCommand += ' --verbose';
298+
}
299+
283300
return fullCommand;
284301
}
285302

โ€Žbin/builders/LinuxBuilder.tsโ€Ž

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ export default class LinuxBuilder extends BaseBuilder {
7878
fullCommand += ` --features ${features.join(',')}`;
7979
}
8080

81+
// Enable verbose output for AppImage builds when debugging or PAKE_VERBOSE is set.
82+
// AppImage builds often fail with minimal error messages from linuxdeploy,
83+
// so verbose mode helps diagnose issues like strip failures and missing dependencies.
84+
if (this.options.targets === 'appimage' && (this.options.debug || process.env.PAKE_VERBOSE)) {
85+
fullCommand += ' --verbose';
86+
}
87+
8188
return fullCommand;
8289
}
8390

โ€Žbin/cli.tsโ€Ž

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ program
9999
.default(DEFAULT.alwaysOnTop)
100100
.hideHelp(),
101101
)
102+
.addOption(
103+
new Option('--maximize', 'Start window maximized')
104+
.default(DEFAULT.maximize)
105+
.hideHelp(),
106+
)
102107
.addOption(
103108
new Option('--dark-mode', 'Force Mac app to use dark mode')
104109
.default(DEFAULT.darkMode)
@@ -164,6 +169,11 @@ program
164169
.default(DEFAULT.multiInstance)
165170
.hideHelp(),
166171
)
172+
.addOption(
173+
new Option('--start-to-tray', 'Start app minimized to tray')
174+
.default(DEFAULT.startToTray)
175+
.hideHelp(),
176+
)
167177
.addOption(
168178
new Option('--installer-language <string>', 'Installer language')
169179
.default(DEFAULT.installerLanguage)

โ€Žbin/defaults.tsโ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export const DEFAULT_PAKE_OPTIONS: PakeCliOptions = {
55
height: 780,
66
width: 1200,
77
fullscreen: false,
8+
maximize: false,
89
resizable: true,
910
hideTitleBar: false,
1011
alwaysOnTop: false,
@@ -28,6 +29,7 @@ export const DEFAULT_PAKE_OPTIONS: PakeCliOptions = {
2829
enableDragDrop: false,
2930
keepBinary: false,
3031
multiInstance: false,
32+
startToTray: false,
3133
};
3234

3335
// Just for cli development

โ€Žbin/helpers/merge.tsโ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export async function mergeConfig(
4949
width,
5050
height,
5151
fullscreen,
52+
maximize,
5253
hideTitleBar,
5354
alwaysOnTop,
5455
appVersion,
@@ -71,6 +72,7 @@ export async function mergeConfig(
7172
wasm,
7273
enableDragDrop,
7374
multiInstance,
75+
startToTray,
7476
} = options;
7577

7678
const { platform } = process;
@@ -81,6 +83,7 @@ export async function mergeConfig(
8183
width,
8284
height,
8385
fullscreen,
86+
maximize,
8487
resizable,
8588
hide_title_bar: hideTitleBar,
8689
activation_shortcut: activationShortcut,
@@ -92,6 +95,7 @@ export async function mergeConfig(
9295
title: title || null,
9396
enable_wasm: wasm,
9497
enable_drag_drop: enableDragDrop,
98+
start_to_tray: startToTray && showSystemTray,
9599
};
96100
Object.assign(tauriConf.pake.windows[0], { url, ...tauriConfWindowOptions });
97101

โ€Žbin/helpers/rust.tsโ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ export async function installRust() {
8383
IS_WIN ? rustInstallScriptForWindows : rustInstallScriptForMac,
8484
300000,
8585
undefined,
86-
true,
8786
);
8887
spinner.succeed(chalk.green('โœ” Rust installed successfully!'));
8988
ensureRustEnv();

โ€Žbin/types.tsโ€Ž

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ export interface PakeCliOptions {
2424
// Whether the window can be fullscreen, default false
2525
fullscreen: boolean;
2626

27+
// Start window maximized, default false
28+
maximize: boolean;
29+
2730
// Enable immersive header, default false.
2831
hideTitleBar: boolean;
2932

@@ -90,6 +93,9 @@ export interface PakeCliOptions {
9093

9194
// Allow multiple instances, default false (single instance)
9295
multiInstance: boolean;
96+
97+
// Start app minimized to tray, default false
98+
startToTray: boolean;
9399
}
94100

95101
export interface PakeAppOptions extends PakeCliOptions {

โ€Žbin/utils/shell.tsโ€Ž

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ export async function shellExec(
55
command: string,
66
timeout: number = 300000,
77
env?: Record<string, string>,
8-
showOutput: boolean = false,
98
) {
109
try {
1110
const { exitCode } = await execa(command, {
1211
cwd: npmDirectory,
13-
stdio: showOutput ? 'inherit' : ['inherit', 'pipe', 'inherit'],
12+
// Use 'inherit' to show all output directly to user in real-time.
13+
// This ensures linuxdeploy and other tool outputs are visible during builds.
14+
stdio: 'inherit',
1415
shell: true,
1516
timeout,
1617
env: env ? { ...process.env, ...env } : process.env,
@@ -28,17 +29,27 @@ export async function shellExec(
2829

2930
let errorMsg = `Error occurred while executing command "${command}". Exit code: ${exitCode}. Details: ${errorMessage}`;
3031

32+
// Provide helpful guidance for common Linux AppImage build failures
33+
// caused by strip tool incompatibility with modern glibc (2.38+)
3134
if (
3235
process.platform === 'linux' &&
3336
(errorMessage.includes('linuxdeploy') ||
3437
errorMessage.includes('appimage') ||
3538
errorMessage.includes('strip'))
3639
) {
3740
errorMsg +=
38-
'\n\nLinux AppImage build error. Try one of these solutions:\n' +
39-
' 1. Run with: NO_STRIP=true pake <url> --targets appimage\n' +
40-
' 2. Use DEB format instead: pake <url> --targets deb\n' +
41-
' 3. See detailed solutions: https://github.com/tw93/Pake/blob/main/docs/faq.md';
41+
'\n\nโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”\n' +
42+
'Linux AppImage Build Failed\n' +
43+
'โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”\n\n' +
44+
'Cause: Strip tool incompatibility with glibc 2.38+\n' +
45+
' (affects Debian Trixie, Arch Linux, and other modern distros)\n\n' +
46+
'Quick fix:\n' +
47+
' NO_STRIP=1 pake <url> --targets appimage --debug\n\n' +
48+
'Alternatives:\n' +
49+
' โ€ข Use DEB format: pake <url> --targets deb\n' +
50+
' โ€ข Update binutils: sudo apt install binutils (or pacman -S binutils)\n' +
51+
' โ€ข Detailed guide: https://github.com/tw93/Pake/blob/main/docs/faq.md\n' +
52+
'โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”';
4253
}
4354

4455
throw new Error(errorMsg);

0 commit comments

Comments
ย (0)