Documentation
¶
Overview ¶
Package detect provides framework and tooling auto-detection from filesystem signals. It identifies frameworks (Rails, Next.js, etc.), package managers, database adapters, and other project characteristics to generate appropriate configuration templates.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var EnvFileCandidates = []string{
".env.local",
".env.development",
".env.development.local",
".env",
".env.example",
}
EnvFileCandidates is the priority-ordered list of env file names to check.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct {
Framework string // "nextjs", "vite", "rails", "phoenix", "node", "django", "python", "rust", "go", "unknown"
HasPrisma bool
HasJSBundler bool // jsbundling-rails/cssbundling-rails or multi-process Procfile.dev
HasDotenv bool // project has dotenv or equivalent wired up
DBAdapter string // "postgresql", "sqlite", ""
DBTemplate string // static development database name, when detected
DBTemplateInvalid string // raw value from database.yml that was rejected as a non-identifier
HasRedis bool
HasEnvFile bool // true if any env file exists on disk
EnvFile string // best candidate: ".env.local", ".env.development", ".env", etc.
EnvFiles []string // all env files found, in priority order
PackageManager string // "npm", "yarn", "pnpm", "bundle", "mix", "cargo", "pip", ""
IsUmbrella bool // Phoenix umbrella project (apps/*/mix.exs); not yet fully supported
MergeTarget string // set by caller when git context is available
}
Result contains the detection findings for a project directory. All fields are populated by Detect() based on filesystem analysis.
func (*Result) AutoLoadsEnvFile ¶
AutoLoadsEnvFile reports whether this framework natively loads .env files without the user needing to install a dotenv library.
func (*Result) DefaultEnvTarget ¶
DefaultEnvTarget returns the conventional env file name for a framework.
func (*Result) IsServerFramework ¶
IsServerFramework returns true if the detected framework typically runs a development server (Rails, Node, Django, etc.) as opposed to a CLI or library.