@paralect/hive 0.1.50-alpha.0 → 0.1.50-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/cli/helpers/docker.js +4 -4
  2. package/cli/helpers/envCheck.js +14 -10
  3. package/cli/helpers/findPort.js +3 -3
  4. package/cli/hive.js +17 -15
  5. package/package.json +1 -1
  6. package/starter/loader.mjs +40 -0
  7. package/starter/package-lock.json +3512 -262
  8. package/starter/package.json +7 -2
  9. package/starter/register.mjs +6 -0
  10. package/starter/src/app-config/index.js +3 -0
  11. package/starter/src/app.js +10 -14
  12. package/starter/src/autoMap/addHandlers.js +3 -3
  13. package/starter/src/autoMap/getDependentFields.js +1 -1
  14. package/starter/src/autoMap/mapSchema.js +2 -2
  15. package/starter/src/bullMqBus.js +1 -1
  16. package/starter/src/bullMqWrapper.js +1 -1
  17. package/starter/src/db.js +12 -11
  18. package/starter/src/helpers/esm.js +56 -0
  19. package/starter/src/helpers/getMiddlewares.js +3 -0
  20. package/starter/src/helpers/getResourceEndpoints.js +3 -0
  21. package/starter/src/helpers/getResources.js +3 -0
  22. package/starter/src/helpers/getSchemas.js +3 -0
  23. package/starter/src/helpers/importHandlers.js +11 -20
  24. package/starter/src/ioEmitter.js +1 -1
  25. package/starter/src/logger.js +1 -1
  26. package/starter/src/middlewares/attachUser.js +2 -2
  27. package/starter/src/middlewares/global/tryToAttachUser.js +1 -1
  28. package/starter/src/middlewares/shouldExist.js +1 -1
  29. package/starter/src/middlewares/shouldNotExist.js +1 -1
  30. package/starter/src/migrations/migration.service.js +4 -1
  31. package/starter/src/migrations/migrations-log/migration-log.schema.js +1 -1
  32. package/starter/src/migrations/migrations-log/migration-log.service.js +1 -1
  33. package/starter/src/migrations/migrations.schema.js +1 -1
  34. package/starter/src/migrations/migrator.js +1 -1
  35. package/starter/src/migrator.js +2 -3
  36. package/starter/src/resources/schemaMappings/schemaMappings.schema.js +1 -1
  37. package/starter/src/resources/tokens/methods/setToken.js +1 -1
  38. package/starter/src/resources/tokens/methods/storeToken.js +2 -2
  39. package/starter/src/resources/tokens/tokens.schema.js +1 -1
  40. package/starter/src/resources/users/endpoints/getCurrentUser.js +1 -1
  41. package/starter/src/resources/users/endpoints/getUserProfile.js +1 -1
  42. package/starter/src/resources/users/methods/ensureUserCreated.js +1 -1
  43. package/starter/src/resources/users/users.schema.js +1 -1
  44. package/starter/src/routes/index.js +8 -8
  45. package/starter/src/routes/middlewares/routeErrorHandler.js +1 -1
  46. package/starter/src/scheduler.js +10 -7
  47. package/starter/src/services/emailService.js +1 -1
  48. package/starter/src/services/setCookie.js +2 -2
  49. package/starter/src/socketIo.js +3 -3
  50. package/test-app/package-lock.json +321 -8543
  51. package/test-app/package.json +1 -1
@@ -4,6 +4,10 @@
4
4
  "description": "Koa api",
5
5
  "private": false,
6
6
  "main": "src/app.js",
7
+ "imports": {
8
+ "#hive/*": "./src/*",
9
+ "#hive": "./src/index.js"
10
+ },
7
11
  "author": "Paralect",
8
12
  "license": "MIT",
9
13
  "keywords": [
@@ -18,7 +22,7 @@
18
22
  "scripts": {
19
23
  "build-assets": "mjml ./src/assets/emails/*.mjml -o ./src/assets/emails/dist/",
20
24
  "build-emails": "babel src/emails --out-dir src/emails/compiled",
21
- "dev": "tsx --watch src/app.js",
25
+ "dev": "tsx --watch --import ./register.mjs src/app.js",
22
26
  "init-project": "./bin/init-project.sh",
23
27
  "start": "tsx src/app.js",
24
28
  "migrate": "node ./src/migrator.js",
@@ -31,6 +35,7 @@
31
35
  "@koa/cors": "5.0.0",
32
36
  "@koa/multer": "3.0.2",
33
37
  "@koa/router": "12.0.1",
38
+ "@paralect/hive": "^0.1.50-alpha.0",
34
39
  "@paralect/node-mongo": "3.2.0",
35
40
  "@react-email/components": "^0.0.21",
36
41
  "@react-email/render": "^0.0.16",
@@ -95,4 +100,4 @@
95
100
  "npm run lint"
96
101
  ]
97
102
  }
