Skip to content

Commit

Permalink
Port gio-2-cat and adw-1-hello examples to use local generated npm pa…
Browse files Browse the repository at this point in the history
…ckage types
  • Loading branch information
JumpLink committed Feb 27, 2024
1 parent f64b979 commit 1fdc7bd
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 515 deletions.
10 changes: 5 additions & 5 deletions examples/gjs/adw-1-hello/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* @see https://gitlab.gnome.org/GNOME/libadwaita/-/blob/main/examples/hello-world/hello.c
*/

import imports from './@types/gjs.js'
import Gio from './@types/gio-2.0.js';
import GLib from './@types/glib-2.0.js';
import Gtk from './@types/gtk-4.0.js';
import Adw from './@types/adw-1.js';
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';

const loop = GLib.MainLoop.new(null, false)

Expand Down
1 change: 1 addition & 0 deletions examples/gjs/gio-2-cat-packages/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/

import '@girs/gjs';
import '@girs/gjs/ambient';
import '@girs/gjs/dom';
import '@girs/gio-2.0';

Expand Down
4 changes: 4 additions & 0 deletions examples/gjs/gio-2-cat-packages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,9 @@
"devDependencies": {
"esbuild": "^0.20.1",
"typescript": "^5.2.2"
},
"dependencies": {
"@girs/gio-2.0": "workspace:^",
"@girs/gjs": "workspace:^"
}
}
8 changes: 4 additions & 4 deletions examples/gjs/gio-2-cat/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
* the label should show a translation of 'Print help'
*/

import './@types/gjs.js';
import './@types/dom.js';
import GLib from './@types/glib-2.0.js';
import Gio from './@types/gio-2.0.js';
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';

const loop = GLib.MainLoop.new(null, false);
const textDecoder = new TextDecoder()
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"clear:build": "yarn workspaces foreach -v --include '@ts-for-gir/*' run clear:build",
"clear:types": "rimraf ./@types",
"clear:types:local": "rimraf ./@types",
"clear:examples": "yarn workspaces foreach -v --all --exclude @ts-for-gir/cli,@ts-for-gir/lib,@ts-for-gir/generator-base,@ts-for-gir/generator-typescript,@ts-for-gir/generator-html-doc --parallel run clear",
"clear:all": "yarn build && yarn clear:examples",
"clear:examples": "yarn workspaces foreach -v --all --exclude @ts-for-gir/cli,@ts-for-gir/lib,@ts-for-gir/generator-base,@ts-for-gir/generator-typescript,@ts-for-gir/generator-html-doc,@gi.ts/parser --parallel run clear",
"clear:all": "yarn clear && yarn clear:examples",
"watch": "concurrently 'yarn:watch:*'",
"watch:cli": "yarn workspace @ts-for-gir/cli run watch",
"watch:lib": "yarn workspace @ts-for-gir/lib run watch",
Expand Down
Loading

0 comments on commit 1fdc7bd

Please sign in to comment.