project

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DetectOptions

type DetectOptions struct {
	ProjectRoot string           `json:"projectRoot,omitzero"`
	MaxDepth    int              `json:"maxDepth,omitzero"`
	Progress    ProgressReporter `json:"-"`
}

DetectOptions configures project detection.

type Detection

type Detection struct {
	ProjectRoot      string                `json:"projectRoot"`
	Root             RootInfo              `json:"root"`
	NextJS           NextJSHints           `json:"nextjs"`
	Libraries        []LibraryHint         `json:"libraries,omitzero"`
	DetectedLibrary  string                `json:"detectedLibrary,omitzero"`
	Layouts          []LocaleLayout        `json:"layouts,omitzero"`
	LocaleFiles      []LocaleFileCandidate `json:"localeFiles,omitzero"`
	SourceCandidates []string              `json:"sourceLocaleCandidates,omitzero"`
	TargetLocales    []string              `json:"targetLocales,omitzero"`
	ProposedConfig   config.File           `json:"proposedConfig"`
	Warnings         []string              `json:"warnings,omitzero"`
}

Detection describes detected project i18n settings and proposed config.

type LibraryHint

type LibraryHint struct {
	Name       string `json:"name"`
	Version    string `json:"version,omitzero"`
	Source     string `json:"source"`
	Confidence string `json:"confidence"`
}

LibraryHint describes a detected i18n library dependency.

type LocaleFileCandidate

type LocaleFileCandidate struct {
	Locale     string `json:"locale"`
	Namespace  string `json:"namespace,omitzero"`
	Path       string `json:"path"`
	Pattern    string `json:"pattern"`
	StringKeys int    `json:"stringKeys"`
	Bytes      int    `json:"bytes"`
}

LocaleFileCandidate describes a detected locale file.

type LocaleLayout

type LocaleLayout struct {
	Pattern    string                `json:"pattern"`
	Files      []LocaleFileCandidate `json:"files"`
	TotalKeys  int                   `json:"totalKeys"`
	Namespaces []string              `json:"namespaces,omitzero"`
}

LocaleLayout describes a detected locale file layout.

type NextJSHints

type NextJSHints = detect4nextjs.Hints

NextJSHints contains Next.js project hints from detect4nextjs.

type ProgressReporter

type ProgressReporter interface {
	Step(ctx context.Context, message string, current int, total int)
}

ProgressReporter receives project detection progress events.

type RootInfo

type RootInfo struct {
	ProjectRoot string `json:"projectRoot"`
	Name        string `json:"name"`
	Relative    string `json:"relative,omitzero"`
}

RootInfo describes the effective project root.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service resolves and inspects project roots.

func NewService

func NewService(guard *fsutil.Guard) *Service

NewService creates a project service scoped by guard.

func (*Service) Detect

func (s *Service) Detect(ctx context.Context, opts DetectOptions) (Detection, error)

Detect inspects a project and proposes i18n MCP configuration.

func (*Service) ResolveRoot

func (s *Service) ResolveRoot(ctx context.Context, projectRoot string) (RootInfo, error)

ResolveRoot resolves projectRoot and returns project root information.

func (*Service) Root

func (s *Service) Root(ctx context.Context) (RootInfo, error)

Root returns information about the current project root.

Jump to

Keyboard shortcuts

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