diff --git a/registry/src/db.ts b/registry/src/db.ts index 6607d9a..ca55a65 100644 --- a/registry/src/db.ts +++ b/registry/src/db.ts @@ -8,6 +8,7 @@ export interface IPackage { description: string; versions: string[]; deprecated: boolean; + readme: string; } export interface IApiKey { diff --git a/registry/src/http/api.ts b/registry/src/http/api.ts index 56ea7a3..d230ad5 100644 --- a/registry/src/http/api.ts +++ b/registry/src/http/api.ts @@ -113,6 +113,7 @@ async function uploadPackage(ctx: ABC.Context) { owner: ctx.customContext.user, description: meta.description, deprecated: false, + readme: meta.readme, versions: [], }; diff --git a/registry/src/views/package.tsx b/registry/src/views/package.tsx index 1971432..09550a6 100644 --- a/registry/src/views/package.tsx +++ b/registry/src/views/package.tsx @@ -45,14 +45,16 @@ export default async function index({ ); version = getAbsolutePackageVersion(pkg, version); - const readmeContent = await getFile(pkg.name, version, "README.md").then( - (res) => { - if (res) - return Marked.parse(new TextDecoder().decode(res.data)) - .content as string; - else return undefined; - } - ); + const readmeContent = await getFile( + pkg.name, + version, + pkg.readme || "README.md" + ).then((res) => { + if (res) + return Marked.parse(new TextDecoder().decode(res.data)) + .content as string; + else return undefined; + }); return (