plusui-native 0.2.107 → 0.2.109

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.
@@ -1,115 +1,115 @@
1
- # PlusUI Project Justfile
2
- # Cross-platform build automation
3
-
4
- # Use PowerShell on Windows, bash on Unix
5
- set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
6
- set shell := ["bash", "-cu"]
7
-
8
- # Project name (from directory)
9
- project_name := file_stem(justfile_directory())
10
-
11
- # Default recipe
12
- default: dev
13
-
14
- # ============================================================
15
- # DEVELOPMENT
16
- # ============================================================
17
-
18
- # Start development mode (frontend HMR + C++ app)
19
- dev:
20
- npm run dev
21
-
22
- # Start only frontend dev server (Vite with HMR)
23
- dev-frontend:
24
- npm run dev:frontend
25
-
26
- # Start only backend in watch mode
27
- dev-backend:
28
- npm run dev:backend
29
-
30
- # ============================================================
31
- # BUILD
32
- # ============================================================
33
-
34
- # Build for current platform (dev mode, connects to Vite)
35
- build:
36
- npm run build
37
-
38
- # Build frontend only
39
- build-frontend:
40
- npm run build:frontend
41
-
42
- # Build backend only (production mode)
43
- build-backend:
44
- npm run build:backend
45
-
46
- # Build for all platforms
47
- build-all:
48
- npm run build:all
49
-
50
- # ============================================================
51
- # PLATFORM-SPECIFIC BUILDS
52
- # ============================================================
53
-
54
- # Build for Windows
55
- build-windows:
56
- @echo "Building for Windows..."
57
- cmake -S . -B build/Windows -DCMAKE_BUILD_TYPE=Release
58
- cmake --build build/Windows --config Release
59
-
60
- # Build for macOS
61
- build-macos:
62
- @echo "Building for macOS..."
63
- cmake -S . -B build/MacOS -G Xcode -DCMAKE_BUILD_TYPE=Release
64
- cmake --build build/MacOS --config Release
65
-
66
- # Build for Linux
67
- build-linux:
68
- @echo "Building for Linux..."
69
- cmake -S . -B build/Linux -DCMAKE_BUILD_TYPE=Release
70
- cmake --build build/Linux --config Release
71
-
72
- # ============================================================
73
- # RUN
74
- # ============================================================
75
-
76
- # Run the built application
77
- run:
78
- npm run start
79
-
80
- # ============================================================
81
- # UTILITIES
82
- # ============================================================
83
-
84
- # Clean build artifacts
85
- clean:
86
- @echo "Cleaning build artifacts..."
87
- rm -rf build
88
- rm -rf frontend/dist
89
- @echo "Done!"
90
-
91
- # Clean everything including node_modules
92
- clean-all: clean
93
- rm -rf node_modules
94
- rm -rf frontend/node_modules
95
-
96
- # Install dependencies
97
- install:
98
- npm install
99
- cd frontend && npm install
100
-
101
- # Check development environment
102
- doctor:
103
- plusui doctor
104
-
105
- # Fix development environment
106
- doctor-fix:
107
- plusui doctor --fix
108
-
109
- # ============================================================
110
- # HELP
111
- # ============================================================
112
-
113
- # Show available commands
114
- help:
115
- @just --list
1
+ # PlusUI Project Justfile
2
+ # Cross-platform build automation
3
+
4
+ # Use PowerShell on Windows, bash on Unix
5
+ set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
6
+ set shell := ["bash", "-cu"]
7
+
8
+ # Project name (from directory)
9
+ project_name := file_stem(justfile_directory())
10
+
11
+ # Default recipe
12
+ default: dev
13
+
14
+ # ============================================================
15
+ # DEVELOPMENT
16
+ # ============================================================
17
+
18
+ # Start development mode (frontend HMR + C++ app)
19
+ dev:
20
+ npm run dev
21
+
22
+ # Start only frontend dev server (Vite with HMR)
23
+ dev-frontend:
24
+ npm run dev:frontend
25
+
26
+ # Start only backend in watch mode
27
+ dev-backend:
28
+ npm run dev:backend
29
+
30
+ # ============================================================
31
+ # BUILD
32
+ # ============================================================
33
+
34
+ # Build for current platform (dev mode, connects to Vite)
35
+ build:
36
+ npm run build
37
+
38
+ # Build frontend only
39
+ build-frontend:
40
+ npm run build:frontend
41
+
42
+ # Build backend only (production mode)
43
+ build-backend:
44
+ npm run build:backend
45
+
46
+ # Build for all platforms
47
+ build-all:
48
+ npm run build:all
49
+
50
+ # ============================================================
51
+ # PLATFORM-SPECIFIC BUILDS
52
+ # ============================================================
53
+
54
+ # Build for Windows
55
+ build-windows:
56
+ @echo "Building for Windows..."
57
+ cmake -S . -B Build/Windows -DCMAKE_BUILD_TYPE=Release
58
+ cmake --build Build/Windows --config Release
59
+
60
+ # Build for macOS
61
+ build-macos:
62
+ @echo "Building for macOS..."
63
+ cmake -S . -B Build/MacOS -G Xcode -DCMAKE_BUILD_TYPE=Release
64
+ cmake --build Build/MacOS --config Release
65
+
66
+ # Build for Linux
67
+ build-linux:
68
+ @echo "Building for Linux..."
69
+ cmake -S . -B Build/Linux -DCMAKE_BUILD_TYPE=Release
70
+ cmake --build Build/Linux --config Release
71
+
72
+ # ============================================================
73
+ # RUN
74
+ # ============================================================
75
+
76
+ # Run the built application
77
+ run:
78
+ npm run start
79
+
80
+ # ============================================================
81
+ # UTILITIES
82
+ # ============================================================
83
+
84
+ # Clean build artifacts
85
+ clean:
86
+ @echo "Cleaning build artifacts..."
87
+ rm -rf Build
88
+ rm -rf frontend/dist
89
+ @echo "Done!"
90
+
91
+ # Clean everything including node_modules
92
+ clean-all: clean
93
+ rm -rf node_modules
94
+ rm -rf frontend/node_modules
95
+
96
+ # Install dependencies
97
+ install:
98
+ npm install
99
+ cd frontend && npm install
100
+
101
+ # Check development environment
102
+ doctor:
103
+ plusui doctor
104
+
105
+ # Fix development environment
106
+ doctor-fix:
107
+ plusui doctor --fix
108
+
109
+ # ============================================================
110
+ # HELP
111
+ # ============================================================
112
+
113
+ # Show available commands
114
+ help:
115
+ @just --list
@@ -1,185 +1,185 @@
1
- # {{PROJECT_NAME}}
2
-
3
- A desktop application built with the PlusUI framework.
4
-
5
- ## Prerequisites
6
-
7
- Check your development environment:
8
- ```bash
9
- plusui doctor
10
- ```
11
-
12
- If any tools are missing, run:
13
- ```bash
14
- plusui doctor --fix
15
- ```
16
-
17
- ## Development
18
-
19
- Start development server with hot reload:
20
- ```bash
21
- npm run dev
22
- ```
23
-
24
- This will:
25
- - Start the Vite dev server with HMR on http://localhost:5173
26
- - Build and launch the C++ app pointing to the dev server
27
- - Changes to frontend code reflect instantly
28
- - Auto-refresh app bindings when `src/features` exists
29
-
30
- Dev build intermediates are stored in `.plusui/dev/...` so your `build/` folder stays focused on release/platform outputs.
31
-
32
- Note: You can run `npm run connect` manually anytime.
33
-
34
- ## Connection Generation (App-level)
35
-
36
- Generate project connection bindings from real `connect.emit()`/`connect.on()` usage:
37
- ```bash
38
- npm run connect
39
- ```
40
-
41
- Default connect generator paths:
42
- - Input: project root scan (frontend + backend files)
43
- - Output: `Connections/` (at project root)
44
-
45
- Generated structure:
46
- - `Connections/connections.gen.ts` — typed TS channel exports (regenerated)
47
- - `Connections/connections.gen.hpp` — C++ `Connections` struct (regenerated)
48
- - `Connections/connect.manifest.json` — detected channel list (regenerated)
49
-
50
- All three files are always regenerated — do not manually edit them.
51
-
52
- Scan extensions:
53
- - `WEB_IO`: `.ts`, `.tsx`, `.js`, `.jsx`, `.mts`, `.cts`, `.html`
54
- - `CPP_IO`: `.h`, `.hpp`, `.hh`, `.hxx`, `.cpp`, `.cc`, `.cxx`
55
-
56
- `plusui connect` scans your project structure and does not require a schema file.
57
-
58
- You can also pass custom paths:
59
- ```bash
60
- plusui connect <projectRoot> <outputDir>
61
- ```
62
-
63
- ## Assets & Icons
64
-
65
- ### App Icon
66
-
67
- Place your app icon at `assets/icon.png` (512x512+ recommended). Generate platform-specific icons:
68
-
69
- ```bash
70
- plusui icons
71
- ```
72
-
73
- This creates:
74
- - **Windows**: `app.ico` for title bar, taskbar, task manager
75
- - **macOS**: `app.icns` for dock, finder, about dialog
76
- - **Linux**: Multiple PNG sizes for window managers
77
- - **Tray**: Small icons for system tray (all platforms)
78
-
79
- ### Embedded Assets
80
-
81
- All files in `assets/` are embedded into the final executable. Access them in C++:
82
-
83
- ```cpp
84
- #include <plusui/resources.hpp>
85
- std::string data = plusui::resources::getResource("path/to/file.png");
86
- ```
87
-
88
- See `assets/README.md` for details.
89
-
90
- ## Build
91
-
92
- ### Build for current platform
93
- ```bash
94
- npm run build
95
- ```
96
-
97
- Build also auto-refreshes app bindings when `src/features` exists.
98
-
99
- ### Build for all platforms
100
- ```bash
101
- npm run build:all
102
- ```
103
-
104
- This creates platform-specific builds in:
105
- ```
106
- build/
107
- ├── Windows/ # Windows builds
108
- ├── MacOS/ # macOS builds
109
- ├── Linux/ # Linux builds
110
- ├── Android/ # Android builds
111
- └── iOS/ # iOS builds
112
- ```
113
-
114
- ### Platform-specific builds
115
- ```bash
116
- plusui build:windows
117
- plusui build:macos
118
- plusui build:linux
119
- ```
120
-
121
- ## Run
122
-
123
- Run the built application:
124
- ```bash
125
- npm run start
126
- ```
127
-
128
- ## Using Just (Optional)
129
-
130
- If you have [`just`](https://github.com/casey/just) installed:
131
-
132
- ```bash
133
- just dev # Start development mode
134
- just build # Build for current platform
135
- just build-all # Build for all platforms
136
- just run # Run the built application
137
- just clean # Clean build artifacts
138
- just help # Show all commands
139
- ```
140
-
141
- ## Project Structure
142
-
143
- ```
144
- {{PROJECT_NAME}}/
145
- ├── src/ # C++ backend code
146
- │ └── main.cpp # Application entry point
147
- ├── frontend/ # Frontend web code (React + Vite)
148
- │ ├── src/
149
- │ │ ├── main.tsx # React entry point
150
- │ │ ├── App.tsx # Main app component
151
- │ │ └── styles/ # CSS styles
152
- │ ├── index.html
153
- │ └── vite.config.ts
154
- ├── build/ # Build output (generated)
155
- ├── CMakeLists.txt # CMake build configuration
156
- ├── package.json # npm dependencies and scripts
157
- └── Justfile # Build automation (optional)
158
- ```
159
-
160
- ## Calling C++ from TypeScript
161
-
162
- All features and custom channels are available via a single import:
163
-
164
- ```tsx
165
- import plusui from 'plusui';
166
- // or named imports:
167
- import { connect, win, clipboard, app } from 'plusui';
168
-
169
- // Window controls
170
- await win.minimize();
171
- await win.maximize();
172
- await win.close();
173
-
174
- // Get window info
175
- const size = await win.getSize();
176
- console.log(`Window size: ${size.width}x${size.height}`);
177
- ```
178
-
179
- ## Learn More
180
-
181
- - [PlusUI Documentation](https://github.com/yourorg/plusui)
182
- - [React Documentation](https://react.dev/)
183
- - [Vite Documentation](https://vitejs.dev/)
184
-
185
-
1
+ # {{PROJECT_NAME}}
2
+
3
+ A desktop application built with the PlusUI framework.
4
+
5
+ ## Prerequisites
6
+
7
+ Check your development environment:
8
+ ```bash
9
+ plusui doctor
10
+ ```
11
+
12
+ If any tools are missing, run:
13
+ ```bash
14
+ plusui doctor --fix
15
+ ```
16
+
17
+ ## Development
18
+
19
+ Start development server with hot reload:
20
+ ```bash
21
+ npm run dev
22
+ ```
23
+
24
+ This will:
25
+ - Start the Vite dev server with HMR on http://localhost:5173
26
+ - Build and launch the C++ app pointing to the dev server
27
+ - Changes to frontend code reflect instantly
28
+ - Auto-refresh app bindings when `src/features` exists
29
+
30
+ Dev build intermediates are stored in `Build/dev/...` so your `Build/` folder stays focused on release/platform outputs.
31
+
32
+ Note: You can run `npm run connect` manually anytime.
33
+
34
+ ## Connection Generation (App-level)
35
+
36
+ Generate project connection bindings from real `connect.emit()`/`connect.on()` usage:
37
+ ```bash
38
+ npm run connect
39
+ ```
40
+
41
+ Default connect generator paths:
42
+ - Input: project root scan (frontend + backend files)
43
+ - Output: `Connections/` (at project root)
44
+
45
+ Generated structure:
46
+ - `Connections/connections.gen.ts` — typed TS channel exports (regenerated)
47
+ - `Connections/connections.gen.hpp` — C++ `Connections` struct (regenerated)
48
+ - `Connections/connect.manifest.json` — detected channel list (regenerated)
49
+
50
+ All three files are always regenerated — do not manually edit them.
51
+
52
+ Scan extensions:
53
+ - `WEB_IO`: `.ts`, `.tsx`, `.js`, `.jsx`, `.mts`, `.cts`, `.html`
54
+ - `CPP_IO`: `.h`, `.hpp`, `.hh`, `.hxx`, `.cpp`, `.cc`, `.cxx`
55
+
56
+ `plusui connect` scans your project structure and does not require a schema file.
57
+
58
+ You can also pass custom paths:
59
+ ```bash
60
+ plusui connect <projectRoot> <outputDir>
61
+ ```
62
+
63
+ ## Assets & Icons
64
+
65
+ ### App Icon
66
+
67
+ Place your app icon at `assets/icon.png` (512x512+ recommended). Generate platform-specific icons:
68
+
69
+ ```bash
70
+ plusui icons
71
+ ```
72
+
73
+ This creates:
74
+ - **Windows**: `app.ico` for title bar, taskbar, task manager
75
+ - **macOS**: `app.icns` for dock, finder, about dialog
76
+ - **Linux**: Multiple PNG sizes for window managers
77
+ - **Tray**: Small icons for system tray (all platforms)
78
+
79
+ ### Embedded Assets
80
+
81
+ All files in `assets/` are embedded into the final executable. Access them in C++:
82
+
83
+ ```cpp
84
+ #include <plusui/resources.hpp>
85
+ std::string data = plusui::resources::getResource("path/to/file.png");
86
+ ```
87
+
88
+ See `assets/README.md` for details.
89
+
90
+ ## Build
91
+
92
+ ### Build for current platform
93
+ ```bash
94
+ npm run build
95
+ ```
96
+
97
+ Build also auto-refreshes app bindings when `src/features` exists.
98
+
99
+ ### Build for all platforms
100
+ ```bash
101
+ npm run build:all
102
+ ```
103
+
104
+ This creates platform-specific builds in:
105
+ ```
106
+ Build/
107
+ ├── Windows/ # Windows builds
108
+ ├── MacOS/ # macOS builds
109
+ ├── Linux/ # Linux builds
110
+ ├── Android/ # Android builds
111
+ └── iOS/ # iOS builds
112
+ ```
113
+
114
+ ### Platform-specific builds
115
+ ```bash
116
+ plusui build:windows
117
+ plusui build:macos
118
+ plusui build:linux
119
+ ```
120
+
121
+ ## Run
122
+
123
+ Run the built application:
124
+ ```bash
125
+ npm run start
126
+ ```
127
+
128
+ ## Using Just (Optional)
129
+
130
+ If you have [`just`](https://github.com/casey/just) installed:
131
+
132
+ ```bash
133
+ just dev # Start development mode
134
+ just build # Build for current platform
135
+ just build-all # Build for all platforms
136
+ just run # Run the built application
137
+ just clean # Clean build artifacts
138
+ just help # Show all commands
139
+ ```
140
+
141
+ ## Project Structure
142
+
143
+ ```
144
+ {{PROJECT_NAME}}/
145
+ ├── src/ # C++ backend code
146
+ │ └── main.cpp # Application entry point
147
+ ├── frontend/ # Frontend web code (React + Vite)
148
+ │ ├── src/
149
+ │ │ ├── main.tsx # React entry point
150
+ │ │ ├── App.tsx # Main app component
151
+ │ │ └── styles/ # CSS styles
152
+ │ ├── index.html
153
+ │ └── vite.config.ts
154
+ ├── Build/ # Build output (generated)
155
+ ├── CMakeLists.txt # CMake build configuration
156
+ ├── package.json # npm dependencies and scripts
157
+ └── Justfile # Build automation (optional)
158
+ ```
159
+
160
+ ## Calling C++ from TypeScript
161
+
162
+ All features and custom channels are available via a single import:
163
+
164
+ ```tsx
165
+ import plusui from 'plusui';
166
+ // or named imports:
167
+ import { connect, win, clipboard, app } from 'plusui';
168
+
169
+ // Window controls
170
+ await win.minimize();
171
+ await win.maximize();
172
+ await win.close();
173
+
174
+ // Get window info
175
+ const size = await win.getSize();
176
+ console.log(`Window size: ${size.width}x${size.height}`);
177
+ ```
178
+
179
+ ## Learn More
180
+
181
+ - [PlusUI Documentation](https://github.com/yourorg/plusui)
182
+ - [React Documentation](https://react.dev/)
183
+ - [Vite Documentation](https://vitejs.dev/)
184
+
185
+