monorepo

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package monorepo detects monorepo/workspace boundaries and reports the repo type along with resolved workspace paths.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manifest added in v0.5.0

type Manifest struct {
	Name string // npm name, Go module path, crate name or python project name
	Kind string // "npm", "go", "cargo" or "python"
}

Manifest identifies a package by the name other code imports it with.

func ReadManifest added in v0.5.0

func ReadManifest(dir string) (Manifest, bool)

ReadManifest returns the identity declared in dir, trying package.json, go.mod, Cargo.toml and pyproject.toml in that order. ok is false when none of them names the package.

func (Manifest) Matches added in v0.5.0

func (m Manifest) Matches(imp string) bool

Matches reports whether import path imp refers to the package named name, either exactly or as a subpath (e.g. "@acme/ui/button" for "@acme/ui"). Cargo crates are compared with dashes folded to underscores.

type Result

type Result struct {
	Type       string   `json:"type"`       // "monorepo" or "single"
	Tool       string   `json:"tool"`       // e.g. "pnpm", "npm", "yarn", "go-work", "turbo", "nx", "lerna", "cargo", "convention"
	Workspaces []string `json:"workspaces"` // relative paths to workspace roots
}

Result holds the detection output for a given root directory.

func Detect

func Detect(root string) (*Result, error)

Detect inspects root and returns a Result describing the repo layout. Detection runs in priority order; the first match wins.

Jump to

Keyboard shortcuts

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