☰
VSuite

@vsuite/detection

Scans a project’s manifests to suggest a stack for the vsuite init wizard and the desktop app’s new-project wizard. Non-goals: choosing agents or MCP servers (@vsuite/catalog resolveStack), and writing config.

This is a private, source-only workspace package (exports → ./src/index.ts). It is bundled into the @krizic/vsuite CLI and the desktop app and is not published to npm. Workspace consumers depend on it with "@vsuite/detection": "workspace:*".

Supported manifests

package.json, requirements.txt, pyproject.toml, go.mod, pom.xml, build.gradle, build.gradle.kts, and *.csproj. Directories such as node_modules and build output are skipped.

Public API

Export Kind Signature Description
detectStack function (root: string) => Promise<DetectedStack> Unions the dependencies of every supported manifest and matches them against the catalog’s stackTechnologies. Registry order is the precedence within a category.
DetectedStack type { frontend: string[]; backend: string | null; orm: string | null; database: string[]; designLibrary: string | null } frontend holds at most one framework followed by companion shells such as electron.
findManifests function (root: string) => Promise<string[]> Recursively finds every supported manifest.
readManifestDependencies function (manifestPath: string) => Promise<Set<string>> Dependency, module, artifact, or SDK names from one manifest.
isManifest, parseManifest functions (name: string) => boolean, (name: string, text: string) => Set<string> Manifest recognition and parsing by file name.
findPackageManifests, readDependencies functions The package.json-only variants.
detectTechnologies function (root: string) => Promise<TechnologySuggestions> Legacy npm-only suggestion of a frontend framework and design library.

Dependencies

  • Workspace: @vsuite/catalog.
  • Third-party: none. Dev: @vsuite/test-utils.
  • Used by: @vsuite/workflows, @krizic/vsuite, and the UI main process.

Usage

import { detectStack } from "@vsuite/detection";
 
const { frontend, backend, orm, database, designLibrary } = await detectStack(process.cwd());

Testing

pnpm vitest run --project @vsuite/detection