Documentation
¶
Index ¶
- Variables
- func Watch(projectDir string, onChange OnChange) error
- func WatchDirsForServices(serviceDirs []string) []string
- func WatchMonorepo(rootDir string, apps []AppWatchConfig, ...) error
- func WatchWithDirs(projectDir string, dirs []string, onChange OnChange) error
- type AppWatchConfig
- type OnChange
Constants ¶
This section is empty.
Variables ¶
var WatchDirs = []string{
"app/http/controllers",
"app/http/middleware",
"app/http/requests",
"app/models",
"database/migrations",
"routes",
"config",
}
WatchDirs are the directories pickle watches for changes (Laravel layout).
Functions ¶
func Watch ¶
Watch monitors a project directory for changes to controllers, migrations, requests, middleware, and routes.go. It calls onChange after a debounce period when changes are detected. Watch blocks until ctx is cancelled or an unrecoverable error occurs.
func WatchDirsForServices ¶
WatchDirsForServices returns the watch directories for a multi-service project. serviceDirs are relative paths like "services/api", "services/worker".
func WatchMonorepo ¶
func WatchMonorepo(rootDir string, apps []AppWatchConfig, onChange func(appName string, changed []string)) error
WatchMonorepo monitors multiple apps for changes. When a shared migration directory changes, all apps referencing it are regenerated. When an app-specific directory changes, only that app is regenerated.
Types ¶
type AppWatchConfig ¶
type AppWatchConfig struct {
Name string
ProjectDir string
MigrationDirs []string // absolute paths to all migration dirs (including shared)
}
AppWatchConfig describes an app's directories for monorepo watching.