Skip to content

Commit

Permalink
Removed dollar signs
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Jun 6, 2024
1 parent e21722c commit b838b3f
Show file tree
Hide file tree
Showing 24 changed files with 44 additions and 44 deletions.
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test('create a {{pascal_case referenceable.name}} and get {{lower_case collectio
const { alice, bob } = await setup(scenario);

// Bob gets {{lower_case collection_name}}
let collectionOutput = await toPromise(bob.store.{{camel_case collection_name}}{{#if (eq collection_type.type "ByAuthor")}}.get(alice.player.agentPubKey){{else}}${{/if}});
let collectionOutput = await toPromise(bob.store.{{camel_case collection_name}}{{#if (eq collection_type.type "ByAuthor")}}.get(alice.player.agentPubKey){{/if}});
assert.equal(collectionOutput.size, 0);

// Alice creates a {{pascal_case referenceable.name}}
Expand All @@ -28,7 +28,7 @@ test('create a {{pascal_case referenceable.name}} and get {{lower_case collectio
);

// Bob gets {{lower_case collection_name}} again
collectionOutput = await toPromise(bob.store.{{camel_case collection_name}}{{#if (eq collection_type.type "ByAuthor")}}.get(alice.player.agentPubKey){{/if}}$);
collectionOutput = await toPromise(bob.store.{{camel_case collection_name}}{{#if (eq collection_type.type "ByAuthor")}}.get(alice.player.agentPubKey){{/if}});
assert.equal(collectionOutput.size, 1);
assert.deepEqual({{camel_case referenceable.name}}.{{#if (eq referenceable.hash_type "ActionHash")}}actionHash{{else}}entryHash{{/if}}, Array.from(collectionOutput.keys())[0]);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class {{pascal_case collection_name}} extends SignalWatcher(LitElement) {
}

render() {
const map = this.{{camel_case coordinator_zome_manifest.name}}Store.{{camel_case collection_name}}{{#if (eq collection_type.type "ByAuthor")}}.get(this.author){{else}}${{/if}}.get();
const map = this.{{camel_case coordinator_zome_manifest.name}}Store.{{camel_case collection_name}}{{#if (eq collection_type.type "ByAuthor")}}.get(this.author){{/if}}.get();

switch (map.status) {
case 'pending':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
)
);
{{else}}
{{camel_case collection_name}}$ = pipe(
{{camel_case collection_name}} = pipe(
collectionSignal(
this.client,
() => this.client.get{{pascal_case collection_name}}(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ test('create and read {{pascal_case entry_type.name}}', async () => {
);

// Bob gets the created {{pascal_case entry_type.name}}
const createReadOutput: EntryRecord<{{pascal_case entry_type.name}}> = await toPromise(bob.store.{{camel_case (plural entry_type.name)}}.get({{camel_case entry_type.name}}{{#if entry_type.reference_entry_hash}}.entryHash{{else}}.actionHash{{/if}}){{#if crud.update}}.original{{else}}.entry{{/if}}$);
const createReadOutput: EntryRecord<{{pascal_case entry_type.name}}> = await toPromise(bob.store.{{camel_case (plural entry_type.name)}}.get({{camel_case entry_type.name}}{{#if entry_type.reference_entry_hash}}.entryHash{{else}}.actionHash{{/if}}){{#if crud.update}}.original{{else}}.entry{{/if}});
assert.deepEqual(sample, cleanNodeDecoding(createReadOutput.entry));
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class {{pascal_case (plural ../entry_type.name)}}For{{pascal_case linked_

render() {
{{#if (eq (pascal_case linked_from.name) (pascal_case ../entry_type.name))}}
const hashes = this.{{camel_case ../coordinator_zome_manifest.name}}Store.{{#if (eq linked_from.hash_type "AgentPubKey")}}{{camel_case (plural ../entry_type.name)}}For{{pascal_case linked_from.name}}.get(this.{{camel_case linked_from.singular_arg}}){{else}}{{camel_case (plural linked_from.name)}}.get(this.{{camel_case linked_from.singular_arg}}).{{camel_case (plural ../entry_type.name)}}{{#if (not ../crud.delete)}}${{/if}}{{/if}}{{#if ../crud.delete}}.live{{/if}}.get();
const hashes = this.{{camel_case ../coordinator_zome_manifest.name}}Store.{{#if (eq linked_from.hash_type "AgentPubKey")}}{{camel_case (plural ../entry_type.name)}}For{{pascal_case linked_from.name}}.get(this.{{camel_case linked_from.singular_arg}}){{else}}{{camel_case (plural linked_from.name)}}.get(this.{{camel_case linked_from.singular_arg}}).{{camel_case (plural ../entry_type.name)}}{{#if (not ../crud.delete)}}{{/if}}{{/if}}{{#if ../crud.delete}}.live{{/if}}.get();

switch (hashes.status) {
case 'pending':
Expand All @@ -84,7 +84,7 @@ export class {{pascal_case (plural ../entry_type.name)}}For{{pascal_case linked_
}

{{else}}
const map = this.{{camel_case ../coordinator_zome_manifest.name}}Store.{{#if (eq linked_from.hash_type "AgentPubKey")}}{{camel_case (plural ../entry_type.name)}}For{{pascal_case linked_from.name}}.get(this.{{camel_case linked_from.singular_arg}}){{else}}{{camel_case (plural linked_from.name)}}.get(this.{{camel_case linked_from.singular_arg}}).{{camel_case (plural ../entry_type.name)}}{{#if (not ../crud.delete)}}${{/if}}{{/if}}{{#if ../crud.delete}}.live{{/if}}.get();
const map = this.{{camel_case ../coordinator_zome_manifest.name}}Store.{{#if (eq linked_from.hash_type "AgentPubKey")}}{{camel_case (plural ../entry_type.name)}}For{{pascal_case linked_from.name}}.get(this.{{camel_case linked_from.singular_arg}}){{else}}{{camel_case (plural linked_from.name)}}.get(this.{{camel_case linked_from.singular_arg}}).{{camel_case (plural ../entry_type.name)}}{{#if (not ../crud.delete)}}{{/if}}{{/if}}{{#if ../crud.delete}}.live{{/if}}.get();

switch (map.status) {
case 'pending':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class Edit{{pascal_case entry_type.name}} extends SignalWatcher(LitElemen
{{/each}}

async firstUpdated() {
const currentRecord = await toPromise(this.{{camel_case coordinator_zome_manifest.name}}Store.{{camel_case (plural entry_type.name)}}.get(this.{{camel_case entry_type.name}}Hash).{{#if crud.update}}latestVersion{{else}}entry{{/if}}$);
const currentRecord = await toPromise(this.{{camel_case coordinator_zome_manifest.name}}Store.{{camel_case (plural entry_type.name)}}.get(this.{{camel_case entry_type.name}}Hash).{{#if crud.update}}latestVersion{{else}}entry{{/if}});
{{#each entry_type.fields}}
{{#if widget}}
{{#if (eq cardinality "vector")}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { {{pascal_case entry_type.name}} } from './types.js';
),
},
{{else}}
{{camel_case (plural ../entry_type.name)}}$: pipe(
{{camel_case (plural ../entry_type.name)}}: pipe(
liveLinksSignal(
this.client,
{{camel_case linked_from.singular_arg}},
Expand Down Expand Up @@ -79,7 +79,7 @@ import { {{pascal_case entry_type.name}} } from './types.js';
),
},
{{else}}
{{camel_case (plural ../entry_type.name)}}$: pipe(
{{camel_case (plural ../entry_type.name)}}: pipe(
liveLinksSignal(
this.client,
{{camel_case linked_from.singular_arg}},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ test('link a {{pascal_case from_referenceable.name}} to a {{pascal_case to_refer
{{/if}}

// Bob gets the links, should be empty
let linksOutput = await toPromise(bob.store.{{#if (ne from_referenceable.hash_type "ActionHash")}}{{camel_case (plural to_referenceable.name)}}For{{pascal_case from_referenceable.name}}.get(baseAddress){{else}}{{camel_case (plural from_referenceable.name)}}.get(baseAddress).{{camel_case (plural to_referenceable.name)}}{{/if}}{{#if delete}}.live{{/if}}$);
let linksOutput = await toPromise(bob.store.{{#if (ne from_referenceable.hash_type "ActionHash")}}{{camel_case (plural to_referenceable.name)}}For{{pascal_case from_referenceable.name}}.get(baseAddress){{else}}{{camel_case (plural from_referenceable.name)}}.get(baseAddress).{{camel_case (plural to_referenceable.name)}}{{/if}}{{#if delete}}.live{{/if}});
assert.equal(linksOutput.size, 0);

// Alice creates a link from {{pascal_case from_referenceable.name}} to {{pascal_case to_referenceable.name}}
Expand All @@ -56,7 +56,7 @@ test('link a {{pascal_case from_referenceable.name}} to a {{pascal_case to_refer
);

// Bob gets the links again
linksOutput = await toPromise(bob.store.{{#if (ne from_referenceable.hash_type "ActionHash")}}{{camel_case (plural to_referenceable.name)}}For{{pascal_case from_referenceable.name}}.get(baseAddress){{else}}{{camel_case (plural from_referenceable.name)}}.get(baseAddress).{{camel_case (plural to_referenceable.name)}}{{/if}}{{#if delete}}.live{{/if}}$);
linksOutput = await toPromise(bob.store.{{#if (ne from_referenceable.hash_type "ActionHash")}}{{camel_case (plural to_referenceable.name)}}For{{pascal_case from_referenceable.name}}.get(baseAddress){{else}}{{camel_case (plural from_referenceable.name)}}.get(baseAddress).{{camel_case (plural to_referenceable.name)}}{{/if}}{{#if delete}}.live{{/if}});
{{#if (eq to_referenceable.hash_type "AgentPubKey")}}
assert.equal(linksOutput.length, 1);
assert.deepEqual(targetAddress, linksOutput[0]);
Expand All @@ -67,7 +67,7 @@ test('link a {{pascal_case from_referenceable.name}} to a {{pascal_case to_refer

{{#if bidirectional}}
// Bob gets the links in the inverse direction
let inverseLinksOutput = await toPromise(bob.store.{{#if (ne to_referenceable.hash_type "ActionHash")}}{{camel_case (plural from_referenceable.name)}}For{{pascal_case to_referenceable.name}}.get(targetAddress){{else}}{{camel_case (plural to_referenceable.name)}}.get(targetAddress).{{camel_case (plural from_referenceable.name)}}{{/if}}{{#if delete}}.live{{/if}}$);
let inverseLinksOutput = await toPromise(bob.store.{{#if (ne to_referenceable.hash_type "ActionHash")}}{{camel_case (plural from_referenceable.name)}}For{{pascal_case to_referenceable.name}}.get(targetAddress){{else}}{{camel_case (plural to_referenceable.name)}}.get(targetAddress).{{camel_case (plural from_referenceable.name)}}{{/if}}{{#if delete}}.live{{/if}});
{{#if (eq from_referenceable.hash_type "AgentPubKey")}}
assert.equal(inverseLinksOutput.length, 1);
assert.deepEqual(baseAddress, inverseLinksOutput[0]);
Expand All @@ -87,7 +87,7 @@ test('link a {{pascal_case from_referenceable.name}} to a {{pascal_case to_refer
);

// Bob gets the links again
linksOutput = await toPromise(bob.store.{{#if (ne from_referenceable.hash_type "ActionHash")}}{{camel_case (plural to_referenceable.name)}}For{{pascal_case from_referenceable.name}}.get(baseAddress){{else}}{{camel_case (plural from_referenceable.name)}}.get(baseAddress).{{camel_case (plural to_referenceable.name)}}{{/if}}{{#if delete}}.live{{/if}}$);
linksOutput = await toPromise(bob.store.{{#if (ne from_referenceable.hash_type "ActionHash")}}{{camel_case (plural to_referenceable.name)}}For{{pascal_case from_referenceable.name}}.get(baseAddress){{else}}{{camel_case (plural from_referenceable.name)}}.get(baseAddress).{{camel_case (plural to_referenceable.name)}}{{/if}}{{#if delete}}.live{{/if}});
{{#if (eq to_referenceable.hash_type "AgentPubKey")}}
assert.equal(linksOutput.length, 0);
{{else}}
Expand All @@ -104,7 +104,7 @@ test('link a {{pascal_case from_referenceable.name}} to a {{pascal_case to_refer

{{#if bidirectional}}
// Bob gets the links in the inverse direction
inverseLinksOutput = await toPromise(bob.store.{{#if (ne to_referenceable.hash_type "ActionHash")}}{{camel_case (plural from_referenceable.name)}}For{{pascal_case to_referenceable.name}}.get(targetAddress){{else}}{{camel_case (plural to_referenceable.name)}}.get(targetAddress).{{camel_case (plural from_referenceable.name)}}{{/if}}{{#if delete}}.live{{/if}}$);
inverseLinksOutput = await toPromise(bob.store.{{#if (ne to_referenceable.hash_type "ActionHash")}}{{camel_case (plural from_referenceable.name)}}For{{pascal_case to_referenceable.name}}.get(targetAddress){{else}}{{camel_case (plural to_referenceable.name)}}.get(targetAddress).{{camel_case (plural from_referenceable.name)}}{{/if}}{{#if delete}}.live{{/if}});
{{#if (eq from_referenceable.hash_type "AgentPubKey")}}
assert.equal(inverseLinksOutput.length, 0);
{{else}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class {{pascal_case (plural from_referenceable.name)}}For{{pascal_case to
}

render() {
const {{#if (eq from_referenceable.hash_type "AgentPubKey")}}agents{{else}}map{{/if}} = this.{{camel_case coordinator_zome_manifest.name}}Store.{{#if (eq to_referenceable.hash_type "AgentPubKey")}}{{plural (camel_case from_referenceable.name)}}For{{pascal_case to_referenceable.name}}.get(this.{{camel_case to_referenceable.singular_arg}}){{else}}{{camel_case (plural to_referenceable.name)}}.get(this.{{camel_case to_referenceable.singular_arg}}).{{plural (camel_case from_referenceable.name)}}{{#if (not delete)}}${{/if}}{{/if}}{{#if delete}}.live{{/if}}.get();
const {{#if (eq from_referenceable.hash_type "AgentPubKey")}}agents{{else}}map{{/if}} = this.{{camel_case coordinator_zome_manifest.name}}Store.{{#if (eq to_referenceable.hash_type "AgentPubKey")}}{{plural (camel_case from_referenceable.name)}}For{{pascal_case to_referenceable.name}}.get(this.{{camel_case to_referenceable.singular_arg}}){{else}}{{camel_case (plural to_referenceable.name)}}.get(this.{{camel_case to_referenceable.singular_arg}}).{{plural (camel_case from_referenceable.name)}}{{#if (not delete)}}{{/if}}{{/if}}{{#if delete}}.live{{/if}}.get();

switch ({{#if (eq from_referenceable.hash_type "AgentPubKey")}}agents{{else}}map{{/if}}.status) {
case 'pending':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class {{pascal_case (plural to_referenceable.name)}}For{{pascal_case from
}

render() {
const {{#if (eq to_referenceable.hash_type "AgentPubKey")}}agents{{else}}map{{/if}} = this.{{camel_case coordinator_zome_manifest.name}}Store.{{#if (eq from_referenceable.hash_type "AgentPubKey")}}{{plural (camel_case to_referenceable.name)}}For{{pascal_case from_referenceable.name}}.get(this.{{camel_case from_referenceable.singular_arg}}){{else}}{{camel_case (plural from_referenceable.name)}}.get(this.{{camel_case from_referenceable.singular_arg}}).{{plural (camel_case to_referenceable.name)}}{{#if (not delete)}}${{/if}}{{/if}}{{#if delete}}.live{{/if}}.get();
const {{#if (eq to_referenceable.hash_type "AgentPubKey")}}agents{{else}}map{{/if}} = this.{{camel_case coordinator_zome_manifest.name}}Store.{{#if (eq from_referenceable.hash_type "AgentPubKey")}}{{plural (camel_case to_referenceable.name)}}For{{pascal_case from_referenceable.name}}.get(this.{{camel_case from_referenceable.singular_arg}}){{else}}{{camel_case (plural from_referenceable.name)}}.get(this.{{camel_case from_referenceable.singular_arg}}).{{plural (camel_case to_referenceable.name)}}{{#if (not delete)}}{{/if}}{{/if}}{{#if delete}}.live{{/if}}.get();

switch ({{#if (eq to_referenceable.hash_type "AgentPubKey")}}agents{{else}}map{{/if}}.status) {
case 'pending':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
),
},
{{else}}
{{camel_case (plural to_referenceable.name)}}$: pipe(
{{camel_case (plural to_referenceable.name)}}: pipe(
liveLinksSignal(
this.client,
{{camel_case from_referenceable.singular_arg}},
Expand Down Expand Up @@ -83,7 +83,7 @@
),
},
{{else}}
{{camel_case (plural from_referenceable.name)}}$: pipe(
{{camel_case (plural from_referenceable.name)}}: pipe(
liveLinksSignal(
this.client,
{{camel_case to_referenceable.singular_arg}},
Expand Down Expand Up @@ -185,7 +185,7 @@
),
},
{{else}}
{{camel_case (plural from_referenceable.name)}}$: pipe(
{{camel_case (plural from_referenceable.name)}}: pipe(
liveLinksSignal(
this.client,
{{camel_case to_referenceable.singular_arg}},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test('create a {{pascal_case referenceable.name}} and get {{lower_case collectio
const { alice, bob } = await setup(scenario);

// Bob gets {{lower_case collection_name}}
let collectionOutput = await toPromise(bob.store.{{camel_case collection_name}}{{#if (eq collection_type.type "ByAuthor")}}.get(alice.player.agentPubKey){{else}}${{/if}});
let collectionOutput = await toPromise(bob.store.{{camel_case collection_name}}{{#if (eq collection_type.type "ByAuthor")}}.get(alice.player.agentPubKey){{else}}{{/if}});
assert.equal(collectionOutput.size, 0);

// Alice creates a {{pascal_case referenceable.name}}
Expand All @@ -28,7 +28,7 @@ test('create a {{pascal_case referenceable.name}} and get {{lower_case collectio
);

// Bob gets {{lower_case collection_name}} again
collectionOutput = await toPromise(bob.store.{{camel_case collection_name}}{{#if (eq collection_type.type "ByAuthor")}}.get(alice.player.agentPubKey){{else}}${{/if}});
collectionOutput = await toPromise(bob.store.{{camel_case collection_name}}{{#if (eq collection_type.type "ByAuthor")}}.get(alice.player.agentPubKey){{else}}{{/if}});
assert.equal(collectionOutput.size, 1);
assert.deepEqual({{camel_case referenceable.name}}.{{#if (eq referenceable.hash_type "ActionHash")}}actionHash{{else}}entryHash{{/if}}, Array.from(collectionOutput.keys())[0]);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class {{pascal_case collection_name}} extends SignalWatcher(LitElement) {
}

render() {
const map = this.{{camel_case coordinator_zome_manifest.name}}Store.{{camel_case collection_name}}{{#if (eq collection_type.type "ByAuthor")}}.get(this.author){{else}}${{/if}}.get();
const map = this.{{camel_case coordinator_zome_manifest.name}}Store.{{camel_case collection_name}}{{#if (eq collection_type.type "ByAuthor")}}.get(this.author){{/if}}.get();

switch (map.status) {
case 'pending':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
)
);
{{else}}
{{camel_case collection_name}}$ = pipe(
{{camel_case collection_name}} = pipe(
collectionSignal(
this.client,
() => this.client.get{{pascal_case collection_name}}(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ test('create and read {{pascal_case entry_type.name}}', async () => {
);

// Bob gets the created {{pascal_case entry_type.name}}
const createReadOutput: EntryRecord<{{pascal_case entry_type.name}}> = await toPromise(bob.store.{{camel_case (plural entry_type.name)}}.get({{camel_case entry_type.name}}{{#if entry_type.reference_entry_hash}}.entryHash{{else}}.actionHash{{/if}}){{#if crud.update}}.original{{else}}.entry{{/if}}$);
const createReadOutput: EntryRecord<{{pascal_case entry_type.name}}> = await toPromise(bob.store.{{camel_case (plural entry_type.name)}}.get({{camel_case entry_type.name}}{{#if entry_type.reference_entry_hash}}.entryHash{{else}}.actionHash{{/if}}){{#if crud.update}}.original{{else}}.entry{{/if}});
assert.deepEqual(sample, cleanNodeDecoding(createReadOutput.entry));
});
});
Expand Down
Loading

0 comments on commit b838b3f

Please sign in to comment.