feat(create-medusa-app): remove admin email prompt (#7417)

* feat(create-medusa-app): remove admin email prompt

* change to constant
This commit is contained in:
Shahed Nasser
2024-05-23 12:23:45 +03:00
committed by GitHub
parent b0209e1114
commit 9cbe0085d0
2 changed files with 4 additions and 33 deletions
@@ -29,7 +29,6 @@ import {
} from "../utils/nextjs-utils.js"
const slugify = slugifyType.default
const isEmail = isEmailImported.default
export type CreateOptions = {
repoUrl?: string
@@ -95,8 +94,6 @@ export default async ({
const projectName = await askForProjectName(directoryPath)
const projectPath = getProjectPath(projectName, directoryPath)
const adminEmail =
!skipDb && migrations ? await askForAdminEmail(seed, boilerplate) : ""
const installNextjs = withNextjsStarter || (await askForNextjsStarter())
let { client, dbConnectionString } = !skipDb
@@ -178,9 +175,6 @@ export default async ({
inviteToken = await prepareProject({
directory: projectPath,
dbConnectionString,
admin: {
email: adminEmail,
},
seed,
boilerplate,
spinner,
@@ -286,27 +280,6 @@ async function askForProjectName(directoryPath?: string): Promise<string> {
return projectName
}
async function askForAdminEmail(
seed?: boolean,
boilerplate?: boolean
): Promise<string> {
const { adminEmail } = await inquirer.prompt([
{
type: "input",
name: "adminEmail",
message: "Enter an email for your admin dashboard user",
default: !seed && boilerplate ? "admin@medusa-test.com" : undefined,
validate: (input) => {
return typeof input === "string" && input.length > 0 && isEmail(input)
? true
: "Please enter a valid email"
},
},
])
return adminEmail
}
function showSuccessMessage(
projectName: string,
inviteToken?: string,