* 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
44 lines
1.4 KiB
JavaScript
44 lines
1.4 KiB
JavaScript
#!/usr/bin/env node
|
|
import { program } from "commander"
|
|
import create from "./commands/create.js"
|
|
|
|
program
|
|
.description("Create a new Medusa project")
|
|
.option("--repo-url <url>", "URL of repository to use to setup project.")
|
|
.option("--seed", "Seed the created database with demo data.")
|
|
.option(
|
|
"--no-boilerplate",
|
|
"Install a Medusa project without the boilerplate and demo files."
|
|
)
|
|
.option(
|
|
"--skip-db",
|
|
"Skips creating the database, running migrations, and seeding, and subsequently skips opening the browser.",
|
|
false
|
|
)
|
|
.option(
|
|
"--db-url <url>",
|
|
"Skips database creation and sets the database URL to the provided URL. Throws an error if can't connect to the database. Will still run migrations and open the admin after project creation."
|
|
)
|
|
.option(
|
|
"--no-migrations",
|
|
"Skips running migrations, creating admin user, and seeding. If used, it's expected that you pass the --db-url option with a url of a database that has all necessary migrations. Otherwise, unexpected errors will occur.",
|
|
true
|
|
)
|
|
.option(
|
|
"--no-browser",
|
|
"Disables opening the browser at the end of the project creation and only shows success message.",
|
|
true
|
|
)
|
|
.option(
|
|
"--directory-path <path>",
|
|
"Specify the directory path to install the project in."
|
|
)
|
|
.option(
|
|
"--with-nextjs-starter",
|
|
"Install the Next.js starter along with the Medusa backend",
|
|
false
|
|
)
|
|
.parse()
|
|
|
|
void create(program.opts())
|