fix(telemetry): Pointing and resolving packages wrongly (#9939)
FIXES FRMW-2764 **What** - Fix wrong CLI package - Fix package.json path resolution
This commit is contained in:
committed by
GitHub
parent
674c86eaa0
commit
de228d209f
6
.changeset/eleven-students-cover.md
Normal file
6
.changeset/eleven-students-cover.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@medusajs/telemetry": patch
|
||||
"@medusajs/medusa": patch
|
||||
---
|
||||
|
||||
fix(telemetry): Pointing and resolving packages wrongly
|
||||
@@ -96,14 +96,9 @@ class Telemeter {
|
||||
getCliVersion() {
|
||||
try {
|
||||
const jsonfile = join(
|
||||
require
|
||||
.resolve(`@medusajs/medusa-cli`) // Resolve where current gatsby-cli would be loaded from.
|
||||
.split(sep)
|
||||
.slice(0, -2) // drop lib/index.js
|
||||
.join(sep),
|
||||
`package.json`
|
||||
require.resolve(`@medusajs/cli`).split(`${sep}dist`).shift(),
|
||||
"package.json"
|
||||
)
|
||||
|
||||
const { version } = require(jsonfile)
|
||||
return version
|
||||
} catch (e) {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"description": "Building blocks for digital commerce",
|
||||
"main": "dist/index.js",
|
||||
"exports": {
|
||||
"./package.json": "./package.json",
|
||||
".": "./dist/index.js",
|
||||
"./types": "./dist/types/index.js",
|
||||
"./utils": "./dist/utils/index.js",
|
||||
|
||||
Reference in New Issue
Block a user