Skip to content

Commit 300c102

Browse files
author
Rishi Raj Jain
committed
remvoe axios and use node-fetch
1 parent 9e0b152 commit 300c102

File tree

2 files changed

+57
-7
lines changed

2 files changed

+57
-7
lines changed

packages/cli/src/commands/update.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import fs from "fs";
22
import path from "path";
3-
import axios from "axios";
3+
import fetch from "node-fetch";
44
import inquirer from "inquirer";
55
import { installDependencies } from "../utils/installDependencies.js";
66

@@ -28,8 +28,9 @@ export async function updateCommand(projectPath: string) {
2828
const newVersions = await Promise.all(
2929
triggerPackages.map(async (packageName) => {
3030
try {
31-
const response = await axios.get(`https://registry.npmjs.org/${packageName}`);
32-
const latestVersion = response.data["dist-tags"].latest;
31+
const response = await fetch(`https://registry.npmjs.org/${packageName}`);
32+
const data = await response.json();
33+
const latestVersion = data["dist-tags"].latest;
3334
return { packageName, latestVersion };
3435
} catch (error) {
3536
// @ts-ignore

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)