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

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,
})

View File

@@ -15,11 +15,6 @@ if (os.platform() === `win32`) {
// ensureWindowsDriveLetterIsUppercase()
}
// Check if update is available
// updateNotifier({ pkg }).notify({ isGlobal: true })
const MIN_NODE_VERSION = `10.13.0`
process.on(`unhandledRejection`, (reason) => {
// This will exit the process in newer Node anyway so lets be consistent
// across versions and crash

View File

@@ -3,8 +3,6 @@ import ora from "ora"
import stackTrace from "stack-trace"
import { ulid } from "ulid"
import winston from "winston"
import * as Transport from "winston-transport"
import { panicHandler } from "./panic-handler"
const LOG_LEVEL = process.env.LOG_LEVEL || "info"
@@ -12,7 +10,7 @@ const LOG_FILE = process.env.LOG_FILE || ""
const NODE_ENV = process.env.NODE_ENV || "development"
const IS_DEV = NODE_ENV.startsWith("dev")
let transports: Transport[] = []
let transports: winston.transport[] = []
if (!IS_DEV) {
transports.push(new winston.transports.Console())

View File

@@ -1,3 +1,4 @@
// @ts-ignore
import ConfigStore from "configstore"
import reporter from "../reporter"