@gjsify/create-app 0.51.0 → 0.52.0

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.
@@ -17,21 +17,21 @@
17
17
  "dev": "gjsify dev --runtime gjs"
18
18
  },
19
19
  "devDependencies": {
20
- "@girs/adw-1": "5.0.0",
21
- "@girs/gio-2.0": "5.0.0",
22
- "@girs/gjs": "5.0.0",
23
- "@girs/gobject-2.0": "5.0.0",
24
- "@girs/gtk-4.0": "5.0.0",
25
- "@gjsify/cli": "^0.51.0",
26
- "@gjsify/dom-elements": "^0.51.0",
27
- "@gjsify/rolldown-native": "^0.51.0",
28
- "@gjsify/vite-plugin-blueprint": "^0.51.0",
20
+ "@girs/adw-1": "5.4.0",
21
+ "@girs/gio-2.0": "5.4.0",
22
+ "@girs/gjs": "5.4.0",
23
+ "@girs/gobject-2.0": "5.4.0",
24
+ "@girs/gtk-4.0": "5.4.0",
25
+ "@gjsify/cli": "^0.52.0",
26
+ "@gjsify/dom-elements": "^0.52.0",
27
+ "@gjsify/rolldown-native": "^0.52.0",
28
+ "@gjsify/vite-plugin-blueprint": "^0.52.0",
29
29
  "@types/node": "^25.9.2",
30
30
  "typescript": "^6.0.3"
31
31
  },
32
32
  "dependencies": {
33
- "@gjsify/canvas2d": "^0.51.0",
34
- "@gjsify/node-gi": "^0.51.0"
33
+ "@gjsify/canvas2d": "^0.52.0",
34
+ "@gjsify/node-gi": "^0.52.0"
35
35
  },
36
36
  "gjsify": {
37
37
  "main": "dist/index.gjs.js",
@@ -17,24 +17,24 @@
17
17
  "dev": "gjsify dev --runtime gjs"
18
18
  },
19
19
  "devDependencies": {
20
- "@girs/adw-1": "5.0.0",
21
- "@girs/gio-2.0": "5.0.0",
22
- "@girs/gjs": "5.0.0",
23
- "@girs/gobject-2.0": "5.0.0",
24
- "@girs/gtk-4.0": "5.0.0",
25
- "@gjsify/canvas2d": "^0.51.0",
26
- "@gjsify/cli": "^0.51.0",
27
- "@gjsify/dom-elements": "^0.51.0",
28
- "@gjsify/dom-events": "^0.51.0",
29
- "@gjsify/fetch": "^0.51.0",
30
- "@gjsify/rolldown-native": "^0.51.0",
31
- "@gjsify/vite-plugin-blueprint": "^0.51.0",
20
+ "@girs/adw-1": "5.4.0",
21
+ "@girs/gio-2.0": "5.4.0",
22
+ "@girs/gjs": "5.4.0",
23
+ "@girs/gobject-2.0": "5.4.0",
24
+ "@girs/gtk-4.0": "5.4.0",
25
+ "@gjsify/canvas2d": "^0.52.0",
26
+ "@gjsify/cli": "^0.52.0",
27
+ "@gjsify/dom-elements": "^0.52.0",
28
+ "@gjsify/dom-events": "^0.52.0",
29
+ "@gjsify/fetch": "^0.52.0",
30
+ "@gjsify/rolldown-native": "^0.52.0",
31
+ "@gjsify/vite-plugin-blueprint": "^0.52.0",
32
32
  "@types/node": "^25.9.2",
33
33
  "typescript": "^6.0.3"
34
34
  },
35
35
  "dependencies": {
36
- "@gjsify/node-gi": "^0.51.0",
37
- "@gjsify/webgl": "^0.51.0",
36
+ "@gjsify/node-gi": "^0.52.0",
37
+ "@gjsify/webgl": "^0.52.0",
38
38
  "excalibur": "0.32.0"
39
39
  },
40
40
  "gjsify": {
@@ -17,22 +17,22 @@
17
17
  "dev": "gjsify dev --runtime gjs"
18
18
  },
