Skip to content

Commit

Permalink
Merge pull request #2672 from MichMich/develop
Browse files Browse the repository at this point in the history
Release 2.17.0
  • Loading branch information
MichMich authored Oct 1, 2021
2 parents 26a76f8 + f746567 commit 5a4fbbf
Show file tree
Hide file tree
Showing 123 changed files with 3,600 additions and 3,927 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"prettier/prettier": "error",
"eqeqeq": "error",
"no-prototype-builtins": "off",
"no-unused-vars": "off"
"no-unused-vars": "off",
"no-useless-return": "error"
}
}
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ To run ESLint, use `npm run lint:js`.

We use [StyleLint](https://stylelint.io) to lint our CSS. Our configuration is in our .stylelintrc file.

To run StyleLint, use `npm run lint:style`.
To run StyleLint, use `npm run lint:css`.

### Submitting Issues

Expand All @@ -32,9 +32,9 @@ When submitting a new issue, please supply the following information:

**Platform**: Place your platform here... give us your web browser/Electron version _and_ your hardware (Raspberry Pi 2/3/4, Windows, Mac, Linux, System V UNIX).

**Node Version**: Make sure it's version 10 or later.
**Node Version**: Make sure it's version 12 or later (recommended is 14).

**MagicMirror Version**: Now that the versions have split, tell us if you are using the PHP version (v1) or the newer JavaScript version (v2).
**MagicMirror Version**: Please let us know which version of MagicMirror you are running. It can be found in the `package.json` file.

**Description**: Provide a detailed description about the issue and include specific details to help us understand the problem. Adding screenshots will help describing the problem.

Expand Down
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github: MichMich
custom: ['https://magicmirror.builders/#donate']
custom: ["https://magicmirror.builders/#donate"]
10 changes: 6 additions & 4 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ If you are facing an issue or found a bug while trying to install MagicMirror vi

## I found a bug in the MagicMirror Docker image

If you are facing an issue or found a bug while running MagicMirror inside a Docker container please create an issue in the GitHub repository of the MagicMirror Docker image:
[https://github.com/bastilimbach/docker-MagicMirror](https://github.com/bastilimbach/docker-MagicMirror)
If you are facing an issue or found a bug while running MagicMirror inside a Docker container please create an issue in the corresponding repository:

- karsten13/magicmirror: [https://gitlab.com/khassel/magicmirror](https://gitlab.com/khassel/magicmirror)
- (deprecated) bastilimbach/docker-magicmirror: [https://github.com/bastilimbach/docker-MagicMirror](https://github.com/bastilimbach/docker-MagicMirror)

---

Expand All @@ -31,9 +33,9 @@ When submitting a new issue, please supply the following information:

**Platform**: Place your platform here... give us your web browser/Electron version _and_ your hardware (Raspberry Pi 2/3/4, Windows, Mac, Linux, System V UNIX).

**Node Version**: Make sure it's version 10 or later.
**Node Version**: Make sure it's version 12 or later (recommended is 14).

**MagicMirror Version**: Please let us now which version of MagicMirror you are running. It can be found in the `package.log` file.
**MagicMirror Version**: Please let us know which version of MagicMirror you are running. It can be found in the `package.json` file.

**Description**: Provide a detailed description about the issue and include specific details to help us understand the problem. Adding screenshots will help describing the problem.

Expand Down
23 changes: 10 additions & 13 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,20 @@ Hello and thank you for wanting to contribute to the MagicMirror project

**Please make sure that you have followed these 4 rules before submitting your Pull Request:**

> 1) Base your pull requests against the `develop` branch.
> 1. Base your pull requests against the `develop` branch.
>
> 2. Include these infos in the description:
>
> 2) Include these infos in the description:
> * Does the pull request solve a **related** issue?
> * If so, can you reference the issue like this `Fixes #<issue_number>`?
> * What does the pull request accomplish? Use a list if needed.
> * If it includes major visual changes please add screenshots.
> - Does the pull request solve a **related** issue?
> - If so, can you reference the issue like this `Fixes #<issue_number>`?
> - What does the pull request accomplish? Use a list if needed.
> - If it includes major visual changes please add screenshots.
>
> 3. Please run `npm run lint:prettier` before submitting so that
> style issues are fixed.
>
> 3) Please run `npm run lint:prettier` before submitting so that
> style issues are fixed.
>
>
> 4) Don't forget to add an entry about your changes to
> the CHANGELOG.md file.
> 4. Don't forget to add an entry about your changes to
> the CHANGELOG.md file.
**Note**: Sometimes the development moves very fast. It is highly
recommended that you update your branch of `develop` before creating a
Expand Down
Binary file removed .github/header.psd
Binary file not shown.
37 changes: 37 additions & 0 deletions .github/workflows/automated-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: "Run Automated Tests"

on:
push:
branches: [master, develop]
pull_request:
branches: [master, develop]

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies and run tests
run: |
Xvfb :99 -screen 0 1024x768x16 &
export DISPLAY=:99
npm install
touch css/custom.css
npm run test:prettier
npm run test:js
npm run test:css
npm run test:unit
npm run test:e2e
npm run test:electron
14 changes: 9 additions & 5 deletions .github/workflows/codecov-test-suites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,26 @@ name: "Run Codecov Tests"

on:
push:
branches: [ master, develop ]
branches: [master, develop]
pull_request:
branches: [ master, develop ]
branches: [master, develop]

