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

This commit is contained in:
Shahed Nasser authored and GitHub committed 2023-08-17 14:34:36 +00:00
1 parent 5cf59a5b9c
commit c684d16ec0
4 files changed
+9 -25

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"create-medusa-app": minor
---
feat(create-medusa-app): remove `--stable` option and change to clone default branch
@@ -31,7 +31,6 @@ export type CreateOptions = {
seed?: boolean seed?: boolean
// commander passed --no-boilerplate as boilerplate // commander passed --no-boilerplate as boilerplate
boilerplate?: boolean boilerplate?: boolean
stable?: boolean
skipDb?: boolean skipDb?: boolean
dbUrl?: string dbUrl?: string
browser?: boolean browser?: boolean
@@ -43,7 +42,6 @@ export default async ({
repoUrl = "", repoUrl = "",
seed, seed,
boilerplate, boilerplate,
stable,
skipDb, skipDb,
dbUrl, dbUrl,
browser, browser,
@@ -123,7 +121,6 @@ export default async ({
repoUrl, repoUrl,
abortController, abortController,
spinner, spinner,
stable,
}) })
} catch { } catch {
return return
@@ -217,9 +214,7 @@ export default async ({
resources: ["http://localhost:9000/health"], resources: ["http://localhost:9000/health"],
}).then(async () => }).then(async () =>
open( open(
stable inviteToken
? "http://localhost:9000/store/products"
: inviteToken
? `http://localhost:7001/invite?token=${inviteToken}&first_run=true` ? `http://localhost:7001/invite?token=${inviteToken}&first_run=true`
: "http://localhost:7001" : "http://localhost:7001"
) )
-4
View File
@@ -10,10 +10,6 @@ program
"--no-boilerplate", "--no-boilerplate",
"Install a Medusa project without the boilerplate and demo files." "Install a Medusa project without the boilerplate and demo files."
) )
.option(
"--stable",
"Install the latest stable version. This removes all onboarding features"
)
.option( .option(
"--skip-db", "--skip-db",
"Skips creating the database, running migrations, and seeding, and subsequently skips opening the browser.", "Skips creating the database, running migrations, and seeding, and subsequently skips opening the browser.",
@@ -9,7 +9,6 @@ type CloneRepoOptions = {
directoryName?: string directoryName?: string
repoUrl?: string repoUrl?: string
abortController?: AbortController abortController?: AbortController
stable?: boolean
} }
const DEFAULT_REPO = "https://github.com/medusajs/medusa-starter-default" const DEFAULT_REPO = "https://github.com/medusajs/medusa-starter-default"
@@ -18,14 +17,10 @@ export default async function cloneRepo({
directoryName = "", directoryName = "",
repoUrl, repoUrl,
abortController, abortController,
stable = false,
}: CloneRepoOptions) { }: CloneRepoOptions) {
await promiseExec( await promiseExec(`git clone ${repoUrl || DEFAULT_REPO} ${directoryName}`, {
`git clone ${repoUrl || getRepoUrl(stable)} ${directoryName}`, signal: abortController?.signal,
{ })
signal: abortController?.signal,
}
)
} }
export async function runCloneRepo({ export async function runCloneRepo({
@@ -33,20 +28,17 @@ export async function runCloneRepo({
repoUrl, repoUrl,
abortController, abortController,
spinner, spinner,
stable = false,
}: { }: {
projectName: string projectName: string
repoUrl: string repoUrl: string
abortController: AbortController abortController: AbortController
spinner: Ora spinner: Ora
stable?: boolean
}) { }) {
try { try {
await cloneRepo({ await cloneRepo({
directoryName: projectName, directoryName: projectName,
repoUrl, repoUrl,
abortController, abortController,
stable,
}) })
deleteGitDirectory(projectName) deleteGitDirectory(projectName)
@@ -69,7 +61,3 @@ function deleteGitDirectory(projectDirectory: string) {
force: true, force: true,
}) })
} }
function getRepoUrl(stable?: boolean) {
return !stable ? `${DEFAULT_REPO} -b feat/onboarding` : DEFAULT_REPO
}