Skip to content

Commit

Permalink
[AMSA-60] Update typescript and fix errors from console (#111)
Browse files Browse the repository at this point in the history
* [AMSA-60] Update typescript and fix errors from console

* [AMSA-60] Update package-lock

* [AMSA-60] bump v0.1.44
  • Loading branch information
maksimroi authored Oct 6, 2023
1 parent ff0c0aa commit ff813c6
Show file tree
Hide file tree
Showing 10 changed files with 630 additions and 394 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class EnableReportingTabJob implements IJob {


async run () {
return new Promise(resolve => {
return new Promise<void>(resolve => {
if (this.isDone) {
resolve();
}
Expand Down
2 changes: 1 addition & 1 deletion chrome-extension/common/localstorage.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const extLocalStorage = {
async set (value) {
return new Promise(resolve => chrome.storage.local.set(value, resolve));
return new Promise<void>(resolve => chrome.storage.local.set(value, resolve));
},
async get (value) {
return new Promise(resolve => chrome.storage.local.get(value, resolve));
Expand Down
992 changes: 610 additions & 382 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"repository": "https://github.com/appodeal/admob-sync-app",
"description": "Appodeal AdMob Sync application",
"private": true,
"version": "0.1.43",
"version": "0.1.44",
"scripts": {
"start": "npm run start:app",
"start:app": "node --max_old_space_size=4096 node_modules/.bin/webpack --watch --progress --config=webpack/development.ts",
Expand Down Expand Up @@ -146,9 +146,9 @@
"sass-loader": "^10.4.1",
"script-ext-html-webpack-plugin": "^2.1.3",
"ts-jest": "^24.0.0",
"ts-loader": "^5.3.3",
"ts-node": "^8.0.2",
"typescript": "^3.3.3",
"ts-loader": "^8.4.0",
"ts-node": "10.8.1",
"typescript": "^4.7.4",
"webpack": "^4.39.2",
"webpack-cli": "^3.2.3",
"webpack-dev-server": "^3.2.0",
Expand All @@ -168,10 +168,12 @@
"electron": "^13.3.0",
"electron-platform": "^1.2.0",
"escape-string-regexp": "^2.0.0",
"fast-safe-stringify": "^2.1.1",
"fs-extra": "^7.0.1",
"graphql": "^14.1.1",
"graphql-tag": "^2.10.1",
"json-stable-stringify": "^1.0.1",
"json-stringify-safe": "^5.0.1",
"jwt-decode": "^2.2.0",
"lodash.trim": "^4.5.1",
"mobx": "^5.9.0",
Expand Down
2 changes: 1 addition & 1 deletion src/core/sync-apps/sync.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class SyncService {


public async runSync (appodealAccountId: string, admobAccount: AdMobAccount, runner: SyncRunner) {
return new Promise(async (resolve, reject) => {
return new Promise<void>(async (resolve, reject) => {
if (this.onlineService.isOffline()) {
console.log('[Sync Service] Can not run sync. No Internet Connection');
return reject(new Error('Can not run sync. No Internet Connection'));
Expand Down
2 changes: 1 addition & 1 deletion src/lib/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export class Debug {
}

wait (time: number) {
return new Promise(resolve => setTimeout(() => resolve(), time));
return new Promise<void>(resolve => setTimeout(() => resolve(), time));
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/lib/sync-logs/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import * as winston from 'winston';
import {Logger} from 'winston';


// @ts-ignore
export interface LoggerInstance extends Logger {
/**
* @deprecated use closeAsync instead
Expand Down
4 changes: 2 additions & 2 deletions src/lib/task-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class TaskRunner extends EventEmitter {
}

break () {
return new Promise(resolve => {
return new Promise<void>(resolve => {
if (this.state === TaskRunnerState.running) {
this.once('cancel', () => resolve());
} else {
Expand Down Expand Up @@ -92,7 +92,7 @@ export class TaskRunner extends EventEmitter {
}

private exec () {
return new Promise(async (resolve, reject) => {
return new Promise<void>(async (resolve, reject) => {

const runNext = () => {
if (this.state === TaskRunnerState.cancelled) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/tray-icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class TrayIcon {

listenStatusChanges () {
this.sub = observe(this.store.state, (change) => {
if (['account', 'history', 'syncProgress', 'selectedAppodealAccount'].includes(change.name)) {
if (['account', 'history', 'syncProgress', 'selectedAppodealAccount'].includes(<string>change.name)) {
this.checkIcon();
}
});
Expand Down
7 changes: 6 additions & 1 deletion webpack/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ export const entriesConfig = entries.map(
devtool: 'source-map',
module: {
rules: [
{
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto'
},
{
test: /\.ts|\.tsx$/,
use: ['ts-loader']
Expand Down Expand Up @@ -105,7 +110,7 @@ export const entriesConfig = entries.map(
]
},
resolve: {
extensions: ['.tsx', '.json', '.ts', '.js', '.svg'],
extensions: ['.tsx', '.json', '.ts', '.js', '.svg', '.mjs', '.gql', '.graphql'],
modules: [
'node_modules',
'@typings',
Expand Down

0 comments on commit ff813c6

Please sign in to comment.