Skip to content

Commit

Permalink
chore: update type
Browse files Browse the repository at this point in the history
  • Loading branch information
fireairforce committed Oct 23, 2023
1 parent 091ad04 commit 4ed3294
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions reviewing/plugin-commands-outdated/package.json
Expand Up @@ -12,6 +12,7 @@
"node": ">=16.14"
},
"scripts": {
"start": "tsc --watch",
"lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
"_test": "cross-env PNPM_REGISTRY_MOCK_PORT=7781 jest",
"test": "pnpm run compile && pnpm run _test",
Expand Down
2 changes: 1 addition & 1 deletion reviewing/plugin-commands-outdated/src/outdated.ts
Expand Up @@ -283,7 +283,7 @@ function renderOutdatedJSON (outdatedPackages: readonly OutdatedPackage[], opts:
latest: outdatedPkg.latestManifest?.version,
wanted: outdatedPkg.wanted,
isDeprecated: Boolean(outdatedPkg.latestManifest?.deprecated),
dependencyType: outdatedPkg.belongsTo,
dependencyType: outdatedPkg.belongsTo as DependenciesField,
}
if (opts.long) {
acc[outdatedPkg.packageName].latestManifest = outdatedPkg.latestManifest
Expand Down
6 changes: 3 additions & 3 deletions reviewing/plugin-commands-outdated/src/recursive.ts
Expand Up @@ -34,11 +34,11 @@ const DEP_PRIORITY: Record<DependenciesField, number> = {
const COMPARATORS = [
...DEFAULT_COMPARATORS,
(o1: OutdatedInWorkspace, o2: OutdatedInWorkspace) =>
DEP_PRIORITY[o1.belongsTo] - DEP_PRIORITY[o2.belongsTo],
DEP_PRIORITY[o1.belongsTo as DependenciesField] - DEP_PRIORITY[o2.belongsTo as DependenciesField],
]

interface OutdatedInWorkspace extends OutdatedPackage {
belongsTo: DependenciesField
belongsTo: DependenciesField | 'packageManager'
current?: string
dependentPkgs: Array<{ location: string, manifest: ProjectManifest }>
latest?: string
Expand Down Expand Up @@ -188,7 +188,7 @@ function renderOutdatedJSON (
latest: outdatedPkg.latestManifest?.version,
wanted: outdatedPkg.wanted,
isDeprecated: Boolean(outdatedPkg.latestManifest?.deprecated),
dependencyType: outdatedPkg.belongsTo,
dependencyType: outdatedPkg.belongsTo as DependenciesField,
dependentPackages: outdatedPkg.dependentPkgs.map(({ manifest, location }) => ({ name: manifest.name!, location })),
}
if (opts.long) {
Expand Down

0 comments on commit 4ed3294

Please sign in to comment.