Skip to content

Commit

Permalink
Switch playground source to nix (#445)
Browse files Browse the repository at this point in the history
* Switch playground source to nix

* Removed version

* Pin ts version for lit template

---------

Co-authored-by: Collins Muriuki <[email protected]>
  • Loading branch information
guillemcordoba and c12i authored Jan 14, 2025
1 parent 658aaf5 commit 59bb240
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 14 deletions.
3 changes: 3 additions & 0 deletions src/scaffold/app/nix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ pub fn flake_nix(holo_enabled: bool, package_manager: &PackageManager) -> FileTr
nixpkgs.follows = "holonix/nixpkgs";
flake-parts.follows = "holonix/flake-parts";
playground.url = "github:darksoil-studio/holochain-playground?ref=main-0.4";
{}
}};
Expand All @@ -47,6 +49,7 @@ pub fn flake_nix(holo_enabled: bool, package_manager: &PackageManager) -> FileTr
packages = (with pkgs; [
nodejs_20
binaryen
inputs'.playground.packages.hc-playground
{}
{}
]);
Expand Down
2 changes: 0 additions & 2 deletions src/templates/web_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ pub struct ScaffoldWebAppData<'a> {
pub hdk_version: &'a str,
pub hdi_version: &'a str,
pub holochain_client_version: &'a str,
pub holochain_playground_cli_version: &'a str,
pub holo_web_sdk_version: &'a str,
pub hc_spin_version: &'a str,
pub package_manager: PackageManager,
Expand All @@ -42,7 +41,6 @@ pub fn scaffold_web_app_template(
hdi_version: versions::HDI_VERSION,
holochain_client_version: versions::HOLOCHAIN_CLIENT_VERSION,
holo_web_sdk_version: versions::WEB_SDK_VERSION,
holochain_playground_cli_version: versions::HOLOCHAIN_PLAYGROUND_CLI_VERSION,
hc_spin_version: versions::HC_SPIN_VERSION,
package_manager,
tryorama_version: versions::TRYORAMA_VERSION,
Expand Down
5 changes: 0 additions & 5 deletions src/versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,3 @@ pub const HDK_VERSION: &str = "0.4.0";

/// crates.io <https://crates.io/crates/holochain/versions>
pub const HOLOCHAIN_VERSION: &str = "0.4.0";

/// source: <https://github.com/darksoil-studio/holochain-playground/tree/main/packages/cli/server>
///
/// npm: <https://www.npmjs.com/package/@holochain-playground/cli>
pub const HOLOCHAIN_PLAYGROUND_CLI_VERSION: &str = "^0.300.0-rc.0";
2 changes: 1 addition & 1 deletion templates/generic/web-app/README.md.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ This repository is using these tools:
- [hc](https://github.com/holochain/holochain/tree/develop/crates/hc): Holochain CLI to easily manage Holochain development instances.
- [@holochain/tryorama](https://www.npmjs.com/package/@holochain/tryorama): test framework.
- [@holochain/client](https://www.npmjs.com/package/@holochain/client): client library to connect to Holochain from the UI.
- [@holochain-playground/cli](https://www.npmjs.com/package/@holochain-playground/cli): introspection tooling to understand what's going on in the Holochain nodes.
- [hc playground](https://github.com/darksoil-studio/holochain-playground): introspection tooling to understand what's going on in the Holochain nodes.
9 changes: 4 additions & 5 deletions templates/generic/web-app/package.json.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
],
"scripts": {
"start": "AGENTS=${AGENTS:-2} BOOTSTRAP_PORT=$(get-port) SIGNAL_PORT=$(get-port) {{(package_manager_command package_manager "network" null)}}",
"network": "hc sandbox clean && {{(package_manager_command package_manager "build:happ" null)}} && UI_PORT=$(get-port) concurrently \"{{(package_manager_command package_manager "start" "ui")}}\" \"{{(package_manager_command package_manager "launch:happ" null)}}\" \"holochain-playground\"",
"network": "hc sandbox clean && {{(package_manager_command package_manager "build:happ" null)}} && UI_PORT=$(get-port) concurrently \"{{(package_manager_command package_manager "start" "ui")}}\" \"{{(package_manager_command package_manager "launch:happ" null)}}\" \"hc playground\"",
"test": "{{(package_manager_command package_manager "build:zomes" null)}} && hc app pack workdir --recursive && {{(package_manager_command package_manager "test" "tests")}}",
"launch:happ": "hc-spin -n $AGENTS --ui-port $UI_PORT workdir/{{app_name}}.happ",
"start:tauri": "AGENTS=${AGENTS:-2} BOOTSTRAP_PORT=$(get-port) SIGNAL_PORT=$(get-port) {{(package_manager_command package_manager "network:tauri" null)}}",
"network:tauri": "hc sandbox clean && {{(package_manager_command package_manager "build:happ" null)}} && UI_PORT=$(get-port) concurrently \"{{(package_manager_command package_manager "start" "ui")}}\" \"{{(package_manager_command package_manager "launch:tauri" null)}}\" \"holochain-playground\"",
"network:tauri": "hc sandbox clean && {{(package_manager_command package_manager "build:happ" null)}} && UI_PORT=$(get-port) concurrently \"{{(package_manager_command package_manager "start" "ui")}}\" \"{{(package_manager_command package_manager "launch:tauri" null)}}\" \"hc playground\"",
"launch:tauri": "concurrently \"hc run-local-services --bootstrap-port $BOOTSTRAP_PORT --signal-port $SIGNAL_PORT\" \"echo pass | RUST_LOG=warn hc launch --piped -n $AGENTS workdir/{{app_name}}.happ --ui-port $UI_PORT network --bootstrap http://127.0.0.1:\"$BOOTSTRAP_PORT\" webrtc ws://127.0.0.1:\"$SIGNAL_PORT\"\"",
{{#if holo_enabled}}
"start:holo": "AGENTS=${AGENTS:-2} {{(package_manager_command package_manager "network:holo" null)}}",
"network:holo": "{{(package_manager_command package_manager "build:happ" null)}} && UI_PORT=$(get-port) concurrently \"{{(package_manager_command package_manager "launch:holo-dev-server" null)}}\" \"holochain-playground ws://localhost:4444\" \"concurrently-repeat 'VITE_APP_CHAPERONE_URL=http://localhost:24274 VITE_APP_IS_HOLO=true {{(package_manager_command package_manager "start" "ui")}}' $AGENTS\"",
"network:holo": "{{(package_manager_command package_manager "build:happ" null)}} && UI_PORT=$(get-port) concurrently \"{{(package_manager_command package_manager "launch:holo-dev-server" null)}}\" \"hc playground ws://localhost:4444\" \"concurrently-repeat 'VITE_APP_CHAPERONE_URL=http://localhost:24274 VITE_APP_IS_HOLO=true {{(package_manager_command package_manager "start" "ui")}}' $AGENTS\"",
"launch:holo-dev-server": "holo-dev-server workdir/{{app_name}}.happ",
{{/if}}
{{#if (eq package_manager "pnpm")}}
Expand All @@ -26,7 +26,6 @@
"build:zomes": "cargo build --release --target wasm32-unknown-unknown"
},
"devDependencies": {
"@holochain-playground/cli": "{{holochain_playground_cli_version}}",
"@holochain/hc-spin": "{{hc_spin_version}}",
"concurrently": "^6.5.1",
{{#if holo_enabled}}
Expand All @@ -37,4 +36,4 @@
"engines": {
"node": ">=16.0.0"
}
}
}
2 changes: 1 addition & 1 deletion templates/ui-frameworks/lit/web-app/ui/package.json.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"prettier": "^2.8.8",
"rimraf": "^5.0.10",
"tslib": "^2.8.0",
"typescript": "^5.6.3",
"typescript": "5.6.3",
"vite": "^5.4.10",
"vite-plugin-checker": "^0.5.6"
},
Expand Down

0 comments on commit 59bb240

Please sign in to comment.