diff --git a/README.md b/README.md index 78dd1b492..e5d8333aa 100644 --- a/README.md +++ b/README.md @@ -257,12 +257,18 @@ and which gives information about the app for the Launcher. // 'app' - an application // 'clock' - a clock - required for clocks to automatically start // 'widget' - a widget - // 'launch' - replacement launcher app - // 'bootloader' - code that runs at startup only + // 'bootloader' - an app that at startup (app.boot.js) but doesn't have a launcher entry for 'app.js' // 'RAM' - code that runs and doesn't upload anything to storage + // 'launch' - replacement 'Launcher' + // 'textinput' - provides a 'textinput' library that allows text to be input on the Bangle + // 'scheduler' - provides 'sched' library and boot code for scheduling alarms/timers + // (currently only 'sched' app) + // 'notify' - provides 'notify' library for showing notifications + // 'locale' - provides 'locale' library for language-specific date/distance/etc + // (a version of 'locale' is included in the firmware) "tags": "", // comma separated tag list for searching "supports": ["BANGLEJS2"], // List of device IDs supported, either BANGLEJS or BANGLEJS2 - "dependencies" : { "notify":"type" } // optional, app 'types' we depend on + "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' "readme": "README.md", // if supplied, a link to a markdown-style text file diff --git a/apps/hrmaccevents/metadata.json b/apps/hrmaccevents/metadata.json index de59dceac..7207f685a 100644 --- a/apps/hrmaccevents/metadata.json +++ b/apps/hrmaccevents/metadata.json @@ -3,7 +3,7 @@ "name": "HRM Accelerometer event recorder", "shortName": "HRM ACC recorder", "version": "0.01", - "type": "ram", + "type": "RAM", "description": "Record HRM and accelerometer events in high resolution to CSV files in your browser", "icon": "app.png", "tags": "debug", diff --git a/apps/menusmall/metadata.json b/apps/menusmall/metadata.json index aafb7da28..51ab825bd 100644 --- a/apps/menusmall/metadata.json +++ b/apps/menusmall/metadata.json @@ -4,7 +4,7 @@ "version": "0.02", "description": "Replace Bangle.js 2's menus with a version that contains smaller text", "icon": "app.png", - "type": "boot", + "type": "bootloader", "tags": "system", "supports": ["BANGLEJS2"], "storage": [ diff --git a/apps/menuwheel/metadata.json b/apps/menuwheel/metadata.json index 1ad042344..5f49b640c 100644 --- a/apps/menuwheel/metadata.json +++ b/apps/menuwheel/metadata.json @@ -9,7 +9,7 @@ {"url":"screenshot_b1_dark.png"},{"url":"screenshot_b1_edit.png"},{"url":"screenshot_b1_light.png"}, {"url":"screenshot_b2_dark.png"},{"url":"screenshot_b2_edit.png"},{"url":"screenshot_b2_light.png"} ], - "type": "boot", + "type": "bootloader", "tags": "system", "supports": ["BANGLEJS","BANGLEJS2"], "storage": [ diff --git a/apps/mmind/mmind.info b/apps/mmind/mmind.info index 2e79822b1..b4b822508 100644 --- a/apps/mmind/mmind.info +++ b/apps/mmind/mmind.info @@ -5,7 +5,7 @@ "icon": "mmind.png", "version":"0.01", "description": "This is the classic game for masterminds", - "type": "game", + "type": "app", "tags": "mastermind, game, classic", "readme":"README.md", "supports": ["BANGLEJS2"], diff --git a/apps/mysticdock/metadata.json b/apps/mysticdock/metadata.json index 54ebedd93..2775b0b72 100644 --- a/apps/mysticdock/metadata.json +++ b/apps/mysticdock/metadata.json @@ -4,7 +4,7 @@ "version": "0.01", "description": "A retro-inspired dockface that displays the current time and battery charge while plugged in, and which features an interactive mode that shows the time, date, and a rotating data display line.", "icon": "mystic-dock.png", - "type": "dock", + "type": "app", "tags": "dock", "supports": ["BANGLEJS"], "readme": "README.md", diff --git a/apps/promenu/metadata.json b/apps/promenu/metadata.json index 443809004..e0124467a 100644 --- a/apps/promenu/metadata.json +++ b/apps/promenu/metadata.json @@ -4,7 +4,7 @@ "version": "0.02", "description": "Replace the built in menu function. Supports Bangle.js 1 and Bangle.js 2.", "icon": "icon.png", - "type": "boot", + "type": "bootloader", "tags": "system", "supports": ["BANGLEJS","BANGLEJS2"], "readme": "README.md", diff --git a/apps/swp2clk/metadata.json b/apps/swp2clk/metadata.json index aa95a6473..8b0cce2d8 100644 --- a/apps/swp2clk/metadata.json +++ b/apps/swp2clk/metadata.json @@ -5,7 +5,7 @@ "version": "0.01", "description": "Let's you swipe from left to right on any app to return back to the clock face. Please configure in the settings app after installing to activate, since its disabled by default.", "icon": "app.png", - "type": "boot", + "type": "bootloader", "tags": "tools", "supports": ["BANGLEJS2"], "readme": "README.md", diff --git a/bin/sanitycheck.js b/bin/sanitycheck.js index 8fdb5a4d2..850b793f4 100755 --- a/bin/sanitycheck.js +++ b/bin/sanitycheck.js @@ -65,6 +65,7 @@ const APP_KEYS = [ const STORAGE_KEYS = ['name', 'url', 'content', 'evaluate', 'noOverwite', 'supports']; const DATA_KEYS = ['name', 'wildcard', 'storageFile', 'url', 'content', 'evaluate']; const SUPPORTS_DEVICES = ["BANGLEJS","BANGLEJS2"]; // device IDs allowed for 'supports' +const METADATA_TYPES = ["app","clock","widget","bootloader","RAM","launch","textinput","scheduler","notify","locale"]; // values allowed for "type" field const FORBIDDEN_FILE_NAME_CHARS = /[,;]/; // used as separators in appid.info const VALID_DUPLICATES = [ '.tfmodel', '.tfnames' ]; const GRANDFATHERED_ICONS = ["s7clk", "snek", "astral", "alpinenav", "slomoclock", "arrow", "pebble", "rebble"]; @@ -94,6 +95,8 @@ apps.forEach((app,appIdx) => { if (!app.name) ERROR(`App ${app.id} has no name`); var isApp = !app.type || app.type=="app"; if (app.name.length>20 && !app.shortName && isApp) ERROR(`App ${app.id} has a long name, but no shortName`); + if (app.type && !METADATA_TYPES.includes(app.type)) + ERROR(`App ${app.id} 'type' is one one of `+METADATA_TYPES); if (!Array.isArray(app.supports)) ERROR(`App ${app.id} has no 'supports' field or it's not an array`); else { app.supports.forEach(dev => { @@ -135,6 +138,9 @@ apps.forEach((app,appIdx) => { Object.keys(app.dependencies).forEach(dependency => { if (!["type","app"].includes(app.dependencies[dependency])) ERROR(`App ${app.id} 'dependencies' must all be tagged 'type' or 'app' right now`); + if (app.dependencies[dependency]=="type" && !METADATA_TYPES.includes(dependency)) + ERROR(`App ${app.id} 'type' dependency must be one of `+METADATA_TYPES); + }); } else ERROR(`App ${app.id} 'dependencies' must be an object`);