jobs:
run-and-upload-coverage-report:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- run: |
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies and run coverage
run: |
Xvfb :99 -screen 0 1024x768x16 &
export DISPLAY=:99
npm ci
touch css/custom.css
npm run test:coverage
- uses: codecov/codecov-action@v1
- name: Upload coverage results to codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage/lcov.info
fail_ci_if_error: true
14 changes: 8 additions & 6 deletions .github/workflows/enforce-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ name: "Enforce Changelog"

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:
check:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: dangoslen/[email protected]
with:
changeLogPath: 'CHANGELOG.md'
skipLabels: 'Skip Changelog'
- name: Checkout code
uses: actions/checkout@v2
- name: Enforce changelog️
uses: dangoslen/[email protected]
with:
changeLogPath: "CHANGELOG.md"
skipLabels: "Skip Changelog"
33 changes: 0 additions & 33 deletions .github/workflows/node-ci.js.yml

This file was deleted.

1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/config
/coverage
/vendor
!/vendor/vendor.js
.github
.nyc_output
package-lock.json
*.ts
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,38 @@ 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.17.0] - 2021-10-01

Special thanks to the following contributors: @apiontek, @eouia, @jupadin, @khassel and @rejas.

### Added

- Added showTime parameter to clock module for enabling/disabling time display in analog clock.
- Added custom electron switches from user config (`config.electronSwitches`).
- Added unit tests for updatenotification module.

### Updated

- Bump electron to v13 (and spectron to v15) and update other dependencies in package.json.
- Refactor test configs, use default test config for all tests.
- Updated github templates.
- Actually test all js and css files when lint script is run.
- Update jsdocs and print warnings during testing too.
- Update weathergov provider to try fetching not just current, but also foreacst, when API URLs available.
- Refactored clock layout.
- Refactored methods from weatherproviders into weatherobject (isDaytime, updateSunTime).
- Use of `logger.js` in jest tests.
- Run prettier over all relevant files.
- Move tests needing electron in new category `electron`, use `server only` mode in `e2e` tests.
- Update dependencies in package.json.

### Fixed

- Fix undefined error with ignoreToday option in weather module (#2620).
- Fix time zone correction in calendar module when the date hour is equal to the time zone correction value (#2632).
- Fix black cursor on startup when using electron.
- Fix update notification not working for own repository (#2644).

## [2.16.0] - 2021-07-01

Special thanks to the following contributors: @210954, @B1gG, @codac, @Crazylegstoo, @daniel, @earlman, @ezeholz, @FrancoisRmn, @jupadin, @khassel, @KristjanESPERANTO, @njwilliams, @oemel09, @r3wald, @rejas, @rico24, Faizan Ahmed.
Expand Down Expand Up @@ -412,6 +444,7 @@ Special thanks to @sdetweil for all his great contributions!
- Update `ical.js` to solve various calendar issues.
- Update weather city list url [#1676](https://github.com/MichMich/MagicMirror/issues/1676)
- Only update clock once per minute when seconds aren't shown
- Update weatherprovider documentation.

### Fixed

Expand Down
3 changes: 2 additions & 1 deletion config/config.js.sample
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ let config = {
calendars: [
{
symbol: "calendar-check",
url: "webcal://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics" }
url: "webcal://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics"
}
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<!-- custom.css is loaded by the loader.js to make sure it's loaded after the module css files. -->

<script type="text/javascript">
var version = "#VERSION#";
window.mmVersion = "#VERSION#";
</script>
</head>
<body>
Expand Down
4 changes: 3 additions & 1 deletion js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ process.on("uncaughtException", function (err) {
*/
function App() {
let nodeHelpers = [];
let httpServer;

/**
* Loads the config file. Combines it with the defaults, and runs the
Expand Down Expand Up @@ -222,7 +223,7 @@ function App() {
}

loadModules(modules, function () {
const server = new Server(config, function (app, io) {
httpServer = new Server(config, function (app, io) {
Log.log("Server started ...");

for (let nodeHelper of nodeHelpers) {
Expand Down Expand Up @@ -253,6 +254,7 @@ function App() {
nodeHelper.stop();
}
}
httpServer.close();
};

/**
Expand Down
20 changes: 10 additions & 10 deletions js/class.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* MIT Licensed.
*/
(function () {
var initializing = false;
var fnTest = /xyz/.test(function () {
let initializing = false;
const fnTest = /xyz/.test(function () {
xyz;
})
? /\b_super\b/
Expand All @@ -20,35 +20,35 @@

// Create a new Class that inherits from this class
Class.extend = function (prop) {
var _super = this.prototype;
let _super = this.prototype;

// Instantiate a base class (but only create the instance,
// don't run the init constructor)
initializing = true;
var prototype = new this();
const prototype = new this();
initializing = false;

// Make a copy of all prototype properties, to prevent reference issues.
for (var p in prototype) {
for (const p in prototype) {
prototype[p] = cloneObject(prototype[p]);
}

// Copy the properties over onto the new prototype
for (var name in prop) {
for (const name in prop) {
// Check if we're overwriting an existing function
prototype[name] =
typeof prop[name] === "function" && typeof _super[name] === "function" && fnTest.test(prop[name])
? (function (name, fn) {
return function () {
var tmp = this._super;
const tmp = this._super;

// Add a new ._super() method that is the same method
// but on the super-class
this._super = _super[name];

// The method only need to be bound temporarily, so we
// remove it when we're done executing
var ret = fn.apply(this, arguments);
const ret = fn.apply(this, arguments);
this._super = tmp;

return ret;
Expand Down Expand Up @@ -91,8 +91,8 @@ function cloneObject(obj) {
return obj;
}

var temp = obj.constructor(); // give temp the original obj's constructor
for (var key in obj) {
const temp = obj.constructor(); // give temp the original obj's constructor
for (const key in obj) {
temp[key] = cloneObject(obj[key]);

if (key === "lockStrings") {
Expand Down
Loading

0 comments on commit 5a4fbbf

Please sign in to comment.