2026-09-22 13:51:32 -07:00
|
|
|
{
|
|
|
|
|
pkgs,
|
|
|
|
|
context,
|
|
|
|
|
src,
|
|
|
|
|
members,
|
|
|
|
|
dependencies ? null,
|
|
|
|
|
}:
|
|
|
|
|
let
|
|
|
|
|
config = pkgs.writeText "camino-react-contracts.json" (
|
|
|
|
|
builtins.toJSON {
|
2026-09-30 22:03:17 -07:00
|
|
|
source = import ./implementation-source.nix {
|
|
|
|
|
inherit (pkgs) lib;
|
|
|
|
|
inherit src;
|
|
|
|
|
};
|
|
|
|
|
interface = builtins.toFile "camino-interface-contract.json" (
|
|
|
|
|
builtins.unsafeDiscardStringContext (
|
|
|
|
|
builtins.toJSON (
|
|
|
|
|
let
|
|
|
|
|
resource = builtins.fromJSON (builtins.readFile context.interface);
|
|
|
|
|
in
|
|
|
|
|
{
|
|
|
|
|
kind = resource.kind;
|
|
|
|
|
revision = builtins.removeAttrs resource.revision [ "source" ];
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
);
|
2026-09-22 13:51:32 -07:00
|
|
|
inherit members dependencies;
|
2026-09-28 21:05:55 -07:00
|
|
|
reactSdk = context.reactSdk or null;
|
2026-09-22 13:51:32 -07:00
|
|
|
node = "${pkgs.nodejs_24}/bin/node";
|
|
|
|
|
tsc = "${context.typescript}/node_modules/typescript/bin/tsc";
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
in
|
|
|
|
|
pkgs.runCommand "camino-react-contracts" { } ''
|
|
|
|
|
${pkgs.nodejs_24}/bin/node ${./.}/build-react-contracts.mjs ${config}
|
|
|
|
|
''
|