Skip to content

Commit

Permalink
Merge pull request #2946 from input-output-hk/dashboard-provide-contr…
Browse files Browse the repository at this point in the history
…acts

marlowe-dashboard-client: provide contracts.json
  • Loading branch information
gilligan committed Apr 8, 2021
2 parents 215b9a9 + ac7efd3 commit f2e5348
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions default.nix
Expand Up @@ -65,10 +65,10 @@ rec {

marlowe-dashboard = pkgs.recurseIntoAttrs rec {
inherit (pkgs.callPackage ./marlowe-dashboard-client {
inherit plutus-pab;
inherit plutus-pab marlowe-app;
inherit (plutus.lib) buildPursPackage buildNodeModules filterNpm gitignore-nix;
inherit webCommon webCommonMarlowe;
}) client server-invoker generated-purescript generate-purescript;
}) client server-invoker generated-purescript generate-purescript contractsJSON;
};

marlowe-marketplace = pkgs.recurseIntoAttrs rec {
Expand Down
3 changes: 3 additions & 0 deletions marlowe-dashboard-client/.gitignore
Expand Up @@ -12,3 +12,6 @@ yarn.lock
.psc-package2nix/
.spago/
.spago2nix/
# contracts is a symlink provided via the nix build
# and should be ignored
contracts
9 changes: 7 additions & 2 deletions marlowe-dashboard-client/default.nix
@@ -1,4 +1,4 @@
{ pkgs, gitignore-nix, webCommon, webCommonMarlowe, buildPursPackage, buildNodeModules, filterNpm, plutus-pab }:
{ pkgs, gitignore-nix, webCommon, webCommonMarlowe, buildPursPackage, buildNodeModules, filterNpm, plutus-pab, marlowe-app }:
let
cleanSrc = gitignore-nix.gitignoreSource ./.;

Expand All @@ -9,6 +9,10 @@ let
githubSourceHashMap = { };
};

contractsJSON = pkgs.writeTextDir "contracts.json" (builtins.toJSON {
marlowe = "${marlowe-app}/bin/marlowe-app";
});

client = buildPursPackage {
inherit pkgs nodeModules;
src = cleanSrc;
Expand All @@ -20,12 +24,13 @@ let
web-common = webCommon;
web-common-marlowe = webCommonMarlowe;
generated = plutus-pab.generated-purescript;
contracts = contractsJSON;
};
packages = pkgs.callPackage ./packages.nix { };
spagoPackages = pkgs.callPackage ./spago-packages.nix { };
};
in
{
inherit (plutus-pab) server-invoker generated-purescript generate-purescript start-backend;
inherit client;
inherit client contractsJSON;
}
3 changes: 2 additions & 1 deletion marlowe-dashboard-client/package.json
Expand Up @@ -12,7 +12,8 @@
"test:watch": "spago test --no-psa --watch",
"docs": "spago docs",
"repl": "spago repl",
"start": "npm install && plutus-pab-generate-purs && npm run purs:compile && npm run webpack:server"
"start": "npm install && plutus-pab-generate-purs && npm run link-contracts && npm run purs:compile && npm run webpack:server",
"link-contracts": "nix-build ../default.nix -A marlowe-dashboard.contractsJSON -o contracts"
},
"dependencies": {
"json-bigint": "^1.0.0"
Expand Down

0 comments on commit f2e5348

Please sign in to comment.