Add package deprecation
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
81213a9aba
commit
5337b44b11
@ -7,6 +7,7 @@ export interface IPackage {
|
||||
author: string;
|
||||
description: string;
|
||||
versions: string[];
|
||||
deprecated: boolean;
|
||||
}
|
||||
|
||||
export interface IApiKey {
|
||||
|
@ -103,6 +103,7 @@ async function uploadPackage(ctx: ABC.Context) {
|
||||
name: packageName,
|
||||
author: meta.author,
|
||||
description: meta.description,
|
||||
deprecated: false,
|
||||
versions: [],
|
||||
};
|
||||
|
||||
@ -149,6 +150,7 @@ async function uploadPackage(ctx: ABC.Context) {
|
||||
versions: [...packageMeta.versions, packageVersion],
|
||||
author: meta.author || packageMeta.author,
|
||||
description: meta.description || packageMeta.description,
|
||||
deprecated: meta.deprecated === true,
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -5,7 +5,7 @@ import DB, { IPackage } from "../db.ts";
|
||||
import { sortVersions } from "../utils.ts";
|
||||
|
||||
function Package({ pkg }: { pkg: IPackage }) {
|
||||
const { name, versions, author, description } = pkg;
|
||||
const { name, versions, author, description, deprecated } = pkg;
|
||||
|
||||
const sorted = versions.sort(sortVersions).reverse();
|
||||
|
||||
@ -17,6 +17,7 @@ function Package({ pkg }: { pkg: IPackage }) {
|
||||
<div class="card-body">
|
||||
<h4 class="card-title">
|
||||
{name} <span class="badge">{sorted[0]}</span>
|
||||
{deprecated && <span class="badge warning">deprecated</span>}
|
||||
</h4>
|
||||
<h5 class="card-subtitle">By {author}</h5>
|
||||
<div class="card-text">
|
||||
|
Loading…
Reference in New Issue
Block a user