chore: Remove v2 branches from starters (#9721)
* chore: Remove v2 branches from starters * revert imports
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import execute from "./execute.js"
|
||||
import { Ora } from "ora"
|
||||
import { isAbortError } from "./create-abort-controller.js"
|
||||
import logMessage from "./log-message.js"
|
||||
import fs from "fs"
|
||||
import { Ora } from "ora"
|
||||
import path from "path"
|
||||
import { isAbortError } from "./create-abort-controller.js"
|
||||
import execute from "./execute.js"
|
||||
import logMessage from "./log-message.js"
|
||||
|
||||
type CloneRepoOptions = {
|
||||
directoryName?: string
|
||||
@@ -13,7 +13,7 @@ type CloneRepoOptions = {
|
||||
}
|
||||
|
||||
const DEFAULT_REPO = "https://github.com/medusajs/medusa-starter-default"
|
||||
const V2_BRANCH = "feat/v2"
|
||||
const BRANCH = "master"
|
||||
|
||||
export default async function cloneRepo({
|
||||
directoryName = "",
|
||||
@@ -23,7 +23,7 @@ export default async function cloneRepo({
|
||||
}: CloneRepoOptions) {
|
||||
await execute(
|
||||
[
|
||||
`git clone ${repoUrl || DEFAULT_REPO} -b ${V2_BRANCH} ${directoryName}`,
|
||||
`git clone ${repoUrl || DEFAULT_REPO} -b ${BRANCH} ${directoryName}`,
|
||||
{
|
||||
signal: abortController?.signal,
|
||||
},
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import inquirer from "inquirer"
|
||||
import { exec } from "child_process"
|
||||
import fs from "fs"
|
||||
import inquirer from "inquirer"
|
||||
import { customAlphabet } from "nanoid"
|
||||
import path from "path"
|
||||
import { isAbortError } from "./create-abort-controller.js"
|
||||
import execute from "./execute.js"
|
||||
import { displayFactBox, FactBoxOptions } from "./facts.js"
|
||||
import fs from "fs"
|
||||
import path from "path"
|
||||
import { customAlphabet } from "nanoid"
|
||||
import { isAbortError } from "./create-abort-controller.js"
|
||||
import logMessage from "./log-message.js"
|
||||
import ProcessManager from "./process-manager.js"
|
||||
|
||||
const NEXTJS_REPO = "https://github.com/medusajs/nextjs-starter-medusa"
|
||||
const NEXTJS_BRANCH = "main"
|
||||
|
||||
export async function askForNextjsStarter(): Promise<boolean> {
|
||||
const { installNextjs } = await inquirer.prompt([
|
||||
@@ -62,7 +63,7 @@ export async function installNextjsStarter({
|
||||
// TODO change back to use create-next-app once Next.js v2 changes land on the main branch
|
||||
await execute(
|
||||
[
|
||||
`git clone ${NEXTJS_REPO} -b v2 ${nextjsDirectory}`,
|
||||
`git clone ${NEXTJS_REPO} -b ${NEXTJS_BRANCH} ${nextjsDirectory}`,
|
||||
{
|
||||
signal: abortController?.signal,
|
||||
env: process.env,
|
||||
|
||||
@@ -13,16 +13,16 @@ import path from "path"
|
||||
import prompts from "prompts"
|
||||
import { Pool } from "pg"
|
||||
import url from "url"
|
||||
import { track } from "@medusajs/telemetry"
|
||||
// @ts-ignore
|
||||
import inquirer from "inquirer"
|
||||
import { createDatabase } from "pg-god"
|
||||
import { track } from "@medusajs/telemetry"
|
||||
|
||||
import { getNodeVersion, MIN_SUPPORTED_NODE_VERSION } from "@medusajs/utils"
|
||||
import reporter from "../reporter"
|
||||
import { getPackageManager, setPackageManager } from "../util/package-manager"
|
||||
import { PanicId } from "../reporter/panic-handler"
|
||||
import { clearProject } from "../util/clear-project"
|
||||
import { getNodeVersion, MIN_SUPPORTED_NODE_VERSION } from "@medusajs/utils"
|
||||
import { getPackageManager, setPackageManager } from "../util/package-manager"
|
||||
|
||||
const removeUndefined = (obj) => {
|
||||
return Object.fromEntries(
|
||||
@@ -187,7 +187,7 @@ const clone = async (hostInfo, rootPath, v2 = false, inputBranch) => {
|
||||
: []
|
||||
|
||||
if (v2) {
|
||||
branch = [`-b`, inputBranch || "feat/v2"]
|
||||
branch = [`-b`, inputBranch || "master"]
|
||||
}
|
||||
|
||||
const createAct = reporter.activity(`Creating new project from git: ${url}`)
|
||||
|
||||
Reference in New Issue
Block a user