fix(create-medusa-app): Don't allow dot in project name (#13042)

This commit is contained in:
Oli Juhl
2025-07-25 17:44:06 +02:00
committed by GitHub
parent 0d8c2c4056
commit 909fc4c127
@@ -57,6 +57,16 @@ export class ProjectCreatorFactory {
type: "warn",
})
askProjectName = true
} else if (args[0].includes(".")) {
// We don't allow projects to have a dot in the name, as this causes issues for
// for MikroORM path resolutions.
logMessage({
message: `Project names cannot contain a dot (.) character. Please enter a different ${
isPlugin ? "plugin" : "project"
} name.`,
type: "error",
})
askProjectName = true
}
}
@@ -80,6 +90,14 @@ async function askForProjectName(
return slugify(input).toLowerCase()
},
validate: (input) => {
// We don't allow projects to have a dot in the name, as this causes issues for
// for MikroORM path resolutions.
if (input.includes(".")) {
return `Project names cannot contain a dot (.) character. Please enter a different ${
isPlugin ? "plugin" : "project"
} name.`
}
if (!input.length) {
return `Please enter a ${isPlugin ? "plugin" : "project"} name`
}