From 49e56239a5052f3b95a72fa980c5905d486ca47c Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Mon, 30 Sep 2024 00:33:16 -0400 Subject: [PATCH] feat: introduce process-compose for process management --- .air.toml | 7 ++-- devbox.json | 49 ++++++++++----------------- devbox.lock | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 117 insertions(+), 35 deletions(-) diff --git a/.air.toml b/.air.toml index deef65bff..b56a4cb51 100644 --- a/.air.toml +++ b/.air.toml @@ -10,11 +10,10 @@ exclude_file = [] exclude_regex = ["_test.go"] exclude_unchanged = true follow_symlink = false -full_bin = "make start-proxy" +full_bin = "devbox run start" include_dir = ["cmd/dwn", "cmd/motr", "internal", "models", "pkl"] -include_ext = ["go", "templ", "html", "pkl", "js", "mjs"] +include_ext = ["go", "templ", "html", "pkl", "js", "mjs", "proto"] include_file = [ - "wrangler.toml", "Dockerfile", ".goreleaser.yaml", "go.mod", @@ -25,7 +24,7 @@ kill_delay = "10s" log = "build-errors.log" poll = false poll_interval = 0 -post_cmd = [] +post_cmd = ["devbox run stop"] pre_cmd = ["templ generate"] rerun = false rerun_delay = 1000 diff --git a/devbox.json b/devbox.json index 2e10448b7..50dfe3c43 100644 --- a/devbox.json +++ b/devbox.json @@ -2,10 +2,12 @@ "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.12.0/.schema/devbox.schema.json", "packages": [ "go@1.22", + "air@latest", "bun@latest", "ipfs@latest", "skate@latest", - "cloudflared@latest" + "cloudflared@latest", + "process-compose@latest" ], "env": { "GOPATH": "$HOME/go", @@ -26,36 +28,21 @@ }, "shell": { "scripts": { - "build:docker": [ - "make local-image" - ], - "build:motr": [ - "make dwn", - "make motr" - ], - "build:sonrd": [ - "make dwn", - "make build" - ], - "gen:proto": [ - "make proto-gen" - ], - "gen:pkl": [ - "make pkl" - ], - "gen:templ": [ - "make templ" - ], - "start:motr": [ - "make templ", - "make motr", - "make start-motr" - ], - "start:testnet": [ - "make templ", - "make install", - "make sh-testnet" - ] + "dev": ["air"], + "build:docker": ["make local-image"], + "build:motr": ["make nebula", "make motr"], + "build:sonrd": ["make dwn", "make build"], + "build": ["make dwn", "make build", "make motr"], + "gen:proto": ["make proto-gen"], + "gen:pkl": ["make pkl"], + "gen:templ": ["make templ"], + "start:motr": ["make templ", "make motr", "make start-motr"], + "start:testnet": ["make templ", "make install", "make sh-testnet"], + "start": ["process-compose up -d"], + "stop": ["process-compose down"], + "test:e2e": ["make templ", "make test-e2e"], + "test:unit": ["make templ", "make test-unit"], + "test": ["make templ", "make test"] } } } diff --git a/devbox.lock b/devbox.lock index fd921b7fd..4d7e30e6d 100644 --- a/devbox.lock +++ b/devbox.lock @@ -1,6 +1,54 @@ { "lockfile_version": "1", "packages": { + "air@latest": { + "last_modified": "2024-09-10T15:01:03Z", + "resolved": "github:NixOS/nixpkgs/5ed627539ac84809c78b2dd6d26a5cebeb5ae269#air", + "source": "devbox-search", + "version": "1.52.3", + "systems": { + "aarch64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/bfwl7myqmaqh2xxw5fla1kmnv89qjxz6-air-1.52.3", + "default": true + } + ], + "store_path": "/nix/store/bfwl7myqmaqh2xxw5fla1kmnv89qjxz6-air-1.52.3" + }, + "aarch64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/ac18dzvchpv0pzi6qvdjs01cffw4q6zf-air-1.52.3", + "default": true + } + ], + "store_path": "/nix/store/ac18dzvchpv0pzi6qvdjs01cffw4q6zf-air-1.52.3" + }, + "x86_64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/jzdcmkyh258nf3j8lhfmg8n959ffvg13-air-1.52.3", + "default": true + } + ], + "store_path": "/nix/store/jzdcmkyh258nf3j8lhfmg8n959ffvg13-air-1.52.3" + }, + "x86_64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/rnny9fd1r9zdln6g6h7md4fpi6jgx229-air-1.52.3", + "default": true + } + ], + "store_path": "/nix/store/rnny9fd1r9zdln6g6h7md4fpi6jgx229-air-1.52.3" + } + } + }, "bun@latest": { "last_modified": "2024-09-20T22:35:44Z", "resolved": "github:NixOS/nixpkgs/a1d92660c6b3b7c26fb883500a80ea9d33321be2#bun", @@ -151,6 +199,54 @@ "source": "devbox-search", "version": "0.17.0" }, + "process-compose@latest": { + "last_modified": "2024-09-15T21:49:16Z", + "resolved": "github:NixOS/nixpkgs/039b72d0c738c934e2e36d7fc5520d1b425287a6#process-compose", + "source": "devbox-search", + "version": "1.27.0", + "systems": { + "aarch64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/dxgk503lw2a0slqcvhcvwfa07qf9y8sx-process-compose-1.27.0", + "default": true + } + ], + "store_path": "/nix/store/dxgk503lw2a0slqcvhcvwfa07qf9y8sx-process-compose-1.27.0" + }, + "aarch64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/k6xl3mdb8f0fkv7q4ibw8smak6lxrb93-process-compose-1.27.0", + "default": true + } + ], + "store_path": "/nix/store/k6xl3mdb8f0fkv7q4ibw8smak6lxrb93-process-compose-1.27.0" + }, + "x86_64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/5zyqg2yf0cg5nahgpwbkbblgml9nlac0-process-compose-1.27.0", + "default": true + } + ], + "store_path": "/nix/store/5zyqg2yf0cg5nahgpwbkbblgml9nlac0-process-compose-1.27.0" + }, + "x86_64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/3fwnj5jmdky0nl9ixp6bxasvi4ki6jgz-process-compose-1.27.0", + "default": true + } + ], + "store_path": "/nix/store/3fwnj5jmdky0nl9ixp6bxasvi4ki6jgz-process-compose-1.27.0" + } + } + }, "skate@latest": { "last_modified": "2024-09-10T15:01:03Z", "resolved": "github:NixOS/nixpkgs/5ed627539ac84809c78b2dd6d26a5cebeb5ae269#skate",