@glazeen/mod-sdk 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +221 -2
- package/bin/bearbar-mod.js +3 -0
- package/client/bb.css +58 -0
- package/client/bb.js +157 -0
- package/dist/bb-JW737zq0.d.ts +266 -0
- package/dist/cli.js +474 -0
- package/dist/global.d.ts +19 -0
- package/dist/global.js +0 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +284 -0
- package/docs/api.md +238 -0
- package/docs/guide.md +200 -0
- package/docs/manifest.md +198 -0
- package/docs/runtime.md +150 -0
- package/docs/styling.md +118 -0
- package/package.json +66 -3
- package/schema/bearbar.mod.schema.json +276 -0
package/package.json
CHANGED
|
@@ -1,6 +1,69 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glazeen/mod-sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Types, manifest schema, validator and CLI for bearbar dock mods, plus the bb runtime the dock injects.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"bearbar",
|
|
7
|
+
"glazeen",
|
|
8
|
+
"dock",
|
|
9
|
+
"taskbar",
|
|
10
|
+
"widget",
|
|
11
|
+
"mod",
|
|
12
|
+
"sdk",
|
|
13
|
+
"windows"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://github.com/Glazeen/bearbar/tree/main/packages/mod-sdk#readme",
|
|
16
|
+
"bugs": "https://github.com/Glazeen/bearbar/issues",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/Glazeen/bearbar.git",
|
|
21
|
+
"directory": "packages/mod-sdk"
|
|
22
|
+
},
|
|
23
|
+
"type": "module",
|
|
24
|
+
"sideEffects": false,
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"default": "./dist/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./global": {
|
|
31
|
+
"types": "./dist/global.d.ts"
|
|
32
|
+
},
|
|
33
|
+
"./client.js": "./client/bb.js",
|
|
34
|
+
"./client.css": "./client/bb.css",
|
|
35
|
+
"./schema.json": "./schema/bearbar.mod.schema.json",
|
|
36
|
+
"./package.json": "./package.json"
|
|
37
|
+
},
|
|
38
|
+
"types": "./dist/index.d.ts",
|
|
39
|
+
"bin": {
|
|
40
|
+
"bearbar-mod": "./bin/bearbar-mod.js"
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"bin",
|
|
44
|
+
"dist",
|
|
45
|
+
"client",
|
|
46
|
+
"docs",
|
|
47
|
+
"schema"
|
|
48
|
+
],
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=20"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@arethetypeswrong/cli": "^0.18.5",
|
|
54
|
+
"@types/node": "^26.6.6",
|
|
55
|
+
"ajv": "^8.20.0",
|
|
56
|
+
"publint": "^0.3.25",
|
|
57
|
+
"tsdown": "^0.23.7",
|
|
58
|
+
"typescript": "^7.0.2"
|
|
59
|
+
},
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"access": "public"
|
|
62
|
+
},
|
|
63
|
+
"scripts": {
|
|
64
|
+
"build": "tsdown",
|
|
65
|
+
"typecheck": "tsc -p tsconfig.json",
|
|
66
|
+
"test": "node --test \"test/*.test.ts\"",
|
|
67
|
+
"publint": "publint --strict && attw --pack . --profile esm-only --exclude-entrypoints client.js client.css"
|
|
68
|
+
}
|
|
6
69
|
}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://unpkg.com/@glazeen/mod-sdk/schema/bearbar.mod.schema.json",
|
|
4
|
+
"title": "bearbar mod manifest",
|
|
5
|
+
"description": "bearbar.mod.json: describes a bearbar dock widget mod.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["id", "name", "version", "tile"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"$schema": {
|
|
10
|
+
"type": "string"
|
|
11
|
+
},
|
|
12
|
+
"id": {
|
|
13
|
+
"description": "Unique id. A mod in the user folder overrides a bundled mod with the same id.",
|
|
14
|
+
"type": "string",
|
|
15
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{1,63}$"
|
|
16
|
+
},
|
|
17
|
+
"name": {
|
|
18
|
+
"description": "Shown in the widget picker.",
|
|
19
|
+
"type": "string",
|
|
20
|
+
"minLength": 1,
|
|
21
|
+
"pattern": "\\S"
|
|
22
|
+
},
|
|
23
|
+
"version": {
|
|
24
|
+
"description": "The mod's own version, ideally semver like \"1.0.0\".",
|
|
25
|
+
"type": "string",
|
|
26
|
+
"minLength": 1
|
|
27
|
+
},
|
|
28
|
+
"apiVersion": {
|
|
29
|
+
"description": "Mod API version the mod targets. Missing means 1.",
|
|
30
|
+
"type": "integer",
|
|
31
|
+
"minimum": 1
|
|
32
|
+
},
|
|
33
|
+
"description": {
|
|
34
|
+
"description": "Shown in the widget picker.",
|
|
35
|
+
"type": "string"
|
|
36
|
+
},
|
|
37
|
+
"author": {
|
|
38
|
+
"description": "Shown in the widget picker when there is no description.",
|
|
39
|
+
"type": "string"
|
|
40
|
+
},
|
|
41
|
+
"category": {
|
|
42
|
+
"description": "Ignored: mods are always listed under Mods.",
|
|
43
|
+
"deprecated": true
|
|
44
|
+
},
|
|
45
|
+
"sizes": {
|
|
46
|
+
"description": "Tile width in dock units for each supported size. Default { \"m\": 2 }.",
|
|
47
|
+
"type": "object",
|
|
48
|
+
"properties": {
|
|
49
|
+
"s": {
|
|
50
|
+
"$ref": "#/$defs/units",
|
|
51
|
+
"description": "Small tile width, in dock units."
|
|
52
|
+
},
|
|
53
|
+
"m": {
|
|
54
|
+
"$ref": "#/$defs/units",
|
|
55
|
+
"description": "Medium tile width, in dock units."
|
|
56
|
+
},
|
|
57
|
+
"l": {
|
|
58
|
+
"$ref": "#/$defs/units",
|
|
59
|
+
"description": "Large tile width, in dock units."
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"additionalProperties": false,
|
|
63
|
+
"minProperties": 1
|
|
64
|
+
},
|
|
65
|
+
"tile": {
|
|
66
|
+
"description": "The tile page: an .html file relative to the mod folder.",
|
|
67
|
+
"$ref": "#/$defs/pagePath",
|
|
68
|
+
"default": "tile.html"
|
|
69
|
+
},
|
|
70
|
+
"panel": {
|
|
71
|
+
"description": "Optional popup page (.html), opened with bb.panel.open().",
|
|
72
|
+
"$ref": "#/$defs/pagePath"
|
|
73
|
+
},
|
|
74
|
+
"panelSize": {
|
|
75
|
+
"description": "Panel size in DIP.",
|
|
76
|
+
"type": "object",
|
|
77
|
+
"required": ["width", "height"],
|
|
78
|
+
"properties": {
|
|
79
|
+
"width": {
|
|
80
|
+
"type": "number",
|
|
81
|
+
"exclusiveMinimum": 0
|
|
82
|
+
},
|
|
83
|
+
"height": {
|
|
84
|
+
"type": "number",
|
|
85
|
+
"exclusiveMinimum": 0
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"additionalProperties": false
|
|
89
|
+
},
|
|
90
|
+
"permissions": {
|
|
91
|
+
"type": "array",
|
|
92
|
+
"uniqueItems": true,
|
|
93
|
+
"items": {
|
|
94
|
+
"anyOf": [
|
|
95
|
+
{
|
|
96
|
+
"const": "open-url",
|
|
97
|
+
"description": "bb.openUrl() opens http(s) links in the default browser."
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"const": "system",
|
|
101
|
+
"description": "bb.on('system') receives CPU and RAM usage."
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"description": "bb.fetch() to this host over https. net:*.example.com covers subdomains.",
|
|
105
|
+
"type": "string",
|
|
106
|
+
"pattern": "^net:(\\*\\.)?[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*$"
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
"description": "What the mod may do beyond its sandbox."
|
|
111
|
+
},
|
|
112
|
+
"settings": {
|
|
113
|
+
"description": "The settings popup is generated from this. Values arrive as bb.config.",
|
|
114
|
+
"type": "object",
|
|
115
|
+
"additionalProperties": {
|
|
116
|
+
"$ref": "#/$defs/settingField"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"$defs": {
|
|
121
|
+
"units": {
|
|
122
|
+
"type": "number",
|
|
123
|
+
"exclusiveMinimum": 0
|
|
124
|
+
},
|
|
125
|
+
"settingField": {
|
|
126
|
+
"type": "object",
|
|
127
|
+
"required": ["type", "label"],
|
|
128
|
+
"properties": {
|
|
129
|
+
"type": {
|
|
130
|
+
"enum": ["text", "number", "toggle", "select"]
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"oneOf": [
|
|
134
|
+
{
|
|
135
|
+
"properties": {
|
|
136
|
+
"type": {
|
|
137
|
+
"const": "text"
|
|
138
|
+
},
|
|
139
|
+
"label": {
|
|
140
|
+
"description": "Shown next to the control.",
|
|
141
|
+
"type": "string"
|
|
142
|
+
},
|
|
143
|
+
"description": {
|
|
144
|
+
"description": "Help text shown under the control.",
|
|
145
|
+
"type": "string"
|
|
146
|
+
},
|
|
147
|
+
"visibleWhen": {
|
|
148
|
+
"$ref": "#/$defs/visibleWhen"
|
|
149
|
+
},
|
|
150
|
+
"default": {
|
|
151
|
+
"type": "string"
|
|
152
|
+
},
|
|
153
|
+
"placeholder": {
|
|
154
|
+
"type": "string"
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"additionalProperties": false
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"properties": {
|
|
161
|
+
"type": {
|
|
162
|
+
"const": "number"
|
|
163
|
+
},
|
|
164
|
+
"label": {
|
|
165
|
+
"description": "Shown next to the control.",
|
|
166
|
+
"type": "string"
|
|
167
|
+
},
|
|
168
|
+
"description": {
|
|
169
|
+
"description": "Help text shown under the control.",
|
|
170
|
+
"type": "string"
|
|
171
|
+
},
|
|
172
|
+
"visibleWhen": {
|
|
173
|
+
"$ref": "#/$defs/visibleWhen"
|
|
174
|
+
},
|
|
175
|
+
"default": {
|
|
176
|
+
"type": "number"
|
|
177
|
+
},
|
|
178
|
+
"min": {
|
|
179
|
+
"type": "number"
|
|
180
|
+
},
|
|
181
|
+
"max": {
|
|
182
|
+
"type": "number"
|
|
183
|
+
},
|
|
184
|
+
"step": {
|
|
185
|
+
"type": "number",
|
|
186
|
+
"exclusiveMinimum": 0
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
"additionalProperties": false
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"properties": {
|
|
193
|
+
"type": {
|
|
194
|
+
"const": "toggle"
|
|
195
|
+
},
|
|
196
|
+
"label": {
|
|
197
|
+
"description": "Shown next to the control.",
|
|
198
|
+
"type": "string"
|
|
199
|
+
},
|
|
200
|
+
"description": {
|
|
201
|
+
"description": "Help text shown under the control.",
|
|
202
|
+
"type": "string"
|
|
203
|
+
},
|
|
204
|
+
"visibleWhen": {
|
|
205
|
+
"$ref": "#/$defs/visibleWhen"
|
|
206
|
+
},
|
|
207
|
+
"default": {
|
|
208
|
+
"type": "boolean"
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
"additionalProperties": false
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"properties": {
|
|
215
|
+
"type": {
|
|
216
|
+
"const": "select"
|
|
217
|
+
},
|
|
218
|
+
"label": {
|
|
219
|
+
"description": "Shown next to the control.",
|
|
220
|
+
"type": "string"
|
|
221
|
+
},
|
|
222
|
+
"description": {
|
|
223
|
+
"description": "Help text shown under the control.",
|
|
224
|
+
"type": "string"
|
|
225
|
+
},
|
|
226
|
+
"visibleWhen": {
|
|
227
|
+
"$ref": "#/$defs/visibleWhen"
|
|
228
|
+
},
|
|
229
|
+
"default": {
|
|
230
|
+
"description": "One of the option values.",
|
|
231
|
+
"type": "string"
|
|
232
|
+
},
|
|
233
|
+
"options": {
|
|
234
|
+
"type": "array",
|
|
235
|
+
"minItems": 1,
|
|
236
|
+
"items": {
|
|
237
|
+
"type": "object",
|
|
238
|
+
"required": ["value", "label"],
|
|
239
|
+
"properties": {
|
|
240
|
+
"value": {
|
|
241
|
+
"type": "string"
|
|
242
|
+
},
|
|
243
|
+
"label": {
|
|
244
|
+
"type": "string"
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"additionalProperties": false
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
"additionalProperties": false,
|
|
252
|
+
"required": ["options"]
|
|
253
|
+
}
|
|
254
|
+
]
|
|
255
|
+
},
|
|
256
|
+
"pagePath": {
|
|
257
|
+
"type": "string",
|
|
258
|
+
"pattern": "^(?![A-Za-z][A-Za-z0-9+.-]*:|[\\\\/])(?!(?:.*[\\\\/])?\\.\\.(?:[\\\\/]|$)).+\\.[Hh][Tt][Mm][Ll]$"
|
|
259
|
+
},
|
|
260
|
+
"visibleWhen": {
|
|
261
|
+
"description": "Show the field only while another setting has this value.",
|
|
262
|
+
"type": "object",
|
|
263
|
+
"required": ["field", "equals"],
|
|
264
|
+
"properties": {
|
|
265
|
+
"field": {
|
|
266
|
+
"description": "Key of another setting.",
|
|
267
|
+
"type": "string"
|
|
268
|
+
},
|
|
269
|
+
"equals": {
|
|
270
|
+
"type": ["string", "number", "boolean"]
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"additionalProperties": false
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|