Skip to content

Commit

Permalink
refactor: enable es module interop for TypeScript (#1008)
Browse files Browse the repository at this point in the history
  • Loading branch information
lautarodragan authored Dec 19, 2019
1 parent f8dc4c1 commit 520400c
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/Frost.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getVerifiableClaimSigner } from '@po.et/poet-js'
import { MongoClient } from 'mongodb'
import * as Pino from 'pino'
import Pino from 'pino'

import { RestServer } from './api/RestServer'
import { Router } from './api/Router'
Expand Down
10 changes: 5 additions & 5 deletions src/api/RestServer.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as Koa from 'koa'
import * as bodyParser from 'koa-bodyparser'
import * as helmet from 'koa-helmet'
import * as KoaRouter from 'koa-router'
import * as cors from 'koa2-cors'
import Koa from 'koa'
import bodyParser from 'koa-bodyparser'
import helmet from 'koa-helmet'
import KoaRouter from 'koa-router'
import cors from 'koa2-cors'

import { securityHeaders } from '../securityHeaders'
import { createModuleLogger, LoggingConfiguration } from '../utils/Logging/Logging'
Expand Down
2 changes: 1 addition & 1 deletion src/api/Router.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as KoaRouter from 'koa-router'
import KoaRouter from 'koa-router'

import { AccountController } from '../controllers/AccountController'
import { ArchiveController } from '../controllers/ArchiveController'
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/AccountController.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createIssuerFromPrivateKey, generateED25519Base58Keys } from '@po.et/poet-js'
import { sign, verify } from 'jsonwebtoken'
import * as Pino from 'pino'
import Pino from 'pino'

import { Token, TokenOptions } from '../api/Tokens'
import { getApiKeyByNetwork, getTokenByNetwork } from '../api/tokens/CreateToken'
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/ArchiveController.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as Pino from 'pino'
import Pino from 'pino'

import { PoetNode } from '../daos/PoetNodeDao'
import { FileTooBig, PoeAddressNotVerified, PoeBalanceInsufficient } from '../errors/errors'
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/WorkController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
SignedVerifiableClaim,
VerifiableClaimSigner,
} from '@po.et/poet-js'
import * as Pino from 'pino'
import Pino from 'pino'
import { pipeP } from 'ramda'

import { PoetNode, WorkSearchFilters } from '../daos/PoetNodeDao'
Expand Down
2 changes: 1 addition & 1 deletion src/daos/PoetNodeDao.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SignedVerifiableClaim } from '@po.et/poet-js'
import * as FormData from 'form-data'
import FormData from 'form-data'
import fetch from 'node-fetch'

import { WorkNotFound } from '../errors/errors'
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/Erc20.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Web3 = require('web3')

import * as Erc20Abi from './Erc20Abi.json'
import Erc20Abi from './Erc20Abi.json'

interface Arguments {
readonly ethereumUrl: string
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/uuid.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as uuidv4 from 'uuid/v4'
import uuidv4 from 'uuid/v4'

export const uuid4 = () => {
const id = Buffer.alloc(16)
Expand Down
2 changes: 1 addition & 1 deletion src/initVault.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { readFile as readFileCallback, writeFileSync, mkdirSync } from 'fs'
import { homedir } from 'os'
import * as path from 'path'
import * as Pino from 'pino'
import Pino from 'pino'
import { promisify } from 'util'

import { Configuration } from './configuration'
Expand Down
2 changes: 1 addition & 1 deletion src/middlewares/logger.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as Pino from 'pino'
import Pino from 'pino'

export const logger = (logger: (dirname: string) => Pino.Logger) => async (
context: any,
Expand Down
2 changes: 1 addition & 1 deletion src/middlewares/monitor.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as Koa from 'koa'
import Koa from 'koa'
const { map, lensPath, ifElse, compose, view, set, identity } = require('ramda')

export const omitSecretsInUrl = (secrets: ReadonlyArray<string> = [], url: string = '') => {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/Logging/Logging.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EventEmitter } from 'events'
import * as Pino from 'pino'
import Pino from 'pino'
import { describe } from 'riteway'
import { spy } from 'sinon'
import {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/Logging/Logging.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { basename } from 'path'
import * as Pino from 'pino'
import Pino from 'pino'

export interface LoggingConfiguration {
readonly loggingLevel: string
Expand Down
2 changes: 1 addition & 1 deletion src/utils/Vault/Vault.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as VaultLib from 'node-vault'
import VaultLib from 'node-vault'
import { Options } from './Options'

export namespace Vault {
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./src",
"esModuleInterop": true,
"paths": {
"test/*" : ["../test/*"],
"expect": ["../test/utils/expect"]
Expand Down

0 comments on commit 520400c

Please sign in to comment.