fix: simplify dev workflow and drop unused scripts - #13
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR streamlines the local development and runtime workflow by standardizing on the built dist/ output, renaming/removing related npm scripts, and documenting debugging via source maps.
Changes:
- Rename/remove
package.jsonscripts to prefer a single built-server workflow (server/server:node) and dropdevvariants. - Improve shutdown behavior messaging by closing WebSocket clients with an explicit code/reason.
- Add documentation for debugging the built server with source maps and clarify runtime detection/spawn behavior in the CLI.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/server/index.ts |
Sends explicit WebSocket close code/reason on shutdown paths. |
src/cli/http.ts |
Adds comments and spawns the server using the current runtime with TS/JS entry detection. |
package.json |
Removes dev scripts and renames prod* scripts to server*. |
README.md |
Adds a debugging section documenting source maps + inspector usage. |
AGENTS.md |
Updates the documented development workflow command snippet. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
added 3 commits
March 23, 2026 06:52
- trim trailing whitespace in AGENTS.md code block - use close code 1001 (Going Away) for server shutdown instead of 4001 which was reserved for session-removed semantics; update client to show 'Server stopped.' message on 1001 rather than reconnecting - graceful SIGINT shutdown: wait for httpServer.close() before exit, with 1s fallback timeout so WS close frames are flushed - guard .ts server entry behind isBun check so Node never tries to exec a TypeScript file directly
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
src/server/index.ts:19
- The
/api/server/stopshutdown path exits only viahttpServer.close(() => process.exit(0)).httpServer.close()waits for all open connections to end, so a stuck/slow WebSocket close handshake (or any keep-alive connection) can causewebtty stopto hang indefinitely. Consider reusing the SIGINT pattern here as well (exit callback + short fallback timeout) so stop is reliably bounded.
handleRequest(req, res, distPath, wasmPath, () => {
for (const session of sessionRegistry.values()) {
session.pty?.kill();
for (const client of session.clients) client.close(1001, 'server stopped');
}
wss.close();
httpServer.close(() => process.exit(0));
});
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- fix README source map glob: dist/*.js.map -> dist/**/*.js.map - annotate removed dev scripts in ADR 001 as historical - restore window.close() for 1001 (server stopped) close code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AGENTS.mdto a singlebun run buildflowdevanddev:nodescripts frompackage.json(renamedprod/prod:nodetoserver/server:node)README.md— build emits source maps sobun --inspect run dist/server/index.jsworks out of the boxstartServer()explaining runtime detection and reuseTest plan
bun run build && webtty stop ; webtty run mainworks end-to-endbun --inspect run dist/server/index.jslaunches server with source maps🤖 Generated with Claude Code