feat(create-medusa-app): remove --stable option and change to clone default branch (#4794)

This commit is contained in:
Shahed Nasser
2023-08-17 17:34:36 +03:00
committed by GitHub
parent 5cf59a5b9c
commit c684d16ec0
4 changed files with 9 additions and 25 deletions

View File

@@ -0,0 +1,5 @@
---
"create-medusa-app": minor
---
feat(create-medusa-app): remove `--stable` option and change to clone default branch

View File

@@ -31,7 +31,6 @@ export type CreateOptions = {
seed?: boolean
// commander passed --no-boilerplate as boilerplate
boilerplate?: boolean
stable?: boolean
skipDb?: boolean
dbUrl?: string
browser?: boolean
@@ -43,7 +42,6 @@ export default async ({
repoUrl = "",
seed,
boilerplate,
stable,
skipDb,
dbUrl,
browser,
@@ -123,7 +121,6 @@ export default async ({
repoUrl,
abortController,
spinner,
stable,
})
} catch {
return
@@ -217,9 +214,7 @@ export default async ({
resources: ["http://localhost:9000/health"],
}).then(async () =>
open(
stable
? "http://localhost:9000/store/products"
: inviteToken
inviteToken
? `http://localhost:7001/invite?token=${inviteToken}&first_run=true`
: "http://localhost:7001"
)

View File

@@ -10,10 +10,6 @@ program
"--no-boilerplate",
"Install a Medusa project without the boilerplate and demo files."
)
.option(
"--stable",
"Install the latest stable version. This removes all onboarding features"
)
.option(
"--skip-db",
"Skips creating the database, running migrations, and seeding, and subsequently skips opening the browser.",

View File

@@ -9,7 +9,6 @@ type CloneRepoOptions = {
directoryName?: string
repoUrl?: string
abortController?: AbortController
stable?: boolean
}
const DEFAULT_REPO = "https://github.com/medusajs/medusa-starter-default"
@@ -18,14 +17,10 @@ export default async function cloneRepo({
directoryName = "",
repoUrl,
abortController,
stable = false,
}: CloneRepoOptions) {
await promiseExec(
`git clone ${repoUrl || getRepoUrl(stable)} ${directoryName}`,
{
signal: abortController?.signal,
}
)
await promiseExec(`git clone ${repoUrl || DEFAULT_REPO} ${directoryName}`, {
signal: abortController?.signal,
})
}
export async function runCloneRepo({
@@ -33,20 +28,17 @@ export async function runCloneRepo({
repoUrl,
abortController,
spinner,
stable = false,
}: {
projectName: string
repoUrl: string
abortController: AbortController
spinner: Ora
stable?: boolean
}) {
try {
await cloneRepo({
directoryName: projectName,
repoUrl,
abortController,
stable,
})
deleteGitDirectory(projectName)
@@ -69,7 +61,3 @@ function deleteGitDirectory(projectDirectory: string) {
force: true,
})
}
function getRepoUrl(stable?: boolean) {
return !stable ? `${DEFAULT_REPO} -b feat/onboarding` : DEFAULT_REPO
}