devsurface 0.2.0 → 0.4.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0
4
+
5
+ - Added multi-workspace Hub mode: one DevSurface instance serves multiple project
6
+ directories. Run `npx devsurface` in any project to attach it to a running hub.
7
+ - Added `devsurface serve` command for running the hub as a persistent background
8
+ server, Docker container, or k3s pod.
9
+ - Added `devsurface workspace add|list|remove` commands for managing registered
10
+ workspaces from the CLI.
11
+ - Added workspace switcher and Hub overview page in the dashboard for comparing
12
+ projects at a glance.
13
+ - Added workspace-scoped API routes under `/api/workspaces/:id/*` with backward-
14
+ compatible aliases for single-project setups.
15
+ - Added workspace-scoped WebSocket connections via `?workspace=<id>` query parameter.
16
+ - Added Dockerfile, docker-compose.hub.yml, and deploy/k3s/ Kubernetes manifests
17
+ for containerized and local-cluster deployments.
18
+ - Added `DEVSURFACE_HOST`, `DEVSURFACE_CONTAINER`, `DEVSURFACE_DATA_DIR`,
19
+ `DEVSURFACE_WORKSPACES`, and `DEVSURFACE_WORKSPACE_ROOTS` environment variables
20
+ for container and workspace-root configuration.
21
+ - Kept per-project `devsurface.config.json` unchanged; existing single-project
22
+ workflows auto-register on first run.
23
+ - Added workspace-root configuration for deployments that should only register
24
+ projects from mounted directories.
25
+
26
+ ## 0.3.0
27
+
28
+ - Added the reusable `mrfandu1/devsurface@v0` GitHub Action.
29
+ - Added static repository checks for onboarding documentation, scripts, configuration,
30
+ environment setup, and declared ports.
31
+ - Added workflow annotations, job summaries, optional update-in-place pull request
32
+ comments, and configurable failure thresholds.
33
+ - Added safe fallback behavior when fork pull requests have read-only tokens.
34
+ - Added Docker Compose service status with running, stopped, error, and unavailable states.
35
+ - Added dashboard controls to start and stop individual Compose services.
36
+ - Added bounded per-service Docker Compose logs in the Services view.
37
+ - Added Docker Desktop guidance when the engine is not responding on macOS or Windows.
38
+ - Reduced consumer-installed dependencies by bundling the browser opener and keeping
39
+ React build-only.
40
+
3
41
  ## 0.2.0
4
42
 
5
43
  - Added retained process logs through `GET /api/logs` so the dashboard can recover session output without relying only on WebSocket state.
package/README.md CHANGED
@@ -57,7 +57,9 @@ new contributor can see what is missing before guessing in the terminal.
57
57
 
58
58
  DevSurface is local-first:
59
59
 
60
- - The server binds to `127.0.0.1`.
60
+ - Local runs bind to `127.0.0.1`.
61
+ - Docker and k3s runs bind inside the container and are meant to be exposed with
62
+ local port mappings or `kubectl port-forward`.
61
63
  - No accounts, cloud sync, telemetry, or analytics.
62
64
  - `.env` values are never displayed.
63
65
  - Commands are shown before they run.
@@ -109,13 +111,96 @@ Run DevSurface without installing it globally:
109
111
  | npm | `npx devsurface` |
110
112
  | Bun | `bunx devsurface` |
111
113
 
