Support for provides_widgets entry in metadata, and try and tag existing widgets

Support for 'default' tag and add it to apps that we expect would be used by default with the Bangle
split widalarm out of alarm

fixes https://github.com/espruino/BangleApps/issues/2353
pull/2363/head
Gordon Williams 2022-12-06 10:25:32 +00:00
parent 341517881b
commit 3e5c0538a9
24 changed files with 53 additions and 14 deletions

View File

@ -282,8 +282,11 @@ and which gives information about the app for the Launcher.
"dependencies" : { "notify":"type" } // optional, app 'types' we depend on (see "type" above)
"dependencies" : { "messages":"app" } // optional, depend on a specific app ID
// for instance this will use notify/notifyfs is they exist, or will pull in 'notify'
"dependencies" : { "messageicons":"module" } // optional, depend on a specific library to be used with 'require'
"dependencies" : { "messageicons":"module" } // optional, depend on a specific library to be used with 'require' - see provides_modules
"dependencies" : { "message":"widget" } // optional, depend on a specific type of widget - see provides_widgets
"provides_modules" : ["messageicons"] // optional, this app provides a module that can be used with 'require'
"provides_widgets" : ["battery"] // optional, this app provides a type of widget - 'alarm/battery/bluetooth/pedometer/message'
"default" : true, // set if an app is the default implementer of something (a widget/module/etc)
"readme": "README.md", // if supplied, a link to a markdown-style text file
// that contains more information about this app (usage, etc)
// A 'Read more...' link will be added under the app

View File

@ -36,4 +36,4 @@
0.33: Allow hiding timers&alarms
0.34: Add "Confirm" option to alarm/timer edit menus
0.35: Add automatic translation of more strings
0.36: alarm widget moved out of app

View File

