Skip to content

Commit

Permalink
Deps pointing to npm
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Dec 6, 2021
1 parent 4f3149a commit 3a75c4e
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 57 deletions.
42 changes: 10 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
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.
165 changes: 148 additions & 17 deletions package-lock.json

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

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion ui/chess/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 1 addition & 3 deletions ui/elemental-chess/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 3a75c4e

Please sign in to comment.