test for using some libs without depending on them

master
Gordon Williams 2025-05-14 15:12:03 +01:00
parent 4e967bad6c
commit 37ca389a52
2 changed files with 7 additions and 2 deletions

View File

@ -3,12 +3,13 @@
"name": "Meridian Clock", "name": "Meridian Clock",
"shortName": "Meridian", "shortName": "Meridian",
"version": "0.01", "version": "0.01",
"description": "An elegant clock", "description": "An elegant clock with two ClockInfos",
"screenshots": [{ "url": "screenshot.png" }], "screenshots": [{ "url": "screenshot.png" }],
"icon": "icon.png", "icon": "icon.png",
"type": "clock", "type": "clock",
"tags": "clock", "tags": "clock,clkinfo",
"supports": ["BANGLEJS2"], "supports": ["BANGLEJS2"],
"dependencies" : { "clock_info":"module" },
"readme": "README.md", "readme": "README.md",
"storage": [ "storage": [
{ "name": "meridian.app.js", "url": "app.js" }, { "name": "meridian.app.js", "url": "app.js" },

View File

@ -343,6 +343,10 @@ apps.forEach((app,appIdx) => {
if (a>=0 && b>=0 && a<b) if (a>=0 && b>=0 && a<b)
WARN(`Clock ${app.id} file calls loadWidgets before setUI (clock widget/etc won't be aware a clock app is running)`, {file:appDirRelative+file.url, line : fileContents.substr(0,a).split("\n").length}); WARN(`Clock ${app.id} file calls loadWidgets before setUI (clock widget/etc won't be aware a clock app is running)`, {file:appDirRelative+file.url, line : fileContents.substr(0,a).split("\n").length});
} }
if (fileContents.includes("clock_info") && (!app.dependencies || !app.dependencies.clock_info) && !["boot","clock_info"].includes(app.id))
ERROR(`App ${app.id}'s uses clock_info but doesn't have a dependency on it`, {file:appDirRelative+file.url});
if (fileContents.includes("clockbg") && (!app.dependencies || !app.dependencies.clockbg) && !["clockbg"].includes(app.id))
ERROR(`App ${app.id}'s uses clockbg but doesn't have a dependency on it`, {file:appDirRelative+file.url});
// if settings // if settings
if (/\.settings?\.js$/.test(file.name)) { if (/\.settings?\.js$/.test(file.name)) {
// suggest adding to datafiles // suggest adding to datafiles