@washichi Interesting idea for the module. And glancing at your code you seem to be on the right track.
I may be not understanding what you trying Sublime Text to do. It’s just a text editor with ability to add various packages on top of it. It’s not a full blown IDE. I don’t believe that you can compile or preview the JavaScript module directly in Sublime.
My general workflow for module creation is something like this:
Create MMM-mymodule directory inside MagicMirror/modules
Open MagicMirror directory in sublime
Add barebones config for the module to modules array in config.js, for example:
{
module: "MMM-mymodule",
position: "bottom_right",
config : {
}
},
Start node serveronly and point my Chrome with dev tools open to the http://localhost:8080
Create/edit MagicMirror/modules/MMM-mymodule/MMM-mymodule.js, save it. (or other files that you need for the module)
Refresh the browser to pickup my changes, debug etc.
Repeat steps 5-6 as I go along. If adding/editing node_helper.js repeat steps 4-6 since node needs to pickup that file.
Some of restarts/refreshes can be automated on file save with different tools, but I’m not going to get into that right now.