chore(medusa-cli): Cleanup plugin setup (#4420)
* chore(medusa-cli): Cleanup plugin setup * fix: logger types * fix event bus local * fix event bus redis * Create late-dragons-collect.md * move to ts * remove unused command * env * fix
This commit is contained in:
committed by
GitHub
parent
fe25c8a91f
commit
6f1fa244fa
@@ -1,22 +1,15 @@
|
||||
import ConfigStore from "configstore"
|
||||
import reporter from "../reporter"
|
||||
|
||||
let config
|
||||
const config = new ConfigStore(`medusa`, {}, { globalConfigPath: true })
|
||||
|
||||
const packageMangerConfigKey = `cli.packageManager`
|
||||
|
||||
export const getPackageManager = () => {
|
||||
if (!config) {
|
||||
config = new ConfigStore(`medusa`, {}, { globalConfigPath: true })
|
||||
}
|
||||
|
||||
return config.get(packageMangerConfigKey)
|
||||
}
|
||||
|
||||
export const setPackageManager = packageManager => {
|
||||
if (!config) {
|
||||
config = new ConfigStore(`medusa`, {}, { globalConfigPath: true })
|
||||
}
|
||||
export const setPackageManager = (packageManager) => {
|
||||
config.set(packageMangerConfigKey, packageManager)
|
||||
reporter.info(`Preferred package manager set to "${packageManager}"`)
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
const ConfigStore = require("configstore")
|
||||
|
||||
let config
|
||||
|
||||
module.exports = {
|
||||
getToken: function() {
|
||||
if (!config) {
|
||||
config = new ConfigStore(`medusa`, {}, { globalConfigPath: true })
|
||||
}
|
||||
|
||||
return config.get("cloud.login_token")
|
||||
},
|
||||
setToken: function(token) {
|
||||
if (!config) {
|
||||
config = new ConfigStore(`medusa`, {}, { globalConfigPath: true })
|
||||
}
|
||||
|
||||
return config.set("cloud.login_token", token)
|
||||
},
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
import { getMedusaVersion } from "medusa-core-utils"
|
||||
|
||||
export const getLocalMedusaVersion = () => {
|
||||
const version = getMedusaVersion()
|
||||
return version
|
||||
}
|
||||
5
packages/medusa-cli/src/util/version.ts
Normal file
5
packages/medusa-cli/src/util/version.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { getMedusaVersion } from "medusa-core-utils"
|
||||
|
||||
export const getLocalMedusaVersion = (): string => {
|
||||
return getMedusaVersion()
|
||||
}
|
||||
Reference in New Issue
Block a user