Skip to content

Commit

Permalink
fix: author in Appstore
Browse files Browse the repository at this point in the history
It seems npmjs no longer provides the author information
from the module's original package.json. Instead let's
use the publisher's username in npmjs instead, as that
seems to be there consistently.
  • Loading branch information
tkurki committed Feb 2, 2025
1 parent 4cd7775 commit 6362e31
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions src/modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,11 @@ interface NpmModuleData {
package: NpmPackageData
}

interface PersonInPackage {
name: string
email: string
}

export interface Package {
name: string
author?: PersonInPackage
contributors?: PersonInPackage[]
publisher?: {
username: string
}
dependencies: { [key: string]: any }
version: string
description: string
Expand Down Expand Up @@ -307,16 +303,9 @@ export function checkForNewServerVersion(
}

export function getAuthor(thePackage: Package): string {
debug(thePackage.name + ' author: ' + thePackage.author)
return (
(thePackage.author && (thePackage.author.name || thePackage.author.email)) +
'' +
(thePackage.contributors || [])
.map((contributor: any) => contributor.name || contributor.email)
.join(',') +
'' +
(thePackage.name.startsWith('@signalk/') ? ' (Signal K team)' : '')
)
return `${thePackage.publisher?.username}${
thePackage.name.startsWith('@signalk/') ? ' (Signal K team)' : ''
}`
}

export function getKeywords(thePackage: NpmPackageData): string[] {
Expand Down

0 comments on commit 6362e31

Please sign in to comment.