feat(ags): declare astal types in package.json
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
47b1910e38
commit
7fd5ab5bc3
10 changed files with 35 additions and 32 deletions
1
modules/ags/config/.gitignore
vendored
1
modules/ags/config/.gitignore
vendored
|
@ -1,3 +1,2 @@
|
|||
@girs
|
||||
node_modules
|
||||
tsconfig.json
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
npmDepsHash = "sha256-qn1+dIo7p1+PYlR2qAmnCrR8xE93mYbwNCjDYISgnqU=";
|
||||
npmDepsHash = "sha256-8LRFd8CYdO7LM0pLuRmoUPam75aWj5GybqXgZVBTdVg=";
|
||||
}
|
||||
|
|
BIN
modules/ags/config/package-lock.json
generated
BIN
modules/ags/config/package-lock.json
generated
Binary file not shown.
|
@ -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",
|
||||
|
|
16
modules/ags/config/tsconfig.json
Normal file
16
modules/ags/config/tsconfig.json
Normal 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"
|
||||
}
|
||||
}
|
1
modules/ags/gtk4/.gitignore
vendored
1
modules/ags/gtk4/.gitignore
vendored
|
@ -1,3 +1,2 @@
|
|||
@girs
|
||||
node_modules
|
||||
tsconfig.json
|
||||
|
|
16
modules/ags/gtk4/tsconfig.json
Normal file
16
modules/ags/gtk4/tsconfig.json
Normal 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"
|
||||
}
|
||||
}
|
|
@ -10,7 +10,7 @@ import {
|
|||
noImplicitDestroy,
|
||||
setChildren,
|
||||
construct,
|
||||
} from 'astal/_astal';
|
||||
} from '../../node_modules/astal/_astal';
|
||||
|
||||
export type BindableChild = Gtk.Widget | Binding<Gtk.Widget>;
|
||||
|
||||
|
|
|
@ -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
|
||||
''
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue