@linkdesk/plugin-sdk 0.1.74 → 0.1.76

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.
package/README.md CHANGED
@@ -18,7 +18,7 @@ npm install -D @linkdesk/plugin-sdk
18
18
  > 自动生成,**勿手改**——由 `scripts/generate-api-cheatsheet.mjs` 从 `@linkdesk/contracts` 的 `linkdesk.d.ts` 现读产出,
19
19
  > `npm run check` 机械盯漂。完整签名与逐方法说明见 `linkdesk.d.ts` 本体(IDE 里可直接跳转)。
20
20
 
21
- **16 个域接口 → 47 个命名空间 / 256 个方法**,全部经 `window.linkdesk.<命名空间>.<方法>` 调用。 (plus 1 deprecated alias/es `config`, not counted twice)
21
+ **16 个域接口 → 47 个命名空间 / 258 个方法**,全部经 `window.linkdesk.<命名空间>.<方法>` 调用。 (plus 1 deprecated alias/es `config`, not counted twice)
22
22
 
23
23
  | Namespace | Methods | Method | Notes |
24
24
  |:--|:--:|:--|:--|
@@ -51,7 +51,7 @@ npm install -D @linkdesk/plugin-sdk
51
51
  | `search` | 1 | `searchFiles` | 文件搜索——全文搜索/替换(IPC 到壳/主进程执行) |
52
52
  | `encoding` | 4 | `detect` `decode` `encode` `isBinary` | 编码检测/转换(主进程 EncodingService) |
53
53
  | `decorations` | 4 | `registerProvider` `unregisterProvider` `getDecoration` `onDidChange` | 文件装饰——池内本地注册表(零 IPC) |
54
- | `fileAssociation` | 1 | `getPluginFor` | 文件关联——扩展名→插件 ID(主进程 FileAssociationService 直答) |
54
+ | `fileAssociation` | 3 | `getPluginFor` `listHandlersFor` `setDefault` | 文件关联——扩展名→插件 ID(主进程 FileAssociationService 直答) |
55
55
  | `langDef` | 1 | `get` | langDef——语言定义注册表(主进程直答) |
56
56
  | `lsp` | 4 | `spawn` `write` `dispose` `onData` | LSP 桥——自动补全/F12/诊断/重命名 |
57
57
  | `protocol` | 3 | `listProtocols` `getActiveProtocolId` `setActiveProtocolId` | protocol——协议注册表(主进程直答) |
@@ -240,6 +240,8 @@ export const linkdeskMock: Record<string, unknown> = {
240
240
  },
241
241
  fileAssociation: {
242
242
  getPluginFor: async (..._args: unknown[]) => { console.info("[linkdesk-mock] fileAssociation.getPluginFor", ..._args); },
243
+ listHandlersFor: async (..._args: unknown[]) => { console.info("[linkdesk-mock] fileAssociation.listHandlersFor", ..._args); return []; },
244
+ setDefault: async (..._args: unknown[]) => { console.info("[linkdesk-mock] fileAssociation.setDefault", ..._args); },
243
245
  },
