Documentation
¶
Overview ¶
Package discover finds projects that look like they have a dev server and proposes a command for each, so adding a server rarely means typing one.
Detection is conservative, because a wrong suggestion is worse than none: a suggestion gets an automatic port only when its command is known to listen on {PORT} or $PORT, and a project kind is proposed only on clear evidence. Node and Deno scripts live in node.go, JavaScript workspace roots in workspace.go, Python in python.go, other ecosystems and Compose in backends.go. Names taken from the project (folders, scripts) enter a generated command only when they are plain words.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Installed ¶
Installed reports whether a command is on the PATH that servers get (the login shell's, not necessarily the caller's), for proposals that depend on a tool such as uv.
type Suggestion ¶
type Suggestion struct {
Name string `json:"name"`
Dir string `json:"dir"`
Cmd string `json:"cmd"`
Kind string `json:"kind"` // e.g. "next", "vite", "compose"
Port int `json:"port,omitempty"`
NoPort bool `json:"noPort,omitempty"`
StopAfter string `json:"stopTimeout,omitempty"`
DirectoryConfigured bool `json:"directoryConfigured,omitempty"`
}
Suggestion is a proposed server definition.
func Prepare ¶
func Prepare(cfg *config.Config, found []Suggestion) []Suggestion
Prepare removes configured commands, marks shared directories and assigns unique names and automatic ports, checking the roster and live listeners.