add generated .medusa/types to local plugins (#13777)
Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
This commit is contained in:
1 parent
fb11f0f272
commit
125694626e
2 files changed
+15
-1
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/medusa": patch
|
||||
---
|
||||
|
||||
feat(medusa): add generated .medusa/types to local plugins
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
dynamicImport,
|
||||
FileSystem,
|
||||
generateContainerTypes,
|
||||
getResolvedPlugins,
|
||||
gqlSchemaToTypes,
|
||||
GracefulShutdownServer,
|
||||
isFileSkipped,
|
||||
@@ -272,7 +273,14 @@ async function start(args: {
|
||||
})
|
||||
|
||||
if (generateTypes) {
|
||||
const typesDirectory = path.join(directory, ".medusa/types")
|
||||
const configModule = container.resolve(
|
||||
ContainerRegistrationKeys.CONFIG_MODULE
|
||||
)
|
||||
const localPlugins = (await getResolvedPlugins(directory, configModule, true))
|
||||
.filter((p) => p.admin?.type === "local")
|
||||
|
||||
for (const plugin of localPlugins) {
|
||||
const typesDirectory = path.join(plugin.admin!.resolve, "../../.medusa/types")
|
||||
|
||||
/**
|
||||
* Cleanup existing types directory before creating new artifacts
|
||||
@@ -296,6 +304,7 @@ async function start(args: {
|
||||
logger.debug("Generated modules types")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Register a health check endpoint. Ideally this also checks the readiness of the service, rather than just returning a static response.
|
||||
app.get("/health", (_, res) => {
|
||||
|
||||
Reference in new issue
Block a user