chore: peer dependency version (#8771)

* fix peer dependency version

* dotenv

* commands

* dotenv cli
This commit is contained in:
Carlos R. L. Rodrigues
2024-08-26 16:55:57 -03:00
committed by GitHub
parent afd25846f0
commit 3b4eea08ef
38 changed files with 230 additions and 228 deletions

View File

@@ -43,6 +43,7 @@
"axios": "^0.21.4",
"chalk": "^4.0.0",
"configstore": "5.0.1",
"dotenv": "^16.4.5",
"execa": "^5.1.1",
"fs-exists-cached": "^1.0.0",
"fs-extra": "^10.0.0",
@@ -57,14 +58,14 @@
"pg": "^8.11.3",
"pg-god": "^1.0.12",
"prompts": "^2.4.2",
"resolve-cwd": "^3.0.0",
"semver": "^7.3.8",
"stack-trace": "^0.0.10",
"winston": "^3.8.2",
"yargs": "^15.3.1"
},
"peerDependencies": {
"dotenv": "*",
"ulid": "*"
"ulid": "^2.3.0"
},
"gitHead": "81a7ff73d012fda722f6e9ef0bd9ba0232d37808"
}

View File

@@ -2,10 +2,9 @@ import { sync as existsSync } from "fs-exists-cached"
import { setTelemetryEnabled } from "medusa-telemetry"
import path from "path"
import { didYouMean } from "./did-you-mean"
import { toCamelCase } from "@medusajs/utils"
import resolveCwd from "resolve-cwd"
import { newStarter } from "./commands/new"
import { didYouMean } from "./did-you-mean"
import reporter from "./reporter"
const yargs = require(`yargs`)
@@ -40,9 +39,10 @@ function buildLocalCommands(cli, isLocalProject) {
}
try {
const { Commands } = require("@medusajs/medusa")
const cmdName = toCamelCase(command)
return Commands[cmdName]
const cmdPath = resolveCwd.silent(
`@medusajs/medusa/dist/commands/${command}`
)!
return require(cmdPath).default
} catch (err) {
if (!process.env.NODE_ENV?.startsWith("prod")) {
console.log("--------------- ERROR ---------------------")