@linkdesk/contracts 0.1.13 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +14 -14
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,35 +1,35 @@
1
1
  # @linkdesk/contracts
2
2
 
3
- LinkDesk 插件契约类型——`window.linkdesk.*` 全量类型定义。
3
+ The LinkDesk plugin contract types — the complete type definitions for `window.linkdesk.*`.
4
4
 
5
- > 本包由 LinkDesk 壳的**契约生成器**(`scripts/generate-contract.mjs`)从 `src/core/api/linkdesk-api.ts` 自动生成,**唯一**类型真相源。第三方插件作者用它拿到与壳完全同步的 API 类型——漂移即编译错误。
5
+ > This package is generated automatically by the LinkDesk shell's **contract generator** (`scripts/generate-contract.mjs`) from `src/core/api/linkdesk-api.ts`, and is the **single** source of truth for types. Third-party plugin authors use it to get API types that are perfectly in sync with the shell — drift means a compile error.
6
6
 
7
- ## 安装
7
+ ## Installation
8
8
 
9
9
  ```bash
10
10
  npm install -D @linkdesk/contracts
11
11
  ```
12
12
 
13
- ## 使用
13
+ ## Usage
14
14
 
15
- 包只含类型(`linkdesk.d.ts`,`types` 入口直指它),零运行时。装完后:
15
+ The package contains types only (`linkdesk.d.ts`, with the `types` entry pointing straight at it) and has zero runtime. Once installed:
16
16
 
17
17
  ```ts
18
18
  import type { LinkDeskAPI } from "@linkdesk/contracts";
19
19
 
20
- // window.linkdesk 自动有类型(声明内置 global Window 接口),无需额外 global.d.ts
21
- window.linkdesk.configuration.get("editor.fontSize"); // 智能提示 + 类型检查
20
+ // window.linkdesk is typed automatically (the built-in global Window interface is declared); no extra global.d.ts needed
21
+ window.linkdesk.configuration.get("editor.fontSize"); // IntelliSense + type checking
22
22
  ```
23
23
 
24
- - **纯类型**:不含 `getLinkDesk`/`linkdesk` 值导出——运行时走 `window.linkdesk`(preload 注入)。
25
- - **自包含**:无任何 `@src/core` 依赖,拷一个 d.ts 进项目即完整类型。
26
- - **版本轴独立(2026-09-06 拆焊,反向 E5.8#22.6)**:包版本不再随壳——壳升级 ≠ 契约升级(软件升级是用户轴,与本包无关)。只有当 `window.linkdesk.*` API 面变了、作者要拿新类型时才升版发布。**内容仍与壳源码逐字节同步**(生成器比对,漂移即 `contracts:check` 红)——类型永远描述当前壳,只是版本号不绑壳。`npm update @linkdesk/contracts` 在版本升后拿新类型。
24
+ - **Types only**: no `getLinkDesk`/`linkdesk` value exports — at runtime you go through `window.linkdesk` (injected by the preload).
25
+ - **Self-contained**: no `@src/core` dependency whatsoever; drop a single d.ts into your project for the complete types.
26
+ - **Independent version axis (decoupled on 2026-09-06)**: the package version no longer follows the shell — a shell upgrade is not a contract upgrade (app upgrades are a user-facing axis and unrelated to this package). A new version is published only when the `window.linkdesk.*` API surface changes and authors need the new types. **The content is still byte-for-byte in sync with the shell source** (compared by the generator; drift turns `contracts:check` red) — the types always describe the current shell, only the version number is not tied to it. Run `npm update @linkdesk/contracts` after a version bump to pick up the new types.
27
27
 
28
- ## 与仓库产物双轨
28
+ ## Two tracks alongside the repository artifact
29
29
 
30
- - **推荐**:`npm i -D @linkdesk/contracts`(真实发布链,类型随版本走)
31
- - **备选**:从 LinkDesk 仓库 `contracts/linkdesk.d.ts` 拷贝(无 npm 环境时兜底)
30
+ - **Recommended**: `npm i -D @linkdesk/contracts` (the real publication chain; types follow the version)
31
+ - **Alternative**: copy `contracts/linkdesk.d.ts` from the LinkDesk repository (a fallback when there is no npm environment)
32
32
 
33
- ## 协议
33
+ ## License
34
34
 
35
35
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linkdesk/contracts",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "LinkDesk 插件契约类型——window.linkdesk.* 全量类型定义(E5.8 契约生成产物)。第三方插件作者唯一合法类型消费路径。",
5
5
  "type": "module",
6
6
  "types": "./linkdesk.d.ts",