From 3a75c4e483ccaae5516dfa96036103538c6b1585 Mon Sep 17 00:00:00 2001 From: Guillem Cordoba Date: Mon, 6 Dec 2021 14:12:13 +0100 Subject: [PATCH] Deps pointing to npm --- README.md | 42 ++------ package-lock.json | 165 ++++++++++++++++++++++++++++---- package.json | 8 +- ui/chess/package.json | 2 +- ui/elemental-chess/package.json | 4 +- 5 files changed, 164 insertions(+), 57 deletions(-) diff --git a/README.md b/README.md index 1c7c6a9..d7c14fa 100644 --- a/README.md +++ b/README.md @@ -16,54 +16,32 @@ From the root folder of the repo: npm install ``` -## Building the DNA +## Testing ```bash -npm run build:happ +npm test ``` -## Starting the UI - -Enter the UI folder: - -```bash -cd ui -``` - -Then, run this inside the nix-shell in one terminal: - -```bash -npm run start-alice -``` - -And this in another terminal inside the nix-shell as well: +## Starting a Holochain network ```bash -npm run start-bob +npm run network 2 ``` -If a page with "Not found" appears, wait for the UI to finish compilation and refresh the page. +You can replace "2" by the number of agents that you want to boot up ## Starting with Holo's HCC mode ```bash -npm run start-holo-alice -``` - -Go to the page that opens, and login with email: "alice". Any password will work. - -In another terminal: - -```bash -npm run start-holo-bob +npm run network:holo ``` -Go to the page that opens, and login with email: "bob". Any password will work. +Go to the 2 pages that opens, and login with any email and password. -## Building the UI +## Packaging for release ```bash -npm run build +npm run package ``` -At this point, you will have the UI bundled in `ui/dist/` and the happ bundle in `dna/workdir/happ` ready to be published. \ No newline at end of file +At this point, you will have the application bundled in `workdir`, both the `.webhapp` for the launcher and the `.happ` and the UI `.zip` for Holo. diff --git a/package-lock.json b/package-lock.json index c24e41a..257bbf1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "dna/tests" ], "devDependencies": { - "@holochain-playground/cli": "^0.0.3", + "@holochain-playground/cli": "0.0.4", "bestzip": "^2.2.0", "concurrently": "^6.4.0", "concurrently-repeat": "^0.0.1", @@ -23,6 +23,62 @@ "npm": ">=7.0.0" } }, + "../../holochain/playground/holochain-playground/packages/cli/server": { + "name": "@holochain-playground/cli", + "version": "0.0.4", + "dev": true, + "license": "MIT", + "bin": { + "holochain-playground": "dist/app.js" + }, + "devDependencies": { + "@babel/core": "^7.15.5", + "@babel/preset-env": "^7.15.6", + "@holochain-playground/cli-client": "0.0.1", + "@mdi/font": "5.9.55", + "@types/body-parser": "^1.19.0", + "@types/dotenv": "^8.2.0", + "@types/express": "^4.17.7", + "@types/prompts": "^2.0.14", + "@typescript-eslint/eslint-plugin": "^4.18.0", + "@typescript-eslint/parser": "^4.18.0", + "babel-loader": "^8.2.2", + "babel-polyfill": "^6.26.0", + "body-parser": "^1.19.0", + "bufferutil": "^4.0.3", + "chalk": "^4.1.2", + "clear-npx-cache": "^1.0.1", + "concurrently": "^5.1.0", + "copy-webpack-plugin": "^6.4.1", + "core-js": "^3.6.5", + "deepmerge": "^4.2.2", + "diff": "^5.0.0", + "dotenv": "^8.2.0", + "eslint": "^6.7.2", + "eslint-plugin-prettier": "^3.3.1", + "express": "^4.17.1", + "gh-pages": "^3.2.3", + "node-fetch": "^3.0.0", + "nodemon": "^2.0.4", + "open": "^8.2.1", + "path": "^0.12.7", + "prettier": "^1.19.1", + "prompts": "^2.4.1", + "rimraf": "^3.0.2", + "sass": "~1.32", + "sass-loader": "^10.0.0", + "semver": "^7.3.5", + "socket.io": "^4.4.0", + "stream": "^0.0.2", + "ts-loader": "^8.0.0", + "ts-node": "^8.10.2", + "typescript": "^4.4.3", + "utf-8-validate": "^5.0.5", + "webpack": "^4.36.0", + "webpack-cli": "^4.8.0", + "webpack-path-resolve": "^0.0.3" + } + }, "dna/tests": { "version": "0.0.0", "license": "ISC", @@ -2076,13 +2132,8 @@ } }, "node_modules/@holochain-playground/cli": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@holochain-playground/cli/-/cli-0.0.3.tgz", - "integrity": "sha512-sd1Yks5L2gAB5rTNHrn6GVehYfvyoJmsx4qdYW23Bk8WRT2ZiB905OPMq1VFHEyZgkYaNlgTfYWERKOJsV1LKw==", - "dev": true, - "bin": { - "holochain-playground": "dist/app.js" - } + "resolved": "../../holochain/playground/holochain-playground/packages/cli/server", + "link": true }, "node_modules/@holochain/conductor-api": { "version": "0.2.4", @@ -14444,7 +14495,7 @@ "@eyss/elo": "github:eyss/elo#ui-build", "@eyss/invitations": "github:eyss/invitations#ui-build", "@eyss/turn-based-game": "github:eyss/turn-based-game#ui-build", - "@holochain-open-dev/cell-client": "github:holochain-open-dev/cell-client#build", + "@holochain-open-dev/cell-client": "0.1.3", "@holochain-open-dev/core-types": "0.1.1", "@holochain-open-dev/profiles": "github:holochain-open-dev/profiles#ui-build", "@lit-labs/context": "github:holochain-open-dev/context.git#build", @@ -14477,6 +14528,15 @@ "typescript": "^4.4.4" } }, + "ui/chess/node_modules/@holochain-open-dev/cell-client": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@holochain-open-dev/cell-client/-/cell-client-0.1.3.tgz", + "integrity": "sha512-vUTA+xXwZRMWkUEBFW4d2C68BWXbC5lk0u77aHq4vLcfr3mayg64AmqFllkjJp9shj+PlIq7QQXoy9uIuHdQSA==", + "dependencies": { + "@holo-host/web-sdk": "^0.5.3", + "@holochain/conductor-api": "0.2.4" + } + }, "ui/chess/node_modules/tslib": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", @@ -14494,7 +14554,7 @@ "@eyss/turn-based-game": "github:eyss/turn-based-game#ui-build", "@holo-host/chaperone": "^9.0.0", "@holo-host/web-sdk": "^0.5.3", - "@holochain-open-dev/cell-client": "github:holochain-open-dev/cell-client#build", + "@holochain-open-dev/cell-client": "0.1.3", "@holochain-open-dev/core-types": "0.1.1", "@holochain-open-dev/profiles": "github:holochain-open-dev/profiles#ui-build", "@holochain/conductor-api": "0.2.4", @@ -14531,6 +14591,15 @@ "typescript": "4.3.5" } }, + "ui/elemental-chess/node_modules/@holochain-open-dev/cell-client": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@holochain-open-dev/cell-client/-/cell-client-0.1.3.tgz", + "integrity": "sha512-vUTA+xXwZRMWkUEBFW4d2C68BWXbC5lk0u77aHq4vLcfr3mayg64AmqFllkjJp9shj+PlIq7QQXoy9uIuHdQSA==", + "dependencies": { + "@holo-host/web-sdk": "^0.5.3", + "@holochain/conductor-api": "0.2.4" + } + }, "ui/elemental-chess/node_modules/tslib": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", @@ -15820,7 +15889,7 @@ "@eyss/elo": "github:eyss/elo#ui-build", "@eyss/invitations": "github:eyss/invitations#ui-build", "@eyss/turn-based-game": "github:eyss/turn-based-game#ui-build", - "@holochain-open-dev/cell-client": "github:holochain-open-dev/cell-client#build", + "@holochain-open-dev/cell-client": "0.1.3", "@holochain-open-dev/core-types": "0.1.1", "@holochain-open-dev/profiles": "github:holochain-open-dev/profiles#ui-build", "@lit-labs/context": "github:holochain-open-dev/context.git#build", @@ -15850,6 +15919,15 @@ "typescript": "^4.4.4" }, "dependencies": { + "@holochain-open-dev/cell-client": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@holochain-open-dev/cell-client/-/cell-client-0.1.3.tgz", + "integrity": "sha512-vUTA+xXwZRMWkUEBFW4d2C68BWXbC5lk0u77aHq4vLcfr3mayg64AmqFllkjJp9shj+PlIq7QQXoy9uIuHdQSA==", + "requires": { + "@holo-host/web-sdk": "^0.5.3", + "@holochain/conductor-api": "0.2.4" + } + }, "tslib": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", @@ -15868,7 +15946,7 @@ "@eyss/turn-based-game": "github:eyss/turn-based-game#ui-build", "@holo-host/chaperone": "^9.0.0", "@holo-host/web-sdk": "^0.5.3", - "@holochain-open-dev/cell-client": "github:holochain-open-dev/cell-client#build", + "@holochain-open-dev/cell-client": "0.1.3", "@holochain-open-dev/core-types": "0.1.1", "@holochain-open-dev/profiles": "github:holochain-open-dev/profiles#ui-build", "@holochain/conductor-api": "0.2.4", @@ -15902,6 +15980,15 @@ "typescript": "4.3.5" }, "dependencies": { + "@holochain-open-dev/cell-client": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@holochain-open-dev/cell-client/-/cell-client-0.1.3.tgz", + "integrity": "sha512-vUTA+xXwZRMWkUEBFW4d2C68BWXbC5lk0u77aHq4vLcfr3mayg64AmqFllkjJp9shj+PlIq7QQXoy9uIuHdQSA==", + "requires": { + "@holo-host/web-sdk": "^0.5.3", + "@holochain/conductor-api": "0.2.4" + } + }, "tslib": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", @@ -16083,7 +16170,7 @@ }, "@holochain-open-dev/cell-client": { "version": "git+ssh://git@github.com/holochain-open-dev/cell-client.git#adbce4c5f86c8d8dda071cd37e5a752237901c57", - "from": "@holochain-open-dev/cell-client@github:holochain-open-dev/cell-client#build", + "from": "@holochain-open-dev/cell-client@^0.1.2", "requires": { "@holo-host/web-sdk": "^0.5.3", "@holochain/conductor-api": "0.2.4" @@ -16135,10 +16222,54 @@ } }, "@holochain-playground/cli": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@holochain-playground/cli/-/cli-0.0.3.tgz", - "integrity": "sha512-sd1Yks5L2gAB5rTNHrn6GVehYfvyoJmsx4qdYW23Bk8WRT2ZiB905OPMq1VFHEyZgkYaNlgTfYWERKOJsV1LKw==", - "dev": true + "version": "file:../../holochain/playground/holochain-playground/packages/cli/server", + "requires": { + "@babel/core": "^7.15.5", + "@babel/preset-env": "^7.15.6", + "@holochain-playground/cli-client": "0.0.1", + "@mdi/font": "5.9.55", + "@types/body-parser": "^1.19.0", + "@types/dotenv": "^8.2.0", + "@types/express": "^4.17.7", + "@types/prompts": "^2.0.14", + "@typescript-eslint/eslint-plugin": "^4.18.0", + "@typescript-eslint/parser": "^4.18.0", + "babel-loader": "^8.2.2", + "babel-polyfill": "^6.26.0", + "body-parser": "^1.19.0", + "bufferutil": "^4.0.3", + "chalk": "^4.1.2", + "clear-npx-cache": "^1.0.1", + "concurrently": "^5.1.0", + "copy-webpack-plugin": "^6.4.1", + "core-js": "^3.6.5", + "deepmerge": "^4.2.2", + "diff": "^5.0.0", + "dotenv": "^8.2.0", + "eslint": "^6.7.2", + "eslint-plugin-prettier": "^3.3.1", + "express": "^4.17.1", + "gh-pages": "^3.2.3", + "node-fetch": "^3.0.0", + "nodemon": "^2.0.4", + "open": "^8.2.1", + "path": "^0.12.7", + "prettier": "^1.19.1", + "prompts": "^2.4.1", + "rimraf": "^3.0.2", + "sass": "~1.32", + "sass-loader": "^10.0.0", + "semver": "^7.3.5", + "socket.io": "^4.4.0", + "stream": "^0.0.2", + "ts-loader": "^8.0.0", + "ts-node": "^8.10.2", + "typescript": "^4.4.3", + "utf-8-validate": "^5.0.5", + "webpack": "^4.36.0", + "webpack-cli": "^4.8.0", + "webpack-path-resolve": "^0.0.3" + } }, "@holochain/conductor-api": { "version": "0.2.4", diff --git a/package.json b/package.json index 8fbb671..d31083e 100644 --- a/package.json +++ b/package.json @@ -18,16 +18,16 @@ "test": "npm run build:happ && npm t -w tests", "prepare": "npm run build -w @eyss/chess && npm run build -w @eyss/elemental-chess", "package": "npm run build:happ && npm run build -w @eyss/chess && npm run package:holochain && npm run package:holo", - "package:holochain": "npm run build:holochain -w @eyss/elemental-chess && cd ui/elemental-chess/dist && bestzip ../dist.zip * && cd ../../../ && hc web-app pack workdir", - "package:holo": "npm run build:holo -w @eyss/elemental-chess && cd ui/elemental-chess/dist && bestzip ../../../workdir/elemental-chess-ui.zip *", - "start:happ": "RUST_LOG=warn hc s -f=$ADMIN_PORT generate ./workdir/elemental-chess.happ --run=$HC_PORT --app-id=$APP_ID network mdns", + "package:holochain": "ENV=hc npm run build -w @eyss/elemental-chess && cd ui/elemental-chess/dist && bestzip ../dist.zip * && cd ../../../ && hc web-app pack workdir", + "package:holo": "ENV=holo npm run build -w @eyss/elemental-chess && cd ui/elemental-chess/dist && bestzip ../../../workdir/elemental-chess-ui.zip *", + "start:happ": "RUST_LOG=warn hc s -f=$ADMIN_PORT generate ./workdir/elemental-chess.happ --run=$HC_PORT --app-id=$APP_ID network --bootstrap https://bootstrap-staging.holo.host/ quic", "build:happ": "npm run build:dna && hc app pack ./workdir/", "build:dna": "npm run build:zome && hc dna pack ./dna/workdir/", "build:zome": "CARGO_TARGET_DIR=target cargo build --release --target wasm32-unknown-unknown", "playground": "run-singleton \"holochain-playground\"" }, "devDependencies": { - "@holochain-playground/cli": "^0.0.3", + "@holochain-playground/cli": "0.0.4", "bestzip": "^2.2.0", "concurrently": "^6.4.0", "concurrently-repeat": "^0.0.1", diff --git a/ui/chess/package.json b/ui/chess/package.json index 1594e5d..9778971 100644 --- a/ui/chess/package.json +++ b/ui/chess/package.json @@ -23,7 +23,7 @@ "@eyss/elo": "github:eyss/elo#ui-build", "@eyss/invitations": "github:eyss/invitations#ui-build", "@eyss/turn-based-game": "github:eyss/turn-based-game#ui-build", - "@holochain-open-dev/cell-client": "github:holochain-open-dev/cell-client#build", + "@holochain-open-dev/cell-client": "0.1.3", "@holochain-open-dev/core-types": "0.1.1", "@holochain-open-dev/profiles": "github:holochain-open-dev/profiles#ui-build", "@lit-labs/context": "github:holochain-open-dev/context.git#build", diff --git a/ui/elemental-chess/package.json b/ui/elemental-chess/package.json index 13647a6..b921452 100644 --- a/ui/elemental-chess/package.json +++ b/ui/elemental-chess/package.json @@ -7,8 +7,6 @@ "scripts": { "start": "concurrently --names tsc,web-dev-server \"npm run build:watch\" \"web-dev-server --config web-dev-server.config.mjs\"", "build": "rimraf dist && tsc && ENV=hc rollup -c rollup.config.js", - "build:holochain": "rimraf dist && tsc && ENV=hc rollup -c rollup.config.js", - "build:holo": "rimraf dist && tsc && ENV=holo rollup -c rollup.config.js", "build:watch": "run-singleton \"tsc -w --incremental --preserveWatchOutput\"", "lint": "eslint --ext .ts,.html . --ignore-path .gitignore", "format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore", @@ -22,7 +20,7 @@ "@eyss/turn-based-game": "github:eyss/turn-based-game#ui-build", "@holo-host/chaperone": "^9.0.0", "@holo-host/web-sdk": "^0.5.3", - "@holochain-open-dev/cell-client": "github:holochain-open-dev/cell-client#build", + "@holochain-open-dev/cell-client": "0.1.3", "@holochain-open-dev/core-types": "0.1.1", "@holochain-open-dev/profiles": "github:holochain-open-dev/profiles#ui-build", "@holochain/conductor-api": "0.2.4",