Basic pack functionality for Embedded Readmes#3575
Basic pack functionality for Embedded Readmes#3575advay26-zz merged 27 commits intodev-feature-readmefrom
Conversation
…speed with nuget pack
…speed with nuget pack
…estMetadata.cs Co-authored-by: donnie-msft <[email protected]>
zkat
left a comment
There was a problem hiding this comment.
I love all the tests, and everything looks good so far! I spotted something that brought up a question for me but the rest looks good. Great work!
…rches exclusively?), added some tests to catch it out
| bool Serviceable { get; } | ||
| string Copyright { get; } | ||
| string Icon { get; } | ||
| string Readme { get; } |
There was a problem hiding this comment.
A concern I have is that one could easily mistake Readme as the readme content instead of a path - especially for undocumented members. What do you think of renaming properties to ReadmePath and methods to GetReadmePath()?
There was a problem hiding this comment.
Would this change apply to the actual nuspec element name <readme> as well, making it something like <readmePath>, or would it only apply to the names of properties and methods in the code?
There was a problem hiding this comment.
Up to you. Personally I'd be fine with renaming just the properties and methods in code so that we can keep the nuspec element <readme> consistent with the <license type="file"> element.
There was a problem hiding this comment.
I agree on not changing the nuspec element name. However, I'm personally unsure about how we should weigh the concerns about the Readme property name not being clear on readme contents vs path, against possible concerns about consistency between:
- the nuspec
<readme>element and other nuspec elements (we seem to agree that we shouldn't change this) - the nuspec
<readme>element and the correspondingReadmeproperties in the code
Would ReadmePath properties in the code cause confusion because of the fact that the corresponding nuspec element is named <readme> and not <readmePath>? I don't necessarily have an answer to this, and I'm happy to leave this conversation open for others to weigh in too.
nkolev92
left a comment
There was a problem hiding this comment.
Quickly skimming through it this looks great.
You are missing dotnet pack tests though. https://github.com/NuGet/NuGet.Client/blob/dev/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/PackCommandTests.cs
@nkolev92 Done! I've added new tests for |
* Made basic changes to classes to allow for a Readme element in the nuspec file * More changes for readme functionality * Adding the readme property if 'readme.md' is present in the base directory * Added support for dotnet pack for .csproj files * Added validation for Readmes when packing, brought dotnet pack up to speed with nuget pack * Changed variable names, changed error message for empty Readme * Removed commented code * Added a summary for the CheckForReadme method * Added support for dotnet pack for .csproj files * Added support for dotnet pack for .csproj files * Added validation for Readmes when packing, brought dotnet pack up to speed with nuget pack * Changed variable names, changed error message for empty Readme * Updated PublicAPI.Unshipped.txt files * Changed some spacing * Wrote tests for packing embedded readmes * Removed automatic packing of readmes from base directory * Used platform independent directory separating chars for testing * Update src/NuGet.Core/NuGet.Packaging/PackageCreation/Authoring/ManifestMetadata.cs Co-authored-by: donnie-msft <[email protected]> * Updated PublicAPI files after file structure was modified * Reverted to 'Readme == string.Empty' so that the Readme element remains optional * Removed 1 MB file size check on pack * Updated Public API files * Updated Public API files again, builds fine locally * Fixed a bug with dir. separating chars (which seemed to affect /* searches exclusively?), added some tests to catch it out * Changed var name in one of the tests * Changed tests that were constructed incorrectly for non-Windows platforms * Added dotnet pack tests Co-authored-by: donnie-msft <[email protected]>
* Made basic changes to classes to allow for a Readme element in the nuspec file * More changes for readme functionality * Adding the readme property if 'readme.md' is present in the base directory * Added support for dotnet pack for .csproj files * Added validation for Readmes when packing, brought dotnet pack up to speed with nuget pack * Changed variable names, changed error message for empty Readme * Removed commented code * Added a summary for the CheckForReadme method * Added support for dotnet pack for .csproj files * Added support for dotnet pack for .csproj files * Added validation for Readmes when packing, brought dotnet pack up to speed with nuget pack * Changed variable names, changed error message for empty Readme * Updated PublicAPI.Unshipped.txt files * Changed some spacing * Wrote tests for packing embedded readmes * Removed automatic packing of readmes from base directory * Used platform independent directory separating chars for testing * Update src/NuGet.Core/NuGet.Packaging/PackageCreation/Authoring/ManifestMetadata.cs Co-authored-by: donnie-msft <[email protected]> * Updated PublicAPI files after file structure was modified * Reverted to 'Readme == string.Empty' so that the Readme element remains optional * Removed 1 MB file size check on pack * Updated Public API files * Updated Public API files again, builds fine locally * Fixed a bug with dir. separating chars (which seemed to affect /* searches exclusively?), added some tests to catch it out * Changed var name in one of the tests * Changed tests that were constructed incorrectly for non-Windows platforms * Added dotnet pack tests Co-authored-by: donnie-msft <[email protected]>
* Made basic changes to classes to allow for a Readme element in the nuspec file * More changes for readme functionality * Adding the readme property if 'readme.md' is present in the base directory * Added support for dotnet pack for .csproj files * Added validation for Readmes when packing, brought dotnet pack up to speed with nuget pack * Changed variable names, changed error message for empty Readme * Removed commented code * Added a summary for the CheckForReadme method * Added support for dotnet pack for .csproj files * Added support for dotnet pack for .csproj files * Added validation for Readmes when packing, brought dotnet pack up to speed with nuget pack * Changed variable names, changed error message for empty Readme * Updated PublicAPI.Unshipped.txt files * Changed some spacing * Wrote tests for packing embedded readmes * Removed automatic packing of readmes from base directory * Used platform independent directory separating chars for testing * Update src/NuGet.Core/NuGet.Packaging/PackageCreation/Authoring/ManifestMetadata.cs Co-authored-by: donnie-msft <[email protected]> * Updated PublicAPI files after file structure was modified * Reverted to 'Readme == string.Empty' so that the Readme element remains optional * Removed 1 MB file size check on pack * Updated Public API files * Updated Public API files again, builds fine locally * Fixed a bug with dir. separating chars (which seemed to affect /* searches exclusively?), added some tests to catch it out * Changed var name in one of the tests * Changed tests that were constructed incorrectly for non-Windows platforms * Added dotnet pack tests Co-authored-by: donnie-msft <[email protected]>
* Made basic changes to classes to allow for a Readme element in the nuspec file * More changes for readme functionality * Adding the readme property if 'readme.md' is present in the base directory * Added support for dotnet pack for .csproj files * Added validation for Readmes when packing, brought dotnet pack up to speed with nuget pack * Changed variable names, changed error message for empty Readme * Removed commented code * Added a summary for the CheckForReadme method * Added support for dotnet pack for .csproj files * Added support for dotnet pack for .csproj files * Added validation for Readmes when packing, brought dotnet pack up to speed with nuget pack * Changed variable names, changed error message for empty Readme * Updated PublicAPI.Unshipped.txt files * Changed some spacing * Wrote tests for packing embedded readmes * Removed automatic packing of readmes from base directory * Used platform independent directory separating chars for testing * Update src/NuGet.Core/NuGet.Packaging/PackageCreation/Authoring/ManifestMetadata.cs Co-authored-by: donnie-msft <[email protected]> * Updated PublicAPI files after file structure was modified * Reverted to 'Readme == string.Empty' so that the Readme element remains optional * Removed 1 MB file size check on pack * Updated Public API files * Updated Public API files again, builds fine locally * Fixed a bug with dir. separating chars (which seemed to affect /* searches exclusively?), added some tests to catch it out * Changed var name in one of the tests * Changed tests that were constructed incorrectly for non-Windows platforms * Added dotnet pack tests Co-authored-by: donnie-msft <[email protected]>
* Basic pack functionality for Embedded Readmes (#3575) * Made basic changes to classes to allow for a Readme element in the nuspec file * More changes for readme functionality * Adding the readme property if 'readme.md' is present in the base directory * Added support for dotnet pack for .csproj files * Added validation for Readmes when packing, brought dotnet pack up to speed with nuget pack * Changed variable names, changed error message for empty Readme * Removed commented code * Added a summary for the CheckForReadme method * Added support for dotnet pack for .csproj files * Added support for dotnet pack for .csproj files * Added validation for Readmes when packing, brought dotnet pack up to speed with nuget pack * Changed variable names, changed error message for empty Readme * Updated PublicAPI.Unshipped.txt files * Changed some spacing * Wrote tests for packing embedded readmes * Removed automatic packing of readmes from base directory * Used platform independent directory separating chars for testing * Update src/NuGet.Core/NuGet.Packaging/PackageCreation/Authoring/ManifestMetadata.cs Co-authored-by: donnie-msft <[email protected]> * Updated PublicAPI files after file structure was modified * Reverted to 'Readme == string.Empty' so that the Readme element remains optional * Removed 1 MB file size check on pack * Updated Public API files * Updated Public API files again, builds fine locally * Fixed a bug with dir. separating chars (which seemed to affect /* searches exclusively?), added some tests to catch it out * Changed var name in one of the tests * Changed tests that were constructed incorrectly for non-Windows platforms * Added dotnet pack tests Co-authored-by: donnie-msft <[email protected]> * PM UI surfaces a 'View README' link to the Embedded Readme file (#3583) * Made initial changes for PM UI work for Readmes * Added ReadmeUrl element to all the relevant places, still using ProjectUrl to see an an actual link for now * URL now shows when user hovers over the link's text * Removed the placeholder URL value that used the ProjectUrl Co-authored-by: Advay Tandon <[email protected]> Co-authored-by: donnie-msft <[email protected]>
Bug
Fixes: NuGet/Home#9833
Regression: No
Fix
Details: This implements basic embedded Readme functionality through
nuget pack,dotnet packandmsbuild /t:pack, and does the Client-side validation for the packed Readme files.Testing/Validation
Tests Added: Yes