-
Notifications
You must be signed in to change notification settings - Fork 0
V1.0.0/initial #1
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
Changes from all commits
a5bdf17
b33a1e5
0eaecf6
855bf89
5100d67
61f68d2
750c792
2050ab3
78120d6
0e30618
e716719
73bb25c
d635bad
b6edb23
78b3093
bff5cca
01dde5f
a4d901f
de31691
656344e
d3a02ba
bb30db4
0b273fe
80ddf47
b37514d
1dc9444
a1fe5d1
04a271a
fe63839
7e405e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| $version = minver -i -t v -v w | ||
| docfx metadata docfx.json | ||
| docker buildx build -t carter-docfx:$version --platform linux/arm64,linux/amd64 --load -f Dockerfile.docfx . | ||
| get-childItem -recurse -path api -include *.yml, .manifest | remove-item | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| ARG NGINX_VERSION=1.29.5-alpine | ||
|
|
||
| FROM --platform=$BUILDPLATFORM nginx:${NGINX_VERSION} AS base | ||
| RUN rm -rf /usr/share/nginx/html/* | ||
|
|
||
| FROM --platform=$BUILDPLATFORM codebeltnet/docfx:2.78.5 AS build | ||
|
|
||
| ADD [".", "docfx"] | ||
|
|
||
| RUN cd docfx; \ | ||
| docfx build | ||
|
|
||
| FROM nginx:${NGINX_VERSION} AS final | ||
| WORKDIR /usr/share/nginx/html | ||
| COPY --from=build /build/docfx/wwwroot /usr/share/nginx/html | ||
|
|
||
| ENTRYPOINT ["nginx", "-g", "daemon off;"] |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,3 @@ | ||||||||||||||||||||||||||||||
| $version = minver -i -t v -v w | ||||||||||||||||||||||||||||||
| docker tag carter-docfx:$version jcr.codebelt.net/geekle/carter-docfx:$version | ||||||||||||||||||||||||||||||
| docker push jcr.codebelt.net/geekle/carter-docfx:$version | ||||||||||||||||||||||||||||||
|
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # Verify the current state of the PowerShell script
rg -n "ErrorActionPreference|Set-StrictMode|Get-Command minver|IsNullOrWhiteSpace|throw" .docfx/PublishDocfxImage.ps1 || echo "No guard patterns found"Repository: codebeltnet/carter Length of output: 85 🏁 Script executed: # Also read the full file to understand its current state
cat -n .docfx/PublishDocfxImage.ps1Repository: codebeltnet/carter Length of output: 252 Add fail-fast and version validation before tagging and pushing. The script lacks error handling: if 🛠️ Proposed hardening+$ErrorActionPreference = 'Stop'
+Set-StrictMode -Version Latest
+
+$minver = Get-Command minver -ErrorAction SilentlyContinue
+if (-not $minver) { throw "minver CLI is required but was not found in PATH." }
+
$version = minver -i -t v -v w
+if ([string]::IsNullOrWhiteSpace($version)) { throw "Resolved version is empty." }
+
docker tag carter-docfx:$version jcr.codebelt.net/geekle/carter-docfx:$version
docker push jcr.codebelt.net/geekle/carter-docfx:$version📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| uid: Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json | ||
| summary: *content | ||
| --- | ||
| The `Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json` namespace contains types that provide JSON response negotiation for Carter, capable of serializing response models to JSON format using `Newtonsoft.Json`. | ||
|
|
||
| [!INCLUDE [availability-modern](../../includes/availability-modern.md)] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| uid: Codebelt.Extensions.Carter.AspNetCore.Text.Json | ||
| summary: *content | ||
| --- | ||
| The `Codebelt.Extensions.Carter.AspNetCore.Text.Json` namespace contains types that provide JSON response negotiation for Carter, capable of serializing response models to JSON format using `System.Text.Json`. | ||
|
|
||
| [!INCLUDE [availability-modern](../../includes/availability-modern.md)] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| uid: Codebelt.Extensions.Carter.AspNetCore.Text.Yaml | ||
| summary: *content | ||
| --- | ||
| The `Codebelt.Extensions.Carter.AspNetCore.Text.Yaml` namespace contains types that provide YAML response negotiation for Carter, capable of serializing response models to YAML format using `YamlDotNet`. | ||
|
|
||
| [!INCLUDE [availability-modern](../../includes/availability-modern.md)] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| uid: Codebelt.Extensions.Carter.AspNetCore.Xml | ||
| summary: *content | ||
| --- | ||
| The `Codebelt.Extensions.Carter.AspNetCore.Xml` namespace contains types that provide XML response negotiation for Carter, capable of serializing response models to XML format using `System.Xml.XmlWriter`. | ||
|
|
||
| [!INCLUDE [availability-modern](../../includes/availability-modern.md)] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --- | ||
| uid: Codebelt.Extensions.Carter | ||
| summary: *content | ||
| --- | ||
| The Codebelt.Extensions.Carter namespace contains types and extension methods that complements the Carter namespace by providing configurable response negotiation, endpoint convention builder extensions and content negotiation for ASP.NET Core minimal APIs. | ||
|
|
||
| [!INCLUDE [availability-modern](../../includes/availability-modern.md)] | ||
|
|
||
| ### Extension Methods | ||
|
|
||
| |Type|Ext|Methods| | ||
| |--:|:-:|---| | ||
| |IEndpointConventionBuilder|⬇️|`Produces<TResponse>`, `Produces`| |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| { | ||
| "metadata": [ | ||
| { | ||
| "src": [ | ||
| { | ||
| "files": [ | ||
| "Codebelt.Extensions.Carter/**.csproj", | ||
| "Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json/**.csproj", | ||
| "Codebelt.Extensions.Carter.AspNetCore.Text.Json/**.csproj", | ||
| "Codebelt.Extensions.Carter.AspNetCore.Text.Yaml/**.csproj", | ||
| "Codebelt.Extensions.Carter.AspNetCore.Xml/**.csproj" | ||
| ], | ||
| "src": "../src" | ||
| } | ||
| ], | ||
| "dest": "api", | ||
| "filter": "filterConfig.yml", | ||
| "properties": { | ||
| "TargetFramework": "net10.0" | ||
| } | ||
| } | ||
| ], | ||
| "build": { | ||
| "xref": [ | ||
| "https://docs.cuemon.net/xrefmap.yml?v=20260120", | ||
| "https://newtonsoft.codebelt.net/xrefmap.yml", | ||
| "https://yamldotnet.codebelt.net/xrefmap.yml", | ||
| "https://github.com/dotnet/docfx/raw/main/.xrefmap.json" | ||
| ], | ||
| "content": [ | ||
| { | ||
| "files": [ | ||
| "api/**/*.yml", | ||
| "api/**/*.md", | ||
| "packages/**/*.md", | ||
| "toc.yml", | ||
| "*.md" | ||
| ], | ||
| "exclude": [ | ||
| "bin/**", | ||
| "obj/**" | ||
| ] | ||
| } | ||
| ], | ||
| "resource": [ | ||
| { | ||
| "files": [ | ||
| "images/**" | ||
| ] | ||
| } | ||
| ], | ||
| "globalMetadata": { | ||
| "_appTitle": "Extensions for Carter by Codebelt", | ||
| "_appFooter": "<span>Generated by <strong>DocFX</strong>. Copyright 2026 Geekle. All rights reserved.</span>", | ||
| "_appLogoPath": "images/50x50.png", | ||
| "_appFaviconPath": "images/favicon.ico", | ||
| "_googleAnalyticsTagId": "G-GGL98GEYWE", | ||
| "_enableSearch": false, | ||
| "_disableContribution": false, | ||
| "_gitContribute": { | ||
| "repo": "https://github.com/codebeltnet/carter", | ||
| "branch": "main" | ||
| }, | ||
| "_gitUrlPattern": "github" | ||
| }, | ||
| "dest": "wwwroot", | ||
| "globalMetadataFiles": [], | ||
| "fileMetadataFiles": [], | ||
| "template": [ | ||
| "default", | ||
| "modern" | ||
| ], | ||
| "overwrite": [ | ||
| { | ||
| "files": [ | ||
| "api/namespaces/**.md" | ||
| ], | ||
| "exclude": [ | ||
| "obj/**", | ||
| "wwwroot/**" | ||
| ] | ||
| } | ||
| ], | ||
| "postProcessors": [], | ||
| "markdownEngineName": "markdig", | ||
| "noLangKeyword": false, | ||
| "keepFileLink": false, | ||
| "cleanupCacheHistory": false, | ||
| "disableGitFeatures": false | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| apiRules: | ||
| - exclude: | ||
| uidRegex: ^System\.Object | ||
| type: Type |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Availability: .NET 10 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| uid: frontpage-md | ||
| title: Extensions for Carter by Codebelt | ||
| --- | ||
|  | ||
|
|
||
| # Extensions for Carter by Codebelt | ||
|
|
||
| This project is part of [Extensions for Carter by Codebelt](https://github.com/codebeltnet/carter). | ||
|
|
||
| Proceed to the [docs](/api/Codebelt.Extensions.Carter.html) to learn more about the capabilities of this project. | ||
gimlichael marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| - name: Carter API | ||
| href: api/Codebelt.Extensions.Carter.html | ||
| - name: NuGet | ||
| href: packages |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,193 @@ | ||
| root = true | ||
|
|
||
| [*] | ||
| charset = utf-8 | ||
| end_of_line = lf | ||
| insert_final_newline = true | ||
| trim_trailing_whitespace = true | ||
|
|
||
| # Default: prefer spaces for data/markup | ||
| indent_style = space | ||
| indent_size = 2 | ||
| tab_width = 2 | ||
|
|
||
| # This style rule concern the use of the range operator, which is available in C# 8.0 and later. | ||
| # https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0057 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.IDE0057.severity = none | ||
|
|
||
| # This style rule concerns the use of switch expressions versus switch statements. | ||
| # https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0066 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.IDE0066.severity = none | ||
|
|
||
| # Performance rules | ||
| # https://docs.microsoft.com/da-dk/dotnet/fundamentals/code-analysis/quality-rules/performance-warnings | ||
| [*.{cs,vb}] | ||
| dotnet_analyzer_diagnostic.category-Performance.severity = none # Because many of the suggestions by performance analyzers are not compatible with .NET Standard 2.0 | ||
|
|
||
|
Comment on lines
+24
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cat -n .editorconfigRepository: codebeltnet/carter Length of output: 9405 Narrow broad performance suppression scope. Line 27 disables the entire Performance category for all C#/VB files, which suppresses useful findings on modern TFMs. Remove this broad suppression and keep only the specific rules already listed below that are genuinely unsupported for .NET Standard 2.0: CA1846, CA1847, CA1865–CA1867, CA2249, and CA2263 (lines 135–165). 🤖 Prompt for AI Agents |
||
| # This style rule concerns the use of using statements without curly braces, also known as using declarations. This alternative syntax was introduced in C# 8.0. | ||
| # https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0063 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.IDE0063.severity = none | ||
|
|
||
| # This style rule concerns with simplification of interpolated strings to improve code readability. It recommends removal of certain explicit method calls, such as ToString(), when the same method would be implicitly invoked by the compiler if the explicit method call is removed. | ||
| # https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0071 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.IDE0071.severity = none | ||
|
|
||
| # S3267: Loops should be simplified with "LINQ" expressions | ||
| # https://rules.sonarsource.com/csharp/RSPEC-3267 | ||
| dotnet_diagnostic.S3267.severity = none | ||
|
|
||
| # CA1859: Use concrete types when possible for improved performance | ||
| # This is a violation of Framework Design Guidelines. | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1859 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.CA1859.severity = none | ||
|
|
||
| # IDE0008: Use explicit type | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0007-ide0008 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.IDE0008.severity = none | ||
|
|
||
| [*.{cs,vb}] | ||
| indent_style = space | ||
| indent_size = 4 | ||
|
|
||
| # IDE0161: Namespace declaration preferences | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0161 | ||
| # Prefer file-scoped namespaces for new files; existing block-scoped files should not be converted unless explicitly asked | ||
| [*.cs] | ||
| csharp_style_namespace_declarations = file_scoped:suggestion | ||
|
|
||
| # Top-level statements: DO NOT USE | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0210-ide0211 | ||
| # This is enforced via a style preference set to error severity, not a language-level prohibition. | ||
| # Always use explicit class declarations with a proper namespace and Main method where applicable. | ||
| [*.cs] | ||
| csharp_style_prefer_top_level_statements = false:error | ||
|
|
||
| [*.xml] | ||
| indent_style = space | ||
| indent_size = 2 | ||
|
|
||
| # IDE0078: Use pattern matching | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0078 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.IDE0078.severity = none | ||
|
|
||
| # IDE0290: Use primary constructor | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0290 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.IDE0290.severity = none | ||
|
|
||
| # CA1200: Avoid using cref tags with a prefix | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1200 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.CA1200.severity = none | ||
|
|
||
| # IDE0305: Use collection expression for fluent | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0305 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.IDE0305.severity = none | ||
|
|
||
| # IDE0011: Add braces | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0011 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.IDE0011.severity = none | ||
|
|
||
| # IDE0028: Use collection initializers or expressions | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0028 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.IDE0028.severity = none | ||
|
|
||
| # IDE0039: Use collection expression for array | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0300 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.IDE0300.severity = none | ||
|
|
||
| # IDE0031: Use collection expression for empty | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0301 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.IDE0301.severity = none | ||
|
|
||
| # IDE0046: Use conditional expression for return | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0046 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.IDE0046.severity = none | ||
|
|
||
| # IDE0047: Parentheses preferences | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0047-ide0048 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.IDE0047.severity = none | ||
|
|
||
| # CA1716: Identifiers should not match keywords | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1716 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.CA1716.severity = none | ||
|
|
||
| # CA1720: Identifiers should not contain type names | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1720 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.CA1720.severity = none | ||
|
|
||
| # CA1846: Prefer AsSpan over Substring | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1846 | ||
| # Excluded while TFMs include netstandard2.0 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.CA1846.severity = none | ||
|
|
||
| # CA1847: Use String.Contains(char) instead of String.Contains(string) with single characters | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1847 | ||
| # Excluded while TFMs include netstandard2.0 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.CA1847.severity = none | ||
|
|
||
| # CA1865-CA1867: Use 'string.Method(char)' instead of 'string.Method(string)' for string with single char | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1865-ca1867 | ||
| # Excluded while TFMs include netstandard2.0 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.CA1865.severity = none | ||
| dotnet_diagnostic.CA1866.severity = none | ||
| dotnet_diagnostic.CA1867.severity = none | ||
|
|
||
| # CA2263: Prefer generic overload when type is known | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2263 | ||
| # Excluded while TFMs include netstandard2.0 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.CA2263.severity = none | ||
|
|
||
| # CA2249: Consider using String.Contains instead of String.IndexOf | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2249 | ||
| # Excluded while TFMs include netstandard2.0 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.CA2249.severity = none | ||
|
|
||
| # IDE0022: Use expression body for methods | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0022 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.IDE0022.severity = none | ||
|
|
||
| # IDE0032: Use auto-property | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0032 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.IDE0032.severity = none | ||
|
|
||
| # Order modifiers | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0036 | ||
| # Excluded becuase of inconsistency with other analyzers | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.IDE0036.severity = none | ||
|
|
||
| # Order modifiers | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0036 | ||
| # Excluded becuase of inconsistency with other analyzers | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.IDE0036.severity = none | ||
|
|
||
| # Use 'System.Threading.Lock' | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0330 | ||
| # Excluded while TFMs are less than net9.0 | ||
| [*.{cs,vb}] | ||
| dotnet_diagnostic.IDE0330.severity = none | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--loadincompatible with multi-platform builds.The
--loadflag loads the built image into the local Docker daemon, but this only works for single-platform images. When building for multiple platforms (linux/arm64,linux/amd64), Docker cannot load multi-arch images locally. The build will either fail or only load one platform.Consider either:
--pushto push multi-platform images to a registryProposed fix for local development (single platform)
Or for multi-platform with registry push:
📝 Committable suggestion
🤖 Prompt for AI Agents