diff --git a/.changeset/slow-garlics-accept.md b/.changeset/slow-garlics-accept.md new file mode 100644 index 0000000000000..612a07d8ec18f --- /dev/null +++ b/.changeset/slow-garlics-accept.md @@ -0,0 +1,5 @@ +--- +"@medusajs/medusa": patch +--- + +chore: rename remote-query-entry-points.d.ts to query-entry-points.d.ts diff --git a/packages/medusa/src/commands/start.ts b/packages/medusa/src/commands/start.ts index a2e2c30ec30e3..cbb6145ebe24c 100644 --- a/packages/medusa/src/commands/start.ts +++ b/packages/medusa/src/commands/start.ts @@ -127,17 +127,23 @@ async function start(args: { }) if (generateTypes) { + const typesDirectory = path.join(directory, ".medusa/types") + + /** + * Cleanup existing types directory before creating new artifacts + */ + await new FileSystem(typesDirectory).cleanup({ recursive: true }) + await generateContainerTypes(modules, { - outputDir: path.join(directory, ".medusa/types"), + outputDir: typesDirectory, interfaceName: "ModuleImplementations", }) logger.debug("Generated container types") if (gqlSchema) { - const outputDirGeneratedTypes = path.join(directory, ".medusa/types") await gqlSchemaToTypes({ - outputDir: outputDirGeneratedTypes, - filename: "remote-query-entry-points", + outputDir: typesDirectory, + filename: "query-entry-points", interfaceName: "RemoteQueryEntryPoints", schema: gqlSchema, joinerConfigs: MedusaModule.getAllJoinerConfigs(),