chore: perform dependencies scan and fix all dependencies (#9296)

This commit is contained in:
Harminder Virk
2024-09-26 14:14:38 +05:30
committed by GitHub
parent fba78c0fb1
commit 48bea267dc
593 changed files with 2729 additions and 2314 deletions
+11 -23
View File
@@ -12,9 +12,10 @@ import sysPath from "path"
import prompts from "prompts"
import { Pool } from "pg"
import url from "url"
// @ts-ignore
import inquirer from "inquirer"
import { createDatabase } from "pg-god"
import { track } from "medusa-telemetry"
import inquirer from "inquirer"
import reporter from "../reporter"
import { getPackageManager, setPackageManager } from "../util/package-manager"
@@ -180,7 +181,10 @@ const clone = async (hostInfo, rootPath, v2 = false, inputBranch) => {
url = hostInfo.https({ noCommittish: true, noGitPlus: true })
}
let branch = (inputBranch || hostInfo.committish ? [`-b`, inputBranch || hostInfo.committish] : [])
let branch =
inputBranch || hostInfo.committish
? [`-b`, inputBranch || hostInfo.committish]
: []
if (v2) {
branch = [`-b`, inputBranch || "feat/v2"]
@@ -215,24 +219,6 @@ const clone = async (hostInfo, rootPath, v2 = false, inputBranch) => {
if (!isGit) await createInitialGitCommit(rootPath, url)
}
const getMedusaConfig = (rootPath) => {
try {
const configPath = sysPath.join(rootPath, "medusa-config.js")
if (existsSync(configPath)) {
const resolved = sysPath.resolve(configPath)
const configModule = require(resolved)
return configModule
}
throw Error()
} catch (err) {
console.log(err)
reporter.warn(
`Couldn't find a medusa-config.js file; please double check that you have the correct starter installed`
)
}
return {}
}
const getPaths = async (starterPath, rootPath, v2 = false) => {
let selectedOtherStarter = false
@@ -515,7 +501,9 @@ const attemptSeed = async (rootPath) => {
export const newStarter = async (args) => {
const nodeVersion = getNodeVersion()
if (nodeVersion < MIN_SUPPORTED_NODE_VERSION) {
reporter.error(`Medusa requires at least v20 of Node.js. You're using v${nodeVersion}. Please install at least v20 and try again: https://nodejs.org/en/download`)
reporter.error(
`Medusa requires at least v20 of Node.js. You're using v${nodeVersion}. Please install at least v20 and try again: https://nodejs.org/en/download`
)
process.exit(1)
}
track("CLI_NEW")
@@ -534,7 +522,7 @@ export const newStarter = async (args) => {
dbPort,
dbHost,
v2,
branch
branch,
} = args
const dbCredentials = removeUndefined({
@@ -656,7 +644,7 @@ medusa new ${rootPath} [url-to-starter]
// remove demo files
clearProject(rootPath)
// remove .git directory
fs.rmSync(path.join(rootPath, '.git'), {
fs.rmSync(path.join(rootPath, ".git"), {
recursive: true,
force: true,
})