devsurface 0.1.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 ADDED
@@ -0,0 +1,9 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0
4
+
5
+ - Initial DevSurface MVP scaffold.
6
+ - Added project scanner, doctor checks, CLI commands, local API server, dashboard, examples, and CI.
7
+ - Added grouped `devsurface.config.json` commands on the Scripts page.
8
+ - Added dashboard actions for dependency install, opening the project folder, opening `package.json`, opening a terminal, copying `.env.example`, and retained command logs.
9
+ - Added completed/failed script status display after commands exit.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DevSurface contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,222 @@
1
+ # DevSurface
2
+
3
+ [![DevSurface ready](docs/devsurface-badge.svg)](https://github.com/mrfandu1/devsurface)
4
+
5
+ Turn any Node.js repository into a local developer control panel.
6
+
7
+ DevSurface scans a project, starts a local dashboard, and shows the things contributors
8
+ usually need before a project will run: package scripts, environment files, ports,
9
+ Docker Compose, live command logs, and repo health warnings.
10
+
11
+ No config file is required.
12
+
13
+ ```bash
14
+ npx devsurface
15
+ ```
16
+
17
+ ![DevSurface demo](docs/devsurface-demo.gif)
18
+
19
+ ## Why DevSurface
20
+
21
+ Most repositories explain setup with a few commands, but real onboarding usually
22
+ means checking env files, ports, Docker, package managers, scripts, and stale README
23
+ instructions. DevSurface puts that project surface in one local browser view so a
24
+ new contributor can see what is missing before guessing in the terminal.
25
+
26
+ DevSurface is local-first:
27
+
28
+ - The server binds to `127.0.0.1`.
29
+ - No accounts, cloud sync, telemetry, or analytics.
30
+ - `.env` values are never displayed.
31
+ - Commands are shown before they run.
32
+
33
+ ## How It Compares
34
+
35
+ | Tool | What it does | Where DevSurface is different |
36
+ | ---------------------- | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
37
+ | runme.dev | Runs commands embedded in annotated README markdown. | Requires maintainers to annotate commands. DevSurface scans the repo without README annotations. |
38
+ | VS Code Tasks | Runs tasks from `.vscode/tasks.json`. | VS Code only and manually configured. DevSurface runs from `npx` and opens in any browser. |
39
+ | Makefile / Taskfile | Provides terminal task runners. | Terminal only. DevSurface adds UI, auto-detection, ports, env checks, logs, and health warnings. |
40
+ | npm-run-all | Runs multiple npm scripts from the terminal. | Script orchestration only. DevSurface shows the whole local project surface. |
41
+ | `package.json` scripts | Standard Node.js script entry points. | No UI, env checks, port checks, service detection, or repo health context. |
42
+
43
+ DevSurface is not trying to replace these tools. It sits above them as a local control
44
+ panel for contributors who need to understand how a project is meant to run.
45
+
46
+ ## Quick Start
47
+
48
+ Run DevSurface from the root of any Node.js project:
49
+
50
+ ```bash
51
+ cd my-node-project
52
+ npx devsurface
53
+ ```
54
+
55
+ The dashboard opens at:
56
+
57
+ ```text
58
+ http://127.0.0.1:4567
59
+ ```
60
+
61
+ If a browser does not open automatically, copy the printed dashboard URL from the
62
+ terminal.
63
+
64
+ ## Commands
65
+
66
+ | Command | Description |
67
+ | ------------------------- | -------------------------------------------------------------------- |
68
+ | `devsurface` | Scan the current project, start the dashboard, and open the browser. |
69
+ | `devsurface scan` | Print detected project information to the terminal. |
70
+ | `devsurface doctor` | Print setup and repo health warnings. |
71
+ | `devsurface init` | Create a starter `devsurface.config.json`. |
72
+ | `devsurface run <script>` | Run a package script and stream output. |
73
+
74
+ ## What It Detects
75
+
76
+ | Area | Detection |
77
+ | --------------- | ------------------------------------------------------------------ |
78
+ | Project | `package.json`, project name, README, LICENSE |
79
+ | Package manager | npm, pnpm, yarn, bun from lock files |
80
+ | Scripts | `package.json` scripts |
81
+ | Environment | `.env`, `.env.example`, missing and empty keys without values |
82
+ | Ports | Configured, inferred, and occupied ports using Node's `net` module |
83
+ | Docker | Compose files, Docker daemon status, compose service names |
84
+ | Git | Repository presence and current branch |
85
+ | Framework | Next.js, Vite, Express, Fastify, NestJS, Remix, Prisma |
86
+
87
+ ## Dashboard
88
+
89
+ The dashboard includes:
90
+
91
+ - **Project Overview**: project name, framework, package manager, branch, env, README,
92
+ and license status.
93
+ - **Quick Actions**: compact direct actions for scripts, terminal, project folder,
94
+ `package.json`, and dependency install.
95
+ - **Scripts**: every package script, plus grouped configured commands when present.
96
+ - **Environment**: `.env` and `.env.example` status, key presence, and copy-from-example.
97
+ - **Ports**: detected ports with availability and conflict warnings.
98
+ - **Services**: Docker Compose detection and service status.
99
+ - **Logs**: expandable per-command logs with timestamps, streams, and exit state.
100
+ - **Repo Health**: doctor warnings for common setup issues.
101
+
102
+ Quick Actions intentionally stay compact. Long script lists belong in the Scripts
103
+ page, where they have room to breathe.
104
+
105
+ ## Optional Config
106
+
107
+ DevSurface works without configuration. Maintainers can add `devsurface.config.json`
108
+ when a project needs richer commands, groups, ports, env paths, or docs links.
109
+
110
+ ```json
111
+ {
112
+ "name": "My App",
113
+ "description": "Full-stack SaaS starter",
114
+ "commands": {
115
+ "install": "pnpm install",
116
+ "dev": "pnpm run dev",
117
+ "build": "pnpm run build",
118
+ "test": "pnpm test",
119
+ "lint": "pnpm run lint"
120
+ },
121
+ "groups": {
122
+ "Setup": ["install"],
123
+ "Development": ["dev"],
124
+ "Quality": ["test", "lint"],
125
+ "Build": ["build"]
126
+ },
127
+ "ports": [3000, 5432, 6379],
128
+ "env": {
129
+ "example": ".env.example",
130
+ "local": ".env"
131
+ },
132
+ "services": {
133
+ "docker": true
134
+ },
135
+ "docs": "https://docs.example.dev"
136
+ }
137
+ ```
138
+
139
+ Configured commands appear on the Scripts page. If `groups` is present, DevSurface
140
+ uses those group names. Commands not listed in a group still appear under
141
+ Configured Commands. The `docs` URL appears as a Project docs link.
142
+
143
+ ## Badge
144
+
145
+ Maintainers can add this badge to a project README after checking that DevSurface
146
+ works for the repo:
147
+
148
+ ```markdown
149
+ [![DevSurface ready](https://raw.githubusercontent.com/mrfandu1/devsurface/main/docs/devsurface-badge.svg)](https://github.com/mrfandu1/devsurface)
150
+ ```
151
+
152
+ ## Safety
153
+
154
+ DevSurface is designed for local development.
155
+
156
+ - The dashboard server is restricted to `127.0.0.1`.
157
+ - Mutating API routes require dashboard intent headers.
158
+ - `.env` values are never returned by scanners, API routes, CLI output, or UI panels.
159
+ - Dashboard command runs show the exact command string first.
160
+ - Destructive-looking configured commands, such as `rm -rf`, `docker volume rm`,
161
+ database drops, and `git clean -fd`, are visibly marked before execution.
162
+ - Child processes started by DevSurface are cleaned up when the dashboard exits.
163
+
164
+ ## Examples
165
+
166
+ This repository includes two sample projects:
167
+
168
+ ```bash
169
+ cd examples/node-basic
170
+ node ../../dist/cli/index.js
171
+
172
+ cd examples/nextjs-app
173
+ node ../../dist/cli/index.js
174
+ ```
175
+
176
+ The Next.js example is used for the README demo: it has six scripts, `.env.example`,
177
+ Docker Compose, and a port conflict scenario.
178
+
179
+ ## Development
180
+
181
+ ```bash
182
+ npm install
183
+ npm run build
184
+ npm test
185
+ ```
186
+
187
+ Useful commands:
188
+
189
+ | Command | Description |
190
+ | ---------------------- | ----------------------------------------- |
191
+ | `npm run dev` | Run the local DevSurface CLI from source. |
192
+ | `npm run build:web` | Build the React dashboard with Vite. |
193
+ | `npm run build:cli` | Build the CLI with tsup. |
194
+ | `npm run typecheck` | Run TypeScript without emitting files. |
195
+ | `npm run lint` | Run ESLint. |
196
+ | `npm run format:check` | Check Prettier formatting. |
197
+
198
+ Before opening a pull request, run:
199
+
200
+ ```bash
201
+ npm run format:check
202
+ npm run typecheck
203
+ npm run lint
204
+ npm test
205
+ npm run build
206
+ ```
207
+
208
+ ## Publishing
209
+
210
+ The npm package is allowlisted through `package.json#files`. The package includes the
211
+ built CLI, built web UI, README, demo GIF, license, and changelog. Private notes,
212
+ tests, examples, and development-only files are excluded from npm publishes.
213
+
214
+ Check package contents before publishing:
215
+
216
+ ```bash
217
+ npm pack --dry-run
218
+ ```
219
+
220
+ ## License
221
+
222
+ MIT. See [LICENSE](LICENSE).
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node