MyTommy.com

Using the SDK

The SDK contains a number of tools for the purpose of building Tommy Mini Programs.

Using the Emulator

The core of the SDK is an emulator which emulates the Tommy app environment on your local machine. This lets you develop mini programs for Tommy that will integrate seamlessly with the live app when you package and release them.

Following the installation steps you will see the emulator, which is the main SDK interface, loaded in your browser.

The emulator lets you preview mini programs that you are building in real-time. The source code for mini programs is located in the /addons folder. The demo mini programs that are provided with the SDK are a great starting point, and should be used as a reference for building your own mini programs.

The main emulator view contains two sections:

A list of all mini programs loaded from the /addons folder.

A list of all the mini program views that can be opened. If you click on any view you will be able to see that view emulated inside the browser. If you modify any of the code from the relative mini program, then that view will be automatically reloaded and you can see your changes in your browser in real time.

The SDK itself is very straight forward to use, so when you’re ready let’s move on to an explanation of the addon file structure and manifest files.

Dynamic Features

Tommy SDK has some dynamic features that you will want to leverage in order to speed up your development flow:

Whenever you edit any code the current view will be reloaded. You can configure the default view to be autoloaded via the Settings page of the interface.

Javascripts located at config.json views/javascripts/**/.js will be auto compiled into views/builds/bundle.js in real-time. ES6 code is fully supported. See the Tasks mini program source for an example.

SASS stylesheets located at views/stylesheets/**/.scss will be auto compiled into views/build/bundle.css in real-time. Only SASS is supported at this time. See the Tasks mini program source for an example.

Template7 templates located at views/templates/**/.tpl.html will be auto compiled into views/build/bundle.tpl.html in real-time. See the Tasks mini program source for an example.