From 2d24723f74b447854732f9dd45b10c2e6846ed4d Mon Sep 17 00:00:00 2001 From: ThetaSinner Date: Thu, 21 Dec 2023 22:51:51 +0000 Subject: [PATCH 1/6] Merge pull request #168 from holochain/fix-hello-world-example Fix missing client in hello-world example --- templates/vanilla/example/ui/index.html.hbs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/templates/vanilla/example/ui/index.html.hbs b/templates/vanilla/example/ui/index.html.hbs index d129a050f..282881108 100644 --- a/templates/vanilla/example/ui/index.html.hbs +++ b/templates/vanilla/example/ui/index.html.hbs @@ -45,8 +45,8 @@ } async function connect() { - // We pass '' as url because it will dynamically be replaced in launcher environments - client = await AppAgentWebsocket.connect('', 'hello-world'); + // We pass an unused string as the url because it will dynamically be replaced in launcher environments + client = await AppAgentWebsocket.connect(new URL('https://UNUSED'), 'hello-world'); const canvas = document.getElementById('pubkey') pubkey.title = encodeHashToBase64(client.myPubKey) const opts = { @@ -63,7 +63,6 @@ fn_name: 'hello_world', payload: message, }); - } async function getHellos() { From 4ad0b0047e20150e8eab4813642f0c4bf00c81ca Mon Sep 17 00:00:00 2001 From: Collins Muriuki <49271447+c12i@users.noreply.github.com> Date: Fri, 22 Dec 2023 17:23:39 +0300 Subject: [PATCH 2/6] Merge pull request #169 from c12i/target-dir-not-in-gitignore Update gitignore to include rust `target` and ui `node_modules` dirs --- templates/lit/web-app/ui/.gitignore.hbs | 4 +++- templates/svelte/web-app/ui/.gitignore.hbs | 3 ++- templates/vanilla/web-app/.gitignore.hbs | 3 ++- templates/vue/web-app/ui/.gitignore.hbs | 3 ++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/templates/lit/web-app/ui/.gitignore.hbs b/templates/lit/web-app/ui/.gitignore.hbs index 23452c88c..59681ea2b 100644 --- a/templates/lit/web-app/ui/.gitignore.hbs +++ b/templates/lit/web-app/ui/.gitignore.hbs @@ -6,7 +6,7 @@ .DS_Store ## npm -/node_modules/ +/**/node_modules/ /npm-debug.log ## testing @@ -19,6 +19,8 @@ /_site/ /dist/ /out-tsc/ +/target/ +/.cargo storybook-static .rollup.cache diff --git a/templates/svelte/web-app/ui/.gitignore.hbs b/templates/svelte/web-app/ui/.gitignore.hbs index 23452c88c..1950056e9 100644 --- a/templates/svelte/web-app/ui/.gitignore.hbs +++ b/templates/svelte/web-app/ui/.gitignore.hbs @@ -6,7 +6,7 @@ .DS_Store ## npm -/node_modules/ +/**/node_modules/ /npm-debug.log ## testing @@ -19,6 +19,7 @@ /_site/ /dist/ /out-tsc/ +/target/ storybook-static .rollup.cache diff --git a/templates/vanilla/web-app/.gitignore.hbs b/templates/vanilla/web-app/.gitignore.hbs index 23452c88c..1950056e9 100644 --- a/templates/vanilla/web-app/.gitignore.hbs +++ b/templates/vanilla/web-app/.gitignore.hbs @@ -6,7 +6,7 @@ .DS_Store ## npm -/node_modules/ +/**/node_modules/ /npm-debug.log ## testing @@ -19,6 +19,7 @@ /_site/ /dist/ /out-tsc/ +/target/ storybook-static .rollup.cache diff --git a/templates/vue/web-app/ui/.gitignore.hbs b/templates/vue/web-app/ui/.gitignore.hbs index 23452c88c..1950056e9 100644 --- a/templates/vue/web-app/ui/.gitignore.hbs +++ b/templates/vue/web-app/ui/.gitignore.hbs @@ -6,7 +6,7 @@ .DS_Store ## npm -/node_modules/ +/**/node_modules/ /npm-debug.log ## testing @@ -19,6 +19,7 @@ /_site/ /dist/ /out-tsc/ +/target/ storybook-static .rollup.cache From f0a6f811714176501a686b4cb16a6337e31f4bd9 Mon Sep 17 00:00:00 2001 From: Collins Muriuki <49271447+c12i@users.noreply.github.com> Date: Thu, 4 Jan 2024 15:59:10 +0300 Subject: [PATCH 3/6] Merge pull request #170 from c12i/fix-unit-tests Remove duplicate unit tests and run them in ci --- .github/workflows/test.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 62b9223e7..7f0a6a1e9 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -9,6 +9,15 @@ on: branches: [ develop, develop-0.1, develop-0.2 ] jobs: + cargotest: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@stable + + - run: cargo test --no-fail-fast + testbuild: runs-on: ubuntu-latest steps: From 6ade4bf0497b9c42a7f056371ee103d524326805 Mon Sep 17 00:00:00 2001 From: Collins Muriuki <49271447+c12i@users.noreply.github.com> Date: Mon, 8 Jan 2024 16:00:10 +0300 Subject: [PATCH 4/6] Merge pull request #171 from c12i/fix-empty-list-of-items-given-to-select Handle error creating linked `ActionHash` or `EntryHash` without previous entry-types existing --- src/cli.rs | 2 +- src/scaffold/app.rs | 1 + src/scaffold/entry_type/fields.rs | 9 ++++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index 5d8143bdd..f333fadd2 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -559,7 +559,7 @@ Add new entry definitions to your zome with: let file_tree = load_directory_into_memory(¤t_dir)?; let template_file_tree = choose_or_get_template_file_tree(&file_tree, &template)?; - let name: String = match name { + let name = match name { Some(n) => { check_case(&n, "entry type name", Case::Snake)?; n diff --git a/src/scaffold/app.rs b/src/scaffold/app.rs index 9bda3f1aa..8a987bb06 100644 --- a/src/scaffold/app.rs +++ b/src/scaffold/app.rs @@ -25,6 +25,7 @@ impl AppFileTree { pub fn file_tree(self) -> FileTree { self.file_tree } + pub fn file_tree_ref<'a>(&'a self) -> &'a FileTree { &self.file_tree } diff --git a/src/scaffold/entry_type/fields.rs b/src/scaffold/entry_type/fields.rs index 329647a0a..c6fe8e58c 100644 --- a/src/scaffold/entry_type/fields.rs +++ b/src/scaffold/entry_type/fields.rs @@ -5,7 +5,7 @@ use dialoguer::{theme::ColorfulTheme, Confirm, Select}; use regex::Regex; use crate::{ - error::ScaffoldResult, + error::{ScaffoldError, ScaffoldResult}, file_tree::{dir_content, FileTree}, scaffold::zome::ZomeFileTree, utils::{check_case, input_with_case, input_with_case_and_initial_text}, @@ -261,6 +261,13 @@ pub fn choose_field( )); } + if all_options.is_empty() { + return Err(ScaffoldError::NoEntryTypesDefFoundForIntegrityZome( + zome_file_tree.dna_file_tree.dna_manifest.name(), + zome_file_tree.zome_manifest.name.to_string(), + )) + } + let selection = Select::with_theme(&ColorfulTheme::default()) .with_prompt(String::from("Which entry type is this field referring to?")) .default(0) From d92e9f316e1c0f968fe8a7daec90ea14f9abaa4d Mon Sep 17 00:00:00 2001 From: Collins Muriuki Date: Tue, 9 Jan 2024 17:01:17 +0300 Subject: [PATCH 5/6] Merge pull request #174 from joshuavial/develop fixing typo in comments --- .../dnas/hello_world/zomes/integrity/hello_world/src/lib.rs.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index 03c00c7f2..f5393cb49 100644 --- 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 @@ -16,7 +16,7 @@ pub enum EntryTypes { Hello(Hello), } -/// Definition of a link type to be used for linking from an anchor to all created entreis +/// Definition of a link type to be used for linking from an anchor to all created entries #[derive(Serialize, Deserialize)] #[hdk_link_types] pub enum LinkTypes { From e2412cde19d2ec08d3e04300835fe139e0dcd129 Mon Sep 17 00:00:00 2001 From: Collins Muriuki Date: Fri, 12 Jan 2024 14:07:36 +0300 Subject: [PATCH 6/6] Revert example client initialization change --- templates/vanilla/example/ui/index.html.hbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/vanilla/example/ui/index.html.hbs b/templates/vanilla/example/ui/index.html.hbs index 282881108..abab2e61f 100644 --- a/templates/vanilla/example/ui/index.html.hbs +++ b/templates/vanilla/example/ui/index.html.hbs @@ -45,8 +45,8 @@ } async function connect() { - // We pass an unused string as the url because it will dynamically be replaced in launcher environments - client = await AppAgentWebsocket.connect(new URL('https://UNUSED'), 'hello-world'); + // We pass '' as url because it will dynamically be replaced in launcher environments + client = await AppAgentWebsocket.connect('', 'hello-world'); const canvas = document.getElementById('pubkey') pubkey.title = encodeHashToBase64(client.myPubKey) const opts = {