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:
Adrien de Peretti
2023-06-28 16:37:25 +02:00
committed by GitHub
parent fe25c8a91f
commit 6f1fa244fa
32 changed files with 244 additions and 521 deletions

View File

@@ -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}"`)
}

View File

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

View File

@@ -1,6 +0,0 @@
import { getMedusaVersion } from "medusa-core-utils"
export const getLocalMedusaVersion = () => {
const version = getMedusaVersion()
return version
}

View File

@@ -0,0 +1,5 @@
import { getMedusaVersion } from "medusa-core-utils"
export const getLocalMedusaVersion = (): string => {
return getMedusaVersion()
}