Skip to content

Commit 1bf8454

Browse files
author
Rishi Raj Jain
committed
add types
1 parent ce95744 commit 1bf8454

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/cli/src/commands/update.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fs from "fs";
22
import path from "path";
33
import inquirer from "inquirer";
4-
import ncu from "npm-check-updates";
4+
import { run, RunOptions } from "npm-check-updates";
55
import { installDependencies } from "../utils/installDependencies.js";
66
import { Index } from "npm-check-updates/build/src/types/IndexType.js";
77

@@ -14,7 +14,7 @@ function getPackageJSON(projectPath: string) {
1414
return JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
1515
}
1616

17-
function setPackageJSON(projectPath: string, updatedPackageJSON: Object) {
17+
function setPackageJSON(projectPath: string, updatedPackageJSON: Index) {
1818
const packageJsonPath = path.join(projectPath, "package.json");
1919
if (!fs.existsSync(packageJsonPath)) {
2020
console.error(`package.json not found in the ${projectPath} directory.`);
@@ -25,7 +25,7 @@ function setPackageJSON(projectPath: string, updatedPackageJSON: Object) {
2525
}
2626

2727
export async function updateCommand(projectPath: string) {
28-
const triggerDevPackage = "";
28+
const triggerDevPackage = "@trigger.dev";
2929
const packageData = getPackageJSON(projectPath);
3030

3131
if (!packageData) {
@@ -46,15 +46,15 @@ export async function updateCommand(projectPath: string) {
4646
});
4747

4848
// Use npm-check-updates to get updated dependency versions
49-
const ncuOptions = {
49+
const ncuOptions: RunOptions = {
5050
packageData,
5151
upgrade: true,
5252
jsonUpgraded: true,
5353
};
5454

5555
// Can either give a json like package.json or just with deps and their new versions
5656
const updatedDependencies: Index | void = await new Promise((resolve, reject) =>
57-
ncu(ncuOptions).then(resolve).catch(reject)
57+
run(ncuOptions).then(resolve).catch(reject)
5858
);
5959

6060
if (!updatedDependencies) return;

0 commit comments

Comments
 (0)