Bee-Mar / mmpm

MagicMirror Package Manager
MIT License
198 stars 30 forks source link

BUG: Custom Packages saved with extension #158

Closed stagenethome closed 10 months ago

stagenethome commented 10 months ago

Describe the Bug

Is this an issue with the CLI or GUI? CLI

Is this something that should be put in the Wiki? No

I am using the docker images karsten13/mm and karsten13/mmpm. I've updated to the latest version of both. I decided to restart from scratch, especially because mmpm has been updated so much. With the previous version of mmpm I added some git repositories as "custom" and they were saved as the normal name, i.e "MMM-CalendarWeek". However, now the custom are saved as MMM-CalendarWeek-ext-mm-pkg. I thought I would just need to update the config.js to reflect that folder, but I cannot get it to work. The application is looking for the file:

MMM-CalendarWeek-ext-mm-pkg/MMM-CalendarWeek-ext-mm-pkg.js

But I only have: MMM-CalendarWeek-ext-mm-pkg/MMM-CalendarWeek.js

Error is on this load in the console of the browser: http://10.201.24.11:8080/modules/MMM-CalendarWeek-ext-mm-pkg/MMM-CalendarWeek-ext-mm-pkg.js

To Reproduce Steps to reproduce the behavior:

  1. Go to Custom Packages
  2. Add new package
  3. Install custom package via Shopping Cart

Expected behavior My expected behavior is that the custom packages are either:

  1. Saved as normal name, i.e. "MMM-CalendarWeek"
  2. .js is referenced as "MMM-CalendarWeek-ext-mm-pkg/MMM-CalendarWeek.js"

Screenshots image

image

Operating System, Python3 Version, and Web Browser\ (Please complete the following information)

MMPM Environment Settings

MMPM Log Files [Uploading mmpm-logs-2023-11-0.zip…]()

MagicMirror Config

/* MagicMirror² Config Sample
 *
 * By Michael Teeuw https://michaelteeuw.nl
 * MIT Licensed.
 *
 * For more information on how you can configure this file
 * see https://docs.magicmirror.builders/configuration/introduction.html
 * and https://docs.magicmirror.builders/modules/configuration.html
 *
 * You can use environment variables using a `config.js.template` file instead of `config.js`
 * which will be converted to `config.js` while starting. For more information
 * see https://docs.magicmirror.builders/configuration/introduction.html#enviromnent-variables
 */
let config = {
    address: "0.0.0.0", // Address to listen on, can be:
    // - "localhost", "127.0.0.1", "::1" to listen on loopback interface
    // - another specific IPv4/6 to listen on a specific interface
    // - "0.0.0.0", "::" to listen on any interface
    // Default, when address config is left out or empty, is "localhost"
    port: 8080,
    basePath: "/", // The URL path where MagicMirror² is hosted. If you are using a Reverse proxy
    // you must set the sub path here. basePath must end with a /
    ipWhitelist: [], // Set [] to allow all IP addresses
    // or add a specific IPv4 of 192.168.1.5 :
    // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
    // or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
    // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],

    useHttps: false, // Support HTTPS or not, default "false" will use HTTP
    httpsPrivateKey: "", // HTTPS private key path, only require when useHttps is true
    httpsCertificate: "", // HTTPS Certificate path, only require when useHttps is true

    language: "en",
    locale: "en-US",
    logLevel: ["INFO", "LOG", "WARN", "ERROR"], // Add "DEBUG" for even more logging
    timeFormat: 24,
    units: "metric",

    modules: [{
            module: "MMM-mmpm"
        },
        {
            module: "alert"
        },
        {
            module: "updatenotification",
            position: "top_bar"
        },
        {
            module: "MMM-CalendarWeek-ext-mm-pkg",
            position: "top_bar", // This can be any of the regions. Best results in bottom region.
            header: "Calendars",
            config: {
                calendarTitle: false,
                maximumEntries: 20,
                maximumNumberOfDays: 4,
                showEndDate: false,
                allowDuplicate: false,
                maxTitleLength: 25,
                hideEmptyDays: false,
                wrapEvents: false,
                tableClass: "small",
                displaySymbol: true,
                displayLocation: false,
                displayDescription: false,
                colored: false,
                coloredSymbolOnly: false,
                calendars: [{
                        url: "webcal://www.ics.calendarlabs.com/71/1e07bb0c/Sweden_Holidays.ics",
                        symbol: "calendar",
                        color: "#ff8e99"
                    },
                    {
                        url: "https://calendar.google.com/calendar/ical/mans.hurtigh%40gmail.com/private-70ade1360dbfcf7f9b347c3d3096c481/basic.ics",
                        symbol: "user-tie",
                        color: "#bcddff"
                    }
                ]
            }
        }
    ]
};

/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {
    module.exports = config;
}
Bee-Mar commented 10 months ago

@stagenethome Interesting. I'll just go ahead and remove the special extension. That was intended to provide further distinction between the standard modules and the custom one, but removing the extension shouldn't cause issues. The next update (aiming for this weekend) will have this corrected.

stagenethome commented 10 months ago

@Bee-Mar Thank you! Cheers! :)

Bee-Mar commented 10 months ago

@stagenethome version 4.1.0 has been released, and addresses the issue. Please let me know if you have any other problems

stagenethome commented 10 months ago

@Bee-Mar Thanks! Just waiting for @khassel to update the mmpm docker image.

khassel commented 10 months ago

waiting for @khassel to update the mmpm docker image.

done

stagenethome commented 10 months ago

@khassel Thanks! Just updated.

@Bee-Mar After uninstalling, removing, and adding the custom packages again, it works as intended. Thank you!

Bee-Mar commented 10 months ago

@stagenethome great! And thanks @khassel !