@spooky-sync/cli 0.0.1-canary.93 → 0.0.1-canary.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +49 -0
- package/package.json +6 -6
package/AGENTS.md
CHANGED
|
@@ -65,6 +65,55 @@ DEFINE FIELD author ON TABLE thread TYPE record<user>; -- @parent
|
|
|
65
65
|
DEFINE TABLE audit_log SCHEMALESS;
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
+
## Docker dev apps (`type: docker`)
|
|
69
|
+
|
|
70
|
+
Besides `backend`/`frontend` apps, `sp00ky.yml` can declare `type: docker` apps —
|
|
71
|
+
containers `spky dev` runs alongside SurrealDB/SSP/scheduler on the
|
|
72
|
+
`sp00ky-dev-net` network (each reachable from the others by its app **name**, via
|
|
73
|
+
a `--network-alias`). Use `scope: devOnly` for local-only sidecars: never
|
|
74
|
+
deployed, and they skip the backend spec/method/deploy validation.
|
|
75
|
+
|
|
76
|
+
Fields:
|
|
77
|
+
|
|
78
|
+
- `image` (required) — image to run, e.g. `bluenviron/mediamtx:latest` or `golang:1.22`.
|
|
79
|
+
- `ports` — published to the host: `[1935, "8189/udp", "3000:8080"]` (a bare value maps the same port host:container; `/udp` suffix preserved).
|
|
80
|
+
- `args` — appended after the image (the container command), e.g. `["go", "run", "."]`.
|
|
81
|
+
- `env` — same forms as other apps (inline map / dotenv path / vault). User values **override** the auto-injected `SPKY_*` vars. `${PROJECT_DIR}` (the absolute dir of `sp00ky.yml`) is expanded in values.
|
|
82
|
+
- `volumes` — bind/volume mounts (`-v`), e.g. `["/var/run/docker.sock:/var/run/docker.sock", "${PROJECT_DIR}/../..:/src", "gomod:/go"]`. `${PROJECT_DIR}` is expanded in the host portion (Docker normalizes `..`).
|
|
83
|
+
- `workdir` — working directory inside the container (`-w`).
|
|
84
|
+
- `dependsOn` — names of other docker apps that must be **ready** before this one starts; `spky dev` starts apps in dependency order. Validated at config load — an unknown name, a self-dependency, or a **cycle** is a hard error (`spky lint` reports it).
|
|
85
|
+
- `healthcheck` — an HTTP path (e.g. `/health`) polled on the app's first published host port until it returns 200. Lets a dependency signal real readiness so `dependsOn` waits for "up", not just "container started". Without it, a dependency counts as ready once its container is running.
|
|
86
|
+
|
|
87
|
+
Containers run as `sp00ky-dev-<name>` with `--rm` and are killed on Ctrl-C.
|
|
88
|
+
`dependsOn`/`healthcheck` are `spky dev` concerns; the cloud deploy path ignores
|
|
89
|
+
them (and `cloudOnly` docker apps are skipped by `spky dev`).
|
|
90
|
+
|
|
91
|
+
Example — a relay built from source via `go run`, and a publisher that waits for it:
|
|
92
|
+
```yaml
|
|
93
|
+
apps:
|
|
94
|
+
relay:
|
|
95
|
+
type: docker
|
|
96
|
+
scope: devOnly
|
|
97
|
+
image: golang:1.22
|
|
98
|
+
workdir: /src/apps/relay
|
|
99
|
+
args: ["go", "run", "."]
|
|
100
|
+
ports: [3670]
|
|
101
|
+
healthcheck: /health
|
|
102
|
+
volumes:
|
|
103
|
+
- "${PROJECT_DIR}/../..:/src"
|
|
104
|
+
- "gomod:/go"
|
|
105
|
+
publisher:
|
|
106
|
+
type: docker
|
|
107
|
+
scope: devOnly
|
|
108
|
+
image: golang:1.22
|
|
109
|
+
workdir: /src/apps/publisher
|
|
110
|
+
args: ["go", "run", "."]
|
|
111
|
+
dependsOn: [relay] # started only after relay's /health returns 200
|
|
112
|
+
volumes:
|
|
113
|
+
- "${PROJECT_DIR}/../..:/src"
|
|
114
|
+
- "gomod:/go"
|
|
115
|
+
```
|
|
116
|
+
|
|
68
117
|
## Common gotchas
|
|
69
118
|
|
|
70
119
|
- **`schema.gen.ts` must be regenerated after every `.surql` change.** `spky generate`. CI typically asserts no drift.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spooky-sync/cli",
|
|
3
|
-
"version": "0.0.1-canary.
|
|
3
|
+
"version": "0.0.1-canary.95",
|
|
4
4
|
"description": "Generate TypeScript/Dart types from SurrealDB schema files",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/syncgen.cjs",
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
"vitest": "^1.0.0"
|
|
62
62
|
},
|
|
63
63
|
"optionalDependencies": {
|
|
64
|
-
"@spooky-sync/cli-darwin-arm64": "0.0.1-canary.
|
|
65
|
-
"@spooky-sync/cli-darwin-x64": "0.0.1-canary.
|
|
66
|
-
"@spooky-sync/cli-linux-arm64": "0.0.1-canary.
|
|
67
|
-
"@spooky-sync/cli-linux-x64": "0.0.1-canary.
|
|
68
|
-
"@spooky-sync/cli-win32-x64": "0.0.1-canary.
|
|
64
|
+
"@spooky-sync/cli-darwin-arm64": "0.0.1-canary.95",
|
|
65
|
+
"@spooky-sync/cli-darwin-x64": "0.0.1-canary.95",
|
|
66
|
+
"@spooky-sync/cli-linux-arm64": "0.0.1-canary.95",
|
|
67
|
+
"@spooky-sync/cli-linux-x64": "0.0.1-canary.95",
|
|
68
|
+
"@spooky-sync/cli-win32-x64": "0.0.1-canary.95"
|
|
69
69
|
}
|
|
70
70
|
}
|