98
- }
103
+ }
@@ -0,0 +1,6 @@
1
+ import { register } from 'node:module';
2
+ import { pathToFileURL } from 'node:url';
3
+
4
+ console.log('[register] Registering custom loader...');
5
+ register('./loader.mjs', pathToFileURL('./'));
6
+ console.log('[register] Custom loader registered');
@@ -2,6 +2,9 @@ import _ from 'lodash';
2
2
  import fs from "fs";
3
3
  import dotenv from "dotenv";
4
4
  import appConfig from "./app.js";
5
+ import { getDirname } from '#hive/helpers/esm';
6
+
7
+ const __dirname = getDirname(import.meta.url);
5
8
 
6
9
  dotenv.config({ path: `${__dirname}/.env` });
7
10
  dotenv.config({ path: `${__dirname}/.env.app` });
@@ -1,31 +1,27 @@
1
-
2
- import appModulePath from "app-module-path";
3
- appModulePath.addPath(__dirname);
4
-
5
- if (process.env.HIVE_SRC) {
6
- appModulePath.addPath(process.env.HIVE_SRC);
7
- }
1
+ // Module resolution:
2
+ // #hive/... .hive/src/... (framework code, via package.json imports)
3
+ // #root/... → HIVE_SRC/... (user code, via custom loader)
8
4
 
9
5
  import Koa from "koa";
10
6
  import http from "http";
11
- import config from "app-config";
12
- import logger from "logger";
7
+ import config from "#hive/app-config";
8
+ import logger from "#hive/logger";
13
9
  import cors from "@koa/cors";
14
10
  import helmet from "koa-helmet";
15
11
  import qs from "koa-qs";
16
12
  import bodyParser from "koa-bodyparser";
17
13
 
18
14
  import requestLogger from "koa-logger";
19
- import db from "db";
20
- import socketIo from "socketIo";
15
+ import db from "#hive/db";
16
+ import socketIo from "#hive/socketIo";
21
17
  import mount from "koa-mount";
22
- import get from "resources/health/endpoints/get";
18
+ import get from "#hive/resources/health/endpoints/get";
23
19
 
