From 93568ad91101bca169adc1cbb9b08a1908ca3ed6 Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Mon, 29 Apr 2019 16:26:20 +0200 Subject: [PATCH] refactor(@embark/utils): move unitRegex into utils package --- .../utils/regexConstants.ts => embark-utils/src/constants.ts} | 0 packages/embark-utils/src/index.js | 2 ++ packages/embark/src/lib/core/config.js | 3 +-- packages/embark/src/lib/utils/contractsConfig.ts | 3 +-- 4 files changed, 4 insertions(+), 4 deletions(-) rename packages/{embark/src/lib/utils/regexConstants.ts => embark-utils/src/constants.ts} (100%) diff --git a/packages/embark/src/lib/utils/regexConstants.ts b/packages/embark-utils/src/constants.ts similarity index 100% rename from packages/embark/src/lib/utils/regexConstants.ts rename to packages/embark-utils/src/constants.ts diff --git a/packages/embark-utils/src/index.js b/packages/embark-utils/src/index.js index c12d3b40c..1228e1abd 100644 --- a/packages/embark-utils/src/index.js +++ b/packages/embark-utils/src/index.js @@ -7,6 +7,7 @@ const {canonicalHost, defaultCorsHost, defaultHost, dockerHostSwap, isDocker} = const {findNextPort} = require('./network'); const logUtils = require('./log-utils'); const toposortGraph = require('./toposort'); +import { unitRegex } from './constants'; import { last, recursiveMerge } from './collections'; @@ -145,6 +146,7 @@ const Utils = { recursiveMerge, sha512, timer, + unitRegex, runCmd, escapeHtml: logUtils.escapeHtml, normalizeInput: logUtils.normalizeInput, diff --git a/packages/embark/src/lib/core/config.js b/packages/embark/src/lib/core/config.js index 111075207..5a37a1d6e 100644 --- a/packages/embark/src/lib/core/config.js +++ b/packages/embark/src/lib/core/config.js @@ -5,10 +5,9 @@ const path = require('path'); const deepEqual = require('deep-equal'); const web3 = require('web3'); const constants = require('embark-core/constants'); -import {canonicalHost, defaultHost, recursiveMerge, AddressUtils} from 'embark-utils'; +import {canonicalHost, defaultHost, recursiveMerge, AddressUtils, unitRegex} from 'embark-utils'; const cloneDeep = require('lodash.clonedeep'); const { replaceZeroAddressShorthand } = AddressUtils; -import { unitRegex } from "../utils/regexConstants"; import * as utilsContractsConfig from "../utils/contractsConfig"; import { File, Types } from "./file"; diff --git a/packages/embark/src/lib/utils/contractsConfig.ts b/packages/embark/src/lib/utils/contractsConfig.ts index 2ad5020c6..808ed4ae9 100644 --- a/packages/embark/src/lib/utils/contractsConfig.ts +++ b/packages/embark/src/lib/utils/contractsConfig.ts @@ -1,5 +1,4 @@ -import { AddressUtils } from "embark-utils"; -import { unitRegex } from "./regexConstants"; +import { AddressUtils, unitRegex } from "embark-utils"; const { extendZeroAddressShorthand, replaceZeroAddressShorthand } = AddressUtils; const web3 = require("web3");