@gjsify/create-app 0.51.1 → 0.53.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.1",
26
- "@gjsify/dom-elements": "^0.51.1",
27
- "@gjsify/rolldown-native": "^0.51.1",
28
- "@gjsify/vite-plugin-blueprint": "^0.51.1",
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.53.0",
26
+ "@gjsify/dom-elements": "^0.53.0",
27
+ "@gjsify/rolldown-native": "^0.53.0",
28
+ "@gjsify/vite-plugin-blueprint": "^0.53.0",
29
29
  "@types/node": "^25.9.2",
30
30
  "typescript": "^6.0.3"
31
31
  },
32
32
  "dependencies": {
33
- "@gjsify/canvas2d": "^0.51.1",
34
- "@gjsify/node-gi": "^0.51.1"
33
+ "@gjsify/canvas2d": "^0.53.0",
34
+ "@gjsify/node-gi": "^0.53.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.1",
26
- "@gjsify/cli": "^0.51.1",
27
- "@gjsify/dom-elements": "^0.51.1",
28
- "@gjsify/dom-events": "^0.51.1",
29
- "@gjsify/fetch": "^0.51.1",
30
- "@gjsify/rolldown-native": "^0.51.1",
31
- "@gjsify/vite-plugin-blueprint": "^0.51.1",
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.53.0",
26
+ "@gjsify/cli": "^0.53.0",
27
+ "@gjsify/dom-elements": "^0.53.0",
28
+ "@gjsify/dom-events": "^0.53.0",
29
+ "@gjsify/fetch": "^0.53.0",
30
+ "@gjsify/rolldown-native": "^0.53.0",
31
+ "@gjsify/vite-plugin-blueprint": "^0.53.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.1",
37
- "@gjsify/webgl": "^0.51.1",
36
+ "@gjsify/node-gi": "^0.53.0",
37
+ "@gjsify/webgl": "^0.53.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.1",
26
- "@gjsify/dom-elements": "^0.51.1",
27
- "@gjsify/rolldown-native": "^0.51.1",
28
- "@gjsify/vite-plugin-blueprint": "^0.51.1",
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.53.0",
26
+ "@gjsify/dom-elements": "^0.53.0",
27
+ "@gjsify/rolldown-native": "^0.53.0",
28
+ "@gjsify/vite-plugin-blueprint": "^0.53.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.1",
35
- "@gjsify/webgl": "^0.51.1",
34
+ "@gjsify/node-gi": "^0.53.0",
35
+ "@gjsify/webgl": "^0.53.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.1",
21
- "@gjsify/node-globals": "^0.51.1",
22
- "@gjsify/rolldown-native": "^0.51.1",
23
- "@gjsify/runtime": "^0.51.1",
20
+ "@gjsify/cli": "^0.53.0",
21
+ "@gjsify/node-globals": "^0.53.0",
22
+ "@gjsify/rolldown-native": "^0.53.0",
23
+ "@gjsify/runtime": "^0.53.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.1",
21
- "@gjsify/rolldown-native": "^0.51.1",
20
+ "@gjsify/cli": "^0.53.0",
21
+ "@gjsify/rolldown-native": "^0.53.0",
22
+ "@gjsify/vite-plugin-blueprint": "^0.53.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.1"
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.53.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.1",
21
- "@gjsify/node-globals": "^0.51.1",
22
- "@gjsify/rolldown-native": "^0.51.1",
23
- "@gjsify/runtime": "^0.51.1",
20
+ "@gjsify/cli": "^0.53.0",
21
+ "@gjsify/node-globals": "^0.53.0",
22
+ "@gjsify/rolldown-native": "^0.53.0",
23
+ "@gjsify/runtime": "^0.53.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.1",
21
- "@gjsify/node-globals": "^0.51.1",
22
- "@gjsify/rolldown-native": "^0.51.1",
23
- "@gjsify/runtime": "^0.51.1",
20
+ "@gjsify/cli": "^0.53.0",
21
+ "@gjsify/node-globals": "^0.53.0",
22
+ "@gjsify/rolldown-native": "^0.53.0",
23
+ "@gjsify/runtime": "^0.53.0",
24
24
  "@types/node": "^25.9.2",
25
25
  "typescript": "^6.0.3"
26
26
  },
