feat(create-medusa-app): add install Next.js storefront option (#4968)

* feat(create-medusa-app): add install Next.js storefront option

* added config for yes option

* added more instructions to exit message

* handle duplicate directories and next errors

* use next.js branch

* add line break in storefront question

* pass next.js directory name as env variable

* change question message

* address PR feedback

* fix(medusa-cli): remove .git directory in `new` command

* fix deleting a directory error
This commit is contained in:
Shahed Nasser
2023-09-08 12:17:48 +02:00
committed by GitHub
parent aecae5705d
commit 240b038006
7 changed files with 172 additions and 9 deletions
+6
View File
@@ -20,6 +20,7 @@ import reporter from "../reporter"
import { getPackageManager, setPackageManager } from "../util/package-manager"
import { PanicId } from "../reporter/panic-handler"
import { clearProject } from "../util/clear-project"
import path from "path"
const removeUndefined = (obj) => {
return Object.fromEntries(
@@ -641,6 +642,11 @@ medusa new ${rootPath} [url-to-starter]
reporter.info("Final project preparations...")
// remove demo files
clearProject(rootPath)
// remove .git directory
fs.rmSync(path.join(rootPath, '.git'), {
recursive: true,
force: true,
})
}
successMessage(rootPath)