Adding support for readme field in meta.json to registry
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
d1244ac0a7
commit
c9bd5c7d18
@ -8,6 +8,7 @@ export interface IPackage {
|
||||
description: string;
|
||||
versions: string[];
|
||||
deprecated: boolean;
|
||||
readme: string;
|
||||
}
|
||||
|
||||
export interface IApiKey {
|
||||
|
@ -113,6 +113,7 @@ async function uploadPackage(ctx: ABC.Context) {
|
||||
owner: ctx.customContext.user,
|
||||
description: meta.description,
|
||||
deprecated: false,
|
||||
readme: meta.readme,
|
||||
versions: [],
|
||||
};
|
||||
|
||||
|
@ -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 (
|
||||
<Base title={"DenReg - " + pkg.name}>
|
||||
|
Loading…
Reference in New Issue
Block a user