@linkdesk/plugin-sdk 0.1.10 → 0.1.12
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 +63 -0
- package/dev-host/dev-main.tsx +47 -47
- package/dev-host/index.html +50 -50
- package/dev-host/linkdesk-mock.generated.ts +3 -0
- package/dev-host/mock.ts +72 -72
- package/dist/bin.js +16 -16
- package/package.json +68 -68
- package/schemas/icon-theme.schema.json +97 -97
- package/schemas/plugin.schema.json +682 -680
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://linkdesk.local/schemas/icon-theme.schema.json",
|
|
4
|
-
"title": "LinkDesk 图标主题 mappings 数据契约",
|
|
5
|
-
"description": "contributes.iconThemes 指向的 mappings JSON 文件契约——镜像引擎 normalizeIconThemeMappings(src/pluginLoader/contributions/contributions.ts,E5.8#133 定案)。匹配表四段(files/extensions/folders/foldersExpanded)+ 顶层默认图标五键(file/folder/folderExpanded/rootFolder/rootFolderExpanded);条目双形态二选一:字体 glyph(class + 可选 color)或图像资产(imagePath,相对插件根)。可选顶层 font 段声明自定义图标字体。校验:npm 侧 @linkdesk/plugin-sdk validateIconThemeJson;repo 侧 check-theme-schema.mjs(contributes.iconThemes 全扫)。",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"additionalProperties": false,
|
|
8
|
-
"properties": {
|
|
9
|
-
"$schema": {
|
|
10
|
-
"type": "string",
|
|
11
|
-
"description": "编辑器 IntelliSense 引用(可选)——npm 作者引 node_modules/@linkdesk/plugin-sdk/schemas/icon-theme.schema.json"
|
|
12
|
-
},
|
|
13
|
-
"files": {
|
|
14
|
-
"$ref": "#/$defs/mappingTable",
|
|
15
|
-
"description": "文件名 → 图标条目(命中优先级最高,未命中走 extensions)"
|
|
16
|
-
},
|
|
17
|
-
"extensions": {
|
|
18
|
-
"$ref": "#/$defs/mappingTable",
|
|
19
|
-
"description": "扩展名(含点,如 \".ts\"/\".jsx\")→ 图标条目"
|
|
20
|
-
},
|
|
21
|
-
"folders": {
|
|
22
|
-
"$ref": "#/$defs/mappingTable",
|
|
23
|
-
"description": "目录名 → 图标条目(折叠态)"
|
|
24
|
-
},
|
|
25
|
-
"foldersExpanded": {
|
|
26
|
-
"$ref": "#/$defs/mappingTable",
|
|
27
|
-
"description": "目录名 → 图标条目(展开态;缺省复用 folders)"
|
|
28
|
-
},
|
|
29
|
-
"file": {
|
|
30
|
-
"$ref": "#/$defs/iconMapping",
|
|
31
|
-
"description": "默认文件图标——未命中 files/extensions 时使用(缺省 = 壳保底图标)"
|
|
32
|
-
},
|
|
33
|
-
"folder": {
|
|
34
|
-
"$ref": "#/$defs/iconMapping",
|
|
35
|
-
"description": "默认文件夹图标——未命中 folders 时使用(缺省 = 壳保底)"
|
|
36
|
-
},
|
|
37
|
-
"folderExpanded": {
|
|
38
|
-
"$ref": "#/$defs/iconMapping",
|
|
39
|
-
"description": "默认文件夹展开图标——未命中 foldersExpanded 时使用(缺省 = 壳保底)"
|
|
40
|
-
},
|
|
41
|
-
"rootFolder": {
|
|
42
|
-
"$ref": "#/$defs/iconMapping",
|
|
43
|
-
"description": "根文件夹图标(缺省 = 壳保底)"
|
|
44
|
-
},
|
|
45
|
-
"rootFolderExpanded": {
|
|
46
|
-
"$ref": "#/$defs/iconMapping",
|
|
47
|
-
"description": "根文件夹展开图标(缺省 = 壳保底)"
|
|
48
|
-
},
|
|
49
|
-
"font": {
|
|
50
|
-
"$ref": "#/$defs/fontSpec",
|
|
51
|
-
"description": "自定义图标字体(可选)——声明后壳生成 @font-face,glyph 类由作者提供"
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
"$defs": {
|
|
55
|
-
"mappingTable": {
|
|
56
|
-
"type": "object",
|
|
57
|
-
"description": "匹配表——名字(文件名/扩展名/目录名)→ 图标条目",
|
|
58
|
-
"additionalProperties": { "$ref": "#/$defs/iconMapping" }
|
|
59
|
-
},
|
|
60
|
-
"iconMapping": {
|
|
61
|
-
"title": "图标条目——双形态二选一",
|
|
62
|
-
"type": "object",
|
|
63
|
-
"anyOf": [
|
|
64
|
-
{
|
|
65
|
-
"title": "字体 glyph 形态",
|
|
66
|
-
"description": "CSS 类名——codicon 保底 / 自定义图标字体(class 缺省 = 图标字体家族自带类)",
|
|
67
|
-
"required": ["class"],
|
|
68
|
-
"properties": {
|
|
69
|
-
"class": { "type": "string", "description": "CSS 类名(如 \"codicon codicon-typescript\" 或 \"myfont myfont-rust\")" },
|
|
70
|
-
"color": { "type": "string", "description": "可选每图标颜色(seti 类彩色字体;普通单色字体不写)" }
|
|
71
|
-
},
|
|
72
|
-
"additionalProperties": false
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"title": "图像资产形态",
|
|
76
|
-
"description": "图像资产——任意多色/拟物化/贴图",
|
|
77
|
-
"required": ["imagePath"],
|
|
78
|
-
"properties": {
|
|
79
|
-
"imagePath": { "type": "string", "description": "图像资产相对插件根的路径(如 \"icons/js.svg\")——渲染时壳用 getPluginAssetPath 解析 linkdesk:// 绝对 URL(硬约束 12 同族),禁止写 /assets/... 绝对路径" }
|
|
80
|
-
},
|
|
81
|
-
"additionalProperties": false
|
|
82
|
-
}
|
|
83
|
-
]
|
|
84
|
-
},
|
|
85
|
-
"fontSpec": {
|
|
86
|
-
"type": "object",
|
|
87
|
-
"description": "自定义图标字体元数据——path 相对插件根或绝对 URL;@font-face 由壳生成(池独立文档复刻),glyph 类 CSS 作者自写",
|
|
88
|
-
"required": ["path", "family"],
|
|
89
|
-
"additionalProperties": false,
|
|
90
|
-
"properties": {
|
|
91
|
-
"path": { "type": "string", "description": "字体文件相对插件根路径(或 linkdesk:// / http(s):// / data: 绝对 URL)" },
|
|
92
|
-
"family": { "type": "string", "description": "作者 glyph CSS 里 font-family 写的族名" },
|
|
93
|
-
"glyphs": { "type": "string", "description": "glyph 类 CSS 文件相对插件根路径(可选;缺省 = 仅 @font-face,无自定义 glyph 类)" }
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://linkdesk.local/schemas/icon-theme.schema.json",
|
|
4
|
+
"title": "LinkDesk 图标主题 mappings 数据契约",
|
|
5
|
+
"description": "contributes.iconThemes 指向的 mappings JSON 文件契约——镜像引擎 normalizeIconThemeMappings(src/pluginLoader/contributions/contributions.ts,E5.8#133 定案)。匹配表四段(files/extensions/folders/foldersExpanded)+ 顶层默认图标五键(file/folder/folderExpanded/rootFolder/rootFolderExpanded);条目双形态二选一:字体 glyph(class + 可选 color)或图像资产(imagePath,相对插件根)。可选顶层 font 段声明自定义图标字体。校验:npm 侧 @linkdesk/plugin-sdk validateIconThemeJson;repo 侧 check-theme-schema.mjs(contributes.iconThemes 全扫)。",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {
|
|
9
|
+
"$schema": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "编辑器 IntelliSense 引用(可选)——npm 作者引 node_modules/@linkdesk/plugin-sdk/schemas/icon-theme.schema.json"
|
|
12
|
+
},
|
|
13
|
+
"files": {
|
|
14
|
+
"$ref": "#/$defs/mappingTable",
|
|
15
|
+
"description": "文件名 → 图标条目(命中优先级最高,未命中走 extensions)"
|
|
16
|
+
},
|
|
17
|
+
"extensions": {
|
|
18
|
+
"$ref": "#/$defs/mappingTable",
|
|
19
|
+
"description": "扩展名(含点,如 \".ts\"/\".jsx\")→ 图标条目"
|
|
20
|
+
},
|
|
21
|
+
"folders": {
|
|
22
|
+
"$ref": "#/$defs/mappingTable",
|
|
23
|
+
"description": "目录名 → 图标条目(折叠态)"
|
|
24
|
+
},
|
|
25
|
+
"foldersExpanded": {
|
|
26
|
+
"$ref": "#/$defs/mappingTable",
|
|
27
|
+
"description": "目录名 → 图标条目(展开态;缺省复用 folders)"
|
|
28
|
+
},
|
|
29
|
+
"file": {
|
|
30
|
+
"$ref": "#/$defs/iconMapping",
|
|
31
|
+
"description": "默认文件图标——未命中 files/extensions 时使用(缺省 = 壳保底图标)"
|
|
32
|
+
},
|
|
33
|
+
"folder": {
|
|
34
|
+
"$ref": "#/$defs/iconMapping",
|
|
35
|
+
"description": "默认文件夹图标——未命中 folders 时使用(缺省 = 壳保底)"
|
|
36
|
+
},
|
|
37
|
+
"folderExpanded": {
|
|
38
|
+
"$ref": "#/$defs/iconMapping",
|
|
39
|
+
"description": "默认文件夹展开图标——未命中 foldersExpanded 时使用(缺省 = 壳保底)"
|
|
40
|
+
},
|
|
41
|
+
"rootFolder": {
|
|
42
|
+
"$ref": "#/$defs/iconMapping",
|
|
43
|
+
"description": "根文件夹图标(缺省 = 壳保底)"
|
|
44
|
+
},
|
|
45
|
+
"rootFolderExpanded": {
|
|
46
|
+
"$ref": "#/$defs/iconMapping",
|
|
47
|
+
"description": "根文件夹展开图标(缺省 = 壳保底)"
|
|
48
|
+
},
|
|
49
|
+
"font": {
|
|
50
|
+
"$ref": "#/$defs/fontSpec",
|
|
51
|
+
"description": "自定义图标字体(可选)——声明后壳生成 @font-face,glyph 类由作者提供"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"$defs": {
|
|
55
|
+
"mappingTable": {
|
|
56
|
+
"type": "object",
|
|
57
|
+
"description": "匹配表——名字(文件名/扩展名/目录名)→ 图标条目",
|
|
58
|
+
"additionalProperties": { "$ref": "#/$defs/iconMapping" }
|
|
59
|
+
},
|
|
60
|
+
"iconMapping": {
|
|
61
|
+
"title": "图标条目——双形态二选一",
|
|
62
|
+
"type": "object",
|
|
63
|
+
"anyOf": [
|
|
64
|
+
{
|
|
65
|
+
"title": "字体 glyph 形态",
|
|
66
|
+
"description": "CSS 类名——codicon 保底 / 自定义图标字体(class 缺省 = 图标字体家族自带类)",
|
|
67
|
+
"required": ["class"],
|
|
68
|
+
"properties": {
|
|
69
|
+
"class": { "type": "string", "description": "CSS 类名(如 \"codicon codicon-typescript\" 或 \"myfont myfont-rust\")" },
|
|
70
|
+
"color": { "type": "string", "description": "可选每图标颜色(seti 类彩色字体;普通单色字体不写)" }
|
|
71
|
+
},
|
|
72
|
+
"additionalProperties": false
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"title": "图像资产形态",
|
|
76
|
+
"description": "图像资产——任意多色/拟物化/贴图",
|
|
77
|
+
"required": ["imagePath"],
|
|
78
|
+
"properties": {
|
|
79
|
+
"imagePath": { "type": "string", "description": "图像资产相对插件根的路径(如 \"icons/js.svg\")——渲染时壳用 getPluginAssetPath 解析 linkdesk:// 绝对 URL(硬约束 12 同族),禁止写 /assets/... 绝对路径" }
|
|
80
|
+
},
|
|
81
|
+
"additionalProperties": false
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
"fontSpec": {
|
|
86
|
+
"type": "object",
|
|
87
|
+
"description": "自定义图标字体元数据——path 相对插件根或绝对 URL;@font-face 由壳生成(池独立文档复刻),glyph 类 CSS 作者自写",
|
|
88
|
+
"required": ["path", "family"],
|
|
89
|
+
"additionalProperties": false,
|
|
90
|
+
"properties": {
|
|
91
|
+
"path": { "type": "string", "description": "字体文件相对插件根路径(或 linkdesk:// / http(s):// / data: 绝对 URL)" },
|
|
92
|
+
"family": { "type": "string", "description": "作者 glyph CSS 里 font-family 写的族名" },
|
|
93
|
+
"glyphs": { "type": "string", "description": "glyph 类 CSS 文件相对插件根路径(可选;缺省 = 仅 @font-face,无自定义 glyph 类)" }
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|