11import fs from "fs" ;
22import path from "path" ;
33import inquirer from "inquirer" ;
4- import ncu from "npm-check-updates" ;
4+ import { run , RunOptions } from "npm-check-updates" ;
55import { installDependencies } from "../utils/installDependencies.js" ;
66import { 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
2727export 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