Merge pull request #3 from MichMich/develop

Sync with Develop
This commit is contained in:
ashishtank 2020-10-02 18:06:24 +02:00 committed by GitHub
commit 86d7ec6270
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 1560 additions and 1334 deletions

View File

@ -5,13 +5,23 @@ This project adheres to [Semantic Versioning](https://semver.org/).
❤️ **Donate:** Enjoying MagicMirror²? [Please consider a donation!](https://magicmirror.builders/donate) With your help we can continue to improve the MagicMirror² ❤️ **Donate:** Enjoying MagicMirror²? [Please consider a donation!](https://magicmirror.builders/donate) With your help we can continue to improve the MagicMirror²
### fixed ## [2.14.0] - Unreleased (Develop Branch)
- 2110, 2111, 2118 recurring full day events should not use timezone adjustment. just compare month/day _This release is scheduled to be released on 2021-01-01._
## [2.13.0] - Unreleased (Develop Branch - Please add your contributions to this release.) ### Added
_This release is scheduled to be released on 2020-10-01._ ### Updated
### Deleted
### Fixed
## [2.13.0] - 2020-10-01
Special thanks to the following contributors: @bryanzzhu, @bugsounet, @chamakura, @cjbrunner, @easyas314, @larryare, @oemel09, @rejas, @sdetweil & @sthuber90.
**Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`.
### Added ### Added
@ -21,9 +31,10 @@ _This release is scheduled to be released on 2020-10-01._
- Test coverage with Istanbul, run it with `npm run test:coverage`. - Test coverage with Istanbul, run it with `npm run test:coverage`.
- Add lithuanian language. - Add lithuanian language.
- Added support in weatherforecast for OpenWeather onecall API. - Added support in weatherforecast for OpenWeather onecall API.
- Added config option to calendar-icons for recurring- and fullday-events - Added config option to calendar-icons for recurring- and fullday-events.
- Added current, hourly (max 48), and daily (max 7) weather forecasts to weather module via OpenWeatherMap One Call API - Added current, hourly (max 48), and daily (max 7) weather forecasts to weather module via OpenWeatherMap One Call API.
- Added eslint-plugin for jsdoc comments - Added eslint-plugin for jsdoc comments.
- Added new configDeepMerge option for module developers.
### Updated ### Updated
@ -31,8 +42,8 @@ _This release is scheduled to be released on 2020-10-01._
- Cleaned up newsfeed module. - Cleaned up newsfeed module.
- Cleaned up jsdoc comments. - Cleaned up jsdoc comments.
- Cleaned up clock tests. - Cleaned up clock tests.
- Move lodash into devDependencies, update other dependencies.
### Deleted - Switch from ical to node-ical library.
### Fixed ### Fixed
@ -43,6 +54,7 @@ _This release is scheduled to be released on 2020-10-01._
- Fix incorrect namespace links in svg clockfaces. [#2072](https://github.com/MichMich/MagicMirror/issues/2072) - Fix incorrect namespace links in svg clockfaces. [#2072](https://github.com/MichMich/MagicMirror/issues/2072)
- Fix weather/providers/weathergov for API guidelines. [#2045](https://github.com/MichMich/MagicMirror/issues/2045) - Fix weather/providers/weathergov for API guidelines. [#2045](https://github.com/MichMich/MagicMirror/issues/2045)
- Fix "undefined" in weather modules header. [#1985](https://github.com/MichMich/MagicMirror/issues/1985) - Fix "undefined" in weather modules header. [#1985](https://github.com/MichMich/MagicMirror/issues/1985)
- Fix #2110, #2111, #2118: Recurring full day events should not use timezone adjustment. Just compare month/day.
## [2.12.0] - 2020-07-01 ## [2.12.0] - 2020-07-01
@ -135,6 +147,7 @@ For more information regarding this major change, please check issue [#1860](htt
- Timestamp in log output now also contains the date - Timestamp in log output now also contains the date
- Turkish translation. - Turkish translation.
- Option to configure the size of the currentweather module. - Option to configure the size of the currentweather module.
- Changed "Gevoelstemperatuur" to "Voelt als" shorter text.
## [2.10.1] - 2020-01-10 ## [2.10.1] - 2020-01-10

View File

@ -1,6 +1,6 @@
# The MIT License (MIT) # The MIT License (MIT)
Copyright © 2016-2019 Michael Teeuw Copyright © 2016-2020 Michael Teeuw
Permission is hereby granted, free of charge, to any person Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation obtaining a copy of this software and associated documentation

View File

@ -98,6 +98,7 @@ var Loader = (function () {
file: moduleName + ".js", file: moduleName + ".js",
position: moduleData.position, position: moduleData.position,
header: moduleData.header, header: moduleData.header,
configDeepMerge: typeof moduleData.configDeepMerge === "boolean" ? moduleData.configDeepMerge : false,
config: moduleData.config, config: moduleData.config,
classes: typeof moduleData.classes !== "undefined" ? moduleData.classes + " " + module : module classes: typeof moduleData.classes !== "undefined" ? moduleData.classes + " " + module : module
}); });

View File

@ -221,16 +221,17 @@ var Module = Class.extend({
this.identifier = data.identifier; this.identifier = data.identifier;
this.hidden = false; this.hidden = false;
this.setConfig(data.config); this.setConfig(data.config, data.configDeepMerge);
}, },
/** /**
* Set the module config and combine it with the module defaults. * Set the module config and combine it with the module defaults.
* *
* @param {object} config The combined module config. * @param {object} config The combined module config.
* @param {boolean} config Merge module config in deep.
*/ */
setConfig: function (config) { setConfig: function (config, deep) {
this.config = Object.assign({}, this.defaults, config); this.config = deep ? configMerge({}, this.defaults, config) : Object.assign({}, this.defaults, config);
}, },
/** /**
@ -440,6 +441,48 @@ var Module = Class.extend({
} }
}); });
/** Merging MagicMirror (or other) default/config script
* merge 2 objects or/with array
* using:
* -------
* this.config = configMerge({}, this.defaults, this.config)
* -------
* arg1: initial objet
* arg2: config model
* arg3: config to merge
* -------
* why using it ?
* Object.assign() function don't to all job
* it don't merge all thing in deep
* -> object in object and array is not merging
* -------
* @bugsounet
* @Todo: idea of Mich determinate what do you want to merge or not
*/
function configMerge(result) {
var stack = Array.prototype.slice.call(arguments, 1);
var item;
var key;
while (stack.length) {
item = stack.shift();
for (key in item) {
if (item.hasOwnProperty(key)) {
if (typeof result[key] === "object" && result[key] && Object.prototype.toString.call(result[key]) !== "[object Array]") {
if (typeof item[key] === "object" && item[key] !== null) {
result[key] = configMerge({}, result[key], item[key]);
} else {
result[key] = item[key];
}
} else {
result[key] = item[key];
}
}
}
}
return result;
}
Module.definitions = {}; Module.definitions = {};
Module.create = function (name) { Module.create = function (name) {

View File

@ -5,7 +5,7 @@
* MIT Licensed. * MIT Licensed.
*/ */
const Log = require("../../../js/logger.js"); const Log = require("../../../js/logger.js");
const ical = require("ical"); const ical = require("node-ical");
const request = require("request"); const request = require("request");
/** /**
@ -240,7 +240,6 @@ const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEn
const dateKey = date.toISOString().substring(0, 10); const dateKey = date.toISOString().substring(0, 10);
let curEvent = event; let curEvent = event;
let showRecurrence = true; let showRecurrence = true;
let duration = 0;
startDate = moment(date); startDate = moment(date);

2732
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "magicmirror", "name": "magicmirror",
"version": "2.13.0-develop", "version": "2.14.0-develop",
"description": "The open source modular smart mirror platform.", "description": "The open source modular smart mirror platform.",
"main": "js/electron.js", "main": "js/electron.js",
"scripts": { "scripts": {
@ -46,19 +46,20 @@
"chai-as-promised": "^7.1.1", "chai-as-promised": "^7.1.1",
"danger": "^3.1.3", "danger": "^3.1.3",
"eslint-config-prettier": "^6.11.0", "eslint-config-prettier": "^6.11.0",
"eslint-plugin-jsdoc": "^30.1.0", "eslint-plugin-jsdoc": "^30.5.1",
"eslint-plugin-prettier": "^3.1.4", "eslint-plugin-prettier": "^3.1.4",
"http-auth": "^3.2.3", "http-auth": "^3.2.3",
"husky": "^4.2.5", "husky": "^4.3.0",
"jsdom": "^11.6.2", "jsdom": "^11.6.2",
"lodash": "^4.17.20",
"mocha": "^7.1.2", "mocha": "^7.1.2",
"mocha-each": "^2.0.1", "mocha-each": "^2.0.1",
"mocha-logger": "^1.0.6", "mocha-logger": "^1.0.6",
"nyc": "^15.1.0", "nyc": "^15.1.0",
"prettier": "^2.0.5", "prettier": "^2.1.2",
"pretty-quick": "^2.0.1", "pretty-quick": "^3.0.2",
"spectron": "^8.0.0", "spectron": "^8.0.0",
"stylelint": "^13.6.1", "stylelint": "^13.7.1",
"stylelint-config-prettier": "^8.0.2", "stylelint-config-prettier": "^8.0.2",
"stylelint-config-standard": "^20.0.0", "stylelint-config-standard": "^20.0.0",
"stylelint-prettier": "^1.1.2" "stylelint-prettier": "^1.1.2"
@ -67,24 +68,24 @@
"electron": "^6.1.7" "electron": "^6.1.7"
}, },
"dependencies": { "dependencies": {
"colors": "^1.1.2", "colors": "^1.4.0",
"console-stamp": "^0.2.9", "console-stamp": "^0.2.9",
"eslint": "^7.6.0", "eslint": "^7.9.0",
"express": "^4.16.2", "express": "^4.17.1",
"express-ipfilter": "^1.0.1", "express-ipfilter": "^1.1.2",
"feedme": "latest", "feedme": "^1.2.0",
"helmet": "^3.23.3", "helmet": "^3.23.3",
"ical": "^0.8.0", "ical": "^0.8.0",
"iconv-lite": "latest", "iconv-lite": "^0.6.2",
"lodash": "^4.17.19",
"module-alias": "^2.2.2", "module-alias": "^2.2.2",
"moment": "latest", "moment": "^2.28.0",
"node-ical": "^0.12.0",
"request": "^2.88.2", "request": "^2.88.2",
"rrule": "^2.6.4", "rrule": "^2.6.6",
"rrule-alt": "^2.2.8", "rrule-alt": "^2.2.8",
"simple-git": "^1.85.0", "simple-git": "^1.85.0",
"socket.io": "^2.1.1", "socket.io": "^2.3.0",
"valid-url": "latest" "valid-url": "^1.0.9"
}, },
"_moduleAliases": { "_moduleAliases": {
"node_helper": "js/node_helper.js" "node_helper": "js/node_helper.js"

View File

@ -28,6 +28,5 @@
"UPDATE_NOTIFICATION_MODULE": "Update beschikbaar voor {MODULE_NAME} module.", "UPDATE_NOTIFICATION_MODULE": "Update beschikbaar voor {MODULE_NAME} module.",
"UPDATE_INFO_SINGLE": "De huidige installatie loopt {COMMIT_COUNT} commit achter op de {BRANCH_NAME} branch.", "UPDATE_INFO_SINGLE": "De huidige installatie loopt {COMMIT_COUNT} commit achter op de {BRANCH_NAME} branch.",
"UPDATE_INFO_MULTIPLE": "De huidige installatie loopt {COMMIT_COUNT} commits achter op de {BRANCH_NAME} branch.", "UPDATE_INFO_MULTIPLE": "De huidige installatie loopt {COMMIT_COUNT} commits achter op de {BRANCH_NAME} branch.",
"FEELS": "Voelt als"
"FEELS": "Gevoelstemperatuur"
} }

32
vendor/package-lock.json generated vendored
View File

@ -4,9 +4,9 @@
"lockfileVersion": 1, "lockfileVersion": 1,
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-free": { "@fortawesome/fontawesome-free": {
"version": "5.13.1", "version": "5.14.0",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.13.1.tgz", "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.14.0.tgz",
"integrity": "sha512-D819f34FLHeBN/4xvw0HR0u7U2G7RqjPSggXqf7LktsxWQ48VAfGwvMrhcVuaZV2fF069c/619RdgCCms0DHhw==" "integrity": "sha512-OfdMsF+ZQgdKHP9jUbmDcRrP0eX90XXrsXIdyjLbkmSBzmMXPABB8eobUJtivaupucYaByz6WNe1PI1JuYm3qA=="
}, },
"a-sync-waterfall": { "a-sync-waterfall": {
"version": "1.0.1", "version": "1.0.1",
@ -44,9 +44,9 @@
} }
}, },
"chokidar": { "chokidar": {
"version": "3.4.0", "version": "3.4.2",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.0.tgz", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.2.tgz",
"integrity": "sha512-aXAaho2VJtisB/1fg1+3nlLJqGOuewTzQpd/Tz0yTg2R0e4IGtshYvtjowyEumcBv2z+y4+kc75Mz7j5xJskcQ==", "integrity": "sha512-IZHaDeBeI+sZJRX7lGcXsdzgvZqKv6sECqsbErJA4mHWfpRrD8B97kSFN4cQz6nGBGiuFia1MKR4d6c1o8Cv7A==",
"optional": true, "optional": true,
"requires": { "requires": {
"anymatch": "~3.1.1", "anymatch": "~3.1.1",
@ -60,9 +60,9 @@
} }
}, },
"commander": { "commander": {
"version": "3.0.2", "version": "5.1.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz",
"integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==" "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg=="
}, },
"fill-range": { "fill-range": {
"version": "7.0.1", "version": "7.0.1",
@ -119,9 +119,9 @@
"optional": true "optional": true
}, },
"moment": { "moment": {
"version": "2.27.0", "version": "2.28.0",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.27.0.tgz", "resolved": "https://registry.npmjs.org/moment/-/moment-2.28.0.tgz",
"integrity": "sha512-al0MUK7cpIcglMv3YF13qSgdAIqxHTO7brRtaz3DlSULbqfazqkc5kEjNrLDOM7fsjshoFIihnU8snrP7zUvhQ==" "integrity": "sha512-Z5KOjYmnHyd/ukynmFd/WwyXHd7L4J9vTI/nn5Ap9AVUgaAE15VvQ9MOGmJJygEUklupqIrFnor/tjTwRU+tQw=="
}, },
"moment-timezone": { "moment-timezone": {
"version": "0.5.31", "version": "0.5.31",
@ -138,14 +138,14 @@
"optional": true "optional": true
}, },
"nunjucks": { "nunjucks": {
"version": "3.2.1", "version": "3.2.2",
"resolved": "https://registry.npmjs.org/nunjucks/-/nunjucks-3.2.1.tgz", "resolved": "https://registry.npmjs.org/nunjucks/-/nunjucks-3.2.2.tgz",
"integrity": "sha512-LYlVuC1ZNSalQQkLNNPvcgPt2M9FTY9bs39mTCuFXtqh7jWbYzhDlmz2M6onPiXEhdZo+b9anRhc+uBGuJZ2bQ==", "integrity": "sha512-KUi85OoF2NMygwODAy28Lh9qHmq5hO3rBlbkYoC8v377h4l8Pt5qFjILl0LWpMbOrZ18CzfVVUvIHUIrtED3sA==",
"requires": { "requires": {
"a-sync-waterfall": "^1.0.0", "a-sync-waterfall": "^1.0.0",
"asap": "^2.0.3", "asap": "^2.0.3",
"chokidar": "^3.3.0", "chokidar": "^3.3.0",
"commander": "^3.0.2" "commander": "^5.1.0"
} }
}, },
"picomatch": { "picomatch": {

6
vendor/package.json vendored
View File

@ -10,10 +10,10 @@
"url": "https://github.com/MichMich/MagicMirror/issues" "url": "https://github.com/MichMich/MagicMirror/issues"
}, },
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-free": "^5.13.1", "@fortawesome/fontawesome-free": "^5.14.0",
"moment": "^2.27.0", "moment": "^2.28.0",
"moment-timezone": "^0.5.31", "moment-timezone": "^0.5.31",
"nunjucks": "^3.2.1", "nunjucks": "^3.2.2",
"suncalc": "^1.8.0", "suncalc": "^1.8.0",
"weathericons": "^2.1.0" "weathericons": "^2.1.0"
} }