pkts
v0.3.0-beta.1
Published
Typescript tools for Pebble
Readme
PebbleKit.ts
A modern Pebble app boilerplate using TypeScript.
This project adds a JS build step similar to what you would find in a modern web project, but with a focus on targeting the PebbleKit JS engine. Meaning you can use modern JS/TS features without worrying about compatability.
Also provided are modern wrappers around PKJS functions, available under the PebbleTS namespace.
How to use
- Run
npx pkts initin your Pebble project - Install dependencies
npm install - Build your app like normal,
pebble buildwill compile your TypeScript and your Pebble app
CLI commands
pkts init- Configures your Pebble project to use PKTSpkts doctor- Checks for configuration issues preventing PKTS from working correctlypkts doctor --fix- Automatically fixes any found issuespkts build- Compiles TS -> JS, ready for Pebble SDK to bundle into your app
Available types
readyandappmessageeventssendAppMessagegetTimelineTokenshowSimpleNotficationOnPebble
Tested JS/TS features
- async/await
- Promises
- String templates
- Arrow functions
- Array/object spreading
Showcase
- PebbleRail
- Tube Status by Chris Lewis
- Plurble by Nikki
Contributing
The PKJS type definitions only cover a subset of the APIs available in PebbleKit JS.
If you are using this in your own project and find yourself expanding the definitions, please contribute your changes back to this project so the community can benefit!
