feat(ags): declare astal types in package.json
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2025-01-02 11:42:05 -05:00
parent 47b1910e38
commit 7fd5ab5bc3
10 changed files with 35 additions and 32 deletions

View file

@ -1,3 +1,2 @@
@girs
node_modules
tsconfig.json

View file

@ -1,3 +1,3 @@
{
npmDepsHash = "sha256-qn1+dIo7p1+PYlR2qAmnCrR8xE93mYbwNCjDYISgnqU=";
npmDepsHash = "sha256-8LRFd8CYdO7LM0pLuRmoUPam75aWj5GybqXgZVBTdVg=";
}

Binary file not shown.

View file

@ -3,6 +3,7 @@
"version": "0.0.0",
"main": "app.ts",
"dependencies": {
"astal": "https://gitpkg.vercel.app/Aylur/astal/lang/gjs/src?main",
"@eslint/js": "9.17.0",
"@stylistic/eslint-plugin": "2.12.1",
"eslint": "9.17.0",

View file

@ -0,0 +1,16 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"experimentalDecorators": true,
"jsx": "react-jsx",
"jsxImportSource": "astal/gtk3",
"lib": [
"ES2022"
],
"module": "ES2022",
"moduleResolution": "Bundler",
"noEmit": true,
"strict": true,
"target": "ES2022"
}
}

View file

@ -1,3 +1,2 @@
@girs
node_modules
tsconfig.json

View file

@ -0,0 +1,16 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"experimentalDecorators": true,
"jsx": "react-jsx",
"jsxImportSource": "astal/gtk4",
"lib": [
"ES2022"
],
"module": "ES2022",
"moduleResolution": "Bundler",
"noEmit": true,
"strict": true,
"target": "ES2022"
}
}

View file

@ -10,7 +10,7 @@ import {
noImplicitDestroy,
setChildren,
construct,
} from 'astal/_astal';
} from '../../node_modules/astal/_astal';
export type BindableChild = Gtk.Widget | Binding<Gtk.Widget>;

View file

@ -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
''

View file

@ -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