enh: local dev setup

This commit is contained in:
Ben Allfree 2023-10-02 11:11:38 +00:00
parent ad2e918a79
commit 80d3e531ac
4 changed files with 17 additions and 6 deletions

View File

@ -6,7 +6,7 @@ Just want to work with the UI and frontend?
git clone git@github.com:benallfree/pockethost.git
cd pockethost
yarn
yarn dev:www
yarn local:dev:www
```
That's it. You're in business. Your local Svelte build will talk to the `pockethost.io` mothership and connect to that for all database-related tasks.

View File

@ -15,7 +15,7 @@ git clone git@github.com:benallfree/pockethost.git
cd pockethost
yarn
cp .env-template .env # modify as needed, if you used `pockethost.test` for your local domain, everything should work
scripts/dev.sh
scripts/local-dev.sh
open https://pockethost.test
open https://pockethost-central.pockethost.test
# login: admin@pockethost.test (change in .env)

View File

@ -10,17 +10,17 @@
"build": "concurrently 'yarn:build:*'",
"build:www": "cd packages/pockethost.io && yarn build",
"build:daemon": "cd packages/daemon && yarn build",
"local:dev": "NODE_ENV=development concurrently 'yarn:dev:*'",
"local:dev:proxy": "cd packages/proxy && yarn dev",
"local:dev:www": "cd packages/pockethost.io && yarn dev",
"dev": "NODE_ENV=development concurrently 'yarn:dev:*'",
"dev:proxy": "cd packages/proxy && yarn dev",
"dev:www": "cd packages/pockethost.io && yarn dev",
"dev:daemon": "cd packages/daemon && yarn dev",
"start": "concurrently 'yarn:start:*'",
"start:proxy": "cd packages/proxy && yarn start",
"start:www": "cd packages/pockethost.io && yarn start",
"start:daemon": "cd packages/daemon && yarn start",
"pm2": "concurrently 'yarn:pm2:*'",
"pm2:proxy": "cd packages/proxy && yarn pm2",
"pm2:www": "cd packages/pockethost.io && yarn pm2",
"pm2:daemon": "cd packages/daemon && yarn pm2",
"postinstall": "patch-package",
"prepare": "husky install"
@ -56,4 +56,4 @@
"postinstall-postinstall": "^2.1.0",
"replace-in-file": "^7.0.1"
}
}
}

11
scripts/local-dev.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
set -a
source .env
DEBUG=1
set +a
pm2 stop all
docker kill $(docker ps -q)
docker rm $(docker ps -a -q)
yarn local:dev