19
19
  "devDependencies": {
20
- "@girs/adw-1": "5.0.0",
21
- "@girs/gio-2.0": "5.0.0",
22
- "@girs/gjs": "5.0.0",
23
- "@girs/gobject-2.0": "5.0.0",
24
- "@girs/gtk-4.0": "5.0.0",
25
- "@gjsify/cli": "^0.51.0",
26
- "@gjsify/dom-elements": "^0.51.0",
27
- "@gjsify/rolldown-native": "^0.51.0",
28
- "@gjsify/vite-plugin-blueprint": "^0.51.0",
20
+ "@girs/adw-1": "5.4.0",
21
+ "@girs/gio-2.0": "5.4.0",
22
+ "@girs/gjs": "5.4.0",
23
+ "@girs/gobject-2.0": "5.4.0",
24
+ "@girs/gtk-4.0": "5.4.0",
25
+ "@gjsify/cli": "^0.52.0",
26
+ "@gjsify/dom-elements": "^0.52.0",
27
+ "@gjsify/rolldown-native": "^0.52.0",
28
+ "@gjsify/vite-plugin-blueprint": "^0.52.0",
29
29
  "@types/node": "^25.9.2",
30
30
  "@types/three": "^0.185.0",
31
31
  "typescript": "^6.0.3"
32
32
  },
33
33
  "dependencies": {
34
- "@gjsify/node-gi": "^0.51.0",
35
- "@gjsify/webgl": "^0.51.0",
34
+ "@gjsify/node-gi": "^0.52.0",
35
+ "@gjsify/webgl": "^0.52.0",
36
36
  "three": "0.185.1"
37
37
  },
38
38
  "gjsify": {
@@ -17,10 +17,10 @@
17
17
  "dev": "gjsify dev --runtime gjs"
18
18
  },
19
19
  "devDependencies": {
20
- "@gjsify/cli": "^0.51.0",
21
- "@gjsify/node-globals": "^0.51.0",
22
- "@gjsify/rolldown-native": "^0.51.0",
23
- "@gjsify/runtime": "^0.51.0",
20
+ "@gjsify/cli": "^0.52.0",
21
+ "@gjsify/node-globals": "^0.52.0",
22
+ "@gjsify/rolldown-native": "^0.52.0",
23
+ "@gjsify/runtime": "^0.52.0",
24
24
  "@types/node": "^25.9.2",
25
25
  "@types/yargs": "^17.0.35",
26
26
  "typescript": "^6.0.3"
@@ -1,6 +1,20 @@
1
1
  # new-gjsify-app
2
2
 
3
- A minimal GTK 4 app — `Gtk.Window` + `Gtk.Label`, no Adwaita, no Blueprint — scaffolded from the gjsify `gtk-minimal` template.
3
+ A minimal GTK 4 app — `Gtk.ApplicationWindow` + `Gtk.Label`, no Adwaita — scaffolded from the
4
+ gjsify `gtk-minimal` template.
5
+
6
+ The window is declared in `src/main-window.blp` and `src/main-window.ts` holds only logic.
7
+ That split is not decoration: a caption assigned from TypeScript cannot be marked
8
+ `translatable`, so `xgettext` never sees it and the interface is untranslatable by
9
+ construction.
10
+
11
+ Blueprint needs **no system tool**. `@gjsify/vite-plugin-blueprint` parses the `.blp` and emits
12
+ GtkBuilder XML in process, so `npm run build` asks nothing of your machine beyond GTK 4 itself,
13
+ on any of Linux, macOS and Windows. The compiled interface is inlined into `dist/`, so the built
14
+ app carries it too. The three `adw-*` templates work the same way.
15
+
16
+ The parser holds a subset of the language, and a construct outside it fails the build naming the
17
+ construct, the file and the line rather than emitting something plausible and wrong.
4
18
 
5
19
  ## Install
6
20
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "new-gjsify-app",
3
- "description": "Minimal GTK4 app — Gtk.Window + Gtk.Label (no Adwaita, no Blueprint).",
3
+ "description": "Minimal GTK4 app — Gtk.ApplicationWindow + Gtk.Label, no Adwaita (Blueprint UI).",
4
4
  "version": "0.1.0",
5
5
  "type": "module",
6
6
  "private": true,
@@ -17,16 +17,18 @@
17
17
  "dev": "gjsify dev --runtime gjs"
18
18
  },
19
19
  "devDependencies": {
20
- "@gjsify/cli": "^0.51.0",
21
- "@gjsify/rolldown-native": "^0.51.0",
20
+ "@gjsify/cli": "^0.52.0",
21
+ "@gjsify/rolldown-native": "^0.52.0",
22
+ "@gjsify/vite-plugin-blueprint": "^0.52.0",
22
23
  "@types/node": "^25.9.2",
23
24
  "typescript": "^6.0.3"
24
25
  },