244
246
  langDef: {
245
247
  get: async (..._args: unknown[]) => { console.info("[linkdesk-mock] langDef.get", ..._args); },
package/package.json CHANGED
@@ -1,97 +1,97 @@
1
- {
2
- "name": "@linkdesk/plugin-sdk",
3
- "version": "0.1.74",
4
- "description": "@linkdesk/plugin-sdk——LinkDesk 插件作者 SDK(对标 @types/vscode):window.linkdesk.* 类型 + 一键 build(.linkdesk-plugin) + dev 宿主 + plugin.json 验证 + eslint 门禁(E6#54d)。作者 npm i 后零壳源码依赖。",
5
- "type": "module",
6
- "main": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./dist/index.d.ts",
11
- "default": "./dist/index.js"
12
- },
13
- "./eslint": {
14
- "types": "./dist/eslint/index.d.ts",
15
- "default": "./dist/eslint/index.js"
16
- },
17
- "./vitest-setup": {
18
- "types": "./dist/vitest-setup.d.ts",
19
- "default": "./dist/vitest-setup.js"
20
- },
21
- "./test-audit": {
22
- "types": "./test-audit.d.ts",
23
- "default": "./test-audit.mjs"
24
- },
25
- "./svg-wellformed": {
26
- "types": "./svg-wellformed.d.ts",
27
- "default": "./svg-wellformed.mjs"
28
- },
29
- "./package.json": "./package.json",
30
- "./own-dict-coverage": {
31
- "types": "./own-dict-coverage.d.ts",
32
- "default": "./own-dict-coverage.mjs"
33
- },
34
- "./check-config-titles": {
35
- "types": "./check-config-titles.d.ts",
36
- "default": "./check-config-titles.mjs"
37
- }
38
- },
39
- "files": [
40
- "dist",
41
- "schemas",
42
- "dev-host",
43
- "test-audit.mjs",
44
- "test-audit.d.ts",
45
- "svg-wellformed.mjs",
46
- "svg-wellformed.d.ts",
47
- "own-dict-coverage.mjs",
48
- "own-dict-coverage.d.ts",
49
- "check-config-titles.mjs",
50
- "check-config-titles.d.ts"
51
- ],
52
- "sideEffects": false,
53
- "bin": {
54
- "linkdesk-plugin-sdk": "./dist/bin.js"
55
- },
56
- "publishConfig": {
57
- "access": "public"
58
- },
59
- "engines": {
60
- "node": ">=20.0.0"
61
- },
62
- "scripts": {
63
- "build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json",
64
- "typecheck": "tsc -p tsconfig.json --noEmit",
65
- "prepack": "npm run build"
66
- },
67
- "dependencies": {
68
- "@linkdesk/contracts": "^0.1.1",
69
- "@typescript-eslint/eslint-plugin": "^8.0.0",
70
- "@typescript-eslint/parser": "^8.0.0",
71
- "@vitejs/plugin-react": "^4.3.4",
72
- "ajv": "^8.17.1",
73
- "eslint": "^9.0.0",
74
- "eslint-import-resolver-typescript": "^4.4.5",
75
- "eslint-plugin-import-x": "^4.17.1",
76
- "eslint-plugin-react-hooks": "^7.1.1",
77
- "i18next": "^26.3.6",
78
- "jsonc-parser": "^3.3.1",
79
- "jszip": "^3.10.1",
80
- "react": "^18.3.1",
81
- "react-dom": "^18.3.1",
82
- "react-i18next": "^17.0.10",
83
- "saxes": "^6.0.0",
84
- "vite": "^6.0.0"
85
- },
86
- "devDependencies": {
87
- "@types/node": "^24.0.0",
88
- "typescript": "^5.9.0"
89
- },
90
- "keywords": [
91
- "linkdesk",
92
- "plugin",
93
- "sdk",
94
- "vite"
95
- ],
96
- "license": "MIT"
97
- }
1
+ {
2
+ "name": "@linkdesk/plugin-sdk",
3
+ "version": "0.1.76",
4
+ "description": "@linkdesk/plugin-sdk——LinkDesk 插件作者 SDK(对标 @types/vscode):window.linkdesk.* 类型 + 一键 build(.linkdesk-plugin) + dev 宿主 + plugin.json 验证 + eslint 门禁(E6#54d)。作者 npm i 后零壳源码依赖。",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ },
13
+ "./eslint": {
14
+ "types": "./dist/eslint/index.d.ts",
15
+ "default": "./dist/eslint/index.js"
16
+ },
17
+ "./vitest-setup": {
18
+ "types": "./dist/vitest-setup.d.ts",
19
+ "default": "./dist/vitest-setup.js"
20
+ },
21
+ "./test-audit": {
22
+ "types": "./test-audit.d.ts",
23
+ "default": "./test-audit.mjs"
24
+ },
25
+ "./svg-wellformed": {
26
+ "types": "./svg-wellformed.d.ts",
27
+ "default": "./svg-wellformed.mjs"
28
+ },
29
+ "./package.json": "./package.json",
30
+ "./own-dict-coverage": {
31
+ "types": "./own-dict-coverage.d.ts",
32
+ "default": "./own-dict-coverage.mjs"
33
+ },
34
+ "./check-config-titles": {
35
+ "types": "./check-config-titles.d.ts",
36
+ "default": "./check-config-titles.mjs"
37
+ }
38
+ },
39
+ "files": [
40
+ "dist",
41
+ "schemas",
42
+ "dev-host",
43
+ "test-audit.mjs",
44
+ "test-audit.d.ts",
45
+ "svg-wellformed.mjs",
46
+ "svg-wellformed.d.ts",
47
+ "own-dict-coverage.mjs",
48
+ "own-dict-coverage.d.ts",
49
+ "check-config-titles.mjs",
50
+ "check-config-titles.d.ts"
51
+ ],
52
+ "sideEffects": false,
53
+ "bin": {
54
+ "linkdesk-plugin-sdk": "./dist/bin.js"
55
+ },
56
+ "publishConfig": {
57
+ "access": "public"
58
+ },
59
+ "engines": {
60
+ "node": ">=20.0.0"
61
+ },
62
+ "scripts": {
63
+ "build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json",
64
+ "typecheck": "tsc -p tsconfig.json --noEmit",
65
+ "prepack": "npm run build"
66
+ },
67
+ "dependencies": {
68
+ "@linkdesk/contracts": "^0.1.1",
69
+ "@typescript-eslint/eslint-plugin": "^8.0.0",
70
+ "@typescript-eslint/parser": "^8.0.0",
71
+ "@vitejs/plugin-react": "^4.3.4",
72
+ "ajv": "^8.17.1",
73
+ "eslint": "^9.0.0",
74
+ "eslint-import-resolver-typescript": "^4.4.5",
75
+ "eslint-plugin-import-x": "^4.17.1",
76
+ "eslint-plugin-react-hooks": "^7.1.1",
77
+ "i18next": "^26.3.6",
78
+ "jsonc-parser": "^3.3.1",
79
+ "jszip": "^3.10.1",
80
+ "react": "^18.3.1",
81
+ "react-dom": "^18.3.1",
82
+ "react-i18next": "^17.0.10",
83
+ "saxes": "^6.0.0",
84
+ "vite": "^6.0.0"
85
+ },
86
+ "devDependencies": {
87
+ "@types/node": "^24.0.0",
88
+ "typescript": "^5.9.0"
89
+ },
90
+ "keywords": [
91
+ "linkdesk",
92
+ "plugin",
93
+ "sdk",
94
+ "vite"
95
+ ],
96
+ "license": "MIT"
97
+ }