From b878e76c1bc24e1f1c84f8f509843162f3ec26bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillem=20C=C3=B3rdoba?= Date: Tue, 28 Feb 2023 23:28:21 +0100 Subject: [PATCH 01/24] Fixed question text --- src/scaffold/entry_type/fields.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/scaffold/entry_type/fields.rs b/src/scaffold/entry_type/fields.rs index 0a347be57..361120bfc 100644 --- a/src/scaffold/entry_type/fields.rs +++ b/src/scaffold/entry_type/fields.rs @@ -220,7 +220,9 @@ pub fn choose_field( let maybe_linked_from = match &field_type { FieldType::AgentPubKey => { let link_from = Confirm::with_theme(&ColorfulTheme::default()) - .with_prompt("Should a link from this field be created when this entry is created?") + .with_prompt( + "Should a link from the AgentPubKey provided in this field also be created when entries of this type are created?" + ) .interact()?; match link_from { @@ -240,7 +242,9 @@ pub fn choose_field( } else { let link_from = Confirm::with_theme(&ColorfulTheme::default()) .with_prompt( - "Should a link from this field be created when this entry is created?", + format!( + "Should a link from the {} provided in this field also be created when entries of this type are created?", + field_type.to_string()) ) .interact()?; From df4a4b3a0315eaf79e2419bbf3336602b97ce920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillem=20C=C3=B3rdoba?= Date: Sun, 12 Mar 2023 21:13:24 +0100 Subject: [PATCH 02/24] Fixed readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4c8d51193..86a41d6a5 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ CLI to easily generate and edit holochain apps. The easiest way to start using the scaffolding tool is through holonix: ```bash -nix-shell https://holochain.love +nix run github:holochain/holochain#hc-scaffold -- example forum hc-scaffold --version ``` From 4e8efa50b62b7590fc410f05506fd54b825bab87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillem=20C=C3=B3rdoba?= Date: Mon, 13 Mar 2023 13:18:16 +0100 Subject: [PATCH 03/24] extend space --- .github/workflows/test.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 29d7998a6..b25a53493 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -13,6 +13,16 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Maximize build space + uses: easimon/maximize-build-space@v6 + with: + remove-dotnet: true + remove-android: true + remove-haskell: true + build-mount-path: /mnt/extended + root-reserve-mb: 512 + swap-size-mb: 1024 + - name: Install nix uses: cachix/install-nix-action@v18 with: @@ -20,7 +30,7 @@ jobs: extra_nix_config: | experimental-features = flakes nix-command - - uses: cachix/cachix-action@v10 + - uses: cachix/cachix-action@v12 with: name: holochain-ci From 81d31750c805cc7ada90b39db21629ad004fed55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillem=20C=C3=B3rdoba?= Date: Mon, 13 Mar 2023 13:23:12 +0100 Subject: [PATCH 04/24] extend space --- .github/workflows/test.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b25a53493..96515ae6e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -19,7 +19,6 @@ jobs: remove-dotnet: true remove-android: true remove-haskell: true - build-mount-path: /mnt/extended root-reserve-mb: 512 swap-size-mb: 1024 From dd239c6650312750d876654723a851158eec2e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillem=20C=C3=B3rdoba?= Date: Mon, 13 Mar 2023 13:32:31 +0100 Subject: [PATCH 05/24] extend space --- .github/workflows/test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 96515ae6e..42b748804 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -35,5 +35,6 @@ jobs: - name: Install and test run: | + ls nix develop --command bash -c "cargo install --path . && sh run_test.sh" From fe11f68ee439636abb7cb94f381e4dc8d814f4a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillem=20C=C3=B3rdoba?= Date: Mon, 13 Mar 2023 13:34:37 +0100 Subject: [PATCH 06/24] Attempt fix CI --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 42b748804..3d7cc0b23 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -35,6 +35,6 @@ jobs: - name: Install and test run: | - ls + cd $GITHUB_WORKSPACE nix develop --command bash -c "cargo install --path . && sh run_test.sh" From 2db984177b9272ced1ce9a7a276c3a3344f8b1e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillem=20C=C3=B3rdoba?= Date: Mon, 13 Mar 2023 13:36:54 +0100 Subject: [PATCH 07/24] Attempt fix CI --- .github/workflows/test.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3d7cc0b23..65c3a3ce6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -11,8 +11,6 @@ jobs: testbuild: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Maximize build space uses: easimon/maximize-build-space@v6 with: @@ -21,7 +19,9 @@ jobs: remove-haskell: true root-reserve-mb: 512 swap-size-mb: 1024 - + + - uses: actions/checkout@v2 + - name: Install nix uses: cachix/install-nix-action@v18 with: From 975fea9d4725b1df7eabfa9f84a972f68e81890c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillem=20C=C3=B3rdoba?= Date: Mon, 13 Mar 2023 13:41:03 +0100 Subject: [PATCH 08/24] Attempt fix CI --- .github/actions/extend-space.yaml | 61 +++++++++++++++++++++++++++++++ .github/workflows/test.yaml | 10 +---- 2 files changed, 63 insertions(+), 8 deletions(-) create mode 100644 .github/actions/extend-space.yaml diff --git a/.github/actions/extend-space.yaml b/.github/actions/extend-space.yaml new file mode 100644 index 000000000..67ccc0cb7 --- /dev/null +++ b/.github/actions/extend-space.yaml @@ -0,0 +1,61 @@ +# Extends disk space on github hosted runners + + +name: "Extend space" +description: "Teases out as much free space as possible" + +runs: + using: "composite" + steps: + - name: Create mountpoint for extended space + shell: "bash" + run: sudo mkdir /mnt/extended + + - name: Maximize build space + uses: easimon/maximize-build-space@v6 + # uses: AdityaGarg8/remove-unwanted-software@v1 + with: + remove-dotnet: true + remove-android: true + remove-haskell: true + build-mount-path: /mnt/extended + root-reserve-mb: 512 + swap-size-mb: 1024 + + # after we've got the extended space mounted, we can use overlayfs and bind + # mounts as appropriate to make this space available to all paths that are + # expected to be written to. + # + # for new directories (such as /nix), a bind mount is enough for existing + # directories (such as $HOME and /tmp), we use an overlay to preserve access + # to the existing files, while redirecting changes to the extended space. + - name: Use extended space for /nix, /tmp, /var/tmp, and $HOME + shell: "bash" + run: | + export EXTENDED_PATH=/mnt/extended + sudo mkdir $EXTENDED_PATH/{tmp,nix,home} + sudo mkdir $EXTENDED_PATH/tmp/{upper,work} + sudo mv /tmp{,_lower} + sudo mkdir /tmp + sudo mount -t overlay overlay \ + -o lowerdir=/tmp_lower,upperdir=$EXTENDED_PATH/tmp/upper,workdir=$EXTENDED_PATH/tmp/work \ + /tmp + sudo chown $(id -u):$(id -g) /tmp + sudo mkdir -p $EXTENDED_PATH/var/tmp/{upper,work} + sudo mv /var/tmp{,_lower} + sudo mkdir -p /var/tmp + sudo mount -t overlay overlay \ + -o lowerdir=/var/tmp_lower,upperdir=$EXTENDED_PATH/var/tmp/upper,workdir=$EXTENDED_PATH/var/tmp/work \ + /var/tmp + sudo chown $(id -u):$(id -g) /var/tmp + sudo mkdir /nix + sudo mount -o bind $EXTENDED_PATH/nix /nix + sudo mkdir $EXTENDED_PATH/home/{upper,work} + sudo mv ${HOME} ${HOME}_lower + sudo mkdir ${HOME} + sudo chown $(id -u):$(id -g) $HOME + sudo mount -t overlay overlay \ + -o lowerdir=${HOME}_lower,upperdir=$EXTENDED_PATH/home/upper,workdir=$EXTENDED_PATH/home/work \ + $HOME + sudo chown $(id -u):$(id -g) $HOME + df -h diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 65c3a3ce6..072d959bc 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -11,14 +11,8 @@ jobs: testbuild: runs-on: ubuntu-latest steps: - - name: Maximize build space - uses: easimon/maximize-build-space@v6 - with: - remove-dotnet: true - remove-android: true - remove-haskell: true - root-reserve-mb: 512 - swap-size-mb: 1024 + - name: Extend space + uses: ./.github/actions/extend-space - uses: actions/checkout@v2 From 40821553b49fcc09e2b949f3d8904105925c30af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillem=20C=C3=B3rdoba?= Date: Mon, 13 Mar 2023 13:49:50 +0100 Subject: [PATCH 09/24] Attempt fix CI --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 072d959bc..46b42b25c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -11,10 +11,10 @@ jobs: testbuild: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v2 + - name: Extend space uses: ./.github/actions/extend-space - - - uses: actions/checkout@v2 - name: Install nix uses: cachix/install-nix-action@v18 From 028d42d101c33614206f7928e6862af9a032bf1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillem=20C=C3=B3rdoba?= Date: Mon, 13 Mar 2023 14:03:42 +0100 Subject: [PATCH 10/24] Attempt fix CI --- .github/actions/{extend-space.yaml => extend-space/action.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/actions/{extend-space.yaml => extend-space/action.yaml} (100%) diff --git a/.github/actions/extend-space.yaml b/.github/actions/extend-space/action.yaml similarity index 100% rename from .github/actions/extend-space.yaml rename to .github/actions/extend-space/action.yaml From 01fad1442ca55d86575ff77324d348b288a345f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillem=20C=C3=B3rdoba?= Date: Mon, 13 Mar 2023 14:25:24 +0100 Subject: [PATCH 11/24] Upped flake --- flake.lock | 53 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/flake.lock b/flake.lock index 84294e96d..7c238b7e2 100644 --- a/flake.lock +++ b/flake.lock @@ -178,6 +178,7 @@ ], "nix-filter": "nix-filter", "nixpkgs": "nixpkgs", + "pre-commit-hooks-nix": "pre-commit-hooks-nix", "rust-overlay": "rust-overlay_2", "scaffolding": [ "holochain", @@ -187,11 +188,11 @@ "versions": "versions" }, "locked": { - "lastModified": 1676891757, - "narHash": "sha256-ePV3nenCyz1IP1bnS074G4ZZmy6oZW8/WhChC1jHj2Y=", + "lastModified": 1678710664, + "narHash": "sha256-TSfZNIrGk3fA79NzyJuN5aHcOtreNForzHXPFU5QbAg=", "owner": "holochain", "repo": "holochain", - "rev": "788ca7083f7dd70c7cef6672008688e12297bc37", + "rev": "e2a1a5cb5e8cf48785736339c064ea9290611877", "type": "github" }, "original": { @@ -237,11 +238,11 @@ "launcher": { "flake": false, "locked": { - "lastModified": 1675974122, - "narHash": "sha256-eSYSMR4fHnwgquWaFZM2DOl7LRTsDrOGZTYkDc8HE3Q=", + "lastModified": 1677270906, + "narHash": "sha256-/xT//6nqhjpKLMMv41JE0W3H5sE9jKMr8Dedr88D4N8=", "owner": "holochain", "repo": "launcher", - "rev": "3bcd14e81cda07e015071b070c2ef032aa1d1193", + "rev": "1ad188a43900c139e52df10a21e3722f41dfb967", "type": "github" }, "original": { @@ -268,11 +269,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1676721149, - "narHash": "sha256-mN2EpTGxxVNnFZLoLWRwh6f7UWhXy4qE+wO2CZyrXps=", + "lastModified": 1678654296, + "narHash": "sha256-aVfw3ThpY7vkUeF1rFy10NAkpKDS2imj3IakrzT0Occ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5f4e07deb7c44f27d498f8df9c5f34750acf52d2", + "rev": "5a1dc8acd977ff3dccd1328b7c4a6995429a656b", "type": "github" }, "original": { @@ -299,6 +300,22 @@ "type": "github" } }, + "pre-commit-hooks-nix": { + "flake": false, + "locked": { + "lastModified": 1676513100, + "narHash": "sha256-MK39nQV86L2ag4TmcK5/+r1ULpzRLPbbfvWbPvIoYJE=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "5f0cba88ac4d6dd8cad5c6f6f1540b3d6a21a798", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { "holochain": "holochain", @@ -344,11 +361,11 @@ ] }, "locked": { - "lastModified": 1676860326, - "narHash": "sha256-Rsvi4Zl6N7phhC7RMoh05gAHSwTzWG+c+iR+/X0RqWU=", + "lastModified": 1678674283, + "narHash": "sha256-MnFqHP7AwvjK3VLRmDnzbJWSL8lbDrmYESjQDaRmAVo=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "98f11700e398cf2ae6da905df56badc17e265021", + "rev": "f25d4bc2f6a0a3f9a2f15d3b9e3edb0ee5099a3d", "type": "github" }, "original": { @@ -360,11 +377,11 @@ "scaffolding": { "flake": false, "locked": { - "lastModified": 1676478168, - "narHash": "sha256-sCcmhrmiji83+80P4q7RIDHF+LGp2VkfKvTHoz+XBmE=", + "lastModified": 1677514461, + "narHash": "sha256-xflYnH6whXRqXFAqY2MHVXTWWcesn9OzZuyNhdXjsgo=", "owner": "holochain", "repo": "scaffolding", - "rev": "b95929a492a2d039d7c40fb95f66c0fa8c222377", + "rev": "c245d306110f3a5408f1dbe15d6a3725884ef3f4", "type": "github" }, "original": { @@ -383,11 +400,11 @@ }, "locked": { "dir": "versions/0_1", - "lastModified": 1676891757, - "narHash": "sha256-ePV3nenCyz1IP1bnS074G4ZZmy6oZW8/WhChC1jHj2Y=", + "lastModified": 1678710664, + "narHash": "sha256-TSfZNIrGk3fA79NzyJuN5aHcOtreNForzHXPFU5QbAg=", "owner": "holochain", "repo": "holochain", - "rev": "788ca7083f7dd70c7cef6672008688e12297bc37", + "rev": "e2a1a5cb5e8cf48785736339c064ea9290611877", "type": "github" }, "original": { From c5d84c1e51da66ae6bfc555db515d5ee3791541d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillem=20C=C3=B3rdoba?= Date: Fri, 17 Mar 2023 11:20:49 +0100 Subject: [PATCH 12/24] Update README.md --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 86a41d6a5..3e7a14a54 100644 --- a/README.md +++ b/README.md @@ -7,15 +7,16 @@ CLI to easily generate and edit holochain apps. The easiest way to start using the scaffolding tool is through holonix: ```bash -nix run github:holochain/holochain#hc-scaffold -- example forum -hc-scaffold --version +nix run github:holochain/holochain#hc-scaffold -- --version ``` Should print the version of the scaffolding tool. ## Usage -These are the commands that you can run with the scaffolding tool: +Refer to [the holochain developer instructions](https://developer.holochain.org/get-building/) to know how you can use the scaffolding tool to create your own apps. + +These are the commands that you can run with the scaffolding tool inside of a holonix develop shell: ```bash # Scaffold an example app From a9496c46b72638f916c989cb28d06b6dc22aade5 Mon Sep 17 00:00:00 2001 From: Eric Harris-Braun Date: Tue, 28 Mar 2023 16:55:22 -0400 Subject: [PATCH 13/24] updates hello-world --- .gitignore | 2 +- flake.lock | 6 +- src/cli.rs | 151 ++++++++++-------- src/scaffold/entry_type.rs | 19 ++- src/scaffold/zome.rs | 4 +- src/scaffold/zome/coordinator.rs | 20 ++- templates/vanilla/example/Cargo.toml.hbs | 19 +++ .../dnas/hello_world/workdir/dna.yaml.hbs | 19 +++ .../coordinator/hello_world/Cargo.toml.hbs | 15 ++ .../coordinator/hello_world/src/lib.rs.hbs | 59 +++++++ .../integrity/hello_world/Cargo.toml.hbs | 13 ++ .../integrity/hello_world/src/lib.rs.hbs | 49 ++++++ templates/vanilla/example/ui/index.html.hbs | 75 +++++++-- templates/vanilla/example/ui/package.json | 27 ++++ .../vanilla/example/workdir/happ.yaml.hbs | 18 +++ .../vanilla/example/workdir/web-happ.yaml.hbs | 7 + 16 files changed, 413 insertions(+), 90 deletions(-) create mode 100644 templates/vanilla/example/Cargo.toml.hbs create mode 100644 templates/vanilla/example/dnas/hello_world/workdir/dna.yaml.hbs create mode 100644 templates/vanilla/example/dnas/hello_world/zomes/coordinator/hello_world/Cargo.toml.hbs create mode 100644 templates/vanilla/example/dnas/hello_world/zomes/coordinator/hello_world/src/lib.rs.hbs create mode 100644 templates/vanilla/example/dnas/hello_world/zomes/integrity/hello_world/Cargo.toml.hbs create mode 100644 templates/vanilla/example/dnas/hello_world/zomes/integrity/hello_world/src/lib.rs.hbs create mode 100644 templates/vanilla/example/ui/package.json create mode 100644 templates/vanilla/example/workdir/happ.yaml.hbs create mode 100644 templates/vanilla/example/workdir/web-happ.yaml.hbs diff --git a/.gitignore b/.gitignore index 89a98ca76..971de4a60 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,4 @@ yarn-error.log* *.sln *.sw? result* -.cargo \ No newline at end of file +.cargo diff --git a/flake.lock b/flake.lock index 7c238b7e2..497bc611c 100644 --- a/flake.lock +++ b/flake.lock @@ -400,11 +400,11 @@ }, "locked": { "dir": "versions/0_1", - "lastModified": 1678710664, - "narHash": "sha256-TSfZNIrGk3fA79NzyJuN5aHcOtreNForzHXPFU5QbAg=", + "lastModified": 1680021245, + "narHash": "sha256-ZU9GnDe50X7ruCgFiGGB7gzJdhIKORq2BqlPIgTQPc4=", "owner": "holochain", "repo": "holochain", - "rev": "e2a1a5cb5e8cf48785736339c064ea9290611877", + "rev": "c50ffc91db8dc80a3db2efd01411ce6be99533f1", "type": "github" }, "original": { diff --git a/src/cli.rs b/src/cli.rs index 65c0b4616..d3f9f1c7d 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,6 +1,6 @@ use crate::error::{ScaffoldError, ScaffoldResult}; use crate::file_tree::{ - dir_content, file_content, insert_file, load_directory_into_memory, FileTree, + dir_content, file_content, load_directory_into_memory, FileTree, }; use crate::scaffold::app::cargo::exec_metadata; use crate::scaffold::app::nix::setup_nix_developer_environment; @@ -578,6 +578,7 @@ Add new entry definitions to your zome with: zome_file_tree, &template_file_tree, &name, + false, &crud, &reference_entry_hash, &link_from_original_to_each_update, @@ -735,68 +736,89 @@ Collection "{}" scaffolded! false, )?; - // scaffold dna hello_world - let dna_name = String::from("hello_world"); - - let app_file_tree = - AppFileTree::get_or_choose(file_tree, &Some(name.clone()))?; - let ScaffoldedTemplate { file_tree, .. } = - scaffold_dna(app_file_tree, &template_file_tree, &dna_name)?; - - // scaffold integrity zome hello_world - let dna_file_tree = - DnaFileTree::get_or_choose(file_tree, &Some(dna_name.clone()))?; - let dna_manifest_path = dna_file_tree.dna_manifest_path.clone(); - - let integrity_zome_name = String::from("hello_world_integrity"); - let integrity_zome_path = PathBuf::new() - .join("dnas") - .join(&dna_name) - .join("zomes") - .join("integrity"); - let ScaffoldedTemplate { file_tree, .. } = - scaffold_integrity_zome_with_path( - dna_file_tree, - &template_file_tree, - &integrity_zome_name, - &integrity_zome_path, - )?; - - // scaffold integrity zome hello_world - let dna_file_tree = - DnaFileTree::from_dna_manifest_path(file_tree, &dna_manifest_path)?; - - let coordinator_zome_name = String::from("hello_world"); - let coordinator_zome_path = PathBuf::new() - .join("dnas") - .join(dna_name) - .join("zomes") - .join("coordinator"); - let ScaffoldedTemplate { mut file_tree, .. } = - scaffold_coordinator_zome_in_path( - dna_file_tree, - &template_file_tree, - &coordinator_zome_name, - &Some(vec![integrity_zome_name]), - &coordinator_zome_path, - )?; - - // Add "hello_world" function to coordinator - let hello_world_zome = format!( - r#"use hdk::prelude::*; - -#[hdk_extern] -pub fn hello_world(_: ()) -> ExternResult {{ - Ok(String::from("hello world from a Holochain app!")) -}} -"# - ); - - insert_file( - &mut file_tree, - &coordinator_zome_path.join("hello_world/src/lib.rs"), - &hello_world_zome, - )?; + // // scaffold dna hello_world + // let dna_name = String::from("hello_world"); + + // let app_file_tree = + // AppFileTree::get_or_choose(file_tree, &Some(name.clone()))?; + // let ScaffoldedTemplate { file_tree, .. } = + // scaffold_dna(app_file_tree, &template_file_tree, &dna_name)?; + + // // scaffold integrity zome hello_world + // let dna_file_tree = + // DnaFileTree::get_or_choose(file_tree, &Some(dna_name.clone()))?; + // let dna_manifest_path = dna_file_tree.dna_manifest_path.clone(); + + // let integrity_zome_name = String::from("hello_world_integrity"); + // let integrity_zome_path = PathBuf::new() + // .join("dnas") + // .join(&dna_name) + // .join("zomes") + // .join("integrity"); + // let ScaffoldedTemplate { file_tree, .. } = + // scaffold_integrity_zome_with_path( + // dna_file_tree, + // &template_file_tree, + // &integrity_zome_name, + // &integrity_zome_path, + // )?; + + // // scaffold integrity zome hello_world + // let dna_file_tree = + // DnaFileTree::from_dna_manifest_path(file_tree, &dna_manifest_path)?; + + // let coordinator_zome_name = String::from("hello_world"); + // let coordinator_zome_path = PathBuf::new() + // .join("dnas") + // .join(dna_name) + // .join("zomes") + // .join("coordinator"); + // let ScaffoldedTemplate { file_tree, .. } = + // scaffold_coordinator_zome_in_path( + // dna_file_tree, + // &template_file_tree, + // &coordinator_zome_name, + // true, + // &Some(vec![integrity_zome_name.clone()]), + // &coordinator_zome_path, + // )?; + + + // // Scaffold the app here to enable ZomeFileTree::from_manifest(), which calls `cargo metadata` + // MergeableFileSystemTree::::from(file_tree.clone()) + // .build(&app_dir)?; + + // std::env::set_current_dir(&app_dir)?; + + // let dna_file_tree = + // DnaFileTree::from_dna_manifest_path(file_tree, &dna_manifest_path)?; + + // let zome_file_tree = ZomeFileTree::get_or_choose_integrity( + // dna_file_tree, + // &Some(integrity_zome_name.clone()), + // )?; + + // let ScaffoldedTemplate { file_tree, .. } = scaffold_entry_type( + // zome_file_tree, + // &template_file_tree, + // &String::from("hello"), + // true, + // &Some(Crud { + // update: false, + // delete: false, + // }), + // &Some(false), + // &Some(true), + // &Some(vec![ + // FieldDefinition { + // field_name: String::from("hello"), + // field_type: FieldType::String, + // widget: None, + // cardinality: Cardinality::Single, + // linked_from: None, + // }, + // ]), + // )?; file_tree } @@ -852,6 +874,7 @@ pub fn hello_world(_: ()) -> ExternResult {{ dna_file_tree, &template_file_tree, &coordinator_zome_name, + false, &Some(vec![integrity_zome_name.clone()]), &coordinator_zome_path, )?; @@ -874,6 +897,7 @@ pub fn hello_world(_: ()) -> ExternResult {{ zome_file_tree, &template_file_tree, &String::from("post"), + false, &Some(Crud { update: true, delete: true, @@ -910,6 +934,7 @@ pub fn hello_world(_: ()) -> ExternResult {{ zome_file_tree, &template_file_tree, &String::from("comment"), + false, &Some(Crud { update: false, delete: true, diff --git a/src/scaffold/entry_type.rs b/src/scaffold/entry_type.rs index c4b040eb8..d3429d376 100644 --- a/src/scaffold/entry_type.rs +++ b/src/scaffold/entry_type.rs @@ -75,6 +75,7 @@ pub fn scaffold_entry_type( zome_file_tree: ZomeFileTree, template_file_tree: &FileTree, name: &String, + simplified: bool, // skips all crud functions and simplifies inital lib files maybe_crud: &Option, maybe_reference_entry_hash: &Option, maybe_link_from_original_to_each_update: &Option, @@ -208,16 +209,18 @@ pub fn scaffold_entry_type( )?; } - let zome_file_tree = + let mut zome_file_tree = ZomeFileTree::from_zome_manifest(zome_file_tree.dna_file_tree, coordinator_zome.clone())?; - let zome_file_tree = add_crud_functions_to_coordinator( - zome_file_tree, - &integrity_zome_name, - &entry_def, - &crud, - link_from_original_to_each_update, - )?; + if !simplified { + zome_file_tree = add_crud_functions_to_coordinator( + zome_file_tree, + &integrity_zome_name, + &entry_def, + &crud, + link_from_original_to_each_update, + )?; + } let dna_manifest = zome_file_tree.dna_file_tree.dna_manifest.clone(); diff --git a/src/scaffold/zome.rs b/src/scaffold/zome.rs index d853f8b5b..344ba2532 100644 --- a/src/scaffold/zome.rs +++ b/src/scaffold/zome.rs @@ -430,6 +430,7 @@ pub fn scaffold_coordinator_zome_in_path( dna_file_tree: DnaFileTree, template_file_tree: &FileTree, zome_name: &String, + simplified: bool, dependencies: &Option>, path: &PathBuf, ) -> ScaffoldResult { @@ -452,7 +453,7 @@ pub fn scaffold_coordinator_zome_in_path( let zome: FileTree = dir! { "Cargo.toml" => file!(coordinator::initial_cargo_toml(zome_name, dependencies)), "src" => dir! { - "lib.rs" => file!(coordinator::initial_lib_rs(dependencies)) + "lib.rs" => file!(coordinator::initial_lib_rs(simplified, dependencies)) } }; @@ -496,6 +497,7 @@ pub fn scaffold_coordinator_zome( dna_file_tree, template_file_tree, zome_name, + false, dependencies, &path_to_scaffold_in, ) diff --git a/src/scaffold/zome/coordinator.rs b/src/scaffold/zome/coordinator.rs index 3c94172de..382c3f56a 100644 --- a/src/scaffold/zome/coordinator.rs +++ b/src/scaffold/zome/coordinator.rs @@ -43,7 +43,7 @@ serde = {{ workspace = true }} ) } -pub fn initial_lib_rs(dependencies: &Option>) -> String { +pub fn initial_lib_rs(simplified: bool, dependencies: &Option>) -> String { let integrity_imports = match dependencies { None => String::from(""), Some(deps) => { @@ -55,8 +55,20 @@ pub fn initial_lib_rs(dependencies: &Option>) -> String { s } }; - - format!( + if simplified { + format!( + r#"use hdk::prelude::*; + {integrity_imports} + + /// Called the first time a zome call is made to the cell containing this zome + #[hdk_extern] + pub fn init(_: ()) -> ExternResult {{ + Ok(InitCallbackResult::Pass) + }} +"#) + } + else { + format!( r#"use hdk::prelude::*; {integrity_imports} @@ -89,7 +101,7 @@ fn signal_action(action: SignedActionHashed) -> ExternResult<()> {{ }} "# - ) + )} } fn choose_extern_function( diff --git a/templates/vanilla/example/Cargo.toml.hbs b/templates/vanilla/example/Cargo.toml.hbs new file mode 100644 index 000000000..a328b406d --- /dev/null +++ b/templates/vanilla/example/Cargo.toml.hbs @@ -0,0 +1,19 @@ +[profile.dev] +opt-level = "z" + +[profile.release] +opt-level = "z" + +[workspace] +members = ["dnas/*/zomes/coordinator/*", "dnas/*/zomes/integrity/*"] + +[workspace.dependencies] +hdi = "=0.2.1" +hdk = "=0.1.1" +serde = "1" + +[workspace.dependencies.hello_world] +path = "dnas/hello_world/zomes/coordinator/hello_world" + +[workspace.dependencies.hello_world_integrity] +path = "dnas/hello_world/zomes/integrity/hello_world" diff --git a/templates/vanilla/example/dnas/hello_world/workdir/dna.yaml.hbs b/templates/vanilla/example/dnas/hello_world/workdir/dna.yaml.hbs new file mode 100644 index 000000000..19f9e661d --- /dev/null +++ b/templates/vanilla/example/dnas/hello_world/workdir/dna.yaml.hbs @@ -0,0 +1,19 @@ +--- +manifest_version: "1" +name: hello_world +integrity: + network_seed: ~ + properties: ~ + origin_time: 1679601731282690 + zomes: + - name: hello_world_integrity + hash: ~ + bundled: "../../../target/wasm32-unknown-unknown/release/hello_world_integrity.wasm" + dependencies: ~ +coordinator: + zomes: + - name: hello_world + hash: ~ + bundled: "../../../target/wasm32-unknown-unknown/release/hello_world.wasm" + dependencies: + - name: hello_world_integrity diff --git a/templates/vanilla/example/dnas/hello_world/zomes/coordinator/hello_world/Cargo.toml.hbs b/templates/vanilla/example/dnas/hello_world/zomes/coordinator/hello_world/Cargo.toml.hbs new file mode 100644 index 000000000..3cee1e254 --- /dev/null +++ b/templates/vanilla/example/dnas/hello_world/zomes/coordinator/hello_world/Cargo.toml.hbs @@ -0,0 +1,15 @@ +[package] +name = "hello_world" +version = "0.0.1" +edition = "2021" + +[lib] +crate-type = ["cdylib", "rlib"] +name = "hello_world" + +[dependencies] +hdk = { workspace = true } + +serde = { workspace = true } + +hello_world_integrity = { workspace = true } diff --git a/templates/vanilla/example/dnas/hello_world/zomes/coordinator/hello_world/src/lib.rs.hbs b/templates/vanilla/example/dnas/hello_world/zomes/coordinator/hello_world/src/lib.rs.hbs new file mode 100644 index 000000000..03fd3e35b --- /dev/null +++ b/templates/vanilla/example/dnas/hello_world/zomes/coordinator/hello_world/src/lib.rs.hbs @@ -0,0 +1,59 @@ +use hdk::prelude::*; +use hello_world_integrity::*; + +#[hdk_extern] +pub fn hello_world(message:String) -> ExternResult { + + // commit the Hello message + let action_hash = create_entry(&EntryTypes::Hello(Hello{message}))?; + + // link it to an anchor for later retrieval + let path = Path::from("hellos"); + create_link( + path.path_entry_hash()?, + action_hash.clone(), + LinkTypes::AllHellos, + (), + )?; + Ok(action_hash) +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct HelloOutput { + pub message: String, + pub author: AgentPubKey +} + +#[hdk_extern] +pub fn get_hellos(_: ()) -> ExternResult> { + + // get all of the hellos linked to the anachor + let path = Path::from("hellos"); + let links = get_links(path.path_entry_hash()?, LinkTypes::AllHellos, None)?; + let get_input: Vec = links + .into_iter() + .map(|link| GetInput::new( + ActionHash::from(link.target).into(), + GetOptions::default(), + )) + .collect(); + + // load the records for all the links + let records = HDK.with(|hdk| hdk.borrow().get(get_input))?; + let records: Vec = records.into_iter().filter_map(|r| r).collect(); + + // convert the records into a usefull struct for the UI + let mut hellos = Vec::new(); + for r in records { + let maybe_hello: Option = r.entry.to_app_option().map_err(|e| wasm_error!(e))?; + if let Some(hello) = maybe_hello { + hellos.push( + HelloOutput { + message:hello.message, + author: r.action().author().clone(), + } + ) + } + } + Ok(hellos) +} diff --git a/templates/vanilla/example/dnas/hello_world/zomes/integrity/hello_world/Cargo.toml.hbs b/templates/vanilla/example/dnas/hello_world/zomes/integrity/hello_world/Cargo.toml.hbs new file mode 100644 index 000000000..ce8f18dd4 --- /dev/null +++ b/templates/vanilla/example/dnas/hello_world/zomes/integrity/hello_world/Cargo.toml.hbs @@ -0,0 +1,13 @@ +[package] +name = "hello_world_integrity" +version = "0.0.1" +edition = "2021" + +[lib] +crate-type = ["cdylib", "rlib"] +name = "hello_world_integrity" + +[dependencies] +hdi = { workspace = true } + +serde = { workspace = true } diff --git a/templates/vanilla/example/dnas/hello_world/zomes/integrity/hello_world/src/lib.rs.hbs b/templates/vanilla/example/dnas/hello_world/zomes/integrity/hello_world/src/lib.rs.hbs new file mode 100644 index 000000000..03c00c7f2 --- /dev/null +++ b/templates/vanilla/example/dnas/hello_world/zomes/integrity/hello_world/src/lib.rs.hbs @@ -0,0 +1,49 @@ +use hdi::prelude::*; + +/// this struct defines the content of the Hello entry +#[hdk_entry_helper] +#[derive(Clone, PartialEq)] +pub struct Hello { + pub message: String, +} + +/// Definition of the Hello entry type itself using the entry-helper struct as its content +#[derive(Serialize, Deserialize)] +#[serde(tag = "type")] +#[hdk_entry_defs] +#[unit_enum(UnitEntryTypes)] +pub enum EntryTypes { + Hello(Hello), +} + +/// Definition of a link type to be used for linking from an anchor to all created entreis +#[derive(Serialize, Deserialize)] +#[hdk_link_types] +pub enum LinkTypes { + AllHellos, +} + +/// Validation you perform during the genesis process. Nobody else on the network performs it, only you. +/// There *is no* access to network calls in this callback +#[hdk_extern] +pub fn genesis_self_check(_data: GenesisSelfCheckData) -> ExternResult { + Ok(ValidateCallbackResult::Valid) +} + +/// Validation the network performs when you try to join, you can't perform this validation yourself as you are not a member yet. +/// There *is* access to network calls in this function +pub fn validate_agent_joining(_agent_pub_key: AgentPubKey, _membrane_proof: &Option) -> ExternResult { + Ok(ValidateCallbackResult::Valid) +} + +/// This is the unified validation callback for all entries and link types in this integrity zome +/// In this example app we leave validation aside, please look at the Forum example for validation samples +/// +/// You can read more about validation here: https://docs.rs/hdi/latest/hdi/index.html#data-validation +/// +/// +#[hdk_extern] +pub fn validate(_op: Op) -> ExternResult { + Ok(ValidateCallbackResult::Valid) +} + diff --git a/templates/vanilla/example/ui/index.html.hbs b/templates/vanilla/example/ui/index.html.hbs index 97d5c0ae1..d94d4a182 100644 --- a/templates/vanilla/example/ui/index.html.hbs +++ b/templates/vanilla/example/ui/index.html.hbs @@ -18,31 +18,86 @@ background-color: #ededed; } + Example hApp - -
+ +
+
My AgentPubKey:
+
Greeting sent! Click the button to see all hellos.
+
+ +
+
diff --git a/templates/vanilla/example/ui/package.json b/templates/vanilla/example/ui/package.json new file mode 100644 index 000000000..961a024f2 --- /dev/null +++ b/templates/vanilla/example/ui/package.json @@ -0,0 +1,27 @@ +{ + "name": "ui", + "description": "vanilla holochain web-app", + "license": "MIT", + "version": "0.0.0", + "scripts": { + "start": "vite --clearScreen false --port $UI_PORT", + "build": "vite build", + "package": "npm run build && cd dist && bestzip ../dist.zip *" + }, + "dependencies": { + "@holochain/client": "^0.12.2", + "@holo-host/identicon": "^0.1.0", + "@msgpack/msgpack": "^2.7.2" + }, + "devDependencies": { + "@open-wc/eslint-config": "^4.3.0", + "@typescript-eslint/eslint-plugin": "^4.29.2", + "@typescript-eslint/parser": "^4.29.2", + "bestzip": "^2.2.0", + "deepmerge": "^4.2.2", + "rimraf": "^3.0.2", + "tslib": "^2.3.1", + "typescript": "^4.9.3", + "vite": "^4.0.4" + } + } \ No newline at end of file diff --git a/templates/vanilla/example/workdir/happ.yaml.hbs b/templates/vanilla/example/workdir/happ.yaml.hbs new file mode 100644 index 000000000..5a9738d38 --- /dev/null +++ b/templates/vanilla/example/workdir/happ.yaml.hbs @@ -0,0 +1,18 @@ +--- +manifest_version: "1" +name: hello-world +description: ~ +roles: + - name: hello_world + provisioning: + strategy: create + deferred: false + dna: + bundled: "../dnas/hello_world/workdir/hello_world.dna" + modifiers: + network_seed: ~ + properties: ~ + origin_time: ~ + quantum_time: ~ + version: ~ + clone_limit: 0 diff --git a/templates/vanilla/example/workdir/web-happ.yaml.hbs b/templates/vanilla/example/workdir/web-happ.yaml.hbs new file mode 100644 index 000000000..0937bcc4c --- /dev/null +++ b/templates/vanilla/example/workdir/web-happ.yaml.hbs @@ -0,0 +1,7 @@ +--- +manifest_version: "1" +name: hello-world +ui: + bundled: "../ui/dist.zip" +happ_manifest: + bundled: "./hello-world.happ" From 0fe5d13e408cecd114d44d2e194023b9a06d93ac Mon Sep 17 00:00:00 2001 From: Eric Harris-Braun Date: Tue, 28 Mar 2023 17:10:11 -0400 Subject: [PATCH 14/24] fix package.json template file --- templates/vanilla/example/ui/{package.json => package.json.hbs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename templates/vanilla/example/ui/{package.json => package.json.hbs} (100%) diff --git a/templates/vanilla/example/ui/package.json b/templates/vanilla/example/ui/package.json.hbs similarity index 100% rename from templates/vanilla/example/ui/package.json rename to templates/vanilla/example/ui/package.json.hbs From 00677251eaa4497a06f840f9900de8cfbf590e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillem=20C=C3=B3rdoba?= Date: Wed, 29 Mar 2023 12:43:16 +0200 Subject: [PATCH 15/24] Fixed linked from question --- src/scaffold/entry_type/fields.rs | 81 ++++++++++++++----------------- 1 file changed, 37 insertions(+), 44 deletions(-) diff --git a/src/scaffold/entry_type/fields.rs b/src/scaffold/entry_type/fields.rs index 361120bfc..d0cd68207 100644 --- a/src/scaffold/entry_type/fields.rs +++ b/src/scaffold/entry_type/fields.rs @@ -236,11 +236,7 @@ pub fn choose_field( } } FieldType::ActionHash | FieldType::EntryHash => { - let all_entry_types = get_all_entry_types(zome_file_tree)?.unwrap_or(vec![]); - if all_entry_types.len() == 0 { - None - } else { - let link_from = Confirm::with_theme(&ColorfulTheme::default()) + let link_from = Confirm::with_theme(&ColorfulTheme::default()) .with_prompt( format!( "Should a link from the {} provided in this field also be created when entries of this type are created?", @@ -248,45 +244,42 @@ pub fn choose_field( ) .interact()?; - match link_from { - false => None, - true => { - let mut all_options: Vec = all_entry_types - .clone() - .into_iter() - .map(|r| r.entry_type) - .collect(); - - if let Cardinality::Option | Cardinality::Vector = cardinality { - all_options.push(format!( - "{} (itself)", - entry_type_name.to_case(Case::Pascal) - )); - } - - let selection = Select::with_theme(&ColorfulTheme::default()) - .with_prompt(String::from( - "Which entry type is this field referring to?", - )) - .default(0) - .items(&all_options[..]) - .interact()?; - - let reference_entry_hash = match field_type { - FieldType::EntryHash => true, - _ => false, - }; - - match selection == all_entry_types.len() { - true => Some(Referenceable::EntryType(EntryTypeReference { - entry_type: entry_type_name.clone(), - reference_entry_hash, - })), - false => Some(Referenceable::EntryType(EntryTypeReference { - entry_type: all_entry_types[selection].entry_type.clone(), - reference_entry_hash, - })), - } + match link_from { + false => None, + true => { + let mut all_options: Vec = all_entry_types + .clone() + .into_iter() + .map(|r| r.entry_type) + .collect(); + + if let Cardinality::Option | Cardinality::Vector = cardinality { + all_options.push(format!( + "{} (itself)", + entry_type_name.to_case(Case::Pascal) + )); + } + + let selection = Select::with_theme(&ColorfulTheme::default()) + .with_prompt(String::from("Which entry type is this field referring to?")) + .default(0) + .items(&all_options[..]) + .interact()?; + + let reference_entry_hash = match field_type { + FieldType::EntryHash => true, + _ => false, + }; + + match selection == all_entry_types.len() { + true => Some(Referenceable::EntryType(EntryTypeReference { + entry_type: entry_type_name.clone(), + reference_entry_hash, + })), + false => Some(Referenceable::EntryType(EntryTypeReference { + entry_type: all_entry_types[selection].entry_type.clone(), + reference_entry_hash, + })), } } } From a348dc5ae4da2425a49455b7097ca429886de8c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillem=20C=C3=B3rdoba?= Date: Wed, 29 Mar 2023 13:38:30 +0200 Subject: [PATCH 16/24] Added call as reserved word --- Cargo.lock | 174 +++++++++++++++++++++------ Cargo.toml | 1 + src/reserved_words.rs | 3 +- src/scaffold/entry_type/fields.rs | 1 + src/scaffold/entry_type/integrity.rs | 2 +- src/scaffold/link_type/integrity.rs | 14 ++- 6 files changed, 152 insertions(+), 43 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 54ff2af84..327c8dbd7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -67,6 +67,46 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "anstream" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "342258dd14006105c2b75ab1bd7543a03bdf0cfc94383303ac212a04939dff6f" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-wincon", + "concolor-override", + "concolor-query", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23ea9e81bd02e310c216d080f6223c179012256e5151c41db88d12c88a1684d2" + +[[package]] +name = "anstyle-parse" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7d1bb534e9efed14f3e5f44e7dd1a4f709384023a4165199a4241e18dff0116" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-wincon" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3127af6145b149f3287bb9a0d10ad9c5692dba8c53ad48285e5bec4063834fa" +dependencies = [ + "anstyle", + "windows-sys 0.45.0", +] + [[package]] name = "anyhow" version = "1.0.69" @@ -380,9 +420,9 @@ checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" [[package]] name = "bimap" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc0455254eb5c6964c4545d8bac815e1a1be4f3afe0ae695ea539c12d728d44b" +checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" [[package]] name = "bincode" @@ -734,21 +774,19 @@ dependencies = [ ] [[package]] -name = "concolor" -version = "0.0.11" +name = "concolor-override" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "318d6c16e73b3a900eb212ad6a82fc7d298c5ab8184c7a9998646455bc474a16" -dependencies = [ - "bitflags", - "concolor-query", - "is-terminal", -] +checksum = "a855d4a1978dc52fb0536a04d384c2c0c1aa273597f08b77c8c4d3b2eec6037f" [[package]] name = "concolor-query" -version = "0.1.0" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82a90734b3d5dcf656e7624cca6bce9c3a90ee11f900e80141a7427ccfb3d317" +checksum = "88d11d52c3d7ca2e6d0040212be9e4dbbcd78b6447f535b6b561f449427944cf" +dependencies = [ + "windows-sys 0.45.0", +] [[package]] name = "concurrent-queue" @@ -1531,6 +1569,17 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "errno" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.45.0", +] + [[package]] name = "errno-dragonfly" version = "0.1.2" @@ -2265,7 +2314,7 @@ dependencies = [ "tiny-keccak", "tokio 1.25.0", "tokio-stream", - "toml", + "toml 0.5.11", "tracing", "tracing-futures", "tracing-subscriber 0.2.25", @@ -2426,6 +2475,7 @@ dependencies = [ "holochain_util", "ignore", "include_dir", + "itertools 0.10.5", "json_value_merge", "mr_bundle", "path-clean", @@ -2443,7 +2493,7 @@ dependencies = [ "temp-dir", "thiserror", "tokio 1.25.0", - "toml", + "toml 0.5.11", ] [[package]] @@ -2683,7 +2733,7 @@ dependencies = [ "holochain_util", "strum", "strum_macros 0.18.0", - "toml", + "toml 0.5.11", "walkdir", ] @@ -2870,18 +2920,18 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "human-panic" -version = "1.1.0" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87eb03e654582b31967d414b86711a7bbd7c6b28a6b7d32857b7d1d45c0926f9" +checksum = "0a6557b29bbdc9d6c7a5cdbe2962e78eaf48115e8d55b0b62282956981c1f605" dependencies = [ + "anstream", + "anstyle", "backtrace", - "concolor", "os_info", "serde", "serde_derive", - "termcolor", - "toml", - "uuid 0.8.2", + "toml 0.7.3", + "uuid 1.3.0", ] [[package]] @@ -3205,13 +3255,13 @@ checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" [[package]] name = "is-terminal" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b6b32576413a8e69b90e952e4a026476040d81017b80445deda5f2d3921857" +checksum = "256017f749ab3117e93acb91063009e1f1bb56d03965b14c2c8df4eb02c524d8" dependencies = [ "hermit-abi 0.3.1", "io-lifetimes", - "rustix", + "rustix 0.37.3", "windows-sys 0.45.0", ] @@ -3539,7 +3589,7 @@ dependencies = [ "serde_json", "serde_yaml 0.9.17", "tokio 1.25.0", - "toml", + "toml 0.5.11", "tracing", "url 2.3.1", "winapi 0.3.9", @@ -3667,6 +3717,12 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +[[package]] +name = "linux-raw-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd550e73688e6d578f0ac2119e32b797a327631a42f9433e59d02e139c8df60d" + [[package]] name = "lock_api" version = "0.3.4" @@ -4390,9 +4446,9 @@ dependencies = [ [[package]] name = "os_info" -version = "2.0.8" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc1b4330bb29087e791ae2a5cf56be64fb8946a4ff5aec2ba11c6ca51f5d60" +checksum = "006e42d5b888366f1880eda20371fedde764ed2213dc8496f49622fa0c99cd5e" dependencies = [ "log", "serde", @@ -5597,10 +5653,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644" dependencies = [ "bitflags", - "errno", + "errno 0.2.8", + "io-lifetimes", + "libc", + "linux-raw-sys 0.1.4", + "windows-sys 0.45.0", +] + +[[package]] +name = "rustix" +version = "0.37.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b24138615de35e32031d041a09032ef3487a616d901ca4db224e7d557efae2" +dependencies = [ + "bitflags", + "errno 0.3.0", "io-lifetimes", "libc", - "linux-raw-sys", + "linux-raw-sys 0.3.0", "windows-sys 0.45.0", ] @@ -5834,6 +5904,15 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.5.5" @@ -6321,7 +6400,7 @@ dependencies = [ "cfg-if 1.0.0", "fastrand", "redox_syscall 0.2.16", - "rustix", + "rustix 0.36.8", "windows-sys 0.42.0", ] @@ -6734,19 +6813,36 @@ dependencies = [ "serde", ] +[[package]] +name = "toml" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b403acf6f2bb0859c93c7f0d967cb4a75a7ac552100f9322faf64dc047669b21" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + [[package]] name = "toml_datetime" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" +dependencies = [ + "serde", +] [[package]] name = "toml_edit" -version = "0.19.4" +version = "0.19.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1eb0622d28f4b9c90adc4ea4b2b46b47663fde9ac5fafcb14a1369d5508825" +checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" dependencies = [ "indexmap", + "serde", + "serde_spanned", "toml_datetime", "winnow", ] @@ -7089,6 +7185,12 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "uuid" version = "0.7.4" @@ -7101,9 +7203,9 @@ dependencies = [ [[package]] name = "uuid" -version = "0.8.2" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +checksum = "1674845326ee10d37ca60470760d4288a6f80f304007d92e5c53bab78c9cfd79" dependencies = [ "getrandom 0.2.8", ] @@ -7780,9 +7882,9 @@ checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" [[package]] name = "winnow" -version = "0.3.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faf09497b8f8b5ac5d3bb4d05c0a99be20f26fd3d5f2db7b0716e946d5103658" +checksum = "ae8970b36c66498d8ff1d66685dc86b91b29db0c7739899012f63a63814b4b28" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index 1d22ae5c2..8b8908403 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,6 +50,7 @@ serde = "1" json_value_merge = "1.1.2" temp-dir = "0.1" semver = "1.0" +itertools = "0.10" [dev-dependencies] assert_cmd = "1.0" diff --git a/src/reserved_words.rs b/src/reserved_words.rs index eb0470f91..d526a98a8 100644 --- a/src/reserved_words.rs +++ b/src/reserved_words.rs @@ -2,7 +2,7 @@ use convert_case::{Case, Casing}; use crate::error::{ScaffoldError, ScaffoldResult}; -const RESERVED_WORDS: [&str; 26] = [ +const RESERVED_WORDS: [&str; 27] = [ "type", "role", "enum", @@ -29,6 +29,7 @@ const RESERVED_WORDS: [&str; 26] = [ "EntryHash", "ActionHash", "AgentPubKey", + "Call", ]; // Returns an error if the given string is invalid due to it being a reserved word diff --git a/src/scaffold/entry_type/fields.rs b/src/scaffold/entry_type/fields.rs index d0cd68207..329647a0a 100644 --- a/src/scaffold/entry_type/fields.rs +++ b/src/scaffold/entry_type/fields.rs @@ -247,6 +247,7 @@ pub fn choose_field( match link_from { false => None, true => { + let all_entry_types = get_all_entry_types(zome_file_tree)?.unwrap_or(vec![]); let mut all_options: Vec = all_entry_types .clone() .into_iter() diff --git a/src/scaffold/entry_type/integrity.rs b/src/scaffold/entry_type/integrity.rs index 99914a2b5..4935ea171 100644 --- a/src/scaffold/entry_type/integrity.rs +++ b/src/scaffold/entry_type/integrity.rs @@ -1,5 +1,5 @@ use convert_case::{Case, Casing}; -use holochain::test_utils::itertools::Itertools; +use itertools::Itertools; use proc_macro2::TokenStream; use quote::{format_ident, quote}; use std::{ffi::OsString, path::PathBuf}; diff --git a/src/scaffold/link_type/integrity.rs b/src/scaffold/link_type/integrity.rs index 51c3c93f5..fc842d4b6 100644 --- a/src/scaffold/link_type/integrity.rs +++ b/src/scaffold/link_type/integrity.rs @@ -1,7 +1,7 @@ use std::{ffi::OsString, path::PathBuf}; use convert_case::{Case, Casing}; -use holochain::test_utils::itertools::Itertools; +use itertools::Itertools; use proc_macro2::TokenStream; use quote::{format_ident, quote}; @@ -425,15 +425,18 @@ fn signal_link_types_variants() -> ScaffoldResult> { fn signal_action_match_arms() -> ScaffoldResult> { Ok(vec![ - syn::parse_str::("Action::CreateLink(create_link) => { + syn::parse_str::( + "Action::CreateLink(create_link) => { if let Ok(Some(link_type)) = LinkTypes::from_type(create_link.zome_index, create_link.link_type) { emit_signal(Signal::LinkCreated { action, link_type })?; } Ok(()) - }")?, - syn::parse_str::("Action::DeleteLink(delete_link) => { + }", + )?, + syn::parse_str::( + "Action::DeleteLink(delete_link) => { let record = get(delete_link.link_add_address.clone(), GetOptions::default())?.ok_or( wasm_error!(WasmErrorInner::Guest( \"Failed to fetch CreateLink action\".to_string() @@ -454,7 +457,8 @@ fn signal_action_match_arms() -> ScaffoldResult> { ))); } } - }")? + }", + )?, ]) } From 1cd0ee7fb579d650569e6a3f87b05ef78277131c Mon Sep 17 00:00:00 2001 From: Eric Harris-Braun Date: Thu, 30 Mar 2023 13:58:33 -0400 Subject: [PATCH 17/24] remove code from early attempt and fix UI --- flake.lock | 6 +- src/cli.rs | 88 --------------------- src/scaffold/entry_type.rs | 17 ++-- src/scaffold/zome.rs | 4 +- src/scaffold/zome/coordinator.rs | 19 +---- templates/vanilla/example/ui/index.html.hbs | 2 +- 6 files changed, 15 insertions(+), 121 deletions(-) diff --git a/flake.lock b/flake.lock index 497bc611c..8ecd74b07 100644 --- a/flake.lock +++ b/flake.lock @@ -400,11 +400,11 @@ }, "locked": { "dir": "versions/0_1", - "lastModified": 1680021245, - "narHash": "sha256-ZU9GnDe50X7ruCgFiGGB7gzJdhIKORq2BqlPIgTQPc4=", + "lastModified": 1680071461, + "narHash": "sha256-HDi5jLkxQnylvQ7DthYzHacT6t6Sr8CDjLLysmnddiE=", "owner": "holochain", "repo": "holochain", - "rev": "c50ffc91db8dc80a3db2efd01411ce6be99533f1", + "rev": "1492ac19715f451214716e671e8d0c80c6b1eee3", "type": "github" }, "original": { diff --git a/src/cli.rs b/src/cli.rs index d3f9f1c7d..833e0be3b 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -578,7 +578,6 @@ Add new entry definitions to your zome with: zome_file_tree, &template_file_tree, &name, - false, &crud, &reference_entry_hash, &link_from_original_to_each_update, @@ -736,90 +735,6 @@ Collection "{}" scaffolded! false, )?; - // // scaffold dna hello_world - // let dna_name = String::from("hello_world"); - - // let app_file_tree = - // AppFileTree::get_or_choose(file_tree, &Some(name.clone()))?; - // let ScaffoldedTemplate { file_tree, .. } = - // scaffold_dna(app_file_tree, &template_file_tree, &dna_name)?; - - // // scaffold integrity zome hello_world - // let dna_file_tree = - // DnaFileTree::get_or_choose(file_tree, &Some(dna_name.clone()))?; - // let dna_manifest_path = dna_file_tree.dna_manifest_path.clone(); - - // let integrity_zome_name = String::from("hello_world_integrity"); - // let integrity_zome_path = PathBuf::new() - // .join("dnas") - // .join(&dna_name) - // .join("zomes") - // .join("integrity"); - // let ScaffoldedTemplate { file_tree, .. } = - // scaffold_integrity_zome_with_path( - // dna_file_tree, - // &template_file_tree, - // &integrity_zome_name, - // &integrity_zome_path, - // )?; - - // // scaffold integrity zome hello_world - // let dna_file_tree = - // DnaFileTree::from_dna_manifest_path(file_tree, &dna_manifest_path)?; - - // let coordinator_zome_name = String::from("hello_world"); - // let coordinator_zome_path = PathBuf::new() - // .join("dnas") - // .join(dna_name) - // .join("zomes") - // .join("coordinator"); - // let ScaffoldedTemplate { file_tree, .. } = - // scaffold_coordinator_zome_in_path( - // dna_file_tree, - // &template_file_tree, - // &coordinator_zome_name, - // true, - // &Some(vec![integrity_zome_name.clone()]), - // &coordinator_zome_path, - // )?; - - - // // Scaffold the app here to enable ZomeFileTree::from_manifest(), which calls `cargo metadata` - // MergeableFileSystemTree::::from(file_tree.clone()) - // .build(&app_dir)?; - - // std::env::set_current_dir(&app_dir)?; - - // let dna_file_tree = - // DnaFileTree::from_dna_manifest_path(file_tree, &dna_manifest_path)?; - - // let zome_file_tree = ZomeFileTree::get_or_choose_integrity( - // dna_file_tree, - // &Some(integrity_zome_name.clone()), - // )?; - - // let ScaffoldedTemplate { file_tree, .. } = scaffold_entry_type( - // zome_file_tree, - // &template_file_tree, - // &String::from("hello"), - // true, - // &Some(Crud { - // update: false, - // delete: false, - // }), - // &Some(false), - // &Some(true), - // &Some(vec![ - // FieldDefinition { - // field_name: String::from("hello"), - // field_type: FieldType::String, - // widget: None, - // cardinality: Cardinality::Single, - // linked_from: None, - // }, - // ]), - // )?; - file_tree } Example::Forum => { @@ -874,7 +789,6 @@ Collection "{}" scaffolded! dna_file_tree, &template_file_tree, &coordinator_zome_name, - false, &Some(vec![integrity_zome_name.clone()]), &coordinator_zome_path, )?; @@ -897,7 +811,6 @@ Collection "{}" scaffolded! zome_file_tree, &template_file_tree, &String::from("post"), - false, &Some(Crud { update: true, delete: true, @@ -934,7 +847,6 @@ Collection "{}" scaffolded! zome_file_tree, &template_file_tree, &String::from("comment"), - false, &Some(Crud { update: false, delete: true, diff --git a/src/scaffold/entry_type.rs b/src/scaffold/entry_type.rs index d3429d376..4fc148bf7 100644 --- a/src/scaffold/entry_type.rs +++ b/src/scaffold/entry_type.rs @@ -75,7 +75,6 @@ pub fn scaffold_entry_type( zome_file_tree: ZomeFileTree, template_file_tree: &FileTree, name: &String, - simplified: bool, // skips all crud functions and simplifies inital lib files maybe_crud: &Option, maybe_reference_entry_hash: &Option, maybe_link_from_original_to_each_update: &Option, @@ -212,15 +211,13 @@ pub fn scaffold_entry_type( let mut zome_file_tree = ZomeFileTree::from_zome_manifest(zome_file_tree.dna_file_tree, coordinator_zome.clone())?; - if !simplified { - zome_file_tree = add_crud_functions_to_coordinator( - zome_file_tree, - &integrity_zome_name, - &entry_def, - &crud, - link_from_original_to_each_update, - )?; - } + zome_file_tree = add_crud_functions_to_coordinator( + zome_file_tree, + &integrity_zome_name, + &entry_def, + &crud, + link_from_original_to_each_update, + )?; let dna_manifest = zome_file_tree.dna_file_tree.dna_manifest.clone(); diff --git a/src/scaffold/zome.rs b/src/scaffold/zome.rs index 344ba2532..d853f8b5b 100644 --- a/src/scaffold/zome.rs +++ b/src/scaffold/zome.rs @@ -430,7 +430,6 @@ pub fn scaffold_coordinator_zome_in_path( dna_file_tree: DnaFileTree, template_file_tree: &FileTree, zome_name: &String, - simplified: bool, dependencies: &Option>, path: &PathBuf, ) -> ScaffoldResult { @@ -453,7 +452,7 @@ pub fn scaffold_coordinator_zome_in_path( let zome: FileTree = dir! { "Cargo.toml" => file!(coordinator::initial_cargo_toml(zome_name, dependencies)), "src" => dir! { - "lib.rs" => file!(coordinator::initial_lib_rs(simplified, dependencies)) + "lib.rs" => file!(coordinator::initial_lib_rs(dependencies)) } }; @@ -497,7 +496,6 @@ pub fn scaffold_coordinator_zome( dna_file_tree, template_file_tree, zome_name, - false, dependencies, &path_to_scaffold_in, ) diff --git a/src/scaffold/zome/coordinator.rs b/src/scaffold/zome/coordinator.rs index 382c3f56a..c00c744de 100644 --- a/src/scaffold/zome/coordinator.rs +++ b/src/scaffold/zome/coordinator.rs @@ -43,7 +43,7 @@ serde = {{ workspace = true }} ) } -pub fn initial_lib_rs(simplified: bool, dependencies: &Option>) -> String { +pub fn initial_lib_rs(dependencies: &Option>) -> String { let integrity_imports = match dependencies { None => String::from(""), Some(deps) => { @@ -55,20 +55,7 @@ pub fn initial_lib_rs(simplified: bool, dependencies: &Option>) -> S s } }; - if simplified { - format!( - r#"use hdk::prelude::*; - {integrity_imports} - - /// Called the first time a zome call is made to the cell containing this zome - #[hdk_extern] - pub fn init(_: ()) -> ExternResult {{ - Ok(InitCallbackResult::Pass) - }} -"#) - } - else { - format!( + format!( r#"use hdk::prelude::*; {integrity_imports} @@ -101,7 +88,7 @@ fn signal_action(action: SignedActionHashed) -> ExternResult<()> {{ }} "# - )} + ) } fn choose_extern_function( diff --git a/templates/vanilla/example/ui/index.html.hbs b/templates/vanilla/example/ui/index.html.hbs index d94d4a182..d129a050f 100644 --- a/templates/vanilla/example/ui/index.html.hbs +++ b/templates/vanilla/example/ui/index.html.hbs @@ -27,7 +27,7 @@
-
My AgentPubKey:
+
My AgentPubKey:
Greeting sent! Click the button to see all hellos.
From 006fdfc20a3f783694a7d9091413a2364d05a0f5 Mon Sep 17 00:00:00 2001 From: Eric Harris-Braun Date: Thu, 30 Mar 2023 17:15:43 -0400 Subject: [PATCH 18/24] added test for hello-world --- run_test.sh | 12 ++++ .../example/tests/hello-world.test.ts.hbs | 58 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 templates/vanilla/example/tests/hello-world.test.ts.hbs diff --git a/run_test.sh b/run_test.sh index d6a36c858..ef0e8788a 100644 --- a/run_test.sh +++ b/run_test.sh @@ -1,6 +1,18 @@ #!/usr/bin/bash set -e +rm -rf /tmp/hello-world +cd /tmp + +hc-scaffold example hello-world +cd hello-world + +nix develop --command bash -c " +set -e +npm i +npm t +" + rm -rf /tmp/forum-svelte cd /tmp diff --git a/templates/vanilla/example/tests/hello-world.test.ts.hbs b/templates/vanilla/example/tests/hello-world.test.ts.hbs new file mode 100644 index 000000000..c1e67f066 --- /dev/null +++ b/templates/vanilla/example/tests/hello-world.test.ts.hbs @@ -0,0 +1,58 @@ +import { assert, test } from "vitest"; + +import { runScenario, pause } from '@holochain/tryorama'; + + +test('send hello and retrieve hellos', async () => { + await runScenario(async scenario => { + // Construct proper paths for your app. + // This assumes app bundle created by the `hc app pack` command. + const testAppPath = process.cwd() + '/../workdir/hello-world.happ'; + + // Set up the app to be installed + const appSource = { appBundleSource: { path: testAppPath } }; + + // Add 2 players with the test app to the Scenario. The returned players + // can be destructured. + const [alice, beto] = await scenario.addPlayersWithApps([appSource, appSource]); + + // Shortcut peer discovery through gossip and register all agents in every + // conductor of the scenario. + await scenario.shareAllAgents(); + + // Alice sends a hello + const aliceCell = alice.cells[0] + const resultAlice = await aliceCell.callZome({ + zome_name: "hello_world", + fn_name: "hello_world", + payload: "hello world!", + }); + assert.ok(resultAlice); + + // Beto sends a hello + const betoCell = beto.cells[0] + const resultBeto = await betoCell.callZome({ + zome_name: "hello_world", + fn_name: "hello_world", + payload: "hola mundo!", + }); + assert.ok(resultBeto); + + await pause(1000) // wait for DHT to settle + + // Alice gets all hellos + const hellosAlice: Array = await aliceCell.callZome({ + zome_name: "hello_world", + fn_name: "get_hellos", + payload: undefined, + }); + + // confirm that both hellos are present + assert.equal(hellosAlice.length, 2); + assert.equal(hellosAlice[0].message, "hello world!"); + assert.deepEqual(hellosAlice[0].author, aliceCell.cell_id[1]); + assert.equal(hellosAlice[1].message, "hola mundo!"); + assert.deepEqual(hellosAlice[1].author, betoCell.cell_id[1]); + + }); + }); \ No newline at end of file From 09f513fa61ae57255f6e333b7947c63dafd32dd6 Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 30 Mar 2023 17:06:26 -0600 Subject: [PATCH 19/24] Add holo_enabled flag and update svelte template --- flake.lock | 6 +-- src/cli.rs | 7 +++ src/scaffold/web_app.rs | 5 +- src/templates/web_app.rs | 3 ++ src/versions.rs | 4 ++ templates/svelte/web-app/package.json.hbs | 12 ++++- templates/svelte/web-app/ui/package.json.hbs | 3 ++ .../svelte/web-app/ui/src/App.svelte.hbs | 48 +++++++++++++++++-- 8 files changed, 78 insertions(+), 10 deletions(-) diff --git a/flake.lock b/flake.lock index 7c238b7e2..4308941b2 100644 --- a/flake.lock +++ b/flake.lock @@ -400,11 +400,11 @@ }, "locked": { "dir": "versions/0_1", - "lastModified": 1678710664, - "narHash": "sha256-TSfZNIrGk3fA79NzyJuN5aHcOtreNForzHXPFU5QbAg=", + "lastModified": 1680190287, + "narHash": "sha256-ehqfn2bSc5ZUTtK0Xf8ini+JEizItSAI9pYxR/EZwPI=", "owner": "holochain", "repo": "holochain", - "rev": "e2a1a5cb5e8cf48785736339c064ea9290611877", + "rev": "2bf0e85e68cdf1b2c78f2a96985799eb43b0fbd1", "type": "github" }, "original": { diff --git a/src/cli.rs b/src/cli.rs index 65c0b4616..417a83b40 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -72,6 +72,9 @@ pub enum HcScaffold { /// If "--templates-url" is given, the template must be located at the ".templates/