Draft: GeneralUpdate.Extension component documentation#60
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
c185396 to
57b32bd
Compare
There was a problem hiding this comment.
Pull request overview
This PR rewrites the GeneralUpdate.Extension component documentation (site default + EN + zh-Hans i18n) to reflect the latest Extension APIs and to provide a clearer end-to-end narrative: querying, downloading, installing/updating, rollback/uninstall, metadata/manifest, packaging responsibilities (Tools/CI vs consumer), and server API contracts.
Changes:
- Replaces the previous long-form reference-style doc with a structured, workflow-oriented component guide (quick start → core workflow → metadata/manifest → packaging → compatibility/deps → events/auto-update → server contract → extensibility → best practices).
- Updates code snippets and terminology (DTOs, response shape, host options, lifecycle hooks, queue, etc.) to match the described current API surface.
- Applies the same rewrite consistently across
website/docsand both i18n copies (EN + zh-Hans).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| website/docs/doc/GeneralUpdate.Extension.md | Main site doc rewrite for GeneralUpdate.Extension (Chinese) with new structure and API contract sections |
| website/i18n/en/docusaurus-plugin-content-docs/current/doc/GeneralUpdate.Extension.md | English i18n version of the rewritten Extension component documentation |
| website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/doc/GeneralUpdate.Extension.md | zh-Hans i18n version of the rewritten Extension component documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| | `Token` | Authorization token。需要和 `Scheme` 同时非空才会生效 | | ||
| | `HostVersion` | 宿主应用版本,用于 `MinHostVersion` / `MaxHostVersion` 兼容性判断 | | ||
| | `ExtensionsDirectory` | 扩展包下载、安装和 `.backup` 目录所在位置 | | ||
| | `CatalogPath` | 可选,本地扩展目录扫描路径;为空时使用 `ExtensionsDirectory` | |
Comment on lines
+289
to
293
| 本地安装 catalog 不再是单个 `catalog.json`。当前实现会扫描 `CatalogPath` 下的子目录,并读取每个扩展目录中的: | ||
|
|
||
| ```c# | ||
| var extension = new ExtensionMetadata | ||
| { | ||
| Id = "550e8400-e29b-41d4-a716-446655440001", | ||
| Name = "my-extension", | ||
| DisplayName = "My Extension", | ||
| Version = "1.0.0", | ||
| // 依赖两个其他扩展 | ||
| Dependencies = "550e8400-e29b-41d4-a716-446655440002,550e8400-e29b-41d4-a716-446655440003" | ||
| }; | ||
| ```text | ||
| manifest.json | ||
| ``` |
|
|
||
| // 禁用自动更新 | ||
| host.SetAutoUpdate(extensionId, false); | ||
| 推荐 ZIP 内容: |
| | `Token` | Authorization token. It is only used when both `Scheme` and `Token` are non-empty | | ||
| | `HostVersion` | Host application version used by `MinHostVersion` / `MaxHostVersion` checks | | ||
| | `ExtensionsDirectory` | Directory for downloaded packages, installed extensions, and `.backup` | | ||
| | `CatalogPath` | Optional local catalog scan path. Defaults to `ExtensionsDirectory` | |
Comment on lines
+289
to
293
| The local catalog is not a single `catalog.json`. Current code scans child directories under `CatalogPath` and reads each extension's: | ||
|
|
||
| ```c# | ||
| var extension = new ExtensionMetadata | ||
| { | ||
| Id = "550e8400-e29b-41d4-a716-446655440001", | ||
| Name = "my-extension", | ||
| DisplayName = "My Extension", | ||
| Version = "1.0.0", | ||
| // Depends on two other extensions | ||
| Dependencies = "550e8400-e29b-41d4-a716-446655440002,550e8400-e29b-41d4-a716-446655440003" | ||
| }; | ||
| ```text | ||
| manifest.json | ||
| ``` |
|
|
||
| // Disable auto-update | ||
| host.SetAutoUpdate(extensionId, false); | ||
| Recommended ZIP contents: |
| | `Token` | Authorization token。需要和 `Scheme` 同时非空才会生效 | | ||
| | `HostVersion` | 宿主应用版本,用于 `MinHostVersion` / `MaxHostVersion` 兼容性判断 | | ||
| | `ExtensionsDirectory` | 扩展包下载、安装和 `.backup` 目录所在位置 | | ||
| | `CatalogPath` | 可选,本地扩展目录扫描路径;为空时使用 `ExtensionsDirectory` | |
Comment on lines
+289
to
293
| 本地安装 catalog 不再是单个 `catalog.json`。当前实现会扫描 `CatalogPath` 下的子目录,并读取每个扩展目录中的: | ||
|
|
||
| ```c# | ||
| var extension = new ExtensionMetadata | ||
| { | ||
| Id = "550e8400-e29b-41d4-a716-446655440001", | ||
| Name = "my-extension", | ||
| DisplayName = "My Extension", | ||
| Version = "1.0.0", | ||
| // 依赖两个其他扩展 | ||
| Dependencies = "550e8400-e29b-41d4-a716-446655440002,550e8400-e29b-41d4-a716-446655440003" | ||
| }; | ||
| ```text | ||
| manifest.json | ||
| ``` |
|
|
||
| // 禁用自动更新 | ||
| host.SetAutoUpdate(extensionId, false); | ||
| 推荐 ZIP 内容: |
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.
Parent: #45
Closes #51
Summary
Validation