chore: Start cleaning up medusa-core-utils (#7450)
**What** - remove medusa-core-utils - dispatch the utils where they belongs - update usage **NOTE** I have been wondering if the graceful class should go into the utils package or medusa package, I ve put it in the medusa package as it seems to be the best place I can see for now and is tight to the server as well. Also, I wanted to avoid the utils package to depends on http and net dependencies, happy to change that if you feel like it
This commit is contained in:
committed by
GitHub
parent
28a3f9a3df
commit
b8bc3ed16f
@@ -52,7 +52,6 @@
|
||||
"inquirer": "^8.0.0",
|
||||
"is-valid-path": "^0.1.1",
|
||||
"meant": "^1.0.3",
|
||||
"medusa-core-utils": "^1.2.0",
|
||||
"medusa-telemetry": "^0.0.17",
|
||||
"open": "^8.0.6",
|
||||
"ora": "^5.4.1",
|
||||
|
||||
@@ -4,7 +4,6 @@ import path from "path"
|
||||
import resolveCwd from "resolve-cwd"
|
||||
|
||||
import { didYouMean } from "./did-you-mean"
|
||||
import { getLocalMedusaVersion } from "./util/version"
|
||||
|
||||
import { newStarter } from "./commands/new"
|
||||
import reporter from "./reporter"
|
||||
@@ -362,7 +361,17 @@ function getVersionInfo() {
|
||||
const { version } = require(`../package.json`)
|
||||
const isMedusaProject = isLocalMedusaProject()
|
||||
if (isMedusaProject) {
|
||||
let medusaVersion = getLocalMedusaVersion()
|
||||
let medusaVersion = ""
|
||||
try {
|
||||
medusaVersion = require(path.join(
|
||||
process.cwd(),
|
||||
`node_modules`,
|
||||
`@medusajs/medusa`,
|
||||
`package.json`
|
||||
)).version
|
||||
} catch (e) {
|
||||
/* noop */
|
||||
}
|
||||
|
||||
if (!medusaVersion) {
|
||||
medusaVersion = `unknown`
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
import { getMedusaVersion } from "medusa-core-utils"
|
||||
|
||||
export const getLocalMedusaVersion = (): string => {
|
||||
return getMedusaVersion()
|
||||
}
|
||||
Reference in New Issue
Block a user