@dp-bohrium/widget-cli 0.1.0 → 0.3.0
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/AGENTS.md +144 -8
- package/CHANGELOG.md +73 -0
- package/README.md +60 -97
- package/assets/licenses/ajv@8.20.0/LICENSE +22 -0
- package/assets/licenses/fast-deep-equal@3.1.3/LICENSE +21 -0
- package/assets/licenses/fast-uri@3.1.6/LICENSE +30 -0
- package/assets/licenses/json-schema-traverse@1.0.0/LICENSE +21 -0
- package/assets/licenses/require-from-string@2.0.2/license +21 -0
- package/assets/licenses/widget-contracts.LICENSE +21 -0
- package/assets/licenses/widget-sdk.LICENSE +21 -0
- package/assets/schemas/host-runtime-config.schema.json +305 -0
- package/assets/schemas/widget-manifest.schema.json +361 -0
- package/assets/schemas/widget-plugin-manifest.schema.json +162 -0
- package/assets/schemas/widget-runtime-contracts.schema.json +2870 -0
- package/assets/toolchain.json +24 -0
- package/dist/cli.mjs +1066 -143
- package/dist/core.mjs +1 -1
- package/dist/{dsh-DgkNH7L-.mjs → dsh-DbOeoKFJ.mjs} +554 -88
- package/llms.txt +55 -4
- package/package.json +13 -12
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "widget-plugin-manifest.schema.json",
|
|
4
|
+
"title": "Widget Plugin Manifest",
|
|
5
|
+
"description": "插件作者维护的插件清单;打包阶段会生成宿主清单的运行时字段。",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"name",
|
|
10
|
+
"version",
|
|
11
|
+
"contributes"
|
|
12
|
+
],
|
|
13
|
+
"properties": {
|
|
14
|
+
"$schema": {
|
|
15
|
+
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
"name": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"minLength": 1,
|
|
20
|
+
"maxLength": 128
|
|
21
|
+
},
|
|
22
|
+
"version": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?$"
|
|
25
|
+
},
|
|
26
|
+
"displayName": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"maxLength": 128
|
|
29
|
+
},
|
|
30
|
+
"description": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"maxLength": 2000
|
|
33
|
+
},
|
|
34
|
+
"entry": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"minLength": 1,
|
|
37
|
+
"maxLength": 256,
|
|
38
|
+
"pattern": "^(?!/)(?!.*\\.\\.)(?!.*\\\\)(?!.*://).+\\.(?:[cm]?js|tsx?|jsx?)$",
|
|
39
|
+
"description": "插件源码入口;CLI 默认使用 src/widget.ts。"
|
|
40
|
+
},
|
|
41
|
+
"activationEvents": {
|
|
42
|
+
"$ref": "widget-manifest.schema.json#/$defs/ActivationEvents"
|
|
43
|
+
},
|
|
44
|
+
"contributes": {
|
|
45
|
+
"$ref": "#/$defs/WidgetPluginContributions"
|
|
46
|
+
},
|
|
47
|
+
"capabilities": {
|
|
48
|
+
"$ref": "widget-manifest.schema.json#/$defs/RequestedCapabilities"
|
|
49
|
+
},
|
|
50
|
+
"runtime": {
|
|
51
|
+
"$ref": "widget-manifest.schema.json#/$defs/RuntimeOptions"
|
|
52
|
+
},
|
|
53
|
+
"samples": {
|
|
54
|
+
"$ref": "widget-manifest.schema.json#/$defs/Samples"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"$defs": {
|
|
58
|
+
"WidgetPluginContributions": {
|
|
59
|
+
"description": "插件声明的一组扩展点;当前仅支持 widget 贡献点。",
|
|
60
|
+
"type": "object",
|
|
61
|
+
"additionalProperties": false,
|
|
62
|
+
"required": [
|
|
63
|
+
"widget"
|
|
64
|
+
],
|
|
65
|
+
"properties": {
|
|
66
|
+
"widget": {
|
|
67
|
+
"$ref": "#/$defs/WidgetContribution"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"WidgetContribution": {
|
|
72
|
+
"description": "作者贡献点联合:以 type 判别 Panel 或文件预览。",
|
|
73
|
+
"oneOf": [
|
|
74
|
+
{
|
|
75
|
+
"$ref": "#/$defs/WidgetPanelContribution"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"$ref": "#/$defs/WidgetFilePreviewContribution"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
"WidgetPanelContribution": {
|
|
83
|
+
"description": "面板贡献:声明 panel 类型与 id;surfaces、title、placement 可选。",
|
|
84
|
+
"type": "object",
|
|
85
|
+
"additionalProperties": false,
|
|
86
|
+
"required": [
|
|
87
|
+
"type",
|
|
88
|
+
"id"
|
|
89
|
+
],
|
|
90
|
+
"properties": {
|
|
91
|
+
"type": {
|
|
92
|
+
"const": "panel"
|
|
93
|
+
},
|
|
94
|
+
"id": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"minLength": 1,
|
|
97
|
+
"maxLength": 128,
|
|
98
|
+
"pattern": "^[A-Za-z0-9_.:-]+$"
|
|
99
|
+
},
|
|
100
|
+
"title": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"maxLength": 128
|
|
103
|
+
},
|
|
104
|
+
"surfaces": {
|
|
105
|
+
"type": "array",
|
|
106
|
+
"minItems": 1,
|
|
107
|
+
"maxItems": 3,
|
|
108
|
+
"uniqueItems": true,
|
|
109
|
+
"items": { "enum": ["workspace", "floating", "overlay"] }
|
|
110
|
+
},
|
|
111
|
+
"placement": {
|
|
112
|
+
"oneOf": [
|
|
113
|
+
{
|
|
114
|
+
"type": "object",
|
|
115
|
+
"additionalProperties": false,
|
|
116
|
+
"required": ["kind"],
|
|
117
|
+
"properties": {
|
|
118
|
+
"kind": { "const": "panel" }
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"type": "object",
|
|
123
|
+
"additionalProperties": false,
|
|
124
|
+
"required": ["kind", "region", "mode"],
|
|
125
|
+
"properties": {
|
|
126
|
+
"kind": { "const": "region" },
|
|
127
|
+
"region": { "const": "session.rightRail" },
|
|
128
|
+
"mode": { "const": "replace" }
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"WidgetFilePreviewContribution": {
|
|
136
|
+
"description": "文件预览贡献:声明一组小写且不含前导点的扩展名。",
|
|
137
|
+
"type": "object",
|
|
138
|
+
"additionalProperties": false,
|
|
139
|
+
"required": [
|
|
140
|
+
"type",
|
|
141
|
+
"extensions"
|
|
142
|
+
],
|
|
143
|
+
"properties": {
|
|
144
|
+
"type": {
|
|
145
|
+
"const": "file-preview"
|
|
146
|
+
},
|
|
147
|
+
"extensions": {
|
|
148
|
+
"type": "array",
|
|
149
|
+
"minItems": 1,
|
|
150
|
+
"maxItems": 32,
|
|
151
|
+
"uniqueItems": true,
|
|
152
|
+
"items": {
|
|
153
|
+
"type": "string",
|
|
154
|
+
"minLength": 1,
|
|
155
|
+
"maxLength": 32,
|
|
156
|
+
"pattern": "^[a-z0-9][a-z0-9.-]*$"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|