Skip to content

docs: update Core & Differential docs and sync i18n across all locales#87

Merged
JusterZhu merged 4 commits into
mainfrom
docs/update-core-differential-docs-and-sync-i18n
Jun 4, 2026
Merged

docs: update Core & Differential docs and sync i18n across all locales#87
JusterZhu merged 4 commits into
mainfrom
docs/update-core-differential-docs-and-sync-i18n

Conversation

@JusterZhu

Copy link
Copy Markdown
Collaborator

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

  • SetSource signature expanded — documented all 9 parameters including new authScheme, basicUsername, basicPassword, installPath
  • UpdateRequest table — added AuthScheme, BasicUsername, BasicPassword fields
  • UpdateRequestBuilder table — added SetAuthScheme, SetBasicUsername, SetBasicPassword methods; removed duplicate SetInstallPath

GeneralUpdate.Differential

  • Brotli description — updated from "reserved placeholder" to accurately reflect the full conditional-compilation implementation behind #if NET6_0_OR_GREATER

i18n Sync

  • i18n/en/ — updated English translations to reflect all API changes
  • i18n/zh-Hans/ — replaced outdated narrative-style knowledge-map documents with the current structured API reference format, matching docs/doc/

Files Changed

File Change
docs/doc/GeneralUpdate.Core.md Updated API tables, resolved merge conflicts
docs/doc/GeneralUpdate.Differential.md Updated Brotli descriptions
i18n/en/.../doc/GeneralUpdate.Core.md Synced API changes to English
i18n/en/.../doc/GeneralUpdate.Differential.md Synced Brotli updates to English
i18n/zh-Hans/.../doc/GeneralUpdate.Core.md Replaced with current structured format
i18n/zh-Hans/.../doc/GeneralUpdate.Differential.md Replaced with current structured format

🤖 Generated with Claude Code

- 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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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!");
JusterZhu and others added 3 commits June 4, 2026 11:26
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>
@JusterZhu JusterZhu merged commit c9433dc into main Jun 4, 2026
2 checks passed
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.

docs: 更新 GeneralUpdate.Core 和 GeneralUpdate.Differential 文档并同步多语言

2 participants