112
- | Command | Description |
113
- | ------------------------- | -------------------------------------------------------------------- |
114
- | `devsurface` | Scan the current project, start the dashboard, and open the browser. |
115
- | `devsurface scan` | Print detected project information to the terminal. |
116
- | `devsurface doctor` | Print setup and repo health warnings. |
117
- | `devsurface init` | Create a starter `devsurface.config.json`. |
118
- | `devsurface run <script>` | Run a package script and stream output. |
114
+ | Command | Description |
115
+ | ---------------------------------- | -------------------------------------------------------------------- |
116
+ | `devsurface` | Scan the current project, start the dashboard, and open the browser. |
117
+ | `devsurface scan` | Print detected project information to the terminal. |
118
+ | `devsurface doctor` | Print setup and repo health warnings. |
119
+ | `devsurface init` | Create a starter `devsurface.config.json`. |
120
+ | `devsurface run <script>` | Run a package script and stream output. |
121
+ | `devsurface serve` | Start the multi-workspace hub server. |
122
+ | `devsurface workspace add [path]` | Register a project directory with the local hub. |
123
+ | `devsurface workspace list` | List registered hub workspaces. |
124
+ | `devsurface workspace remove <id>` | Remove a workspace from the hub registry. |
125
+
126
+ ## Multi-Workspace Hub
127
+
128
+ DevSurface now runs as a local hub. One server can serve several project
129
+ directories, each with isolated process state, Docker controls, logs, and scanner
130
+ results.
131
+
132
+ Start or attach from any project:
133
+
134
+ ```bash
135
+ npx devsurface
136
+ ```
137
+
138
+ Run a persistent hub:
139
+
140
+ ```bash
141
+ npx devsurface serve --no-open
142
+ ```
143
+
144
+ Register workspaces manually:
145
+
146
+ ```bash
147
+ npx devsurface workspace add /path/to/project-a
148
+ npx devsurface workspace add /path/to/project-b
149
+ npx devsurface workspace list
150
+ ```
151
+
152
+ Container and k3s deployments are included for local-cluster use:
153
+
154
+ - `Dockerfile`
155
+ - `docker-compose.hub.yml`
156
+ - `deploy/k3s/`
157
+
158
+ Container deployments bind inside the container. Keep host port mappings local,
159
+ for example `127.0.0.1:4567:4567`, or use `kubectl port-forward` for k3s.
160
+
161
+ ## GitHub Action
162
+
163
+ DevSurface can check repository onboarding health on every pull request without
164
+ installing dependencies or running project scripts.
165
+
166
+ ```yaml
167
+ name: DevSurface
168
+
169
+ on:
170
+ pull_request:
171
+ push:
172
+ branches: [main]
173
+
174
+ permissions:
175
+ contents: read
176
+ pull-requests: write
177
+
178
+ jobs:
179
+ health:
180
+ runs-on: ubuntu-latest
181
+ steps:
182
+ - uses: actions/checkout@v4
183
+ - uses: mrfandu1/devsurface@v0
184
+ with:
185
+ fail-on: error
186
+ ```
187
+
188
+ The action always emits workflow annotations and a Markdown job summary. On pull
189
+ requests it also creates or updates one DevSurface comment when the workflow token
190
+ has `pull-requests: write`. Fork pull requests normally receive a read-only token;
191
+ in that case the action keeps the annotations and summary and skips the comment.
192
+
193
+ Inputs:
194
+
195
+ | Input | Default | Description |
196
+ | -------------- | ------- | --------------------------------------------------------------- |
197
+ | `path` | `.` | Repository-relative directory to check. |
198
+ | `fail-on` | `error` | Fail on `error`, `warning`, or never fail with `never`. |
199
+ | `comment` | `true` | Create or update a pull request comment when permissions allow. |
200
+ | `github-token` | token | Token used only for pull request comments. |
201
+
202
+ The repository checks are intentionally static. They do not install dependencies,
203
+ run package scripts, inspect local ports, require a real `.env`, or contact Docker.
119
204
 
120
205
  ## What It Detects
121
206
 
@@ -126,7 +211,7 @@ Run DevSurface without installing it globally:
126
211
  | Scripts | `package.json` scripts |
127
212
  | Environment | `.env`, `.env.example`, missing and empty keys without values |
128
213
  | Ports | Configured, inferred, and occupied ports using Node's `net` module |
129
- | Docker | Compose files, Docker daemon status, compose service names |
214
+ | Docker | Compose files, daemon status, service state, controls, and logs |
130
215
  | Git | Repository presence and current branch |
131
216
  | Framework | Next.js, Vite, Express, Fastify, NestJS, Remix, Prisma |
132
217
 
@@ -141,7 +226,8 @@ The dashboard includes:
141
226
  - **Scripts**: every package script, plus grouped configured commands when present.
142
227
  - **Environment**: `.env` and `.env.example` status, key presence, and copy-from-example.
143
228
  - **Ports**: detected ports with availability and conflict warnings.
144
- - **Services**: Docker Compose detection and service status.
229
+ - **Services**: Docker Compose daemon state, per-service status, start/stop controls,
230
+ and the latest 200 log lines for each service.
145
231
  - **Logs**: expandable per-command logs with timestamps, streams, and exit state.
146
232
  - **Repo Health**: doctor warnings for common setup issues.
147
233
 
@@ -199,10 +285,12 @@ works for the repo:
199
285
 
200
286
  DevSurface is designed for local development.
201
287
 
202
- - The dashboard server is restricted to `127.0.0.1`.
203
- - Mutating API routes require dashboard intent headers.
288
+ - Local dashboard servers bind to loopback hosts.
289
+ - Container deployments use `DEVSURFACE_CONTAINER=true`.
290
+ - Workspace registration can be limited with `DEVSURFACE_WORKSPACE_ROOTS`.
204
291
  - `.env` values are never returned by scanners, API routes, CLI output, or UI panels.
205
292
  - Dashboard command runs show the exact command string first.
293
+ - Docker service start and stop actions show the exact Compose command before running.
206
294
  - Destructive-looking configured commands, such as `rm -rf`, `docker volume rm`,
207
295
  database drops, and `git clean -fd`, are visibly marked before execution.
208
296
  - Child processes started by DevSurface are cleaned up when the dashboard exits.