workspace

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package workspace detects monorepo structures and enumerates their workspaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kind

type Kind string

Kind identifies the monorepo tool or convention that defines the workspace layout.

const (
	KindGoWork Kind = "go-work"
	KindPnpm   Kind = "pnpm"
	KindNpm    Kind = "npm"
	KindLerna  Kind = "lerna"
	KindNx     Kind = "nx"
	KindCargo  Kind = "cargo"
)

type Layout

type Layout struct {
	Kind       Kind
	Root       string
	Workspaces []Workspace
}

Layout describes a detected monorepo structure.

func Detect

func Detect(rootPath string) (*Layout, error)

Detect probes rootPath for known monorepo layouts. It returns the first matching Layout, or nil if no monorepo structure is detected.

type Workspace

type Workspace struct {
	Name string // basename or package name
	Path string // absolute path
	Rel  string // relative to monorepo root
}

Workspace represents a single workspace within a monorepo.

Jump to

Keyboard shortcuts

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