Skip to content

Commit 047e22c

Browse files
committed
🔧 Update to the latest stable versions of node and rust
1 parent 003addc commit 047e22c

File tree

9 files changed

+159
-91
lines changed

9 files changed

+159
-91
lines changed

.github/workflows/code-quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Setup Node.js
2929
uses: actions/setup-node@v4
3030
with:
31-
node-version: "20"
31+
node-version: "22"
3232
cache: "pnpm"
3333

3434
- name: Install dependencies

.github/workflows/pake-cli.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
- name: Install node
6868
uses: actions/setup-node@v4
6969
with:
70-
node-version: 18
70+
node-version: 22
7171

7272
- name: Install Rust for ubuntu-24.04
7373
if: inputs.platform == 'ubuntu-24.04'

CLAUDE.md

Lines changed: 103 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -2,145 +2,164 @@
22

33
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
44

5-
## Project Overview
5+
## Philosophy
66

7-
Pake is a tool that turns any webpage into a desktop app with Rust, using Tauri framework. It's much lighter than Electron (~5M vs ~100M+) and provides better performance. The project consists of a CLI tool for packaging web apps and the core Tauri application framework.
7+
- **Incremental progress over big bangs**: Break complex tasks into manageable stages
8+
- **Learn from existing code**: Understand patterns before implementing new features
9+
- **Clear intent over clever code**: Prioritize readability and maintainability
810

9-
## Commands
11+
## Project Overview
1012

11-
### Development
13+
Pake transforms any webpage into a lightweight desktop app using Rust and Tauri. It's significantly lighter than Electron (~5M vs ~100M+) with better performance.
1214

13-
```bash
14-
# Install dependencies
15-
npm i
15+
**Core Architecture:**
1616

17-
# Local development (right-click to open debug mode)
18-
npm run dev
17+
- **CLI Tool** (`bin/`): TypeScript-based command interface
18+
- **Tauri App** (`src-tauri/`): Rust desktop framework
19+
- **Injection System**: Custom CSS/JS injection for webpages
1920

20-
# CLI development with hot reload
21-
npm run cli:dev
21+
## Development Workflow
2222

23-
# Build CLI tools
24-
npm run cli:build
25-
```
23+
### 1. Planning Phase
2624

27-
### Building
25+
Break complex work into 3-5 stages:
2826

29-
```bash
30-
# Production build
31-
npm run build
27+
1. Understand existing patterns in codebase
28+
2. Plan implementation approach
29+
3. Write tests first (when applicable)
30+
4. Implement minimal working solution
31+
5. Refactor and optimize
3232

33-
# Debug build
34-
npm run build:debug
33+
### 2. Implementation Flow
3534

36-
# Mac universal build (Intel + M1)
37-
npm run build:mac
35+
**Understanding First:**
3836

39-
# Generate app configuration
40-
npm run build:config
37+
```bash
38+
# Explore codebase structure
39+
find src-tauri/src -name "*.rs" | head -10
40+
grep -r "window_config" src-tauri/src/
4141
```
4242

43-
### CLI Usage
43+
**Development Commands:**
4444

4545
```bash
46-
# Install CLI globally
47-
npm install -g pake-cli
48-
49-
# Package a webpage
50-
pake https://example.com --name MyApp --width 1200 --height 800
46+
# Install dependencies
47+
npm i
5148

52-
# Also supports names with spaces (cross-platform compatible)
53-
# pake https://translate.google.com --name "Google Translate" --hide-title-bar
49+
# Development with hot reload
50+
npm run dev
5451

