Skip to content

Commit

Permalink
Merged gi-ts-rework and fixed conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
JumpLink committed Mar 13, 2024
2 parents b389d10 + 04a2ee3 commit d44c7d3
Show file tree
Hide file tree
Showing 101 changed files with 3,250 additions and 5,234 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ examples/
@types/
*.js
*/*.js
# ignore local test as it is a separate typescript project
local/
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ examples/**/@types/
# !@types/Gtk-2.0.d.ts
# !@types/*

.vscode

index.ts.bak

examples/**/node_modules/
Expand Down
1 change: 1 addition & 0 deletions .ts-for-gir.all.rc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export default {
girDirectories: ['./vala-girs/gir-1.0', './girs'],
ignoreVersionConflicts: true,
promisify: true,
packageYarn: true,
ignore: [
'Colorhug-1.0', // Duplicate of ColorHug-1.0
'GUPnP-DLNA-1.0', // Same namespace as GUPnP-1.0.gir, is this a bug or should we merge the type definitions?
Expand Down
92 changes: 0 additions & 92 deletions .vscode/launch.json

This file was deleted.

9 changes: 4 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,10 @@
* @see https://gitlab.gnome.org/GNOME/libadwaita/-/blob/main/examples/hello-world/hello.c
*/

import '@girs/gjs';
import Gio from '@girs/gio-2.0';
import GLib from '@girs/glib-2.0';
import Gtk from '@girs/gtk-4.0';
import Adw from '@girs/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)

Expand Down
3 changes: 3 additions & 0 deletions examples/gjs/gio-2-cat/main.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/// <reference path="./@types/gjs/gjs.d.ts" />
/// <reference path="./@types/gjs/dom.d.ts" />

// 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
Expand Down
3 changes: 2 additions & 1 deletion examples/gjs/gio-2-dbus/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"lib": ["ESNext"],
"types": [],
"types": ["@girs/gjs"],
"typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
Expand Down
6 changes: 3 additions & 3 deletions examples/gjs/gio-2-list-model/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"lib": ["ESNext"],
"types": [],
"lib": ["ESNext"],
"types": ["@girs/gjs"],
"typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
Expand All @@ -11,7 +12,6 @@
"noImplicitThis": true,
"alwaysStrict": true,
},
"include": ["@girs/gjs"],
"files": [
"main.ts",
]
Expand Down
5 changes: 1 addition & 4 deletions examples/gjs/glib-2-spawn-command/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// Example based on https://gist.github.com/buzztaiki/1487781/74ea93d3a30f20c7f094327db9cb263a6286f6d6
import '@girs/gjs';
import '@girs/gjs/dom'

import GLib from '@girs/glib-2.0';
import GLib from 'gi://GLib';
const textDecoder = new TextDecoder();

let [_res, out, _err, _status] = GLib.spawn_command_line_sync('ls -la');
Expand Down
31 changes: 15 additions & 16 deletions examples/gjs/glib-2-spawn-command/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
{
"compilerOptions": {
"lib": ["ESNext"],
"types": [],
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"noImplicitThis": true,
"alwaysStrict": true,
},
"include": ["@girs/gjs", "@girs/gjs/dom", "@girs/gjs/ambient"],
"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"]
}
4 changes: 2 additions & 2 deletions examples/gjs/glib-2-variant/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"lib": ["ESNext"],
"types": [],
"types": ["@girs/gjs", "@girs/glib-2.0"],
"typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
Expand All @@ -11,7 +12,6 @@
"noImplicitThis": true,
"alwaysStrict": true,
},
"include": ["@girs/gjs"],
"files": [
"index.ts"
]
Expand Down
4 changes: 2 additions & 2 deletions examples/gjs/gtk-3-browser/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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",
"moduleResolution": "bundler",
Expand All @@ -11,7 +12,6 @@
"noImplicitThis": true,
"alwaysStrict": true,
},

"files": [
"main.ts"
]
Expand Down
6 changes: 4 additions & 2 deletions examples/gjs/gtk-3-builder/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"lib": ["ESNext"],
"types": [],
"typeRoots": ["./@types"],
"types": ["@girs/gjs"],
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
Expand All @@ -10,8 +11,9 @@
"strictNullChecks": true,
"noImplicitThis": true,
"alwaysStrict": true,
"allowSyntheticDefaultImports": true,
},
"include": ["global.d.ts", "@girs/gjs", "@girs/gjs/ambient"],
"include": ["global.d.ts"],
"files": [
"main.ts"
]
Expand Down
4 changes: 2 additions & 2 deletions examples/gjs/gtk-3-calc/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"lib": ["ESNext"],
"types": [],
"types": ["@girs/gtk-3.0"],
"typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
Expand All @@ -11,7 +12,6 @@
"noImplicitThis": true,
"alwaysStrict": true,
},
"include": [],
"files": [
"main.ts",
]
Expand Down
2 changes: 1 addition & 1 deletion examples/gjs/gtk-3-editor/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"compilerOptions": {
"lib": ["ESNext"],
"types": [],
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
Expand All @@ -10,6 +9,7 @@
"strictNullChecks": true,
"noImplicitThis": true,
"alwaysStrict": true,
"allowSyntheticDefaultImports": true,
},
"files": [
"main.ts"
Expand Down
4 changes: 2 additions & 2 deletions examples/gjs/gtk-3-gettext/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"lib": ["ESNext"],
"types": [],
"types": ["@girs/gjs", "@girs/gtk-3.0"],
"typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
Expand All @@ -11,7 +12,6 @@
"noImplicitThis": true,
"alwaysStrict": true,
},
"include": [],
"files": [
"main.ts",
]
Expand Down
3 changes: 0 additions & 3 deletions examples/gjs/gtk-3-hello-2/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
// SPDX-FileCopyrightText: 2008 litl, LLC
// Based on https://gitlab.gnome.org/GNOME/gjs/-/blob/master/examples/gtk.js

import imports from '@girs/gjs';
import '@girs/gtk-3.0'

// Include this in case both GTK3 and GTK4 installed, otherwise an exception
// will be thrown
imports.gi.versions.Gtk = '3.0';
Expand Down
4 changes: 2 additions & 2 deletions examples/gjs/gtk-3-hello-2/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"lib": ["ESNext"],
"types": [],
"types": ["@girs/gjs", "@girs/gtk-3.0"],
"typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
Expand All @@ -11,7 +12,6 @@
"noImplicitThis": true,
"alwaysStrict": true,
},
"include": [],
"files": [
"main.ts",
]
Expand Down
1 change: 1 addition & 0 deletions examples/gjs/gtk-3-hello/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "",
"main": "main.ts",
"private": true,
"type": "module",
"scripts": {
"build": "yarn build:app",
"build:app": "yarn clear:app && webpack --env production",
Expand Down
4 changes: 3 additions & 1 deletion examples/gjs/gtk-3-hello/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"lib": ["ESNext"],
"types": [],
"types": ["@girs/gjs"],
"typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
Expand All @@ -10,6 +11,7 @@
"strictNullChecks": true,
"noImplicitThis": true,
"alwaysStrict": true,
"allowSyntheticDefaultImports": true,
},
"files": [
"main.ts"
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions examples/gjs/gtk-3-template/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"lib": ["ESNext"],
"types": [],
"types": ["@girs/gjs", "@girs/gtk-3.0"],
"typeRoots": ["./@types"],
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
Expand All @@ -11,7 +12,6 @@
"noImplicitThis": true,
"alwaysStrict": true,
},
"include": [],
"files": [
"main.ts",
]
Expand Down
Loading

0 comments on commit d44c7d3

Please sign in to comment.