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 ¶
NewService creates a project service scoped by guard.
func (*Service) ResolveRoot ¶
ResolveRoot resolves projectRoot and returns project root information.
Click to show internal directories.
Click to hide internal directories.