frameworks

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package frameworks - detection.go provides framework detection utilities This centralizes file path indicators used to detect frameworks in codebases

Index

Constants

This section is empty.

Variables

View Source
var AllFrameworkIndicators = func() []FrameworkIndicator {
	all := make([]FrameworkIndicator, 0)
	all = append(all, PHPFrameworkIndicators...)
	all = append(all, RubyFrameworkIndicators...)
	all = append(all, JavaScriptFrameworkIndicators...)
	all = append(all, PythonFrameworkIndicators...)
	all = append(all, JavaFrameworkIndicators...)
	all = append(all, GoFrameworkIndicators...)
	all = append(all, CSharpFrameworkIndicators...)
	all = append(all, RustFrameworkIndicators...)
	all = append(all, CppFrameworkIndicators...)
	return all
}()

AllFrameworkIndicators contains all framework indicators across all languages

View Source
var CSharpFrameworkIndicators = []FrameworkIndicator{
	{
		Framework:   "aspnetcore",
		Language:    "csharp",
		Indicators:  []string{"Program.cs", "Startup.cs", ".csproj"},
		Description: "ASP.NET Core",
	},
	{
		Framework:   "aspnetmvc",
		Language:    "csharp",
		Indicators:  []string{"Global.asax.cs", "Web.config"},
		Description: "ASP.NET MVC",
	},
}

CSharpFrameworkIndicators contains file path indicators for C# frameworks

View Source
var CppFrameworkIndicators = []FrameworkIndicator{
	{
		Framework:   "qt",
		Language:    "cpp",
		Indicators:  []string{".pro", "CMakeLists.txt"},
		Description: "Qt framework",
	},
	{
		Framework:   "poco",
		Language:    "cpp",
		Indicators:  []string{"CMakeLists.txt"},
		Description: "POCO C++ Libraries",
	},
}

CppFrameworkIndicators contains file path indicators for C++ frameworks

View Source
var GoFrameworkIndicators = []FrameworkIndicator{
	{
		Framework:   "gin",
		Language:    "go",
		Indicators:  []string{"go.mod", "main.go"},
		Description: "Gin web framework",
	},
	{
		Framework:   "echo",
		Language:    "go",
		Indicators:  []string{"go.mod"},
		Description: "Echo web framework",
	},
}

GoFrameworkIndicators contains file path indicators for Go frameworks

View Source
var JavaFrameworkIndicators = []FrameworkIndicator{
	{
		Framework:   "spring",
		Language:    "java",
		Indicators:  []string{"pom.xml", "application.properties", "application.yml"},
		Description: "Spring Framework",
	},
	{
		Framework:   "springboot",
		Language:    "java",
		Indicators:  []string{"src/main/java", "Application.java"},
		Description: "Spring Boot",
	},
}

JavaFrameworkIndicators contains file path indicators for Java frameworks

View Source
var JavaScriptFrameworkIndicators = []FrameworkIndicator{
	{
		Framework:   "express",
		Language:    "javascript",
		Indicators:  []string{"node_modules/express", "package.json"},
		Description: "Express.js web framework",
	},
	{
		Framework:   "nextjs",
		Language:    "javascript",
		Indicators:  []string{"next.config.js", "next.config.mjs", "pages/", "app/"},
		Description: "Next.js React framework",
	},
	{
		Framework:   "nuxt",
		Language:    "javascript",
		Indicators:  []string{"nuxt.config.js", "nuxt.config.ts"},
		Description: "Nuxt.js Vue framework",
	},
	{
		Framework:   "nestjs",
		Language:    "typescript",
		Indicators:  []string{"nest-cli.json", "src/main.ts"},
		Description: "NestJS framework",
	},
	{
		Framework:   "koa",
		Language:    "javascript",
		Indicators:  []string{"node_modules/koa"},
		Description: "Koa web framework",
	},
	{
		Framework:   "fastify",
		Language:    "javascript",
		Indicators:  []string{"node_modules/fastify"},
		Description: "Fastify web framework",
	},
}

