feat(ags): fix type checking with tsc
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2025-01-04 01:22:08 -05:00
parent 8157d3ef2d
commit 199fa9c32e
5 changed files with 9 additions and 12 deletions

View file

@ -31,7 +31,6 @@ in {
configPath, configPath,
packages, packages,
pname, pname,
delete ? [],
}: let }: let
girNameTable = { girNameTable = {
gtk4 = "Gtk-4.0"; gtk4 = "Gtk-4.0";
@ -57,7 +56,7 @@ in {
force = true; force = true;
source = pkgs.callPackage ./mk-types { source = pkgs.callPackage ./mk-types {
inherit (self.inputs) ts-for-gir-src; inherit (self.inputs) ts-for-gir-src;
inherit delete pname withGirNames; inherit pname withGirNames;
}; };
}; };
}; };

View file

@ -4,13 +4,13 @@
withGirNames, withGirNames,
buildNpmPackage, buildNpmPackage,
ts-for-gir-src, ts-for-gir-src,
delete ? [],
... ...
}: let }: let
inherit (lib) concatMapStringsSep optionalString; inherit (lib) concatMapStringsSep;
buildPhase = '' buildPhase = ''
npx @ts-for-gir/cli generate ${concatMapStringsSep " " (p: p.girName) withGirNames} \ npx @ts-for-gir/cli generate \
${concatMapStringsSep "\n" (p: " ${p.girName} \\") withGirNames}
${concatMapStringsSep "\n" (p: " -g ${p.package.dev}/share/gir-1.0 \\") withGirNames} ${concatMapStringsSep "\n" (p: " -g ${p.package.dev}/share/gir-1.0 \\") withGirNames}
-g ${ts-for-gir-src}/girs \ -g ${ts-for-gir-src}/girs \
--ignoreVersionConflicts \ --ignoreVersionConflicts \
@ -32,9 +32,6 @@ in
''; '';
installPhase = '' installPhase = ''
${optionalString (delete != []) (
"rm -f " + concatMapStringsSep " " (file: "./types/${file}.d.ts") delete
)}
cp -r ./types $out cp -r ./types $out
''; '';
} }

View file

@ -10,6 +10,7 @@
"module": "ES2022", "module": "ES2022",
"moduleResolution": "Bundler", "moduleResolution": "Bundler",
"noEmit": true, "noEmit": true,
"skipLibCheck": true,
"strict": true, "strict": true,
"target": "ES2022" "target": "ES2022"
} }

View file

@ -10,6 +10,7 @@
"module": "ES2022", "module": "ES2022",
"moduleResolution": "Bundler", "moduleResolution": "Bundler",
"noEmit": true, "noEmit": true,
"skipLibCheck": true,
"strict": true, "strict": true,
"target": "ES2022" "target": "ES2022"
} }

View file

@ -122,15 +122,14 @@ in {
pname = "ags"; pname = "ags";
configPath = "${cfg.configDir}/@girs"; configPath = "${cfg.configDir}/@girs";
packages = filter (x: packages = filter (x:
x.pname != "astal4" && x.pname != "libadwaita") x.pname != "libadwaita")
cfg.astalLibs; cfg.astalLibs;
delete = ["gdk-4.0" "gtk-4.0" "gsk-4.0"];
}) })
// (buildGirTypes { // (buildGirTypes {
pname = "ags"; pname = "ags";
configPath = "${gtk4ConfigDir}/@girs"; configPath = "${gtk4ConfigDir}/@girs";
packages = filter (x: packages = filter (x:
x.pname != "astal3" && x.pname != "gtk-session-lock") x.pname != "gtk-session-lock")
cfg.astalLibs; cfg.astalLibs;
}) })
// { // {