Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build all types without errors + migrate to ESM + type definition improvements #44

Merged
merged 104 commits into from
Jan 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
79d9547
Improved error message if no module was found
JumpLink Oct 20, 2020
a05b22e
Merge branch 'sammydre'
JumpLink Oct 20, 2020
b3da8ef
Package.json: Own script for validation in test:girs
JumpLink Oct 20, 2020
adddb77
Merge remote-tracking branch 'realh/classmethod'
JumpLink Oct 20, 2020
f0373a8
Merge https://github.com/sammydre/ts-for-gjs
JumpLink Feb 15, 2021
c0255dd
Add support for overloadable methods
JumpLink Feb 15, 2021
0091668
Improved examples and upgrade example dependencies
JumpLink Feb 15, 2021
4b82421
Ported more examples from node-gtk to ts-for-gjs
JumpLink Feb 15, 2021
3974122
Cleanup
JumpLink Feb 15, 2021
153b737
Merge branch 'patch-1' of https://github.com/dcrime/ts-for-gjs
JumpLink Feb 16, 2021
1e63499
Allow to select all module versions
JumpLink Feb 16, 2021
e7399ae
Do not ignore type definitions anymore (to make it compareable in git…
JumpLink Feb 16, 2021
aa31405
Solved symTable version conflicts
JumpLink Feb 16, 2021
2968f8b
Update types
JumpLink Feb 16, 2021
aca4fe3
Fix ignore conflicts option loading from config file
JumpLink Feb 17, 2021
dfecd0d
Replaced depricated ESLint CLI class and other improvements
JumpLink Feb 17, 2021
a7f7b0a
Small fixes
JumpLink Feb 17, 2021
224dd3a
Update README
JumpLink Feb 17, 2021
ee0eed8
Merge conflict
JumpLink Feb 17, 2021
341c445
Fix test
JumpLink Feb 17, 2021
ecca99c
Try to get all vala-gir files working
JumpLink Feb 17, 2021
8137e22
Fix test
JumpLink Feb 17, 2021
101287e
typeLookup: Check reserved names and if type exists in symTable
JumpLink Feb 18, 2021
8eed79f
Many type fixes
JumpLink Feb 18, 2021
08c0554
Move symTable to own class and fix test
JumpLink Feb 20, 2021
22a092f
Cleanup
JumpLink Feb 20, 2021
b32019e
Add package name to comments
JumpLink Feb 21, 2021
65f5f56
[node-gtk] Fix signals, see #21
JumpLink Feb 21, 2021
30670c7
[node-gtk] Fix return type overwrites, see #21 point 6
JumpLink Feb 21, 2021
4ce4ce9
Fix test
JumpLink Feb 21, 2021
803e996
[node-gtk] Removed virtual methods, see #21 point 4
JumpLink Feb 21, 2021
fdc30ac
Rebuild types
JumpLink Feb 21, 2021
0a58f65
Ignore types from missign dependencies (WIP)
JumpLink Feb 22, 2021
69be23b
Rebuild gtk3 types
JumpLink Feb 23, 2021
74051f5
Rebuild all types
JumpLink Feb 23, 2021
38f610a
Cleanups
JumpLink Feb 23, 2021
7dfca17
Added missing gir files
JumpLink Feb 23, 2021
5630ce4
Fix index output path and exported types for node-gtk
JumpLink Feb 23, 2021
687bcd1
Export multiple module versions if found
JumpLink Feb 23, 2021
e3aeef0
Revert example
JumpLink Feb 24, 2021
e73190d
Write patch comments and improved code readability
JumpLink Feb 25, 2021
152eeca
Rebuild types
JumpLink Feb 26, 2021
10b03f2
Version conflicts for type patches fixed
JumpLink Feb 26, 2021
e02def1
Rebuild types
JumpLink Feb 26, 2021
7f2bda8
Split typeLookup method and find namespace for type
JumpLink Feb 26, 2021
cc2b07b
Cleanup
JumpLink Feb 26, 2021
829c21a
Rebuild types
JumpLink Feb 26, 2021
f84972b
Fix module export
JumpLink Mar 12, 2021
e7a986c
Fix ava test
JumpLink Mar 17, 2021
a35927b
Added more types and regenerate types
JumpLink Mar 17, 2021
29f876d
Update vala-girs submodules
JumpLink Jan 6, 2022
08bea5c
Rebuild types
JumpLink Jan 6, 2022
0e57a43
Merge branch 'sammydre-master'
JumpLink Jan 6, 2022
e3f5c8b
Merge
JumpLink Jan 6, 2022
2a51d6f
Merge
JumpLink Jan 6, 2022
daae6a0
Merge
JumpLink Jan 6, 2022
5461104
Merge
JumpLink Jan 6, 2022
5a5a150
Merge
JumpLink Jan 6, 2022
40168c5
Merge
JumpLink Jan 6, 2022
088b9dd
Revert "Merge"
JumpLink Jan 6, 2022
645df14
Revert "Merge"
JumpLink Jan 6, 2022
73cc300
Revert "Merge"
JumpLink Jan 6, 2022
dd95f1b
Revert "Merge"
JumpLink Jan 6, 2022
48c4fb8
Revert "Merge"
JumpLink Jan 6, 2022
05dc771
Revert "Merge"
JumpLink Jan 6, 2022
11ba28c
Merge
JumpLink Jan 6, 2022
4625a19
Upgrade dependencies
JumpLink Jan 6, 2022
59bde98
Add two more other project links to README.md
JumpLink Jan 7, 2022
3155185
ESM: Some Bugfixes and changed examples/Gjs/browser to use ESM with g…
JumpLink Jan 7, 2022
768130d
Fix lyrics
JumpLink Jan 7, 2022
3e67aa7
Update @types/eslint
JumpLink Jan 7, 2022
c2a50db
Improved types from gi.js project
JumpLink Jan 9, 2022
10e1306
Upgrade gir types based on https://gitlab.gnome.org/ewlsh/gi.ts/-/blo…
JumpLink Jan 10, 2022
93e8ce7
Replaced oclif with yargs
JumpLink Jan 10, 2022
17ff039
Full switch to ESM
JumpLink Jan 10, 2022
cf786ed
Use node 16 for CI
JumpLink Jan 10, 2022
6e40132
Required node engine is 16 for ESM now
JumpLink Jan 10, 2022
ddb33ec
Fix config loading
JumpLink Jan 10, 2022
48253a4
Upgrade vala-girs
JumpLink Jan 10, 2022
259e62d
Fix ava test
JumpLink Jan 10, 2022
ef7ccd8
Cleanup
JumpLink Jan 10, 2022
035158e
CI: Test generated types for Gtk3 and Gtk4
JumpLink Jan 10, 2022
3a12015
Fix npm script
JumpLink Jan 10, 2022
df80b88
Apply constructor property patches
JumpLink Jan 10, 2022
a393ccd
Unified return types
JumpLink Jan 11, 2022
d5f4a1f
All types in vala-gir can be built and validated without errors now :…
JumpLink Jan 11, 2022
df7d0e6
CI: Checkout vala-girs submodule for tests
JumpLink Jan 11, 2022
c8e4a2e
Do not ignore duplicate parameter names, just rename them
JumpLink Jan 11, 2022
f61f11a
CI: Test build all examples
JumpLink Jan 11, 2022
f8c38ea
Build ts-for-gir itself before the examples
JumpLink Jan 11, 2022
458207a
CI: Install dependencies for node-gtk
JumpLink Jan 11, 2022
b3abd9d
Do not ignore package-lock.json
JumpLink Jan 11, 2022
5bb8554
Fix node.js.yml
JumpLink Jan 11, 2022
08f3840
CI: Only build gjs examples
JumpLink Jan 11, 2022
b2dedf1
New cli option for no comments
JumpLink Jan 12, 2022
fc30538
More code cleanups
JumpLink Jan 12, 2022
3d6e8a7
Update README.md
JumpLink Jan 13, 2022
9d23845
More code cleanups
JumpLink Jan 13, 2022
42fc3a4
Moved addExport method to TemplateProcessor
JumpLink Jan 13, 2022
2a5bbc9
Cleanups
JumpLink Jan 13, 2022
8722059
Cleanups
JumpLink Jan 13, 2022
ac1d19b
Moved function return generation to TemplateProcessor
JumpLink Jan 14, 2022
507f0f9
Moved function generation to TemplateProcessor
JumpLink Jan 14, 2022
4a07f43
CI: Run ci tests on all branches
JumpLink Jan 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ node_modules/
# don't lint build output (make sure it's set to your correct build folder name)
lib/
tmp/
test/*.js
test/
# don't lint templates
templates/
# temporary ignore examples
# examples/
examples/
# temporary ignore generated types, remove this if the heap out of memory bug is fixed
@types/
*.js
Expand Down
25 changes: 0 additions & 25 deletions .eslintrc.js

This file was deleted.

26 changes: 26 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier"
],
"rules": {
"semi": ["error", "never"],
"no-debugger": "off",
"@typescript-eslint/triple-slash-reference": "off",
"camelcase": "off",
"@typescript-eslint/camelcase": "off"
},
"parserOptions": {
"requireConfigFile": false,
"files": ["*.ts", "*.tsx"],
"project": "./tsconfig.json"
},
"globals": {
"imports": true
}
}
29 changes: 21 additions & 8 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,40 @@
name: Node.js CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

push:
branches:
- "*"
jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]

node-version: [16.x]
architecture:
- x64
steps:
- uses: actions/checkout@v2
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: sudo apt-get update
- run: sudo apt-get --yes install libappindicator3-dev libgda-5.0-dev libgirepository1.0-dev libgtk-3-dev libgtksourceview-3.0-dev libnotify-dev libsoup2.4-dev libwebkit2gtk-4.0-dev
- name: Install dependencies for regress test
run: sudo apt-get --yes install libappindicator3-dev libgda-5.0-dev libgirepository1.0-dev libgtk-3-dev libgtksourceview-3.0-dev libnotify-dev libsoup2.4-dev libwebkit2gtk-4.0-dev
- run: npm install
- run: npm run regress
- run: npm run test:ava
- run: npm run build:types:gjs
- run: npm run build:types:node
- run: npm run build
- run: npm run build:examples:gjs
# TODO fix build node-gtk on Github actions
# - name: Install dependencies for node-gtk
# run: sudo apt-get --yes install build-essential gobject-introspection libgirepository1.0-dev libcairo2 libcairo2-dev
# - run: npm run install:examples:node
# - run: npm run build:examples:node
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
*.lock
*-lock*
main.js
node_modules/
tmp/
lib/
examples/**/@types/
@types/
index.ts.bak
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "test/girs/vala-girs"]
path = test/girs/vala-girs
path = vala-girs
url = https://github.com/nemequ/vala-girs.git
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16
8 changes: 0 additions & 8 deletions .prettierrc.js

