Introduction

Clockwork

The open-source CLI and package manager for Watch Face Format projects

About

Clockwork is like npm install + npm build for Watch Face Format projects. It manages all your dependencies and building your watch face, reducing the painful parts of building watch faces using Watch Face Format.

Features

Overview

Let’s take a look at what Clockwork can do. We’ll start by creating a clockwork.yaml and downloading a few packages:

$ clockwork init
$ clockwork install example-ui-pkg
$ clockwork install xml-preprocessor

Here’s the watch face component we’ll be using:

watchface-pp.xml
<WatchFace>
    <Scene>
        <Group width="450" height="200" x="-50" y="170" name="TextGroup">
            <Import href="packages/example-ui-pkg/text.xml" />
        </Group>
    </Scene>
</WatchFace>

Our watch face file and packges are setup, now we can now build our watch face:

$ clockwork build
Clockwork CLI - the open-source package manager for Watch Face Format - v1.1.5-alpha.3
 No updates available.
 Preprocessing...
 Validating...
🛠️ Building...
BUILD SUCCESSFUL in 1s
31 actionable tasks: 1 executed, 30 up-to-date
 Installation successful.

If XML Preprocessor is installed, it will process the <Import /> and compile the contents of packages/example-ui-pkg/text.xml into the raw watchface.xml which will be built.

Now it’s installed on our device and the sample component has been successfully imported. Here’s a screenshot of the watch face: