- New test: Create simple vala classes, build the gir files from that, generate the typescript type definitions for that and test if the result looks good
- Create a Reporter to create a text or json file with warnings like unknown types, renaming, etc and a summary of all that (e.g. 5 type conflicts resolved, 8 unknown types of *gint)
- Update types for GJS v1.75.2, see https://gitlab.gnome.org/GNOME/gjs/-/commit/666755b3b09d765e43d415e76105b828517b5509
- Upgrade dependencies
- Update examples and removed deprecated function calls like
byteArray.toString()
- Add
dom.js
,ambient.js
andnode-ambient.js
to allow importing there type definitions in the codebase with a bundler - Update TSDoc documentation for
system
- node-gtk: Add new
gtk-4-application
example - node-gtk: Uses snake_case for property names at constructor, fixes #131
- Removed support for additional
underscore
properties (next tolowerCamelCase
) in the generated types, if this causes problems please let us know, then we will undo it again
- Upgrade dependencies
- Add type for import.meta.url, see 142
- C type
const
is readonly in typescript - Constants are not nullable, fixes #141
- Upgrade dependencies
- Generate camel cased property accessors, see #138
- Add
runAsync
override forGLib.MainLoop
, see #130
- Upgrade dependencies
- Allow ambient modules without version for NPM packages, see #139
- Add information about ESM and CommonJS modules to README.md for NPM packages
- Upgrade dependencies
- Add instruction to install
GnomeBluetooth-3.0.gir
on Fedora - Add more *.gir files to
./girs
directory
- Upgrade dependencies
- Upgrade gir files
- TypeDoc: Only include main entry point
- Upgrade dependencies
- TypeDoc: Improved support for TypeDoc 0.24.x
- Upgrade dependencies
- Upgrade gir files
- Upgrade dependencies
- Move conflicting global GJS types to
dom.d.ts
for optional import
Move conflicting global GJS types to dom.d.ts
, allowing you to optionally import them in your project. By doing so, you have the flexibility to choose whether or not to include these types based on your specific needs. This resolves the conflict between the GJS and DOM types and provides you with more control over managing the type definitions.
To use the previous behavior and include the conflicting GJS types, you can import both ./@types/gjs.d.ts
and ./@types/dom.d.ts
in your code.
Alternatively, if you are using the NPM packages, you can import the following:
@girs/gjs
: This package provides the GJS types.@girs/gjs/dom
: This package provides the conflicting DOM types.
Please update your imports accordingly based on your chosen approach.
- Update badges on README template files
- Node-gtk: Readd gobject signal method, fixes #126
- NPM package Yarn workspace support is optional now, see #124
- Upgrade all dependencies (except
xml2js
, see #125) - Parse app version from
package.json
- Moved
templates
,packages.xml
,package-data-parser.ts
andtemplate-processor.ts
from@ts-for-gir/lib
to@ts-for-gir/generator-typescript
- Cleanup yarn scripts in
./package.json
- Add missing
packages.xml
to@ts-for-gir/lib
This is the first stable release of version 3.0.0 with support for NPM package generation.
- Add support to generate a package for each GIR module we can publish on NPM, see #106
- Add a new CLI option to generate NPM packages
- Add a new CLI option to change the NPM package scope name
- Documentation for the new CLI options
- Generate a
package.json
for each package - One folder for each package
- New example
- Add dependencies to each
package.json
- Package names in lower case
- Separate package names for node-gtk types
- Package directory and file names in lower case
- Parse library versions
- Add a README.md for each NPM package
- Different README.md for node-gtk NPM packages
- Add an test to CI
- Fix
tsconfig.alias.json
- Add support for ambient modules
- Documentation for ambient modules
- Generate both CJS and ESM modules
- Add node-gtk to the peer dependencies to the node-gtk NPM packages
- Remove destination environment directory
- Separate README.md for the main NPM packages (
@gir/gjs
and@gir/node-gtk
) - Generate and publish the new NPM packages
- Provide system and gettext as ESM, see #114
- Include only desired types (instead of all existing ones)
- Add repository and homepage to
package.json
- Updated Documentation for the new NPM packages
- Move the GNOME Shell type definitions to a NPM package and make use of the new generated NPM packages
- All filenames for the generated types now contain the name of the module
- All filenames for the generated types are now lowercase
- All filenames for the generated types for Node.js now have a
node-
prefix - Now no parent folder
Gjs
ornote-gtk
is created. When types are generated for both environments, they all end up in the same folder - Now not all GIR modules are imported in the gjs.js, who wants to have types for a certain GIR module, must include this module now itself. This saves a lot of processing work in your IDE
- Some default values of the CLI options have changed, for example now by default only the types for Gjs are generated and the default module format is now ESM with namespaces
- UTF-8 string pointers are nullable, so all of this pointers are handled as nullable now, see #108
- Extract default GIR directories from
XDG_DATA_DIRS
environment variable, this fixes ts-for-gir on NixOS. See #107 by @samdroid-apps
- More parameters and returned UTF-8 strings are nullable now, so maybe you need to update your code to check if the string is not null. Please give us feedback about this change
- Split this project into more submodules: 'cli', 'lib', 'generator-base', 'generator-typescript' and 'generator-html-doc'
- Fix node bin path for ts-for-gir execution
- Upgrade dependencies
- Add GNOME Shell types for:
- ui/checkBox
- ui/closeDialog
- Paths in the config file are now relative to the path of the config file itself
- Add TSDoc
@returns
for return values - Fixed VSCode launch.json for debugging
- Reenable
ts-node
to develop without the need to rebuildts-for-gir
for debugging - Add support for promisified function generation, see #104 by @CharlieQLe
- Upgrade dependencies
- Add support for the
"gi://..."
import syntax, see #103 by @CharlieQLe - README.md greatly simplified and split into several files
- Add new DependencyManager to be able to search for a dependency regardless of the version
- Improved GNOME Shell types
- Only extend class/interface parent if the dependency of the parent exists
- Add more properties to the dependency object like
exists
to be able to check if a dependencygir
file was found - Upgrade dependencies
- Removed the
pretty
andnoCheck
options - Changed default options to:
noNamespace: true
(wasuseNamespace: false
before)environments: ["gjs"]
(was["gjs", "node"]
before)moduleType: "esm"
(was"commonjs"
before)
- Add new option to enable type generation for GNOME Shell (disabled by default now)
- Add some more types for GNOME Shell
- Set verbose to
false
by default - Removed casts.ts
- Removed ava test
- Upgrade dependencies, yarn and vala-girs
- Add initial support for GNOME Shell imports, see #99
- Added new GNOME Shell Extension example, see #99
- Added new example with types only generation, see #101
- Add missing
getttext
functions:pgettext
,dpgettext
, see #97 by @HeavenVolkoff - Replace typescript runtime dependency with
get-tsconfig
, see #96 by @HeavenVolkoff
- Change Class Signal conflict resolution logic, see #91 by @HeavenVolkoff
- Expose GJS global imports.signals type, see #89 by @HeavenVolkoff
- Enhance Glib.Error type with GJS specific additions, see #88 by @HeavenVolkoff
- CLI: Fix noDOMLib option in templates
- CLI: Allow to disable generation of types that are in conflict with the DOM types
- Add typing definition for
GLib.Bytes.toArray()
- Upgrade dependencies
- Follow user defined verbose option in ConflictResolver, see #83 by @HeavenVolkoff
- Fix prepend logic in Logger's static methods, see #84 by @HeavenVolkoff
- Expose GIRepositoryNamespace underscore properties in TS namespace, see #85 by @HeavenVolkoff
- Solution for #72 + Add type definitions for Text(D)Encoder, see #86 by @HeavenVolkoff
- Added new simple GJS example with Libadwaita and Vite
- Rename package to
@ts-for-gir/cli
, see #82 - Ported more examples, see #81
- Add overrides for Gio-2.0, see #80
- Add GLib.Variant unpacking methods, see #70 by @HeavenVolkoff
- node-gtk: Now supports virtual methods, see #77
- Wrap constructor properties and signal callback interfaces to a class name module, see #73
- Improve typing definition of log and logError, see #71 by @HeavenVolkoff
- Real inheritance and implementations instead of copy all inherited methods / properties to the classes / interfaces, see #63
- During the implementation of the upper pull request many other small improvements have been made.
- Upgrade dependencies
- More splitting of the Github workflows so that more can be tested in parallel
- Expect error on gi ESM imports, see #69 by @HeavenVolkoff
- Add typing definition for
imports.package
, see #67 by @HeavenVolkoff - Allow Node.js versions greater or equal than v16 , see #65 by @HeavenVolkoff
- Ported GJS for http server + client example to node-gtk
- Split GObject template for separate templates for gjs and node-gtk
- Do not skip generation of GObject fields anymore
- Add TSDoc tags which identifies the type with the original gir type
- Also generate TSDocs for classes
- Split Github workflows into gjs and node-gtk
- General improvements #59
- Added new GJS example for http server + client with Soap 3
- Renamed CHANGELOG.md to NEWS.md because as it is not always a detailed changelog
- Cleanup detection / generation of Array types
- Added new GJS example for
Gtk.ListStore
- Inject additional static methods to GObject.ParamSpec and other GObject overrides
- Export GJS System namespace
- Ignore depreciated allow-none if
optional
ornullable
is used - Distinguish between
optional
andnullable
types - Add types for timer functions (
setTimeout
,setInterval
), supported by GJS since 1.71.1 - Renamed GObject.Type to GObject.Gtype
- General improvements to the generated types
- Add initial support for generic type parameters
- Add initial support for TSDoc with text and
@param
tag support, see #49 - Upgrade dependencies
- Fix logic around property's readonly & construct-only, see #52
- Fix properties with the name of
constructor
- Fix enums with duplicate identifiers
- Disabled Ava test for now, because it needs a refactoring
- Fix config file loading, see #48
- The browser example now uses ESM for GJS and Node.js
- Upgrade all dependencies to latest
- [node-gtk] don't add $obj parameter in connect() method either, by @peat-psuwit
- [node-gtk] Fixed Return types, see #46
- New and simpler patch format
- Replaced
ESLint
withprettier
for prettify output, this fixes #29 - New
doc
command for future implementation - New class
HtmlDocGenerator
this is not implemented yet, but can serve as a template for a future implementation - Fix type
Uint8Array
(should not beUint8Array[]
) - CI: Run GJS CLI examples to test working bindings
- The generated types now contain a note that they are automatically generated with
ts-for-gir
- Split option
exportDefault
touseNamespace
andmoduleType
to specifyESM
orCommonJS
module generation - Fix VSCode debugging configuration to work with ESM
- Debugging information added to README.md
- Moved all signature generations to new TypeDefinitionGenerator
- The utility functions are no longer static members of a class
- Fixed a bug in the
forEachInterface
method, which caused that not all inherited methods were implemented anymore (slipped in with the last PR) - Added this CHANGELOG.md
- All types in vala-gir can now be built and validated without errors, this can be tested with
npm run test:girs:all
, this test is now also executed with github actions - Switch to ESM for ts-for-gir itself
- Replaced
oclif
withyargs
for CLI parsing (yargs
has ESM Support,oclif
not) - Improved @realh's GJS ESM support
- Improved types based on gobject-introspection/docs/gir-1.2.rnc and gi.ts/parser/src/xml.ts
- Changed
examples/gjs/builder
example to use the GJS ESM feature usinggi://
imports - Version conflicts in Gir modules fixed, now multiple versions of the same module name can be generated
- Made the source code more readable in some places, this mainly affects places where an array was returned, here a more meaningful tuple / object is now returned
- Dependencies updated
- It is now possible to build all gir modules from the vala-girs repository.
- Some older girs are missing in the vala-girs repository, they are now included in this repository
- Added some new examples
- Node.js minimum version is now 16 for ESM support
- The config files must also be in ESM format if you are inside a ESM Package, this is the case if
"type": "module"
is defined in yourpackage.json
. Alternatively, the file can be saved in json format, then it works in both cases.
See PR #44
- Fix error type
See PR #43
- Add support for ES modules using default exports
See PR #41
- Use /usr/local/share when on Darwin systems
See PR #39
- Missing quote in generate example
See PR #38
- Use qualified names in circular dependency check (fixes #28)
- Fixed type transformations for arrays of bytes
- Add support for inline callback types
- Expose instance parameters of class methods
- Add CI / action tests using Github workflow
See PR #30, #31, #34, #36 and #37
- Improved types and also use more types in test data
- Fixed test npm run build:test:girs
- Upgrade dependencies (With the upgrade of eslint some new automatic formatting has been added which increases the PR)
- Added tests to README.md
- Added version to fix
- Add versions property type to imports.gi for gobject-introspection classes #25
- Added src to NPM module
- Is it possible to use ts-for-gir as dev dependency #20
- Split method exportObjectInternal in more methods to make it more readable
- Improved debugging by log the full error when an error occurs
- Some improvements taken from @realh `s fork
See PR #27
- Add ts-node as devDep to fix running in-tree
- Improve typing for cast.ts
- Moved CLI specific code to
cli.ts
- Add a new
TemplateProcessor
class to generate definitions from templates to reduce the GirModule class - Add a new
Transformation
class to transform methods, enums, etc for the specific environment (gjs or node) - Convert string templates to ejs templates
- Because there are now more source files, I have moved them all to
src/
- The compiled source files now in
lib/
- I have moved the dependencies loading to
module-loader.ts
- I have moved the file parser to
module-loader.ts
- I have moved the cli specific to
./src/commands/*
and./src/config
- All types now in
./src/types
, each type / interface in his own file - Added
bin/bin.js
, required to use ts-for-gir as a cl tool by npm - Added ESLint with the Prettier plugin, I tried to keep the code style (for example, there is a rule to not use semicolon's).
- ESLint and Prettier are also used to validate and auto format the generated template files.
- I've changed the default output dir to
@types/
to make it easier to generate type definitions in other projects without having to specify the output path each time - The output path now contains subfolder's for
GJS
and / ornode-gtk
(the directory namenode-gtk
is required to get typescript automatically working withimport * as gi from 'node-gtk'
) - There is now a new option called
--build-type
which can be"lib"
or"types"
,"lib"
is the default for generating types forGJS
and the way it was before. I added "types" for node-gtk and generates the types e.g. as you would publish them on DefinitelyTyped. - Source maps are now also generated, which simplify debugging, Zhe IDE can now points directly to the typescript files e.g. at a breakpoint
- Updated dependencies
- Replaced commander.js with oclif because
commander.js
was a difficult to use with multiple arguments - Added wild card support for module names to load (e.g. Gtk*)
- Ask which module version should be used if several are found
- It can now be specified which modules should be ignored
- A config can now be created in which the cli options are available (e.g. the modules that should be ignored)
- Added new reserved keywords for functions, class names, etc
- Fixed data type errors
- Added a new list
See PR #19
- Export symbols used by registerClass
See PR #16
- Add GObject signal connect methods
- Fix GType and add $gtype properties
- Fix return value of signal connect methods
See PR #10