diff --git a/examples/gjs/adw-1-hello/main.ts b/examples/gjs/adw-1-hello/main.ts
index 536273f1c..dfb78ceb6 100644
--- a/examples/gjs/adw-1-hello/main.ts
+++ b/examples/gjs/adw-1-hello/main.ts
@@ -3,11 +3,10 @@
* @see https://gitlab.gnome.org/GNOME/libadwaita/-/blob/main/examples/hello-world/hello.c
*/
-import './@types/gjs/gjs';
-import Gio from './@types/gio-2.0/gio-2.0';
-import GLib from './@types/glib-2.0/glib-2.0';
-import Gtk from './@types/gtk-4.0/gtk-4.0';
-import Adw from './@types/adw-1/adw-1';
+import Gio from 'gi://Gio';
+import GLib from 'gi://GLib';
+import Gtk from 'gi://Gtk';
+import Adw from 'gi://Adw';
const loop = GLib.MainLoop.new(null, false)
diff --git a/examples/gjs/adw-1-hello/package.json b/examples/gjs/adw-1-hello/package.json
index b038c8b87..f73109de4 100644
--- a/examples/gjs/adw-1-hello/package.json
+++ b/examples/gjs/adw-1-hello/package.json
@@ -7,7 +7,7 @@
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
- "build:types": "yarn ts-for-gir generate Adw-1",
+ "build:types": "yarn ts-for-gir generate Adw-1 --outdir @types/@girs",
"build:app": "vite build",
"build": "yarn build:types && yarn build:app",
"start:app": "gjs -m dist/main.js",
diff --git a/examples/gjs/gio-2-cat-alias/.ts-for-girrc.json b/examples/gjs/gio-2-cat-alias/.ts-for-girrc.json
index 21688bbbd..2e9ed5ccb 100644
--- a/examples/gjs/gio-2-cat-alias/.ts-for-girrc.json
+++ b/examples/gjs/gio-2-cat-alias/.ts-for-girrc.json
@@ -1,6 +1,6 @@
{
"modules": ["Gio-2.0"],
"noNamespace": false,
- "outdir": "./@types",
+ "outdir": "./@types/@girs",
"generateAlias": true
}
\ No newline at end of file
diff --git a/examples/gjs/gio-2-cat-alias/tsconfig.json b/examples/gjs/gio-2-cat-alias/tsconfig.json
index 89d0f11a2..0ce4e49a9 100644
--- a/examples/gjs/gio-2-cat-alias/tsconfig.json
+++ b/examples/gjs/gio-2-cat-alias/tsconfig.json
@@ -2,12 +2,12 @@
"extends": "./tsconfig.alias.json",
"compilerOptions": {
"lib": ["ESNext"],
- "types": [],
+ "types": ["@girs/gjs", "@girs/gjs/dom"],
+ "typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
},
- "include": ["@types/gjs.d.ts", "@types/dom.d.ts"],
"files": [
"main.ts",
]
diff --git a/examples/gjs/gio-2-cat-promisify/tsconfig.json b/examples/gjs/gio-2-cat-promisify/tsconfig.json
index 1d5d30cd2..846178966 100644
--- a/examples/gjs/gio-2-cat-promisify/tsconfig.json
+++ b/examples/gjs/gio-2-cat-promisify/tsconfig.json
@@ -2,11 +2,11 @@
"extends": "./tsconfig.alias.json",
"compilerOptions": {
"lib": ["ESNext"],
- "types": [],
+ "types": ["@girs/gjs", "@girs/gjs/dom"],
+ "typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext"
},
- "include": ["@types/gjs.d.ts", "@types/dom.d.ts"],
"files": [
"main.ts",
]
diff --git a/examples/gjs/gio-2-cat-types-only/tsconfig.json b/examples/gjs/gio-2-cat-types-only/tsconfig.json
index dc12aae7e..759877532 100644
--- a/examples/gjs/gio-2-cat-types-only/tsconfig.json
+++ b/examples/gjs/gio-2-cat-types-only/tsconfig.json
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"lib": ["ESNext"],
- "types": [],
+ "types": ["@girs/gjs", "@girs/gjs/dom", "@girs/glib-2.0", "@girs/gio-2.0"],
+ "typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"strict": true,
@@ -10,7 +11,6 @@
"noImplicitThis": true,
"alwaysStrict": true
},
- "include": ["@types/gjs.d.ts", "@types/dom.d.ts", "@types/gio-2.0.d.ts", "@types/glib-2.0.d.ts"],
"files": [
"main.ts",
]
diff --git a/examples/gjs/gio-2-cat/main.ts b/examples/gjs/gio-2-cat/main.ts
index 0ae82f9ab..fb6ccac86 100644
--- a/examples/gjs/gio-2-cat/main.ts
+++ b/examples/gjs/gio-2-cat/main.ts
@@ -1,3 +1,6 @@
+///
+///
+
// SPDX-License-Identifier: MIT OR LGPL-2.0-or-later
// SPDX-FileCopyrightText: 2009 Red Hat, Inc.
// Based on https://gitlab.gnome.org/GNOME/gjs/-/blob/master/examples/gio-cat.js
@@ -8,8 +11,6 @@
* the label should show a translation of 'Print help'
*/
-import './@types/gjs/gjs';
-import './@types/gjs/dom';
import GLib from './@types/glib-2.0/glib-2.0';
import Gio from './@types/gio-2.0/gio-2.0';
diff --git a/examples/gjs/gio-2-cat/package.json b/examples/gjs/gio-2-cat/package.json
index 243e02634..e2c00d05b 100644
--- a/examples/gjs/gio-2-cat/package.json
+++ b/examples/gjs/gio-2-cat/package.json
@@ -7,7 +7,7 @@
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
- "build:types": "yarn ts-for-gir generate Gio-2.0",
+ "build:types": "yarn ts-for-gir generate Gio-2.0 --outdir @types/@girs",
"build:app": "yarn node esbuild.js",
"build": "yarn build:types && yarn build:app",
"start:app": "gjs -m dist/main.js main.ts",
diff --git a/examples/gjs/gio-2-dbus/package.json b/examples/gjs/gio-2-dbus/package.json
index 681ba56c8..0963846de 100644
--- a/examples/gjs/gio-2-dbus/package.json
+++ b/examples/gjs/gio-2-dbus/package.json
@@ -7,7 +7,7 @@
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
- "build:types": "yarn ts-for-gir generate Gio-2.0 --generateAlias",
+ "build:types": "yarn ts-for-gir generate Gio-2.0 --generateAlias --outdir=@types/@girs",
"build:app": "yarn node esbuild.js",
"build": "yarn build:types && yarn build:app",
"start": "yarn build && yarn start:server",
diff --git a/examples/gjs/gio-2-dbus/tsconfig.json b/examples/gjs/gio-2-dbus/tsconfig.json
index 33bae9338..c1a56714f 100644
--- a/examples/gjs/gio-2-dbus/tsconfig.json
+++ b/examples/gjs/gio-2-dbus/tsconfig.json
@@ -2,7 +2,8 @@
"extends": "./tsconfig.alias.json",
"compilerOptions": {
"lib": ["ESNext"],
- "types": [],
+ "types": ["@girs/gjs"],
+ "typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"strict": true,
@@ -11,7 +12,6 @@
"noImplicitThis": true,
"alwaysStrict": true,
},
- "include": ["@types/gjs.d.ts"],
"files": [
"dbus-client.ts",
"dbus-server.ts",
diff --git a/examples/gjs/gio-2-list-model/package.json b/examples/gjs/gio-2-list-model/package.json
index 74286fed3..fbc9052e2 100644
--- a/examples/gjs/gio-2-list-model/package.json
+++ b/examples/gjs/gio-2-list-model/package.json
@@ -7,7 +7,7 @@
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
- "build:types": "yarn ts-for-gir generate Gtk-4.0 --generateAlias",
+ "build:types": "yarn ts-for-gir generate Gtk-4.0 --generateAlias --outdir=@types/@girs",
"build:app": "yarn node esbuild.js",
"build": "yarn build:types && yarn build:app",
"start:app": "gjs -m dist/main.js",
diff --git a/examples/gjs/gio-2-list-model/tsconfig.json b/examples/gjs/gio-2-list-model/tsconfig.json
index 27740af42..b83468bb1 100644
--- a/examples/gjs/gio-2-list-model/tsconfig.json
+++ b/examples/gjs/gio-2-list-model/tsconfig.json
@@ -2,7 +2,8 @@
"extends": "./tsconfig.alias.json",
"compilerOptions": {
"lib": ["ESNext"],
- "types": [],
+ "types": ["@girs/gjs"],
+ "typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"strict": true,
@@ -11,7 +12,6 @@
"noImplicitThis": true,
"alwaysStrict": true,
},
- "include": ["@types/gjs.d.ts"],
"files": [
"main.ts",
]
diff --git a/examples/gjs/glib-2-spawn-command/main.ts b/examples/gjs/glib-2-spawn-command/main.ts
index 6b9683d03..d375abddc 100644
--- a/examples/gjs/glib-2-spawn-command/main.ts
+++ b/examples/gjs/glib-2-spawn-command/main.ts
@@ -1,5 +1,5 @@
// Example based on https://gist.github.com/buzztaiki/1487781/74ea93d3a30f20c7f094327db9cb263a6286f6d6
-import * as GLib from './@types/glib-2.0.js';
+import GLib from 'gi://GLib';
const textDecoder = new TextDecoder();
let [res, out, err, status] = GLib.spawn_command_line_sync('ls -la');
diff --git a/examples/gjs/glib-2-spawn-command/package.json b/examples/gjs/glib-2-spawn-command/package.json
index 32fc938e1..2da915696 100644
--- a/examples/gjs/glib-2-spawn-command/package.json
+++ b/examples/gjs/glib-2-spawn-command/package.json
@@ -10,7 +10,7 @@
"watch": "yarn build:app --watch",
"build": "yarn build:types && yarn build:app",
"build:app": "yarn clear:ts && webpack --env production",
- "build:types": "yarn ts-for-gir generate GLib-2.0 --noNamespace",
+ "build:types": "yarn ts-for-gir generate GLib-2.0 --outdir @types/@girs",
"clear:types": "rm -rf ./@types",
"clear:ts": "rm -rf ./dist",
"clear": "yarn clear:ts && yarn clear:types",
diff --git a/examples/gjs/glib-2-spawn-command/tsconfig.json b/examples/gjs/glib-2-spawn-command/tsconfig.json
index 9da618f9d..233ab4be1 100644
--- a/examples/gjs/glib-2-spawn-command/tsconfig.json
+++ b/examples/gjs/glib-2-spawn-command/tsconfig.json
@@ -1,17 +1,17 @@
{
- "compilerOptions": {
- "lib": ["ESNext"],
- "types": [],
- "target": "ESNext",
- "module": "ESNext",
- "strict": true,
- "noImplicitAny": false,
- "strictNullChecks": true,
- "noImplicitThis": true,
- "alwaysStrict": true,
- },
- "include": ["@types/gjs.d.ts", "@types/dom.d.ts", "@types/ambient.d.ts"],
- "files": [
- "main.ts"
- ]
+ "compilerOptions": {
+ "lib": ["ESNext"],
+ "types": ["@girs/gjs", "@girs/gjs/dom", "@girs/glib-2.0", "@girs/gobject-2.0"],
+ "typeRoots": ["./@types"],
+ "target": "ESNext",
+ "module": "ESNext",
+ "moduleResolution": "Bundler",
+ "strict": true,
+ "noImplicitAny": false,
+ "strictNullChecks": true,
+ "noImplicitThis": true,
+ "alwaysStrict": true,
+ "skipLibCheck": false
+ },
+ "files": ["main.ts"]
}
diff --git a/examples/gjs/glib-2-variant/package.json b/examples/gjs/glib-2-variant/package.json
index 27ebddab0..5b5730a00 100644
--- a/examples/gjs/glib-2-variant/package.json
+++ b/examples/gjs/glib-2-variant/package.json
@@ -7,7 +7,7 @@
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
- "build:types": "yarn ts-for-gir generate GLib-2.0 Gio-2.0 --generateAlias",
+ "build:types": "yarn ts-for-gir generate GLib-2.0 Gio-2.0 --generateAlias --outdir=@types/@girs",
"build:app": "yarn node esbuild.js",
"build": "yarn build:types && yarn build:app",
"start:app": "gjs -m dist/index.js",
diff --git a/examples/gjs/glib-2-variant/tsconfig.json b/examples/gjs/glib-2-variant/tsconfig.json
index 2af89788e..092b96ad2 100644
--- a/examples/gjs/glib-2-variant/tsconfig.json
+++ b/examples/gjs/glib-2-variant/tsconfig.json
@@ -2,7 +2,8 @@
"extends": "./tsconfig.alias.json",
"compilerOptions": {
"lib": ["ESNext"],
- "types": [],
+ "types": ["@girs/gjs", "@girs/glib-2.0"],
+ "typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"strict": true,
@@ -11,7 +12,6 @@
"noImplicitThis": true,
"alwaysStrict": true,
},
- "include": ["@types/gjs.d.ts"],
"files": [
"index.ts"
]
diff --git a/examples/gjs/gtk-3-browser/package.json b/examples/gjs/gtk-3-browser/package.json
index 2f60c6835..dd70e3aa8 100644
--- a/examples/gjs/gtk-3-browser/package.json
+++ b/examples/gjs/gtk-3-browser/package.json
@@ -11,7 +11,7 @@
"watch": "yarn build:app --watch",
"build": "yarn build:types && yarn build:app",
"build:app": "yarn clear:ts && webpack --config webpack.config.cjs --env production",
- "build:types": "yarn ts-for-gir generate Gtk-3.0 Pango-1.0 WebKit2-4.0 --generateAlias",
+ "build:types": "yarn ts-for-gir generate Gtk-3.0 Pango-1.0 WebKit2-4.0 --generateAlias --outdir=@types/@girs",
"clear:types": "rm -rf ./@types",
"clear:ts": "rm -rf ./dist",
"clear": "yarn clear:ts && yarn clear:types",
diff --git a/examples/gjs/gtk-3-browser/tsconfig.json b/examples/gjs/gtk-3-browser/tsconfig.json
index f47168300..9d679eeea 100644
--- a/examples/gjs/gtk-3-browser/tsconfig.json
+++ b/examples/gjs/gtk-3-browser/tsconfig.json
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"lib": ["ESNext"],
- "types": [],
+ "types": ["@girs/gjs", "@girs/pango-1.0", "@girs/gtk-3.0", "@girs/webkit2-4.0"],
+ "typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"strict": true,
@@ -10,7 +11,6 @@
"noImplicitThis": true,
"alwaysStrict": true,
},
- "include": ["@types/ambient.d.ts", "@types/pango-1.0-ambient.d.ts", "@types/gtk-3.0-ambient.d.ts", "@types/webkit2-4.0-ambient.d.ts"],
"files": [
"main.ts"
]
diff --git a/examples/gjs/gtk-3-builder/main.ts b/examples/gjs/gtk-3-builder/main.ts
index dfe505582..9a37ae499 100644
--- a/examples/gjs/gtk-3-builder/main.ts
+++ b/examples/gjs/gtk-3-builder/main.ts
@@ -1,6 +1,5 @@
-import './@types/gjs.js'
import gladeFile from './builderExample.glade'
-import * as Gtk from './@types/gtk-3.0'
+import Gtk from './@types/gtk-3.0/gtk-3.0'
Gtk.init(null)
diff --git a/examples/gjs/gtk-3-builder/package.json b/examples/gjs/gtk-3-builder/package.json
index f0a754749..00f995be1 100644
--- a/examples/gjs/gtk-3-builder/package.json
+++ b/examples/gjs/gtk-3-builder/package.json
@@ -10,7 +10,7 @@
"watch": "yarn build:app --watch",
"build": "yarn build:types && yarn build:app",
"build:app": "yarn clear:ts && webpack --env production",
- "build:types": "yarn ts-for-gir generate Gtk-3.0 --noNamespace",
+ "build:types": "yarn ts-for-gir generate Gtk-3.0 --noNamespace --outdir=@types",
"clear:types": "rm -rf ./@types",
"clear:ts": "rm -rf ./dist",
"clear": "yarn clear:ts && yarn clear:types",
diff --git a/examples/gjs/gtk-3-builder/tsconfig.json b/examples/gjs/gtk-3-builder/tsconfig.json
index ae1ae2e0a..ec08a4c94 100644
--- a/examples/gjs/gtk-3-builder/tsconfig.json
+++ b/examples/gjs/gtk-3-builder/tsconfig.json
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"lib": ["ESNext"],
- "types": [],
+ "typeRoots": ["./@types"],
+ "types": ["@girs/gjs"],
"target": "ESNext",
"module": "ESNext",
"strict": true,
@@ -9,8 +10,9 @@
"strictNullChecks": true,
"noImplicitThis": true,
"alwaysStrict": true,
+ "allowSyntheticDefaultImports": true,
},
- "include": ["global.d.ts", "@types/gjs.d.ts", "@types/ambient.d.ts"],
+ "include": ["global.d.ts"],
"files": [
"main.ts"
]
diff --git a/examples/gjs/gtk-3-calc/package.json b/examples/gjs/gtk-3-calc/package.json
index 2e481988c..a4dd059f7 100644
--- a/examples/gjs/gtk-3-calc/package.json
+++ b/examples/gjs/gtk-3-calc/package.json
@@ -7,7 +7,7 @@
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
- "build:types": "yarn ts-for-gir generate Gtk-3.0 --generateAlias",
+ "build:types": "yarn ts-for-gir generate Gtk-3.0 --generateAlias --outdir=@types/@girs",
"build:app": "yarn node esbuild.js",
"build": "yarn build:types && yarn build:app",
"start:app": "gjs -m dist/main.js",
diff --git a/examples/gjs/gtk-3-calc/tsconfig.json b/examples/gjs/gtk-3-calc/tsconfig.json
index de82d12da..d2a598249 100644
--- a/examples/gjs/gtk-3-calc/tsconfig.json
+++ b/examples/gjs/gtk-3-calc/tsconfig.json
@@ -2,7 +2,8 @@
"extends": "./tsconfig.alias.json",
"compilerOptions": {
"lib": ["ESNext"],
- "types": [],
+ "types": ["@girs/gtk-3.0"],
+ "typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"strict": true,
@@ -11,7 +12,6 @@
"noImplicitThis": true,
"alwaysStrict": true,
},
- "include": ["@types/gjs.d.ts"],
"files": [
"main.ts",
]
diff --git a/examples/gjs/gtk-3-editor/main.ts b/examples/gjs/gtk-3-editor/main.ts
index db7b92248..524528ddb 100644
--- a/examples/gjs/gtk-3-editor/main.ts
+++ b/examples/gjs/gtk-3-editor/main.ts
@@ -1,6 +1,7 @@
-import imports from './@types/gjs.js'
-import * as Gtk from './@types/gtk-3.0'
-import * as GtkSource from './@types/gtksource-3.0'
+///
+
+import Gtk from './@types/gtk-3.0/gtk-3.0'
+import GtkSource from './@types/gtksource-3.0/gtksource-3.0'
const { gettext } = imports;
Gtk.init(null)
diff --git a/examples/gjs/gtk-3-editor/package.json b/examples/gjs/gtk-3-editor/package.json
index 2a0961211..f7f53f159 100644
--- a/examples/gjs/gtk-3-editor/package.json
+++ b/examples/gjs/gtk-3-editor/package.json
@@ -7,7 +7,7 @@
"scripts": {
"build": "yarn build:types && yarn build:app",
"build:app": "yarn clear:app && webpack --env production",
- "build:types": "yarn ts-for-gir generate Gtk-3.0 GtkSource-3.0 --noNamespace",
+ "build:types": "yarn ts-for-gir generate Gtk-3.0 GtkSource-3.0 --noNamespace --outdir=@types",
"clear:types": "rm -rf ./@types",
"clear:app": "rm -rf ./dist",
"clear": "yarn clear:app && yarn clear:types",
diff --git a/examples/gjs/gtk-3-editor/tsconfig.json b/examples/gjs/gtk-3-editor/tsconfig.json
index 172ffaef9..7d9647262 100644
--- a/examples/gjs/gtk-3-editor/tsconfig.json
+++ b/examples/gjs/gtk-3-editor/tsconfig.json
@@ -1,7 +1,6 @@
{
"compilerOptions": {
"lib": ["ESNext"],
- "types": [],
"target": "ESNext",
"module": "ESNext",
"strict": true,
@@ -9,6 +8,7 @@
"strictNullChecks": true,
"noImplicitThis": true,
"alwaysStrict": true,
+ "allowSyntheticDefaultImports": true,
},
"files": [
"main.ts"
diff --git a/examples/gjs/gtk-3-gettext/package.json b/examples/gjs/gtk-3-gettext/package.json
index 4047fb97e..8efacb297 100644
--- a/examples/gjs/gtk-3-gettext/package.json
+++ b/examples/gjs/gtk-3-gettext/package.json
@@ -7,7 +7,7 @@
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
- "build:types": "yarn ts-for-gir generate Gtk-3.0 --generateAlias",
+ "build:types": "yarn ts-for-gir generate Gtk-3.0 --generateAlias --outdir=@types/@girs",
"build:app": "yarn node esbuild.js",
"build": "yarn build:types && yarn build:app",
"start:app": "gjs -m dist/main.js",
diff --git a/examples/gjs/gtk-3-gettext/tsconfig.json b/examples/gjs/gtk-3-gettext/tsconfig.json
index de82d12da..b0ee3495b 100644
--- a/examples/gjs/gtk-3-gettext/tsconfig.json
+++ b/examples/gjs/gtk-3-gettext/tsconfig.json
@@ -2,7 +2,8 @@
"extends": "./tsconfig.alias.json",
"compilerOptions": {
"lib": ["ESNext"],
- "types": [],
+ "types": ["@girs/gjs", "@girs/gtk-3.0"],
+ "typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"strict": true,
@@ -11,7 +12,6 @@
"noImplicitThis": true,
"alwaysStrict": true,
},
- "include": ["@types/gjs.d.ts"],
"files": [
"main.ts",
]
diff --git a/examples/gjs/gtk-3-hello-2/main.ts b/examples/gjs/gtk-3-hello-2/main.ts
index 9ffe02213..28b151039 100644
--- a/examples/gjs/gtk-3-hello-2/main.ts
+++ b/examples/gjs/gtk-3-hello-2/main.ts
@@ -3,8 +3,6 @@
// SPDX-FileCopyrightText: 2008 litl, LLC
// Based on https://gitlab.gnome.org/GNOME/gjs/-/blob/master/examples/gtk.js
-import imports from './@types/gjs.js';
-
// Include this in case both GTK3 and GTK4 installed, otherwise an exception
// will be thrown
imports.gi.versions.Gtk = '3.0';
diff --git a/examples/gjs/gtk-3-hello-2/package.json b/examples/gjs/gtk-3-hello-2/package.json
index 6bc8eb193..12279b5ca 100644
--- a/examples/gjs/gtk-3-hello-2/package.json
+++ b/examples/gjs/gtk-3-hello-2/package.json
@@ -7,7 +7,7 @@
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
- "build:types": "yarn ts-for-gir generate Gtk-3.0 --generateAlias",
+ "build:types": "yarn ts-for-gir generate Gtk-3.0 --generateAlias --outdir=@types/@girs",
"build:app": "yarn node esbuild.js",
"build": "yarn build:types && yarn build:app",
"start:app": "gjs -m dist/main.js",
diff --git a/examples/gjs/gtk-3-hello-2/tsconfig.json b/examples/gjs/gtk-3-hello-2/tsconfig.json
index 15a01fef0..b0ee3495b 100644
--- a/examples/gjs/gtk-3-hello-2/tsconfig.json
+++ b/examples/gjs/gtk-3-hello-2/tsconfig.json
@@ -2,7 +2,8 @@
"extends": "./tsconfig.alias.json",
"compilerOptions": {
"lib": ["ESNext"],
- "types": [],
+ "types": ["@girs/gjs", "@girs/gtk-3.0"],
+ "typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"strict": true,
@@ -11,7 +12,6 @@
"noImplicitThis": true,
"alwaysStrict": true,
},
- "include": ["@types/gjs.d.ts", "@types/gtk-3.0.d.ts"],
"files": [
"main.ts",
]
diff --git a/examples/gjs/gtk-3-hello/main.ts b/examples/gjs/gtk-3-hello/main.ts
index c30421a12..d14071cc1 100644
--- a/examples/gjs/gtk-3-hello/main.ts
+++ b/examples/gjs/gtk-3-hello/main.ts
@@ -1,5 +1,4 @@
-import './@types/gjs.js'
-import * as Gtk from './@types/gtk-3.0.js'
+import Gtk from './@types/gtk-3.0/gtk-3.0'
Gtk.init(null)
diff --git a/examples/gjs/gtk-3-hello/package.json b/examples/gjs/gtk-3-hello/package.json
index 48e2d2a9f..ccb84a5be 100644
--- a/examples/gjs/gtk-3-hello/package.json
+++ b/examples/gjs/gtk-3-hello/package.json
@@ -4,10 +4,11 @@
"description": "",
"main": "main.ts",
"private": true,
+ "type": "module",
"scripts": {
"build": "yarn build:types && yarn build:app",
"build:app": "yarn clear:app && webpack --env production",
- "build:types": "yarn ts-for-gir generate Gtk-3.0 GtkSource-3.0 --noNamespace",
+ "build:types": "yarn ts-for-gir generate Gtk-3.0 GtkSource-3.0 --noNamespace --outdir=@types",
"clear:types": "rm -rf ./@types",
"clear:app": "rm -rf ./dist",
"clear": "yarn clear:app && yarn clear:types",
diff --git a/examples/gjs/gtk-3-hello/tsconfig.json b/examples/gjs/gtk-3-hello/tsconfig.json
index 172ffaef9..a675b7a7d 100644
--- a/examples/gjs/gtk-3-hello/tsconfig.json
+++ b/examples/gjs/gtk-3-hello/tsconfig.json
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"lib": ["ESNext"],
- "types": [],
+ "types": ["@girs/gjs"],
+ "typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"strict": true,
@@ -9,6 +10,7 @@
"strictNullChecks": true,
"noImplicitThis": true,
"alwaysStrict": true,
+ "allowSyntheticDefaultImports": true,
},
"files": [
"main.ts"
diff --git a/examples/gjs/gtk-3-hello/webpack.config.js b/examples/gjs/gtk-3-hello/webpack.config.cjs
similarity index 100%
rename from examples/gjs/gtk-3-hello/webpack.config.js
rename to examples/gjs/gtk-3-hello/webpack.config.cjs
diff --git a/examples/gjs/gtk-3-template/package.json b/examples/gjs/gtk-3-template/package.json
index 037c24fda..71d422de0 100644
--- a/examples/gjs/gtk-3-template/package.json
+++ b/examples/gjs/gtk-3-template/package.json
@@ -7,7 +7,7 @@
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
- "build:types": "yarn ts-for-gir generate Gtk-3.0 --generateAlias",
+ "build:types": "yarn ts-for-gir generate Gtk-3.0 --generateAlias --outdir=@types/@girs",
"build:app": "yarn node esbuild.js",
"build": "yarn build:types && yarn build:app",
"start:app": "gjs -m dist/main.js",
diff --git a/examples/gjs/gtk-3-template/tsconfig.json b/examples/gjs/gtk-3-template/tsconfig.json
index de82d12da..b0ee3495b 100644
--- a/examples/gjs/gtk-3-template/tsconfig.json
+++ b/examples/gjs/gtk-3-template/tsconfig.json
@@ -2,7 +2,8 @@
"extends": "./tsconfig.alias.json",
"compilerOptions": {
"lib": ["ESNext"],
- "types": [],
+ "types": ["@girs/gjs", "@girs/gtk-3.0"],
+ "typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"strict": true,
@@ -11,7 +12,6 @@
"noImplicitThis": true,
"alwaysStrict": true,
},
- "include": ["@types/gjs.d.ts"],
"files": [
"main.ts",
]
diff --git a/examples/gjs/gtk-3-webkit/main.ts b/examples/gjs/gtk-3-webkit/main.ts
index 1c1df2d93..7cbf19e91 100644
--- a/examples/gjs/gtk-3-webkit/main.ts
+++ b/examples/gjs/gtk-3-webkit/main.ts
@@ -3,7 +3,6 @@
// SPDX-FileCopyrightText: 2008 litl, LLC
// Based on https://gitlab.gnome.org/GNOME/gjs/-/blob/master/examples/webkit.js
-import './@types/gjs.js';
import Gtk from 'gi://Gtk?version=3.0';
import WebKit from 'gi://WebKit2?version=4.0';
diff --git a/examples/gjs/gtk-3-webkit/package.json b/examples/gjs/gtk-3-webkit/package.json
index d9009f8a4..23ed89d54 100644
--- a/examples/gjs/gtk-3-webkit/package.json
+++ b/examples/gjs/gtk-3-webkit/package.json
@@ -7,7 +7,7 @@
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
- "build:types": "yarn ts-for-gir generate WebKit2-4.0 --generateAlias",
+ "build:types": "yarn ts-for-gir generate WebKit2-4.0 --generateAlias --outdir=@types/@girs",
"build:app": "yarn node esbuild.js",
"build": "yarn build:types && yarn build:app",
"start:app": "gjs -m dist/main.js",
diff --git a/examples/gjs/gtk-3-webkit/tsconfig.json b/examples/gjs/gtk-3-webkit/tsconfig.json
index de82d12da..b0ee3495b 100644
--- a/examples/gjs/gtk-3-webkit/tsconfig.json
+++ b/examples/gjs/gtk-3-webkit/tsconfig.json
@@ -2,7 +2,8 @@
"extends": "./tsconfig.alias.json",
"compilerOptions": {
"lib": ["ESNext"],
- "types": [],
+ "types": ["@girs/gjs", "@girs/gtk-3.0"],
+ "typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"strict": true,
@@ -11,7 +12,6 @@
"noImplicitThis": true,
"alwaysStrict": true,
},
- "include": ["@types/gjs.d.ts"],
"files": [
"main.ts",
]
diff --git a/examples/gjs/gtk-4-application/package.json b/examples/gjs/gtk-4-application/package.json
index 7a61ef3d2..fcba8b643 100644
--- a/examples/gjs/gtk-4-application/package.json
+++ b/examples/gjs/gtk-4-application/package.json
@@ -7,7 +7,7 @@
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
- "build:types": "yarn ts-for-gir generate Gtk-4.0 --generateAlias",
+ "build:types": "yarn ts-for-gir generate Gtk-4.0 --generateAlias --outdir=@types/@girs",
"build:app": "yarn node esbuild.js",
"build": "yarn build:types && yarn build:app",
"start:app": "gjs -m dist/main.js",
diff --git a/examples/gjs/gtk-4-application/tsconfig.json b/examples/gjs/gtk-4-application/tsconfig.json
index 18c6dbf89..fc0dbc315 100644
--- a/examples/gjs/gtk-4-application/tsconfig.json
+++ b/examples/gjs/gtk-4-application/tsconfig.json
@@ -2,7 +2,8 @@
"extends": "./tsconfig.alias.json",
"compilerOptions": {
"lib": ["ESNext"],
- "types": [],
+ "types": ["@girs/gjs", "@girs/gtk-4.0"],
+ "typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"strict": true,
@@ -11,7 +12,6 @@
"noImplicitThis": true,
"alwaysStrict": true,
},
- "include": ["@types/gjs.d.ts", "@types/ambient.d.ts", "@types/gio-2.0.d.ts", "@types/glib-2.0.d.ts", "@types/gtk-3.0.d.ts"],
"files": [
"main.ts",
]
diff --git a/examples/gjs/gtk-4-custom-widget/package.json b/examples/gjs/gtk-4-custom-widget/package.json
index 01777cc62..b7cd1bf03 100644
--- a/examples/gjs/gtk-4-custom-widget/package.json
+++ b/examples/gjs/gtk-4-custom-widget/package.json
@@ -7,7 +7,7 @@
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
- "build:types": "yarn ts-for-gir generate Gtk-4.0 Gdk-4.0 Graphene-1.0 --generateAlias",
+ "build:types": "yarn ts-for-gir generate Gtk-4.0 Gdk-4.0 Graphene-1.0 --generateAlias --outdir=@types/@girs",
"build:app": "yarn node esbuild.js",
"build": "yarn build:types && yarn build:app",
"start:app": "gjs -m dist/index.js",
diff --git a/examples/gjs/gtk-4-custom-widget/tsconfig.json b/examples/gjs/gtk-4-custom-widget/tsconfig.json
index f6ed449e8..91479c666 100644
--- a/examples/gjs/gtk-4-custom-widget/tsconfig.json
+++ b/examples/gjs/gtk-4-custom-widget/tsconfig.json
@@ -2,7 +2,8 @@
"extends": "./tsconfig.alias.json",
"compilerOptions": {
"lib": ["ESNext"],
- "types": [],
+ "types": ["@girs/gjs", "@girs/gjs/dom", "@girs/gtk-4.0"],
+ "typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"strict": true,
@@ -12,7 +13,6 @@
"alwaysStrict": true,
"moduleResolution":"Bundler"
},
- "include": ["@types/gjs.d.ts", "@types/dom.d.ts"],
"files": [
"index.ts"
]
diff --git a/examples/gjs/gtk-4-list-store/main.ts b/examples/gjs/gtk-4-list-store/main.ts
index 2b70991f4..8b755210c 100644
--- a/examples/gjs/gtk-4-list-store/main.ts
+++ b/examples/gjs/gtk-4-list-store/main.ts
@@ -4,7 +4,6 @@
* @source https://github.com/optimisme/gjs-examples/blob/master/egList.js
*/
-import imports from './@types/gjs.js'
import GObject from 'gi://GObject?version=2.0';
import GLib from 'gi://GLib?version=2.0';
import Gtk from 'gi://Gtk?version=4.0';
diff --git a/examples/gjs/gtk-4-list-store/package.json b/examples/gjs/gtk-4-list-store/package.json
index 5e9e59260..e82db381d 100644
--- a/examples/gjs/gtk-4-list-store/package.json
+++ b/examples/gjs/gtk-4-list-store/package.json
@@ -7,7 +7,7 @@
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
- "build:types": "yarn ts-for-gir generate Gtk-4.0 --generateAlias",
+ "build:types": "yarn ts-for-gir generate Gtk-4.0 --generateAlias --outdir=@types/@girs",
"build:app": "yarn node esbuild.js",
"build": "yarn build:types && yarn build:app",
"start:app": "gjs -m dist/main.js",
diff --git a/examples/gjs/gtk-4-list-store/tsconfig.json b/examples/gjs/gtk-4-list-store/tsconfig.json
index 27740af42..5adf3ada1 100644
--- a/examples/gjs/gtk-4-list-store/tsconfig.json
+++ b/examples/gjs/gtk-4-list-store/tsconfig.json
@@ -2,7 +2,8 @@
"extends": "./tsconfig.alias.json",
"compilerOptions": {
"lib": ["ESNext"],
- "types": [],
+ "types": ["@girs/gjs", "@girs/gjs/dom", "@girs/gtk-4.0"],
+ "typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"strict": true,
@@ -11,7 +12,6 @@
"noImplicitThis": true,
"alwaysStrict": true,
},
- "include": ["@types/gjs.d.ts"],
"files": [
"main.ts",
]
diff --git a/examples/gjs/gtk-4-template/package.json b/examples/gjs/gtk-4-template/package.json
index 89ea3d24d..f5e5df591 100644
--- a/examples/gjs/gtk-4-template/package.json
+++ b/examples/gjs/gtk-4-template/package.json
@@ -7,7 +7,7 @@
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
- "build:types": "yarn ts-for-gir generate Gtk-4.0 --generateAlias",
+ "build:types": "yarn ts-for-gir generate Gtk-4.0 --generateAlias --outdir=@types/@girs",
"build:app": "yarn node esbuild.js",
"build": "yarn build:types && yarn build:app",
"start:app": "gjs -m dist/main.js",
diff --git a/examples/gjs/gtk-4-template/tsconfig.json b/examples/gjs/gtk-4-template/tsconfig.json
index de82d12da..8c7edc4a3 100644
--- a/examples/gjs/gtk-4-template/tsconfig.json
+++ b/examples/gjs/gtk-4-template/tsconfig.json
@@ -2,7 +2,8 @@
"extends": "./tsconfig.alias.json",
"compilerOptions": {
"lib": ["ESNext"],
- "types": [],
+ "types": ["@girs/gjs", "@girs/gjs/dom", "@girs/gtk-4.0"],
+ "typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"strict": true,
@@ -11,7 +12,6 @@
"noImplicitThis": true,
"alwaysStrict": true,
},
- "include": ["@types/gjs.d.ts"],
"files": [
"main.ts",
]
diff --git a/examples/gjs/run-async/.gitignore b/examples/gjs/run-async/.gitignore
deleted file mode 100644
index 1345bf22e..000000000
--- a/examples/gjs/run-async/.gitignore
+++ /dev/null
@@ -1,18 +0,0 @@
-# Yarn https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
-.pnp.*
-.yarn/*
-!.yarn/patches
-!.yarn/plugins
-!.yarn/releases
-!.yarn/sdks
-!.yarn/versions
-
-!@types/
-@types/gio-2.0/*
-!@types/gio-2.0/package.json
-@types/gjs/*
-!@types/gjs/package.json
-@types/glib-2.0/*
-!@types/glib-2.0/package.json
-@types/gobject-2.0/*
-!@types/gobject-2.0/package.json
\ No newline at end of file
diff --git a/examples/gjs/run-async/.ts-for-girrc.json b/examples/gjs/run-async/.ts-for-girrc.json
index 21688bbbd..2e9ed5ccb 100644
--- a/examples/gjs/run-async/.ts-for-girrc.json
+++ b/examples/gjs/run-async/.ts-for-girrc.json
@@ -1,6 +1,6 @@
{
"modules": ["Gio-2.0"],
"noNamespace": false,
- "outdir": "./@types",
+ "outdir": "./@types/@girs",
"generateAlias": true
}
\ No newline at end of file
diff --git a/examples/gjs/run-async/@types/gio-2.0/package.json b/examples/gjs/run-async/@types/gio-2.0/package.json
index 9d3829af1..97c99130d 100644
--- a/examples/gjs/run-async/@types/gio-2.0/package.json
+++ b/examples/gjs/run-async/@types/gio-2.0/package.json
@@ -23,7 +23,7 @@
"test": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit gio-2.0.d.ts"
},
"dependencies": {
- "@girs/gjs": "4.0.0", "@girs/gobject-2.0": "*", "@girs/glib-2.0": "*"
+ "@girs/gjs": "4.0.0"
},
"devDependencies": {
"typescript": "*"
diff --git a/examples/gjs/run-async/@types/glib-2.0/package.json b/examples/gjs/run-async/@types/glib-2.0/package.json
index 557547023..e2383d7c8 100644
--- a/examples/gjs/run-async/@types/glib-2.0/package.json
+++ b/examples/gjs/run-async/@types/glib-2.0/package.json
@@ -23,7 +23,7 @@
"test": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit glib-2.0.d.ts"
},
"dependencies": {
- "@girs/gjs": "4.0.0", "@girs/gobject-2.0": "*"
+ "@girs/gjs": "4.0.0"
},
"devDependencies": {
"typescript": "*"
diff --git a/examples/gjs/run-async/@types/gobject-2.0/package.json b/examples/gjs/run-async/@types/gobject-2.0/package.json
index 2db9df9c1..045d8bea8 100644
--- a/examples/gjs/run-async/@types/gobject-2.0/package.json
+++ b/examples/gjs/run-async/@types/gobject-2.0/package.json
@@ -23,7 +23,7 @@
"test": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit gobject-2.0.d.ts"
},
"dependencies": {
- "@girs/gjs": "4.0.0", "@girs/glib-2.0": "*"
+ "@girs/gjs": "4.0.0"
},
"devDependencies": {
"typescript": "*"
diff --git a/examples/gjs/run-async/main.ts b/examples/gjs/run-async/main.ts
index 77b1c9132..fd88ca9f4 100644
--- a/examples/gjs/run-async/main.ts
+++ b/examples/gjs/run-async/main.ts
@@ -8,10 +8,6 @@
* the label should show a translation of 'Print help'
*/
-import './@types/gjs/gjs';
-import './@types/gjs/dom';
-import './@types/gio-2.0';
-
// import Adw from "gi://Adw";
// import GLib from "gi://GLib";
import Gio from "gi://Gio";
diff --git a/examples/gjs/run-async/tsconfig.json b/examples/gjs/run-async/tsconfig.json
index 8c0958ff2..86edbe188 100644
--- a/examples/gjs/run-async/tsconfig.json
+++ b/examples/gjs/run-async/tsconfig.json
@@ -3,17 +3,15 @@
"compilerOptions": {
"baseUrl": ".",
"lib": ["ESNext"],
- "types": [],
+ "types": ["@girs/gjs", "@girs/gio-2.0"],
+ "typeRoots": [
+ "./@types"
+ ],
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
"noImplicitAny": true,
- "paths": {
- // Simulate the node_modules packaging...
- "@girs/*": ["./@types/*"]
- }
},
- "include": ["./@types"],
"files": [
"main.ts",
]
diff --git a/examples/gjs/soup-3-http/package.json b/examples/gjs/soup-3-http/package.json
index 02f1e7772..df0f752f6 100644
--- a/examples/gjs/soup-3-http/package.json
+++ b/examples/gjs/soup-3-http/package.json
@@ -7,7 +7,7 @@
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
- "build:types": "yarn ts-for-gir generate Soup-3.0 --generateAlias",
+ "build:types": "yarn ts-for-gir generate Soup-3.0 --generateAlias --outdir=@types/@girs",
"build:app": "yarn node esbuild.js",
"build": "yarn build:types && yarn build:app",
"start:server": "gjs -m dist/http-server.js",
diff --git a/examples/gjs/soup-3-http/tsconfig.json b/examples/gjs/soup-3-http/tsconfig.json
index 516172fba..e8f6ea75e 100644
--- a/examples/gjs/soup-3-http/tsconfig.json
+++ b/examples/gjs/soup-3-http/tsconfig.json
@@ -2,7 +2,8 @@
"extends": "./tsconfig.alias.json",
"compilerOptions": {
"lib": ["ESNext"],
- "types": [],
+ "types": ["@girs/gjs", "@girs/gjs/dom", "@girs/soup-3.0"],
+ "typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Bundler",
@@ -14,7 +15,6 @@
"noImplicitThis": true,
"alwaysStrict": true,
},
- "include": ["@types/gjs.d.ts", "@types/dom.d.ts"],
"files": [
"http-client.ts",
"http-server.ts"
diff --git a/examples/gjs/soup-3-websocket/client.ts b/examples/gjs/soup-3-websocket/client.ts
index d78b8a89a..defc57374 100644
--- a/examples/gjs/soup-3-websocket/client.ts
+++ b/examples/gjs/soup-3-websocket/client.ts
@@ -7,7 +7,6 @@
// Based on https://gitlab.gnome.org/GNOME/gjs/-/blob/master/examples/websocket-client.js
-import imports from './@types/gjs.js';
import GLib from 'gi://GLib?version=2.0';
import Soup from 'gi://Soup?version=3.0';
import Gio from 'gi://Gio?version=2.0';
diff --git a/examples/gjs/soup-3-websocket/package.json b/examples/gjs/soup-3-websocket/package.json
index a62e942ee..e1db696f9 100644
--- a/examples/gjs/soup-3-websocket/package.json
+++ b/examples/gjs/soup-3-websocket/package.json
@@ -7,7 +7,7 @@
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
- "build:types": "yarn ts-for-gir generate Soup-3.0 --generateAlias",
+ "build:types": "yarn ts-for-gir generate Soup-3.0 --generateAlias --outdir=@types/@girs",
"build:client": "yarn node esbuild.js",
"build": "yarn build:types && yarn build:client",
"start:client": "gjs -m dist/main.js",
diff --git a/examples/gjs/soup-3-websocket/tsconfig.json b/examples/gjs/soup-3-websocket/tsconfig.json
index c48863475..a5160232f 100644
--- a/examples/gjs/soup-3-websocket/tsconfig.json
+++ b/examples/gjs/soup-3-websocket/tsconfig.json
@@ -2,7 +2,8 @@
"extends": "./tsconfig.alias.json",
"compilerOptions": {
"lib": ["ESNext"],
- "types": [],
+ "types": ["@girs/gjs", "@girs/gjs/dom", "@girs/soup-3.0"],
+ "typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"strict": true,
@@ -11,7 +12,6 @@
"noImplicitThis": true,
"alwaysStrict": true,
},
- "include": ["@types/gjs.d.ts", "@types/dom.d.ts"],
"files": [
"client.ts",
]
diff --git a/examples/gjs/timers/package.json b/examples/gjs/timers/package.json
index 6cc30535f..94988e926 100644
--- a/examples/gjs/timers/package.json
+++ b/examples/gjs/timers/package.json
@@ -7,7 +7,7 @@
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
- "build:types": "yarn ts-for-gir generate Gtk-4.0 --noNamespace",
+ "build:types": "yarn ts-for-gir generate Gtk-4.0 --noNamespace --outdir=@types/@girs",
"build:app": "yarn node esbuild.js",
"build": "yarn build:types && yarn build:app",
"start:app": "gjs dist/main.js",
diff --git a/examples/gjs/timers/tsconfig.json b/examples/gjs/timers/tsconfig.json
index 4c0e84e16..1c2bfe364 100644
--- a/examples/gjs/timers/tsconfig.json
+++ b/examples/gjs/timers/tsconfig.json
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"lib": ["ESNext"],
- "types": [],
+ "types": ["@girs/gjs", "@girs/gjs/dom"],
+ "typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"strict": true,
@@ -10,7 +11,6 @@
"noImplicitThis": true,
"alwaysStrict": true,
},
- "include": ["@types/gjs.d.ts", "@types/dom.d.ts"],
"files": [
"main.ts",
]
diff --git a/examples/node-gtk/gtk-4-application/esbuild.mjs b/examples/node-gtk/gtk-4-application/esbuild.mjs
deleted file mode 100644
index 48d5cbca5..000000000
--- a/examples/node-gtk/gtk-4-application/esbuild.mjs
+++ /dev/null
@@ -1,14 +0,0 @@
-import { build } from "esbuild";
-
-await build({
- entryPoints: ['main.ts'],
- outdir: 'dist',
- bundle: true,
- // target: "firefox60", // Since GJS 1.53.90
- // target: "firefox68", // Since GJS 1.63.90
- target: "firefox78", // Since GJS 1.65.90
- // target: "firefox91", // Since GJS 1.71.1
- format: 'cjs',
- platform: 'node',
- external: ['node-gtk', 'gi://*', 'resource://*', 'gettext', 'system', 'cairo'],
-})
diff --git a/examples/node-gtk/gtk-4-application/main.ts b/examples/node-gtk/gtk-4-application/main.ts
deleted file mode 100644
index 337501deb..000000000
--- a/examples/node-gtk/gtk-4-application/main.ts
+++ /dev/null
@@ -1,71 +0,0 @@
-// Based on https://github.com/romgrk/node-gtk/blob/master/examples/gtk-4.js
-
-import gi from 'node-gtk';
-import GLib from './@types/node-glib-2.0.js';
-import Gtk from './@types/node-gtk-4.0.js';
-
-const printHello = () => console.log('Hello')
-
-const loop = GLib.MainLoop.new(null, false)
-const app = new Gtk.Application('com.github.romgrk.node-gtk.demo', 0)
-app.on('activate', onActivate)
-const status = app.run([])
-
-console.log('Finished with status:', status)
-
-function onActivate() {
- const window = new Gtk.ApplicationWindow(app)
- window.setTitle('Window')
- window.setDefaultSize(200, 200)
- window.on('close-request', onQuit)
-
- const ui = `
-
-
-
-
-
- `
-
- const builder = Gtk.Builder.newFromString(ui, ui.length)
- const root = builder.getObject('root') as Gtk.Box;
-
- const actionButton = builder.getObject('actionButton')
- actionButton?.on('clicked', printHello)
-
- const closeButton = builder.getObject('closeButton')
- closeButton?.on('clicked', () => window.close())
-
- window.setChild(root)
- window.show()
- window.present()
-
- gi.startLoop()
- loop.run()
-}
-
-function onQuit() {
- loop.quit()
- app.quit()
- return false
-}
\ No newline at end of file
diff --git a/examples/node-gtk/gtk-4-application/package.json b/examples/node-gtk/gtk-4-application/package.json
deleted file mode 100644
index a4934ab5b..000000000
--- a/examples/node-gtk/gtk-4-application/package.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "name": "ts-for-gir-node-gtk-gtk-4-application-example",
- "version": "3.2.8",
- "description": "Simple node-gtk Gtk 4 example app to demonstrate how you can use and extend Gtk.Application",
- "main": "dist/main.js",
- "private": true,
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1",
- "build:types": "yarn ts-for-gir generate Gtk-4.0 -e node",
- "build:app": "yarn node esbuild.mjs",
- "build": "yarn build:types && yarn build:app",
- "start:app": "yarn node dist/main.js",
- "debug:app": "GTK_DEBUG=interactive yarn start:app",
- "start": "yarn build && yarn start:app",
- "validate": "yarn validate:types && yarn validate:app",
- "validate:types": "tsc --project tsconfig.types.json",
- "validate:app": "tsc --noEmit",
- "clear": "rm -rf dist @types"
- },
- "author": "Pascal Garber ",
- "license": "MIT",
- "devDependencies": {
- "@ts-for-gir/cli": "workspace:^",
- "esbuild": "^0.20.0",
- "typescript": "5.2.2"
- }
-}
diff --git a/examples/node-gtk/gtk-4-application/tsconfig.json b/examples/node-gtk/gtk-4-application/tsconfig.json
deleted file mode 100644
index 0c8696d6c..000000000
--- a/examples/node-gtk/gtk-4-application/tsconfig.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "compilerOptions": {
- "lib": ["ESNext"],
- "types": ["node"],
- "target": "ESNext",
- "module": "Node16",
- "strict": true,
- "allowSyntheticDefaultImports": true,
- "esModuleInterop": true,
- "noImplicitAny": true,
- "strictNullChecks": true,
- "noImplicitThis": true,
- "alwaysStrict": true,
- "moduleResolution":"Node16",
- },
- "include": [
- "./@types/node-ambient.d.ts"
- ],
- "files": [
- "main.ts"
- ]
-}
diff --git a/examples/node-gtk/gtk-4-application/tsconfig.types.json b/examples/node-gtk/gtk-4-application/tsconfig.types.json
deleted file mode 100644
index 9f910a243..000000000
--- a/examples/node-gtk/gtk-4-application/tsconfig.types.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "extends": "./tsconfig.json",
- "compilerOptions": {
- "noEmit": true
- }
-}
diff --git a/packages/lib/src/dependency-manager.ts b/packages/lib/src/dependency-manager.ts
index 029be6218..828001d75 100644
--- a/packages/lib/src/dependency-manager.ts
+++ b/packages/lib/src/dependency-manager.ts
@@ -74,7 +74,10 @@ export class DependencyManager extends GirNSRegistry {
createImportPath(packageName: string): string {
const importName = this.transformation.transformImportName(packageName)
- const importPath = `${this.config.npmScope}/${importName}`
+ // TODO: noNamespace is currently a proxy for "no npm packaging"
+ const importPath = this.config.noNamespace
+ ? `../${importName}/${importName}`
+ : `${this.config.npmScope}/${importName}`
return importPath
}