Skip to content

Commit

Permalink
chore: adds turbo repo dev setup
Browse files Browse the repository at this point in the history
ref #229
  • Loading branch information
ygrishajev committed Jun 19, 2024
1 parent 323fc9b commit e8994af
Show file tree
Hide file tree
Showing 4 changed files with 157 additions and 2 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,21 @@ Note: you may pass any `docker compose` related arguments to the above commands.
npm run dc:up:dev -- deploy-web
```
This would also properly spin up all the dependencies like the `api`.
### Using Turbo Repo
Another way to run apps in dev mode is using turbo repo setup. Some available commands are:
```shell
npm run console:dev # run console ui in dev mode with dependencies
npm run stats:dev # run stats ui in dev mode with dependencies
npm run api:dev # run api in dev mode with dependencies
npm run indexer:dev # run indexer in dev mode with dependencies
```

Note the above commands still depend on docker to ru postgres database. If you need to run them without db you can use the following commands:
```shell
npm run console:dev:no-db # run console ui in dev mode with dependencies but without postgres in docker
npm run stats:dev:no-db # run stats ui in dev mode with dependencies but without postgres in docker
```


## Manual Database Restoration

Expand Down
117 changes: 116 additions & 1 deletion package-lock.json

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

12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@akash-network/cloudmos",
"packageManager": "[email protected]",
"workspaces": [
"./packages/*",
"./apps/*"
Expand All @@ -10,13 +11,22 @@
"dc:up:dev": "docker compose -p console -f docker-compose.build.yml -f docker-compose.prod.yml -f docker-compose.prod-with-db.yml -f docker-compose.yml up",
"dc:up:dev:no-db": "docker compose -p console -f docker-compose.build.yml -f docker-compose.prod.yml -f docker-compose.yml up",
"dc:up:prod": "docker compose -p console -f docker-compose.build.yml -f docker-compose.prod.yml -f docker-compose.prod-with-db.yml up",
"dc:up:db": "cross-env-shell '[ \\\"$SKIP_DC_DB\\\" != \\\"true\\\" ] && npm run dc:up:prod -- -d db || echo \\\"Skipping DB setup\\\"'",
"dc:up:prod:no-db": "docker compose -p console -f docker-compose.build.yml -f docker-compose.prod.yml up",
"console:dev": "turbo dev --filter=\"./apps/deploy-web/\" --filter=\"./apps/api\" --filter=\"./apps/provider-proxy/\"",
"console:dev:no-db": "cross-env SKIP_DC_DB=true turbo dev --filter=\"./apps/deploy-web/\" --filter=\"./apps/api\" --filter=\"./apps/provider-proxy/\"",
"stats:dev": "turbo dev --filter=\"./apps/stats-web/\" --filter=\"./apps/api\"",
"stats:dev:no-db": "cross-env SKIP_DC_DB=true turbo dev --filter=\"./apps/stats-web/\" --filter=\"./apps/api\"",
"api:dev": "turbo dev --filter=\"./apps/api\"",
"indexer:dev": "turbo dev --filter=\"./apps/indexer\"",
"format": "prettier --write ./*.{js,json} **/*.{ts,tsx,js,json}",
"lint": "eslint .",
"lint:api": "eslint ./apps/api"
},
"devDependencies": {
"@akashnetwork/dev-config": "*"
"@akashnetwork/dev-config": "*",
"cross-env": "^7.0.3",
"turbo": "^2.0.3"
},
"engines": {
"node": "20.14.0",
Expand Down
15 changes: 15 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://turbo.build/schema.json",
"globalEnv": [
"SKIP_DC_DB"
],
"tasks": {
"dev": {
"persistent": true,
"cache": false,
"dependsOn": ["//#dc:up:db"],
"env": ["SKIP_DB"]
},
"//#dc:up:db": {}
}
}

0 comments on commit e8994af

Please sign in to comment.