Navigation

    MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    Add further npm dependencies to basic MM installation

    Feature Requests
    3
    4
    712
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • lavolp3
      lavolp3 Module Developer last edited by lavolp3

      Hi all,
      this goes esp. to @MichMich but of course like to discuss with all @Module-Developers

      If I understand correctly, for npm dependencies to be used by module fiels there are basically two options

      • use what is in the MagicMirror/vendor (like moment.js) folder
      • have it installed via npm install in a node_modules folder of the module and set a link in the module file.

      Now there are some npm dependencies that are used in more than one 3rd party module.
      E.g.

      • I am using chart.js in three different modules a.t.m.
      • I have seen google-translate-api being used several times.

      Can’t we include these to the general MM installation and have them present only once and net in every in every module’s subfolder?
      I understand that we might not want to blow up the basic MM installation but I also think there are some trends for usage of certain npm modules.

      Sean 1 Reply Last reply Reply Quote 0
      • Sean
        Sean Module Developer @lavolp3 last edited by Sean

        @lavolp3
        I want to recommend ‘iconify’ instead font-awesome, it include fa and more than that nonetheless its not related with npm.
        https://iconify.design

        1 Reply Last reply Reply Quote 0
        • MichMich
          MichMich Admin last edited by

          The problem is I don’t want to bloat the basic installation. (Looking back I prefer to not have any additional vendors at all).

          And how would we select which dependencies we include in MM and which dependencies we don’t?

          What would be a great feature, is to allow a module to specify the rpm modules it requires and let MM install them on startup if they are not currently available. 🙂

          lavolp3 1 Reply Last reply Reply Quote 1
          • lavolp3
            lavolp3 Module Developer @MichMich last edited by

            @michmich said in Add further npm dependencies to basic MM installation:

            And how would we select which dependencies we include in MM and which dependencies we don’t?

            Well that is obviously a case-by-case decision and therefore a bit tricky, I admit.
            But from these two I’m sure they are valuable to the MM environment.

            • A Google translation API (which tbh needs to be chosen carefully because one on npm is currently not working unfortunately)

            • A Charting tool.

            So why not use them? It’s “only” a few JS files.
            However, it’s your decision and I fully respect your point.

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            Enjoying MagicMirror? Please consider a donation!
            MagicMirror created by Michael Teeuw.
            Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
            This forum is using NodeBB as its core | Contributors
            Contact | Privacy Policy