mirror of https://github.com/espruino/BangleApps
Update app metadata to make clockinfo apps easier to find
parent
92a5acdbca
commit
4b2061e899
|
@ -9,7 +9,7 @@
|
||||||
"dependencies" : { "clock_info":"module" },
|
"dependencies" : { "clock_info":"module" },
|
||||||
"description": "A watch face that was designed by an AI (stable diffusion) and implemented by a human.",
|
"description": "A watch face that was designed by an AI (stable diffusion) and implemented by a human.",
|
||||||
"type": "clock",
|
"type": "clock",
|
||||||
"tags": "clock",
|
"tags": "clock,clkinfo",
|
||||||
"screenshots": [
|
"screenshots": [
|
||||||
{"url":"orig.png"},
|
{"url":"orig.png"},
|
||||||
{"url":"impl.png"},
|
{"url":"impl.png"},
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"screenshots": [{"url":"screenshot-dark.png"}, {"url":"screenshot-light.png"}, {"url":"screenshot-dark-4.png"}, {"url":"screenshot-light-4.png"}],
|
"screenshots": [{"url":"screenshot-dark.png"}, {"url":"screenshot-light.png"}, {"url":"screenshot-dark-4.png"}, {"url":"screenshot-light-4.png"}],
|
||||||
"type": "clock",
|
"type": "clock",
|
||||||
"tags": "clock",
|
"tags": "clock,clkinfo",
|
||||||
"supports" : ["BANGLEJS2"],
|
"supports" : ["BANGLEJS2"],
|
||||||
"dependencies" : { "clock_info":"module" },
|
"dependencies" : { "clock_info":"module" },
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"screenshots": [{"url":"screenshot3.png"}],
|
"screenshots": [{"url":"screenshot3.png"}],
|
||||||
"type": "clock",
|
"type": "clock",
|
||||||
"tags": "clock",
|
"tags": "clock,clkinfo",
|
||||||
"supports": ["BANGLEJS2"],
|
"supports": ["BANGLEJS2"],
|
||||||
"dependencies" : { "clock_info":"module" },
|
"dependencies" : { "clock_info":"module" },
|
||||||
"storage": [
|
"storage": [
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"screenshots": [{"url":"screenshot.png"}, {"url":"screenshot_2.png"}],
|
"screenshots": [{"url":"screenshot.png"}, {"url":"screenshot_2.png"}],
|
||||||
"type": "clock",
|
"type": "clock",
|
||||||
"tags": "clock",
|
"tags": "clock,clkinfo",
|
||||||
"supports": ["BANGLEJS2"],
|
"supports": ["BANGLEJS2"],
|
||||||
"dependencies" : { "clock_info":"module" },
|
"dependencies" : { "clock_info":"module" },
|
||||||
"storage": [
|
"storage": [
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
"description": "Scheduling library for alarms and timers",
|
"description": "Scheduling library for alarms and timers",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"type": "scheduler",
|
"type": "scheduler",
|
||||||
"tags": "tool,system,alarm",
|
"tags": "tool,system,alarm,clkinfo",
|
||||||
"supports": ["BANGLEJS","BANGLEJS2"],
|
"supports": ["BANGLEJS","BANGLEJS2"],
|
||||||
"provides_modules" : ["sched"],
|
"provides_modules" : ["sched"],
|
||||||
"default" : true,
|
"default" : true,
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"screenshots": [{"url":"screenshot3.png"}],
|
"screenshots": [{"url":"screenshot3.png"}],
|
||||||
"type": "clock",
|
"type": "clock",
|
||||||
"tags": "clock",
|
"tags": "clock,clkinfo",
|
||||||
"supports": ["BANGLEJS2"],
|
"supports": ["BANGLEJS2"],
|
||||||
"dependencies" : { "clock_info":"module" },
|
"dependencies" : { "clock_info":"module" },
|
||||||
"storage": [
|
"storage": [
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"screenshots": [{"url":"screenshot.png"}],
|
"screenshots": [{"url":"screenshot.png"}],
|
||||||
"type": "clock",
|
"type": "clock",
|
||||||
"tags": "clock",
|
"tags": "clock,clkinfo",
|
||||||
"supports" : ["BANGLEJS2"],
|
"supports" : ["BANGLEJS2"],
|
||||||
"dependencies" : { "clock_info":"module" },
|
"dependencies" : { "clock_info":"module" },
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
|
|
|
@ -116,7 +116,7 @@ apps.forEach((app,appIdx) => {
|
||||||
if (!app.id) ERROR(`App ${appIdx} has no id`);
|
if (!app.id) ERROR(`App ${appIdx} has no id`);
|
||||||
var appDirRelative = APPSDIR_RELATIVE+app.id+"/";
|
var appDirRelative = APPSDIR_RELATIVE+app.id+"/";
|
||||||
var appDir = APPSDIR+app.id+"/";
|
var appDir = APPSDIR+app.id+"/";
|
||||||
var metadataFile = appDirRelative+"metadata.json";
|
var metadataFile = appDirRelative+"metadata.json";
|
||||||
if (existingApps.includes(app.id)) ERROR(`Duplicate app '${app.id}'`, {file:metadataFile});
|
if (existingApps.includes(app.id)) ERROR(`Duplicate app '${app.id}'`, {file:metadataFile});
|
||||||
existingApps.push(app.id);
|
existingApps.push(app.id);
|
||||||
//console.log(`Checking ${app.id}...`);
|
//console.log(`Checking ${app.id}...`);
|
||||||
|
@ -124,6 +124,7 @@ apps.forEach((app,appIdx) => {
|
||||||
if (!fs.existsSync(APPSDIR+app.id)) ERROR(`App ${app.id} has no directory`);
|
if (!fs.existsSync(APPSDIR+app.id)) ERROR(`App ${app.id} has no directory`);
|
||||||
if (!app.name) ERROR(`App ${app.id} has no name`, {file:metadataFile});
|
if (!app.name) ERROR(`App ${app.id} has no name`, {file:metadataFile});
|
||||||
var isApp = !app.type || app.type=="app";
|
var isApp = !app.type || app.type=="app";
|
||||||
|
var appTags = app.tags ? app.tags.split(",") : [];
|
||||||
if (app.name.length>20 && !app.shortName && isApp) ERROR(`App ${app.id} has a long name, but no shortName`, {file:metadataFile});
|
if (app.name.length>20 && !app.shortName && isApp) ERROR(`App ${app.id} has a long name, but no shortName`, {file:metadataFile});
|
||||||
if (app.type && !METADATA_TYPES.includes(app.type))
|
if (app.type && !METADATA_TYPES.includes(app.type))
|
||||||
ERROR(`App ${app.id} 'type' is one one of `+METADATA_TYPES, {file:metadataFile});
|
ERROR(`App ${app.id} 'type' is one one of `+METADATA_TYPES, {file:metadataFile});
|
||||||
|
@ -174,6 +175,8 @@ apps.forEach((app,appIdx) => {
|
||||||
if (app.customConnect && !app.custom) ERROR(`App ${app.id} has customConnect but no customn HTML`, {file:metadataFile});
|
if (app.customConnect && !app.custom) ERROR(`App ${app.id} has customConnect but no customn HTML`, {file:metadataFile});
|
||||||
if (app.interface && !fs.existsSync(appDir+app.interface)) ERROR(`App ${app.id} interface HTML doesn't exist`, {file:metadataFile});
|
if (app.interface && !fs.existsSync(appDir+app.interface)) ERROR(`App ${app.id} interface HTML doesn't exist`, {file:metadataFile});
|
||||||
if (app.dependencies) {
|
if (app.dependencies) {
|
||||||
|
if (app.dependencies.clock_info && !appTags.includes("clkinfo"))
|
||||||
|
WARN(`App ${app.id} uses clock_info but doesn't have clkinfo tag`, {file:metadataFile});
|
||||||
if (("object"==typeof app.dependencies) && !Array.isArray(app.dependencies)) {
|
if (("object"==typeof app.dependencies) && !Array.isArray(app.dependencies)) {
|
||||||
Object.keys(app.dependencies).forEach(dependency => {
|
Object.keys(app.dependencies).forEach(dependency => {
|
||||||
if (!["type","app","module","widget"].includes(app.dependencies[dependency]))
|
if (!["type","app","module","widget"].includes(app.dependencies[dependency]))
|
||||||
|
@ -185,6 +188,8 @@ apps.forEach((app,appIdx) => {
|
||||||
ERROR(`App ${app.id} 'dependencies' must be an object`, {file:metadataFile});
|
ERROR(`App ${app.id} 'dependencies' must be an object`, {file:metadataFile});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (app.storage.find(f=>f.name.endsWith(".clkinfo.js")) && !appTags.includes("clkinfo"))
|
||||||
|
WARN(`App ${app.id} provides ...clkinfo.js but doesn't have clkinfo tag`, {file:metadataFile});
|
||||||
var fileNames = [];
|
var fileNames = [];
|
||||||
app.storage.forEach((file) => {
|
app.storage.forEach((file) => {
|
||||||
if (!file.name) ERROR(`App ${app.id} has a file with no name`, {file:metadataFile});
|
if (!file.name) ERROR(`App ${app.id} has a file with no name`, {file:metadataFile});
|
||||||
|
|
Loading…
Reference in New Issue