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: 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) 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/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 { diff --git a/templates/vanilla/example/ui/index.html.hbs b/templates/vanilla/example/ui/index.html.hbs index d129a050f..abab2e61f 100644 --- a/templates/vanilla/example/ui/index.html.hbs +++ b/templates/vanilla/example/ui/index.html.hbs @@ -63,7 +63,6 @@ fn_name: 'hello_world', payload: message, }); - } async function getHellos() { 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