This file was deleted.

7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": false,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 120,
"tabWidth": 4
}
10 changes: 10 additions & 0 deletions .ts-for-gir.all.rc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export default {
modules: ['*'],
girDirectories: ['./vala-girs/gir-1.0', './girs'],
ignoreConflicts: true,
prettify: 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?
]
}
74 changes: 0 additions & 74 deletions .ts-for-gir.gtk-3.rc.js

This file was deleted.

6 changes: 6 additions & 0 deletions .ts-for-gir.gtk3.rc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
modules: ['Gtk-3.0'],
girDirectories: ['./vala-girs/gir-1.0'],
prettify: true,
ignore: [],
}
6 changes: 6 additions & 0 deletions .ts-for-gir.gtk4.rc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
modules: ['Gtk-4.0'],
girDirectories: ['./vala-girs/gir-1.0'],
prettify: true,
ignore: [],
}
3 changes: 2 additions & 1 deletion .ts-for-gir.regress.rc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
export default {
modules: ['Gtk-3.0', 'Soup-2.4', 'GtkSource-3.0', 'WebKit2-4.0', 'AppIndicator3-0.1', 'Gda-5.0', 'Notify-0.7'],
ignoreConflicts: true,
prettify: true,
ignore: []
}
5 changes: 5 additions & 0 deletions .ts-for-gir.rygelcore24.rc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
modules: ['RygelCore-2.4', 'RygelRenderer-2.4'],
girDirectories: ['./vala-girs/gir-1.0'],
ignore: [],
}
7 changes: 0 additions & 7 deletions .ts-for-gir.test.rc.js

