Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
7e8f28f
weather.md: update for recent changes (#230)
crazyscot Jan 29, 2024
154a843
add updates feature configuration (#234)
bugsounet Mar 23, 2024
a78bd1f
Update calendar.md (#236)
bugsounet Mar 23, 2024
2ce3c94
updateOnFetch feature Docs (#235)
bugsounet Mar 23, 2024
4e451f8
Minor changes (#238)
KristjanESPERANTO Mar 30, 2024
43103c3
Merge branch 'mm-master' into mm-develop
rejas Apr 2, 2024
942936f
Merge branch 'mm-master' into mm-develop
rejas Jul 3, 2024
6b6eb2d
Update compliments docs page (#242)
WallysWellies Jul 3, 2024
87ff347
Cleanup formatting (#247)
rejas Jul 3, 2024
f642eb1
Merge branch 'mm-master' into mm-develop
rejas Jul 3, 2024
61f70b7
UK Met Office Documentation Fix (#253)
jargordon Jul 8, 2024
89b6259
Merge branch 'master' into develop
khassel Jul 11, 2024
085392a
add doc for new compliments(#3481) and support custom positions (#351…
sdetweil Aug 4, 2024
6f61f0c
update compliments, and module position info (#255)
sdetweil Aug 31, 2024
ff262af
Merge branch 'mm-master' into mm-develop
rejas Sep 10, 2024
73fae2b
Added docs for new notification `MODULE_DOM_UPDATED` (#262)
ryan-d-williams Sep 19, 2024
eac07b0
Merge branch 'master' into develop
khassel Sep 30, 2024
3f661a4
Update Windows section and add Wayland section (#265)
KristjanESPERANTO Oct 25, 2024
1d53e8d
add clarification for nextDaysRelative and showEndsOnlyWithDuration, …
sdetweil Oct 27, 2024
eff6c0d
electron-rebuild -> @electron/rebuild (#271)
KristjanESPERANTO Nov 9, 2024
57499ae
update doc for #3630 (#273)
sdetweil Nov 12, 2024
d547306
Merge branch 'mm_master' into mm_develop
Dec 11, 2024
9f756ef
fix typos, add doc for calendar FullDateEnd format usage, add new env…
sdetweil Dec 30, 2024
98e9f94
Merge branch 'master' into develop
rejas Dec 30, 2024
90da8ee
Merge branch 'mm_master' into mm_develop
Jan 1, 2025
8567162
prepare release 2.31.0
Jan 1, 2025
a107053
Upgrade to Vuepress2 (#214)
rejas Jan 1, 2025
4f01306
Merge branch 'master' into develop
Jan 8, 2025
cbbe318
fix and update dependencies
Jan 8, 2025
5c0f8bb
update package-lock.json
khassel Jan 8, 2025
f22acb3
Merge branch 'mm_master' into mm_develop
Jan 9, 2025
44a2e0c
Final cleanups (#287)
rejas Feb 15, 2025
eae559f
Merge branch 'mm_master' into mm_develop
Feb 23, 2025
cee5e92
newsfeed: add new properties for feeds (#294)
khassel Mar 23, 2025
e66a168
[updatenotification] Added option to iterate over modules directory i…
khassel Mar 31, 2025
f31e6a8
add info for clock css and deprecated property, clarify property use …
sdetweil Mar 31, 2025
e761761
Update weather.md (#281)
princemaxwell Mar 31, 2025
a8e7e92
Merge branch 'mm_master' into mm_develop
Mar 31, 2025
2a925d1
Cleanups (#297)
rejas Mar 31, 2025
7a79763
Merge branch 'mm_master' into mm_develop
Apr 1, 2025
8bfc509
Add documentation for disableNextEvent (#307)
bughaver Apr 27, 2025
0b88fff
Add documentation for disableNextEvent (#307)
bughaver Apr 27, 2025
862f15f
Update clock.md (#309)
bughaver May 16, 2025
700a405
fix compliments option table (#300)
rejas Apr 2, 2025
6c4a0ae
Bump vite from 6.1.3 to 6.1.4 (#302)
dependabot[bot] Apr 4, 2025
8858b96
replace `npm start` with `npm run start` (#304)
khassel Apr 7, 2025
58dcc7c
Bump vite from 6.1.4 to 6.1.5 (#305)
dependabot[bot] Apr 11, 2025
320bede
Update dependencies (#306)
rejas Apr 14, 2025
e873585
Bump vite from 6.2.6 to 6.2.7 (#308)
dependabot[bot] Apr 30, 2025
e13d6ea
changes after removal of dirs fonts and vendor, remove unneeded ignor…
khassel Jun 1, 2025
f635f50
docs: reword windows part and move it from "Installation" to "Usage" …
KristjanESPERANTO Jun 4, 2025
5048aae
Merge remote-tracking branch 'origin/master' into develop
khassel Jun 5, 2025
11500bf
Auto-merge master back to develop
actions-user Jun 30, 2025
05825c8
Auto-merge master back to develop
actions-user Jul 7, 2025
7c503a3
Auto-merge master back to develop
actions-user Jul 26, 2025
57c62a0
Auto-merge master back to develop
actions-user Aug 28, 2025
7105f28
Auto-merge master back to develop
actions-user Aug 29, 2025
2e64758
Auto-merge master back to develop
actions-user Sep 8, 2025
61aff4b
Development documentation (MM issue #3252) (#218)
jkriegshauser Sep 8, 2025
52de5c6
update defaultSymbol info (#325)
rejas Sep 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions .vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,23 @@ export default {
text: "Module Development",
collapsible: true,
children: [
"/development/introduction.md",
"/development/core-module-file.md",
"/development/node-helper.md",
"/development/helper-methods.md",
"/development/logger.md",
"/development/notifications.md",
"/development/weather-provider.md",
"/development/documentation.md",
"/module-development/introduction.md",
"/module-development/core-module-file.md",
"/module-development/node-helper.md",
"/module-development/helper-methods.md",
"/module-development/logger.md",
"/module-development/notifications.md",
"/module-development/weather-provider.md",
"/module-development/documentation.md",
],
},
{
text: "Core Development",
collapsible: true,
children: [
"/core-development/introduction.md",
"/core-development/testing.md",
"/core-development/debugging.md",
],
},
{
Expand Down
12 changes: 12 additions & 0 deletions .vuepress/enhanceApp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default ({ router }) => {
router.addRoutes([
{ path: '/development/introduction.html', redirect: '/module-development/introduction.html' },
{ path: '/development/core-module-file.html', redirect: '/module-development/core-module-file.html' },
{ path: '/development/node-helper.html', redirect: '/module-development/node-helper.html' },
{ path: '/development/helper-methods.html', redirect: '/module-development/helper-methods.html' },
{ path: '/development/logger.html', redirect: '/module-development/logger.html' },
{ path: '/development/notifications.html', redirect: '/module-development/notifications.html' },
{ path: '/development/weather-provider.html', redirect: '/module-development/weather-provider.html' },
{ path: '/development/documentation.html', redirect: '/module-development/documentation.html' }
])
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Introduction
---

![MagicMirror²: The open source modular smart mirror platform. ](./.vuepress/public/header.png)
![MagicMirror²: The open source modular smart mirror platform. ](/header.png)

<p style="text-align: center">
<a href="https://choosealicense.com/licenses/mit">
Expand Down
117 changes: 117 additions & 0 deletions core-development/debugging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
title: Debugging
---

# Core Development Documentation: Debugging

Tips and tricks for debugging MagicMirror²,

## Make sure dependencies are up-to-date

When you pull a branch, exceptions can be thrown when running MagicMirror²:

```
App threw an error during load
Error: Cannot find module 'ansis'
Require stack:
```

If this happens, make sure that dependencies have been updated to latest by
executing `npm install`.

## Breakpoints

Node.js has support for
[built-in breakpoints](https://nodejs.org/api/debugger.html), or
[VSCode](https://code.visualstudio.com/) allows for visual breakpoints and
inspecting of objects.

Developer consoles in browsers and the Electron app (typically CTRL+SHIFT+I to
toggle open/close) can be used to set client-side breakpoints, step through
scripts and inspect variables.

## Logging

While there are no log files produced by the server, info is reported in two
different places:

- The console when running from `npm run start` or `npm run server`.
- This is separated into two streams, `console.log()` is output as the
`stdout` stream, and
- `console.error()` is output as the `stderr` stream.
- These can be redirected to files when starting the server. `>` will redirect
`stdout`, and `2>` will redirect `stderr`. `2>&1` will combine both streams:
`npm run start > out.log 2>&1`
- The browser's developer console (typically CTRL+SHIFT+I to toggle open/close)
will have output from scripts that run on the browser.

The [MMM-Logging](https://github.com/shbatm/MMM-Logging) module can help to
gather logs and output to a file, but at a performance cost.

Debug logging is disabled by default, and can be very verbose. It can be enabled
in the _config/config.js_ file by adding `"DEBUG"` to the `logLevel` key:

```js
let config = {
// ...
logLevel: ["INFO", "LOG", "WARN", "ERROR", "DEBUG"], // Add "DEBUG" for even more logging
// ...
};
```

If you are using `pm2` to launch MagicMirror², you can use the `logs` command to
display lines from each of the `stderr` and `stdout` streams, but not interlaced
by time:

```sh
pm2 logs --lines=15 # will show 15 lines each from stdout and stderr
```

There is no capability to identify the module that is producing console output.
However, most browsers have the ability to filter logs by a string.

## Date

It can be very useful to set the current date to debug calendar issues. In order
to do this, override `Date.now` with a lambda in _config/config.js_:

```js
Date.now = () => new Date("2023-12-31T14:05:32").valueOf();
```

This will cause every request for the current time to return the specified time,
at least for the core and built-in modules.

Several tests use this to override the current time for the test. See
`startApplication()` in _tests/electron/helpers/global-setup.js_ as it has a
`systemDate` argument to override the system date for tests.

**NOTE:** Some modules may use `new Date()` to get the current date/time, though
this is not recommended. If this is the case, the external module will not work
correctly for date debugging.

## Timezone

The `TZ` environment variable can be used to specify a valid
[canonical timezone name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
from the [tz database](https://en.wikipedia.org/wiki/Tz_database).

Several tests do this, such as this example in
_tests/electron/helpers/global-setup.js_:

```js
process.env.TZ = "GMT";
```

The _package.json_ could also be modified to force a timezone for a given
script, such as `start:dev`:

```json
"start:dev": "TZ=Europe/Madrid ./node_modules/.bin/electron js/electron.js dev"
```

Or when running from the command line (Linux example):

```sh
TZ=Europe/Madrid npm run start:dev
```
48 changes: 48 additions & 0 deletions core-development/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: Introduction
---

# Core Development Documentation

This documentation describes core MagicMirror² development.

## General

MagicMirror² is a community-driven development effort, and
[contributions](../about/contributing.md) are welcome!

In general, new features and bug fixes should be tracked against an
[issue in the MagicMirror repo](https://github.com/MagicMirrorOrg/MagicMirror/issues).
It is always a good idea to search existing issues to see if a problem you're
experiencing has already been reported, or if someone has already suggested a
feature you'd like to propose. Creating or finding an issue also starts the
discussion and helps build consensus around your proposed fix or feature.

The MagicMirror² core is
[developed on GitHub](https://github.com/MagicMirrorOrg/MagicMirror/) out of the
_develop_ branch. To begin developing MagicMirror² core, please fork the GitHub
project and create a new branch based off of the _develop_ branch.

When your development is ready for review and testing, create a new _Pull
Request_ targeting the _develop_ branch. The development team and other
contributors will be able to review your changes and provide feedback, and the
test system will run automated tests against your changes. Make sure to mention
the issue(s) that your Pull Request solves.

## Development Environment

Although Node.js applications are typically platform-independent, many of the
scripts created for MagicMirror² are Linux-based. While Windows/Mac development
is possible, you may run into issues. (Improvements here are welcome!)

You will need to have [Node.js installed](https://nodejs.org/en/download). When
doing Linux development, on newer distributions Node.js is available from
package managers.

Many Node.js or experienced Javascript developers have an environment that works
for them. New developers to Node.js / Electron can download
[VSCode for free](https://code.visualstudio.com/download) and use many
extensions available for debugging and developing Javascript.

Also checkout
[Building Node.js Apps with VSCode](https://code.visualstudio.com/docs/nodejs/nodejs-tutorial).
34 changes: 34 additions & 0 deletions core-development/testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: Testing
---

# Core Development Documentation: Testing

Unit tests are important to ensure the quality of the project as changes occur.

All tests are located in the
[_tests_ top-level directory](https://github.com/MagicMirrorOrg/MagicMirror/tree/master/tests).

## Hierarchy of Tests

Below the _tests_ directory are other directories that organize the tests:

- _configs_ - Configuration files for tests.
- _e2e_ - End-to-end tests that start and run MagicMirror² in various
configurations.
- _electron_ - Electron application tests.
- _mocks_ - Mock-up data for tests.
- _unit_ - Unit tests for utilities and smaller portions of MagicMirror².
- _utils_ - Testing utilities.

## Writing a Test

Almost all pull requests must have test coverage of changes. Usually, it is
easier to find an existing test and extend it to test your new functionality.

For example, if you were writing a test for a fix in the Calendar module, you
might locate _tests/e2e/modules/calendar_spec.js_ and add an additional test
there.

If you have questions about how to write a test, you can also ask in the
[MagicMirror forums](https://forum.magicmirror.builders/).
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ information in your README file.**
- What external API's it depends upon, including web links to those
- Whether the API/request require a key and the user limitations of those. (Is
it free?)
- **Do not use `new Date()` for the current timestamp, instead prefer
`new Date(Date.now())` as it can be more
[easily overridden for debugging](../core-development/debugging.html#Date)**.

Surely this also help you get better recognition and feedback for your work.

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ The MagicMirror core has the ability to send notifications to modules. Or even
better: the modules have the possibility to send notifications to other modules.

Additional technical information on the notifications can be found in the
[modules' documentation](/development/introduction.md#general-advice):
[modules' documentation](/module-development/introduction.md#general-advice):

- [notificationReceived](/development/core-module-file.md#subclassable-module-methods)
- [sendNotification](/development/core-module-file.md#module-instance-methods)
- [notificationReceived](/module-development/core-module-file.md#subclassable-module-methods)
- [sendNotification](/module-development/core-module-file.md#module-instance-methods)

# System notifications

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions modules/animate.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ animation name result.

::: warning Where animation can be used?

- [global module configuration](configuration.md#animated) of a module
- [this.hide()](/development/core-module-file.md#this-hide-speed-callback-options)
- [global module configuration](configuration.html#animated) of a module
- [this.hide()](../module-development/core-module-file.html#this-hide-speed-callback-options)
function in core module file
- [this.show()](/development/core-module-file.md#this-show-speed-callback-options)
- [this.show()](../module-development/core-module-file.html#this-show-speed-callback-options)
function in core module file
- [this.updateDom()](/development/core-module-file.md#this-updatedom-speed-options)
- [this.updateDom()](../module-development/core-module-file.html#this-updatedom-speed-options)
function in core module file

:::
Expand Down
Loading