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