@ -2,17 +2,16 @@
"id": "alarm",
"name": "Alarms & Timers",
"shortName": "Alarms",
"version": "0.35",
"version": "0.36",
"description": "Set alarms and timers on your Bangle",
"icon": "app.png",
"tags": "tool,alarm,widget",
"tags": "tool,alarm",
"supports": [ "BANGLEJS", "BANGLEJS2" ],
"readme": "README.md",
"dependencies": { "scheduler":"type" },
"dependencies": { "scheduler":"type", "alarm":"widget" },
"storage": [
{ "name": "alarm.app.js", "url": "app.js" },
{ "name": "alarm.img", "url": "app-icon.js", "evaluate": true },
{ "name": "alarm.wid.js", "url": "widget.js" }
{ "name": "alarm.img", "url": "app-icon.js", "evaluate": true }
],
"screenshots": [
{ "url": "screenshot-1.png" },

View File

@ -7,6 +7,7 @@
"readme": "README.md",
"icon": "app.png",
"type": "launch",
"default": true,
"tags": "tool,system,launcher",
"supports": ["BANGLEJS","BANGLEJS2"],
"storage": [

View File

@ -9,6 +9,7 @@
"supports": ["BANGLEJS","BANGLEJS2"],
"dependencies" : { "messageicons":"module" },
"provides_modules": ["messagegui"],
"default": true,
"readme": "README.md",
"storage": [
{"name":"messagegui","url":"lib.js"},

View File

@ -8,6 +8,7 @@
"tags": "tool,system",
"supports": ["BANGLEJS","BANGLEJS2"],
"provides_modules" : ["messageicons"],
"default": true,
"storage": [
{"name":"messageicons","url":"lib.js"}
]

View File

@ -8,7 +8,11 @@
"tags": "tool,system",
"supports": ["BANGLEJS","BANGLEJS2"],
"provides_modules" : ["messages"],
"dependencies" : { "messagegui":"module","messagewidget":"module" },
"dependencies" : {
"messagegui":"module",
"message":"widget"
},
"default": true,
"readme": "README.md",
"storage": [
{"name":"messages","url":"lib.js"},

View File

@ -7,6 +7,8 @@
"type": "scheduler",
"tags": "tool,system,alarm",
"supports": ["BANGLEJS","BANGLEJS2"],
"provides_modules" : ["sched"],
"default" : true,
"readme": "README.md",
"storage": [
{"name":"sched.boot.js","url":"boot.js"},

1
apps/widalarm/ChangeLog Normal file
View File

@ -0,0 +1 @@
0.01: Moved out of 'alarm' app

BIN
apps/widalarm/app.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -0,0 +1,15 @@
{
"id": "widalarm",
"name": "Alarms Widget",
"version": "0.01",
"description": "Displays an alarm icon in the widgets bar if any alarm is active",
"icon": "app.png",
"type": "widget",
"tags": "tool,alarm,widget",
"supports": [ "BANGLEJS", "BANGLEJS2" ],
"provides_widgets" : ["alarm"],
"default" : true,
"storage": [
{ "name": "widalarm.wid.js", "url": "widget.js" }
]
}

View File

@ -8,6 +8,7 @@
"type": "widget",
"tags": "widget",
"supports": ["BANGLEJS","BANGLEJS2"],
"provides_widgets" : ["alarm"],
"screenshots" : [ { "url":"screenshot.png" } ],
"storage": [
{"name":"widalarmeta.wid.js","url":"widget.js"}

View File

@ -6,6 +6,8 @@
"icon": "widget.png",
"type": "widget",
"tags": "widget,battery",
"provides_widgets" : ["battery"],
"default" : true,
"supports": ["BANGLEJS","BANGLEJS2"],
"storage": [
{"name":"widbat.wid.js","url":"widget.js"}

View File

@ -10,6 +10,7 @@
"readme": "README.md",
"description": "Shows the current battery level status in the top right using the clocks colour theme",
"tags": "widget,battery",
"provides_widgets" : ["battery"],
"storage": [
{"name":"widbata.wid.js","url":"widbata.wid.js"}
]

View File

@ -7,6 +7,7 @@
"icon": "widget.png",
"type": "widget",
"tags": "widget,battery",
"provides_widgets" : ["battery"],
"supports": ["BANGLEJS","BANGLEJS2"],
"readme": "README.md",
"screenshots": [{"url":"widbatpc.full.jpg"},{"url":"widbatpc.part.jpg"}],

View File

@ -6,6 +6,7 @@
"icon": "widget.png",
"type": "widget",
"tags": "widget,battery",
"provides_widgets" : ["battery"],
"supports": ["BANGLEJS","BANGLEJS2"],
"storage": [
{"name":"widbatv.wid.js","url":"widget.js"}

View File

@ -6,6 +6,8 @@
"icon": "widget.png",
"type": "widget",
"tags": "widget,bluetooth",
"provides_widgets" : ["bluetooth"],
"default" : true,
"supports": ["BANGLEJS","BANGLEJS2"],
"storage": [
{"name":"widbt.wid.js","url":"widget.js"}

View File

@ -6,6 +6,7 @@
"icon": "widget.png",
"type": "widget",
"tags": "widget,bluetooth",
"provides_widgets" : ["bluetooth"],
"supports": ["BANGLEJS","BANGLEJS2"],
"storage": [
{"name":"widbt_notify.wid.js","url":"widget.js"},
@ -13,5 +14,5 @@
],
"data": [
{"name":"widbt_notify.json"}
]
]
}

View File

@ -6,6 +6,7 @@
"icon": "widget.png",
"type": "widget",
"tags": "widget,bluetooth",
"provides_widgets" : ["bluetooth"],
"supports": ["BANGLEJS","BANGLEJS2"],
"storage": [
{"name":"widbthide.wid.js","url":"widget.js"}

View File

@ -10,6 +10,8 @@
"screenshots": [{"url": "screenshot.gif"}],
"dependencies" : { "messageicons":"module" },
"provides_modules" : ["messagewidget"],
"provides_widgets" : ["message"],
"default" : true,
"readme": "README.md",
"storage": [
{"name":"messagewidget","url":"lib.js"},

View File

@ -76,7 +76,7 @@ const APP_KEYS = [
'id', 'name', 'shortName', 'version', 'icon', 'screenshots', 'description', 'tags', 'type',
'sortorder', 'readme', 'custom', 'customConnect', 'interface', 'storage', 'data',
'supports', 'allow_emulator',
'dependencies', 'provides_modules'
'dependencies', 'provides_modules', 'provides_widgets', "default"
];
const STORAGE_KEYS = ['name', 'url', 'content', 'evaluate', 'noOverwite', 'supports', 'noOverwrite'];
const DATA_KEYS = ['name', 'wildcard', 'storageFile', 'url', 'content', 'evaluate'];
@ -168,8 +168,8 @@ apps.forEach((app,appIdx) => {
if (app.dependencies) {
if (("object"==typeof app.dependencies) && !Array.isArray(app.dependencies)) {
Object.keys(app.dependencies).forEach(dependency => {
if (!["type","app","module"].includes(app.dependencies[dependency]))
ERROR(`App ${app.id} 'dependencies' must all be tagged 'type/app/module' right now`, {file:metadataFile});
if (!["type","app","module","widget"].includes(app.dependencies[dependency]))
ERROR(`App ${app.id} 'dependencies' must all be tagged 'type/app/module/widget' right now`, {file:metadataFile});
if (app.dependencies[dependency]=="type" && !METADATA_TYPES.includes(dependency))
ERROR(`App ${app.id} 'type' dependency must be one of `+METADATA_TYPES, {file:metadataFile});
});

2
core

@ -1 +1 @@
Subproject commit 3a953179b7bb9f574d4e77d5f34b6b7deee1e884
Subproject commit 2a89ea64f7874b9264572f68836fe8ecd0a6b191

View File

@ -1 +1 @@
["boot","launch","antonclk","health","setting","about","widbat","widbt","widlock","widid"]
["boot","launch","antonclk","health","setting","about","alarm","widbat","widbt","widlock","widid"]