package/lib/create.d.ts CHANGED
@@ -2,7 +2,7 @@ import { type TemplateInfo } from './discover-templates.js';
2
2
  import { type PackageManager } from './runtimes.js';
3
3
  export { discoverTemplates, findTemplate } from './discover-templates.js';
4
4
  export type { TemplateInfo } from './discover-templates.js';
5
- export { PACKAGE_MANAGERS, INSTALL_ARGV, RUNTIME_PACKAGE_MANAGERS, RUNTIME_DESCRIPTIONS, packageManagersForRuntime, isKnownRuntime, hostRuntime, defaultRuntimeFor, runScriptCommand, startScriptFor, type PackageManager, } from './runtimes.js';
5
+ export { PACKAGE_MANAGERS, INSTALL_ARGV, installCommandLine, RUNTIME_PACKAGE_MANAGERS, RUNTIME_DESCRIPTIONS, packageManagersForRuntime, isKnownRuntime, hostRuntime, defaultRuntimeFor, runScriptCommand, startScriptFor, type PackageManager, } from './runtimes.js';
6
6
  export { selectRuntime, selectPackageManager, type Selection } from './select.js';
7
7
  export interface CreateProjectOptions {
8
8
  projectName: string;
package/lib/create.js CHANGED
@@ -2,9 +2,9 @@ import { spawnSync } from 'node:child_process';
2
2
  import { readFileSync, writeFileSync, mkdirSync, existsSync, readdirSync, cpSync } from 'node:fs';
3
3
  import { resolve, join } from 'node:path';
4
4
  import { discoverTemplates, findTemplate } from './discover-templates.js';
5
- import { INSTALL_ARGV, defaultRuntimeFor, hostRuntime, packageManagersForRuntime, runScriptCommand, startScriptFor, } from './runtimes.js';
5
+ import { defaultRuntimeFor, installCommandLine, hostRuntime, packageManagersForRuntime, runScriptCommand, startScriptFor, } from './runtimes.js';
6
6
  export { discoverTemplates, findTemplate } from './discover-templates.js';
7
- export { PACKAGE_MANAGERS, INSTALL_ARGV, RUNTIME_PACKAGE_MANAGERS, RUNTIME_DESCRIPTIONS, packageManagersForRuntime, isKnownRuntime, hostRuntime, defaultRuntimeFor, runScriptCommand, startScriptFor, } from './runtimes.js';
7
+ export { PACKAGE_MANAGERS, INSTALL_ARGV, installCommandLine, RUNTIME_PACKAGE_MANAGERS, RUNTIME_DESCRIPTIONS, packageManagersForRuntime, isKnownRuntime, hostRuntime, defaultRuntimeFor, runScriptCommand, startScriptFor, } from './runtimes.js';
8
8
  // Re-exported through the package's `.` entry (which is this file, not
9
9
  // `index.ts`) so `gjsify create` can reach the same decisions the standalone bin
10
10
  // makes instead of re-deriving them — a second derivation is a second answer.
@@ -110,8 +110,8 @@ export async function createProject(options) {
110
110
  cpSync(info.path, targetDir, { recursive: true });
111
111
  substituteTemplateSentinels(targetDir, projectName);
112
112
  if (install) {
113
- const argv = [...INSTALL_ARGV[packageManager]];
114
- console.log(`Running ${packageManager} ${argv[0]}...`);
113
+ const commandLine = installCommandLine(packageManager);
114
+ console.log(`Running ${commandLine}...`);
115
115
  // `shell: true` is what makes this work on Windows, where `npm` is
116
116
  // `npm.cmd`: `CreateProcess` appends only `.exe` when it searches PATH
117
117
  // for a bare name, so `spawnSync('npm', …)` is ENOENT there — and
@@ -122,8 +122,10 @@ export async function createProject(options) {
122
122
  // `@gjsify/cli`'s `utils/spawn.ts` sanctions for exactly this case. It
123
123
  // applies to every manager here: npm/yarn/pnpm/gjsify ship as `.cmd`
124
124
  // shims on Windows, and bun/deno as `.exe`, which the bare-name search
125
- // finds — but the shell path is correct for both and costs nothing.
126
- const result = spawnSync(packageManager, argv, {
125
+ // finds — but the shell path is correct for both and costs nothing. The
126
+ // command goes in as one LINE, not an argv: `shell` plus an args array is
127
+ // DEP0190 (see `installCommandLine`).
128
+ const result = spawnSync(commandLine, {
127
129
  cwd: targetDir,
128
130
  stdio: 'inherit',
129
131
  shell: true,
@@ -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/lib/runtimes.d.ts CHANGED
@@ -14,6 +14,17 @@ export type PackageManager = (typeof PACKAGE_MANAGERS)[number];
14
14
  * install-a-script mode.
15
15
  */
16
16
  export declare const INSTALL_ARGV: Record<PackageManager, readonly string[]>;
17
+ /**
18
+ * The install as ONE shell command line, for `spawnSync(line, { shell: true })`.
19
+ *
20
+ * The shell is what finds the `.cmd` shims npm/yarn/pnpm/gjsify are on Windows (see
21
+ * `createProject`). Handing it an argv array as well is Node's DEP0190: with
22
+ * `shell: true` the array is only concatenated, never escaped, so Node 24 warns on
23
+ * every call and a later major refuses it. Joining here is safe because every token
24
+ * is a fixed flag from {@link INSTALL_ARGV}, and the spec holds each one to a
25
+ * character set neither `sh` nor `cmd.exe` gives a meaning to.
26
+ */
27
+ export declare function installCommandLine(manager: PackageManager): string;
17
28
  /** The command prefix that runs a package script under `manager`. */
18
29
  export declare function runScriptCommand(manager: PackageManager): string;
19
30
  /**
package/lib/runtimes.js CHANGED
@@ -37,6 +37,19 @@ export const INSTALL_ARGV = {
37
37
  bun: ['install'],
38
38
  deno: ['install'],
39
39
  };
40
+ /**
41
+ * The install as ONE shell command line, for `spawnSync(line, { shell: true })`.
42
+ *
43
+ * The shell is what finds the `.cmd` shims npm/yarn/pnpm/gjsify are on Windows (see
44
+ * `createProject`). Handing it an argv array as well is Node's DEP0190: with
45
+ * `shell: true` the array is only concatenated, never escaped, so Node 24 warns on
46
+ * every call and a later major refuses it. Joining here is safe because every token
47
+ * is a fixed flag from {@link INSTALL_ARGV}, and the spec holds each one to a
48
+ * character set neither `sh` nor `cmd.exe` gives a meaning to.
49
+ */
50
+ export function installCommandLine(manager) {
51
+ return [manager, ...INSTALL_ARGV[manager]].join(' ');
52
+ }
40
53
  /**
41
54
  * How each manager spells "run the package script `<name>`" — six managers, four
42
55
  * spellings. Printing the one the user's manager accepts is why the choice is
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/create-app",
3
- "version": "0.51.1",
3
+ "version": "0.53.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.1",
50
- "@gjsify/rolldown-plugin-gjsify": "^0.51.1",
51
- "@gjsify/unit": "^0.51.1",
49
+ "@gjsify/cli": "^0.53.0",
50
+ "@gjsify/rolldown-plugin-gjsify": "^0.53.0",
51
+ "@gjsify/unit": "^0.53.0",
52
52
  "@types/node": "^25.9.2",
53
53
  "@types/yargs": "^17.0.35",
54
54
  "typescript": "^6.0.3"