JavaScriptFrameworkIndicators contains file path indicators for JavaScript frameworks

View Source
var PHPFrameworkIndicators = []FrameworkIndicator{
	{
		Framework:   "laravel",
		Language:    "php",
		Indicators:  []string{"artisan", "bootstrap/app.php"},
		Description: "Laravel framework",
	},
	{
		Framework:   "symfony",
		Language:    "php",
		Indicators:  []string{"symfony.lock", "config/bundles.php"},
		Description: "Symfony framework",
	},
}

PHPFrameworkIndicators contains file path indicators for PHP frameworks Note: Only Laravel and Symfony are supported

View Source
var PythonFrameworkIndicators = []FrameworkIndicator{
	{
		Framework:   "django",
		Language:    "python",
		Indicators:  []string{"manage.py", "settings.py", "urls.py"},
		Description: "Django web framework",
	},
	{
		Framework:   "flask",
		Language:    "python",
		Indicators:  []string{"app.py", "wsgi.py"},
		Description: "Flask web framework",
	},
	{
		Framework:   "fastapi",
		Language:    "python",
		Indicators:  []string{"main.py"},
		Description: "FastAPI web framework",
	},
}

PythonFrameworkIndicators contains file path indicators for Python frameworks

View Source
var RubyFrameworkIndicators = []FrameworkIndicator{
	{
		Framework:   "rails",
		Language:    "ruby",
		Indicators:  []string{"config/application.rb", "config/routes.rb", "app/controllers"},
		Description: "Ruby on Rails",
	},
	{
		Framework:   "sinatra",
		Language:    "ruby",
		Indicators:  []string{"config.ru"},
		Description: "Sinatra web framework",
	},
	{
		Framework:   "hanami",
		Language:    "ruby",
		Indicators:  []string{"config/environment.rb", "lib/"},
		Description: "Hanami framework",
	},
	{
		Framework:   "padrino",
		Language:    "ruby",
		Indicators:  []string{"config/boot.rb", "config/apps.rb"},
		Description: "Padrino framework",
	},
}

RubyFrameworkIndicators contains file path indicators for Ruby frameworks

View Source
var RustFrameworkIndicators = []FrameworkIndicator{
	{
		Framework:   "actix-web",
		Language:    "rust",
		Indicators:  []string{"Cargo.toml"},
		Description: "Actix-web framework",
	},
	{
		Framework:   "rocket",
		Language:    "rust",
		Indicators:  []string{"Cargo.toml", "Rocket.toml"},
		Description: "Rocket framework",
	},
	{
		Framework:   "axum",
		Language:    "rust",
		Indicators:  []string{"Cargo.toml"},
		Description: "Axum framework",
	},
}

RustFrameworkIndicators contains file path indicators for Rust frameworks

Functions

func DetectFramework

func DetectFramework(codebasePath string) string

DetectFramework detects which framework is being used in a codebase Returns the framework name or "unknown" if not detected

func DetectFrameworkByLanguage

func DetectFrameworkByLanguage(codebasePath string, language string) string

DetectFrameworkByLanguage detects which framework is being used for a specific language

func GetFrameworkIndicators

func GetFrameworkIndicators(framework string) []string

GetFrameworkIndicators returns all indicators for a specific framework

func GetFrameworksForLanguage

func GetFrameworksForLanguage(language string) []string

GetFrameworksForLanguage returns all known frameworks for a language

func RegisterAllDetectors

func RegisterAllDetectors()

RegisterAllDetectors registers all framework detectors with the common package

Types

type FrameworkIndicator

type FrameworkIndicator struct {
	Framework   string   // Framework identifier
	Language    string   // Programming language
	Indicators  []string // File paths relative to project root
	Description string   // Human-readable description
}

FrameworkIndicator defines file paths that indicate a specific framework

Jump to

Keyboard shortcuts

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