Skip to content

Commit 17b15e0

Browse files
committed
working
1 parent 07eca6d commit 17b15e0

File tree

3 files changed

+3
-83
lines changed

3 files changed

+3
-83
lines changed

lib/commands/info/index.js

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import chalk from 'chalk'
44
import meow from 'meow'
5-
import fetch from 'node-fetch'
65
import ora from 'ora'
76

87
import { outputFlags, validationFlags } from '../../flags/index.js'
@@ -48,9 +47,9 @@ export const info = {
4847
* @param {string} description
4948
* @param {readonly string[]} argv
5049
* @param {ImportMeta} importMeta
51-
* @returns {Promise<void|CommandContext>}
50+
* @returns {void|CommandContext}
5251
*/
53-
async function setupCommand (name, description, argv, importMeta) {
52+
function setupCommand (name, description, argv, importMeta) {
5453
const flags = {
5554
...outputFlags,
5655
...validationFlags,
@@ -95,19 +94,8 @@ async function setupCommand (name, description, argv, importMeta) {
9594

9695
let pkgVersion, pkgName
9796
if (versionSeparator < 1) {
98-
// Get the latest version
99-
try {
10097
pkgName = rawPkgName
101-
const response = await fetch(`https://registry.npmjs.org/${rawPkgName}/latest`)
102-
/** @type any */
103-
const packageDetails = await response.json() || null
104-
105-
if (packageDetails?.version) {
106-
pkgVersion = packageDetails.version
107-
}
108-
} catch (e) {
109-
throw new Error('Issue fetching package version')
110-
}
98+
pkgVersion = 'latest'
11199
} else {
112100
pkgName = rawPkgName.slice(0, versionSeparator)
113101
pkgVersion = rawPkgName.slice(versionSeparator + 1)

package-lock.json

Lines changed: 0 additions & 67 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@
9191
"is-interactive": "^2.0.0",
9292
"is-unicode-supported": "^1.3.0",
9393
"meow": "^12.0.1",
94-
"node-fetch": "^3.3.2",
9594
"ora": "^6.1.2",
9695
"pony-cause": "^2.1.8",
9796
"prompts": "^2.4.2",

0 commit comments

Comments
 (0)