Giter VIP home page Giter VIP logo

magicmirror-module-template's Introduction

MagicMirror-Module-Template

This is a module to help developers to start building their own modules for the MagicMirror.

There samples of code for:

  • External request
  • Config parameters
  • Custom URL path route
  • Passing of messages (NOTIFICATIONS)

Also this module include tasks for checking your code. For that you need install the developer dependencies.

cd MI_MODULE_PATH && npm install 

Run the test npm script

npm test

Current Tests:

Installation

bash -c "$(curl -sL https://raw.githubusercontent.com/roramirez/MagicMirror-Module-Template/master/create_module.sh)"

This creates a module example to start your development more easy.

If you have any suggest, please let me know by an issue.

magicmirror-module-template's People

Contributors

blindman avatar jopyth avatar morozgrafix avatar ralberth avatar roramirez avatar svensommer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

magicmirror-module-template's Issues

Testing module does not work

After creating a new module with the script, running npm install && npm test in the new module directory does not result in tests being executed.

How exactly do I have to perform the npm test? What are the requirements?

Missing files in project

These files are missing when running grunt, they probably need to be copied over from the reference repo

.eslintrc.json
.stylelintrc

add support for automatic code reformat

add files to root:

.editorconfig

# http://editorconfig.org

root = true

[*]
charset = utf-8
indent_style = tab
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
insert_final_newline = false
trim_trailing_whitespace = false

.prettierrc.json

{
    "tabWidth": 4,
    "printWidth": 250,
    "useTabs": true,
    "singleQuote": false,
    "bracketSpacing": true,
    "trailingComma": "es5",
    "semi": false
}

npm i -D prettier

Keeps showing “ loading”

When I had first downloaded the MM software everything was fine except the underneath the US Holidays calendar it would just say “no upcoming” events instead of showing the us Holidays. The I tried syncing it to my google calendar by putting my iCal public address and now it just shows “loading” underneath. Please help me fix this problem.

Remove grunt

Since MagicMirror no longer uses grunt 1, would it not make sense to do the same? With npm install even an error message appears that calls for this:

npm WARN deprecated [email protected]: Deprecated because Grunt is practically unmaintained. Move on to something better.

Undefined rule font-family-no-missing-generic-family-keyword

Hi, following the template installations instruction I'm attempting to create my own MM-module. I encounter test errors as shown below though:

pi@raspberrypi:~/MagicMirror/modules/MMM-Trains-Trafikverket $ npm test

> [email protected] test /home/pi/MagicMirror/modules/MMM-Trains-Trafikverket
> ./node_modules/grunt/bin/grunt

Running "eslint:target" (eslint) task

Running "stylelint:simple" (stylelint) task
Warning: Running stylelint failed
Error: Undefined rule font-family-no-missing-generic-family-keyword                          
  at module.exports (/home/pi/MagicMirror/modules/MMM-Trains-Trafikverket/node_modules/stylelint/lib/utils/configurationError.js:8:27)                                                    
  at Object.keys.forEach.ruleName (/home/pi/MagicMirror/modules/MMM-Trains-Trafikverket/node_modules/stylelint/lib/augmentConfig.js:279:13)                                               
  at Array.forEach (<anonymous>:null:null)                                                   
  at normalizeAllRuleSettings (/home/pi/MagicMirror/modules/MMM-Trains-Trafikverket/node_modules/stylelint/lib/augmentConfig.js:275:29)                                                   
  at augmentConfigBasic.then.then.then.then.augmentedConfig (/home/pi/MagicMirror/modules/MMM-Trains-Trafikverket/node_modules/stylelint/lib/augmentConfig.js:84:12)                      
  at <anonymous>:null:null                                                                   
 Use --force to continue.                                                                    

Aborted due to warnings.


Execution Time (2018-03-16 16:48:34 UTC+1)
loading tasks     1.2s  ââââââââââââ 20%
eslint:target     1.7s  ââââââââââââââââ 27%
stylelint:simple  3.3s  âââââââââââââââââââââââââââââââ 53%
Total 6.2s

npm ERR! Test failed.  See above for more details.
pi@raspberrypi:~/MagicMirror/modules/MMM-Trains-Trafikverket $

I use node v9.8.0 and npm 5.6.0

Any workarounds or solutions to get past this?

make template repository

There is a setting to make a repository a template repository.

Bildschirmfoto 2022-01-12 um 08 13 51

This gives an easy to use "use this template" button at the top.

Bildschirmfoto 2022-01-12 um 08 31 31

Does not work on Mac

There's a problem running the create_module.sh script on Mac.

This seem to be due to version missmatch of SED. When running the same command in an Ubuntu Docker container it works fine.

$ bash -c "$(curl -sL https://raw.githubusercontent.com/roramirez/MagicMirror-Module-Template/master/create_module.sh)"
MagicMirror installation not found.
Please input its path now (or restart script in its directory): /path
Insert your module name: MyModule
Do you want create in /path/module/MyModule (y/N) y
Pickup a license
  1. MIT (Default)
  2. ISC
Choice: 1
Type a short description of what your module does (leave empty to insert a Todo)
: Todo
Cloning into '/var/folders/s9/tkvlqcy57w37x46r69d2x9b40000gn/T/tmp.jUQrYWPk'...
remote: Counting objects: 160, done.
remote: Total 160 (delta 0), reused 0 (delta 0), pack-reused 160
Receiving objects: 100% (160/160), 22.42 KiB | 0 bytes/s, done.
Resolving deltas: 100% (82/82), done.
Checking connectivity... done.
sed: 1: "/path/module/MyModule ...": invalid command code m
sed: 1: "/path/module/MyModule ...": invalid command code m
sed: 1: "/path/module/MyModule ...": invalid command code m
sed: 1: "/path/module/MyModule ...": invalid command code m
sed: 1: "/path/module/MyModule ...": invalid command code m
Initialized empty Git repository in /path/module/MyModule/.git/

Running this manually shows me there's an error in CHANGELOG.md but that makes no sense at all.

sed -i s/\{\{MODULE_NAME\}\}/MyModule/g module/MyModule/*.*
sed: 1: "CHANGELOG.md": invalid command code C

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.