Skip to content

Type generation fails #617

@yashranjan1

Description

@yashranjan1

Sorry if this is a stupid question but, when I init the type generation fails, im not sure why

ags init
error: type generation failed, try running
/usr/bin/npx -y @ts-for-gir/cli@4.0.0-beta.15 generate * --ignoreVersionConflicts --outdir /home/yash/.config/ags/@girs -g /usr/local/share/gir-1.0 -g /usr/share/gir-1.0 -g /usr/share/*/gir-1.0 -g gir-1.0

When I try the recommended command it gives me the following error

/usr/bin/npx -y @ts-for-gir/cli@4.0.0-beta.15 generate * --ignoreVersionConflicts --outdir /home/yash/.config/ags/@girs -g /usr/local/share/gir-1.0 -g /usr/share/gir-1.0 -g /usr/share/*/gir-1.0 -g gir-1.0
Adding generics...
ts-for-gir generate [modules..]

Generates Typescript type definition .d.ts files from GIR for GJS

Options:
      --version                 Show version number                    [boolean]
      --help                    Show help                              [boolean]
      --modules                 GIR modules to load, e.g. 'Gio-2.0'. Accepts mul
                                tiple modules           [array] [default: ["*"]]
  -g, --girDirectories          GIR directories
  [array] [default: ["/usr/local/share/gir-1.0","/usr/share/gir-1.0","/usr/share
  /*/gir-1.0","/usr/share/gnome-shell","/usr/share/gnome-shell/gir-1.0","/usr/li
        b64/mutter-*","/usr/lib/mutter-*","/usr/lib/x86_64-linux-gnu/mutter-*"]]
      --root                    Root directory of your project
                                        [string] [default: "/home/yash/.config"]
  -o, --outdir                  Directory to output to
                                                  [string] [default: "./@types"]
  -i, --ignore                  Modules that should be ignored
                                                           [array] [default: []]
  -v, --verbose                 Switch on/off the verbose mode
                                                       [string] [default: false]
      --ignoreVersionConflicts  Skip prompts for library version selection when
                                multiple versions are detected
                                                       [string] [default: false]
  -p, --print                   Print the output to console and create no files
                                                       [string] [default: false]
      --configName              Specify a custom name for the configuration file
                                          [string] [default: ".ts-for-girrc.js"]
  -d, --noNamespace             Do not export all symbols for each module as a n
                                amespace               [string] [default: false]
  -n, --noComments              Do not generate documentation comments
                                                       [string] [default: false]
      --promisify               Generate promisified functions for async/finish
                                calls                   [string] [default: true]
      --npmScope                Scope of the generated NPM packages
                                                     [string] [default: "@girs"]
      --workspace               Uses the workspace protocol for the generated pa
                                ckages which can be used with package managers l
                                ike Yarn and PNPM      [string] [default: 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.
                                                       [string] [default: false]
      --noPrettyPrint           Do not prettify the generated types
                                                       [string] [default: false]
      --noAdvancedVariants      Disable GLib.Variant class with string parsing
                                                        [string] [default: true]
      --package                 Generate the typescript types with package.json
                                support                [string] [default: false]

Examples:
  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/yash/.npm/_npx/9947fdcb15df8564/node_modules/@ts-for-gir/lib/lib/generics/generify.js:17:19
    at generify (file:///home/yash/.npm/_npx/9947fdcb15df8564/node_modules/@ts-for-gir/lib/lib/generics/generify.js:25:5)
    at DependencyManager.transform (file:///home/yash/.npm/_npx/9947fdcb15df8564/node_modules/@ts-for-gir/lib/lib/gir/registry.js:105:9)
    at GenerationHandler.start (file:///home/yash/.npm/_npx/9947fdcb15df8564/node_modules/@ts-for-gir/cli/lib/generation-handler.js:35:18)
    at async Object.handler (file:///home/yash/.npm/_npx/9947fdcb15df8564/node_modules/@ts-for-gir/cli/lib/commands/generate.js:34:5)

Im not really sure whats going here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions