Today we have released a major update to the SDK tools to create, build and release Homey apps.
Many developers already have been using the Homey Compose plugin to ease the development of Homey apps. This plugin allows dissecting very large app.json files into smaller more specific files such as driver.json or flow.json. Homey Compose will merge all those files into the final app.json.
Previously, running homey app create didn't enable the plugin by default, which has changed in the just released Homey CLI. Just run the usual command homey app create to get started and it will automatically ask you to enable Homey Compose.
Should you already have an app that is not using the compose plugin, don't worry! We've created a migrate function to enable the compose plugin for any existing Homey app. This will scan your app folder and split your data structure found in app.json in to separate files. All separated files will be placed in a .homeycompose folder in the root of your app's folder. Drivers will be placed in the folder of the driver they belong to, e.g. /drivers/my_driver/driver.compose.json.
You can migrate your app to enable compose by running homey app compose. Read more about the compose plugin in the documentation: https://apps.developer.athom.com/tutorial-Homey%20Compose.html
Discovery & Flow Cards
To make Homey app development even easier, the Homey CLI will now guide you through setting up a new Driver (homey app driver create), a Flow Card (homey app flow create), a Discovery Strategy (homey app discovery create). In most cases you won't need to touch those JSON files anymore.
Localised strings will now be asked for interactively.
You'll always be asked for the English language first, because it's required. Additional languages can then be entered easily.
You are probably using Git for your Homey app. When running homey app publish, a Git tag with the new version number will automatically be created. That makes it easy to keep track which version runs which code.
Before the new Homey App Store, developers needed to commit their node_modules folder to Git. Because Homey apps now can be published from the CLI, this requirement has been removed.
Even better, Homey CLI now automatically removes any non-production Node.js Modules when running or publishing your app. This makes development faster, and the footprint of your app smaller. Note that you need to have a package.json file for this to work.
Automatic code completion
All new Homey apps created using homey app create are linked with the homey module on npm. This adds code completion in any supporting IDE.
You can add this functionality to your existing apps by running npm i --save-dev homey.
You might've noticed that the App Certification process has become more extensive since the new Homey App Store. We are working towards a future where Homey works without any bugs, and Homey Apps have a crucial role.
In an effort to make it easier for you to create great apps, we have published the App Development Guidelines.
It provides you with important guidelines regarding creating drivers, choosing capabilities, publishing and updating apps, and more. These guidelines are a living document which we’d like to keep up-to-date as much as possible in collaboration with our developer community.
Get Started Now
To use the new Homey CLI functionality, you can install the latest release of the Homey package by running npm i -g homey.
Should you experience any problems, please don't hesitate to let us know in the Homey Apps SDK Issue Tracker.