feat(medusa, modules-sdk, types, utils): Re work modules loading and remove legacy functions (#5496)
This commit is contained in:
committed by
GitHub
parent
ca411e54eb
commit
154c9b43bd
@@ -14,15 +14,17 @@ async function bootstrapApp({ cwd, env = {} } = {}) {
|
||||
|
||||
const loaders = require("@medusajs/medusa/dist/loaders").default
|
||||
|
||||
const { container, dbConnection, pgConnection } = await loaders({
|
||||
directory: path.resolve(cwd || process.cwd()),
|
||||
expressApp: app,
|
||||
isTest: false,
|
||||
})
|
||||
const { container, dbConnection, pgConnection, disposeResources } =
|
||||
await loaders({
|
||||
directory: path.resolve(cwd || process.cwd()),
|
||||
expressApp: app,
|
||||
isTest: false,
|
||||
})
|
||||
|
||||
const PORT = await getPort()
|
||||
|
||||
return {
|
||||
disposeResources,
|
||||
container,
|
||||
db: dbConnection,
|
||||
pgConnection,
|
||||
@@ -55,6 +57,7 @@ module.exports = {
|
||||
expressServer.close(),
|
||||
db?.destroy(),
|
||||
pgConnection?.context?.destroy(),
|
||||
container.dispose(),
|
||||
])
|
||||
|
||||
if (typeof global !== "undefined" && global?.gc) {
|
||||
|
||||
@@ -9,6 +9,7 @@ module.exports = {
|
||||
`/www/`,
|
||||
`/dist/`,
|
||||
`/node_modules/`,
|
||||
"<rootDir>/node_modules",
|
||||
`__tests__/fixtures`,
|
||||
`__testfixtures__`,
|
||||
`.cache`,
|
||||
|
||||
Reference in New Issue
Block a user