BangleApps/typescript
Felix Wiedenbach 267f043dfe documents all four possible widget areas 2022-06-16 10:28:25 +02:00
..
types documents all four possible widget areas 2022-06-16 10:28:25 +02:00
.gitignore move package back within typescript 2021-12-10 20:52:17 +01:00
README.md rename build step to be less confusing for widgets 2022-01-20 21:09:57 +01:00
package-lock.json fix global vars inside IDE (only cli to go) 2021-12-10 21:19:01 +01:00
package.json rename build step to be less confusing for widgets 2022-01-20 21:09:57 +01:00
tsconfig.json adjust module target version during build 2022-01-20 21:23:17 +01:00

README.md

BangleTS

A generic project setup for compiling apps from Typescript to Bangle.js ready, readable Javascript. It includes types for some of the modules and globals that are exposed for apps to use. The goal is to have types for everything, but that will take some time. Feel free to help out by contributing!

Using the types

All currently typed modules can be found in /typescript/types.globals.d.ts. The typing is an ongoing process. If anything is still missing, you can add it! It will automatically be available in your TS files.

Compilation

Install npm and node.js if you haven't already. We recommend using a version manager like nvm, which is also referenced in the linked documentation. Make sure you are using node version 16 by running nvm use 16 and npm version ^8 by running npm -v. If the latter version is incorrect, run npm i -g npm@^8.

After having installed npm for your platform, open a terminal, and navigate into the /typescript folder. Then run:

npm ci

to install the project's build tools, and:

npm run build

To build all Typescript apps and widgets. The last command will generate the app.js files containing the transpiled code for the BangleJS.