1
1
import fs from "fs" ;
2
2
import path from "path" ;
3
3
import inquirer from "inquirer" ;
4
- import ncu from "npm-check-updates" ;
4
+ import { run , RunOptions } from "npm-check-updates" ;
5
5
import { installDependencies } from "../utils/installDependencies.js" ;
6
6
import { Index } from "npm-check-updates/build/src/types/IndexType.js" ;
7
7
@@ -14,7 +14,7 @@ function getPackageJSON(projectPath: string) {
14
14
return JSON . parse ( fs . readFileSync ( packageJsonPath , "utf8" ) ) ;
15
15
}
16
16
17
- function setPackageJSON ( projectPath : string , updatedPackageJSON : Object ) {
17
+ function setPackageJSON ( projectPath : string , updatedPackageJSON : Index ) {
18
18
const packageJsonPath = path . join ( projectPath , "package.json" ) ;
19
19
if ( ! fs . existsSync ( packageJsonPath ) ) {
20
20
console . error ( `package.json not found in the ${ projectPath } directory.` ) ;
@@ -25,7 +25,7 @@ function setPackageJSON(projectPath: string, updatedPackageJSON: Object) {
25
25
}
26
26
27
27
export async function updateCommand ( projectPath : string ) {
28
- const triggerDevPackage = "" ;
28
+ const triggerDevPackage = "@trigger.dev " ;
29
29
const packageData = getPackageJSON ( projectPath ) ;
30
30
31
31
if ( ! packageData ) {
@@ -46,15 +46,15 @@ export async function updateCommand(projectPath: string) {
46
46
} ) ;
47
47
48
48
// Use npm-check-updates to get updated dependency versions
49
- const ncuOptions = {
49
+ const ncuOptions : RunOptions = {
50
50
packageData,
51
51
upgrade : true ,
52
52
jsonUpgraded : true ,
53
53
} ;
54
54
55
55
// Can either give a json like package.json or just with deps and their new versions
56
56
const updatedDependencies : Index | void = await new Promise ( ( resolve , reject ) =>
57
- ncu ( ncuOptions ) . then ( resolve ) . catch ( reject )
57
+ run ( ncuOptions ) . then ( resolve ) . catch ( reject )
58
58
) ;
59
59
60
60
if ( ! updatedDependencies ) return ;
0 commit comments