From ce99e70bf9be6152daa2b9b454ab9543f61808a7 Mon Sep 17 00:00:00 2001 From: easyas314 <30437725+easyas314@users.noreply.github.com> Date: Thu, 4 Jun 2020 19:25:13 -0400 Subject: [PATCH 01/54] tweak package; my wxgov.js --- modules/default/weather/providers/weathergov.js | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/default/weather/providers/weathergov.js b/modules/default/weather/providers/weathergov.js index c24e4de1..a86c3bea 100755 --- a/modules/default/weather/providers/weathergov.js +++ b/modules/default/weather/providers/weathergov.js @@ -1,4 +1,4 @@ -/* global WeatherProvider, WeatherObject, SunCalc */ +/* global WeatherProvider, WeatherObject */ /* Magic Mirror * Module: Weather @@ -11,6 +11,7 @@ * Note that this is only for US locations (lat and lon) and does not require an API key * Since it is free, there are some items missing - like sunrise, sunset, humidity, etc. */ + WeatherProvider.register("weathergov", { // Set the name of the provider. // This isn't strictly necessary, since it will fallback to the provider identifier diff --git a/package.json b/package.json index f568d73c..8d93e7b6 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "The open source modular smart mirror platform.", "main": "js/electron.js", "scripts": { - "start": "DISPLAY=\"${DISPLAY:=:0}\" ./node_modules/.bin/electron js/electron.js", + "start": "./node_modules/.bin/electron js/electron.js", "server": "node ./serveronly", "install": "echo \"Installing vendor files ...\n\" && cd vendor && npm install --loglevel=error", "install-fonts": "echo \"Installing fonts ...\n\" && cd fonts && npm install --loglevel=error", From a4aabfcdae7edc2223ab3722754bb48be4695a42 Mon Sep 17 00:00:00 2001 From: easyas314 <30437725+easyas314@users.noreply.github.com> Date: Thu, 4 Jun 2020 19:26:09 -0400 Subject: [PATCH 02/54] add the lock file --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 428fd1fe..20930a94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4634,9 +4634,9 @@ "integrity": "sha512-A/78XjoX2EmNvppVWEhM2oGk3x4lLxnkEA4jTbaK97QKSDjkIoOsKQlfylt/d3kKKi596Qy3NP5XrXJ6fZIC9Q==" }, "moment": { - "version": "2.24.0", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", - "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==" + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.26.0.tgz", + "integrity": "sha512-oIixUO+OamkUkwjhAVE18rAMfRJNsNe/Stid/gwHSOfHrOtw9EhAY2AHvdKZ/k/MggcYELFCJz/Sn2pL8b8JMw==" }, "mri": { "version": "1.1.5", From df3aa22c59a57b02d01d3c5febe6d8aebe23873f Mon Sep 17 00:00:00 2001 From: easyas314 <30437725+easyas314@users.noreply.github.com> Date: Thu, 4 Jun 2020 23:35:32 -0400 Subject: [PATCH 03/54] current appears to be working --- .../default/weather/providers/weathergov.js | 77 ++++++++++++++++++- 1 file changed, 74 insertions(+), 3 deletions(-) diff --git a/modules/default/weather/providers/weathergov.js b/modules/default/weather/providers/weathergov.js index a86c3bea..e56c13a6 100755 --- a/modules/default/weather/providers/weathergov.js +++ b/modules/default/weather/providers/weathergov.js @@ -18,9 +18,37 @@ WeatherProvider.register("weathergov", { // But for debugging (and future alerts) it would be nice to have the real name. providerName: "Weather.gov", + // need setConfig URLs status + configURLs: false, + + //multiple urls involved + forecastURL: "tbd", + forecastHourlyURL: "tbd", + forecastGridDataURL: "tbd", + observationStationsURL: "tbd", + stationObsURL: "tbd", + + // Called to set the config, this config is the same as the weather module's config. + setConfig: function (config) { + this.config = config; + Log.info(`Weather provider: ${this.providerName} config set.`, this.config); + // URLs needed from weather.gov + this.fetchWxGovURLs(this.config); + }, + + // Called when the weather provider is about to start. + start: function () { + Log.info(`Weather provider: ${this.providerName} started.`); + }, + // Overwrite the fetchCurrentWeather method. fetchCurrentWeather() { - this.fetchData(this.getUrl()) + if (!this.configURLs) { + Log.info("fetch wx waiting on config URLs"); + return; + } + // this.fetchData(this.getUrl()) + this.fetchData(this.forecastURL) .then((data) => { if (!data || !data.properties || !data.properties.periods || !data.properties.periods.length) { // Did not receive usable new data. @@ -37,9 +65,14 @@ WeatherProvider.register("weathergov", { .finally(() => this.updateAvailable()); }, - // Overwrite the fetchCurrentWeather method. + // Overwrite the fetchWeatherForecast method. fetchWeatherForecast() { - this.fetchData(this.getUrl()) + if (!this.configURLs) { + Log.info("fetch wx waiting on config URLs"); + return; + } + //this.fetchData(this.getUrl()) + this.fetchData(this.forecastHourlyURL) .then((data) => { if (!data || !data.properties || !data.properties.periods || !data.properties.periods.length) { // Did not receive usable new data. @@ -57,6 +90,44 @@ WeatherProvider.register("weathergov", { }, /** Weather.gov Specific Methods - These are not part of the default provider methods */ + + /* + * Get specific URLs + */ + fetchWxGovURLs(config) { + // wxCtl.initialLoadDelay here ? + this.fetchData(`${config.apiBase}/points/${config.lat},${config.lon}`) + .then((data) => { + if (!data || !data.properties) { + // points URL did not respond with usable data. + return; + } + this.forecastURL = data.properties.forecast; + Log.log(this.forecastURL); + this.forecastHourlyURL = data.properties.forecastHourly; + this.forecastGridDataURL = data.properties.forecastGridData; + this.observationStationsURL = data.properties.observationStations; + // with this URL, we chain another promise for the station obs URL + return this.fetchData(data.properties.observationStations); + //const wxStations = await this.fetchData(wxPoints.properties.observationStationsURL); + }) + .then((obsData) => { + if (!obsData || !obsData.features) { + // obs station URL did not respond with usable data. + return; + } + this.stationObsURL = obsData.features[0].id + "/observations/latest"; + Log.log(this.stationObsURL); + }) + .catch((err) => { + Log.error(err); + }) + .finally(() => { + this.configURLs = true; + this.fetchCurrentWeather(); + }); + }, + /* * Gets the complete url for the request */ From 9d2d170c2d4014f0ba5e11cfaf52410e1d35adb0 Mon Sep 17 00:00:00 2001 From: easyas314 <30437725+easyas314@users.noreply.github.com> Date: Sat, 13 Jun 2020 11:58:06 -0400 Subject: [PATCH 04/54] add additional URLs per API --- .../default/weather/providers/weathergov.js | 103 ++++++++++++------ 1 file changed, 69 insertions(+), 34 deletions(-) diff --git a/modules/default/weather/providers/weathergov.js b/modules/default/weather/providers/weathergov.js index e56c13a6..c41742fa 100755 --- a/modules/default/weather/providers/weathergov.js +++ b/modules/default/weather/providers/weathergov.js @@ -3,13 +3,14 @@ /* Magic Mirror * Module: Weather * Provider: weather.gov + * https://weather-gov.github.io/api/general-faqs * - * By Vince Peri + * Original by Vince Peri * MIT Licensed. * * This class is a provider for weather.gov. * Note that this is only for US locations (lat and lon) and does not require an API key - * Since it is free, there are some items missing - like sunrise, sunset, humidity, etc. + * Since it is free, there are some items missing - like sunrise, sunset */ WeatherProvider.register("weathergov", { @@ -18,10 +19,10 @@ WeatherProvider.register("weathergov", { // But for debugging (and future alerts) it would be nice to have the real name. providerName: "Weather.gov", - // need setConfig URLs status + // Flag all needed URLs availability configURLs: false, - //multiple urls involved + //This API has multiple urls involved forecastURL: "tbd", forecastHourlyURL: "tbd", forecastGridDataURL: "tbd", @@ -31,9 +32,7 @@ WeatherProvider.register("weathergov", { // Called to set the config, this config is the same as the weather module's config. setConfig: function (config) { this.config = config; - Log.info(`Weather provider: ${this.providerName} config set.`, this.config); - // URLs needed from weather.gov - this.fetchWxGovURLs(this.config); + (this.config.apiBase = "https://api.weather.gov"), this.fetchWxGovURLs(this.config); }, // Called when the weather provider is about to start. @@ -41,26 +40,28 @@ WeatherProvider.register("weathergov", { Log.info(`Weather provider: ${this.providerName} started.`); }, + // This returns the name of the fetched location or an empty string. + fetchedLocation: function () { + return this.fetchedLocationName || ""; + }, + // Overwrite the fetchCurrentWeather method. fetchCurrentWeather() { if (!this.configURLs) { Log.info("fetch wx waiting on config URLs"); return; } - // this.fetchData(this.getUrl()) - this.fetchData(this.forecastURL) + this.fetchData(this.stationObsURL) .then((data) => { - if (!data || !data.properties || !data.properties.periods || !data.properties.periods.length) { + if (!data || !data.properties) { // Did not receive usable new data. - // Maybe this needs a better check? return; } - - const currentWeather = this.generateWeatherObjectFromCurrentWeather(data.properties.periods[0]); + const currentWeather = this.generateWeatherObjectFromCurrentWeather(data.properties); this.setCurrentWeather(currentWeather); }) .catch(function (request) { - Log.error("Could not load data ... ", request); + Log.error("Could not load station obs data ... ", request); }) .finally(() => this.updateAvailable()); }, @@ -71,20 +72,17 @@ WeatherProvider.register("weathergov", { Log.info("fetch wx waiting on config URLs"); return; } - //this.fetchData(this.getUrl()) - this.fetchData(this.forecastHourlyURL) + this.fetchData(this.forecastURL) .then((data) => { if (!data || !data.properties || !data.properties.periods || !data.properties.periods.length) { // Did not receive usable new data. - // Maybe this needs a better check? return; } - const forecast = this.generateWeatherObjectsFromForecast(data.properties.periods); this.setWeatherForecast(forecast); }) .catch(function (request) { - Log.error("Could not load data ... ", request); + Log.error("Could not load forecast hourly data ... ", request); }) .finally(() => this.updateAvailable()); }, @@ -95,21 +93,20 @@ WeatherProvider.register("weathergov", { * Get specific URLs */ fetchWxGovURLs(config) { - // wxCtl.initialLoadDelay here ? this.fetchData(`${config.apiBase}/points/${config.lat},${config.lon}`) .then((data) => { if (!data || !data.properties) { // points URL did not respond with usable data. return; } + this.fetchedLocationName = data.properties.relativeLocation.properties.city + ", " + data.properties.relativeLocation.properties.state; + Log.log("Forecast location is " + this.fetchedLocationName); this.forecastURL = data.properties.forecast; - Log.log(this.forecastURL); this.forecastHourlyURL = data.properties.forecastHourly; this.forecastGridDataURL = data.properties.forecastGridData; this.observationStationsURL = data.properties.observationStations; // with this URL, we chain another promise for the station obs URL return this.fetchData(data.properties.observationStations); - //const wxStations = await this.fetchData(wxPoints.properties.observationStationsURL); }) .then((obsData) => { if (!obsData || !obsData.features) { @@ -117,34 +114,44 @@ WeatherProvider.register("weathergov", { return; } this.stationObsURL = obsData.features[0].id + "/observations/latest"; - Log.log(this.stationObsURL); }) .catch((err) => { Log.error(err); }) .finally(() => { + // excellent, let's fetch some actual wx data this.configURLs = true; this.fetchCurrentWeather(); }); }, - /* - * Gets the complete url for the request - */ - getUrl() { - return this.config.apiBase + this.config.lat + "," + this.config.lon + this.config.weatherEndpoint; - }, - /* * Generate a WeatherObject based on currentWeatherInformation + * Weather.gov API uses specific units; API does not include choice of units + * ... object needs data in units based on config! */ generateWeatherObjectFromCurrentWeather(currentWeatherData) { const currentWeather = new WeatherObject(this.config.units, this.config.tempUnits, this.config.windUnits); - currentWeather.temperature = currentWeatherData.temperature; - currentWeather.windSpeed = currentWeatherData.windSpeed.split(" ", 1); - currentWeather.windDirection = this.convertWindDirection(currentWeatherData.windDirection); - currentWeather.weatherType = this.convertWeatherType(currentWeatherData.shortForecast, currentWeatherData.isDaytime); + currentWeather.date = moment(currentWeatherData.timestamp); + currentWeather.temperature = this.convertTemp(currentWeatherData.temperature.value); + currentWeather.windSpeed = this.covertSpeed(currentWeatherData.windSpeed.value); + currentWeather.windDirection = currentWeatherData.windDirection.value; + currentWeather.minTemperature = this.convertTemp(currentWeatherData.minTemperatureLast24Hours.value); + currentWeather.maxTemperature = this.convertTemp(currentWeatherData.maxTemperatureLast24Hours.value); + currentWeather.humidity = Math.round(currentWeatherData.relativeHumidity.value); + currentWeather.rain = null; + currentWeather.snow = null; + currentWeather.precipitation = this.convertLength(currentWeatherData.precipitationLastHour.value); + currentWeather.feelsLikeTemp = this.convertTemp(currentWeatherData.heatIndex.value); + + let isDaytime = true; + if (currentWeatherData.icon.includes("day")) { + isDaytime = true; + } else { + isDaytime = false; + } + currentWeather.weatherType = this.convertWeatherType(currentWeatherData.textDescription, isDaytime); // determine the sunrise/sunset times - not supplied in weather.gov data let times = this.calcAstroData(this.config.lat, this.config.lon); @@ -220,6 +227,34 @@ WeatherProvider.register("weathergov", { return days.slice(1); }, + /* + * Unit conversions + */ + // conversion to fahrenheit + convertTemp(temp) { + if (this.config.tempUnits === "imperial") { + return (9 / 5) * temp + 32; + } else { + return temp; + } + }, + // conversion to mph + covertSpeed(metSec) { + if (this.config.windUnits === "imperial") { + return metSec * 2.23694; + } else { + return metSec; + } + }, + // conversion to inches + convertLength(meters) { + if (this.config.units === "imperial") { + return meters * 39.3701; + } else { + return meters; + } + }, + /* * Calculate the astronomical data */ From d5caadd9062ae7ee6dcdfe25caa4c435d01c82ea Mon Sep 17 00:00:00 2001 From: wolfen351 Date: Sat, 27 Jun 2020 19:43:09 +1200 Subject: [PATCH 05/54] Correct calendar display - account for current timezone --- modules/default/calendar/calendar.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index d93f570c..97eca85f 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -469,6 +469,12 @@ Module.register("calendar", { var calendar = this.calendarData[c]; for (var e in calendar) { var event = JSON.parse(JSON.stringify(calendar[e])); // clone object + + // correct data for the current timezone + var offset = - ((new Date()).getTimezoneOffset() * 60 * 1000); + event.startDate = (event.startDate - offset); + event.endDate = (event.endDate - offset); + if(event.endDate < now) { continue; } From dc9d6f6b79ed666e52658f6ab9ed584ff93ec388 Mon Sep 17 00:00:00 2001 From: Bryan Zhu Date: Tue, 30 Jun 2020 12:29:00 -0400 Subject: [PATCH 06/54] fixed minor typo (apiKey vs. appid) --- modules/default/weather/weather.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/weather/weather.js b/modules/default/weather/weather.js index 150ba084..be5c3a3f 100644 --- a/modules/default/weather/weather.js +++ b/modules/default/weather/weather.js @@ -15,7 +15,7 @@ Module.register("weather", { location: false, locationID: false, - appid: "", + apiKey: "", units: config.units, tempUnits: config.units, From 26ed05ba3a5a2e00b98bf485ee89f861710f1154 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Wed, 1 Jul 2020 20:07:12 +0200 Subject: [PATCH 07/54] Prepare 2.13.0-develop --- CHANGELOG.md | 12 ++++++++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b4ee497..069c61f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ 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² +## [2.13.0] - Unreleased (Develop Branch - Please add your contributions to this release.) + +_This release is scheduled to be released on 2020-10-01._ + +### Added + +### Updated + +### Deleted + +### Fixed + ## [2.12.0] - 2020-07-01 Special thanks to the following contributors: @AndreKoepke, @andrezibaia, @bryanzzhu, @chamakura, @DarthBrento, @Ekristoffe, @khassel, @Legion2, @ndom91, @radokristof, @rejas, @XBCreepinJesus & @ZoneMR. diff --git a/package-lock.json b/package-lock.json index 15a6644a..e421d505 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "magicmirror", - "version": "2.12.0", + "version": "2.13.0-develop", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5b9562d5..63d9fcdd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "magicmirror", - "version": "2.12.0", + "version": "2.13.0-develop", "description": "The open source modular smart mirror platform.", "main": "js/electron.js", "scripts": { From 0939e405b4019772d4984484761a003da23ff410 Mon Sep 17 00:00:00 2001 From: oemel09 Date: Thu, 2 Jul 2020 20:54:20 +0200 Subject: [PATCH 08/54] Adjusts maxNumberOfDays depending on the endpoint --- modules/default/weatherforecast/weatherforecast.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index 83389911..ecda5a53 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -294,7 +294,15 @@ Module.register("weatherforecast", { return; } - params += "&cnt=" + (this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 17 ? 7 : this.config.maxNumberOfDays); + let numberOfDays; + if (this.config.forecastEndpoint === "forecast") { + numberOfDays = (this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 5 ? 5 : this.config.maxNumberOfDays); + // don't get forecasts for the 6th day, as it would not represent the whole day + numberOfDays = numberOfDays * 8 - Math.ceil(new Date().getHours() / 3) % 8; + } else { + numberOfDays = (this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 17) ? 7 : this.config.maxNumberOfDays; + } + params += "&cnt=" + numberOfDays; params += "&units=" + this.config.units; params += "&lang=" + this.config.lang; From 4ed323559058932dd58c012d39757e7fd7cea140 Mon Sep 17 00:00:00 2001 From: oemel09 Date: Thu, 2 Jul 2020 20:56:48 +0200 Subject: [PATCH 09/54] Adds fix to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 069c61f8..68ebc0ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ _This release is scheduled to be released on 2020-10-01._ ### Deleted ### Fixed +- Fix the use of "maxNumberOfDays" in the module "weatherforecast depending on the endpoint (forecast/daily or forecast)". [#2018](https://github.com/MichMich/MagicMirror/issues/2018) ## [2.12.0] - 2020-07-01 From 246dc663c4a82f9f0284de21577f3c24cd7ace9c Mon Sep 17 00:00:00 2001 From: oemel09 Date: Thu, 2 Jul 2020 22:22:04 +0200 Subject: [PATCH 10/54] Applies suggestions from prettier, floor instead of ceil --- modules/default/weatherforecast/weatherforecast.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index ecda5a53..d872ee01 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -296,11 +296,11 @@ Module.register("weatherforecast", { let numberOfDays; if (this.config.forecastEndpoint === "forecast") { - numberOfDays = (this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 5 ? 5 : this.config.maxNumberOfDays); + numberOfDays = this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 5 ? 5 : this.config.maxNumberOfDays; // don't get forecasts for the 6th day, as it would not represent the whole day - numberOfDays = numberOfDays * 8 - Math.ceil(new Date().getHours() / 3) % 8; + numberOfDays = numberOfDays * 8 - (Math.floor(new Date().getHours() / 3) % 8); } else { - numberOfDays = (this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 17) ? 7 : this.config.maxNumberOfDays; + numberOfDays = this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 17 ? 7 : this.config.maxNumberOfDays; } params += "&cnt=" + numberOfDays; From 92cc41dec661f7f8cca593e4da25895c40f7bb4c Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Fri, 3 Jul 2020 21:53:18 +0200 Subject: [PATCH 11/54] Fix linting issue. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68ebc0ea..66c307c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ _This release is scheduled to be released on 2020-10-01._ ### Deleted ### Fixed + - Fix the use of "maxNumberOfDays" in the module "weatherforecast depending on the endpoint (forecast/daily or forecast)". [#2018](https://github.com/MichMich/MagicMirror/issues/2018) ## [2.12.0] - 2020-07-01 From a06615355625fea82deae86f36d061ecf1521679 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Sat, 4 Jul 2020 21:26:22 +0200 Subject: [PATCH 12/54] Add updated changelog. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66c307c3..1e38f0b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ _This release is scheduled to be released on 2020-10-01._ ### Fixed - Fix the use of "maxNumberOfDays" in the module "weatherforecast depending on the endpoint (forecast/daily or forecast)". [#2018](https://github.com/MichMich/MagicMirror/issues/2018) +- Fix calendar display. Account for current timezone. [#2068](https://github.com/MichMich/MagicMirror/issues/2068) ## [2.12.0] - 2020-07-01 From bd0f707aed194fd5333b9b7f81d957e011e48c6f Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Sat, 4 Jul 2020 21:40:31 +0200 Subject: [PATCH 13/54] Add changelog. --- CHANGELOG.md | 2 ++ modules/default/weather/weather.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e38f0b5..11bfedd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ _This release is scheduled to be released on 2020-10-01._ ### Updated +- Change incorrect weather.js default properties. + ### Deleted ### Fixed diff --git a/modules/default/weather/weather.js b/modules/default/weather/weather.js index be5c3a3f..a8b6cc53 100644 --- a/modules/default/weather/weather.js +++ b/modules/default/weather/weather.js @@ -15,7 +15,6 @@ Module.register("weather", { location: false, locationID: false, - apiKey: "", units: config.units, tempUnits: config.units, @@ -43,6 +42,8 @@ Module.register("weather", { initialLoadDelay: 0, // 0 seconds delay retryDelay: 2500, + apiKey: "", + apiSecret: "", apiVersion: "2.5", apiBase: "https://api.openweathermap.org/data/", weatherEndpoint: "/weather", From 3282ed4fea3b43a4a789b7ebce3b09d0ee06e729 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Sat, 4 Jul 2020 21:49:14 +0200 Subject: [PATCH 14/54] Add TODO --- modules/default/weather/weather.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/weather/weather.js b/modules/default/weather/weather.js index a8b6cc53..73c493e0 100644 --- a/modules/default/weather/weather.js +++ b/modules/default/weather/weather.js @@ -45,7 +45,7 @@ Module.register("weather", { apiKey: "", apiSecret: "", apiVersion: "2.5", - apiBase: "https://api.openweathermap.org/data/", + apiBase: "https://api.openweathermap.org/data/", // TODO: this should not be part of the weather.js file, but should be contained in the openweatherprovider weatherEndpoint: "/weather", appendLocationNameToHeader: true, From 9f5e1b59fb41daf82a9a59bcbbc4e15dddae23d1 Mon Sep 17 00:00:00 2001 From: rejas Date: Sat, 4 Jul 2020 22:02:39 +0200 Subject: [PATCH 15/54] Set logLevel after loading config --- js/app.js | 2 ++ js/logger.js | 16 +++++++++------- js/main.js | 3 +++ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/js/app.js b/js/app.js index 7cf7dd2e..b1fcc9bb 100644 --- a/js/app.js +++ b/js/app.js @@ -202,6 +202,8 @@ var App = function () { loadConfig(function (c) { config = c; + Log.setLogLevel(config.logLevel); + var modules = []; for (var m in config.modules) { diff --git a/js/logger.js b/js/logger.js index 157420a7..122ba81a 100644 --- a/js/logger.js +++ b/js/logger.js @@ -32,13 +32,15 @@ timeStamp: Function.prototype.bind.call(console.timeStamp, console) }; - if (config && config.logLevel) { - Object.keys(logLevel).forEach(function (key, index) { - if (!config.logLevel.includes(key.toLocaleUpperCase())) { - logLevel[key] = function () {}; - } - }); - } + logLevel.setLogLevel = function (newLevel) { + if (newLevel) { + Object.keys(logLevel).forEach(function (key, index) { + if (!newLevel.includes(key.toLocaleUpperCase())) { + logLevel[key] = function () {}; + } + }); + } + }; return logLevel; }); diff --git a/js/main.js b/js/main.js index 07459f0f..dc1667af 100644 --- a/js/main.js +++ b/js/main.js @@ -477,6 +477,9 @@ var MM = (function () { init: function () { Log.info("Initializing MagicMirror."); loadConfig(); + + Log.setLogLevel(config.logLevel); + Translator.loadCoreTranslations(config.language); Loader.loadModules(); }, From 121e7db3309694916ab867c29af426e215d759a1 Mon Sep 17 00:00:00 2001 From: rejas Date: Sat, 4 Jul 2020 22:03:13 +0200 Subject: [PATCH 16/54] Add CHANGELOG entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11bfedd6..9fa43e6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ _This release is scheduled to be released on 2020-10-01._ - Fix the use of "maxNumberOfDays" in the module "weatherforecast depending on the endpoint (forecast/daily or forecast)". [#2018](https://github.com/MichMich/MagicMirror/issues/2018) - Fix calendar display. Account for current timezone. [#2068](https://github.com/MichMich/MagicMirror/issues/2068) +- Fix logLevel being set before loading config ## [2.12.0] - 2020-07-01 From 309a18e9c0d748328fbb11d29fb2ecaca2809cd4 Mon Sep 17 00:00:00 2001 From: chamakura Date: Sat, 4 Jul 2020 20:12:34 -0700 Subject: [PATCH 17/54] Fixing double conversion of time between UTC and local timezone --- modules/default/calendar/calendar.js | 5 ----- modules/default/calendar/calendarfetcher.js | 10 ++++++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index d18132a6..5c6ce453 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -468,11 +468,6 @@ Module.register("calendar", { for (var e in calendar) { var event = JSON.parse(JSON.stringify(calendar[e])); // clone object - // correct data for the current timezone - var offset = -(new Date().getTimezoneOffset() * 60 * 1000); - event.startDate = event.startDate - offset; - event.endDate = event.endDate - offset; - if (event.endDate < now) { continue; } diff --git a/modules/default/calendar/calendarfetcher.js b/modules/default/calendar/calendarfetcher.js index 4a6fb0e6..3676b5a8 100644 --- a/modules/default/calendar/calendarfetcher.js +++ b/modules/default/calendar/calendarfetcher.js @@ -186,10 +186,12 @@ const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumNu // kblankenship1989 - to fix issue #1798, converting all dates to locale time first, then converting back to UTC time const pastLocal = pastMoment.subtract(past.getTimezoneOffset(), "minutes").toDate(); const futureLocal = futureMoment.subtract(future.getTimezoneOffset(), "minutes").toDate(); - const datesLocal = rule.between(pastLocal, futureLocal, true, limitFunction); - const dates = datesLocal.map(function (dateLocal) { - return moment(dateLocal).add(dateLocal.getTimezoneOffset(), "minutes").toDate(); - }); + const dates = rule.between(pastLocal, futureLocal, true, limitFunction); + if (getTitleFromEvent(event).search("Manageando") > -1) { + console.log(startDate); + console.log(event); + console.log(rule); + } // The "dates" array contains the set of dates within our desired date range range that are valid // for the recurrence rule. *However*, it's possible for us to have a specific recurrence that From d021c9b4ae242c4fc53ffafbe92db098b9710b31 Mon Sep 17 00:00:00 2001 From: chamakura Date: Sat, 4 Jul 2020 20:23:09 -0700 Subject: [PATCH 18/54] Removing debug log statements --- modules/default/calendar/calendarfetcher.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/modules/default/calendar/calendarfetcher.js b/modules/default/calendar/calendarfetcher.js index 3676b5a8..acae13dc 100644 --- a/modules/default/calendar/calendarfetcher.js +++ b/modules/default/calendar/calendarfetcher.js @@ -187,11 +187,6 @@ const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumNu const pastLocal = pastMoment.subtract(past.getTimezoneOffset(), "minutes").toDate(); const futureLocal = futureMoment.subtract(future.getTimezoneOffset(), "minutes").toDate(); const dates = rule.between(pastLocal, futureLocal, true, limitFunction); - if (getTitleFromEvent(event).search("Manageando") > -1) { - console.log(startDate); - console.log(event); - console.log(rule); - } // The "dates" array contains the set of dates within our desired date range range that are valid // for the recurrence rule. *However*, it's possible for us to have a specific recurrence that From 921932920d6d5d0cbd4e64bf0614c11a02a84467 Mon Sep 17 00:00:00 2001 From: rejas Date: Sun, 5 Jul 2020 11:58:37 +0200 Subject: [PATCH 19/54] Fix incorrect namespace links in svg clockfaces Fixes #2072 --- CHANGELOG.md | 3 ++- modules/default/clock/faces/face-001.svg | 2 +- modules/default/clock/faces/face-002.svg | 2 +- modules/default/clock/faces/face-003.svg | 2 +- modules/default/clock/faces/face-004.svg | 2 +- modules/default/clock/faces/face-005.svg | 2 +- modules/default/clock/faces/face-006.svg | 2 +- modules/default/clock/faces/face-007.svg | 2 +- modules/default/clock/faces/face-008.svg | 2 +- modules/default/clock/faces/face-009.svg | 2 +- modules/default/clock/faces/face-010.svg | 2 +- modules/default/clock/faces/face-011.svg | 2 +- modules/default/clock/faces/face-012.svg | 2 +- 13 files changed, 14 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fa43e6b..7d5bc9b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,8 @@ _This release is scheduled to be released on 2020-10-01._ - Fix the use of "maxNumberOfDays" in the module "weatherforecast depending on the endpoint (forecast/daily or forecast)". [#2018](https://github.com/MichMich/MagicMirror/issues/2018) - Fix calendar display. Account for current timezone. [#2068](https://github.com/MichMich/MagicMirror/issues/2068) -- Fix logLevel being set before loading config +- Fix logLevel being set before loading config. +- Fix incorrect namespace links in svg clockfaces. [#2072](https://github.com/MichMich/MagicMirror/issues/2072) ## [2.12.0] - 2020-07-01 diff --git a/modules/default/clock/faces/face-001.svg b/modules/default/clock/faces/face-001.svg index 13436c76..abd08ce7 100644 --- a/modules/default/clock/faces/face-001.svg +++ b/modules/default/clock/faces/face-001.svg @@ -1 +1 @@ -face-001 +face-001 diff --git a/modules/default/clock/faces/face-002.svg b/modules/default/clock/faces/face-002.svg index a3ee3682..1ec31049 100644 --- a/modules/default/clock/faces/face-002.svg +++ b/modules/default/clock/faces/face-002.svg @@ -1 +1 @@ -face-002 +face-002 diff --git a/modules/default/clock/faces/face-003.svg b/modules/default/clock/faces/face-003.svg index d3fc32de..7cfeebac 100644 --- a/modules/default/clock/faces/face-003.svg +++ b/modules/default/clock/faces/face-003.svg @@ -1 +1 @@ -face-003 +face-003 diff --git a/modules/default/clock/faces/face-004.svg b/modules/default/clock/faces/face-004.svg index 140955d7..bc97588c 100644 --- a/modules/default/clock/faces/face-004.svg +++ b/modules/default/clock/faces/face-004.svg @@ -1 +1 @@ -face-004 +face-004 diff --git a/modules/default/clock/faces/face-005.svg b/modules/default/clock/faces/face-005.svg index fb52a435..0bc1b430 100644 --- a/modules/default/clock/faces/face-005.svg +++ b/modules/default/clock/faces/face-005.svg @@ -1 +1 @@ -faces +faces diff --git a/modules/default/clock/faces/face-006.svg b/modules/default/clock/faces/face-006.svg index a9eff826..87c52ed5 100644 --- a/modules/default/clock/faces/face-006.svg +++ b/modules/default/clock/faces/face-006.svg @@ -1 +1 @@ -face-006 +face-006 diff --git a/modules/default/clock/faces/face-007.svg b/modules/default/clock/faces/face-007.svg index b0dde834..e557f55f 100644 --- a/modules/default/clock/faces/face-007.svg +++ b/modules/default/clock/faces/face-007.svg @@ -1 +1 @@ -face-007 +face-007 diff --git a/modules/default/clock/faces/face-008.svg b/modules/default/clock/faces/face-008.svg index 551ea7df..6fadb396 100644 --- a/modules/default/clock/faces/face-008.svg +++ b/modules/default/clock/faces/face-008.svg @@ -1 +1 @@ -face-008 +face-008 diff --git a/modules/default/clock/faces/face-009.svg b/modules/default/clock/faces/face-009.svg index cd3720f2..bd207e09 100644 --- a/modules/default/clock/faces/face-009.svg +++ b/modules/default/clock/faces/face-009.svg @@ -1 +1 @@ -face-009 +face-009 diff --git a/modules/default/clock/faces/face-010.svg b/modules/default/clock/faces/face-010.svg index d0af3acb..8c5e5848 100644 --- a/modules/default/clock/faces/face-010.svg +++ b/modules/default/clock/faces/face-010.svg @@ -1 +1 @@ -face-010 +face-010 diff --git a/modules/default/clock/faces/face-011.svg b/modules/default/clock/faces/face-011.svg index 2d5f27ba..9886fed5 100644 --- a/modules/default/clock/faces/face-011.svg +++ b/modules/default/clock/faces/face-011.svg @@ -1 +1 @@ -face-011 +face-011 diff --git a/modules/default/clock/faces/face-012.svg b/modules/default/clock/faces/face-012.svg index 8096d492..cfd80698 100644 --- a/modules/default/clock/faces/face-012.svg +++ b/modules/default/clock/faces/face-012.svg @@ -1 +1 @@ -face-012 +face-012 From a1708a14697bb9a548e0e92f1fe3bb7197b497d5 Mon Sep 17 00:00:00 2001 From: oemel09 Date: Wed, 8 Jul 2020 10:19:49 +0200 Subject: [PATCH 20/54] Fixes getting only full day forecasts --- modules/default/weatherforecast/weatherforecast.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index d872ee01..874c48fe 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -297,8 +297,8 @@ Module.register("weatherforecast", { let numberOfDays; if (this.config.forecastEndpoint === "forecast") { numberOfDays = this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 5 ? 5 : this.config.maxNumberOfDays; - // don't get forecasts for the 6th day, as it would not represent the whole day - numberOfDays = numberOfDays * 8 - (Math.floor(new Date().getHours() / 3) % 8); + // don't get forecasts for the next day, as it would not represent the whole day + numberOfDays = numberOfDays * 8 - (Math.round(new Date().getHours() / 3) % 8); } else { numberOfDays = this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 17 ? 7 : this.config.maxNumberOfDays; } From 93c0787efdb98c3b0c09ccb740ccea9b2cb0e206 Mon Sep 17 00:00:00 2001 From: Chris Brunner Date: Wed, 8 Jul 2020 09:48:03 -0700 Subject: [PATCH 21/54] Add support for OpenWeather onecall API --- .../weatherforecast/weatherforecast.js | 35 ++++++++++++++++--- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index d872ee01..42937879 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -9,6 +9,8 @@ Module.register("weatherforecast", { defaults: { location: false, locationID: false, + lat: false, + lon: false, appid: "", units: config.units, maxNumberOfDays: 7, @@ -29,6 +31,7 @@ Module.register("weatherforecast", { apiVersion: "2.5", apiBase: "https://api.openweathermap.org/data/", forecastEndpoint: "forecast/daily", + excludes: false, appendLocationNameToHeader: true, calendarClass: "calendar", @@ -283,6 +286,8 @@ Module.register("weatherforecast", { var params = "?"; if (this.config.locationID) { params += "id=" + this.config.locationID; + } else if (this.config.lat && this.config.lon) { + params += "lat=" + this.config.lat + "&lon=" + this.config.lon; } else if (this.config.location) { params += "q=" + this.config.location; } else if (this.firstEvent && this.firstEvent.geo) { @@ -304,6 +309,7 @@ Module.register("weatherforecast", { } params += "&cnt=" + numberOfDays; + params += "&exclude=" + this.config.excludes; params += "&units=" + this.config.units; params += "&lang=" + this.config.lang; params += "&APPID=" + this.config.appid; @@ -331,15 +337,34 @@ Module.register("weatherforecast", { * argument data object - Weather information received form openweather.org. */ processWeather: function (data) { - this.fetchedLocationName = data.city.name + ", " + data.city.country; + // Forcast16 (paid) API endpoint provides this data. Onecall endpoint + // does not. + if (data.city) { + this.fetchedLocationName = data.city.name + ", " + data.city.country; + } else if (this.config.location) { + this.fetchedLocationName = this.config.location; + } else { + this.fetchedLocationName = "Unknown"; + } this.forecast = []; var lastDay = null; var forecastData = {}; - for (var i = 0, count = data.list.length; i < count; i++) { - var forecast = data.list[i]; - this.parserDataWeather(forecast); // hack issue #1017 + // Handle different structs between forecast16 and onecall endpoints + var forecastList = null; + if (data.list) { + forecastList = data.list; + } else if (data.daily) { + forecastList = data.daily; + } else { + Log.error("Unexpected forecast data"); + return undefined; + } + + for (var i = 0, count = forecastList.length; i < count; i++) { + var forecast = forecastList[i]; + forecast = this.parserDataWeather(forecast); // hack issue #1017 var day; var hour; @@ -357,7 +382,7 @@ Module.register("weatherforecast", { icon: this.config.iconTable[forecast.weather[0].icon], maxTemp: this.roundValue(forecast.temp.max), minTemp: this.roundValue(forecast.temp.min), - rain: this.processRain(forecast, data.list) + rain: this.processRain(forecast, forecastList) }; this.forecast.push(forecastData); From 679d464f4cf7e9de579ff7c349318ee97ecd8734 Mon Sep 17 00:00:00 2001 From: Chris Brunner Date: Wed, 8 Jul 2020 09:53:50 -0700 Subject: [PATCH 22/54] Update chagelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d5bc9b4..1e825dd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). _This release is scheduled to be released on 2020-10-01._ ### Added +- Added support in weatherforecast for OpenWeather onecall API ### Updated From 2973a03d403a17084f5e1dd12bdad23b3c53046b Mon Sep 17 00:00:00 2001 From: Chris Brunner Date: Wed, 8 Jul 2020 10:11:12 -0700 Subject: [PATCH 23/54] Prettier... --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e825dd5..1c5b27bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). _This release is scheduled to be released on 2020-10-01._ ### Added + - Added support in weatherforecast for OpenWeather onecall API ### Updated From caa51b10297426e8aee7ed3e30aade5904786e1a Mon Sep 17 00:00:00 2001 From: Laurynas Kerezius Date: Wed, 8 Jul 2020 20:52:24 +0000 Subject: [PATCH 24/54] Add lithuanian language --- translations/lt.json | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 translations/lt.json diff --git a/translations/lt.json b/translations/lt.json new file mode 100644 index 00000000..87fbd791 --- /dev/null +++ b/translations/lt.json @@ -0,0 +1,36 @@ +{ + "LOADING": "Kraunasi …", + + "TODAY": "Šiandien", + "TOMORROW": "Rytoj", + "DAYAFTERTOMORROW": "Už 2 dienų", + "RUNNING": "Pasibaigs už", + "EMPTY": "Nėra artimų įvykių.", + + "WEEK": "{weekNumber} savaitė", + + "N": "N", + "NNE": "NNE", + "NE": "NE", + "ENE": "ENE", + "E": "E", + "ESE": "ESE", + "SE": "SE", + "SSE": "SSE", + "S": "S", + "SSW": "SSW", + "SW": "SW", + "WSW": "WSW", + "W": "W", + "WNW": "WNW", + "NW": "NW", + "NNW": "NNW", + + "UPDATE_NOTIFICATION": "Galimas MagicMirror² naujinimas.", + "UPDATE_NOTIFICATION_MODULE": "Galimas {MODULE_NAME} naujinimas.", + "UPDATE_INFO_SINGLE": "Šis įdiegimas atsilieka {COMMIT_COUNT} įsipareigojimu {BRANCH_NAME} šakoje.", + "UPDATE_INFO_MULTIPLE": "Šis įdiegimas atsilieka {COMMIT_COUNT} įsipareigojimais {BRANCH_NAME} šakoje.", + + "FEELS": "Jaučiasi kaip", + "PRECIP": "Krituliai" +} From 029da3791bac3cd23b47d4564397287880213d9d Mon Sep 17 00:00:00 2001 From: larryare <47447699+larryare@users.noreply.github.com> Date: Wed, 8 Jul 2020 23:57:57 +0300 Subject: [PATCH 25/54] Update CHANGELOG.md Added lithuanian language entry. --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d5bc9b4..efd63fe7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ _This release is scheduled to be released on 2020-10-01._ ### Added +- Add lithuanian language. + ### Updated - Change incorrect weather.js default properties. From d570f910f82754039f4a3342a657279013e2b30a Mon Sep 17 00:00:00 2001 From: rejas Date: Thu, 9 Jul 2020 20:29:38 +0200 Subject: [PATCH 26/54] Added test coverage with istanbul --- .gitignore | 6 +- CHANGELOG.md | 2 + package-lock.json | 859 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 8 +- 4 files changed, 868 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index c3cf9bdb..08c2df0c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ # Various Node ignoramuses. - logs *.log npm-debug.log* @@ -13,9 +12,11 @@ build/Release /node_modules/**/* fonts/node_modules/**/* vendor/node_modules/**/* +!/tests/node_modules/**/* jspm_modules .npm .node_repl_history +.nyc_output/ # Visual Studio Code ignoramuses. .vscode/ @@ -53,7 +54,6 @@ Temporary Items .apdisk # Various Linux ignoramuses. - .fuse_hidden* .directory .Trash-* @@ -76,5 +76,3 @@ Temporary Items *.orig *.rej *.bak - -!/tests/node_modules/**/* diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d5bc9b4..1af06abd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ _This release is scheduled to be released on 2020-10-01._ ### Added +- Test coverage with Istanbul, run it with `npm run test:coverage` + ### Updated - Change incorrect weather.js default properties. diff --git a/package-lock.json b/package-lock.json index e421d505..e7687789 100644 --- a/package-lock.json +++ b/package-lock.json @@ -302,6 +302,24 @@ } } }, + "@babel/runtime-corejs3": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.10.4.tgz", + "integrity": "sha512-BFlgP2SoLO9HJX9WBwN67gHWMBhDX/eDz64Jajd6mR/UAUzqrNMm99d4qHnVaKscAElZoFiPv+JpR/Siud5lXw==", + "dev": true, + "requires": { + "core-js-pure": "^3.0.0", + "regenerator-runtime": "^0.13.4" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.13.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", + "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==", + "dev": true + } + } + }, "@babel/template": { "version": "7.10.1", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.1.tgz", @@ -458,6 +476,88 @@ "to-fast-properties": "^2.0.0" } }, + "@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + } + } + }, + "@istanbuljs/schema": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", + "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", + "dev": true + }, "@nodelib/fs.scandir": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", @@ -636,6 +736,24 @@ "es6-promisify": "^5.0.0" } }, + "aggregate-error": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", + "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "dependencies": { + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + } + } + }, "ajv": { "version": "6.10.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", @@ -687,6 +805,21 @@ "integrity": "sha1-7klza2ObTxCLbp5ibG2pkwa0FpI=", "dev": true }, + "append-transform": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", + "dev": true, + "requires": { + "default-require-extensions": "^3.0.0" + } + }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "dev": true + }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -1088,6 +1221,18 @@ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" }, + "caching-transform": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", + "dev": true, + "requires": { + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" + } + }, "callsite": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", @@ -1226,6 +1371,12 @@ "resolved": "https://registry.npmjs.org/clarinet/-/clarinet-0.12.4.tgz", "integrity": "sha512-Rx9Zw8KQkoPO3/O2yPRchCZm3cGubCQiRLmmFAlbkDKobUIPP3JYul+bKILR9DIv1gSVwPQSgF8JGGkXzX8Q0w==" }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, "cli-width": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", @@ -1328,6 +1479,12 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, "compare-versions": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", @@ -1467,6 +1624,12 @@ "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==", "dev": true }, + "core-js-pure": { + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.5.tgz", + "integrity": "sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA==", + "dev": true + }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -1758,6 +1921,23 @@ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" }, + "default-require-extensions": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", + "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", + "dev": true, + "requires": { + "strip-bom": "^4.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true + } + } + }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -2142,6 +2322,12 @@ "is-symbol": "^1.0.2" } }, + "es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true + }, "es6-promise": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", @@ -2754,6 +2940,17 @@ } } }, + "find-cache-dir": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", + "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + } + }, "find-up": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", @@ -2796,6 +2993,59 @@ "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==" }, + "foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + }, + "dependencies": { + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -2826,6 +3076,12 @@ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" }, + "fromentries": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.0.tgz", + "integrity": "sha512-33X7H/wdfO99GdRLLgkjUrD4geAFdq/Uv0kl3HD4da6HDixd2GUg8Mw7dahLCV9r/EARkmtYBB6Tch4EEokFTQ==", + "dev": true + }, "fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", @@ -2898,6 +3154,12 @@ "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", "dev": true }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true + }, "get-stdin": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", @@ -3129,6 +3391,24 @@ "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", "dev": true }, + "hasha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.0.tgz", + "integrity": "sha512-2W+jKdQbAdSIrggA8Q35Br8qKadTrqCTC8+XZvBWepKDK6m9XkX6Iz1a2yh2KP01kzAR/dpuMeUnocoLYDcskw==", + "dev": true, + "requires": { + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" + }, + "dependencies": { + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + } + } + }, "he": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", @@ -3228,6 +3508,12 @@ "whatwg-encoding": "^1.0.1" } }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, "html-tags": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.1.0.tgz", @@ -3710,6 +3996,12 @@ "integrity": "sha512-SDweEzfIZM0SJV0EUga669UTKlmL0Pq8Lno0QDQsPnvECB3IM2aP0gdx5TrU0A01MAPfViaZiI2V1QMZLaKK5w==", "dev": true }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, "is-word-character": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-word-character/-/is-word-character-1.0.4.tgz", @@ -3731,6 +4023,168 @@ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, + "istanbul-lib-coverage": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", + "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", + "dev": true + }, + "istanbul-lib-hook": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", + "dev": true, + "requires": { + "append-transform": "^2.0.0" + } + }, + "istanbul-lib-instrument": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "dev": true, + "requires": { + "@babel/core": "^7.7.5", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "istanbul-lib-processinfo": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", + "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", + "dev": true, + "requires": { + "archy": "^1.0.0", + "cross-spawn": "^7.0.0", + "istanbul-lib-coverage": "^3.0.0-alpha.1", + "make-dir": "^3.0.0", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "uuid": "^3.3.3" + }, + "dependencies": { + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", + "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "istanbul-reports": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", + "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -4085,6 +4539,12 @@ "integrity": "sha1-ywcE1Hq3F4n/oN6Ll92Sb7iLE7E=", "dev": true }, + "lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", + "dev": true + }, "lodash.includes": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", @@ -4212,6 +4672,23 @@ "integrity": "sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA==", "dev": true }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, "map-age-cleaner": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", @@ -4828,6 +5305,15 @@ "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==", "dev": true }, + "node-preload": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", + "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", + "dev": true, + "requires": { + "process-on-spawn": "^1.0.0" + } + }, "node-releases": { "version": "1.1.58", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.58.tgz", @@ -4924,6 +5410,270 @@ "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", "dev": true }, + "nyc": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", + "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", + "dev": true, + "requires": { + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^2.0.0", + "get-package-type": "^0.1.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "make-dir": "^3.0.0", + "node-preload": "^0.2.1", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "yargs": "^15.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "yargs": { + "version": "15.4.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.0.tgz", + "integrity": "sha512-D3fRFnZwLWp8jVAAhPZBsmeIHY8tTsb8ItV9KaAaopmC6wde2u6Yw29JBIZHXw14kgkRnYmDgmQU4FVMDlIsWw==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^3.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "dependencies": { + "decamelize": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-3.2.0.tgz", + "integrity": "sha512-4TgkVUsmmu7oCSyGBm5FvfMoACuoh9EOidm7V5/J2X2djAwwt57qb3F2KMP2ITqODTCSwb+YRV+0Zqrv18k/hw==", + "dev": true, + "requires": { + "xregexp": "^4.2.4" + } + } + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", @@ -5106,12 +5856,33 @@ "p-limit": "^1.1.0" } }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, "p-try": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", "dev": true }, + "package-hash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "hasha": "^5.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + } + }, "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -5804,6 +6575,15 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, + "process-on-spawn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", + "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", + "dev": true, + "requires": { + "fromentries": "^1.2.0" + } + }, "progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -5993,6 +6773,15 @@ "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==" }, + "release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", + "dev": true, + "requires": { + "es6-error": "^4.0.1" + } + }, "remark": { "version": "12.0.0", "resolved": "https://registry.npmjs.org/remark/-/remark-12.0.0.tgz", @@ -6569,6 +7358,40 @@ "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", "dev": true }, + "spawn-wrap": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", + "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", + "dev": true, + "requires": { + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "which": "^2.0.1" + }, + "dependencies": { + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "spdx-correct": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", @@ -7713,6 +8536,33 @@ } } }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "dependencies": { + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -8304,6 +9154,15 @@ "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz", "integrity": "sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4=" }, + "xregexp": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.3.0.tgz", + "integrity": "sha512-7jXDIFXh5yJ/orPn4SXjuVrWWoi4Cr8jfV1eHv9CixKSbU+jY4mxfrBwAuDvupPNKpMUY+FeIqsVw/JLT9+B8g==", + "dev": true, + "requires": { + "@babel/runtime-corejs3": "^7.8.3" + } + }, "xtend": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", diff --git a/package.json b/package.json index 63d9fcdd..11a8f79c 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,10 @@ "install": "echo \"Installing vendor files ...\n\" && cd vendor && npm install --loglevel=error", "install-fonts": "echo \"Installing fonts ...\n\" && cd fonts && npm install --loglevel=error", "postinstall": "npm run install-fonts && echo \"MagicMirror installation finished successfully! \n\"", - "test": "NODE_ENV=test ./node_modules/mocha/bin/mocha tests --recursive", - "test:unit": "NODE_ENV=test ./node_modules/mocha/bin/mocha tests/unit --recursive", - "test:e2e": "NODE_ENV=test ./node_modules/mocha/bin/mocha tests/e2e --recursive", + "test": "NODE_ENV=test mocha tests --recursive", + "test:coverage": "NODE_ENV=test nyc mocha tests --recursive --timeout=3000", + "test:e2e": "NODE_ENV=test mocha tests/e2e --recursive", + "test:unit": "NODE_ENV=test mocha tests/unit --recursive", "test:prettier": "prettier --check **/*.{js,css,json,md,yml}", "test:js": "eslint *.js js/**/*.js modules/default/**/*.js clientonly/*.js serveronly/*.js translations/*.js vendor/*.js tests/**/*.js config/* --config .eslintrc.json --quiet", "test:css": "stylelint css/main.css modules/default/**/*.css --config .stylelintrc.json", @@ -54,6 +55,7 @@ "mocha": "^7.1.2", "mocha-each": "^2.0.1", "mocha-logger": "^1.0.6", + "nyc": "^15.1.0", "prettier": "^2.0.5", "pretty-quick": "^2.0.1", "spectron": "^8.0.0", From dc089d7db952ded33f1c40073b6eb1668d2174b5 Mon Sep 17 00:00:00 2001 From: rejas Date: Thu, 9 Jul 2020 20:30:26 +0200 Subject: [PATCH 27/54] Remove stripCommentsFromJson code and test Since we dont allow comments in the json anymore anyway --- js/translator.js | 82 +-------------------------- tests/unit/classes/translator_spec.js | 19 ------- 2 files changed, 1 insertion(+), 100 deletions(-) diff --git a/js/translator.js b/js/translator.js index 3a09fe0b..ee4e1051 100644 --- a/js/translator.js +++ b/js/translator.js @@ -19,92 +19,12 @@ var Translator = (function () { xhr.open("GET", file, true); xhr.onreadystatechange = function () { if (xhr.readyState === 4 && xhr.status === 200) { - callback(JSON.parse(stripComments(xhr.responseText))); + callback(JSON.parse(xhr.responseText)); } }; xhr.send(null); } - /* loadJSON(str, options) - * Remove any commenting from a json file so it can be parsed. - * - * argument str string - The string that contains json with comments. - * argument opts function - Strip options. - * - * return the stripped string. - */ - function stripComments(str, opts) { - // strip comments copied from: https://github.com/sindresorhus/strip-json-comments - - var singleComment = 1; - var multiComment = 2; - - function stripWithoutWhitespace() { - return ""; - } - - function stripWithWhitespace(str, start, end) { - return str.slice(start, end).replace(/\S/g, " "); - } - - opts = opts || {}; - - var currentChar; - var nextChar; - var insideString = false; - var insideComment = false; - var offset = 0; - var ret = ""; - var strip = opts.whitespace === false ? stripWithoutWhitespace : stripWithWhitespace; - - for (var i = 0; i < str.length; i++) { - currentChar = str[i]; - nextChar = str[i + 1]; - - if (!insideComment && currentChar === '"') { - var escaped = str[i - 1] === "\\" && str[i - 2] !== "\\"; - if (!escaped) { - insideString = !insideString; - } - } - - if (insideString) { - continue; - } - - if (!insideComment && currentChar + nextChar === "//") { - ret += str.slice(offset, i); - offset = i; - insideComment = singleComment; - i++; - } else if (insideComment === singleComment && currentChar + nextChar === "\r\n") { - i++; - insideComment = false; - ret += strip(str, offset, i); - offset = i; - continue; - } else if (insideComment === singleComment && currentChar === "\n") { - insideComment = false; - ret += strip(str, offset, i); - offset = i; - } else if (!insideComment && currentChar + nextChar === "/*") { - ret += str.slice(offset, i); - offset = i; - insideComment = multiComment; - i++; - continue; - } else if (insideComment === multiComment && currentChar + nextChar === "*/") { - i++; - insideComment = false; - ret += strip(str, offset, i + 1); - offset = i + 1; - continue; - } - } - - return ret + (insideComment ? strip(str.substr(offset)) : str.substr(offset)); - } - return { coreTranslations: {}, coreTranslationsFallback: {}, diff --git a/tests/unit/classes/translator_spec.js b/tests/unit/classes/translator_spec.js index b0ec084c..9d784cff 100644 --- a/tests/unit/classes/translator_spec.js +++ b/tests/unit/classes/translator_spec.js @@ -171,25 +171,6 @@ describe("Translator", function () { }; }); - it("should strip comments", function (done) { - const dom = new JSDOM(`