Skip to content

Commit

Permalink
feat(ranking): add popularAlternativeNames, detect security packages (#…
Browse files Browse the repository at this point in the history
…975)

Co-authored-by: Martin Kolárik <[email protected]>
Co-authored-by: Haroen Viaene <[email protected]>
  • Loading branch information
3 people authored May 30, 2022
1 parent 011a174 commit 62f82e4
Show file tree
Hide file tree
Showing 9 changed files with 605 additions and 180 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ For every single NPM package, we create a record in the Algolia index. The resul
deprecated: 'Deprecated', // This field will be removed, please use `isDeprecated` instead
isDeprecated: true,
deprecatedReason: 'Deprecated',
isSecurityHeld: false, // See https://github.com/npm/security-holder
badPackage: false,
homepage: 'https://babeljs.io/',
license: 'MIT',
Expand Down
7 changes: 7 additions & 0 deletions src/@types/pkg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface Repo {
head?: string;
branch?: string;
}

export interface GithubRepo {
user: string;
project: string;
Expand Down Expand Up @@ -48,6 +49,7 @@ export interface RawPkg {
downloadsLast30Days: number;
downloadsRatio: number;
humanDownloadsLast30Days: string;
jsDelivrHits: number;
popular: boolean;
version: string;
versions: Record<string, string>;
Expand All @@ -64,6 +66,7 @@ export interface RawPkg {
deprecated: boolean | string;
isDeprecated: boolean;
deprecatedReason: string | null;
isSecurityHeld: boolean;
homepage: string | null;
license: string | null;
keywords: string[];
Expand All @@ -74,13 +77,17 @@ export interface RawPkg {
lastPublisher: Owner | null;
owners: Owner[];
bin: Record<string, string>;
dependents: number;
types: TsType;
moduleTypes: ModuleType[];
styleTypes: StyleType[];
humanDependents: string;
changelogFilename: string | null;
lastCrawl: string;
_searchInternal: {
expiresAt: number;
alternativeNames: string[];
popularAlternativeNames: string[];
};
}

Expand Down
Loading

0 comments on commit 62f82e4

Please sign in to comment.