#[derive(Debug, Clone, Copy)]
pub(crate) struct ProjectCatalogEntry {
pub(crate) id: &'static str,
pub(crate) languages: &'static [&'static str],
pub(crate) frameworks: &'static [&'static str],
pub(crate) build_systems: &'static [&'static str],
pub(crate) anchors: &'static [&'static str],
pub(crate) lockfiles: &'static [&'static str],
pub(crate) source_globs: &'static [&'static str],
pub(crate) default_build_cmd: Option<&'static str>,
pub(crate) default_test_cmd: Option<&'static str>,
pub(crate) anchor_score: f64,
}
pub(crate) const PROJECT_CATALOG: &[ProjectCatalogEntry] = &[
ProjectCatalogEntry {
id: "rust",
languages: &["rust"],
frameworks: &[],
build_systems: &["cargo"],
anchors: &["Cargo.toml"],
lockfiles: &["Cargo.lock"],
source_globs: &["*.rs", "src/**/*.rs", "crates/**/*.rs", "tests/**/*.rs"],
default_build_cmd: Some("cargo build"),
default_test_cmd: Some("cargo test"),
anchor_score: 0.5,
},
ProjectCatalogEntry {
id: "go",
languages: &["go"],
frameworks: &[],
build_systems: &["go"],
anchors: &["go.mod"],
lockfiles: &["go.sum"],
source_globs: &["*.go", "cmd/**/*.go", "internal/**/*.go", "pkg/**/*.go"],
default_build_cmd: Some("go build ./..."),
default_test_cmd: Some("go test ./..."),
anchor_score: 0.5,
},
ProjectCatalogEntry {
id: "python",
languages: &["python"],
frameworks: &[],
build_systems: &["python"],
anchors: &["pyproject.toml", "setup.py", "requirements.txt"],
lockfiles: &[
"uv.lock",
"poetry.lock",
"Pipfile.lock",
"requirements.lock",
],
source_globs: &["*.py", "src/**/*.py", "tests/**/*.py"],
default_build_cmd: None,
default_test_cmd: Some("pytest"),
anchor_score: 0.5,
},
ProjectCatalogEntry {
id: "typescript",
languages: &["typescript"],
frameworks: &[],
build_systems: &["npm"],
anchors: &["tsconfig.json", "package.json"],
lockfiles: &[
"package-lock.json",
"pnpm-lock.yaml",
"yarn.lock",
"bun.lockb",
],
source_globs: &[
"*.ts",
"*.tsx",
"src/**/*.ts",
"src/**/*.tsx",
"tests/**/*.ts",
],
default_build_cmd: Some("npm run build"),
default_test_cmd: Some("npm test"),
anchor_score: 0.2,
},
ProjectCatalogEntry {
id: "javascript",
languages: &["javascript"],
frameworks: &[],
build_systems: &["npm"],
anchors: &["package.json"],
lockfiles: &[
"package-lock.json",
"pnpm-lock.yaml",
"yarn.lock",
"bun.lockb",
],
source_globs: &[
"*.js",
"*.jsx",
"*.mjs",
"*.cjs",
"src/**/*.js",
"src/**/*.jsx",
],
default_build_cmd: Some("npm run build"),
default_test_cmd: Some("npm test"),
anchor_score: 0.1,
},
ProjectCatalogEntry {
id: "nextjs",
languages: &["javascript", "typescript"],
frameworks: &["nextjs"],
build_systems: &["npm"],
anchors: &["next.config.js", "next.config.mjs", "next.config.ts"],
lockfiles: &[],
source_globs: &[
"pages/**/*.tsx",
"app/**/*.tsx",
"pages/**/*.js",
"app/**/*.js",
],
default_build_cmd: Some("npm run build"),
default_test_cmd: Some("npm test"),
anchor_score: 0.7,
},
ProjectCatalogEntry {
id: "ruby",
languages: &["ruby"],
frameworks: &[],
build_systems: &["bundler"],
anchors: &["Gemfile"],
lockfiles: &["Gemfile.lock"],
source_globs: &["*.rb", "app/**/*.rb", "lib/**/*.rb", "spec/**/*.rb"],
default_build_cmd: None,
default_test_cmd: Some("bundle exec rspec"),
anchor_score: 0.5,
},
];
pub(crate) fn project_catalog() -> &'static [ProjectCatalogEntry] {
PROJECT_CATALOG
}