From c019e9a23baf98cbc2a99dea0b75c4bd99d562c7 Mon Sep 17 00:00:00 2001 From: Evan Morikawa Date: Tue, 22 Nov 2016 17:07:48 -0800 Subject: [PATCH] Move SchedulerUtils out of nylas-core to local-sync/src/shared --- packages/local-sync/src/local-api/app.js | 3 ++- .../local-sync/src/local-sync-dashboard/routes/sync-policy.js | 2 +- .../local-sync/src/local-sync-dashboard/routes/websocket.js | 2 +- .../local-sync/src/local-sync-worker/sync-process-manager.js | 3 ++- packages/local-sync/src/local-sync-worker/sync-worker.js | 2 +- .../{nylas-core => local-sync/src/shared}/scheduler-utils.js | 0 packages/nylas-core/index.js | 1 - 7 files changed, 7 insertions(+), 6 deletions(-) rename packages/{nylas-core => local-sync/src/shared}/scheduler-utils.js (100%) diff --git a/packages/local-sync/src/local-api/app.js b/packages/local-sync/src/local-api/app.js index d4decbbb2..e1a7ba6a0 100644 --- a/packages/local-sync/src/local-api/app.js +++ b/packages/local-sync/src/local-api/app.js @@ -10,7 +10,8 @@ const Vision = require('vision'); const Package = require('../../package'); const fs = require('fs'); const path = require('path'); -const {DatabaseConnector, SchedulerUtils, Logger} = require(`nylas-core`); +const {DatabaseConnector, Logger} = require(`nylas-core`); +const SchedulerUtils = require('../shared/scheduler-utils') global.Metrics = Metrics global.Logger = Logger.createLogger('nylas-k2-api') diff --git a/packages/local-sync/src/local-sync-dashboard/routes/sync-policy.js b/packages/local-sync/src/local-sync-dashboard/routes/sync-policy.js index ac327af4b..e437d4d82 100644 --- a/packages/local-sync/src/local-sync-dashboard/routes/sync-policy.js +++ b/packages/local-sync/src/local-sync-dashboard/routes/sync-policy.js @@ -1,5 +1,5 @@ const Joi = require('joi'); -const {SchedulerUtils} = require(`nylas-core`); +const SchedulerUtils = require('../../shared/scheduler-utils'); module.exports = (server) => { server.route({ diff --git a/packages/local-sync/src/local-sync-dashboard/routes/websocket.js b/packages/local-sync/src/local-sync-dashboard/routes/websocket.js index 5bfb8e419..1e1c71b66 100644 --- a/packages/local-sync/src/local-sync-dashboard/routes/websocket.js +++ b/packages/local-sync/src/local-sync-dashboard/routes/websocket.js @@ -1,8 +1,8 @@ const { DatabaseConnector, PubsubConnector, - SchedulerUtils, } = require(`nylas-core`); +const SchedulerUtils = require('../../shared/scheduler-utils') function onWebsocketConnected(wss, ws) { let toSend; diff --git a/packages/local-sync/src/local-sync-worker/sync-process-manager.js b/packages/local-sync/src/local-sync-worker/sync-process-manager.js index bf23f1a99..e7ee3b5a7 100644 --- a/packages/local-sync/src/local-sync-worker/sync-process-manager.js +++ b/packages/local-sync/src/local-sync-worker/sync-process-manager.js @@ -1,5 +1,6 @@ const SyncWorker = require('./sync-worker'); -const {PromiseUtils, DatabaseConnector, PubsubConnector, SchedulerUtils} = require(`nylas-core`) +const {PromiseUtils, DatabaseConnector, PubsubConnector} = require(`nylas-core`) +const SchedulerUtils = require('../shared/scheduler-utils') const IDENTITY = `${global.instanceId}-${process.pid}`; diff --git a/packages/local-sync/src/local-sync-worker/sync-worker.js b/packages/local-sync/src/local-sync-worker/sync-worker.js index e5fbdc0ff..6c5e7bd96 100644 --- a/packages/local-sync/src/local-sync-worker/sync-worker.js +++ b/packages/local-sync/src/local-sync-worker/sync-worker.js @@ -1,5 +1,4 @@ const { - SchedulerUtils, IMAPConnection, PubsubConnector, DatabaseConnector, @@ -7,6 +6,7 @@ const { Errors, PromiseUtils, } = require('nylas-core'); +const SchedulerUtils = require('../shared/scheduler-utils') const { jsonError, } = require('./sync-utils') diff --git a/packages/nylas-core/scheduler-utils.js b/packages/local-sync/src/shared/scheduler-utils.js similarity index 100% rename from packages/nylas-core/scheduler-utils.js rename to packages/local-sync/src/shared/scheduler-utils.js diff --git a/packages/nylas-core/index.js b/packages/nylas-core/index.js index 17d530ac0..f8909e5ce 100644 --- a/packages/nylas-core/index.js +++ b/packages/nylas-core/index.js @@ -8,7 +8,6 @@ module.exports = { Imap: require('imap'), IMAPConnection: require('./imap-connection'), SyncPolicy: require('./sync-policy'), - SchedulerUtils: require('./scheduler-utils'), MessageTypes: require('./message-types'), Logger: require('./logger'), Errors: require('./imap-errors'),