1259 Commits

Author SHA1 Message Date
Karsten Hassel
b910c60eb2
update dependencies (#3657) 2024-12-18 22:04:16 +01:00
sam detweiler
24d9b70c4c
fix access denied fault error writing js/positions.js (#3652)
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
2024-12-18 17:37:51 +01:00
sam detweiler
786eacf41a
update config.js.sample about locale variable (#3655)
add text to config.js.sample about usage of locale variable/property

Co-authored-by: Veeck <github@veeck.de>
2024-12-18 13:43:20 +01:00
Kristjan ESPERANTO
5b3b40da66
Use project URL in fallback config (#3656) 2024-12-18 08:00:00 +01:00
sam detweiler
5232f46d44
fix #3267 again this time, dropped from big cal update (#3650)
this change was dropped from #3267 by mistake
2024-12-08 21:23:53 +01:00
sam detweiler
39ab651319
Show animations, fix export only on server side (#3649)
fix #3644 so only on server side
2024-12-08 16:24:39 +01:00
Kristjan ESPERANTO
76fac78909
Run code style checks in workflow only once (#3648)
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.
2024-12-07 18:29:49 +01:00
Kristjan ESPERANTO
5b7b76c877
Add linting for markdown files (#3646)
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>
2024-12-07 10:12:28 +01:00
sam detweiler
19bd76ab93
Fixcaldates2 fix calendar module date processing, using node-ical@0.20.1 (#3587)
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>
2024-12-07 09:51:11 +01:00
Kristjan ESPERANTO
291ae8546c
Handle "module is not defined" in e2e tests (#3647)
Even in successful tests, there are many module not defined` error
entries. Like this:
https://github.com/MagicMirrorOrg/MagicMirror/actions/runs/12199106844/job/34032254241#step:5:353

I think we can suppress them.
2024-12-07 08:17:04 +01:00
sam detweiler
63178eba72
Export animations (#3644)
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?
2024-12-02 10:17:19 +01:00
Kristjan ESPERANTO
07768c3a88
Reactivate eslint-plugin-package-json (#3643)
Somehow the plugin get lost when we moved to ESLint flat config. Now I
reactivated it.

One rules caused sorting the scripts. If this is not okay, I can undo
this and switch off the rule.

Thank's @bugsounet for the pinging in
https://github.com/MagicMirrorOrg/MagicMirror/pull/3637#issuecomment-2509771362.
2024-12-01 15:26:23 +01:00
Bugsounet - Cédric
bd1324cc42
Remove @eslint/js dependency. Already installed with eslint in deep (#3636)
I lint my modules and just see this:

`@eslint/js` is now not needed.
it's installed by `eslint` it self
2024-11-17 13:15:51 +01:00
Kristjan ESPERANTO
15baffdede
Adapt to "Keep a Changelog" (#3634)
- Adapt heading and description to "Keep a Changelog" guideline v1.1.0
- Add missing links at the end - with this, users can click on the
version number to see the diffs (I think this was intended from the
beginning)
- Fix two bare URLs

## The link fix
Before (the link on the version number doesn't work):
![Screenshot from 2024-11-14
01-15-07](https://github.com/user-attachments/assets/e0ff4eee-abc8-4ba8-9fb7-f18fd3279ddf)

After (the link on the version number works):
![Screenshot from 2024-11-14
01-15-52](https://github.com/user-attachments/assets/7b2997e7-cf6d-4e23-b4fc-50536174f4c6)
2024-11-14 19:05:41 +01:00
sam detweiler
bd620e0061
Enhance compliments remote file with refresh support (#3630)
add support to refresh the compliments remotefile
add testcases for both without refresh (testcase missing) and with
refresh

doc to be updated
2024-11-13 09:57:55 +01:00
Kristjan ESPERANTO
f1522da153
Fix eslint ignores (#3633)
This will fix #3632.
2024-11-12 21:05:31 +01:00
sam detweiler
56cb536df1
add support for test mode detection in modulename.js via index.html (#3631)
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)
2024-11-12 15:58:36 +01:00
Bugsounet - Cédric
4259d7c075
updatenotification: some fixes (#3628)
continue from #3626 

Is it ok for you ?
2024-11-09 09:59:12 +01:00
Bugsounet - Cédric
cd6f10c843
PM2 Fix (again): add pm2_env.unique_id checking and cleaning (#3626)
#3605 : new purpose code with `pm2_env.unique_id` checking
2024-11-07 11:38:46 +01:00
sam detweiler
7e6349c093
Fix compliments croner (#3625)
croner changed the filename we need to use in the latest version
fix the alias table in vendor/vendor.js

fixes #3624
2024-11-04 17:41:48 +01:00
Kristjan ESPERANTO
6ce3622c61
Add spelling check to GitHub workflow (#3623)
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?
2024-11-03 21:49:00 +01:00
Veeck
0aae771799
Update dependencies reported by Dependabot (#3621)
... maybe we should group those dependabot PRs someday (see
https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#groups)

---------

Co-authored-by: veeck <gitkraken@veeck.de>
2024-11-02 15:58:20 +01:00
Karsten Hassel
9114aefecc
fix missing basePath (#3620)
fixes #3613 

wanted to write a test for `basePath` but have no idea at the moment to
simulate this without a reverse proxy.

Here my test setup for documentation:
```yaml
networks:
  proxy:
    driver: bridge

services:
  socket-proxy:
    privileged: true
    image: tecnativa/docker-socket-proxy:edge
    container_name: socket-proxy
    restart: unless-stopped
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      CONTAINERS: 1
    ports:
      - "127.0.0.1:2375:2375"
    networks:
      - proxy

  traefik:
    image: traefik:latest
    container_name: traefik
    restart: unless-stopped
    user: 1000:1000
    command:
      - "--providers.docker=true"
      - "--providers.docker.network=traefik_proxy"
      - "--providers.docker.endpoint=tcp://socket-proxy:2375"
      - "--entryPoints.http.address=:80"
      - "--global.sendAnonymousUsage=false"
      - "--log.level=INFO"
      - "--api=true"
      - "--api.dashboard=true"
#      - "--accessLog=true"
#      - "--accesslog.fields.defaultmode=keep"
#      - "--accesslog.fields.headers.defaultmode=keep"
    networks:
      - proxy
    ports:
      - "80:80"

  magicmirror:
    image: karsten13/magicmirror:develop
    container_name: mm
    restart: unless-stopped
    entrypoint:
      - sleep
      - infinity
    networks:
      - proxy
    labels:
      - "traefik.http.services.karsten13.loadbalancer.server.port=8080"
      - "traefik.http.routers.k13-http.service=karsten13"
      - "traefik.http.routers.k13-http.entrypoints=http"
      - "traefik.http.routers.k13-http.rule=Host(`localhost`) && PathPrefix(`/testbasepath`)"
      - "traefik.http.middlewares.k13-stripprefix.stripprefix.prefixes=/testbasepath"
      - "traefik.http.routers.k13-http.middlewares=k13-stripprefix"
```
2024-11-02 08:22:27 +01:00
Bugsounet - Cédric
399e2ae1da
[updatenotification] Fix pm2 using detection when pm2 script is inside or outside MagicMirror root folder (#3605)
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
2024-10-28 10:32:39 +01:00
sam detweiler
c96326b760
Cleanup testcases that had hard coded Date() values which override the testcase runner (#3601)
cleanup testcases with hard coded Date settings after #3597
2024-10-25 20:52:00 +02:00
Karsten Hassel
cfa5c0d127
fix electron tests mocking dates (#3599)
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)
2024-10-25 11:34:35 +02:00
sam detweiler
6946b49977
Fixtestcase calendar testcase failure (#3596)
fix calendar testcase failing after date change (exposes helper failure)
2024-10-23 23:46:32 +02:00
Kristjan ESPERANTO
aa7e856170
Add wayland and windows start options (#3594)
This PR adds start options for Wayland and Windows.

This would solve issue #3582.

**To Do if this PR is merged:**

- [ ] Adjust [Windows
section](https://docs.magicmirror.builders/getting-started/installation.html#windows)
in documentation
- [ ] Add Wayland section to the documentation
2024-10-23 21:42:29 +02:00
Veeck
b54fc08da7
Add npm publishing step to release process (#3595)
so that the npm version also stays in sync and
https://github.com/MagicMirrorOrg/MagicMirror/issues/2876 can be closed
for good
2024-10-23 20:47:01 +02:00
Kristjan ESPERANTO
0f024cff4e
Run and test with node 23 (#3588) 2024-10-19 12:11:20 +02:00
Veeck
fff31068ab
Re-add eslint-plugin-import (#3586)
eslint-plugin-import was missing since the switch to
[v9](https://github.com/MagicMirrorOrg/MagicMirror/pull/3558). They
finally
[support](https://github.com/import-js/eslint-plugin-import/pull/2996)
it so we can re-add it.
2024-10-13 15:22:02 +02:00
Karsten Hassel
3d1e8ab849
add address and ipWhitelist to all test configs (#3585)
All test configs have been updated to allow full external access,
allowing for easier debugging (especially when running as a container)
2024-10-12 07:53:58 +02:00
Bugsounet - Cédric
1b80e87563
[core] test electron v32 and electron rebuild (#3584)
test deps: nan v2.22.0 and electron v32
2024-10-11 11:57:34 +02:00
HeikoGr
7489e51a67
Change default for weatherEndpoint according to API 3.0 (#3583)
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>
2024-10-11 08:51:00 +02:00
Karsten Hassel
0130dc45ab
stale workflow: increase operations-per-run (default=30) so that all … (#3581)
…issues can be processed
2024-10-05 22:41:41 +02:00
Karsten Hassel
c7dcf542cf
allow manually running stale workflow (#3580) 2024-10-05 19:47:34 +02:00
Bugsounet - Cédric
961bae637c
[core] add try / catch on mode_helper loading (#3578)
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
2024-10-05 15:23:36 +02:00
Karsten Hassel
f51fbe39c4
reactivated stale.yaml as github action (#3577)
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.
2024-10-04 21:47:07 +02:00
Bugsounet - Cédric
ee98a0c7e5
[UpdateNotification] Fix pm2 using detection when pm2 script is in MagicMirror root folder (#3576)
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 
```
2024-10-02 18:33:46 +02:00
Bugsounet - Cédric
4c7c859ae6
[Electron rebuild] Removed node-pty and drivelist from rebuilded test (#3575)
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
2024-10-02 18:31:57 +02:00
Karsten Hassel
d1be92a426 Prepare v2.30.0-develop 2024-10-01 00:09:29 +02:00
Karsten Hassel
d84d612df5 Release 2.29.0 2024-09-30 23:49:05 +02:00
Karsten Hassel
719eca49fe
update dependencies, nail down node-ical version to 0.18.0 (#3566)
- node-ical use `0.18.0` instead of `^0.18.0` in `package.json`
- cleanup `package-lock.json`
2024-09-28 15:33:53 -05:00
sam detweiler
d9eefff066
fix double load of positions now that check:config at startup is active (#3565)
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
2024-09-28 15:52:09 +02:00
Bugsounet - Cédric
731512c2e5
Electron rebuild tests update (#3563)
# 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
2024-09-26 19:09:39 +02:00
Bugsounet - Cédric
ebaeed935f
Engine except on node v21 (#3561)
in addition of #3559 

except with node v21: no security updates and EOL
2024-09-26 19:09:10 +02:00
Marc Landis
2e6e86887b
fix calendar showing previous day when using sliceMultiDayEvents (#3555)
This bug is caused by #3543.

The calculation for midnight adds a day but for endDate we want the day
to be subtracted again.
2024-09-25 21:16:43 +02:00
Kristjan ESPERANTO
d3187689f0
Switch to ESLint v9 and flat config (#3558)
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.
2024-09-25 21:05:11 +02:00
Bugsounet - Cédric
5ffdf9af09
Updated minimal needed node version in package.json (currently v20.9.0) (#3559)
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`
2024-09-25 09:03:09 +02:00
Karsten Hassel
08116b8e64
fixes for running tests for MM_MODULES_DIR (#3550)
and ignore `js/positions.js` when linting (because this file is
generated at runtime).
2024-09-24 22:38:00 +02:00