quickwin 1.1.2 → 1.1.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.en.md CHANGED
@@ -1,33 +1,37 @@
1
- > [中文文档](README.md) · **English**
1
+ > [中文文档](README.md) · **English**
2
2
 
3
3
  # QuickWin
4
4
 
5
5
  QuickJS runtime for Windows, with native GUI, networking, WASM, FFI and more.
6
6
 
7
- Goal: compatibility with Windows XP+ (32/64-bit) and a minimal binary size.
8
-
9
- Currently: supports Windows 7+ (64-bit), ~1.5MB binary.
7
+ Supports Windows XP+ (32/64-bit) with a minimal binary size (~1.5MB). The 32-bit build is CI-tested in a QEMU Windows XP VM.
10
8
 
11
9
  Early-stage project with known bugs.
12
10
 
13
- Download directly from the GitHub Release:
11
+ Install:
12
+
13
+ ```bash
14
+ # Option 1: npm local install (recommended)
15
+ npm install quickwin
16
+ npx quickwin script.js
14
17
 
15
- ```powershell
18
+ # Option 2: download directly from GitHub Release
16
19
  iwr https://github.com/xna00/quickwin/releases/latest/download/qwin.exe -OutFile qwin.exe
17
- iwr https://github.com/xna00/quickwin/releases/latest/download/main.js -OutFile main.js
18
20
  .\qwin.exe main.js
19
21
  ```
20
22
 
23
+ The npm package ships 4 executables: `qwin.exe` (64-bit) / `qwin-x86.exe` (32-bit, XP-compatible) plus their no-WASM variants `qwin-nowasm.exe` / `qwin-nowasm-x86.exe`.
24
+
21
25
  ## Features
22
26
 
23
- - **Win32 GUI** — native windows, buttons, edit boxes, list boxes, tray icons, popup menus
24
- - **React renderer** — declarative GUI in JSX with `useState`/`useEffect`, diff updates ([react-qw](lib/react-qw/))
25
- - **HTTP/HTTPS** — `fetch()` API, Brotli decompression, chunked transfer, conditional caching
26
- - **WebSocket** — full RFC 6455 implementation, ws:// + wss://
27
- - **WebAssembly** — WAMR-based, supports `WebAssembly.*` standard API
28
- - **FFI** — call any DLL function via libffi
29
- - **Polyfills** — `TextEncoder`, `URL`, `URLSearchParams`, `btoa`/`atob`, `crypto.subtle`, `setTimeout`
30
- - **Dynamic import** — `import('https://esm.sh/...')`, no dependency installation needed
27
+ - **Win32 GUI** — native windows, buttons, edit boxes, list boxes, tray icons, popup menus
28
+ - **React renderer** — declarative GUI in JSX with `useState`/`useEffect`, diff updates ([react-qw](lib/react-qw/))
29
+ - **HTTP/HTTPS** — `fetch()` API, Brotli decompression, chunked transfer, conditional caching
30
+ - **WebSocket** — full RFC 6455 implementation, ws:// + wss://
31
+ - **WebAssembly** — WAMR-based, supports `WebAssembly.*` standard API
32
+ - **FFI** — call any DLL function via libffi
33
+ - **Polyfills** — `TextEncoder`, `URL`, `URLSearchParams`, `btoa`/`atob`, `crypto.subtle`, `setTimeout`
34
+ - **Dynamic import** — `import('https://esm.sh/...')`, no dependency installation needed
31
35
 
32
36
  ## CLI
33
37
 
@@ -50,12 +54,12 @@ quickwin -- script.js --flag # -- stops option parsing
50
54
  | `-d` | Enable HTTP debug logging |
51
55
  | `--` | Stop option parsing, remaining args passed to script |
52
56
 
53
- All unknown flags are transparently forwarded to `scriptArgs` — no error,
57
+ All unknown flags are transparently forwarded to `scriptArgs` — no error,
54
58
  no consumption. Script file is the first non-flag argument after option parsing.
55
59
 
56
60
  ## Embedded Script
57
61
 
58
- You can embed a JS script directly into the `qwin.exe` binary — no recompilation needed.
62
+ You can embed a JS script directly into the `qwin.exe` binary — no recompilation needed.
59
63
 
60
64
  ### Format (appended to exe)
61
65
 
@@ -97,7 +101,7 @@ When run without a script file argument, `qwin.exe` checks for embedded JS at th
97
101
  | `fetch` | `import './lib/fetch.js'` | adds `fetch()`, `Response`, `Headers` to globalThis |
98
102
  | `websocket` | `import './lib/websocket.js'` | adds `WebSocket` to globalThis |
99
103
  | `polyfill` | `import './lib/polyfill.js'` | adds `TextEncoder`, `URL`, `btoa`/`atob`, `setTimeout` to globalThis |
100
- | `preact` | `lib/preact/...` | JSX → Win32 renderer (`render`, `useState`, `useEffect`) |
104
+ | `preact` | `lib/preact/...` | JSX → Win32 renderer (`render`, `useState`, `useEffect`) |
101
105
  | `react-qw` | `lib/react-qw/` | React Custom Renderer for Win32 GUI ([docs](lib/react-qw/)) |
102
106
 
103
107
  ## Worker
@@ -152,9 +156,9 @@ Both sides must set `onmessage = null` when communication is complete. This rele
152
156
  ## Examples
153
157
 
154
158
  ```bash
