Project

Profile

Help

NuGet Packages » History » Sprint/Milestone 1

ananace, 01/28/2018 04:27 PM

1 1 ananace
# NuGet Packages
2
3
This would manage .nupkg files, which are renamed ZIP files with a special \<id\>.nuspec file in the root.
4
5
The .nuspec is documented with an xsd on GitHub: https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Packaging/compiler/resources/nuspec.xsd  
6
Uniqueness is determined as a combination of id and version from the spec, with added digest.  
7
Core attributes are id and version. They are both strings and are required to discover NuGet packages.
8
9
Additional simple optional attributes that could be added are;  
10
\- authors : string  
11
\- copyright : string  
12
\- description : string  
13
\- language : string : default en-US  
14
\- owners : string  
15
\- summary : string  
16
\- tags : string  
17
\- title : string
18
19
Clients that access NuGet packages are; nuget (Both by itself as well as a package-manager plugin for Visual Studio), the dotnet CLI tool, the Chocolatey tool, and just plain curl works too.
20
21
For content discovery, a core index JSON lists available services on the registry (https://registry.example/v3/index.json)  
22
The Catalog/3.0.0 service provides json blobs for full content listing, split into several "pages" of JSON. (https://docs.microsoft.com/en-us/nuget/guides/api/query-for-all-published-packages)  
23
Additionally, the PackageBaseAddress/3.0.0 service provides the base address for generating a download URL from {@id}/{LOWER_ID}/{LOWER_VERSION}/{LOWER_ID}.{LOWER_VERSION}.nupkg (https://docs.microsoft.com/en-us/nuget/api/package-base-address-resource)
24
25
The JSON blobs contain identical metadata to the nuspec XML, just in JSON format.
26
27
To make the client happy about finding packages in large registries, the SearchQueryService would probably have to be implemented as well - as a live API. (https://docs.microsoft.com/en-us/nuget/api/search-query-service-resource)