File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import chalk from 'chalk';
22
33import { PatchPulseConfig , shouldSkipPackage } from '../services/config' ;
44import { getLatestVersion } from '../services/npm' ;
5- import { type DependencyInfo } from '../types' ;
5+ import { UpdateType , type DependencyInfo } from '../types' ;
66import { ProgressSpinner } from '../ui/progress' ;
77import { getUpdateType } from '../utils/getUpdateType' ;
88import { isVersionOutdated } from '../utils/isVersionOutdated' ;
@@ -36,7 +36,7 @@ export async function checkDependencyVersions(
3636
3737 let latestVersion : string | undefined ;
3838 let isOutdated = false ;
39- let updateType : 'patch' | 'minor' | 'major' | undefined ;
39+ let updateType : UpdateType | undefined ;
4040
4141 if ( ! isSkipped ) {
4242 latestVersion = await getLatestVersion ( packageName ) ;
Original file line number Diff line number Diff line change 11export type PackageManager = 'npm' | 'pnpm' | 'yarn' | 'bun' ;
22
3+ export type UpdateType = 'patch' | 'minor' | 'major' ;
4+
35export interface PackageJson {
46 dependencies ?: Record < string , string > ;
57 devDependencies ?: Record < string , string > ;
@@ -13,7 +15,7 @@ export interface DependencyInfo {
1315 currentVersion : string ;
1416 latestVersion ?: string ;
1517 isOutdated : boolean ;
16- updateType ?: 'patch' | 'minor' | 'major' ;
18+ updateType ?: UpdateType ;
1719 isSkipped ?: boolean ;
1820 category ?: string ;
1921}
@@ -26,7 +28,7 @@ export interface UpdateableDependency {
2628 packageName : string ;
2729 currentVersion : string ;
2830 latestVersion : string ;
29- updateType : 'patch' | 'minor' | 'major' ;
31+ updateType : UpdateType ;
3032 category : string ;
3133}
3234
Original file line number Diff line number Diff line change 11import chalk from 'chalk' ;
2+ import { UpdateType } from '../types' ;
23import { parseVersion } from './parseVersion' ;
34
45interface GetUpdateTypeArgs {
@@ -19,7 +20,7 @@ interface GetUpdateTypeArgs {
1920export function getUpdateType ( {
2021 current,
2122 latest,
22- } : GetUpdateTypeArgs ) : 'patch' | 'minor' | 'major' {
23+ } : GetUpdateTypeArgs ) : UpdateType {
2324 try {
2425 const currentVersion = parseVersion ( current ) ;
2526 const latestVersion = parseVersion ( latest ) ;
You can’t perform that action at this time.
0 commit comments