This file was deleted.

60 changes: 27 additions & 33 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,82 +5,76 @@
"version": "0.2.0",
"configurations": [
{
"name": "build:types:gtk3",
"type": "node",
"request": "launch",
"protocol": "inspector",
"name": "Generate Gtk for gjs",
"program": "${workspaceRoot}/bin/run",
"program": "./src/index.ts",
"args": [
"generate", "Gtk-3.0", "-e", "gjs", "-o", "./tmp"
"generate", "--configName=.ts-for-gir.gtk3.rc.js", "-o", "./tmp"
],
"outFiles": [
"${workspaceRoot}/main.js"
]
"runtimeArgs": ["--nolazy", "-r", "ts-node/register"],
"sourceMaps": true
},
{
"name": "build:types",
"type": "node",
"request": "launch",
"protocol": "inspector",
"name": "Generate Gtk for node-gtk",
"program": "${workspaceRoot}/bin/run",
"program": "${workspaceRoot}/src/index.ts",
"args": [
"generate", "Gtk-3.0", "-e", "node", "-o", "./tmp"
"generate", "--configName=.ts-for-gir.all.rc.js", "-o", "./tmp"
],
"outFiles": [
"${workspaceRoot}/main.js"
]
"runtimeArgs": ["--nolazy", "-r", "ts-node/register"],
"sourceMaps": true,
},
{
"name": "build:types:gjs",
"type": "node",
"request": "launch",
"protocol": "inspector",
"name": "Generate all locale installed for gjs",
"program": "${workspaceRoot}/bin/run",
"program": "${workspaceRoot}/src/index.ts",
"args": [
"generate", "-e", "gjs", "-o", "./tmp"
"generate", "--configName=.ts-for-gir.all.rc.js", "--environments=gjs", "-o", "./tmp"
],
"outFiles": [
"${workspaceRoot}/main.js"
]
"runtimeArgs": ["--nolazy", "-r", "ts-node/register"],
"sourceMaps": true,
},
{
"name": "build:types:node",
"type": "node",
"request": "launch",
"protocol": "inspector",
"name": "Generate all locale installed for node-gtk",
"program": "${workspaceRoot}/bin/run",
"program": "${workspaceRoot}/src/index.ts",
"args": [
"generate", "-e", "node", "-o", "./tmp"
"generate", "--configName=.ts-for-gir.all.rc.js", "--environments=node", "-o", "./tmp"
],
"outFiles": [
"${workspaceRoot}/main.js"
]
"runtimeArgs": ["--nolazy", "-r", "ts-node/register"],
"sourceMaps": true,
},
{
"name": "regress",
"type": "node",
"request": "launch",
"protocol": "inspector",
"name": "regress",
"program": "${workspaceRoot}/bin/run",
"program": "${workspaceRoot}/src/index.ts",
"args": [
"generate", "--configName='.ts-for-gir.regress.rc.js", "-o", "./tmp"
],
"outFiles": [
"${workspaceRoot}/main.js"
]
"runtimeArgs": ["--nolazy", "-r", "ts-node/register"],
"sourceMaps": true,
},
{
"name": "Launch Test",
"type": "node",
"request": "launch",
"name": "Launch Test",
"program": "${workspaceRoot}/node_modules/ava/profile.js",
"args": [
"${workspaceRoot}/test.js",
"--no-color"
],
"outFiles": [
"${workspaceRoot}/test.js"
]
"runtimeArgs": ["--nolazy", "-r", "ts-node/register"],
"sourceMaps": true,
}
]
}
Loading