Documentation
¶
Overview ¶
Package scan finds projects under the root and reads their state: stack, git, running processes, disk use and activity. It only reads; it never changes anything on disk except its own size cache.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var BuildDirs = []string{"node_modules", "target", ".next", "dist", "build", ".turbo", "src-tauri/target"}
BuildDirs are the only folders cleanup may remove (Safety rule 2). Sizes report them separately so the dashboard shows what is reclaimable.
Functions ¶
func PackageScripts ¶
PackageScripts returns the scripts in a folder's package.json, or nil.
Types ¶
type Detail ¶
type Detail struct {
Changes []string // `git status --short` lines
Commits []string // recent commits, one line each
Readme []string // first non-empty README lines
Scripts []string // package.json scripts as "name: command"
}
Detail is what the project detail view shows beyond the dashboard row.
type Project ¶
type Project struct {
Rel string // path relative to root, e.g. "acme/web"
Abs string
Name string
Depth int // 1 for top-level folders
Kind Kind
Archived bool // inside the archive folder
Stack []string
Docker bool
NotInstalled bool // package.json but no node_modules
Port int // expected dev port, 0 if unknown
PortSource string
Git GitState
LastChange time.Time
Activity string // active | warm | dormant | abandoned | ""
Running []Listener
Containers []string
Size *Sizes // nil until measured
}
func Discover ¶
Discover lists every git repo up to depth levels under root, the folders that only hold repos (groups), and top-level folders with no git at all. The result is in tree order: each group or repo precedes what it contains.
The archive folder is a group whenever it holds anything, its direct children count as top-level (so an archived folder without git still shows and can be restored), and it gets one extra level of depth because archived projects keep their path, e.g. archive/acme/web.
func (*Project) IsRunning ¶
IsRunning reports whether any listener or container belongs to the project.
func (*Project) StackLabel ¶
StackLabel is the primary stack plus any secondary ones, e.g. "Tauri".
type Scanner ¶
type Scanner struct {
Sizes *SizeCache
// contains filtered or unexported fields
}
type SizeCache ¶
type SizeCache struct {
// contains filtered or unexported fields
}
SizeCache keeps measured sizes on disk between runs.