This commit is contained in:
be5invis 2022-06-27 20:38:01 -07:00
parent 76e258ef77
commit 99fdf500eb
6 changed files with 43 additions and 61 deletions

View file

@ -97,7 +97,7 @@ async function saveTTF(argv, font) {
generateDummyDigitalSignature: true
});
const buf = FontIo.writeSfntOtf(sfnt);
await fs.writeFile(argv.o, buf);
await fs.promises.writeFile(argv.o, buf);
}
// Save character map file

View file

@ -3,6 +3,7 @@
const path = require("path");
const fs = require("fs");
const semver = require("semver");
const { Output } = require("./shared/index");
const ChangeFileDir = path.join(__dirname, "../../changes");
const ModifiedSinceVersion = "2.x";
@ -15,15 +16,6 @@ module.exports = async function main(argv) {
await fs.writeFile(argv.outputPath, out.buffer);
};
class Output {
constructor() {
this.buffer = "";
}
log(...s) {
this.buffer += s.join("") + "\n";
}
}
async function GenerateChangeList(argv, out) {
const changeFiles = await fs.promises.readdir(ChangeFileDir);
const fragments = new Map();

View file

@ -2,6 +2,7 @@
const path = require("path");
const fs = require("fs");
const { Output } = require("./shared/index");
///////////////////////////////////////////////////////////////////////////////////////////////////
@ -15,15 +16,6 @@ module.exports = async function main(argv) {
await fs.promises.writeFile(argv.outputPath, out.buffer);
};
class Output {
constructor() {
this.buffer = "";
}
log(...s) {
this.buffer += s.join("") + "\n";
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////
// Copy Markdown

View file

@ -3,6 +3,7 @@
const path = require("path");
const fs = require("fs");
const SemVer = require("semver");
const { Output } = require("./shared/index");
const ChangeFileDir = path.join(__dirname, "../../changes");
@ -26,26 +27,6 @@ module.exports = async function main(argv) {
await fs.promises.writeFile(argv.outputPath, out.buffer);
};
class Output {
constructor() {
this.buffer = "";
}
log(...s) {
this.buffer += s.join("") + "\n";
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////
// Copy Markdown
async function CopyMarkdown(out, name) {
const content = await fs.promises.readFile(
path.resolve(__dirname, `release-note-fragments/${name}`),
"utf8"
);
out.log(content);
}
///////////////////////////////////////////////////////////////////////////////////////////////////
// CHANGE LIST

View file

@ -0,0 +1,12 @@
"use strict";
class Output {
constructor() {
this.buffer = "";
}
log(...s) {
this.buffer += s.join("") + "\n";
}
}
exports.Output = Output;

View file

@ -747,26 +747,31 @@ const PagesFastFontExport = task.group(`pages:fast-font-export`, async (target,
// README
const AmendReadme = task("amend-readme", async target => {
await target.need(
AmendReadmeFor("README.md"),
AmendReadmeFor("doc/stylistic-sets.md"),
AmendReadmeFor("doc/character-variants.md"),
AmendReadmeFor("doc/custom-build.md"),
AmendReadmeFor("doc/language-specific-ligation-sets.md")
);
});
const AmendReadmeFor = task.make(
f => `amend-readme::for::${f}`,
async (target, f) => {
await target.need(Parameters, UtilScripts);
const [cm, cmi, cmo] = await target.need(
BuildCM("iosevka", "iosevka-regular"),
BuildCM("iosevka", "iosevka-italic"),
BuildCM("iosevka", "iosevka-oblique")
);
await amendReadmeFor("README.md", cm, cmi, cmo);
await amendReadmeFor("doc/stylistic-sets.md", cm, cmi, cmo);
await amendReadmeFor("doc/character-variants.md", cm, cmi, cmo);
await amendReadmeFor("doc/custom-build.md", cm, cmi, cmo);
await amendReadmeFor("doc/language-specific-ligation-sets.md", cm, cmi, cmo);
});
async function amendReadmeFor(md, cm, cmi, cmo) {
return node(`utility/amend-readme/index`, {
mdFilePath: md,
mdFilePath: f,
charMapPath: cm.full,
charMapItalicPath: cmi.full,
charMapObliquePath: cmo.full
});
}
}
);
///////////////////////////////////////////////////////////
// Sample Images
@ -834,7 +839,7 @@ const ReleaseNotesFile = file.make(
await t.need(Version, UtilScripts, de(ARCHIVE_DIR));
const [changeFiles, rpFiles] = await t.need(ChangeFileList(), ReleaseNotePackagesFile);
await t.need(changeFiles.map(fu));
await node("utility/generate-release-note/index", {
await node("utility/generate-release-note/release-note", {
version,
releasePackagesJsonPath: rpFiles.full,
outputPath: out.full
@ -879,14 +884,14 @@ const ReleaseNotePackagesFile = file(`${BUILD}/release-packages.json`, async (t,
await fs.promises.writeFile(out.full, JSON.stringify(releaseNoteGroups, null, " "));
});
const ChangeLog = task(`release:change-log`, async t => {
await t.need(ChangeLogFile);
await t.need(ChangeLogMd);
});
const ChangeLogFile = file(`CHANGELOG.md`, async (t, out) => {
const ChangeLogMd = file(`CHANGELOG.md`, async (t, out) => {
const [version] = await t.need(Version);
await t.need(UtilScripts, de(ARCHIVE_DIR));
const [changeFiles] = await t.need(ChangeFileList());
await t.need(changeFiles.map(fu));
await node("utility/generate-change-log/index", { version, outputPath: out.full });
await node("utility/generate-release-note/change-log", { version, outputPath: out.full });
});
const ChangeFileList = oracle.make(
() => `release:change-file-list`,