Skip to content

Commit

Permalink
chore: Upgrade dependencies and submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
JumpLink committed Nov 2, 2023
2 parents 2bd12f3 + 094097b commit 47ca384
Show file tree
Hide file tree
Showing 12 changed files with 8,684 additions and 881 deletions.
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

# 3.2.2
- Upgrade dependencies

- Upgrade gir files

# 3.2.1
- TypeDoc: Only include main entry point
- Upgrade dependencies
Expand Down
2 changes: 1 addition & 1 deletion examples/gjs/adw-1-hello/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@babel/core": "^7.23.2",
"@rollup/plugin-babel": "^6.0.4",
"@ts-for-gir/cli": "workspace:^",
"rollup": "^3.29.4",
"rollup": "^4.2.0",
"typescript": "^5.2.2",
"vite": "^4.5.0"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/gjs/gtk-4-custom-widget/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"strictNullChecks": true,
"noImplicitThis": true,
"alwaysStrict": true,
"moduleResolution":"Node16"
"moduleResolution":"Bundler"
},
"include": ["@types/gjs.d.ts", "@types/dom.d.ts"],
"files": [
Expand Down
2 changes: 1 addition & 1 deletion examples/node-gtk/gtk-4-custom-widget/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"lib": ["ESNext"],
"types": ["node"],
"target": "ESNext",
"module": "ESNext",
"module": "Node16",
"strict": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
Expand Down
8 changes: 6 additions & 2 deletions examples/node-gtk/soup-3-http/http-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,25 @@
// https://developer.gnome.org/libsoup/stable/libsoup-client-howto.html
// https://gitlab.gnome.org/GNOME/gjs/-/blob/master/examples/http-client.js

import './@types/node-gtk.js';
// TODO callbacks not working in node-gtk?

import gi from './@types/node-gtk.js';
import GLib from './@types/node-glib-2.0.js';
import Soup from './@types/node-soup-3.0.js';
import Gio from './@types/node-gio-2.0.js';

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

gi.startLoop();

const gBytesToString = (data: GLib.Bytes) => {
return Buffer.from(data.getData() || []).toString()
}

const session = new Soup.Session();
const message = new Soup.Message({
method: 'GET',
uri: GLib.Uri.parse('http://localhost:1080/hello?myname=gjs', GLib.UriFlags.NONE),
uri: GLib.Uri.parse('http://localhost:1080/hello?myname=node-gtk', GLib.UriFlags.NONE),
});

const readBytesAsyncCallback: Gio.AsyncReadyCallback = (inputStream, res) => {
Expand Down
12 changes: 8 additions & 4 deletions examples/node-gtk/soup-3-http/http-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
// This is a simple example of a HTTP server in Gjs using libsoup 3
// https://gitlab.gnome.org/GNOME/gjs/-/blob/master/examples/http-server.js

import './@types/node-gtk.js';
// TODO callbacks not working in node-gtk?

import gi from './@types/node-gtk.js';
import GLib from './@types/node-glib-2.0.js';
import Soup from './@types/node-soup-3.0.js';

Expand All @@ -15,6 +17,8 @@ interface GjsHashTable {
[key: symbol | string | number]: string | number | boolean;
}

gi.startLoop();

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

const handler: Soup.ServerCallback = (server, msg, path, query) => {
Expand All @@ -32,7 +36,7 @@ const handler: Soup.ServerCallback = (server, msg, path, query) => {
</html>
`);

msg.setResponse('text/html; charset=utf-8', Soup.MemoryUse.COPY, body)
msg.setResponse('text/html; charset=utf-8', Soup.MemoryUse.COPY, [...body])
}

const helloHandler: Soup.ServerCallback = (server, msg, path, query) => {
Expand All @@ -54,7 +58,7 @@ const helloHandler: Soup.ServerCallback = (server, msg, path, query) => {
</html>
`);

msg.setResponse('text/html; charset=utf-8', Soup.MemoryUse.COPY, body)
msg.setResponse('text/html; charset=utf-8', Soup.MemoryUse.COPY, [...body])
}

function main() {
Expand All @@ -66,4 +70,4 @@ function main() {
loop.run();
}

main();
main();
2 changes: 1 addition & 1 deletion examples/node-gtk/soup-3-http/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"lib": ["ESNext"],
"types": ["node"],
"target": "ESNext",
"module": "ESNext",
"module": "Node16",
"strict": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"build:generator-base": "yarn workspace @ts-for-gir/generator-base run build",
"build:generator-typescript": "yarn workspace @ts-for-gir/generator-typescript run build",
"build:generator-html-doc": "yarn workspace @ts-for-gir/generator-html-doc run build",
"build:examples": "yarn workspaces foreach -v --exclude '@ts-for-gir/*' --parallel run build",
"build:examples": "yarn workspaces foreach -v --all --exclude '@ts-for-gir/*' --parallel run build",
"build:all": "yarn build && yarn build:examples",
"start:cli-examples:all": "yarn start:cli-examples:gjs && yarn start:cli-examples:node",
"start:cli-examples:gjs": "yarn workspace ts-for-gir-glib-2-spawn-command-example run start && yarn workspace ts-for-gir-gio-2-cat-promisify-packages run start",
Expand Down Expand Up @@ -94,9 +94,9 @@
"build:types:node:timezonemap1": "yarn build:types:timezonemap1 --environments=node --noNamespace --moduleType=cjs",
"build:types:node:rygelcore2": "yarn build:types:rygelcore2 --environments=node --noNamespace --moduleType=cjs",
"build:types:node:gcalc": "yarn build:types:gcalc --environments=node --noNamespace --moduleType=cjs",
"validate": "yarn workspaces foreach -v --parallel run validate",
"validate:types": "yarn workspaces foreach -v --parallel run validate:types",
"validate:examples": "yarn workspaces foreach -v --parallel run validate:app",
"validate": "yarn workspaces foreach -v --all --parallel run validate",
"validate:types": "yarn workspaces foreach -v --all --parallel run validate:types",
"validate:examples": "yarn workspaces foreach -v --all --parallel run validate:app",
"validate:types:all": "yarn validate:types:gjs && yarn validate:types:node",
"validate:types:gjs": "NODE_OPTIONS=--max_old_space_size=9216 tsc --project tsconfig.json",
"validate:types:node": "NODE_OPTIONS=--max_old_space_size=9216 tsc --project tsconfig.node.json",
Expand All @@ -105,7 +105,7 @@
"clear:types": "rimraf ./@types",
"clear:types:gjs": "rimraf ./@types",
"clear:types:node": "rimraf ./@types",
"clear:examples": "yarn workspaces foreach -v --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: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",
"watch": "concurrently 'yarn:watch:*'",
"watch:cli": "yarn workspace @ts-for-gir/cli run watch",
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@
"colorette": "^2.0.20",
"ejs": "^3.1.9",
"lodash": "^4.17.21",
"xml2js": "0.5.0"
"xml2js": "0.6.2"
}
}
2 changes: 1 addition & 1 deletion packages/lib/src/gir-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ export class GirModule {
arrayType = typeArray[0]
}

if (isArray && arrayType?.$?.name && ARRAY_TYPE_MAP[arrayType.$.name]) {
if (this.config.environment == 'gjs' && isArray && arrayType?.$?.name && ARRAY_TYPE_MAP[arrayType.$.name]) {
isArray = false
overrideTypeName = ARRAY_TYPE_MAP[arrayType.$.name] as string | undefined
}
Expand Down
2 changes: 1 addition & 1 deletion types
Submodule types updated 550 files
Loading

0 comments on commit 47ca384

Please sign in to comment.