Skip to content

fix: simplify dev workflow and drop unused scripts - #13

Merged
jesse23 merged 7 commits into
mainfrom
jesse_webui
Mar 23, 2026
Merged

fix: simplify dev workflow and drop unused scripts#13
jesse23 merged 7 commits into
mainfrom
jesse_webui

Conversation

@jesse23

@jesse23 jesse23 commented Mar 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Collapse dual dev/CLI workflows in AGENTS.md to a single bun run build flow
  • Remove dev and dev:node scripts from package.json (renamed prod/prod:node to server/server:node)
  • Add debugging section to README.md — build emits source maps so bun --inspect run dist/server/index.js works out of the box
  • Add comments to startServer() explaining runtime detection and reuse

Test plan

  • bun run build && webtty stop ; webtty run main works end-to-end
  • bun --inspect run dist/server/index.js launches server with source maps

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json scripts to prefer a single built-server workflow (server / server:node) and drop dev variants.
  • 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.

Comment thread AGENTS.md Outdated
Comment thread src/server/index.ts
Comment thread src/server/index.ts Outdated
Comment thread src/cli/http.ts Outdated
jesse23 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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/stop shutdown path exits only via httpServer.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 cause webtty stop to 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.

Comment thread README.md Outdated
Comment thread AGENTS.md
- 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
@jesse23
jesse23 merged commit 03406c6 into main Mar 23, 2026
3 checks passed
@jesse23
jesse23 deleted the jesse_webui branch March 23, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants