Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport 0.1 #177

Merged
merged 6 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ Add new entry definitions to your zome with:
let file_tree = load_directory_into_memory(&current_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
Expand Down
1 change: 1 addition & 0 deletions src/scaffold/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
9 changes: 8 additions & 1 deletion src/scaffold/entry_type/fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion templates/lit/web-app/ui/.gitignore.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
.DS_Store

## npm
/node_modules/
/**/node_modules/
/npm-debug.log

## testing
Expand All @@ -19,6 +19,8 @@
/_site/
/dist/
/out-tsc/
/target/
/.cargo

storybook-static
.rollup.cache
Expand Down
3 changes: 2 additions & 1 deletion templates/svelte/web-app/ui/.gitignore.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
.DS_Store

## npm
/node_modules/
/**/node_modules/
/npm-debug.log

## testing
Expand All @@ -19,6 +19,7 @@
/_site/
/dist/
/out-tsc/
/target/

storybook-static
.rollup.cache
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 2 additions & 3 deletions templates/vanilla/example/ui/index.html.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -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');
c12i marked this conversation as resolved.
Show resolved Hide resolved
const canvas = document.getElementById('pubkey')
pubkey.title = encodeHashToBase64(client.myPubKey)
const opts = {
Expand All @@ -63,7 +63,6 @@
fn_name: 'hello_world',
payload: message,
});

}

async function getHellos() {
Expand Down
3 changes: 2 additions & 1 deletion templates/vanilla/web-app/.gitignore.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
.DS_Store

## npm
/node_modules/
/**/node_modules/
/npm-debug.log

## testing
Expand All @@ -19,6 +19,7 @@
/_site/
/dist/
/out-tsc/
/target/

storybook-static
.rollup.cache
Expand Down
3 changes: 2 additions & 1 deletion templates/vue/web-app/ui/.gitignore.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
.DS_Store

## npm
/node_modules/
/**/node_modules/
/npm-debug.log

## testing
Expand All @@ -19,6 +19,7 @@
/_site/
/dist/
/out-tsc/
/target/

storybook-static
.rollup.cache
Expand Down