From 199fa9c32e722e01ee9bd38bbbe1b1d6195500f4 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sat, 4 Jan 2025 01:22:08 -0500 Subject: [PATCH] feat(ags): fix type checking with tsc --- lib/pkgs/default.nix | 3 +-- lib/pkgs/mk-types/default.nix | 11 ++++------- modules/ags/config/tsconfig.json | 1 + modules/ags/gtk4/tsconfig.json | 1 + modules/ags/packages.nix | 5 ++--- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/lib/pkgs/default.nix b/lib/pkgs/default.nix index 39fb3c82..496a3660 100644 --- a/lib/pkgs/default.nix +++ b/lib/pkgs/default.nix @@ -31,7 +31,6 @@ in { configPath, packages, pname, - delete ? [], }: let girNameTable = { gtk4 = "Gtk-4.0"; @@ -57,7 +56,7 @@ in { force = true; source = pkgs.callPackage ./mk-types { inherit (self.inputs) ts-for-gir-src; - inherit delete pname withGirNames; + inherit pname withGirNames; }; }; }; diff --git a/lib/pkgs/mk-types/default.nix b/lib/pkgs/mk-types/default.nix index 47a0913d..92285c02 100644 --- a/lib/pkgs/mk-types/default.nix +++ b/lib/pkgs/mk-types/default.nix @@ -4,14 +4,14 @@ withGirNames, buildNpmPackage, ts-for-gir-src, - delete ? [], ... }: let - inherit (lib) concatMapStringsSep optionalString; + inherit (lib) concatMapStringsSep; buildPhase = '' - npx @ts-for-gir/cli generate ${concatMapStringsSep " " (p: p.girName) withGirNames} \ - ${concatMapStringsSep "\n" (p: "-g ${p.package.dev}/share/gir-1.0 \\") 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} -g ${ts-for-gir-src}/girs \ --ignoreVersionConflicts \ -o ./types @@ -32,9 +32,6 @@ in ''; installPhase = '' - ${optionalString (delete != []) ( - "rm -f " + concatMapStringsSep " " (file: "./types/${file}.d.ts") delete - )} cp -r ./types $out ''; } diff --git a/modules/ags/config/tsconfig.json b/modules/ags/config/tsconfig.json index 8959489a..dd1cebcc 100644 --- a/modules/ags/config/tsconfig.json +++ b/modules/ags/config/tsconfig.json @@ -10,6 +10,7 @@ "module": "ES2022", "moduleResolution": "Bundler", "noEmit": true, + "skipLibCheck": true, "strict": true, "target": "ES2022" } diff --git a/modules/ags/gtk4/tsconfig.json b/modules/ags/gtk4/tsconfig.json index c1ea8a05..457e4df4 100644 --- a/modules/ags/gtk4/tsconfig.json +++ b/modules/ags/gtk4/tsconfig.json @@ -10,6 +10,7 @@ "module": "ES2022", "moduleResolution": "Bundler", "noEmit": true, + "skipLibCheck": true, "strict": true, "target": "ES2022" } diff --git a/modules/ags/packages.nix b/modules/ags/packages.nix index d2e88c24..39dfd8d2 100644 --- a/modules/ags/packages.nix +++ b/modules/ags/packages.nix @@ -122,15 +122,14 @@ in { pname = "ags"; configPath = "${cfg.configDir}/@girs"; packages = filter (x: - x.pname != "astal4" && x.pname != "libadwaita") + x.pname != "libadwaita") cfg.astalLibs; - delete = ["gdk-4.0" "gtk-4.0" "gsk-4.0"]; }) // (buildGirTypes { pname = "ags"; configPath = "${gtk4ConfigDir}/@girs"; packages = filter (x: - x.pname != "astal3" && x.pname != "gtk-session-lock") + x.pname != "gtk-session-lock") cfg.astalLibs; }) // {