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;
|
description: string;
|
||||||
versions: string[];
|
versions: string[];
|
||||||
deprecated: boolean;
|
deprecated: boolean;
|
||||||
|
readme: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IApiKey {
|
export interface IApiKey {
|
||||||
|
@ -113,6 +113,7 @@ async function uploadPackage(ctx: ABC.Context) {
|
|||||||
owner: ctx.customContext.user,
|
owner: ctx.customContext.user,
|
||||||
description: meta.description,
|
description: meta.description,
|
||||||
deprecated: false,
|
deprecated: false,
|
||||||
|
readme: meta.readme,
|
||||||
versions: [],
|
versions: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -45,14 +45,16 @@ export default async function index({
|
|||||||
);
|
);
|
||||||
|
|
||||||
version = getAbsolutePackageVersion(pkg, version);
|
version = getAbsolutePackageVersion(pkg, version);
|
||||||
const readmeContent = await getFile(pkg.name, version, "README.md").then(
|
const readmeContent = await getFile(
|
||||||
(res) => {
|
pkg.name,
|
||||||
|
version,
|
||||||
|
pkg.readme || "README.md"
|
||||||
|
).then((res) => {
|
||||||
if (res)
|
if (res)
|
||||||
return Marked.parse(new TextDecoder().decode(res.data))
|
return Marked.parse(new TextDecoder().decode(res.data))
|
||||||
.content as string;
|
.content as string;
|
||||||
else return undefined;
|
else return undefined;
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Base title={"DenReg - " + pkg.name}>
|
<Base title={"DenReg - " + pkg.name}>
|
||||||
|
Loading…
Reference in New Issue
Block a user