if the MagicMirror js folder is not writable (synology nas created by
different user than docker container) there is an uncaught throw
```
[ERROR] EACCES: permission denied, open 'js/positions.js'
```
add try/catch, output new message, console.error
```text
unable to write js/positions.js with the discovered module positions
make the MagicMirror/js folder writeable by the user starting MagicMirror
```
MM will start, but no modules will show, as no positions were discovered
this file is used to pass the list from the server side to the browser
side
fixes#3651
It's enough if the code style checks are successful once, it's not
necessary to run them with every node version.
Also, if there is an error, we can see more quickly whether it is a code
style or a test-runner issue.
I also reworked the Linters section in `CONTRIBUTING.md` a bit and
switched the `prettier` config to a flat config.
Co-authored-by: Veeck <github@veeck.de>
here is an updated test version of the fixes for all kinds of calendar
date problems.
NOTE: the changed branch name
NOTE: this used the node-cal@0.19.0 library UNCHANGED
best to make a new folder and git clone there
git clone https://github.com/sdetweil/MagicMirror
cd MagicMirror
git checkout fixcaldates2 // <------ note this is a changed branch name
npm run install-mm
copy your config.js and custom.css from the prior folder
and the non-default modules you have installed…
this ONLY changes the default calendar
but DOES ship an updated node-ical library too
if you need to fall back, just rename the folders around again so that
your original is called MagicMirror
all the testcases for node-ical and MagicMirror execute successfully.
the ‘BIG’ change here is to get the local NON-TZ dates for the
rrule.between()
all the checking and conversion code is commented out or not used
the node-ical fixes are for excluded dates (exdate) values being
adjusted for DST/STD time… waiting to submit that PR
one fix in calendar.js for checking if a past date was too far back,
but it never checked to see IF the event date was in the past… (before
today) so it chopped off too many
and one change in calendarfetcher.js to put out a better diagnostic
message of the parsed data… (exdate was excluded cause JSON stringify
couldn’t convert the complex structure)
I added the tests you all have documented
please re-pull and checkout the new branch (I deleted the old branch)
and npm run install-mm again
---------
Co-authored-by: Veeck <github@veeck.de>
I am adding the animateIn/Out support to MMM-Config, but I need the list
of animations..
but they are not visible in js/animateCSS.js (from require)
adding an export satisfies that
side issue, these would go in a dropdown list
what value can I use for the default behavior? none/default?
don't want an error produced..
should I add code to check for this value to prevent error?
in some cases the modulename.js may need to detect running in test mode
(compliments pr #3630)
window.name is not set web mode
add a new field to the index.html
window.intest
and use the server_function to replace the hard coded string like we do
for window.mmversion=#VERSION#
then change the two test helpers to set the env variable
app.js detects and sets global.intest=true
server func replace with value of global.intest
then module can use if(window.intest)
Besides updating cspell and handling spelling issues, the important
change is adding the spelling check to the GitHub workflow.
I'm not sure if it will bother us too much when people create PRs. But I
wanted to give it a try. Or do you have any other ideas on how we can
run the spelling check on a regular basis?
This will fix#3576
@FrankBlackMG:
I don't use `*env.unique_id` because some others modules can use pm2 too
for starting a service and unique_id is the same (this will make
confusion)
So I check `name` and `pm_id` for found it
fixes#3597
Changes:
- electron tests: add mocking to `electron.js` for mocking the server
side, before only the browser side was mocked
- publish "/tests/configs" and "/tests/mocks" always in `server.js`,
this reverts a change done with latest release, we need this for
debugging (otherwise you get on the screen that your config has errors
but config check is successful ...)
- revert hotfix in
`tests/configs/modules/calendar/show-duplicates-in-calendar.js`
- fix `tests/configs/modules/calendar/custom.js` to allow events in the
past (~~I don't know how this could work before~~ when testing css
classes `yesterday` and `dayBeforeYesterday` --> it worked before
because the server side did not mock and therefore was not in the past)
since API 3.0 is default, weatherEndpoint should be set to "/onecall"
Fixes#3574
ATTENTION: since lat / lon defaults to 0 / 0, the weather plugins works
after this patch, but shows the weather from
https://de.wikipedia.org/wiki/Null_Island if lat / lon is not manually
set.
---------
Co-authored-by: Karsten Hassel <hassel@gmx.de>
Co-authored-by: Pedro Lamas <pedrolamas@gmail.com>
When a library is missing on an 3rd party module, MM² stop loading and
display a black screen. (I'm sure it's happened to everyone.)
So, I have added a try/catch block and it's avoid black screen, display
errors and allow continue loading with next module
The old `stale.yaml` seems not to work anymore, so I set up the same
content in a new github workflow.
I think we should use it again to get rid of old issues.
I discover this bug:
When pm2 `sh` script is on MagicMirror root folder, updatenotification
is not able to detect pm2 using
```
0|MagicMirror | [2024-10-02 17:23:09.215] [DEBUG] Version Compare: 2.30.0-develop 2.30.0-develop --> true
0|MagicMirror | [2024-10-02 17:23:09.216] [DEBUG] Status: online
0|MagicMirror | [2024-10-02 17:23:09.216] [DEBUG] PM2 MagicMirror starting from Path: /home/bugsounet/MagicMirror-dev
0|MagicMirror | [2024-10-02 17:23:09.216] [DEBUG] MagicMirror Path /home/bugsounet/MagicMirror-dev/
0|MagicMirror | [2024-10-02 17:23:09.216] [DEBUG] Compare: false
0|MagicMirror | [2024-10-02 17:23:09.216] [INFO] updatenotification: [PM2] You are not using pm2
```
Related to #3573
I think it's better to keep new library node-libgpiod for testing
(library to manage RPI gpio for pir sensor management) and delete others
Only one test is better
after adding check:config to the MM startup process, #3450, we
accidentally discover module positions more than once, and write the
file each time..
add a check to see if we have done this work already
# Update electron-rebuild.yaml
* remove onoff library: Not updated since 3 years, don't work with last
rpi Os
* add node-libgpiod library in replacement
Since PR #3551 was not yet complete, I made my own attempt.
1. Update to ESLint v9.
2. Replace deprecated `.eslintrc.json` and `.eslintignore` by flat
config `eslint.config.mjs`.
3. Adapt `check_config.js` to use flat config.
4. Since `eslint-plugin-import` still doesn't support ESLint v9 I
removed it. We can add it back when it does support v9.
5. Run tests `npm run check:js` and `npm run config:check`.
6. In order not to overload this PR, I have not yet activated more
additional rules - there are some useful ones in the new plugin
`@eslint/js`.
@bugsounet, please don't take it as an offence that I have created a
competing PR. The migration to ESLint v9 has been burning under my nails
for some time.
Update of package*.json for minimal node verion requirement (v20.9.0)
* it's an addition to #3556
* According to changelog v2.28.0: `⚠️ This release needs nodejs version
>= v20.9.0`