diff --git a/packages/embark-api-client/package.json b/packages/embark-api-client/package.json index 172ef2472..1ca18737c 100644 --- a/packages/embark-api-client/package.json +++ b/packages/embark-api-client/package.json @@ -31,13 +31,13 @@ "clean": "npm run reset", "lint": "npm-run-all lint:*", "lint:js": "eslint src/", - "lint:ts": "tslint -c tslint.json \"src/**/*.ts\"", + "// lint:ts": "tslint -c tslint.json \"src/**/*.ts\"", "package": "npm pack", "// qa": "npm-run-all lint typecheck build package", "qa": "npm-run-all lint build package", "reset": "npx rimraf dist embark-*.tgz package", "start": "npm run watch", - "typecheck": "tsc", + "// typecheck": "tsc", "watch": "run-p watch:*", "watch:build": "npm run build -- --verbose --watch", "// watch:typecheck": "npm run typecheck -- --preserveWatchOutput --watch" diff --git a/packages/embark-utils/src/index.js b/packages/embark-utils/src/index.js index 29253b647..f509ec98b 100644 --- a/packages/embark-utils/src/index.js +++ b/packages/embark-utils/src/index.js @@ -2,6 +2,7 @@ const http = require('follow-redirects').http; const https = require('follow-redirects').https; const {canonicalHost, defaultCorsHost, defaultHost, dockerHostSwap, isDocker} = require('./host'); +const {findNextPort} = require('./network'); function checkIsAvailable(url, callback) { const protocol = url.split(':')[0]; @@ -24,7 +25,8 @@ const Utils = { defaultHost, dockerHostSwap, isDocker, - checkIsAvailable + checkIsAvailable, + findNextPort }; module.exports = Utils; diff --git a/packages/embark/src/lib/utils/network.ts b/packages/embark-utils/src/network.ts similarity index 100% rename from packages/embark/src/lib/utils/network.ts rename to packages/embark-utils/src/network.ts diff --git a/packages/embark/src/lib/modules/api/index.ts b/packages/embark/src/lib/modules/api/index.ts index 53a3cafbd..6d0da2faf 100644 --- a/packages/embark/src/lib/modules/api/index.ts +++ b/packages/embark/src/lib/modules/api/index.ts @@ -1,9 +1,8 @@ import {Embark} from "embark"; +import {checkIsAvailable, dockerHostSwap, findNextPort} from "embark-utils"; import {__} from "i18n"; -import {findNextPort} from "../../utils/network"; -import Server from "./server"; -import {dockerHostSwap, checkIsAvailable} from "embark-utils"; +import Server from "./server"; const DEFAULT_PORT = 55555; const DEFAULT_HOSTNAME = "localhost"; @@ -15,7 +14,7 @@ export default class Api { constructor(private embark: Embark, private options: any) { this.embark.events.emit("status", __("Starting API & Cockpit UI")); - findNextPort(DEFAULT_PORT).then((port) => { + findNextPort(DEFAULT_PORT).then((port: any) => { this.port = port; this.apiUrl = `http://${DEFAULT_HOSTNAME}:${this.port}`; diff --git a/packages/embark/src/lib/modules/webserver/index.js b/packages/embark/src/lib/modules/webserver/index.js index a430d4922..af30ccc83 100644 --- a/packages/embark/src/lib/modules/webserver/index.js +++ b/packages/embark/src/lib/modules/webserver/index.js @@ -1,6 +1,4 @@ -import {findNextPort} from "../../utils/network"; - -import {joinPath, canonicalHost, checkIsAvailable} from 'embark-utils'; +import {joinPath, canonicalHost, checkIsAvailable, findNextPort} from 'embark-utils'; var Server = require('./server.js'); const opn = require('opn');