fix(manifest): describe optional dependency declarations

This commit is contained in:
creatixchu committed 2026-10-19 21:39:38 +08:00
1 parent 6d0ba11d2b
commit ea016fa3dd
4 files changed
+6 -4

No files matched your search

@@ -15,8 +15,8 @@
en: d152484eb41ac6b4
zh: 1db86285abf6c499
/deepseek-ai-dsh-package-manifest/use-this-package:
en: f275964a8845888a
zh: b284e09aacea079b
en: 0f5e861b0c0c5ee2
zh: 766eaa36b794a22b
/deepseek-ai-dsh-package-manifest/understand-the-implementation:
en: 41ec449dee927f04
zh: ec1b583bd9025d84
+1 -1
View File
@@ -43,7 +43,7 @@ const manifest: DshPackageManifest = {
}
```
`DshPackageManifest` describes the package.json fields used by DSH, with required `name` and `version`; it is not an exhaustive npm schema. Local profile readers use `Partial<DshPackageManifest>` because profiles need no published version. `DshManifest` describes only public author fields under `dsh`. `DshBundleManifest.patch` is one patch file path or an ordered list of them, each relative to the package root; the launcher applies a list in order as one bundle layer. TypeScript checks the example and erases `import type`; these interfaces do not parse JSON or write a file.
`DshPackageManifest` describes the package.json fields used by DSH, with required `name` and `version`; it includes dependency, peer, and optional dependency declarations but is not an exhaustive npm schema. Local profile readers use `Partial<DshPackageManifest>` because profiles need no published version. `DshManifest` describes only public author fields under `dsh`. `DshBundleManifest.patch` is one patch file path or an ordered list of them, each relative to the package root; the launcher applies a list in order as one bundle layer. TypeScript checks the example and erases `import type`; these interfaces do not parse JSON or write a file.
The following metadata fields are optional. Omitting them leaves the format version or compatible host versions undeclared; readers do not infer defaults.
+1 -1
View File
@@ -43,7 +43,7 @@ const manifest: DshPackageManifest = {
}
```
`DshPackageManifest` 描述 DSH 使用的 package.json 字段,其中 `name` 和 `version` 必填;它不是完整的 npm schema(模式)。本地 profile 读取方使用 `Partial<DshPackageManifest>`,因为 profile 无需发布版本。`DshManifest` 仅描述 `dsh` 下的公共作者字段。`DshBundleManifest.patch` 是一个 patch 文件路径,或一个有序的路径列表,均相对于包根目录;launcher 按列表顺序把它们作为同一个组合包层应用。TypeScript 检查示例并删除 `import type`;这些接口不解析 JSON,也不写入文件。
`DshPackageManifest` 描述 DSH 使用的 package.json 字段,其中 `name` 和 `version` 必填;它包含普通依赖、peer 依赖及可选依赖声明,未覆盖 npm 的所有字段。本地 profile 读取方使用 `Partial<DshPackageManifest>`,因为 profile 无需发布版本。`DshManifest` 仅描述 `dsh` 下的公共作者字段。`DshBundleManifest.patch` 是一个 patch 文件路径,或一个有序的路径列表,均相对于包根目录;launcher 按列表顺序把它们作为同一个组合包层应用。TypeScript 检查示例并删除 `import type`;这些接口不解析 JSON,也不写入文件。
以下元数据字段均可选。省略时,格式版本或兼容的宿主版本保持未声明状态;读取方不推断默认值。
@@ -18,6 +18,8 @@ export interface DshPackageManifest {
private?: boolean
/** Packages installed alongside this package. */
dependencies?: Record<string, string>
/** Packages that may be absent when installation or platform checks skip them. */
optionalDependencies?: Record<string, string>
/** Compatible versions of packages supplied by the consuming project. */
peerDependencies?: Record<string, string>
/** Runtime requirements; DSH compatibility is declarative until a reader enforces it. */