Skip to content

Commit

Permalink
Updated hc, minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Apr 11, 2024
1 parent cc27417 commit 9bfbc7a
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tauri = { version = "2.0.0-beta", features = [

# Holochain dependencies
mr_bundle = "0.3.0-beta-dev"
holochain = "=0.3.0-beta-dev.43"
holochain = "=0.3.0-beta-dev.45"
holochain_types = "0.3.0-beta-dev"
holochain_keystore = "0.3.0-beta-dev"
holochain_conductor_api = "0.3.0-beta-dev"
Expand Down
1 change: 0 additions & 1 deletion examples/tauri-app/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ lair_keystore = { version = "0.4.0" }
holochain_client = { version = "0.5.0-dev" }
log = "0.4"
tauri-plugin-log = "2.0.0-beta"

url2 = "0.0.6"
4 changes: 2 additions & 2 deletions examples/tauri-app/ui/src/forum/posts/create-post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { Snackbar } from '@material/mwc-snackbar';
import '@material/mwc-textfield';
import '@material/mwc-textarea';

import { clientContext } from '../../contexts';
import { Post } from './types';
import { clientContext } from '../../contexts.js';
import { Post } from './types.js';

@customElement('create-post')
export class CreatePost extends LitElement {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ inputs, rootPath, ... }:
{ inputs, rootPath, excludedCrates, ... }:

{
perSystem =
Expand All @@ -7,6 +7,7 @@
, ...
}: {
packages.{{zome_manifest.name}} = inputs.hc-infra.outputs.lib.rustZome {
inherit excludedCrates;
workspacePath = rootPath;
holochain = inputs'.holochain;
crateCargoToml = ./Cargo.toml;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { dirname } from 'path';
import { fileURLToPath } from 'url';
import { appPath } from '../../app-path.js';
import { {{pascal_case zome_manifest.name}}Client } from '../../../../ui/src/{{dna_role_name}}/{{kebab_case zome_manifest.name}}/{{kebab_case zome_manifest.name}}-client.js';
import { {{pascal_case zome_manifest.name}}Store } from '../../../../ui/src//{{dna_role_name}}/{{kebab_case zome_manifest.name}}/{{kebab_case zome_manifest.name}}-store.js';
import { {{pascal_case zome_manifest.name}}Store } from '../../../../ui/src/{{dna_role_name}}/{{kebab_case zome_manifest.name}}/{{kebab_case zome_manifest.name}}-store.js';

export async function setup(scenario: Scenario) {
// Add 2 players with the test hApp to the Scenario. The returned players
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{ inputs, rootPath, ... }:
{ inputs, rootPath, excludedCrates, ... }:

{
perSystem =
{ inputs'
, ...
}: {
packages.{{zome_manifest.name}} = inputs.hc-infra.outputs.lib.rustZome {
inherit excludedCrates;
workspacePath = rootPath;
holochain = inputs'.holochain;
crateCargoToml = ./Cargo.toml;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async fn link_a_{{snake_case from_referenceable.name}}_to_a_{{snake_case to_refe
{{/if}}
{{/if}}
{{#if (eq to_referenceable.hash_type "AgentPubKey")}}
let target_address = alice.agentPubKey;
let target_address = alice.agent_pubkey();
{{else}}
let target_record = create_{{snake_case to_referenceable.name}}(&conductors[0], &alice_zome, sample_{{snake_case to_referenceable.name}}_1(&conductors[0], &alice_zome).await).await;
{{#if (eq to_referenceable.hash_type "EntryHash")}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ test('link a {{pascal_case from_referenceable.name}} to a {{pascal_case to_refer

// 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}});
{{#if (eq to_referenceable.hash_type "AgentPubKey")}}
assert.equal(linksOutput.length, 0);
{{else}}
assert.equal(linksOutput.size, 0);
{{/if}}

// Alice creates a link from {{pascal_case from_referenceable.name}} to {{pascal_case to_referenceable.name}}
await alice.store.client.add{{pascal_case to_referenceable.name}}For{{pascal_case from_referenceable.name}}(baseAddress, targetAddress);
Expand Down
1 change: 1 addition & 0 deletions templates/happ-open-dev/web-app/flake.nix.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
specialArgs = {
## Special arguments for the flake parts of this repository
rootPath = ./.;
excludedCrates = [ "{{app_name}}" ];
};
}
{
Expand Down
5 changes: 3 additions & 2 deletions templates/happ-open-dev/web-app/package.json.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
"private": true,
"scripts": {
"local-services": "hc run-local-services --bootstrap-port $BOOTSTRAP_PORT --signal-port $SIGNAL_PORT",
"test": "pnpm run build:happ && nix flake check -L && pnpm -F tests test",
"happ:build-debug": "nix build -L .#{{app_name}}.meta.debug -o workdir/{{app_name}}.happ",
"test": "pnpm happ:build-debug && nix flake check -L && pnpm -F tests test",
"happ:build-debug": "nix build -L .#{{app_name}}.meta.debug -o workdir/{{app_name}}debug.happ",
"happ:build": "nix build -L .#{{app_name}} -o workdir/{{app_name}}.happ",
"tauri": "tauri"
},
"devDependencies": {
"@holochain-playground/cli": "^0.1.0",
"@tauri-apps/cli": "^2.0.0-alpha.17",
"concurrently": "^6.2.1",
"internal-ip-cli": "^2.0.0",
"new-port-cli": "^1.0.0",
"rimraf": "^3.0.2"
},
Expand Down
1 change: 1 addition & 0 deletions templates/happ-open-dev/web-app/src-tauri/Cargo.toml.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ lair_keystore = { version = "0.4.0" }
holochain_client = { version = "0.5.0-dev" }
log = "0.4"
tauri-plugin-log = "2.0.0-beta"
url2 = "0.0.6"

3 changes: 2 additions & 1 deletion templates/happ-open-dev/web-app/ui/package.json.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ui",
"version": "0.0.0",
"scripts": {
"start": "vite --port $UI_PORT --clearScreen false",
"start": "vite",
"build": "vite build",
"lint": "eslint --ext .ts,.html . --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore",
"format": "eslint --fix --ext .ts,.html . --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore",
Expand Down Expand Up @@ -32,6 +32,7 @@
"bestzip": "^2.2.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"internal-ip": "^8.0.0",
"prettier": "^3.2.5",
"rimraf": "^3.0.2",
"vite": "^4.0.0",
Expand Down
1 change: 1 addition & 0 deletions templates/happ-open-dev/web-app/ui/vite.config.ts.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import path from "path";
import { viteStaticCopy } from "vite-plugin-static-copy";
import { internalIpV4Sync } from "internal-ip";

// @ts-ignore
const mobile = !!/android|ios/.exec(process.env.TAURI_ENV_PLATFORM);

export default defineConfig({
Expand Down

0 comments on commit 9bfbc7a

Please sign in to comment.