Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix package path to reduce nupkg size #8876

Merged
merged 2 commits into from
Jun 19, 2023

Conversation

filzrev
Copy link
Contributor

@filzrev filzrev commented Jun 16, 2023

Currently build-in templates don't contains target framework dependent plugin DLLs.
But Microsoft.DocAsCode.App.nupkg contains duplicated content files as below.

/contentFiles/any/net6.0/templates/**
/contentFiles/any/net7.0/templates/**
/contentFiles/any/net8.0/templates/**

This PR set PackagePath as Language- and framework-agnostic
and templates resources are packed to following shared path.

/contentFiles/any/any/templates/**

This PR reduce Microsoft.DocAsCode.App.nupkg package size.
docfx.nupkg package size issue described at #8691 needs additional works.

@filzrev
Copy link
Contributor Author

filzrev commented Jun 16, 2023

CI Tests failed with following error.

Failed! - Failed: 9, Passed: 16, Skipped: 1, Total: 26, Duration: 39 s - docfx.Tests.dll (net7.0)

It seems recent PR tests failed with same issues.

@@ -13,7 +13,7 @@
</Target>

<ItemGroup>
<Content Include="templates/**" CopyToOutputDirectory="PreserveNewest" PackageCopyToOutput="true" />
<Content Include="templates/**" CopyToOutputDirectory="PreserveNewest" PackageCopyToOutput="true" PackagePath="contentFiles/any/any/templates"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this change breaks the docfx package shipped as a global tool?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR change don't affects docfx.nupkg contents.
(Because docfx reference Microsoft.DocAsCode.App as ProjectReference)
So there is no breaking changes.


I though there are 3 execution type to run docfx toolset.

  1. Run docfx as .NET global tool (and .NET local tool)
  2. Run docfx Self-Contained exe that is published on GitHub Release Page
  3. Run custom application that use Microsoft.DocAsCode.App package.

1. and 2. behaviors are guaranteed by there is no output content changes.
And 3. is tested on my local environment. and confirmed no behavior changes.

@codecov
Copy link

codecov bot commented Jun 17, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.02 ⚠️

Comparison is base (e66d5df) 77.00% compared to head (3c3d0c0) 76.99%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8876      +/-   ##
==========================================
- Coverage   77.00%   76.99%   -0.02%     
==========================================
  Files         605      605              
  Lines       25036    25036              
==========================================
- Hits        19280    19277       -3     
- Misses       5756     5759       +3     

see 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@yufeih yufeih left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @filzrev, this is a great approach!

@yufeih yufeih merged commit d450f5c into dotnet:main Jun 19, 2023
@yufeih yufeih added engineering Makes the pull request to appear in the "Engineering" section of the next release note new-feature Makes the pull request to appear in "New Features" section of the next release note and removed engineering Makes the pull request to appear in the "Engineering" section of the next release note labels Jun 19, 2023
@filzrev filzrev deleted the fix-nupkg-templates-path branch June 19, 2023 19:40
@filzrev
Copy link
Contributor Author

filzrev commented Jun 21, 2023

I've confirmed Microsoft.DocAsCode.App 2.67.5 NuGet package size is reduced from 32.14 MB to 10.29 MB.

p-kostov pushed a commit to ErpNetDocs/docfx that referenced this pull request Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature Makes the pull request to appear in "New Features" section of the next release note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants