Skip to content

Commit 53fc814

Browse files
khasselMichMichKristjanESPERANTOdependabot[bot]crazyscot
authored
Release 2.28.0 (#3490)
## [2.28.0] - 2024-07-01 Thanks to: @btoconnor, @bugsounet, @JasonStieber, @khassel, @kleinmantara and @WallysWellies. > ⚠️ This release needs nodejs version >= v20 ### Added - [calendar] Added config option "showEndsOnlyWithDuration" for default calendar - [compliments] Added `specialDayUnique` config option, defaults to `false` (#3465) - [weather] Provider weathergov: Use `precipitationLast3Hours` if `precipitationLastHour` is `null` (#3124) ### Removed - [tests] delete node v18 support (#3462) ### Updated - [core] Update dependencies including electron to v31 - [core] use node >= v20 (#3462) - [core] Update `config.js.sample` to use openmeteo as weather provider which needs no api key - [tests] Use latest@version of node for `automated-tests.yaml` (#3483) - [updatenotification] Avoid using pm2 when running in docker container ### Fixed - [core] Fixed crash possibility if `module: <name>` is not defined and on `postion: <positon>` mistake (#3445) - [weather] Fixed precipitationProbability in forecast for provider openmeteo (#3446) - [weather] Fixed type=daily for provider openmeteo having no data when running after 23:00 (#3449) - [weather] Fixed type=daily for provider openmeteo showing nightly icons in forecast when current time is "nightly" (#3458) - [weather] Fixed forecast and hourly weather for provider openmeteo to use real temperatures, not apparent temperatures (#3466) - [tests] Fixed e2e tests running in docker container which needs `address: "0.0.0.0"` (#3479) --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Michael Teeuw <[email protected]> Co-authored-by: Kristjan ESPERANTO <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ross Younger <[email protected]> Co-authored-by: Veeck <[email protected]> Co-authored-by: Bugsounet - Cédric <[email protected]> Co-authored-by: jkriegshauser <[email protected]> Co-authored-by: illimarkangur <[email protected]> Co-authored-by: sam detweiler <[email protected]> Co-authored-by: vppencilsharpener <[email protected]> Co-authored-by: veeck <[email protected]> Co-authored-by: Paranoid93 <[email protected]> Co-authored-by: Brian O'Connor <[email protected]> Co-authored-by: WallysWellies <[email protected]> Co-authored-by: Jason Stieber <[email protected]>
1 parent 5ea8a34 commit 53fc814

File tree

23 files changed

+2342
-1266
lines changed

23 files changed

+2342
-1266
lines changed

.github/workflows/automated-tests.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@ jobs:
1818
timeout-minutes: 30
1919
strategy:
2020
matrix:
21-
node-version: [18.x, 20.x, 21.x]
21+
node-version: [20.x, 22.x]
2222
steps:
2323
- name: "Checkout code"
2424
uses: actions/checkout@v4
2525
- name: "Use Node.js ${{ matrix.node-version }}"
2626
uses: actions/setup-node@v4
2727
with:
2828
node-version: ${{ matrix.node-version }}
29+
check-latest: true
2930
cache: "npm"
3031
- name: "Install dependencies"
3132
run: |

.github/workflows/electronRebuild.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,17 @@ jobs:
66
rebuild:
77
name: Run electron-rebuild
88
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
node-version: [20.x, 22.x]
912
steps:
1013
- name: Checkout code
1114
uses: actions/checkout@v4
15+
- name: "Use Node.js ${{ matrix.node-version }}"
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: ${{ matrix.node-version }}
19+
check-latest: true
1220
- name: Install MagicMirror
1321
run: npm run install-mm
1422
- name: Install @electron/rebuild

CHANGELOG.md

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,39 @@ This project adheres to [Semantic Versioning](https://semver.org/).
55

66
❤️ **Donate:** Enjoying MagicMirror²? [Please consider a donation!](https://magicmirror.builders/#donate) With your help we can continue to improve the MagicMirror².
77

8+
## [2.28.0] - 2024-07-01
9+
10+
Thanks to: @btoconnor, @bugsounet, @JasonStieber, @khassel, @kleinmantara and @WallysWellies.
11+
12+
> ⚠️ This release needs nodejs version >= v20
13+
14+
### Added
15+
16+
- [calendar] Added config option "showEndsOnlyWithDuration" for default calendar
17+
- [compliments] Added `specialDayUnique` config option, defaults to `false` (#3465)
18+
- [weather] Provider weathergov: Use `precipitationLast3Hours` if `precipitationLastHour` is `null` (#3124)
19+
20+
### Removed
21+
22+
- [tests] delete node v18 support (#3462)
23+
24+
### Updated
25+
26+
- [core] Update dependencies including electron to v31
27+
- [core] use node >= v20 (#3462)
28+
- [core] Update `config.js.sample` to use openmeteo as weather provider which needs no api key
29+
- [tests] Use latest@version of node for `automated-tests.yaml` (#3483)
30+
- [updatenotification] Avoid using pm2 when running in docker container
31+
32+
### Fixed
33+
34+
- [core] Fixed crash possibility if `module: <name>` is not defined and on `postion: <positon>` mistake (#3445)
35+
- [weather] Fixed precipitationProbability in forecast for provider openmeteo (#3446)
36+
- [weather] Fixed type=daily for provider openmeteo having no data when running after 23:00 (#3449)
37+
- [weather] Fixed type=daily for provider openmeteo showing nightly icons in forecast when current time is "nightly" (#3458)
38+
- [weather] Fixed forecast and hourly weather for provider openmeteo to use real temperatures, not apparent temperatures (#3466)
39+
- [tests] Fixed e2e tests running in docker container which needs `address: "0.0.0.0"` (#3479)
40+
841
## [2.27.0] - 2024-04-01
942

1043
Thanks to: @bugsounet, @crazyscot, @illimarkangur, @jkriegshauser, @khassel, @KristjanESPERANTO, @Paranoid93, @rejas, @sdetweil and @vppencilsharpener.
@@ -16,7 +49,7 @@ For more info, please read the following post: [A New Chapter for MagicMirror: T
1649
### Added
1750

1851
- Output of system information to the console for troubleshooting (#3328 and #3337), ignore errors under aarch64 (#3349)
19-
- [chore] Add `eslint-plugin-package-json` to lint the `package.json` files (#3368)
52+
- [core] Add `eslint-plugin-package-json` to lint the `package.json` files (#3368)
2053
- [weather] `showHumidity` config is now a string describing where to show this element. Supported values: "wind", "temp", "feelslike", "below", "none". (#3330)
2154
- electron-rebuild test suite for electron and 3rd party modules compatibility (#3392)
2255
- Create MM² icon and attach it to electron process (#3407)
@@ -28,8 +61,8 @@ For more info, please read the following post: [A New Chapter for MagicMirror: T
2861
- Use node prefix for build-in modules (#3340)
2962
- Rework logging colors (#3350)
3063
- Update pm2 to v5.3.1 with no allow-ghsas (#3364)
31-
- [chore] Update husky and let lint-staged fix ESLint issues
32-
- [chore] Update dependencies including electron to v29 (#3357) and node-ical
64+
- [core] Update husky and let lint-staged fix ESLint issues
65+
- [core] Update dependencies including electron to v29 (#3357) and node-ical
3366
- Update translations for estonian (#3371)
3467
- Update electron to v29 and update other dependencies
3568
- [calendar] fullDay events over several days now show the left days from the first day on and 'today' on the last day
@@ -51,9 +84,9 @@ For more info, please read the following post: [A New Chapter for MagicMirror: T
5184
- added message in case where config.js is missing the module.export line PR #3383
5285
- Fixed an issue where recurring events could extend past their recurrence end date (#3393)
5386
- Don't display any `npm WARN <....>` on install (#3399)
54-
- Fixed move suncalc dependency to production from dev, as it is used by clock module
87+
- [core] Moved suncalc dependency to production from dev, as it is used by clock module
5588
- [compliments] Fix mirror not responding anymore when no compliments are to be shown (#3385)
56-
- [chore] Fixed mastermerge workflow (#3415)
89+
- [core] Fixed mastermerge workflow (#3415)
5790

5891
### Deleted
5992

@@ -87,7 +120,7 @@ This release also marks the latest release by Michael Teeuw. For more info, plea
87120
- Update electron to v27 and update other dependencies as well as github actions
88121
- Update newsfeed: Use `html-to-text` instead of regex for transform description
89122
- Review ESLint config (#3269)
90-
- Updated dependencies
123+
- Update dependencies
91124
- Clock module: optionally display current moon phase in addition to rise/set times
92125
- electron is now per default started without gpu, if needed it must be enabled with new env var `ELECTRON_ENABLE_GPU=1` on startup (#3226)
93126
- Replace prettier by stylistic in ESLint config to lint JavaScript (and disable some rules for `config/config.js*` files)

config/config.js.sample

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,23 +67,21 @@ let config = {
6767
module: "weather",
6868
position: "top_right",
6969
config: {
70-
weatherProvider: "openweathermap",
70+
weatherProvider: "openmeteo",
7171
type: "current",
72-
location: "New York",
73-
locationID: "5128581", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
74-
apiKey: "YOUR_OPENWEATHER_API_KEY"
72+
lat: 40.776676,
73+
lon: -73.971321
7574
}
7675
},
7776
{
7877
module: "weather",
7978
position: "top_right",
8079
header: "Weather Forecast",
8180
config: {
82-
weatherProvider: "openweathermap",
81+
weatherProvider: "openmeteo",
8382
type: "forecast",
84-
location: "New York",
85-
locationID: "5128581", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
86-
apiKey: "YOUR_OPENWEATHER_API_KEY"
83+
lat: 40.776676,
84+
lon: -73.971321
8785
}
8886
},
8987
{

fonts/package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fonts/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
"name": "magicmirror-fonts",
33
"version": "1.0.0",
44
"description": "Package for fonts use by MagicMirror² core.",
5+
"bugs": {
6+
"url": "https://github.com/MagicMirrorOrg/MagicMirror/issues"
7+
},
58
"repository": {
69
"type": "git",
710
"url": "https://github.com/MagicMirrorOrg/MagicMirror"
811
},
912
"license": "MIT",
10-
"bugs": {
11-
"url": "https://github.com/MagicMirrorOrg/MagicMirror/issues"
12-
},
1313
"dependencies": {
14-
"@fontsource/roboto": "^5.0.12",
15-
"@fontsource/roboto-condensed": "^5.0.15"
14+
"@fontsource/roboto": "^5.0.13",
15+
"@fontsource/roboto-condensed": "^5.0.16"
1616
}
1717
}

js/app.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ function App () {
5858
async function loadConfig () {
5959
Log.log("Loading config ...");
6060
const defaults = require(`${__dirname}/defaults`);
61+
if (process.env.JEST_WORKER_ID !== undefined) {
62+
// if we are running with jest
63+
defaults.address = "0.0.0.0";
64+
}
6165

6266
// For this check proposed to TestSuite
6367
// https://forum.magicmirror.builders/topic/1456/test-suite-for-magicmirror/8
@@ -253,8 +257,15 @@ function App () {
253257

254258
let modules = [];
255259
for (const module of config.modules) {
256-
if (!modules.includes(module.module) && !module.disabled) {
257-
modules.push(module.module);
260+
if (module.disabled) continue;
261+
if (module.module) {
262+
if (Utils.moduleHasValidPosition(module.position) || typeof (module.position) === "undefined") {
263+
modules.push(module.module);
264+
} else {
265+
Log.warn("Invalid module position found for this configuration:", module);
266+
}
267+
} else {
268+
Log.warn("No module name found for this configuration:", module);
258269
}
259270
}
260271

js/check_config.js

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ const { Linter } = require("eslint");
55

66
const linter = new Linter();
77

8+
const Ajv = require("ajv");
9+
10+
const ajv = new Ajv();
11+
812
const rootPath = path.resolve(`${__dirname}/../`);
913
const Log = require(`${rootPath}/js/logger.js`);
1014

@@ -59,6 +63,68 @@ function checkConfigFile () {
5963
for (const error of errors) {
6064
Log.error(`Line ${error.line} column ${error.column}: ${error.message}`);
6165
}
66+
return;
67+
}
68+
69+
Log.info("Checking modules structure configuration... ");
70+
71+
// Make Ajv schema confguration of modules config
72+
// only scan "module" and "position"
73+
const schema = {
74+
type: "object",
75+
properties: {
76+
modules: {
77+
type: "array",
78+
items: {
79+
type: "object",
80+
properties: {
81+
module: {
82+
type: "string"
83+
},
84+
position: {
85+
type: "string",
86+
enum: [
87+
"top_bar",
88+
"top_left",
89+
"top_center",
90+
"top_right",
91+
"upper_third",
92+
"middle_center",
93+
"lower_third",
94+
"bottom_left",
95+
"bottom_center",
96+
"bottom_right",
97+
"bottom_bar",
98+
"fullscreen_above",
99+
"fullscreen_below"
100+
]
101+
}
102+
},
103+
required: ["module"]
104+
}
105+
}
106+
}
107+
};
108+
109+
// scan all modules
110+
const validate = ajv.compile(schema);
111+
const data = require(configFileName);
112+
113+
const valid = validate(data);
114+
if (!valid) {
115+
let module = validate.errors[0].instancePath.split("/")[2];
116+
let position = validate.errors[0].instancePath.split("/")[3];
117+
118+
Log.error(colors.red("This module configuration contains errors:"));
119+
Log.error(data.modules[module]);
120+
if (position) {
121+
Log.error(colors.red(`${position}: ${validate.errors[0].message}`));
122+
Log.error(validate.errors[0].params.allowedValues);
123+
} else {
124+
Log.error(colors.red(validate.errors[0].message));
125+
}
126+
} else {
127+
Log.info(colors.green("Your modules structure configuration doesn't contain errors :)"));
62128
}
63129
}
64130

js/loader.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ const Loader = (function () {
5050
* @returns {object[]} module data as configured in config
5151
*/
5252
const getAllModules = function () {
53-
return config.modules;
53+
const AllModules = config.modules.filter((module) => (module.module !== undefined) && (MM.getAvailableModulePositions.indexOf(module.position) > -1 || typeof (module.position) === "undefined"));
54+
return AllModules;
5455
};
5556

5657
/**

js/main.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,10 @@ const MM = (function () {
450450
* an ugly top margin. By using this function, the top bar will be hidden if the
451451
* update notification is not visible.
452452
*/
453-
const updateWrapperStates = function () {
454-
const positions = ["top_bar", "top_left", "top_center", "top_right", "upper_third", "middle_center", "lower_third", "bottom_left", "bottom_center", "bottom_right", "bottom_bar", "fullscreen_above", "fullscreen_below"];
453+
const modulePositions = ["top_bar", "top_left", "top_center", "top_right", "upper_third", "middle_center", "lower_third", "bottom_left", "bottom_center", "bottom_right", "bottom_bar", "fullscreen_above", "fullscreen_below"];
455454

456-
positions.forEach(function (position) {
455+
const updateWrapperStates = function () {
456+
modulePositions.forEach(function (position) {
457457
const wrapper = selectWrapper(position);
458458
const moduleWrappers = wrapper.getElementsByClassName("module");
459459

@@ -701,7 +701,10 @@ const MM = (function () {
701701
showModule (module, speed, callback, options) {
702702
// do not change module.hidden yet, only if we really show it later
703703
showModule(module, speed, callback, options);
704-
}
704+
},
705+
706+
// return all available module postions.
707+
getAvailableModulePositions: modulePositions
705708
};
706709
}());
707710

0 commit comments

Comments
 (0)