@gjsify/create-app 0.52.0 → 0.54.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.
- package/README.md +2 -2
- package/dist-templates/adw-canvas2d/.oxlintrc.json +13 -0
- package/dist-templates/adw-canvas2d/package.json +7 -6
- package/dist-templates/adw-game/.oxlintrc.json +13 -0
- package/dist-templates/adw-game/README.md +9 -0
- package/dist-templates/adw-game/package.json +11 -10
- package/dist-templates/adw-webgl/.oxlintrc.json +13 -0
- package/dist-templates/adw-webgl/package.json +7 -6
- package/dist-templates/cli/package.json +4 -4
- package/dist-templates/gtk-minimal/.oxlintrc.json +13 -0
- package/dist-templates/gtk-minimal/package.json +5 -4
- package/dist-templates/web-server-express/package.json +4 -4
- package/dist-templates/web-server-hono/package.json +4 -4
- package/lib/create.d.ts +1 -1
- package/lib/create.js +8 -6
- package/lib/runtimes.d.ts +11 -0
- package/lib/runtimes.js +13 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -57,10 +57,10 @@ one flag whose default would reach your disk.
|
|
|
57
57
|
|
|
58
58
|
| Template | |
|
|
59
59
|
|---|---|
|
|
60
|
-
| `gtk-minimal` | `Gtk.
|
|
60
|
+
| `gtk-minimal` | `Gtk.ApplicationWindow` declared in Blueprint; no Adwaita. |
|
|
61
61
|
| `adw-canvas2d` | Adwaita app rendering through the HTML Canvas 2D API (Blueprint UI). |
|
|
62
62
|
| `adw-webgl` | Adwaita app rendering through WebGL + three.js (Blueprint UI). |
|
|
63
|
-
| `adw-game` | Adwaita game shell on Excalibur.js; WebGL with a Canvas 2D fallback. |
|
|
63
|
+
| `adw-game` | Adwaita game shell on Excalibur.js; WebGL with a Canvas 2D fallback (Blueprint UI). |
|
|
64
64
|
| `cli` | Command-line tool using yargs. |
|
|
65
65
|
| `web-server-hono` | HTTP server using Hono (Web-standard fetch-style API). |
|
|
66
66
|
| `web-server-express` | HTTP server using Express. |
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
3
|
+
"categories": {
|
|
4
|
+
"correctness": "error"
|
|
5
|
+
},
|
|
6
|
+
"jsPlugins": [
|
|
7
|
+
"@gjsify/oxlint-plugin-gjsify"
|
|
8
|
+
],
|
|
9
|
+
"rules": {
|
|
10
|
+
"gjsify/prefer-blueprint-template": "error",
|
|
11
|
+
"gjsify/no-literal-widget-label": "error"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -22,16 +22,17 @@
|
|
|
22
22
|
"@girs/gjs": "5.4.0",
|
|
23
23
|
"@girs/gobject-2.0": "5.4.0",
|
|
24
24
|
"@girs/gtk-4.0": "5.4.0",
|
|
25
|
-
"@gjsify/cli": "^0.
|
|
26
|
-
"@gjsify/dom-elements": "^0.
|
|
27
|
-
"@gjsify/
|
|
28
|
-
"@gjsify/
|
|
25
|
+
"@gjsify/cli": "^0.54.0",
|
|
26
|
+
"@gjsify/dom-elements": "^0.54.0",
|
|
27
|
+
"@gjsify/oxlint-plugin-gjsify": "^0.54.0",
|
|
28
|
+
"@gjsify/rolldown-native": "^0.54.0",
|
|
29
|
+
"@gjsify/vite-plugin-blueprint": "^0.54.0",
|
|
29
30
|
"@types/node": "^25.9.2",
|
|
30
31
|
"typescript": "^6.0.3"
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
33
|
-
"@gjsify/canvas2d": "^0.
|
|
34
|
-
"@gjsify/node-gi": "^0.
|
|
34
|
+
"@gjsify/canvas2d": "^0.54.0",
|
|
35
|
+
"@gjsify/node-gi": "^0.54.0"
|
|
35
36
|
},
|
|
36
37
|
"gjsify": {
|
|
37
38
|
"main": "dist/index.gjs.js",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
3
|
+
"categories": {
|
|
4
|
+
"correctness": "error"
|
|
5
|
+
},
|
|
6
|
+
"jsPlugins": [
|
|
7
|
+
"@gjsify/oxlint-plugin-gjsify"
|
|
8
|
+
],
|
|
9
|
+
"rules": {
|
|
10
|
+
"gjsify/prefer-blueprint-template": "error",
|
|
11
|
+
"gjsify/no-literal-widget-label": "error"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
An Adwaita game shell built on Excalibur.js, WebGL with a Canvas 2D fallback, scaffolded from the gjsify `adw-game` template.
|
|
4
4
|
|
|
5
|
+
The window is declared in `src/main-window.blp` and `src/main-window.ts` holds only logic. That
|
|
6
|
+
split is what makes the caption translatable: a string assigned from TypeScript carries no
|
|
7
|
+
`translatable` attribute, so `xgettext` never sees it and the interface is untranslatable by
|
|
8
|
+
construction. The drawing surface is the deliberate exception — it is a runtime object with no
|
|
9
|
+
place in a template, so the `.blp` declares the empty container and the constructor appends it.
|
|
10
|
+
|
|
11
|
+
Blueprint needs **no system tool**. `@gjsify/vite-plugin-blueprint` parses the `.blp` in process and
|
|
12
|
+
emits GtkBuilder XML, so `npm run build` asks nothing of your machine beyond GTK 4 itself.
|
|
13
|
+
|
|
5
14
|
## Install
|
|
6
15
|
|
|
7
16
|
```bash
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "new-gjsify-app",
|
|
3
|
-
"description": "Adwaita game shell using Excalibur.js, WebGL → Canvas2D fallback.",
|
|
3
|
+
"description": "Adwaita game shell using Excalibur.js, WebGL → Canvas2D fallback (Blueprint UI).",
|
|
4
4
|
"version": "0.1.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": true,
|
|
@@ -22,19 +22,20 @@
|
|
|
22
22
|
"@girs/gjs": "5.4.0",
|
|
23
23
|
"@girs/gobject-2.0": "5.4.0",
|
|
24
24
|
"@girs/gtk-4.0": "5.4.0",
|
|
25
|
-
"@gjsify/canvas2d": "^0.
|
|
26
|
-
"@gjsify/cli": "^0.
|
|
27
|
-
"@gjsify/dom-elements": "^0.
|
|
28
|
-
"@gjsify/dom-events": "^0.
|
|
29
|
-
"@gjsify/fetch": "^0.
|
|
30
|
-
"@gjsify/
|
|
31
|
-
"@gjsify/
|
|
25
|
+
"@gjsify/canvas2d": "^0.54.0",
|
|
26
|
+
"@gjsify/cli": "^0.54.0",
|
|
27
|
+
"@gjsify/dom-elements": "^0.54.0",
|
|
28
|
+
"@gjsify/dom-events": "^0.54.0",
|
|
29
|
+
"@gjsify/fetch": "^0.54.0",
|
|
30
|
+
"@gjsify/oxlint-plugin-gjsify": "^0.54.0",
|
|
31
|
+
"@gjsify/rolldown-native": "^0.54.0",
|
|
32
|
+
"@gjsify/vite-plugin-blueprint": "^0.54.0",
|
|
32
33
|
"@types/node": "^25.9.2",
|
|
33
34
|
"typescript": "^6.0.3"
|
|
34
35
|
},
|
|
35
36
|
"dependencies": {
|
|
36
|
-
"@gjsify/node-gi": "^0.
|
|
37
|
-
"@gjsify/webgl": "^0.
|
|
37
|
+
"@gjsify/node-gi": "^0.54.0",
|
|
38
|
+
"@gjsify/webgl": "^0.54.0",
|
|
38
39
|
"excalibur": "0.32.0"
|
|
39
40
|
},
|
|
40
41
|
"gjsify": {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
3
|
+
"categories": {
|
|
4
|
+
"correctness": "error"
|
|
5
|
+
},
|
|
6
|
+
"jsPlugins": [
|
|
7
|
+
"@gjsify/oxlint-plugin-gjsify"
|
|
8
|
+
],
|
|
9
|
+
"rules": {
|
|
10
|
+
"gjsify/prefer-blueprint-template": "error",
|
|
11
|
+
"gjsify/no-literal-widget-label": "error"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -22,17 +22,18 @@
|
|
|
22
22
|
"@girs/gjs": "5.4.0",
|
|
23
23
|
"@girs/gobject-2.0": "5.4.0",
|
|
24
24
|
"@girs/gtk-4.0": "5.4.0",
|
|
25
|
-
"@gjsify/cli": "^0.
|
|
26
|
-
"@gjsify/dom-elements": "^0.
|
|
27
|
-
"@gjsify/
|
|
28
|
-
"@gjsify/
|
|
25
|
+
"@gjsify/cli": "^0.54.0",
|
|
26
|
+
"@gjsify/dom-elements": "^0.54.0",
|
|
27
|
+
"@gjsify/oxlint-plugin-gjsify": "^0.54.0",
|
|
28
|
+
"@gjsify/rolldown-native": "^0.54.0",
|
|
29
|
+
"@gjsify/vite-plugin-blueprint": "^0.54.0",
|
|
29
30
|
"@types/node": "^25.9.2",
|
|
30
31
|
"@types/three": "^0.185.0",
|
|
31
32
|
"typescript": "^6.0.3"
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|
|
34
|
-
"@gjsify/node-gi": "^0.
|
|
35
|
-
"@gjsify/webgl": "^0.
|
|
35
|
+
"@gjsify/node-gi": "^0.54.0",
|
|
36
|
+
"@gjsify/webgl": "^0.54.0",
|
|
36
37
|
"three": "0.185.1"
|
|
37
38
|
},
|
|
38
39
|
"gjsify": {
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"dev": "gjsify dev --runtime gjs"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@gjsify/cli": "^0.
|
|
21
|
-
"@gjsify/node-globals": "^0.
|
|
22
|
-
"@gjsify/rolldown-native": "^0.
|
|
23
|
-
"@gjsify/runtime": "^0.
|
|
20
|
+
"@gjsify/cli": "^0.54.0",
|
|
21
|
+
"@gjsify/node-globals": "^0.54.0",
|
|
22
|
+
"@gjsify/rolldown-native": "^0.54.0",
|
|
23
|
+
"@gjsify/runtime": "^0.54.0",
|
|
24
24
|
"@types/node": "^25.9.2",
|
|
25
25
|
"@types/yargs": "^17.0.35",
|
|
26
26
|
"typescript": "^6.0.3"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
3
|
+
"categories": {
|
|
4
|
+
"correctness": "error"
|
|
5
|
+
},
|
|
6
|
+
"jsPlugins": [
|
|
7
|
+
"@gjsify/oxlint-plugin-gjsify"
|
|
8
|
+
],
|
|
9
|
+
"rules": {
|
|
10
|
+
"gjsify/prefer-blueprint-template": "error",
|
|
11
|
+
"gjsify/no-literal-widget-label": "error"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -17,9 +17,10 @@
|
|
|
17
17
|
"dev": "gjsify dev --runtime gjs"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@gjsify/cli": "^0.
|
|
21
|
-
"@gjsify/
|
|
22
|
-
"@gjsify/
|
|
20
|
+
"@gjsify/cli": "^0.54.0",
|
|
21
|
+
"@gjsify/oxlint-plugin-gjsify": "^0.54.0",
|
|
22
|
+
"@gjsify/rolldown-native": "^0.54.0",
|
|
23
|
+
"@gjsify/vite-plugin-blueprint": "^0.54.0",
|
|
23
24
|
"@types/node": "^25.9.2",
|
|
24
25
|
"typescript": "^6.0.3"
|
|
25
26
|
},
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
"@girs/glib-2.0": "5.4.0",
|
|
29
30
|
"@girs/gobject-2.0": "5.4.0",
|
|
30
31
|
"@girs/gtk-4.0": "5.4.0",
|
|
31
|
-
"@gjsify/node-gi": "^0.
|
|
32
|
+
"@gjsify/node-gi": "^0.54.0"
|
|
32
33
|
},
|
|
33
34
|
"gjsify": {
|
|
34
35
|
"main": "dist/index.gjs.js",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"dev": "gjsify dev --runtime gjs"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@gjsify/cli": "^0.
|
|
21
|
-
"@gjsify/node-globals": "^0.
|
|
22
|
-
"@gjsify/rolldown-native": "^0.
|
|
23
|
-
"@gjsify/runtime": "^0.
|
|
20
|
+
"@gjsify/cli": "^0.54.0",
|
|
21
|
+
"@gjsify/node-globals": "^0.54.0",
|
|
22
|
+
"@gjsify/rolldown-native": "^0.54.0",
|
|
23
|
+
"@gjsify/runtime": "^0.54.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.
|
|
21
|
-
"@gjsify/node-globals": "^0.
|
|
22
|
-
"@gjsify/rolldown-native": "^0.
|
|
23
|
-
"@gjsify/runtime": "^0.
|
|
20
|
+
"@gjsify/cli": "^0.54.0",
|
|
21
|
+
"@gjsify/node-globals": "^0.54.0",
|
|
22
|
+
"@gjsify/rolldown-native": "^0.54.0",
|
|
23
|
+
"@gjsify/runtime": "^0.54.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 {
|
|
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
|
|
114
|
-
console.log(`Running ${
|
|
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
|
-
|
|
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,
|
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.
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"description": "Create a new Gjsify project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/create.js",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"yargs": "^18.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@gjsify/cli": "^0.
|
|
50
|
-
"@gjsify/rolldown-plugin-gjsify": "^0.
|
|
51
|
-
"@gjsify/unit": "^0.
|
|
49
|
+
"@gjsify/cli": "^0.54.0",
|
|
50
|
+
"@gjsify/rolldown-plugin-gjsify": "^0.54.0",
|
|
51
|
+
"@gjsify/unit": "^0.54.0",
|
|
52
52
|
"@types/node": "^25.9.2",
|
|
53
53
|
"@types/yargs": "^17.0.35",
|
|
54
54
|
"typescript": "^6.0.3"
|