Update TypeScript README

pull/2054/head
qucchia 2022-07-20 16:23:38 +02:00
parent 51ac93a0ce
commit cbd6e7d7f8
2 changed files with 13 additions and 12 deletions

View File

@ -1,13 +1,7 @@
# BangleTS
# Bangle.ts
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`.
The typing is an ongoing process. If anything is still missing, you can add it! It will automatically be available in your TS files.
A generic project setup for compiling apps from Typescript to Bangle.js ready, readable JavaScript.
The types are now automatically generated by the `generate.js` script, although they are not completely correct yet.
## Compilation
@ -26,4 +20,10 @@ 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.
To build all Typescript apps and widgets. The last command will generate the `app.js` files containing the transpiled code for the Bangle.js.
```
npm run gen
```
Finally, run the command above to automatically generate the types for Bangle.ts.

View File

@ -1,14 +1,15 @@
{
"name": "Bangle.ts",
"description": "Bangle.js Typescript Project Setup and Types",
"author": "Sebastian Di Luzio <sebastian@diluz.io> (https://diluz.io)",
"author": "Sebastian Di Luzio <sebastian@diluz.io> (https://diluz.io) and qucchia <qucchia0@gmail.com> (https://github.com/qucchia)",
"version": "0.0.1",
"devDependencies": {
"typescript": "4.5.2"
},
"scripts": {
"build": "tsc",
"build:types": "tsc ./types/main.d.ts"
"build:types": "tsc ./types/main.d.ts",
"gen": "node ./generate.js"
},
"dependencies": {
"node-fetch": "^3.2.9"