From 46836496aa08340d82bdea8ca82704040cbb36f1 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Fri, 8 Nov 2024 13:54:14 +0100 Subject: [PATCH] Clan-ts-api: filter out reserved tags from typescript, library generates invalid types --- pkgs/clan-cli/flake-module.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/clan-cli/flake-module.nix b/pkgs/clan-cli/flake-module.nix index ccd4cc847..297c4ee8d 100644 --- a/pkgs/clan-cli/flake-module.nix +++ b/pkgs/clan-cli/flake-module.nix @@ -88,6 +88,7 @@ buildInputs = [ pkgs.python3 pkgs.json2ts + pkgs.jq ]; installPhase = '' @@ -98,7 +99,9 @@ json2ts --input $out/API.json > $out/API.ts # Retrieve python API Typescript types - json2ts --input ${self'.legacyPackages.schemas.inventory}/schema.json > $out/Inventory.ts + # delete the reserved tags from typechecking because the conversion library doesn't support them + jq 'del(.properties.tags.properties)' ${self'.legacyPackages.schemas.inventory}/schema.json > schema.json + json2ts --input schema.json > $out/Inventory.ts cp ${self'.legacyPackages.schemas.inventory}/* $out ''; };