feat(node): make function to make girs types and move it to lib
This commit is contained in:
parent
aa9723303b
commit
7a3ea83d40
7 changed files with 58 additions and 24 deletions
lib/mk-types
1
lib/mk-types/.envrc
Normal file
1
lib/mk-types/.envrc
Normal file
|
@ -0,0 +1 @@
|
|||
use flake $FLAKE#node
|
32
lib/mk-types/default.nix
Normal file
32
lib/mk-types/default.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
lib,
|
||||
pname,
|
||||
withGirNames,
|
||||
buildNpmPackage,
|
||||
ts-for-gir-src,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) concatMapStringsSep;
|
||||
in
|
||||
buildNpmPackage {
|
||||
pname = "${pname}-types";
|
||||
version = "0.0.0";
|
||||
|
||||
npmDepsHash = "sha256-8De8tRUKzRhD1jyx0anYNPMhxZyIr2nI45HdK6nb8jI=";
|
||||
|
||||
src = ./.;
|
||||
dontNpmBuild = true;
|
||||
|
||||
buildPhase = ''
|
||||
npx @ts-for-gir/cli generate ${concatMapStringsSep " " (p: p.girName) withGirNames} \
|
||||
${concatMapStringsSep "\n" (p: "-g ${p.package.dev}/share/gir-1.0 \\") withGirNames}
|
||||
-g ${ts-for-gir-src}/girs \
|
||||
--ignoreVersionConflicts \
|
||||
--package \
|
||||
-e gjs -o ./types
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
cp -r ./types $out
|
||||
'';
|
||||
}
|
1204
lib/mk-types/package-lock.json
generated
Normal file
1204
lib/mk-types/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
5
lib/mk-types/package.json
Normal file
5
lib/mk-types/package.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"@ts-for-gir/cli": "^3.3.0"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue