From 7fd5ab5bc394bafe453e7109c243be2482dab7cb Mon Sep 17 00:00:00 2001 From: matt1432 Date: Thu, 2 Jan 2025 11:42:05 -0500 Subject: [PATCH] feat(ags): declare astal types in package.json --- modules/ags/config/.gitignore | 1 - modules/ags/config/default.nix | 2 +- modules/ags/config/package-lock.json | Bin 72637 -> 73005 bytes modules/ags/config/package.json | 1 + modules/ags/config/tsconfig.json | 16 +++++++++++ modules/ags/gtk4/.gitignore | 1 - modules/ags/gtk4/tsconfig.json | 16 +++++++++++ .../ags/gtk4/widget/subclasses/astalify.ts | 2 +- modules/ags/packages.nix | 26 ------------------ modules/desktop/manager/ags.nix | 2 -- 10 files changed, 35 insertions(+), 32 deletions(-) create mode 100644 modules/ags/config/tsconfig.json create mode 100644 modules/ags/gtk4/tsconfig.json diff --git a/modules/ags/config/.gitignore b/modules/ags/config/.gitignore index be93e7dc..8dfae95e 100644 --- a/modules/ags/config/.gitignore +++ b/modules/ags/config/.gitignore @@ -1,3 +1,2 @@ @girs node_modules -tsconfig.json diff --git a/modules/ags/config/default.nix b/modules/ags/config/default.nix index 21a9ca87..d41bb99a 100644 --- a/modules/ags/config/default.nix +++ b/modules/ags/config/default.nix @@ -1,3 +1,3 @@ { - npmDepsHash = "sha256-qn1+dIo7p1+PYlR2qAmnCrR8xE93mYbwNCjDYISgnqU="; + npmDepsHash = "sha256-8LRFd8CYdO7LM0pLuRmoUPam75aWj5GybqXgZVBTdVg="; } diff --git a/modules/ags/config/package-lock.json b/modules/ags/config/package-lock.json index db2e211a9af912d8d2a5631e88a993f4c3d22f32..a53a6c6863f75aec9dabca587da536bb8bc8aaa0 100644 GIT binary patch delta 264 zcmdnHon`GVmJP0q_KC$Mi8)GE3Q8FzB?ZM+`ugdaB?Z~(dS$6a$*DPdi3J7vj+Hs3 zMfzZc`ZH6te#rnlX$@aO4nUfE`6PfH#%RX7alx4F&; diff --git a/modules/ags/packages.nix b/modules/ags/packages.nix index b91672f2..d2e88c24 100644 --- a/modules/ags/packages.nix +++ b/modules/ags/packages.nix @@ -117,28 +117,6 @@ in { buildNodeModules buildGirTypes ; - - mkTsConf = gtkVer: let - inherit (astal.packages.${pkgs.system}) gjs; - in - pkgs.writers.writeJSON "tsconfig.json" { - "$schema" = "https://json.schemastore.org/tsconfig"; - "compilerOptions" = { - "experimentalDecorators" = true; - "strict" = true; - "target" = "ES2022"; - "module" = "ES2022"; - "lib" = ["ES2022"]; - "moduleResolution" = "Bundler"; - "noEmit" = true; - "jsx" = "react-jsx"; - "jsxImportSource" = "${gjs}/share/astal/gjs/gtk${toString gtkVer}"; - "paths" = { - "astal" = ["${gjs}/share/astal/gjs"]; - "astal/*" = ["${gjs}/share/astal/gjs/*"]; - }; - }; - }; in ( (buildGirTypes { pname = "ags"; @@ -166,10 +144,6 @@ in { source = buildNodeModules ./config (import ./config).npmDepsHash; }; - "${cfg.configDir}/tsconfig.json".source = mkTsConf 3; - - "${gtk4ConfigDir}/tsconfig.json".source = mkTsConf 4; - "${cfg.configDir}/widgets/lockscreen/vars.ts".text = # javascript '' diff --git a/modules/desktop/manager/ags.nix b/modules/desktop/manager/ags.nix index 1ed498be..a65537f2 100644 --- a/modules/desktop/manager/ags.nix +++ b/modules/desktop/manager/ags.nix @@ -14,11 +14,9 @@ self: { homeFiles = config.home-manager.users.${cfg.user}.home.file; nodeModules = homeFiles."${agsCfg.configDir}/node_modules".source; - tsconfig = homeFiles."${agsCfg.configDir}/tsconfig.json".source; varsTs = homeFiles."${agsCfg.configDir}/widgets/lockscreen/vars.ts".source; in pkgs.runCommandLocal "agsConfig" {} '' - cp -ar ${tsconfig} ./tsconfig.json cp -ar ${../../ags/config}/* ./. chmod +w -R ./. cp -ar ${varsTs} ./widgets/lockscreen/vars.ts