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() {
|
getCliVersion() {
|
||||||
try {
|
try {
|
||||||
const jsonfile = join(
|
const jsonfile = join(
|
||||||
require
|
require.resolve(`@medusajs/cli`).split(`${sep}dist`).shift(),
|
||||||
.resolve(`@medusajs/medusa-cli`) // Resolve where current gatsby-cli would be loaded from.
|
"package.json"
|
||||||
.split(sep)
|
|
||||||
.slice(0, -2) // drop lib/index.js
|
|
||||||
.join(sep),
|
|
||||||
`package.json`
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const { version } = require(jsonfile)
|
const { version } = require(jsonfile)
|
||||||
return version
|
return version
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
"description": "Building blocks for digital commerce",
|
"description": "Building blocks for digital commerce",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
"./package.json": "./package.json",
|
||||||
".": "./dist/index.js",
|
".": "./dist/index.js",
|
||||||
"./types": "./dist/types/index.js",
|
"./types": "./dist/types/index.js",
|
||||||
"./utils": "./dist/utils/index.js",
|
"./utils": "./dist/utils/index.js",
|
||||||
|
|||||||
Reference in New Issue
Block a user