Skip to content

Commit

Permalink
Examples: Fix some global type settings
Browse files Browse the repository at this point in the history
  • Loading branch information
JumpLink committed Mar 13, 2024
1 parent c539a67 commit 4efbf7a
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 13 deletions.
1 change: 1 addition & 0 deletions examples/gjs/gio-2-dbus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"typescript": "^5.4.2"
},
"dependencies": {
"@girs/gio-2.0": "workspace:^",
"@girs/gjs": "workspace:^"
}
}
2 changes: 1 addition & 1 deletion examples/gjs/gio-2-dbus/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"lib": ["ESNext"],
"types": ["@girs/gjs"],
"types": ["@girs/gjs", "@girs/gio-2.0"],
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
Expand Down
3 changes: 3 additions & 0 deletions examples/gjs/gio-2-list-model/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@
"devDependencies": {
"esbuild": "^0.20.1",
"typescript": "^5.4.2"
},
"dependencies": {
"@girs/gjs": "workspace:^"
}
}
5 changes: 0 additions & 5 deletions examples/gjs/gtk-4-custom-widget/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
// This example is based on https://github.com/romgrk/node-gtk/blob/master/examples/gtk-4-custom-widget.js

import '@girs/gjs';
import '@girs/gjs/dom';
import '@girs/gio-2.0';
import '@girs/gtk-4.0';

import GObject from 'gi://GObject?version=2.0';
import GLib from 'gi://GLib?version=2.0';
import Gtk from 'gi://Gtk?version=4.0';
Expand Down
7 changes: 6 additions & 1 deletion examples/gjs/gtk-4-custom-widget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@
"typescript": "^5.4.2"
},
"dependencies": {
"@girs/freetype2-2.0": "workspace:^",
"@girs/gio-2.0": "workspace:^",
"@girs/gjs": "workspace:^",
"@girs/gtk-4.0": "workspace:^"
"@girs/glib-2.0": "workspace:^",
"@girs/gobject-2.0": "workspace:^",
"@girs/graphene-1.0": "workspace:^",
"@girs/gtk-4.0": "workspace:^",
"@girs/harfbuzz-0.0": "workspace:^"
}
}
2 changes: 1 addition & 1 deletion examples/gjs/gtk-4-custom-widget/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"lib": ["ESNext"],
"types": ["@girs/gjs", "@girs/gjs/dom", "@girs/gtk-4.0"],
"types": ["@girs/gjs", "@girs/gjs/dom", "@girs/gio-2.0", "@girs/gobject-2.0", "@girs/gtk-4.0", "@girs/graphene-1.0"],
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
Expand Down
1 change: 1 addition & 0 deletions examples/gjs/gtk-4-list-store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"dependencies": {
"@girs/gio-2.0": "workspace:^",
"@girs/gjs": "workspace:^",
"@girs/gobject-2.0": "workspace:^",
"@girs/gtk-4.0": "workspace:^"
}
}
2 changes: 1 addition & 1 deletion examples/gjs/gtk-4-list-store/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"lib": ["ESNext"],
"types": ["@girs/gjs", "@girs/gjs/dom", "@girs/gtk-4.0"],
"types": ["@girs/gjs", "@girs/gjs/dom", "@girs/gtk-4.0", "@girs/gobject-2.0", "@girs/gio-2.0"],
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
Expand Down
4 changes: 3 additions & 1 deletion examples/gjs/gtk-4-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
"dependencies": {
"@girs/gio-2.0": "workspace:^",
"@girs/gjs": "workspace:^",
"@girs/gtk-4.0": "workspace:^"
"@girs/glib-2.0": "workspace:^",
"@girs/gtk-4.0": "workspace:^",
"@girs/harfbuzz-0.0": "workspace:^"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ declare module 'gi://<%= name %>?version=<%= version %>' {
export default <%- girModule.importNamespace -%>;
}

<%# // Generate ambient module declarations Without version number if there are no conflicts or the target is an NPM package _%>
<%# // Generate ambient module declarations Without version number if this is the latest version _%>
<%_ if (dep.isLatestVersion(pkg.namespace, pkg.version)) { _%>
declare module 'gi://<%= name %>' {
export * from 'gi://<%= name %>?version=<%= version %>';
export default 'gi://<%= name %>?version=<%= version %>';
}
<%_ } _%>
2 changes: 1 addition & 1 deletion types
Submodule types updated 320 files
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6193,6 +6193,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@ts-for-gir-example/gio-2-dbus-example@workspace:examples/gjs/gio-2-dbus"
dependencies:
"@girs/gio-2.0": "workspace:^"
"@girs/gjs": "workspace:^"
esbuild: "npm:^0.20.1"
typescript: "npm:^5.4.2"
Expand All @@ -6203,6 +6204,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@ts-for-gir-example/gio-2-list-model-example@workspace:examples/gjs/gio-2-list-model"
dependencies:
"@girs/gjs": "workspace:^"
esbuild: "npm:^0.20.1"
typescript: "npm:^5.4.2"
languageName: unknown
Expand All @@ -6212,9 +6214,14 @@ __metadata:
version: 0.0.0-use.local
resolution: "@ts-for-gir-example/gjs-gtk-4-custom-widget-example@workspace:examples/gjs/gtk-4-custom-widget"
dependencies:
"@girs/freetype2-2.0": "workspace:^"
"@girs/gio-2.0": "workspace:^"
"@girs/gjs": "workspace:^"
"@girs/glib-2.0": "workspace:^"
"@girs/gobject-2.0": "workspace:^"
"@girs/graphene-1.0": "workspace:^"
"@girs/gtk-4.0": "workspace:^"
"@girs/harfbuzz-0.0": "workspace:^"
"@ts-for-gir/cli": "workspace:^"
esbuild: "npm:^0.20.1"
typescript: "npm:^5.4.2"
Expand Down Expand Up @@ -6378,6 +6385,7 @@ __metadata:
dependencies:
"@girs/gio-2.0": "workspace:^"
"@girs/gjs": "workspace:^"
"@girs/gobject-2.0": "workspace:^"
"@girs/gtk-4.0": "workspace:^"
esbuild: "npm:^0.20.1"
typescript: "npm:^5.4.2"
Expand All @@ -6390,7 +6398,9 @@ __metadata:
dependencies:
"@girs/gio-2.0": "workspace:^"
"@girs/gjs": "workspace:^"
"@girs/glib-2.0": "workspace:^"
"@girs/gtk-4.0": "workspace:^"
"@girs/harfbuzz-0.0": "workspace:^"
"@ts-for-gir/cli": "workspace:^"
esbuild: "npm:^0.20.1"
typescript: "npm:^5.4.2"
Expand Down

0 comments on commit 4efbf7a

Please sign in to comment.