feat: use attribute instead of name for packages
Alan Pearce alan@alanpearce.eu
Fri, 17 May 2024 22:59:57 +0200
4 files changed, 5 insertions(+), 3 deletions(-)
M frontend/templates/blocks/packages.gotmpl → frontend/templates/blocks/packages.gotmpl
@@ -5,9 +5,9 @@ <details id="{{ .Name }}"> <summary> <h3> {{- if .Broken }} - <del>{{ .Name }}</del> + <del>{{ .Attribute }}</del> {{- else }} - {{ .Name }} + {{ .Attribute }} {{- end }} </h3> </summary>
M internal/importer/package.go → internal/importer/package.go
@@ -228,6 +228,7 @@ } results <- &nix.Package{ Name: i.pkg.Name, + Attribute: kv.Key, Source: i.source.Key, PackageSet: pkgSet, Version: i.pkg.Version,
M internal/index/indexer.go → internal/index/indexer.go
@@ -104,7 +104,7 @@ optionMapping.AddSubDocumentMapping("Example", nixValueMapping) packageMapping := bleve.NewDocumentStaticMapping() - packageMapping.AddFieldMappingsAt("Name", keywordFieldMapping) + packageMapping.AddFieldMappingsAt("Attribute", keywordFieldMapping) packageMapping.AddFieldMappingsAt("Source", keywordFieldMapping) packageMapping.AddFieldMappingsAt("Description", textFieldMapping) packageMapping.AddFieldMappingsAt("MainProgram", keywordFieldMapping)
M internal/nix/package.go → internal/nix/package.go
@@ -2,6 +2,7 @@ package nix type Package struct { Name string + Attribute string Source string Broken bool Definition string