-
Notifications
You must be signed in to change notification settings - Fork 82
Language-Agnostic Local Dev Process Manager #2697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
rossnelson
wants to merge
10
commits into
main
Choose a base branch
from
add-proc-manager
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
This commit introduces a new CLI tool, `devctl`, designed to manage development services. It includes the following features: - Service orchestration with health checks and environment loading. - Interactive TUI for monitoring service statuses and logs. - Configurable focus and mute options for service output. - Support for Procfile-based service definitions and health checks. The implementation includes: - Core application logic in `app` package. - CLI entry point in `cmd` package. - Config parsing for `.env`, Procfile, and healthcheck files. - Unit tests for key components. This tool aims to streamline development workflows by providing a centralized interface for managing services.
Add unit tests for various utility packages including app, colors, config, contexts, runner, service, tui, and cmd. These tests cover functionality such as environment file loading, Procfile handling, health checks, service execution, and TUI interactions. - Ensure proper error handling and edge case coverage. - Validate default configurations and custom options. - Improve test coverage and maintainability. This change enhances the reliability and robustness of the utilities.
- Replaced `tui` flag with `noTUI` for better clarity. - Updated `Handler` to handle `noTUI` flag and adjusted logic in `Run`. - Enhanced TUI model to apply focus and mute filters for logs and statuses. - Added tests for focus and mute filtering in TUI model. - Removed unused development configuration files. BREAKING CHANGE: The `--tui` flag is replaced with `--no-tui` to disable the interactive TUI. Update CLI usage accordingly.
- Introduced `.env.dev` for environment-specific variables. - Added `Procfile.dev` to define development process commands. - Created `healthcheck.dev.yaml` for service health monitoring. - Implemented TUI keybindings and viewport handling in `keys.go`. - Enhanced TUI model with sidebar and content focus in `model.go`. - Updated `run.go` to enable alternate screen for TUI. - Upgraded dependencies in `go.mod` and `go.sum` for compatibility.
- Introduced `Left` and `Right` key bindings for horizontal scrolling. - Updated `keyMap` to include new bindings with help descriptions. - Modified `ShortHelp` and `FullHelp` to reflect the new keys. - Enabled horizontal scrolling in the main viewport with a step of 1. - Implemented `ScrollLeft` and `ScrollRight` actions in the `Update` method. This enhances navigation by allowing users to scroll content horizontally.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
- Updated `.gitignore` to include `/bin/cli` instead of `/bin`. - Added `bin/devctl.sh` script to build and run `devctl` with configs. - Modified `configs/Procfile.dev` to open the browser on `vite dev`. - Updated `package.json` to use `bin/devctl.sh` for the `dev` command.
Updated the devctl script to forward any additional arguments to the devctl executable. This allows for more flexible usage of the script by supporting custom parameters.
- Replace `tui` flag with `noTUI` in test cases to align with updated functionality. - Adjust test assertions to reflect changes in model behavior, including focus, mute, and log handling. - Update `makeContext` helper to support `--no-tui` flag. - Ensure test coverage for new behavior, including service-runner path and help text in `View()` output.
- Refactored `captureOutput` to `captureStderr` for improved clarity. - Added `TestRun_Warnings` to verify warnings for missing env and health files. - Introduced `TestRun_SetsEnvVars` to ensure environment variables are set. - Added `TestRun_ErrorOnBadEnvFile` to handle malformed env files. - Included `TestRun_ErrorOnMissingProcfile` to test missing Procfile errors. - Created new TUI test `TestRun_ProcfileMissing` for Procfile absence handling. - Added utility functions `errorsUnwrapped`, `unwrap`, and `contains` for error handling and string checks in TUI tests.
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.
This PR introduces a clean, extensible process manager CLI for local development.
Define various modes by simply adding:
Procfile.<mode>
.env.<mode>
healthcheck.<mode>.yaml
Start the
dev
mode easily with:If you don't want a TUI pass the
--no-tui
flagWhy
Improving Visibility and Control
Currently, services like the
ui-server
must often be started manually outside of Vite to properly view logs. When enabling internal logs, outputs from multiple processes are mixed and hard to follow.This new process manager cleanly separates logs per process, supports log focusing (only see one process) or log muting (hide noisy services), and provides a unified way to start all needed services from a single command.
Developers can easily run focused workflows like:
pnpm dev:with-auth
pnpm dev:local-temporal
pnpm dev:with-codec
and add new modes without manually editing Node scripts or Vite plugins.
Simpler, Safer Scaling
Granted, how often are we really going to add a module, but....
Adding new local services or workflows today requires:
shouldSkip
.This introduces hidden coupling and complexity.
With this new model, adding a new service mode is as easy as:
No Go, Node, or Vite code changes required.
A Monorepo Dev Experience (in practice)
While our runtime systems are separate, our local development already resembles a monorepo:
A common, language-agnostic process manager better matches our reality. It makes development across all modules easier, faster, and more reliable.
Summary
This PR replaces per-plugin service management with: