make tsconfig work for all ts apps

pull/1052/head
Sebastian Di Luzio 2021-12-10 21:51:35 +01:00
parent 15d24ac1b3
commit 96b099b10a
5 changed files with 19 additions and 12 deletions

View File

@ -16,7 +16,12 @@ jobs:
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
- name: npm i - name: npm ci
run: npm i working-directory: ./typescript
run: npm ci
- name: build types - name: build types
working-directory: ./typescript
run: npm run build:types
- name: build all TS apps
working-directory: ./typescript
run: npm run build:types run: npm run build:types

View File

@ -4763,7 +4763,7 @@
"tags": "widget", "tags": "widget",
"supports": ["BANGLEJS","BANGLEJS2"], "supports": ["BANGLEJS","BANGLEJS2"],
"storage": [ "storage": [
{"name":"widChargingStatus.wid.js","url":"./dist/widget.js"} {"name":"widChargingStatus.wid.js","url":"./widget.js"}
] ]
}, },
{ {

View File

@ -1,22 +1,23 @@
(function () { "use strict";
var icon = require('heatshrink').decompress(atob('ikggMAiEAgYIBmEAg4EB+EAh0AgPggEeCAIEBnwQBAgP+gEP//x///j//8f//k///H//4BYOP/4lBv4bDvwEB4EAvAEBwEAuA7DCAI7BgAQBhEAA')); (() => {
var iconWidth = 18; const icon = require('heatshrink').decompress(atob('ikggMAiEAgYIBmEAg4EB+EAh0AgPggEeCAIEBnwQBAgP+gEP//x///j//8f//k///H//4BYOP/4lBv4bDvwEB4EAvAEBwEAuA7DCAI7BgAQBhEAA'));
const iconWidth = 18;
function draw() { function draw() {
g.reset(); g.reset();
if (Bangle.isCharging()) { if (Bangle.isCharging()) {
g.setColor('#FD0'); g.setColor('#FD0');
g.drawImage(icon, this.x + 1, this.y + 1, { g.drawImage(icon, this.x + 1, this.y + 1, {
scale: 0.6875 scale: 0.6875,
}); });
} }
} }
WIDGETS.chargingStatus = { WIDGETS.chargingStatus = {
area: 'tr', area: 'tr',
width: Bangle.isCharging() ? iconWidth : 0, width: Bangle.isCharging() ? iconWidth : 0,
draw: draw draw,
}; };
Bangle.on('charging', function (charging) { Bangle.on('charging', (charging) => {
var widget = WIDGETS.chargingStatus; const widget = WIDGETS.chargingStatus;
if (widget) { if (widget) {
if (charging) { if (charging) {
Bangle.buzz(); Bangle.buzz();

View File

@ -7,7 +7,7 @@
"typescript": "4.5.2" "typescript": "4.5.2"
}, },
"scripts": { "scripts": {
"build:example": "tsc ../apps/widChargingStatus/widget.ts --outDir ../apps/widChargingStatus/dist", "build:apps": "tsc",
"build:types": "tsc ./types/globals.d.ts" "build:types": "tsc ./types/globals.d.ts"
} }
} }

View File

@ -13,5 +13,6 @@
"noUnusedParameters": true, "noUnusedParameters": true,
"strict": true "strict": true
}, },
"include": ["../apps/**/*", "./**/*"] "include": ["../apps/**/*", "./**/*"],
"exclude": ["../apps/banglerun", "../apps/hebrew_calendar"]
} }