docs: update Core & Differential docs and sync i18n across all locales#87
Merged
Merged
Conversation
- Expand SetSource signature to include all 9 parameters (authScheme, basicUsername, basicPassword, installPath) - Add AuthScheme, BasicUsername, BasicPassword fields to UpdateRequest config table - Add SetAuthScheme, SetBasicUsername, SetBasicPassword methods to UpdateRequestBuilder - Update BrotliCompressionProvider description to reflect conditional compilation implementation - Sync all changes to English (i18n/en) and Chinese (i18n/zh-Hans) translations - Replace outdated zh-Hans i18n overrides with current structured API reference format Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
6 tasks
There was a problem hiding this comment.
Pull request overview
This PR updates the GeneralUpdate documentation for Core and Differential, and syncs those updates across the Docusaurus i18n layers (zh-Hans + en) to keep API references aligned.
Changes:
- Updated Core docs to reflect the expanded
SetSource(...)signature and new auth-related fields/methods in the API tables. - Updated Differential docs to clarify Brotli support as conditionally compiled (
#if NET6_0_OR_GREATER) rather than a placeholder. - Replaced/reshaped zh-Hans i18n docs into the same structured API reference format as
website/docs/doc/.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| website/docs/doc/GeneralUpdate.Core.md | Updated SetSource(...) signature docs + added builder methods to match new auth parameters. |
| website/docs/doc/GeneralUpdate.Differential.md | Clarified Brotli availability wording in the canonical Differential docs. |
| website/i18n/en/docusaurus-plugin-content-docs/current/doc/GeneralUpdate.Core.md | Synced EN API tables for Core (noted: AuthScheme row needs alignment with canonical docs). |
| website/i18n/en/docusaurus-plugin-content-docs/current/doc/GeneralUpdate.Differential.md | Synced EN wording for Brotli conditional compilation. |
| website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/doc/GeneralUpdate.Core.md | Replaced zh-Hans i18n Core doc with structured reference format and expanded sections/examples. |
| website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/doc/GeneralUpdate.Differential.md | Replaced zh-Hans i18n Differential doc with structured reference format and updated Brotli description. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
99
to
+105
| | `UpdatePath` | `string` | `InstallPath` | Optional | Valid directory path | Upgrade process location | | ||
| | `Bowl` | `string` | `null` | Optional | Valid filename | Auxiliary process name to close before update | | ||
| | `Scheme` | `string` | `null` | Optional | `"Bearer"` etc. | Auth scheme | | ||
| | `Scheme` | `string` | `null` | Optional | `"Bearer"` etc. | Auth scheme (used with `Token`) | | ||
| | `Token` | `string` | `null` | Optional | — | Auth token | | ||
| | `AuthScheme` | `AuthScheme` | `Hmac` | Optional | `Hmac`, `Bearer`, `Basic` | Auth scheme enum; `Hmac` for GeneralSpacestation server-side signed auth | | ||
| | `BasicUsername` | `string` | `null` | Optional | — | HTTP Basic auth username (requires `AuthScheme = Basic`) | | ||
| | `BasicPassword` | `string` | `null` | Optional | — | HTTP Basic auth password (requires `AuthScheme = Basic`) | |
Comment on lines
+860
to
+864
| { | ||
| request.Headers.Authorization = | ||
| new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", "access-token"); | ||
|
|
||
| return Task.CompletedTask; | ||
| } | ||
| } | ||
|
|
||
| await new GeneralUpdateBootstrap() | ||
| .SetConfig(request) | ||
| .HttpAuth<StaticBearerAuthProvider>() | ||
| .LaunchAsync(); | ||
| ``` | ||
|
|
||
| Core 内置的认证类型包括 `NoOpAuthProvider`、`BearerTokenAuthProvider`、`ApiKeyAuthProvider` 和 `HmacAuthProvider`。这些类型中部分构造函数需要参数,因此如果要通过 `HttpAuth<T>()` 注册,通常需要写一个无参包装类。 | ||
|
|
||
| ## HTTPS 证书策略:ISslValidationPolicy | ||
|
|
||
| `ISslValidationPolicy` 用于控制 HTTPS 证书校验。默认 `StrictSslValidationPolicy` 只接受没有 SSL policy errors 的证书。 | ||
|
|
||
| ```csharp | ||
| using System.Net.Security; | ||
| using System.Security.Cryptography.X509Certificates; | ||
| using GeneralUpdate.Core.Security; | ||
|
|
||
| public sealed class DevelopmentSslPolicy : ISslValidationPolicy | ||
| { | ||
| public bool ValidateCertificate( | ||
| X509Certificate2? certificate, | ||
| X509Chain? chain, | ||
| SslPolicyErrors sslPolicyErrors) | ||
| if (e.Info?.Code == "404") | ||
| { | ||
| Console.WriteLine("Already up to date."); | ||
| return; |
Comment on lines
+243
to
+246
| // 验证还原结果 | ||
| var newHash = ComputeSha256(newFile); | ||
| var outputHash = ComputeSha256(outputFile); | ||
| Console.WriteLine(newHash == outputHash ? "Patch verified." : "MISMATCH!"); |
The zh-Hans locale is the default locale in Docusaurus config, so docs/doc/ serves zh-Hans content directly. The i18n/zh-Hans/ overrides are unnecessary and were causing MDX compilation errors during website build. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…error The <br> HTML tags inside markdown table cells were being interpreted as JSX elements by the MDX parser (mdast-util-mdx-jsx), causing the Docusaurus website build to fail. Replaced with comma-separated format. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Docusaurus resolves internal doc links without the .md extension. Links with .md suffix break when the target document's i18n override is removed (Docusaurus falls back to docs/ but can't match the .md suffix). This was pre-existing but masked by zh-Hans i18n overrides for Core and Differential docs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates the GeneralUpdate.Core and GeneralUpdate.Differential component documentation and synchronizes changes across all three locale layers (zh-Hans default, en, zh-Hans i18n override).
Changes
GeneralUpdate.Core
SetSourcesignature expanded — documented all 9 parameters including newauthScheme,basicUsername,basicPassword,installPathUpdateRequesttable — addedAuthScheme,BasicUsername,BasicPasswordfieldsUpdateRequestBuildertable — addedSetAuthScheme,SetBasicUsername,SetBasicPasswordmethods; removed duplicateSetInstallPathGeneralUpdate.Differential
#if NET6_0_OR_GREATERi18n Sync
i18n/en/— updated English translations to reflect all API changesi18n/zh-Hans/— replaced outdated narrative-style knowledge-map documents with the current structured API reference format, matchingdocs/doc/Files Changed
docs/doc/GeneralUpdate.Core.mddocs/doc/GeneralUpdate.Differential.mdi18n/en/.../doc/GeneralUpdate.Core.mdi18n/en/.../doc/GeneralUpdate.Differential.mdi18n/zh-Hans/.../doc/GeneralUpdate.Core.mdi18n/zh-Hans/.../doc/GeneralUpdate.Differential.md🤖 Generated with Claude Code