You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use Soup-3.0 in my projects, tried installing the types through the cli (ts-for-gir generate Soup-3.0)n, and an error occurs.
Current vs Expected Behavior
Current:
[adam@TOUR-ADAM NyarchUpdater]$ ts-for-gir generate Soup-3.0
Adding generics...
ts-for-gir generate [modules..]
Generates Typescript type definition .d.ts files from GIR for GJS
Options :
--version Affiche le numéro de version [booléen]
--help Affiche l'aide [booléen]
--modules GIR modules to load, e.g. 'Gio-2.0'. Accepts mul
tiple modules [tableau] [défaut : ["*"]]
-g, --girDirectories GIR directories
[tableau] [défaut : ["/usr/local/share/gir-1.0","/usr/share/gir-1.0","/usr/sha
re/*/gir-1.0","/usr/share/gnome-shell","/usr/share/gnome-shell/gir-1.0","/usr/
lib64/mutter-*","/usr/lib/mutter-*","/usr/lib/x86_64-linux-gnu/mutter-*"]]
--root Root directory of your project
[chaîne de caractères] [défaut : "/home/adam/Projets/NyarchUpdater"]
-o, --outdir Directory to output to
[chaîne de caractères] [défaut : "./@types"]
-i, --ignore Modules that should be ignored
[tableau] [défaut : []]
-v, --verbose Switch on/off the verbose mode
[chaîne de caractères] [défaut : false]
--ignoreVersionConflicts Skip prompts for library version selection when
multiple versions are detected
[chaîne de caractères] [défaut : false]
-p, --print Print the output to console and create no files
[chaîne de caractères] [défaut : false]
--configName Specify a custom name for the configuration file
[chaîne de caractères] [défaut : ".ts-for-girrc.js"]
-d, --noNamespace Do not export all symbols for each module as a n
amespace [chaîne de caractères] [défaut : false]
-n, --noComments Do not generate documentation comments
[chaîne de caractères] [défaut : false]
--promisify Generate promisified functions for async/finish
calls [chaîne de caractères] [défaut : true]
--npmScope Scope of the generated NPM packages
[chaîne de caractères] [défaut : "@girs"]
--workspace Uses the workspace protocol for the generated pa
ckages which can be used with package managers l
ike Yarn and PNPM
[chaîne de caractères] [défaut : false]
--onlyVersionPrefix Only use the version prefix for the ambient modu
le exports. This is useful if, for whatever reas
on, you want to use different library versions o
f the same library in your project.
[chaîne de caractères] [défaut : false]
--noPrettyPrint Do not prettify the generated types
[chaîne de caractères] [défaut : false]
--noAdvancedVariants Disable GLib.Variant class with string parsing
[chaîne de caractères] [défaut : true]
--package Generate the typescript types with package.json
support [chaîne de caractères] [défaut : false]
Exemples :
ts-for-gir generate Run 'ts-for-gir generate' in your gj
s project to generate typings for yo
ur project, pass the gir modules you
need for your project
ts-for-gir generate Gtk* You can also use wild cards
ts-for-gir generate '*' If you want to parse all of your loc
ally installed gir modules run
ts-for-gir generate --configName='.ts-fo Use a special config file
r-gir.gtk4.rc.js
ts-for-gir generate --ignore=Gtk-4.0 xra Generate .d.ts. files but not for Gt
ndr-1.3 k-4.0 and xrandr-1.3
Error: Could not generify Gtk 4.0
at file:///home/adam/.nvm/versions/node/v20.18.3/lib/node_modules/@ts-for-gir/cli/node_modules/@ts-for-gir/lib/lib/generics/generify.js:17:19
at generify (file:///home/adam/.nvm/versions/node/v20.18.3/lib/node_modules/@ts-for-gir/cli/node_modules/@ts-for-gir/lib/lib/generics/generify.js:25:5)
at DependencyManager.transform (file:///home/adam/.nvm/versions/node/v20.18.3/lib/node_modules/@ts-for-gir/cli/node_modules/@ts-for-gir/lib/lib/gir/registry.js:105:9)
at GenerationHandler.start (file:///home/adam/.nvm/versions/node/v20.18.3/lib/node_modules/@ts-for-gir/cli/lib/generation-handler.js:35:18)
at async Object.handler (file:///home/adam/.nvm/versions/node/v20.18.3/lib/node_modules/@ts-for-gir/cli/lib/commands/generate.js:32:5)
I can confirm the behaviour and it is definitely a bug. I'll take a look at it. As a workaround, you can pass Gtk-4.0 with it, then it works:
@ts-for-gir/cli generate Gtk-4.0 Soup-3.0
Regarding the package name, I agree that ts-for-gir would be more handy. Unfortunately, someone has published our repo under this name on NPM without asking and all attempts to contact them have unfortunately failed: https://www.npmjs.com/package/ts-for-gir
Hey!
Thanks for the reply, i'll try out.
As for ts-for-gir package, i wasn't talking about the fact typing the whole cli package name was an issue, just that using npx to execute it is way longer.
Description
I use Soup-3.0 in my projects, tried installing the types through the cli (ts-for-gir generate Soup-3.0)n, and an error occurs.
Current vs Expected Behavior
Current:
Expected:
Should make me the types defs.
Example
npm i -g @ts-for-gir/cli
(I find it handier to have it available asts-for-gir
instead of the whole npx execution)ts-for-gir generate Soup-3.0
References
Running ts-for-gir generate Gtk-4.0 or Adw-1 works fine.
Additional Context
The text was updated successfully, but these errors were encountered: