@gtkx/testing 0.10.4 → 0.10.5

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 ADDED
@@ -0,0 +1,103 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/eugeniodepalo/gtkx/main/logo.svg" alt="GTKX" width="80" height="80">
3
+ </p>
4
+
5
+ <h1 align="center">GTKX</h1>
6
+
7
+ <p align="center">
8
+ <strong>Build native GTK4 desktop applications with React and TypeScript.</strong>
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/@gtkx/react"><img src="https://img.shields.io/npm/v/@gtkx/react.svg" alt="npm version"></a>
13
+ <a href="https://github.com/eugeniodepalo/gtkx/actions"><img src="https://img.shields.io/github/actions/workflow/status/eugeniodepalo/gtkx/ci.yml" alt="CI"></a>
14
+ <a href="https://github.com/eugeniodepalo/gtkx/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MPL--2.0-blue.svg" alt="License"></a>
15
+ <a href="https://github.com/eugeniodepalo/gtkx/discussions"><img src="https://img.shields.io/badge/discussions-GitHub-blue" alt="GitHub Discussions"></a>
16
+ </p>
17
+
18
+ ---
19
+
20
+ GTKX lets you write Linux desktop applications using React. Your components render as native GTK4 widgets through a Rust FFI bridge—no webviews, no Electron, just native performance with the developer experience you already know.
21
+
22
+ ## Quick Start
23
+
24
+ ```bash
25
+ npx @gtkx/cli create my-app
26
+ cd my-app
27
+ npm run dev
28
+ ```
29
+
30
+ ## Example
31
+
32
+ ```tsx
33
+ import {
34
+ GtkApplicationWindow,
35
+ GtkBox,
36
+ GtkButton,
37
+ GtkLabel,
38
+ quit,
39
+ render,
40
+ } from "@gtkx/react";
41
+ import * as Gtk from "@gtkx/ffi/gtk";
42
+ import { useState } from "react";
43
+
44
+ const App = () => {
45
+ const [count, setCount] = useState(0);
46
+
47
+ return (
48
+ <GtkApplicationWindow
49
+ title="Counter"
50
+ defaultWidth={300}
51
+ defaultHeight={200}
52
+ onCloseRequest={quit}
53
+ >
54
+ <GtkBox
55
+ orientation={Gtk.Orientation.VERTICAL}
56
+ spacing={20}
57
+ valign={Gtk.Align.CENTER}
58
+ >
59
+ <GtkLabel label={`Count: ${count}`} cssClasses={["title-1"]} />
60
+ <GtkButton label="Increment" onClicked={() => setCount((c) => c + 1)} />
61
+ </GtkBox>
62
+ </GtkApplicationWindow>
63
+ );
64
+ };
65
+
66
+ render(<App />, "com.example.counter");
67
+ ```
68
+
69
+ ## Features
70
+
71
+ - **React 19** — Hooks, concurrent features, and the component model you know
72
+ - **Native GTK4 widgets** — Real native controls, not web components in a webview
73
+ - **Adwaita support** — Modern GNOME styling with Libadwaita components
74
+ - **Hot Module Replacement** — Fast refresh during development
75
+ - **TypeScript first** — Full type safety with auto-generated bindings
76
+ - **CSS-in-JS styling** — Familiar styling patterns adapted for GTK
77
+ - **Testing utilities** — Component testing similar to Testing Library
78
+
79
+ ## Examples
80
+
81
+ Explore complete applications in the [`examples/`](./examples) directory:
82
+
83
+ - **[gtk-demo](./examples/gtk-demo)** — Full replica of the official GTK demo app
84
+ - **[hello-world](./examples/hello-world)** — Minimal application showing a counter
85
+ - **[todo](./examples/todo)** — Full-featured todo application with Adwaita styling and testing
86
+ - **[deploying](./examples/deploying)** — Example of packaging and distributing a GTKX app
87
+
88
+ ## Documentation
89
+
90
+ Visit [https://eugeniodepalo.github.io/gtkx](https://eugeniodepalo.github.io/gtkx/) for the full documentation.
91
+
92
+ ## Contributing
93
+
94
+ Contributions are welcome! Please see the [contributing guidelines](./CONTRIBUTING.md) and check out the [good first issues](https://github.com/eugeniodepalo/gtkx/labels/good%20first%20issue).
95
+
96
+ ## Community
97
+
98
+ - [GitHub Discussions](https://github.com/eugeniodepalo/gtkx/discussions) — Questions, ideas, and general discussion
99
+ - [Issue Tracker](https://github.com/eugeniodepalo/gtkx/issues) — Bug reports and feature requests
100
+
101
+ ## License
102
+
103
+ [MPL-2.0](./LICENSE)
package/dist/render.js CHANGED
@@ -54,7 +54,7 @@ const ensureInitialized = () => {
54
54
  application = start(APP_ID);
55
55
  if (!container) {
56
56
  const instance = reconciler.getInstance();
57
- container = instance.createContainer(application, 0, null, false, null, "", handleError, handleError, () => { }, () => { }, null);
57
+ container = instance.createContainer(application, 1, null, false, null, "", handleError, handleError, () => { }, () => { }, null);
58
58
  }
59
59
  return { app: application, container };
60
60
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gtkx/testing",
3
- "version": "0.10.4",
3
+ "version": "0.10.5",
4
4
  "description": "Testing utilities for GTKX applications",
5
5
  "keywords": [
6
6
  "gtk",
@@ -32,16 +32,17 @@
32
32
  "dist"
33
33
  ],
34
34
  "dependencies": {
35
- "@gtkx/ffi": "0.10.4",
36
- "@gtkx/react": "0.10.4",
37
- "@gtkx/native": "0.10.4"
35
+ "@gtkx/ffi": "0.10.5",
36
+ "@gtkx/native": "0.10.5",
37
+ "@gtkx/react": "0.10.5"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/react-reconciler": "^0.32.3",
41
- "react-reconciler": "^0.33.0"
41
+ "react-reconciler": "^0.33.0",
42
+ "@gtkx/vitest": "0.10.5"
42
43
  },
43
44
  "scripts": {
44
45
  "build": "tsc -b && cp ../../README.md .",
45
- "test": "../../scripts/run-tests.sh"
46
+ "test": "vitest run"
46
47
  }
47
48
  }