Skip to content

Commit 062e3bd

Browse files
committed
feat(cli): migrate compose from YAML to TS
1 parent 0b1d277 commit 062e3bd

26 files changed

+2160
-620
lines changed

apps/cli/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
"semver": "^7.7.2",
4040
"smol-toml": "^1.4.2",
4141
"tmp": "^0.2.5",
42-
"viem": "^2.37.6"
42+
"viem": "^2.37.6",
43+
"yaml": "^2.8.2"
4344
},
4445
"devDependencies": {
4546
"@biomejs/biome": "catalog:",
@@ -56,7 +57,6 @@
5657
"@types/tmp": "^0.2.6",
5758
"@vitest/coverage-istanbul": "^3.2.4",
5859
"@wagmi/cli": "^2.5.1",
59-
"copyfiles": "^2.4.1",
6060
"npm-run-all": "^4.1.5",
6161
"rimraf": "^6.0.1",
6262
"ts-node": "^10.9.2",
@@ -66,13 +66,12 @@
6666
"vitest": "^3.2.4"
6767
},
6868
"scripts": {
69-
"build": "run-s clean codegen compile copy-files",
69+
"build": "run-s clean codegen compile",
7070
"clean": "rimraf dist",
7171
"codegen": "run-p codegen:wagmi",
7272
"codegen:wagmi": "wagmi generate",
7373
"compile": "tsc -p tsconfig.build.json",
7474
"postcompile": "chmod +x dist/index.js",
75-
"copy-files": "copyfiles -u 1 \"src/**/*.yaml\" \"src/**/*.env\" \"src/**/*.txt\" dist",
7675
"lint": "biome lint",
7776
"posttest": "pnpm lint",
7877
"test": "vitest"

apps/cli/src/compose/anvil.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { Config, Service } from "../types/compose.js";
2+
import { DEFAULT_HEALTHCHECK } from "./common.js";
3+
4+
// Anvil service
5+
export const ANVIL_SVC: Service = {
6+
image: "cartesi/sdk:latest",
7+
command: ["devnet"],
8+
healthcheck: {
9+
...DEFAULT_HEALTHCHECK,
10+
test: ["CMD", "eth_isready"],
11+
},
12+
environment: {
13+
ANVIL_IP_ADDR: "0.0.0.0",
14+
},
15+
};
16+
17+
export const ANVIL_PROXY_CONFIG: Config = {
18+
name: "anvil-proxy",
19+
content: `http:
20+
routers:
21+
anvil:
22+
rule: "PathPrefix(\`/anvil\`)"
23+
middlewares:
24+
- "remove-anvil-prefix"
25+
service: anvil
26+
middlewares:
27+
remove-anvil-prefix:
28+
replacePathRegex:
29+
regex: "^/anvil(.*)"
30+
replacement: "$1"
31+
services:
32+
anvil:
33+
loadBalancer:
34+
servers:
35+
- url: "http://anvil:8545"`,
36+
};

0 commit comments

Comments
 (0)