155
- .\qwin.exe examples/preact_demo.js # counter GUI with JSX + hooks
156
159
  .\qwin.exe examples/tray_demo.js # system tray app
157
- .\qwin.exe examples/pdf_preview.js # PDF reader with mupdf
160
+ .\qwin.exe examples/pdf_preview2.js # PDF reader with mupdf
161
+ .\qwin.exe examples/test_tab.js # tabbed GUI with JSX
158
162
  ```
159
163
 
160
164
  ## Build from Source
@@ -168,11 +172,11 @@ Both sides must set `onmessage = null` when communication is complete. This rele
168
172
  ### Build
169
173
 
170
174
  ```bash
171
- git clone --recursive https://github.com/anomalyco/quickwin.git
175
+ git clone --recursive https://github.com/xna00/quickwin.git
172
176
  cd quickwin
173
177
 
174
178
  .\run.ps1 "make wamr" # build WAMR library (first time only)
175
- .\run.ps1 "make minimal" # build qwin.exe (-Os + LTO + UPX)
179
+ .\run.ps1 "make small" # build qwin.exe (-Os + LTO, ~1.5MB)
176
180
  .\run.ps1 "make js" # compile TypeScript
177
181
  .\run.ps1 "make test" # run all tests
178
182
  ```
@@ -185,12 +189,15 @@ cd quickwin
185
189
  | Target | Description |
186
190
  |--------|-------------|
187
191
  | `make` / `make nodebug` | fast build |
188
- | `make minimal` | `-Os` + LTO + `-mwindows` + UPX, no console, add `-o CON` for console |
189
- | `make nowasm` | no WASM/WAMR build → `_build/qwin-nowasm.exe` (~1.2MB, no `WebAssembly` global) |
190
- | `make release` | `-O2` + LTO + strip, ~1.5MB |
192
+ | `make small` | `-Os` + LTO + strip, ~1.5MB (recommended) |
193
+ | `make minimal` | `small` + UPX compression |
194
+ | `make release` | `-O2` + LTO + strip (not `-Os` optimized) |
191
195
  | `make debug` | debug build with bridge logs |
196
+ | `make nowasm` | no WASM/WAMR build → `_build/qwin-nowasm.exe` (~1.2MB, no `WebAssembly` global) |
197
+ | `make cc64-small` | cross-compile x86_64 `_build/qwin.exe` (`-Os`, used by CI) |
198
+ | `make cc32-small` | cross-compile i686 `_build/qwin-x86.exe` (`-Os`, XP-compatible, used by CI) |
192
199
  | `make js` | compile TypeScript via tsc |
193
- | `make wasm` | compile WAT → WASM fixtures |
200
+ | `make wasm` | compile WAT → WASM fixtures |
194
201
  | `make test` | run all tests |
195
202
  | `make test TEST=-net` | skip network tests (fast) |
196
203
  | `make test TEST=wasm` | run WASM tests only |
package/README.md CHANGED
@@ -4,20 +4,24 @@
4
4
 
5
5
  Windows 平台上的 QuickJS 运行时,支持原生 GUI、网络、WASM、FFI 等能力。
6
6
 
7
- 目标:兼容 Windows XP+(32/64 位),保持最小二进制体积。
8
-
9
- 现状:当前支持 Windows 7+(64 位),体积约 1.5MB。
7
+ 支持 Windows XP+(32/64 位),保持最小二进制体积(约 1.5MB)。32 位构建已在 QEMU Windows XP 虚拟机中通过 CI 测试。
10
8
 
11
9
  项目处于早期,功能待完善,包含已知 bug。
12
10
 
13
- 直接从 GitHub Release 下载运行:
11
+ 安装方式:
12
+
13
+ ```bash
14
+ # 方式一:npm 本地安装(推荐)
15
+ npm install quickwin
16
+ npx quickwin script.js
14
17
 
15
- ```powershell
18
+ # 方式二:直接从 GitHub Release 下载
16
19
  iwr https://github.com/xna00/quickwin/releases/latest/download/qwin.exe -OutFile qwin.exe
17
- iwr https://github.com/xna00/quickwin/releases/latest/download/main.js -OutFile main.js
18
20
  .\qwin.exe main.js
19
21
  ```
20
22
 
23
+ npm 包自带 4 个可执行文件:`qwin.exe`(64 位)/ `qwin-x86.exe`(32 位,兼容 XP)及其无 WASM 版本 `qwin-nowasm.exe` / `qwin-nowasm-x86.exe`。
24
+
21
25
  ## 特性
22
26
 
23
27
  - **Win32 原生 GUI** —— 原生窗口、按钮、编辑框、列表框、托盘图标、弹出菜单
@@ -151,9 +155,9 @@ parent.onmessage = (e) => {
151
155
  ## 示例
152
156
 
153
157
  ```bash
154
- .\qwin.exe examples/preact_demo.js # JSX + hooks 的计数器 GUI
155
158
  .\qwin.exe examples/tray_demo.js # 系统托盘应用
156
- .\qwin.exe examples/pdf_preview.js # 基于 mupdf 的 PDF 阅读器
159
+ .\qwin.exe examples/pdf_preview2.js # 基于 mupdf 的 PDF 阅读器
160
+ .\qwin.exe examples/test_tab.js # 基于 JSX 的标签页 GUI
157
161
  ```
158
162
 
159
163
  ## 从源码构建
@@ -167,11 +171,11 @@ parent.onmessage = (e) => {
167
171
  ### 构建
168
172
 
169
173
  ```bash
170
- git clone --recursive https://github.com/anomalyco/quickwin.git
174
+ git clone --recursive https://github.com/xna00/quickwin.git
171
175
  cd quickwin
172
176
 
173
177
  .\run.ps1 "make wamr" # 构建 WAMR 库(仅首次)
174
- .\run.ps1 "make minimal" # 构建 qwin.exe(-Os + LTO + UPX)
178
+ .\run.ps1 "make small" # 构建 qwin.exe(-Os + LTO,约 1.5MB)
175
179
  .\run.ps1 "make js" # 编译 TypeScript
176
180
  .\run.ps1 "make test" # 运行全部测试
177
181
  ```
@@ -184,10 +188,13 @@ cd quickwin
184
188
  | Target | Description |
185
189
  |--------|-------------|
186
190
  | `make` / `make nodebug` | 快速构建 |
187
- | `make minimal` | `-Os` + LTO + `-mwindows` + UPX,无控制台,需要控制台时加 `-o CON` |
188
- | `make nowasm` | 无 WASM/WAMR 构建 → `_build/qwin-nowasm.exe`(约 1.2MB,无 `WebAssembly` 全局) |
189
- | `make release` | `-O2` + LTO + strip,约 1.5MB |
191
+ | `make small` | `-Os` + LTO + strip,约 1.5MB(推荐) |
192
+ | `make minimal` | `small` + UPX 压缩 |
193
+ | `make release` | `-O2` + LTO + strip(未做 `-Os` 优化) |
190
194
  | `make debug` | 带 bridge 日志的调试构建 |
195
+ | `make nowasm` | 无 WASM/WAMR 构建 → `_build/qwin-nowasm.exe`(约 1.2MB,无 `WebAssembly` 全局) |
196
+ | `make cc64-small` | 交叉编译 x86_64 `_build/qwin.exe`(`-Os`,CI 用) |
197
+ | `make cc32-small` | 交叉编译 i686 `_build/qwin-x86.exe`(`-Os`,兼容 XP,CI 用) |
191
198
  | `make js` | 通过 tsc 编译 TypeScript |
192
199
  | `make wasm` | 编译 WAT → WASM fixtures |
193
200
  | `make test` | 运行全部测试 |
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "quickwin",
4
- "version": "1.1.2",
4
+ "version": "1.1.3",
5
5
  "description": "QuickJS Win32 runtime — GUI, networking, WASM, FFI, and more",
6
6
  "bin": {
7
7
  "quickwin": "qwin.exe",
Binary file
package/qwin-nowasm.exe CHANGED
Binary file
package/qwin-x86.exe CHANGED
Binary file
package/qwin.exe CHANGED
Binary file