devtool

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Stdin     io.Reader
	Stdout    io.Writer
	Stderr    io.Writer
	Resolve   func(context.Context) (Environment, error)
	Database  DatabaseManager
	Ports     PortAllocator
	Processes ProcessManager
	// LANAddress is this machine's address as a phone on the same network
	// sees it.
	LANAddress func(context.Context) (string, error)
}

App implements the command interface used by mise tasks.

func NewApp

func NewApp() *App

func (*App) Run

func (a *App) Run(ctx context.Context, args []string) error

type DatabaseManager

DatabaseManager owns the shared PostgreSQL process and its worktree databases.

type DockerDatabase

type DockerDatabase struct{}

DockerDatabase manages PostgreSQL through the main worktree's Compose service.

func (*DockerDatabase) Clone

func (d *DockerDatabase) Clone(ctx context.Context, env Environment, source, target string) (returnErr error)

func (*DockerDatabase) Create

func (d *DockerDatabase) Create(ctx context.Context, env Environment, name string) error

func (*DockerDatabase) Exists

func (d *DockerDatabase) Exists(ctx context.Context, env Environment, name string) (bool, error)

func (*DockerDatabase) Migrate

func (d *DockerDatabase) Migrate(ctx context.Context, env Environment, name string) error

func (*DockerDatabase) RequireRunning

func (d *DockerDatabase) RequireRunning(ctx context.Context, env Environment) error

func (*DockerDatabase) Reset

func (d *DockerDatabase) Reset(ctx context.Context, env Environment, name string) error

func (*DockerDatabase) Rollback

func (d *DockerDatabase) Rollback(ctx context.Context, env Environment, name string) error

func (*DockerDatabase) Start

func (d *DockerDatabase) Start(ctx context.Context, env Environment) error

type Environment

type Environment struct {
	MainRoot        string
	CurrentRoot     string
	MainDatabase    string
	CurrentDatabase string
	PostgresPort    int
	ProjectName     string
}

Environment describes the repository and worktree resources used by a command.

func ResolveEnvironment

func ResolveEnvironment(ctx context.Context) (Environment, error)

func (Environment) DatabaseURL

func (e Environment) DatabaseURL(name string) string

func (Environment) IsMain

func (e Environment) IsMain() bool

type FilePortAllocator

type FilePortAllocator struct {
	LockRoot string
}

FilePortAllocator coordinates ports between worktrees with advisory locks.

func (*FilePortAllocator) Acquire

func (a *FilePortAllocator) Acquire(preferred int) (PortLease, error)

type OSProcesses

type OSProcesses struct{}

OSProcesses runs development commands as child process groups.

func (*OSProcesses) E2E

func (p *OSProcesses) E2E(ctx context.Context, env Environment, project string, webPort int) error

func (*OSProcesses) Mobile added in v0.3.0

func (p *OSProcesses) Mobile(ctx context.Context, env Environment, host, installationURL string) error

func (*OSProcesses) PreviewEmail added in v0.6.0

func (p *OSProcesses) PreviewEmail(ctx context.Context, env Environment, proxyPort, serverPort int) error

func (*OSProcesses) Start

func (p *OSProcesses) Start(ctx context.Context, env Environment, mode string, apiPort, webPort int) error

type PortAllocator

type PortAllocator interface {
	Acquire(preferred int) (PortLease, error)
}

PortAllocator reserves the first available port at or above a preferred port.

type PortLease

type PortLease interface {
	Port() int
	Close() error
}

PortLease reserves a runtime port until Close is called.

type ProcessManager

type ProcessManager interface {
	Start(context.Context, Environment, string, int, int) error
	// Mobile starts Expo advertising host, with the app's address field
	// prefilled with installationURL.
	Mobile(ctx context.Context, env Environment, host, installationURL string) error
	E2E(context.Context, Environment, string, int) error
	// PreviewEmail serves the email previews on proxyPort, rebuilding the
	// server on serverPort when Go files change.
	PreviewEmail(ctx context.Context, env Environment, proxyPort, serverPort int) error
}

ProcessManager runs the development servers, the Mobile App's bundler, and browser tests.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL