chore: Start cleaning up medusa-core-utils (#7450)
**What** - remove medusa-core-utils - dispatch the utils where they belongs - update usage **NOTE** I have been wondering if the graceful class should go into the utils package or medusa package, I ve put it in the medusa package as it seems to be the best place I can see for now and is tight to the server as well. Also, I wanted to avoid the utils package to depends on http and net dependencies, happy to change that if you feel like it
This commit is contained in:
committed by
GitHub
parent
28a3f9a3df
commit
b8bc3ed16f
+4
-2
@@ -2,7 +2,10 @@ const path = require("path")
|
||||
const express = require("express")
|
||||
const getPort = require("get-port")
|
||||
const { isObject, promiseAll } = require("@medusajs/utils")
|
||||
const { GracefulShutdownServer } = require("medusa-core-utils")
|
||||
// TODO: fix that once we find the appropriate place to put this util
|
||||
const {
|
||||
GracefulShutdownServer,
|
||||
} = require("@medusajs/medusa/dist/utils/graceful-shutdown-server")
|
||||
|
||||
async function bootstrapApp({ cwd, env = {} } = {}) {
|
||||
const app = express()
|
||||
@@ -16,7 +19,6 @@ async function bootstrapApp({ cwd, env = {} } = {}) {
|
||||
const { container, shutdown } = await loaders({
|
||||
directory: path.resolve(cwd || process.cwd()),
|
||||
expressApp: app,
|
||||
isTest: false,
|
||||
})
|
||||
|
||||
const PORT = await getPort()
|
||||
|
||||
Reference in New Issue
Block a user