25
26
  "dependencies": {
26
- "@girs/gio-2.0": "5.0.0",
27
- "@girs/glib-2.0": "5.0.0",
28
- "@girs/gtk-4.0": "5.0.0",
29
- "@gjsify/node-gi": "^0.51.0"
27
+ "@girs/gio-2.0": "5.4.0",
28
+ "@girs/glib-2.0": "5.4.0",
29
+ "@girs/gobject-2.0": "5.4.0",
30
+ "@girs/gtk-4.0": "5.4.0",
31
+ "@gjsify/node-gi": "^0.52.0"
30
32
  },
31
33
  "gjsify": {
32
34
  "main": "dist/index.gjs.js",
@@ -1,5 +1,6 @@
1
1
  import Gtk from 'gi://Gtk?version=4.0';
2
2
  import Gio from 'gi://Gio?version=2.0';
3
+ import { MainWindow } from './main-window.js';
3
4
 
4
5
  const app = new Gtk.Application({
5
6
  applicationId: 'org.gjsify.example',
@@ -7,34 +8,7 @@ const app = new Gtk.Application({
7
8
  });
8
9
 
9
10
  app.connect('activate', () => {
10
- const window = new Gtk.ApplicationWindow({
11
- application: app,
12
- title: 'new-gjsify-app',
13
- defaultWidth: 480,
14
- defaultHeight: 280,
15
- });
16
-
17
- const box = new Gtk.Box({
18
- orientation: Gtk.Orientation.VERTICAL,
19
- spacing: 12,
20
- marginTop: 24,
21
- marginBottom: 24,
22
- marginStart: 24,
23
- marginEnd: 24,
24
- });
25
-
26
- const title = new Gtk.Label({ label: 'Hello from gjsify!' });
27
- title.add_css_class('title-2');
28
-
29
- const hint = new Gtk.Label({
30
- label: `Running on ${process.platform} · PID ${process.pid}`,
31
- xalign: 0.5,
32
- });
33
-
34
- box.append(title);
35
- box.append(hint);
36
- window.set_child(box);
37
- window.present();
11
+ new MainWindow(app).present();
38
12
  });
39
13
 
40
14
  app.run([]);
@@ -0,0 +1,33 @@
1
+ using Gtk 4.0;
2
+
3
+ template $MainWindow: Gtk.ApplicationWindow {
4
+ title: "new-gjsify-app";
5
+ default-width: 480;
6
+ default-height: 280;
7
+
8
+ child: Gtk.Box {
9
+ orientation: vertical;
10
+ spacing: 12;
11
+ margin-top: 24;
12
+ margin-bottom: 24;
13
+ margin-start: 24;
14
+ margin-end: 24;
15
+
16
+ Gtk.Label {
17
+ // `_()` is what makes this reachable for xgettext. The same words assigned from
18
+ // TypeScript could not be marked translatable at all — that is the whole reason the
19
+ // tree lives here and not in the callback that used to build it.
20
+ label: _("Hello from gjsify!");
21
+
22
+ styles [
23
+ "title-2",
24
+ ]
25
+ }
26
+
27
+ // Named, and left empty: the platform and PID are runtime FACTS, so TypeScript fills
28
+ // them in. Declaring the container here and populating it there is the intended split.
29
+ Gtk.Label hint {
30
+ xalign: 0.5;
31
+ }
32
+ };
33
+ }
@@ -0,0 +1,32 @@
1
+ import GObject from 'gi://GObject?version=2.0';
2
+ import Gtk from 'gi://Gtk?version=4.0';
3
+ import Template from './main-window.blp';
4
+
5
+ /**
6
+ * The application window.
7
+ *
8
+ * Its whole widget tree is declared in `main-window.blp` rather than built here. That is what
9
+ * makes the caption translatable — a string assigned from TypeScript is invisible to `xgettext`,
10
+ * so an interface assembled in code is untranslatABLE while merely looking untranslated.
11
+ */
12
+ export class MainWindow extends Gtk.ApplicationWindow {
13
+ declare private _hint: Gtk.Label;
14
+
15
+ static {
16
+ GObject.registerClass(
17
+ {
18
+ GTypeName: 'MainWindow',
19
+ Template,
20
+ InternalChildren: ['hint'],
21
+ },
22
+ this,
23
+ );
24
+ }
25
+
26
+ constructor(application: Gtk.Application) {
27
+ super({ application });
28
+
29
+ // Runtime facts only. Prose belongs in the template, where extraction can see it.
30
+ this._hint.set_label(`${process.platform} · PID ${process.pid}`);
31
+ }
32
+ }
@@ -5,7 +5,14 @@
5
5
  "target": "ESNext",
6
6
  "module": "NodeNext",
7
7
  "moduleResolution": "NodeNext",
8
- "types": ["node", "@girs/gtk-4.0", "@girs/gio-2.0", "@girs/glib-2.0"],
8
+ "types": [
9
+ "node",
10
+ "@girs/gtk-4.0",
11
+ "@girs/gio-2.0",
12
+ "@girs/glib-2.0",
13
+ "@girs/gobject-2.0",
14
+ "@gjsify/vite-plugin-blueprint/types"
15
+ ],
9
16
  "esModuleInterop": true,
10
17
  "strict": true,
11
18
  "skipLibCheck": true
@@ -17,10 +17,10 @@
17
17
  "dev": "gjsify dev --runtime gjs"
18
18
  },
19
19
  "devDependencies": {
20
- "@gjsify/cli": "^0.51.0",
21
- "@gjsify/node-globals": "^0.51.0",
22
- "@gjsify/rolldown-native": "^0.51.0",
23
- "@gjsify/runtime": "^0.51.0",
20
+ "@gjsify/cli": "^0.52.0",
21
+ "@gjsify/node-globals": "^0.52.0",
22
+ "@gjsify/rolldown-native": "^0.52.0",
23
+ "@gjsify/runtime": "^0.52.0",
24
24
  "@types/express": "^5.0.6",
25
25
  "@types/node": "^25.9.2",
26
26
  "typescript": "^6.0.3"
@@ -17,10 +17,10 @@
17
17
  "dev": "gjsify dev --runtime gjs"
18
18
  },
19
19
  "devDependencies": {
20
- "@gjsify/cli": "^0.51.0",
21
- "@gjsify/node-globals": "^0.51.0",
22
- "@gjsify/rolldown-native": "^0.51.0",
23
- "@gjsify/runtime": "^0.51.0",
20
+ "@gjsify/cli": "^0.52.0",
21
+ "@gjsify/node-globals": "^0.52.0",
22
+ "@gjsify/rolldown-native": "^0.52.0",
23
+ "@gjsify/runtime": "^0.52.0",
24
24
  "@types/node": "^25.9.2",
25
25
  "typescript": "^6.0.3"
26
26
  },
@@ -42,7 +42,7 @@ function resolveTemplatesRoot() {
42
42
  return candidates.find((c) => existsSync(c));
43
43
  }
44
44
  const FALLBACK_DESCRIPTIONS = {
45
- 'gtk-minimal': 'Minimal GTK4 app — Gtk.Window + Gtk.Label (no Adwaita, no Blueprint).',
45
+ 'gtk-minimal': 'Minimal GTK4 app — Gtk.ApplicationWindow + Gtk.Label, no Adwaita (Blueprint UI).',
46
46
  cli: 'Command-line tool using yargs (Node.js + GJS).',
47
47
  'adw-canvas2d': 'Adwaita app with HTML Canvas 2D rendering (Blueprint UI).',
48
48
  'adw-webgl': 'Adwaita app with WebGL + three.js (Blueprint UI).',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/create-app",
3
- "version": "0.51.0",
3
+ "version": "0.52.0",
4
4
  "description": "Create a new Gjsify project",
5
5
  "type": "module",
6
6
  "main": "lib/create.js",
@@ -28,7 +28,7 @@
28
28
  "test:gjs": "gjsify run test.gjs.mjs",
29
29
  "test:node": "node test.node.mjs",
30
30
  "test:bun": "bun test.node.mjs",
31
- "test:deno": "deno run -A --no-lock --node-modules-dir=none test.node.mjs",
31
+ "test:deno": "deno run -A --no-lock --node-modules-dir=none --min-dep-age=0 test.node.mjs",
32
32
  "test:cross-runtime": "gjsify run build:test && gjsify run test:gjs && gjsify run test:node && gjsify run test:bun && gjsify run test:deno"
33
33
  },
34
34
  "keywords": [
@@ -46,9 +46,9 @@
46
46
  "yargs": "^18.0.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@gjsify/cli": "^0.51.0",
50
- "@gjsify/rolldown-plugin-gjsify": "^0.51.0",
51
- "@gjsify/unit": "^0.51.0",
49
+ "@gjsify/cli": "^0.52.0",
50
+ "@gjsify/rolldown-plugin-gjsify": "^0.52.0",
51
+ "@gjsify/unit": "^0.52.0",
52
52
  "@types/node": "^25.9.2",
53
53
  "@types/yargs": "^17.0.35",
54
54
  "typescript": "^6.0.3"