55-
# Development with custom options
56-
# Modify DEFAULT_DEV_PAKE_OPTIONS in bin/defaults.ts
52+
# CLI development
5753
npm run cli:dev
54+
55+
# Production build
56+
npm run build
5857
```
5958

60-
### Analysis
59+
### 3. Testing and Validation
60+
61+
**Key Testing Commands:**
6162

6263
```bash
63-
# Analyze binary size
64-
npm run analyze
64+
# Debug build for development
65+
npm run build:debug
66+
67+
# Multi-platform testing
68+
npm run build:mac # macOS universal build
6569
```
6670

67-
## Architecture
71+
**Testing Checklist:**
6872

69-
### Core Components
73+
- [ ] Test on target platforms
74+
- [ ] Verify injection system works
75+
- [ ] Check system tray integration
76+
- [ ] Validate window behavior
7077

71-
1. **CLI Tool** (`bin/`): Node.js/TypeScript-based command-line interface
78+
## Core Components
7279

73-
- `bin/cli.ts` - Main CLI entry point with Commander.js
74-
- `bin/builders/` - Platform-specific builders (Mac, Windows, Linux)
75-
- `bin/options/` - CLI option processing and validation
76-
- `bin/utils/` - Utility functions for URL validation, platform detection
80+
### CLI Tool (`bin/`)
7781

78-
2. **Tauri Application** (`src-tauri/`): Rust-based desktop app framework
82+
- `bin/cli.ts` - Main entry point
83+
- `bin/builders/` - Platform-specific builders
84+
- `bin/options/` - Configuration processing
7985

80-
- `src-tauri/src/lib.rs` - Main application entry point
81-
- `src-tauri/src/app/` - Application modules (config, window, system tray, shortcuts)
82-
- `src-tauri/src/inject/` - JavaScript/CSS injection for web pages
83-
- `src-tauri/pake.json` - Default app configuration
86+
### Tauri Application (`src-tauri/`)
8487

85-
3. **Build System**: Uses Rollup for CLI bundling and Tauri for app packaging
88+
- `src/lib.rs` - Application entry point
89+
- `src/app/` - Core modules (window, tray, shortcuts)
90+
- `src/inject/` - Web page injection logic
8691

87-
### Configuration System
92+
### Key Configuration Files
8893

89-
- **pake.json**: Main configuration file defining window properties, user agents, system tray settings
90-
- **tauri.conf.json**: Tauri-specific configuration
91-
- Platform-specific configs: `tauri.macos.conf.json`, `tauri.windows.conf.json`, `tauri.linux.conf.json`
94+
- `pake.json` - App configuration
95+
- `tauri.conf.json` - Tauri settings
96+
- Platform configs: `tauri.{macos,windows,linux}.conf.json`
9297

93-
### Key Features Implementation
98+
## Problem-Solving Approach
9499

95-
- **Window Management**: `src-tauri/src/app/window.rs` - Window creation, sizing, title bar handling
96-
- **System Tray**: `src-tauri/src/app/setup.rs` - Cross-platform system tray integration
97-
- **Window Close Behavior**: `src-tauri/src/lib.rs` - Configurable close behavior (hide vs exit)
98-
- **Global Shortcuts**: Activation shortcuts for bringing app to foreground
99-
- **Web Integration**: Custom user agents, proxy support, CSS/JS injection
100-
- **Multi-platform**: Builds for macOS (Intel/M1), Windows, Linux (deb/appimage/rpm)
100+
**When stuck:**
101101

102-
## File Injection System
102+
1. **Limit attempts to 3** before stopping to reassess
103+
2. **Document what doesn't work** and why
104+
3. **Research alternative approaches** in similar projects
105+
4. **Question assumptions** - is there a simpler way?
103106

104-
The project supports injecting custom CSS/JS files into webpages:
107+
**Example debugging flow:**
105108

106-
- Files in `src-tauri/src/inject/` contain the injection logic
107-
- Use `--inject` CLI option to specify custom files
108-
- Supports both local and remote injection files
109+
```bash
110+
# 1. Check logs
111+
npm run dev 2>&1 | grep -i error
112+
113+
# 2. Verify dependencies
114+
cargo check --manifest-path=src-tauri/Cargo.toml
115+
116+
# 3. Test minimal reproduction
117+
# Create simple test case isolating the issue
118+
```
109119

110-
## Platform-Specific Notes
120+
## Platform-Specific Development
111121

112122
### macOS
113123

114-
- Supports universal builds (Intel + M1) with `--multi-arch`
115-
- Hide title bar option available with `--hide-title-bar`
124+
- Universal builds: `--multi-arch` flag
116125
- Uses `.icns` icons
126+
- Title bar customization available
117127

118128
### Windows
119129

120-
- Requires specific build tools and redistributables (see bin/README.md)
130+
- Requires Visual Studio Build Tools
121131
- Uses `.ico` icons
122-
- Supports installer language configuration
132+
- MSI installer support
123133

124134
### Linux
125135

126-
- Multiple package formats: deb, appimage, rpm
127-
- Requires specific system dependencies (libwebkit2gtk, etc.)
136+
- Multiple formats: deb, AppImage, rpm
137+
- Requires `libwebkit2gtk` and dependencies
128138
- Uses `.png` icons
129139

130-
## Development Workflow
140+
## Quality Standards
141+
142+
**Code Standards:**
143+
144+
- Prefer composition over inheritance
145+
- Use explicit types over implicit
146+
- Write self-documenting code
147+
- Follow existing patterns consistently
148+
149+
**Commit Guidelines:**
131150

132-
1. **CLI Development**: Modify `bin/defaults.ts` for default options, use `npm run cli:dev` for hot reload
133-
2. **Core App Development**: Work in `src-tauri/src/`, use `npm run dev` for Tauri development
134-
3. **Testing**: Build with `--debug` flag for development tools and verbose logging
135-
4. **Multi-platform**: Test builds on respective platforms or use GitHub Actions
151+
- Commit working code incrementally
152+
- Use clear, descriptive messages
153+
- Never bypass commit hooks
154+
- Test before committing
136155

137-
## Branch Management
156+
## Branch Strategy
138157

139-
- `dev` branch: Active development, feature PRs should target this branch
140-
- `main` branch: Release branch for tags and publishing
158+
- `dev` - Active development, target for PRs
159+
- `main` - Release branch for stable versions
141160

142161
## Prerequisites
143162

144-
- Node.js >=16.0.0
145-
- Rust >=1.78.0 (installed automatically by CLI if missing)
146-
- Platform-specific build tools (see Tauri prerequisites)
163+
- Node.js ≥22.0.0 (recommended LTS, older versions ≥16.0.0 may work)
164+
- Rust ≥1.89.0 (recommended stable, older versions ≥1.78.0 may work)
165+
- Platform build tools (see CONTRIBUTING.md for details)

CONTRIBUTING.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,55 @@ graph LR
1717
- `main` is the release branch, we will make tag and publish version on this branch.
1818
- If it is a document modification, it can be submitted to this branch.
1919

20+
## Development Setup
21+
22+
### Prerequisites
23+
24+
- Node.js ≥22.0.0 (recommended LTS, older versions ≥16.0.0 may work)
25+
- Rust ≥1.89.0 (recommended stable, older versions ≥1.78.0 may work)
26+
- Platform-specific build tools:
27+
- **macOS**: Xcode Command Line Tools (`xcode-select --install`)
28+
- **Windows**: Visual Studio Build Tools with MSVC
29+
- **Linux**: `build-essential`, `libwebkit2gtk`, system dependencies
30+
31+
### Installation
32+
33+
```bash
34+
# Clone the repository
35+
git clone https://github.com/tw93/Pake.git
36+
cd Pake
37+
38+
# Install dependencies
39+
npm install
40+
41+
# Start development
42+
npm run dev
43+
```
44+
45+
## Troubleshooting
46+
47+
### macOS 26 Beta Compilation Issues
48+
49+
If you're running macOS 26 Beta and encounter compilation errors related to `mac-notification-sys` or system frameworks (errors about `CoreFoundation`, `_Builtin_float` modules), create a `src-tauri/.cargo/config.toml` file with:
50+
51+
```toml
52+
[env]
53+
# Fix for macOS 26 Beta compatibility issues
54+
# Forces use of compatible SDK when building on macOS 26 Beta
55+
MACOSX_DEPLOYMENT_TARGET = "15.5"
56+
SDKROOT = "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk"
57+
```
58+
59+
This file is already in `.gitignore` and should not be committed to the repository.
60+
61+
**Root Cause**: macOS 26 Beta uses newer system frameworks that aren't yet supported by the current Xcode SDK (15.5). This configuration forces the build to use the compatible SDK version.
62+
63+
### Common Build Issues
64+
65+
- **Rust compilation errors**: Run `cargo clean` in `src-tauri/` directory
66+
- **Node dependency issues**: Delete `node_modules` and run `npm install`
67+
- **Permission errors on macOS**: Run `sudo xcode-select --reset`
68+
2069
## More
2170

2271
It is a good habit to create a feature request issue to discuss whether the feature is necessary before you implement it. However, it's unnecessary to create an issue to claim that you found a typo or improved the readability of documentation, just create a pull request.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ If you are new to the command line, you can compile packages online with _GitHub
179179

180180
## Development
181181

182-
Prepare your environment before starting. Make sure you have Rust `>=1.63` and Node `>=16` (e.g., `16.18.1`) installed on your computer. For installation guidance, see [Tauri documentation](https://tauri.app/start/prerequisites/).
182+
Prepare your environment before starting. Make sure you have Rust `>=1.89` and Node `>=22` (e.g., `22.11.0`) installed on your computer. *Note: Older versions (Rust ≥1.78, Node ≥16) may also work but latest stable versions are recommended.* For installation guidance, see [Tauri documentation](https://tauri.app/start/prerequisites/).
183183

184184
If you are unfamiliar with these, it is better to try out the above tool to pack with one click.
185185

README_CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ pake https://weekly.tw93.fun --name Weekly --hide-title-bar
178178

179179
## 定制开发
180180

181-
开始前请确保电脑已经安装了 Rust `>=1.63` 和 Node `>=1616.18.1` 的环境,此外需参考 [Tauri 文档](https://tauri.app/start/prerequisites/) 快速配置好环境才可以开始使用,假如你太不懂,使用上面的命令行打包会更加合适。
181+
开始前请确保电脑已经安装了 Rust `>=1.89` 和 Node `>=2222.11.0` 的环境,*注意:较旧的版本(Rust ≥1.78,Node ≥16)也可能可以工作,但推荐使用最新稳定版本。* 此外需参考 [Tauri 文档](https://tauri.app/start/prerequisites/) 快速配置好环境才可以开始使用,假如你太不懂,使用上面的命令行打包会更加合适。
182182

183183
```sh
184184
# 安装依赖

