Skip to content

Conversation

@zone117x
Copy link
Owner

KnownMimeTypes.cs is now generated at compile-time via source generator instead of T4 template.

  • Add MimeMapping.SourceGenerator project with incremental generator
  • Remove KnownMimeTypes.tt T4 template
  • Download mime-db.json at build time via MSBuild target
  • Clean mime-db.json on dotnet clean
  • Copy generated file to source dir for IDE IntelliSense support (I at least needed this in vscode on MacOS)
  • Update renovate.json to track MimeDbVersion in csproj
  • Simplify tests to verify expected mime types instead of duplicating parser logic

This should make contributions easier so folks don't have to deal with the weird t4 syntax and formatting issues.

@zone117x zone117x requested a review from viceice January 20, 2026 21:36
@github-actions
Copy link

Generated Code Diff

No changes to generated KnownMimeTypes.cs file.

@zone117x zone117x force-pushed the refactor/t4-to-source-generator branch from e7c53fd to 27ea03c Compare January 20, 2026 21:48
@zone117x zone117x force-pushed the refactor/t4-to-source-generator branch from 27ea03c to 043c175 Compare January 20, 2026 21:49
@@ -1,4 +1,4 @@


Copy link
Collaborator

Choose a reason for hiding this comment

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

we should convert this to slnx in a follow up for simpler maintenance

@zone117x zone117x mentioned this pull request Jan 21, 2026
@zone117x zone117x merged commit 84df485 into master Jan 21, 2026
7 checks passed
@zone117x zone117x deleted the refactor/t4-to-source-generator branch January 21, 2026 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants