Expose import defaults and selection evidence

This commit is contained in:
2026-10-19 21:06:31 +00:00
parent 05b67cbfcf
commit 24131617c7
12 changed files with 568 additions and 18 deletions

View File

@@ -35,6 +35,9 @@ type Underlay struct{ Inputs []Input }
type LayeredOptions[T any] struct {
Definition Definition[T]
SourceVersionMode SourceVersionMode
// ImportDefaults supplies one load-wide default policy for enabled main,
// underlay, and transitive declarations. Explicit declaration values win.
ImportDefaults ImportDefaults
Underlays []Underlay
Overlay string
OverlayFilesystem *FilesystemContext
@@ -73,6 +76,7 @@ func toEngineLayeredOptions[T any](options LayeredOptions[T]) engine.LayeredOpti
Overlay: options.Overlay,
OverlayFilesystem: toEngineFilesystemContext(options.OverlayFilesystem),
}
result = engine.LayeredOptionsWithImportDefaults(result, toEngineImportDefaults(options.ImportDefaults))
if options.Underlays != nil {
result.Underlays = make([]engine.Underlay, len(options.Underlays))
for index, group := range options.Underlays {