From 9d54ae770ae0490eebe76d95beb6c0dc1efce403 Mon Sep 17 00:00:00 2001 From: Collins Muriuki Date: Mon, 25 Nov 2024 17:00:04 +0300 Subject: [PATCH] Update client version and usage; also fix console errors in vue template --- src/versions.rs | 2 +- .../{{kebab_case collection_name}}.test.ts.hbs | 4 ++-- .../{{kebab_case collection_name}}.ts.hbs | 2 +- .../{{pascal_case collection_name}}.tsx.hbs | 2 +- .../{{pascal_case collection_name}}.svelte.hbs | 2 +- .../{{kebab_case collection_name}}.test.ts.hbs | 2 +- .../{{pascal_case collection_name}}.vue.hbs | 4 ++-- ... linked_from.name}}.vue{{\302\241if}}{{\302\241each}}.hbs" | 2 +- ...pascal_case to_referenceable.name}}.vue{{\302\241if}}.hbs" | 2 +- ...scal_case from_referenceable.name}}.vue{{\302\241if}}.hbs" | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/versions.rs b/src/versions.rs index 45e94fb34..87d0aca42 100644 --- a/src/versions.rs +++ b/src/versions.rs @@ -2,7 +2,7 @@ pub const TRYORAMA_VERSION: &str = "^0.18.0-dev.1"; /// npm: -pub const HOLOCHAIN_CLIENT_VERSION: &str = "^0.19.0-dev.3"; +pub const HOLOCHAIN_CLIENT_VERSION: &str = "^0.19.0-dev.5"; /// npm: pub const HC_SPIN_VERSION: &str = "^0.400.0-dev.3"; diff --git a/templates/generic/collection/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.test.ts.hbs b/templates/generic/collection/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.test.ts.hbs index 7694dcbda..7ffeab56e 100644 --- a/templates/generic/collection/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.test.ts.hbs +++ b/templates/generic/collection/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.test.ts.hbs @@ -36,7 +36,7 @@ test('create a {{pascal_case referenceable.name}} and get {{lower_case collectio let collectionOutput: Link[] = await bob.cells[0].callZome({ zome_name: "{{coordinator_zome_manifest.name}}", fn_name: "get_{{snake_case collection_name}}", - payload: {{#if (eq collection_type.type "Global")}}null{{else}}alice.agentPubKey{{/if}} + {{#if (eq collection_type.type "ByAuthor")}}payload: alice.agentPubKey{{/if}}, }); assert.equal(collectionOutput.length, 0); @@ -74,4 +74,4 @@ test('create a {{pascal_case referenceable.name}} and get {{lower_case collectio assert.equal(collectionOutput.length, 0); {{/if}} }); -}); +}); \ No newline at end of file diff --git a/templates/ui-frameworks/lit/collection/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.ts.hbs b/templates/ui-frameworks/lit/collection/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.ts.hbs index 7342237e6..682ad9dea 100644 --- a/templates/ui-frameworks/lit/collection/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.ts.hbs +++ b/templates/ui-frameworks/lit/collection/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.ts.hbs @@ -29,7 +29,7 @@ export class {{pascal_case collection_name}} extends LitElement { role_name: '{{dna_role_name}}', zome_name: '{{coordinator_zome_manifest.name}}', fn_name: 'get_{{snake_case collection_name}}', - payload: {{#if (eq collection_type.type "ByAuthor")}}author{{else}}null{{/if}}, + {{#if (eq collection_type.type "ByAuthor")}}payload: this.author{{/if}}, }) as Promise>, () => [{{#if (eq collection_type.type "ByAuthor")}}this.author{{/if}}]); firstUpdated() { diff --git a/templates/ui-frameworks/react/collection/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{pascal_case collection_name}}.tsx.hbs b/templates/ui-frameworks/react/collection/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{pascal_case collection_name}}.tsx.hbs index 2a679e082..f05f3c917 100644 --- a/templates/ui-frameworks/react/collection/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{pascal_case collection_name}}.tsx.hbs +++ b/templates/ui-frameworks/react/collection/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{pascal_case collection_name}}.tsx.hbs @@ -18,7 +18,7 @@ const {{pascal_case collection_name}}: FC{{#if (eq collection_type.type "ByAutho role_name: '{{dna_role_name}}', zome_name: '{{snake_case coordinator_zome_manifest.name}}', fn_name: 'get_{{snake_case collection_name}}', - payload: {{#if (eq collection_type.type "ByAuthor")}}author{{else}}null{{/if}}, + {{#if (eq collection_type.type "ByAuthor")}}payload: author{{/if}}, }); if (links?.length) { setHashes(links.map((l) => l.target)); diff --git a/templates/ui-frameworks/svelte/collection/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{pascal_case collection_name}}.svelte.hbs b/templates/ui-frameworks/svelte/collection/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{pascal_case collection_name}}.svelte.hbs index 14db899b8..a53debe70 100644 --- a/templates/ui-frameworks/svelte/collection/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{pascal_case collection_name}}.svelte.hbs +++ b/templates/ui-frameworks/svelte/collection/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{pascal_case collection_name}}.svelte.hbs @@ -53,7 +53,7 @@ async function fetch{{pascal_case (plural referenceable.name)}}() { role_name: '{{dna_role_name}}', zome_name: '{{snake_case coordinator_zome_manifest.name}}', fn_name: 'get_{{snake_case collection_name}}', - payload: {{#if (eq collection_type.type "ByAuthor")}}author{{else}}null{{/if}}, + {{#if (eq collection_type.type "ByAuthor")}}payload: author{{/if}}, }); if (links.length) { hashes = links.map(l => l.target); diff --git a/templates/ui-frameworks/vanilla/collection/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.test.ts.hbs b/templates/ui-frameworks/vanilla/collection/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.test.ts.hbs index 3aa9d2511..30dd7aa72 100644 --- a/templates/ui-frameworks/vanilla/collection/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.test.ts.hbs +++ b/templates/ui-frameworks/vanilla/collection/tests/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{kebab_case collection_name}}.test.ts.hbs @@ -36,7 +36,7 @@ test('create a {{pascal_case referenceable.name}} and get {{lower_case collectio let collectionOutput: Link[] = await bob.cells[0].callZome({ zome_name: "{{coordinator_zome_manifest.name}}", fn_name: "get_{{snake_case collection_name}}", - payload: {{#if (eq collection_type.type "Global")}}null{{else}}alice.agentPubKey{{/if}} + {{#if (eq collection_type.type "ByAuthor")}}alice.agentPubKey{{/if}}, }); assert.equal(collectionOutput.length, 0); diff --git a/templates/ui-frameworks/vue/collection/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{pascal_case collection_name}}.vue.hbs b/templates/ui-frameworks/vue/collection/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{pascal_case collection_name}}.vue.hbs index b4fe6ca36..362873a21 100644 --- a/templates/ui-frameworks/vue/collection/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{pascal_case collection_name}}.vue.hbs +++ b/templates/ui-frameworks/vue/collection/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{pascal_case collection_name}}.vue.hbs @@ -49,7 +49,7 @@ export default defineComponent({ {{/if}} await this.fetch{{pascal_case referenceable.name}}(); - toRaw(this.client).on('signal', signal => { + toRaw(this.client)?.on('signal', signal => { if (!(SignalType.App in signal)) return; if (signal.App.zome_name !== '{{coordinator_zome_manifest.name}}') return; const payload = signal.App.payload as {{pascal_case coordinator_zome_manifest.name}}Signal; @@ -69,7 +69,7 @@ export default defineComponent({ role_name: '{{dna_role_name}}', zome_name: '{{snake_case coordinator_zome_manifest.name}}', fn_name: 'get_{{snake_case collection_name}}', - payload: {{#if (eq collection_type.type "ByAuthor")}}this.author{{else}}null{{/if}}, + {{#if (eq collection_type.type "ByAuthor")}}payload: this.author{{/if}}, }); this.hashes = links.map(l => l.target); } catch (e) { diff --git "a/templates/ui-frameworks/vue/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#each entry_type.fields}}{{#if (and linked_from (not (eq linked_from.hash_type 'AgentPubKey') ) )}}{{pascal_case (plural ..\302\241entry_type.name)}}For{{pascal_case linked_from.name}}.vue{{\302\241if}}{{\302\241each}}.hbs" "b/templates/ui-frameworks/vue/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#each entry_type.fields}}{{#if (and linked_from (not (eq linked_from.hash_type 'AgentPubKey') ) )}}{{pascal_case (plural ..\302\241entry_type.name)}}For{{pascal_case linked_from.name}}.vue{{\302\241if}}{{\302\241each}}.hbs" index 48383907f..a2ffd6804 100644 --- "a/templates/ui-frameworks/vue/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#each entry_type.fields}}{{#if (and linked_from (not (eq linked_from.hash_type 'AgentPubKey') ) )}}{{pascal_case (plural ..\302\241entry_type.name)}}For{{pascal_case linked_from.name}}.vue{{\302\241if}}{{\302\241each}}.hbs" +++ "b/templates/ui-frameworks/vue/entry-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#each entry_type.fields}}{{#if (and linked_from (not (eq linked_from.hash_type 'AgentPubKey') ) )}}{{pascal_case (plural ..\302\241entry_type.name)}}For{{pascal_case linked_from.name}}.vue{{\302\241if}}{{\302\241each}}.hbs" @@ -44,7 +44,7 @@ export default defineComponent({ await this.fetch{{pascal_case (plural ../entry_type.name)}}(); - toRaw(this.client).on('signal', async signal => { + toRaw(this.client)?.on('signal', async signal => { if (!(SignalType.App in signal)) return; if (signal.App.zome_name !== '{{../coordinator_zome_manifest.name}}') return; const payload = signal.App.payload as {{pascal_case ../coordinator_zome_manifest.name}}Signal; diff --git "a/templates/ui-frameworks/vue/link-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if (and bidireccional (and to_referenceable (ne from_referenceable.hash_type 'AgentPubKey')))}}{{pascal_case (plural from_referenceable.name)}}For{{pascal_case to_referenceable.name}}.vue{{\302\241if}}.hbs" "b/templates/ui-frameworks/vue/link-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if (and bidireccional (and to_referenceable (ne from_referenceable.hash_type 'AgentPubKey')))}}{{pascal_case (plural from_referenceable.name)}}For{{pascal_case to_referenceable.name}}.vue{{\302\241if}}.hbs" index 3bf4d92ec..15df09d3f 100644 --- "a/templates/ui-frameworks/vue/link-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if (and bidireccional (and to_referenceable (ne from_referenceable.hash_type 'AgentPubKey')))}}{{pascal_case (plural from_referenceable.name)}}For{{pascal_case to_referenceable.name}}.vue{{\302\241if}}.hbs" +++ "b/templates/ui-frameworks/vue/link-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if (and bidireccional (and to_referenceable (ne from_referenceable.hash_type 'AgentPubKey')))}}{{pascal_case (plural from_referenceable.name)}}For{{pascal_case to_referenceable.name}}.vue{{\302\241if}}.hbs" @@ -58,7 +58,7 @@ export default defineComponent({ this.loading = false; } - toRaw(this.client).on('signal', signal => { + toRaw(this.client)?.on('signal', signal => { if (!(SignalType.App in signal)) return; if (signal.App.zome_name !== '{{coordinator_zome_manifest.name}}') return; const payload = signal.App.payload as {{pascal_case coordinator_zome_manifest.name}}Signal; diff --git "a/templates/ui-frameworks/vue/link-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if (and to_referenceable (ne to_referenceable.hash_type 'AgentPubKey'))}}{{pascal_case (plural to_referenceable.name)}}For{{pascal_case from_referenceable.name}}.vue{{\302\241if}}.hbs" "b/templates/ui-frameworks/vue/link-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if (and to_referenceable (ne to_referenceable.hash_type 'AgentPubKey'))}}{{pascal_case (plural to_referenceable.name)}}For{{pascal_case from_referenceable.name}}.vue{{\302\241if}}.hbs" index 13e3c5b67..a7071ac31 100644 --- "a/templates/ui-frameworks/vue/link-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if (and to_referenceable (ne to_referenceable.hash_type 'AgentPubKey'))}}{{pascal_case (plural to_referenceable.name)}}For{{pascal_case from_referenceable.name}}.vue{{\302\241if}}.hbs" +++ "b/templates/ui-frameworks/vue/link-type/ui/src/{{dna_role_name}}/{{coordinator_zome_manifest.name}}/{{#if (and to_referenceable (ne to_referenceable.hash_type 'AgentPubKey'))}}{{pascal_case (plural to_referenceable.name)}}For{{pascal_case from_referenceable.name}}.vue{{\302\241if}}.hbs" @@ -59,7 +59,7 @@ export default defineComponent({ } this.loading = false; - toRaw(this.client).on('signal', signal => { + toRaw(this.client)?.on('signal', signal => { if (!(SignalType.App in signal)) return; if (signal.App.zome_name !== '{{coordinator_zome_manifest.name}}') return; const payload = signal.App.payload as {{pascal_case coordinator_zome_manifest.name}}Signal;