Merge pull request #698 from ffflorian/feat/readme-links

feat: Make readme more readable
This commit is contained in:
Nathan Shively-Sanders
2019-11-11 09:22:38 -08:00
committed by Andrew Branch
parent 20477d70a5
commit bb7badea38

View File

@@ -187,18 +187,18 @@ export function createReadme(typing: TypingsData, reg: Registry): string {
lines.push("");
lines.push("# Details");
lines.push(`Files were exported from ${definitelyTypedURL}/tree/${sourceBranch}/types/${typing.subDirectoryPath}`);
lines.push(`Files were exported from ${definitelyTypedURL}/tree/${sourceBranch}/types/${typing.subDirectoryPath}.`);
lines.push("");
lines.push("Additional Details");
lines.push("### Additional Details");
lines.push(` * Last updated: ${(new Date()).toUTCString()}`);
const dependencies = Array.from(typing.dependencies).map(d => getFullNpmName(d.name));
lines.push(` * Dependencies: ${dependencies.length ? dependencies.join(", ") : "none"}`);
lines.push(` * Global values: ${typing.globals.length ? typing.globals.join(", ") : "none"}`);
lines.push(` * Dependencies: ${dependencies.length ? dependencies.map(d => `[${d}](https://npmjs.com/package/${d})`).join(", ") : "none"}`);
lines.push(` * Global values: ${typing.globals.length ? typing.globals.map(g => `\`${g}\``).join(", ") : "none"}`);
lines.push("");
lines.push("# Credits");
const contributors = typing.contributors.map(({ name, url }) => `${name} <${url}>`).join(", ").replace(/, ([^,]+)$/, ", and $1");
const contributors = typing.contributors.map(({ name, url }) => `${name} (${url})`).join(", ").replace(/, ([^,]+)$/, ", and $1");
lines.push(`These definitions were written by ${contributors}.`);
lines.push("");