Files
LanMountainDesktop/LanMountainDesktop.PluginTemplate/README.md
lincube fc4d0c4cd8 Support .laapp/plugin.json and improve market models
Add support for the new plugin package contract (.laapp + plugin.json) while keeping backward compatibility with legacy .lmdp/manifest.json, and improve market metadata resolution and launcher handling.

Key changes:
- LanMountainDesktop.Launcher: PluginInstallerService now recognizes plugin.json and .laapp, preserves legacy manifest/package names, searches for manifests with a helper, and removes existing packages matching either extension.
- LanMountainDesktop.PluginTemplate: README updated to document .laapp, plugin.json, runtime contract and packaging expectations.
- Tests: New and extended tests for PluginInstallerService and a PluginMarketIndexDocumentTests covering nested index parsing and metadata enrichment.
- LauncherClient & PluginMarketInstallService: ResolveLauncherPath now probes multiple candidate locations (useful for dev and packaged layouts); LauncherClient also adjusted launcher arguments to use the updated CLI form.
- SettingsDomainServices: Added BuildCapabilities to safely build capability lists from entries (null checks, projection, de-dup via DistinctBy).
- AirAppMarketMetadataResolverService & PluginMarketModels: Prefer existing manifest/publication/compatibility values when enriching entries, add ApiVersion/Path fields, normalize compatibility logic and package source URL/path handling; handle Sha256/size/publication dates more robustly.
- Misc: Added localization spec/checklist/tasks under .trae for a localization fix initiative.

These changes enable the new plugin packaging format, improve robustness of market data enrichment, make launcher discovery more flexible for different environments, and add tests and docs to cover the new behaviors.
2026-04-30 00:02:52 +08:00

42 lines
1.1 KiB
Markdown

# LanMountainDesktop.PluginTemplate
Official `dotnet new` template package for LanMountainDesktop plugins.
## Baseline
- Target framework: `net10.0`
- Plugin SDK: `LanMountainDesktop.PluginSdk` `5.0.0`
- Manifest: `plugin.json`
- Package: `.laapp`
- Runtime mode: `in-proc`
## Install
```powershell
dotnet new install LanMountainDesktop.PluginTemplate
```
## Create a plugin
```powershell
dotnet new lmd-plugin -n YourPluginName
```
The generated project references `LanMountainDesktop.PluginSdk` and produces a `.laapp` package automatically when built.
## Package contract
Every plugin package must contain:
- `plugin.json`
- the entrance assembly declared by `entranceAssembly`
- the `.deps.json` next to the entrance assembly
Optional package content:
- `Localization/*.json`
- plugin assets and other managed dependencies
- `airappmarket-entry.template.json` in the repository root for market publishing
Market publishing uses `market-manifest.json` with `schemaVersion`, `manifest`, `compatibility`, `repository`, `publication.packageSources`, and `capabilities`.