README_JP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ pake https://weekly.tw93.fun --name Weekly --hide-title-bar
178178

179179
## 開発
180180

181-
開始する前に、Rust `>=1.63` と Node `>=16` (例: `16.18.1`) がコンピュータにインストールされていることを確認してください。インストールガイドについては、[Tauri ドキュメント](https://tauri.app/start/prerequisites/)を参照してください。
181+
開始する前に、Rust `>=1.89` と Node `>=22` (例: `22.11.0`) がコンピュータにインストールされていることを確認してください。*注意:古いバージョン(Rust ≥1.78、Node ≥16)でも動作する可能性がありますが、最新の安定版の使用をお勧めします。* インストールガイドについては、[Tauri ドキュメント](https://tauri.app/start/prerequisites/)を参照してください。
182182

183183
これらに不慣れな場合は、上記のツールを使用してワンクリックでパッケージを作成することをお勧めします。
184184

bin/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Installation
44

5-
Ensure that your Node.js version is 18.0 or higher (e.g., 18.20.2). Avoid using `sudo` for the installation. If you encounter permission issues with npm, refer to [How to fix npm throwing error without sudo](https://stackoverflow.com/questions/16151018/how-to-fix-npm-throwing-error-without-sudo).
5+
Ensure that your Node.js version is 22.0 or higher (e.g., 22.11.0). *Note: Older versions ≥16.0.0 may also work.* Avoid using `sudo` for the installation. If you encounter permission issues with npm, refer to [How to fix npm throwing error without sudo](https://stackoverflow.com/questions/16151018/how-to-fix-npm-throwing-error-without-sudo).
66

77
```bash
88
npm install pake-cli -g

bin/README_CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## 安装
44

5-
请确保您的 Node.js 版本为 18 或更高版本(例如 18.7)。请避免使用 `sudo` 进行安装。如果 npm 报告权限问题,请参考 [如何在不使用 sudo 的情况下修复 npm 报错](https://stackoverflow.com/questions/16151018/how-to-fix-npm-throwing-error-without-sudo)
5+
请确保您的 Node.js 版本为 22 或更高版本(例如 22.11.0)。*注意:较旧的版本 ≥16.0.0 也可能可以工作。* 请避免使用 `sudo` 进行安装。如果 npm 报告权限问题,请参考 [如何在不使用 sudo 的情况下修复 npm 报错](https://stackoverflow.com/questions/16151018/how-to-fix-npm-throwing-error-without-sudo)
66

77
```bash
88
npm install pake-cli -g

0 commit comments

Comments
 (0)