From db2647653e15a5d144251a12b7c0f1bed4987556 Mon Sep 17 00:00:00 2001 From: damien Date: Fri, 22 Sep 2023 16:04:26 -0400 Subject: [PATCH] update to hdk 2.2 --- package.json | 48 +++++++++++++++++------------------- we-applet/package.json | 1 - webapp/package.json | 3 +-- webapp/src/file-share-app.ts | 2 +- webcomponents/package.json | 2 +- 5 files changed, 25 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index 4b9b520..b510b31 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "file-share-dev", "version": "0.1.0", "config": { - "hc_version": "0.2.1", + "hc_version": "0.2.2", "zits_version": "1.9.0", "bin": "bin" }, @@ -33,36 +33,31 @@ "dev:components" : "npm run build:watch -w webcomponents", - "devtest" : "npm run build:devtest && concurrently \"npm run build:watch -w webcomponents\" \"npm run build:watch -w webapp\" \"npm run start\"", + "devtest" : "npm run build:devtest && concurrently \"npm run build:watch -w webcomponents\" \"npm run build:watch -w webapp\" \"npm run start:mem\"", "devtest:we" : "npm run build:devtest:we && npm run devtest -w we-applet", - "network" : "npm run build:happ && concurrently-repeat \"npm run start:proxied\"", - "network-playground" : "npm run build:happ && concurrently-repeat \"npm run start:playground\"", - "network-mem" : "npm run build:happ && concurrently-repeat \"npm run start\"", + "_save-ports" : "echo $HC_APP_PORT > .hc_app_$INDEX && echo $HC_ADMIN_PORT > .hc_admin_$INDEX", - "start:save" : "echo $HC_APP_PORT > .hc_app_$INDEX && echo $HC_ADMIN_PORT > .hc_admin_$INDEX", - - "prodtest" : "npm run dist -w webapp && cross-env HC_APP_PORT=$(port) HC_ADMIN_PORT=$(port) concurrently \"npm run dev:components\" \"npm run start:happ\" \"sleep 7 && npm run start:ui -w webapp\"", - "start" : "cross-env HC_APP_PORT=$(port) HC_ADMIN_PORT=$(port) BUILD_MODE='dev' ADD_PROFILES=1 concurrently \"npm run dev:components\" \"npm run start:happ\" \"sleep 7 && npm run start:ui -w webapp\"", - "start:local" : "echo START:LOCAL $INDEX & cross-env HC_APP_PORT=$(port) HC_ADMIN_PORT=$(port) BUILD_MODE='dev' ADD_PROFILES=1 concurrently \"npm run start:save\" \"npm run dev:components\" \"npm run start:happ:local\" \"sleep 7 && npm run start:ui -w webapp\"", - "start:proxied" : "cross-env HC_APP_PORT=$(port) HC_ADMIN_PORT=$(port) BUILD_MODE='dev' concurrently \"npm run dev:components\" \"npm run start:happ:proxied\" \"sleep 7 && npm run start:ui -w webapp\"", - "start:playground" : "cross-env HC_APP_PORT=$(port) HC_ADMIN_PORT=$(port) BUILD_MODE='dev' concurrently \"npm run playground\" \"npm run dev:components\" \"npm run start:happ\" \"sleep 7 && npm run start:ui -w webapp\"", - "start:happ" : "RUST_LOG=warn WASM_LOG=warn echo \"pass\" | $npm_package_config_bin/hc s --piped -f=$HC_ADMIN_PORT generate artifacts/file_share_dev.happ -a FileShareDev --run=$HC_APP_PORT network mem", - "start:happ:proxied" : "RUST_LOG=warn WASM_LOG=warn echo \"pass\" | $npm_package_config_bin/hc s --piped -f=$HC_ADMIN_PORT generate artifacts/file_share_dev.happ --run=$HC_APP_PORT -a FileShareDev network --bootstrap https://bootstrap.holo.host/ webrtc wss://signal.holo.host", - "start:happ:local" : "RUST_LOG=warn WASM_LOG=warn echo \"pass\" | $npm_package_config_bin/hc s --piped -f=$HC_ADMIN_PORT generate artifacts/file_share_dev.happ --run=$HC_APP_PORT -a FileShareDev network --bootstrap http://127.0.0.1:$BOOT_PORT webrtc ws://127.0.0.1:$SIGNAL_PORT", + "prodtest" : "npm run dist -w webapp && cross-env HC_APP_PORT=$(port) HC_ADMIN_PORT=$(port) concurrently \"npm run dev:components\" \"npm run new-sandbox:mem\" \"sleep 7 && npm run start:ui -w webapp\"", + "start:mem" : "cross-env HC_APP_PORT=$(port) HC_ADMIN_PORT=$(port) BUILD_MODE='dev' ADD_PROFILES=1 concurrently \"npm run dev:components\" \"npm run new-sandbox:mem\" \"sleep 7 && npm run start:ui -w webapp\"", + "start:local" : "echo START:LOCAL $INDEX & cross-env HC_APP_PORT=$(port) HC_ADMIN_PORT=$(port) BUILD_MODE='dev' ADD_PROFILES=1 concurrently \"npm run _save-ports\" \"npm run dev:components\" \"npm run new-sandbox:local\" \"sleep 7 && npm run start:ui -w webapp\"", + "start:public" : "cross-env HC_APP_PORT=$(port) HC_ADMIN_PORT=$(port) BUILD_MODE='dev' concurrently \"npm run dev:components\" \"npm run new-sandbox:public\" \"sleep 7 && npm run start:ui -w webapp\"", + "new-sandbox:mem" : "RUST_LOG=warn WASM_LOG=warn echo \"pass\" | $npm_package_config_bin/hc s --piped -f=$HC_ADMIN_PORT generate artifacts/file_share_dev.happ -a FileShareDev --run=$HC_APP_PORT network mem", + "new-sandbox:public" : "RUST_LOG=warn WASM_LOG=warn echo \"pass\" | $npm_package_config_bin/hc s --piped -f=$HC_ADMIN_PORT generate artifacts/file_share_dev.happ --run=$HC_APP_PORT -a FileShareDev network --bootstrap https://bootstrap.holo.host/ webrtc wss://signal.holo.host", + "new-sandbox:local" : "RUST_LOG=warn WASM_LOG=warn echo \"pass\" | $npm_package_config_bin/hc s --piped -f=$HC_ADMIN_PORT generate artifacts/file_share_dev.happ --run=$HC_APP_PORT -a FileShareDev network --bootstrap http://127.0.0.1:$BOOT_PORT webrtc ws://127.0.0.1:$SIGNAL_PORT", "serve:run" : "hc run-local-services --bootstrap-port $BOOT_PORT --signal-port $SIGNAL_PORT", "serve:save" : "echo SIGNAL_PORT=$SIGNAL_PORT && echo $SIGNAL_PORT > .hc_signalenv && echo $BOOT_PORT > .hc_bootenv && echo BOOT_PORT=$BOOT_PORT", "serve" : "cross-env BOOT_PORT=$(cat .hc_bootenv) SIGNAL_PORT=$(cat .hc_signalenv) npm run serve:run", - "network:local2" : "npm run clean:hc & npm run build:devtest && cross-env BOOT_PORT=$(port) SIGNAL_PORT=$(port) concurrently \"npm run serve:save\" \"npm run serve:run\" \"cross-env INDEX=0 npm run start:local\" \"sleep 1 && cross-env INDEX=1 npm run start:local\"", - "network:local3" : "npm run clean:hc & npm run build:devtest && cross-env BOOT_PORT=$(port) SIGNAL_PORT=$(port) concurrently \"npm run serve:save\" \"npm run serve:run\" \"cross-env INDEX=0 npm run start:local\" \"sleep 1 && cross-env INDEX=1 npm run start:local\" \"sleep 2 && cross-env INDEX=2 npm run start:local\"", + "network2" : "npm run clean:hc & npm run build:devtest && cross-env BOOT_PORT=$(port) SIGNAL_PORT=$(port) concurrently \"npm run serve:save\" \"npm run serve:run\" \"cross-env INDEX=0 npm run new-sandbox:local\" \"sleep 1 && cross-env INDEX=1 npm run new-sandbox:local\"", + "network3" : "npm run clean:hc & npm run build:devtest && cross-env BOOT_PORT=$(port) SIGNAL_PORT=$(port) concurrently \"npm run serve:save\" \"npm run serve:run\" \"cross-env INDEX=0 npm run new-sandbox:local\" \"sleep 1 && cross-env INDEX=1 npm run new-sandbox:local\" \"sleep 2 && cross-env INDEX=2 npm run new-sandbox:local\"", "network:we" : "npm run clean:hc & npm run network:local2 -w we-applet", - "happ:local" : "echo INDEX: $INDEX & echo PORTS: $BOOT_PORT $SIGNAL_PORT $HC_APP_PORT $HC_ADMIN_PORT & RUST_LOG=warn WASM_LOG=warn echo \"pass\" | $npm_package_config_bin/hc s --piped -f=$HC_ADMIN_PORT run $INDEX", - "local" : "cross-env BOOT_PORT=$(cat .hc_bootenv) SIGNAL_PORT=$(cat .hc_signalenv) HC_APP_PORT=$(cat .hc_app_$INDEX) HC_ADMIN_PORT=$(cat .hc_admin_$INDEX) BUILD_MODE='dev' ADD_PROFILES=1 concurrently \"npm run happ:local\" \"sleep 7 && npm run start:ui-only -w webapp\"", - "local0" : "cross-env INDEX=0 npm run local", - "local1" : "cross-env INDEX=1 npm run local", - "local2" : "cross-env INDEX=2 npm run local", + "local:sandbox" : "echo INDEX: $INDEX & echo PORTS: $BOOT_PORT $SIGNAL_PORT $HC_APP_PORT $HC_ADMIN_PORT & RUST_LOG=warn WASM_LOG=warn echo \"pass\" | $npm_package_config_bin/hc s --piped -f=$HC_ADMIN_PORT run $INDEX", + "_local" : "cross-env BOOT_PORT=$(cat .hc_bootenv) SIGNAL_PORT=$(cat .hc_signalenv) HC_APP_PORT=$(cat .hc_app_$INDEX) HC_ADMIN_PORT=$(cat .hc_admin_$INDEX) BUILD_MODE='dev' ADD_PROFILES=1 concurrently \"npm run local:sandbox\" \"sleep 7 && npm run start:ui-only -w webapp\"", + "local0" : "cross-env INDEX=0 npm run _local", + "local1" : "cross-env INDEX=1 npm run _local", + "local2" : "cross-env INDEX=2 npm run _local", "launch" : "echo pass | hc-launch --piped -n 1 artifacts/file_share.webhapp network mem", "launch:we" : "echo pass | hc-launch --piped -n 1 artifacts/file_share-we_applet.webhapp network mem", @@ -92,10 +87,11 @@ "typescript": "^4.9.5" }, "dependencies": { - "@ddd-qc/cell-proxy": "=0.19.8", - "@ddd-qc/lit-happ": "=0.19.8", - "@ddd-qc/path-explorer": "0.1.6", - "@holochain/client": "=0.14.1", + "@ddd-qc/cell-proxy": "=0.19.11", + "@ddd-qc/lit-happ": "=0.19.11", + "@ddd-qc/path-explorer": "=0.2.0", + "@lightningrodlabs/we-applet": "0.8.0", + "@holochain/client": "=0.16.1", "@holochain-open-dev/core-types": "0.6.3", "@lit-labs/context": "^0.2.0", "lit": "2.6.0" diff --git a/we-applet/package.json b/we-applet/package.json index 9bc1590..2600267 100644 --- a/we-applet/package.json +++ b/we-applet/package.json @@ -36,7 +36,6 @@ "typescript": "^4.9.0" }, "dependencies": { - "@lightningrodlabs/we-applet": "0.6.1", "@file-share/app": "file:../webapp", "@mdi/js": "^7.2.0" } diff --git a/webapp/package.json b/webapp/package.json index 729437a..e0509cc 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -37,8 +37,7 @@ }, "dependencies": { "@holochain-open-dev/core-types": "0.6.3", - "@holochain-open-dev/profiles": "^0.14.0", - "@lightningrodlabs/we-applet": "0.6.1", + "@holochain-open-dev/profiles": "^0.16.1", "@file-share/elements": "file:../webcomponents" } } diff --git a/webapp/src/file-share-app.ts b/webapp/src/file-share-app.ts index 6f44565..c0590ab 100644 --- a/webapp/src/file-share-app.ts +++ b/webapp/src/file-share-app.ts @@ -147,7 +147,7 @@ export class FileShareApp extends HappElement { console.log("hvmConstructed()", this._adminWs, this._canAuthorizeZfns) /** Authorize all zome calls */ if (!this._adminWs && this._canAuthorizeZfns) { - this._adminWs = await AdminWebsocket.connect(`ws://localhost:${HC_ADMIN_PORT}`); + this._adminWs = await AdminWebsocket.connect(new URL(`ws://localhost:${HC_ADMIN_PORT}`)); console.log("hvmConstructed() connect() called", this._adminWs); } if (this._adminWs && this._canAuthorizeZfns) { diff --git a/webcomponents/package.json b/webcomponents/package.json index 0589eda..30ad09b 100644 --- a/webcomponents/package.json +++ b/webcomponents/package.json @@ -20,7 +20,7 @@ "watch-cli": "^0.2.3" }, "dependencies": { - "@lightningrodlabs/we-applet": "0.6.1", + "@lightningrodlabs/we-applet": "0.8.0", "js-base64": "^3.7.3", "@msgpack/msgpack": "^2.7.2", "@shoelace-style/shoelace": "^2.4.0",