Skip to content

Commit

Permalink
chore: bump weekly to holochain 0.5.0 dev.20 (#455)
Browse files Browse the repository at this point in the history
* Bump versions

* nix flake update

* Bump holochain_types

* Pin holo-server-bin version to most recent working version

* Unpin holo-dev-server-bin

* Update ci workflow

* Bump to 0.5.0-dev.17

* Nix flake update

* ci: Add `ci_pass` job (#454)

* ci: Add `ci_pass` job

* ci: Rename develop to main

* Fix lit template ts error (#448)

* fix: wrongly used v-if directive (#457)

* Fix incorrect usage of v-if directive

* Fix vue-ts type error on current record prop

* Check both editing and record

* Bump to dev.18

* Nix flake update

* Remove test retries

* Bump versions

* Nix flake update

* Fix signal usage

* Bump tryorama

* Bump dep versions

* Nix flake update

* Update enum usage in tests

* Fix slow tests

* Update app bundle sources

---------

Co-authored-by: ThetaSinner <[email protected]>
  • Loading branch information
c12i and ThetaSinner authored Mar 3, 2025
1 parent c276d08 commit d35cdaf
Show file tree
Hide file tree
Showing 28 changed files with 461 additions and 500 deletions.
656 changes: 306 additions & 350 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
edition = "2021"
name = "holochain_scaffolding_cli"
version = "0.500.0-dev.5"
version = "0.500.0-dev.6"
description = "CLI to easily generate and modify holochain apps"
license = "CAL-1.0"
homepage = "https://developer.holochain.org"
Expand All @@ -18,8 +18,8 @@ name = "holochain_scaffolding_cli"
path = "src/lib.rs"

[dependencies]
holochain_types = "0.5.0-dev.13"
mr_bundle = "0.5.0-dev.1"
holochain_types = "0.5.0-dev.20"
mr_bundle = "0.5.0-dev.5"

dirs = "5.0.1"
ignore = "0.4"
Expand Down
46 changes: 23 additions & 23 deletions flake.lock

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

10 changes: 5 additions & 5 deletions src/versions.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/// npm: <https://www.npmjs.com/package/@holochain/tryorama>
pub const TRYORAMA_VERSION: &str = "^0.18.0-dev.3";
pub const TRYORAMA_VERSION: &str = "^0.18.0-dev.5";

/// npm: <https://www.npmjs.com/package/@holochain/client>
pub const HOLOCHAIN_CLIENT_VERSION: &str = "^0.19.0-dev.6";
pub const HOLOCHAIN_CLIENT_VERSION: &str = "^0.19.0-dev.7";

/// npm: <https://www.npmjs.com/package/@holochain/hc-spin>
pub const HC_SPIN_VERSION: &str = "^0.500.0-dev.0";
Expand All @@ -11,13 +11,13 @@ pub const HC_SPIN_VERSION: &str = "^0.500.0-dev.0";
pub const WEB_SDK_VERSION: &str = "^0.6.20-prerelease";

/// crates.io <https://crates.io/crates/hdi/versions>
pub const HDI_VERSION: &str = "0.6.0-dev.9";
pub const HDI_VERSION: &str = "0.6.0-dev.15";

/// crates.io <https://crates.io/crates/hdk/versions>
pub const HDK_VERSION: &str = "0.5.0-dev.12";
pub const HDK_VERSION: &str = "0.5.0-dev.19";

/// crates.io <https://crates.io/crates/holochain/versions>
pub const HOLOCHAIN_VERSION: &str = "0.5.0-dev.13";
pub const HOLOCHAIN_VERSION: &str = "0.5.0-dev.20";

/// source: <https://github.com/darksoil-studio/holochain-playground/tree/main/packages/cli/server>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ test('create a {{pascal_case referenceable.name}} and get {{lower_case collectio
const testAppPath = process.cwd() + '/../workdir/{{app_name}}.happ';

// Set up the app to be installed
const appSource = { appBundleSource: { path: testAppPath } };
const appBundleSource: AppBundleSource = { type: "path", value: testAppPath };
const appSource = { appBundleSource };

// Add 2 players with the test app to the Scenario. The returned players
// can be destructured.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ test('create {{pascal_case entry_type.name}}', async () => {
// This assumes app bundle created by the `hc app pack` command.
const testAppPath = process.cwd() + '/../workdir/{{app_name}}.happ';

// Set up the app to be installed
const appSource = { appBundleSource: { path: testAppPath } };
// Set up the app to be installed
const appBundleSource: AppBundleSource = { type: "path", value: testAppPath };
const appSource = { appBundleSource };

// Add 2 players with the test app to the Scenario. The returned players
// can be destructured.
Expand All @@ -47,8 +48,9 @@ test('create and read {{pascal_case entry_type.name}}', async () => {
// This assumes app bundle created by the `hc app pack` command.
const testAppPath = process.cwd() + '/../workdir/{{app_name}}.happ';

// Set up the app to be installed
const appSource = { appBundleSource: { path: testAppPath } };
// Set up the app to be installed
const appBundleSource: AppBundleSource = { type: "path", value: testAppPath };
const appSource = { appBundleSource };

// Add 2 players with the test app to the Scenario. The returned players
// can be destructured.
Expand Down Expand Up @@ -99,8 +101,9 @@ test('create and update {{pascal_case entry_type.name}}', async () => {
// This assumes app bundle created by the `hc app pack` command.
const testAppPath = process.cwd() + '/../workdir/{{app_name}}.happ';

// Set up the app to be installed
const appSource = { appBundleSource: { path: testAppPath } };
// Set up the app to be installed
const appBundleSource: AppBundleSource = { type: "path", value: testAppPath };
const appSource = { appBundleSource };

// Add 2 players with the test app to the Scenario. The returned players
// can be destructured.
Expand All @@ -113,9 +116,9 @@ test('create and update {{pascal_case entry_type.name}}', async () => {
// Alice creates a {{pascal_case entry_type.name}}
const record: Record = await create{{pascal_case entry_type.name}}(alice.cells[0]);
assert.ok(record);

const originalActionHash = record.signed_action.hashed.hash;

// Alice updates the {{pascal_case entry_type.name}}
let contentUpdate: any = await sample{{pascal_case entry_type.name}}(alice.cells[0]);
let updateInput = {
Expand All @@ -135,7 +138,7 @@ test('create and update {{pascal_case entry_type.name}}', async () => {

// Wait for the updated entry to be propagated to the other node.
await dhtSync([alice, bob], alice.cells[0].cell_id[0]);

// Bob gets the updated {{pascal_case entry_type.name}}
const readUpdatedOutput0: Record = await bob.cells[0].callZome({
zome_name: "{{coordinator_zome_manifest.name}}",
Expand All @@ -146,7 +149,7 @@ test('create and update {{pascal_case entry_type.name}}', async () => {

// Alice updates the {{pascal_case entry_type.name}} again
contentUpdate = await sample{{pascal_case entry_type.name}}(alice.cells[0]);
updateInput = {
updateInput = {
{{#if link_from_original_to_each_update}}
original_{{snake_case entry_type.name}}_hash: originalActionHash,
{{/if}}
Expand All @@ -163,7 +166,7 @@ test('create and update {{pascal_case entry_type.name}}', async () => {

// Wait for the updated entry to be propagated to the other node.
await dhtSync([alice, bob], alice.cells[0].cell_id[0]);

// Bob gets the updated {{pascal_case entry_type.name}}
const readUpdatedOutput1: Record = await bob.cells[0].callZome({
zome_name: "{{coordinator_zome_manifest.name}}",
Expand Down Expand Up @@ -191,8 +194,9 @@ test('create and delete {{pascal_case entry_type.name}}', async () => {
// This assumes app bundle created by the `hc app pack` command.
const testAppPath = process.cwd() + '/../workdir/{{app_name}}.happ';

// Set up the app to be installed
const appSource = { appBundleSource: { path: testAppPath } };
// Set up the app to be installed
const appBundleSource: AppBundleSource = { type: "path", value: testAppPath };
const appSource = { appBundleSource };

// Add 2 players with the test app to the Scenario. The returned players
// can be destructured.
Expand Down Expand Up @@ -235,15 +239,15 @@ test('create and delete {{pascal_case entry_type.name}}', async () => {

// Wait for the entry deletion to be propagated to the other node.
await dhtSync([alice, bob], alice.cells[0].cell_id[0]);

// Bob gets the oldest delete for the {{pascal_case entry_type.name}}
const oldestDeleteFor{{pascal_case entry_type.name}}: SignedActionHashed = await bob.cells[0].callZome({
zome_name: "{{coordinator_zome_manifest.name}}",
fn_name: "get_oldest_delete_for_{{snake_case entry_type.name}}",
payload: record.signed_action.hashed.hash,
});
assert.ok(oldestDeleteFor{{pascal_case entry_type.name}});

// Bob gets the deletions for the {{pascal_case entry_type.name}}
const deletesFor{{pascal_case entry_type.name}}: SignedActionHashed[] = await bob.cells[0].callZome({
zome_name: "{{coordinator_zome_manifest.name}}",
Expand All @@ -263,7 +267,7 @@ test('create and delete {{pascal_case entry_type.name}}', async () => {
});
assert.equal(linksTo{{pascal_case (plural linked_from.name)}}.length, 0);

// Bob gets the deleted {{pascal_case (plural linked_from.name)}} for the {{pascal_case ../entry_type.name}}
// Bob gets the deleted {{pascal_case (plural linked_from.name)}} for the {{pascal_case ../entry_type.name}}
const deletedLinksTo{{pascal_case (plural linked_from.name)}}: Array<[SignedActionHashed<CreateLink>, SignedActionHashed<DeleteLink>[]]> = await bob.cells[0].callZome({
zome_name: "{{../coordinator_zome_manifest.name}}",
fn_name: "get_deleted_{{snake_case (plural ../entry_type.name)}}_for_{{snake_case linked_from.name}}",
Expand All @@ -276,4 +280,4 @@ test('create and delete {{pascal_case entry_type.name}}', async () => {

});
});
{{/if}}
{{/if}}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ test('link a {{pascal_case from_referenceable.name}} to a {{pascal_case to_refer
const testAppPath = process.cwd() + '/../workdir/{{app_name}}.happ';

// Set up the app to be installed
const appSource = { appBundleSource: { path: testAppPath } };
const appBundleSource: AppBundleSource = { type: "path", value: testAppPath };
const appSource = { appBundleSource };

// Add 2 players with the test app to the Scenario. The returned players
// can be destructured.
Expand Down
2 changes: 1 addition & 1 deletion templates/generic/web-app/tests/package.json.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@holochain/client": "{{holochain_client_version}}",
"@holochain/tryorama": "{{tryorama_version}}",
"typescript": "^4.9.4",
"vitest": "^3.0.5"
"vitest": "^3.0.7"
},
"type": "module"
}
5 changes: 2 additions & 3 deletions templates/generic/web-app/tests/vitest.config.ts.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ import { defineConfig } from 'vitest/config'

export default defineConfig({
test: {
retry: 3,
testTimeout: 60*1000*6, // 6 mins
testTimeout: 60*1000*4, // 4 mins
poolOptions: {
threads: { singleThread: true },
forks: { singleFork: true },
},
},
})
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { LitElement, html } from 'lit';
import { state, customElement, property } from 'lit/decorators.js';
import { AppClient, AgentPubKey, Link, EntryHash, ActionHash, Record, NewEntryAction, SignalType } from '@holochain/client';
import { AppClient, AgentPubKey, Link, EntryHash, ActionHash, Record, NewEntryAction } from '@holochain/client';
import { consume } from '@lit/context';
import { Task } from '@lit/task';

Expand Down Expand Up @@ -40,9 +40,9 @@ export class {{pascal_case collection_name}} extends LitElement {
{{/if}}

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;
if (signal.type !== "app") return;
if (signal.value.zome_name !== '{{coordinator_zome_manifest.name}}') return;
const payload = signal.value.payload as {{pascal_case coordinator_zome_manifest.name}}Signal;
if (payload.type !== 'EntryCreated') return;
if (payload.app_entry.type !== '{{pascal_case referenceable.name}}') return;
{{#if (eq collection_type.type "ByAuthor")}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { LitElement, html } from 'lit';
import { state, customElement, property } from 'lit/decorators.js';
import { InstalledCell, Record, Link, AppClient, EntryHash, ActionHash, AgentPubKey, SignalType } from '@holochain/client';
import { InstalledCell, Record, Link, AppClient, EntryHash, ActionHash, AgentPubKey } from '@holochain/client';
import { consume } from '@lit/context';
import { Task } from '@lit/task';

Expand Down Expand Up @@ -36,9 +36,9 @@ export class {{pascal_case (plural ../entry_type.name)}}For{{pascal_case linked_
}

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;
if (signal.type !== "app") return;
if (signal.value.zome_name !== '{{../coordinator_zome_manifest.name}}') return;
const payload = signal.value.payload as {{pascal_case ../coordinator_zome_manifest.name}}Signal;
if (!(payload.type === 'EntryCreated' && payload.app_entry.type === '{{pascal_case ../entry_type.name}}')) return;
this._fetch{{pascal_case (plural ../entry_type.name)}}.run();
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { LitElement, html } from 'lit';
import { state, property, customElement } from 'lit/decorators.js';
import { AgentPubKey, Link, EntryHash, ActionHash, Record, AppClient, NewEntryAction, SignalType } from '@holochain/client';
import { AgentPubKey, Link, EntryHash, ActionHash, Record, AppClient, NewEntryAction } from '@holochain/client';
import { consume } from '@lit/context';
import { Task } from '@lit/task';

Expand Down Expand Up @@ -36,9 +36,9 @@ export class {{pascal_case (plural from_referenceable.name)}}For{{pascal_case to
}

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;
if (signal.type !== "app") return;
if (signal.value.zome_name !== '{{coordinator_zome_manifest.name}}') return;
const payload = signal.value.payload as {{pascal_case coordinator_zome_manifest.name}}Signal;
if (payload.type !== 'LinkCreated') return;
if (payload.link_type !== '{{pascal_case bidirectional}}') return;

Expand Down
Loading

0 comments on commit d35cdaf

Please sign in to comment.