24
20
  const main = async () => {
25
21
  await config.init();
26
22
  await db.init();
27
23
 
28
- const routes = (await import("routes")).default;
24
+ const routes = (await import("#hive/routes")).default;
29
25
  const scheduler = (await import("./scheduler")).default;
30
26
 
31
27
  process.on("unhandledRejection", (reason, p) => {
@@ -59,7 +55,7 @@ const main = async () => {
59
55
  console.log(`Api server listening on ${config.port}, in ${process.env.NODE_ENV} mode and ${process.env.APP_ENV} environment`);
60
56
  });
61
57
 
62
- scheduler();
58
+ await scheduler();
63
59
 
64
60
  await socketIo(server);
65
61
  };
@@ -1,9 +1,9 @@
1
1
  import _ from "lodash";
2
- import db from "db";
3
- import ifUpdated from "helpers/db/ifUpdated";
2
+ import db from "#hive/db";
3
+ import ifUpdated from "#hive/helpers/db/ifUpdated";
4
4
  import schemaMappings from "./schemaMappings";
5
5
  import getDependentFields from './getDependentFields';
6
- import isZodArray from "helpers/isZodArray";
6
+ import isZodArray from "#hive/helpers/isZodArray";
7
7
 
8
8
  const updatedSchemaMappings = (() => {
9
9
  const result = {};
@@ -1,6 +1,6 @@
1
1
  import _ from 'lodash';
2
2
  import { z } from 'zod';
3
- import isZodArray from "helpers/isZodArray";
3
+ import isZodArray from "#hive/helpers/isZodArray";
4
4
 
5
5
  const getZodKeys = schema => {
6
6
  // make sure schema is not null or undefined
@@ -1,9 +1,9 @@
1
1
  import _ from "lodash";
2
- import db from "db";
2
+ import db from "#hive/db";
3
3
 
4
4
  import schemaMappings from "./schemaMappings";
5
5
  import getDependentFields from './getDependentFields';
6
- import isZodArray from "helpers/isZodArray";
6
+ import isZodArray from "#hive/helpers/isZodArray";
7
7
 
8
8
  const schemaMappingService = db.services.schemaMappings;
9
9
 
@@ -1,4 +1,4 @@
1
- import config from 'app-config';
1
+ import config from '#hive/app-config';
2
2
  import bullMq from './bullMq';
3
3
  const queue = bullMq.Queue(`database-${config.env}`);
4
4
 
@@ -1,4 +1,4 @@
1
- import config from 'app-config';
1
+ import config from '#hive/app-config';
2
2
  import { Queue, Worker } from 'bullMq';
3
3
 
4
4
  let connectionOpts = {
package/starter/src/db.js CHANGED
@@ -1,10 +1,11 @@
1
1
  import fs from "fs";
2
2
  import _ from "lodash";
3
- import getSchemas from "helpers/getSchemas";
4
- import getResources from "helpers/getResources";
5
- import importHandlers from "helpers/importHandlers";
6
- import config from "app-config";
7
- import { connect } from "lib/node-mongo";
3
+ import getSchemas from "#hive/helpers/getSchemas";
4
+ import getResources from "#hive/helpers/getResources";
5
+ import importHandlers from "#hive/helpers/importHandlers";
6
+
7
+ import config from "#hive/app-config";
8
+ import { connect } from "#hive/lib/node-mongo/src/index.js";
8
9
 
9
10
  const db = connect(config.mongoUri);
10
11
 
@@ -39,14 +40,14 @@ db.init = async () => {
39
40
 
40
41
  const resourcePaths = await getResources();
41
42
 
42
- setTimeout(() => {
43
- _.each(resourcePaths, ({ name }) => {
44
- importHandlers(name)
45
- });
43
+ setTimeout(async () => {
44
+ for (const { name } of resourcePaths) {
45
+ await importHandlers(name);
46
+ }
46
47
  }, 0);
47
48
 
48
- (await import("autoMap/addHandlers")).default();
49
- (await import("autoMap/mapSchema")).default();
49
+ (await import("#hive/autoMap/addHandlers")).default();
50
+ (await import("#hive/autoMap/mapSchema")).default();
50
51
  };
51
52
 
52
53
  export default db;
@@ -0,0 +1,56 @@
1
+ import { fileURLToPath } from 'url';
2
+ import { dirname, join } from 'path';
3
+ import { readdirSync } from 'fs';
4
+
5
+ /**
6
+ * Get __dirname equivalent for ESM modules
7
+ * Usage: const __dirname = getDirname(import.meta.url);
8
+ */
9
+ export const getDirname = (importMetaUrl) => {
10
+ return dirname(fileURLToPath(importMetaUrl));
11
+ };
12
+
13
+ /**
14
+ * Get __filename equivalent for ESM modules
15
+ * Usage: const __filename = getFilename(import.meta.url);
16
+ */
17
+ export const getFilename = (importMetaUrl) => {
18
+ return fileURLToPath(importMetaUrl);
19
+ };
20
+
21
+ /**
22
+ * ESM replacement for require-dir
23
+ * Imports all JS files from a directory
24
+ *
25
+ * @param {string} dirPath - Directory path to import from
26
+ * @param {object} options - Options
27
+ * @param {function} options.mapValue - Function to call for each imported module (module, name) => any
28
+ * @param {function} options.filter - Function to filter files (filename) => boolean
29
+ * @returns {Promise<object>} - Object with filename (without ext) as key and module as value
30
+ */
31
+ export const importDir = async (dirPath, options = {}) => {
32
+ const { mapValue, filter = (f) => f.endsWith('.js') } = options;
33
+
34
+ const files = readdirSync(dirPath).filter(filter);
35
+ const modules = {};
36
+
37
+ for (const file of files) {
38
+ const filePath = join(dirPath, file);
39
+ const moduleName = file.replace(/\.[^.]+$/, ''); // Remove extension
40
+
41
+ try {
42
+ const module = await import(filePath);
43
+ const value = module.default || module;
44
+
45
+ if (mapValue) {
46
+ modules[moduleName] = mapValue(value, moduleName);
47
+ } else {
48
+ modules[moduleName] = value;
49
+ }
50
+ } catch (err) {
51
+ console.error(`[importDir] Failed to import ${filePath}:`, err.message);
52
+ }
53
+ }
54
+
55
+ return modules;
56
+ };
@@ -1,6 +1,9 @@
1
1
  import _ from 'lodash';
2
2
  import path from 'path';
3
3
  import fs from 'fs';
4
+ import { getDirname } from '#hive/helpers/esm';
5
+
6
+ const __dirname = getDirname(import.meta.url);
4
7
 
5
8
  const {
6
9
  promises: { readdir },
@@ -1,5 +1,8 @@
1
1
  import fs from 'fs';
2
2
  import _ from 'lodash';
3
+ import { getDirname } from '#hive/helpers/esm';
4
+
5
+ const __dirname = getDirname(import.meta.url);
3
6
 
4
7
  const {
5
8
  promises: { readdir },
@@ -1,6 +1,9 @@
1
1
  import _ from 'lodash';
2
2
  import path from 'path';
3
3
  import fs from 'fs';
4
+ import { getDirname } from '#hive/helpers/esm';
5
+
6
+ const __dirname = getDirname(import.meta.url);
4
7
 
5
8
  const {
6
9
  promises: { readdir },
@@ -1,6 +1,9 @@
1
1
  import _ from 'lodash';
2
2
  import fs, { promises } from "fs";
3
3
  import getResources from "./getResources.js";
4
+ import { getDirname } from '#hive/helpers/esm';
5
+
6
+ const __dirname = getDirname(import.meta.url);
4
7
 
5
8
  const {
6
9
  promises: { readdir },
@@ -1,29 +1,20 @@
1
1
  import fs from 'fs';
2
2
  import _ from 'lodash';
3
- import requireDir from "require-dir";
3
+ import { getDirname, importDir } from '#hive/helpers/esm';
4
4
 
5
- export default (resourceName) => {
6
- if (fs.existsSync(`${process.env.HIVE_SRC}/resources/${resourceName}/handlers`)) {
7
- requireDir(`${process.env.HIVE_SRC}/resources/${resourceName}/handlers`, {
8
- mapValue: (handler, handlerName) => {
9
- console.log(
10
- `[handlers] Registering handler ${handlerName}`
11
- );
5
+ const __dirname = getDirname(import.meta.url);
6
+
7
+ export default async (resourceName) => {
8
+ const mapValue = (handler, handlerName) => {
9
+ console.log(`[handlers] Registering handler ${handlerName}`);
10
+ return handler;
11
+ };
12
12
 
13
- return handler;
14
- },
15
- });
13
+ if (fs.existsSync(`${process.env.HIVE_SRC}/resources/${resourceName}/handlers`)) {
14
+ await importDir(`${process.env.HIVE_SRC}/resources/${resourceName}/handlers`, { mapValue });
16
15
  }
17
16
 
18
17
  if (fs.existsSync(`${__dirname}/../resources/${resourceName}/handlers`)) {
19
- requireDir(`${__dirname}/../resources/${resourceName}/handlers`, {
20
- mapValue: (handler, handlerName) => {
21
- console.log(
22
- `[handlers] Registering handler ${handlerName}`
23
- );
24
-
25
- return handler;
26
- },
27
- });
18
+ await importDir(`${__dirname}/../resources/${resourceName}/handlers`, { mapValue });
28
19
  }
29
20
  };
@@ -1,4 +1,4 @@
1
- import config from 'app-config';
1
+ import config from '#hive/app-config';
2
2
  import { Emitter } from '@socket.io/redis-emitter';
3
3
  import { createClient } from 'redis';
4
4
 
@@ -1,5 +1,5 @@
1
1
  import winston from 'winston';
2
- import config from 'app-config';
2
+ import config from '#hive/app-config';
3
3
  import fs from 'fs';
4
4
 
5
5
  const colorizer = winston.format.colorize();
@@ -1,5 +1,5 @@
1
- import db from 'db';
2
- import config from 'app-config';
1
+ import db from '#hive/db';
2
+ import config from '#hive/app-config';
3
3
 
4
4
  const userService = db.services.users;
5
5
  const tokenService = db.services.tokens;
@@ -1,4 +1,4 @@
1
- import db from 'db';
1
+ import db from '#hive/db';
2
2
  const userService = db.services.users;
3
3
  const tokenService = db.services.tokens;
4
4
 
@@ -1,4 +1,4 @@
1
- import db from 'db';
1
+ import db from '#hive/db';
2
2
 
3
3
  function singularize(word) {
4
4
  const endings = {
@@ -1,5 +1,5 @@
1
1
  import _ from 'lodash';
2
- import db from 'db';
2
+ import db from '#hive/db';
3
3
 
4
4
  export default (
5
5
  resourceName,
@@ -1,8 +1,11 @@
1
- import db from "db";
1
+ import db from "#hive/db";
2
2
  import fs from "fs";
3
3
  import path from "path";
4
4
  import _ from "lodash";
5
5
  import validateSchema from "./migrations.schema";
6
+ import { getDirname } from '#hive/helpers/esm';
7
+
8
+ const __dirname = getDirname(import.meta.url);
6
9
 
7
10
  const service = db.createService("__migrationVersion", {
8
11
  validate: validateSchema,
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import dbSchema from 'helpers/schema/db.schema';
2
+ import dbSchema from '#hive/helpers/schema/db.schema';
3
3
 
4
4
  export default dbSchema.extend({
5
5
  startTime: z.date(),
@@ -1,4 +1,4 @@
1
- import db from 'db';
1
+ import db from '#hive/db';
2
2
  import validateSchema from './migration-log.schema.js';
3
3
 
4
4
  const service = db.createService("__migrationLog", {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import dbSchema from 'helpers/schema/db.schema';
2
+ import dbSchema from '#hive/helpers/schema/db.schema';
3
3
 
4
4
  export default dbSchema.extend({
5
5
  version: z.number(),
@@ -1,6 +1,6 @@
1
1
  import 'moment-duration-format';
2
2
  import moment from 'moment';
3
- import logger from 'logger';
3
+ import logger from '#hive/logger';
4
4
  import migrationLogService from './migrations-log/migration-log.service';
5
5
  import migrationService from './migration.service';
6
6
 
@@ -1,4 +1,3 @@
1
- import appModulePath from "app-module-path";
2
- import migrator from "migrations/migrator";
3
- appModulePath.addPath(__dirname);
1
+ import migrator from "#hive/migrations/migrator";
2
+
4
3
  migrator.exec();
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import dbSchema from 'helpers/schema/db.schema';
2
+ import dbSchema from '#hive/helpers/schema/db.schema';
3
3
 
4
4
  export default dbSchema.extend({
5
5
  mappings: z.object({}),
@@ -1,4 +1,4 @@
1
- import db from 'db';
1
+ import db from '#hive/db';
2
2
  const tokenService = db.services.tokens;
3
3
 
4
4
  export default async () => {
@@ -1,10 +1,10 @@
1
- import db from 'db';
1
+ import db from '#hive/db';
2
2
  import crypto from 'crypto';
3
3
  import util from 'util';
4
4
 
5
5
  const randomBytes = util.promisify(crypto.randomBytes, crypto);
6
6
 
7
- import setCookie from 'services/setCookie';
7
+ import setCookie from '#hive/services/setCookie';
8
8
 
9
9
  const tokenService = db.services.tokens;
10
10
 
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import dbSchema from 'helpers/schema/db.schema';
2
+ import dbSchema from '#hive/helpers/schema/db.schema';
3
3
 
4
4
  export default dbSchema.extend({
5
5
  user: z.object({
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import isAuthorized from 'middlewares/isAuthorized';
2
+ import isAuthorized from '#hive/middlewares/isAuthorized';
3
3
 
4
4
  export const handler = async (ctx) => {
5
5
  ctx.body = ctx.state.user;
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import db from 'db';
2
+ import db from '#hive/db';
3
3
 
4
4
  const userService = db.services.users;
5
5
 
@@ -1,4 +1,4 @@
1
- import db from 'db';
1
+ import db from '#hive/db';
2
2
  import _ from 'lodash';
3
3
  import slug from 'slug';
4
4
 
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import dbSchema from 'helpers/schema/db.schema';
2
+ import dbSchema from '#hive/helpers/schema/db.schema';
3
3
 
4
4
  const users = dbSchema.extend({
5
5
  email: z.string().email(),
@@ -1,16 +1,16 @@
1
1
  import _ from "lodash";
2
- import getResources from "helpers/getResources";
3
- import getMiddlewares from "helpers/getMiddlewares";
4
- import getResourceEndpoints from "helpers/getResourceEndpoints";
2
+ import getResources from "#hive/helpers/getResources";
3
+ import getMiddlewares from "#hive/helpers/getMiddlewares";
4
+ import getResourceEndpoints from "#hive/helpers/getResourceEndpoints";
5
5
  import mount from "koa-mount";
6
6
  import Router from "@koa/router";
7
- import validate from "middlewares/validate";
8
- import db from "db";
9
- import tryToAttachUser from "middlewares/global/tryToAttachUser";
7
+ import validate from "#hive/middlewares/validate";
8
+ import db from "#hive/db";
9
+ import tryToAttachUser from "#hive/middlewares/global/tryToAttachUser";
10
10
  import attachCustomErrors from "./middlewares/attachCustomErrors";
11
11
  import routeErrorHandler from "./middlewares/routeErrorHandler";
12
- import isAuthorized from "middlewares/isAuthorized";
13
- import config from 'app-config';
12
+ import isAuthorized from "#hive/middlewares/isAuthorized";
13
+ import config from '#hive/app-config';
14
14
 
15
15
  const requestLogService = db.createService("_request_logs");
16
16
 
@@ -1,4 +1,4 @@
1
- import logger from 'logger';
1
+ import logger from '#hive/logger';
2
2
 
3
3
  const routeErrorHandler = async (ctx, next) => {
4
4
  try {
@@ -2,17 +2,19 @@ import path from 'path';
2
2
  import fs from 'fs';
3
3
  import moment from 'moment';
4
4
  import schedule from 'node-schedule';
5
- import requireDir from 'require-dir';
5
+ import { getDirname, importDir } from '#hive/helpers/esm';
6
6
 
7
- export default () => {
7
+ const __dirname = getDirname(import.meta.url);
8
+
9
+ export default async () => {
8
10
  const paths = [path.resolve(__dirname, './scheduler/handlers')];
9
11
  if (process.env.HIVE_SRC) {
10
12
  paths.push(path.resolve(process.env.HIVE_SRC, './scheduler/handlers'))
11
13
  }
12
14
 
13
- paths.forEach((pathName) => {
15
+ for (const pathName of paths) {
14
16
  if (fs.existsSync(pathName)) {
15
- requireDir(pathName, {
17
+ await importDir(pathName, {
16
18
  mapValue: (handler, handlerName) => {
17
19
  console.log(
18
20
  `[scheduler] Registering handler ${handlerName} with cron ${handler.cron}`
@@ -20,13 +22,14 @@ export default () => {
20
22
 
21
23
  schedule.scheduleJob(handler.cron, () => {
22
24
  console.log(
23
- `[scheduler] ${moment().format()} executing ${handlerName} with cron ${handler.cron
24
- }`
25
+ `[scheduler] ${moment().format()} executing ${handlerName} with cron ${handler.cron}`
25
26
  );
26
27
  handler.handler();
27
28
  });
29
+
30
+ return handler;
28
31
  },
29
32
  });
30
33
  }
31
- });
34
+ }
32
35
  }
@@ -1,4 +1,4 @@
1
- import config from 'app-config';
1
+ import config from '#hive/app-config';
2
2
  import nodemailer from 'nodemailer';
3
3
 
4
4
  config.assert('smtp');
@@ -1,7 +1,7 @@
1
1
  import psl from 'psl';
2
2
  import url from 'url';
3
- import { env } from 'app-config';
4
- import { webUri } from 'app-config';
3
+ import { env } from '#hive/app-config';
4
+ import { webUri } from '#hive/app-config';
5
5
 
6
6
  let cookiesDomain;
7
7
 
@@ -1,9 +1,9 @@
1
- import db from 'db';
1
+ import db from '#hive/db';
2
2
  import { Server } from 'socket.io';
3
3
  import { createClient } from 'redis';
4
4
  import { createAdapter } from '@socket.io/redis-adapter';
5
- import config from 'app-config';
6
- import logger from 'logger';
5
+ import config from '#hive/app-config';
6
+ import logger from '#hive/logger';
7
7
 
8
8
  export default (server) => {
9
9
  const io = new Server(server);