diff --git a/gen/generator.js b/gen/index.js similarity index 78% rename from gen/generator.js rename to gen/index.js index 51a31ca9a..21d49fe5b 100644 --- a/gen/generator.js +++ b/gen/index.js @@ -3,28 +3,18 @@ const fs = require("fs-extra"); const path = require("path"); -const argv = require("yargs").argv; const buildFont = require("./build-font.js"); -const EmptyFont = require("./empty-font.js"); const parameters = require("../support/parameters"); const formVariantData = require("../support/variant-data"); const formLigationData = require("../support/ligation-data"); -const regulateGlyphs = require("../support/regulate-glyph"); const toml = require("toml"); -main().catch(e => { - console.error(e); - process.exit(1); -}); - -/////////////////////////////////////////////////////////////////////////////////////////////////// - -async function main() { +module.exports = async function main(argv) { const para = await getParameters(argv); const font = buildFont(para); - if (argv.charmap) await saveCharMap(font); - if (argv.o) await saveOtd(font); -} + if (argv.charmap) await saveCharMap(argv, font); + if (argv.o) await saveOtd(argv, font); +}; // Parameter preparation async function getParameters(argv) { @@ -41,23 +31,23 @@ async function getParameters(argv) { const rawVariantsData = await tryParseToml(VARIANTS_TOML); const rawLigationData = await tryParseToml(LIGATIONS_TOML); - const para = parameters.build(parametersData, argv._, { "shape-weight": argv["shape-weight"] }); + const para = parameters.build(parametersData, argv.hives, { shapeWeight: argv.shapeWeight }); const variantsData = formVariantData(rawVariantsData, para); para.variants = variantsData; - para.variantSelector = parameters.build(variantsData, ["default", ...argv._]); + para.variantSelector = parameters.build(variantsData, ["default", ...argv.hives]); para.defaultVariant = variantsData.default; const ligationData = formLigationData(rawLigationData, para); para.defaultBuildup = ligationData.defaultBuildup; - para.ligation = parameters.build(ligationData.hives, ["default", ...argv._]); + para.ligation = parameters.build(ligationData.hives, ["default", ...argv.hives]); para.naming = { family: argv.family, - version: argv.ver, - weight: argv["menu-weight"] - 0, - width: argv["menu-width"] - 0, - slant: argv["menu-slant"] + version: argv.version, + weight: argv.menuWeight - 0, + width: argv.menuWidth - 0, + slant: argv.menuSlant }; return para; @@ -74,7 +64,7 @@ async function tryParseToml(str) { } // Save OTD -async function saveOtd(font) { +async function saveOtd(argv, font) { if (argv.o === "|") { process.stdout.write(JSON.stringify(font)); } else { @@ -89,7 +79,7 @@ function objHashNonEmpty(obj) { return false; } -async function saveCharMap(font) { +async function saveCharMap(argv, font) { let charMap = []; for (const gid in font.glyf) { const glyph = font.glyf[gid]; diff --git a/package.json b/package.json index 6ca711c06..44431a70f 100644 --- a/package.json +++ b/package.json @@ -21,8 +21,7 @@ "ttf2woff2": "^3.0.0", "unorm": "^1.6.0", "verda": "^1.0.1", - "fs-extra": "^9.0.0", - "yargs": "^15.3.1" + "fs-extra": "^9.0.0" }, "devDependencies": { "cldr": "^5.5.4", diff --git a/parameters.toml b/parameters.toml index c0f78d9cb..473a0f603 100644 --- a/parameters.toml +++ b/parameters.toml @@ -64,7 +64,7 @@ enableLigation = true # Excluded code points excludedCodePointRanges = [] -[shape-weight.blend.400] +[shapeWeight.blend.400] stroke = 72 # Primary stroke width sb = 60 # Primary sidebearings essx = 1.12 # Proportion of widen of center of "S" @@ -110,7 +110,7 @@ cthinb = 0.5 vtipfine = 0.8 vtipfineSlab = 0.9 -[shape-weight.blend.100] +[shapeWeight.blend.100] jut = 85 vjut = 145 smooth = 195 @@ -127,7 +127,7 @@ sb = 72 dotsize = 53 periodsize = 55 -[shape-weight.blend.200] +[shapeWeight.blend.200] jut = 85 vjut = 145 smooth = 195 @@ -144,7 +144,7 @@ sb = 68 dotsize = 70 periodsize = 77 -[shape-weight.blend.300] +[shapeWeight.blend.300] jut = 85 vjut = 145 smooth = 195 @@ -161,7 +161,7 @@ sb = 64 dotsize = 100 periodsize = 115 -[shape-weight.blend.500] +[shapeWeight.blend.500] essx = 1.12 jut = 85 vjut = 157 @@ -175,7 +175,7 @@ sb = 57 dotsize = 135 periodsize = 160 -[shape-weight.blend.600] +[shapeWeight.blend.600] essx = 1.07 jut = 85 vjut = 170 @@ -189,7 +189,7 @@ sb = 54 dotsize = 145 periodsize = 168 -[shape-weight.blend.700] +[shapeWeight.blend.700] essx = 1.06 jut = 89 vjut = 179 @@ -203,7 +203,7 @@ sb = 50 dotsize = 157 periodsize = 180 -[shape-weight.blend.800] +[shapeWeight.blend.800] essx = 1.05 jut = 96 vjut = 189 @@ -217,7 +217,7 @@ sb = 45 dotsize = 167 periodsize = 188 -[shape-weight.blend.900] +[shapeWeight.blend.900] essx = 1.03 jut = 100 vjut = 199 diff --git a/snapshot/get-snap.js b/snapshot/get-snap.js index cb3eda36b..c71d26844 100644 --- a/snapshot/get-snap.js +++ b/snapshot/get-snap.js @@ -1,5 +1,5 @@ const { app, BrowserWindow } = require("electron"); -let argv = require("yargs").argv; +let argDir = process.argv[2]; let fs = require("fs"); let cp = require("child_process"); @@ -12,7 +12,7 @@ function checkQuit() { if (allWindowClosed && pendingTasks == 0) app.quit(); } -app.on("window-all-closed", function() { +app.on("window-all-closed", function () { allWindowClosed = true; checkQuit(); }); @@ -29,9 +29,9 @@ function combineImages(images, outfile, width, height, doubleTrim) { (doubleTrim ? "-bordercolor " + doubleTrim + " -trim " : "") + outfile; console.log(command); - cp.exec(command, function(err, stdout, stderr) { + cp.exec(command, function (err, stdout, stderr) { if (err) console.log(err); - images.forEach(function(file) { + images.forEach(function (file) { fs.unlinkSync(file); }); pendingTasks -= 1; @@ -44,15 +44,15 @@ function GOTO(phase) { currentPhase = phase; } const phases = { - prepare: function(event, arg) { + prepare: function (event, arg) { console.log(arg); GOTO(phases["receive-rect"]); }, - "receive-rect": function(event, rect) { + "receive-rect": function (event, rect) { pendingTasks += 1; console.log("Received rect."); rect = JSON.parse(JSON.stringify(rect)); - let file = argv.dir + "/" + rect.name + ".png"; + let file = argDir + "/" + rect.name + ".png"; let j = 0; let totalFiles = Math.ceil(rect.height / rect.windowHeight); let pendingFiles = totalFiles; @@ -63,7 +63,7 @@ const phases = { if (pendingFiles <= 0) { let images = []; for (let k = 0; k < j; k++) { - images.push(argv.dir + "/" + rect.name + "." + k + ".png"); + images.push(argDir + "/" + rect.name + "." + k + ".png"); } combineImages( images, @@ -76,10 +76,10 @@ const phases = { } function step() { event.sender.send("scroll", rect.y + j * rect.windowHeight); - GOTO(function(event) { - mainWindow.capturePage().then(function(image) { + GOTO(function (event) { + mainWindow.capturePage().then(function (image) { fs.writeFile( - argv.dir + "/" + rect.name + "." + j + ".png", + argDir + "/" + rect.name + "." + j + ".png", image.toPNG(), doneFileWrite ); @@ -97,14 +97,14 @@ const phases = { } }; let currentPhase = phases["prepare"]; -ipc.on("snapshot", function() { +ipc.on("snapshot", function () { currentPhase.apply(this, arguments); }); -ipc.on("log", function(event, arg) { +ipc.on("log", function (event, arg) { console.log(arg); }); -app.on("ready", function() { +app.on("ready", function () { mainWindow = new BrowserWindow({ width: 64 * 16 * zoom, height: 1024 * zoom, diff --git a/verdafile.js b/verdafile.js index 34765dab6..00161cc9f 100644 --- a/verdafile.js +++ b/verdafile.js @@ -24,7 +24,7 @@ const GENERATE = ["node", "gen/generator"]; const webfontFormats = [ ["woff2", "woff2"], ["woff", "woff"], - ["ttf", "truetype"], + ["ttf", "truetype"] ]; const BUILD_PLANS = path.relative(__dirname, path.resolve(__dirname, "./build-plans.toml")); @@ -59,7 +59,7 @@ async function tryParseToml(str) { } } -const RawPlans = oracle(`metadata:raw-plans`, async (target) => { +const RawPlans = oracle(`metadata:raw-plans`, async target => { await target.need(sfu(BUILD_PLANS), ofu(PRIVATE_BUILD_PLANS)); const bp = await tryParseToml(BUILD_PLANS); @@ -91,31 +91,31 @@ const RawPlans = oracle(`metadata:raw-plans`, async (target) => { return bp; }); -const BuildPlans = computed("metadata:build-plans", async (target) => { +const BuildPlans = computed("metadata:build-plans", async target => { const [rp] = await target.need(RawPlans); return rp.buildPlans; }); -const ExportPlans = computed("metadata:export-plans", async (target) => { +const ExportPlans = computed("metadata:export-plans", async target => { const [rp] = await target.need(RawPlans); return rp.exportPlans; }); -const RawCollectPlans = computed("metadata:raw-collect-plans", async (target) => { +const RawCollectPlans = computed("metadata:raw-collect-plans", async target => { const [rp] = await target.need(RawPlans); return rp.collectPlans; }); -const Weights = computed("metadata:global-weights", async (target) => { +const Weights = computed("metadata:global-weights", async target => { const [rp] = await target.need(RawPlans); return rp.weights; }); -const Slants = computed("metadata:global-slants", async (target) => { +const Slants = computed("metadata:global-slants", async target => { const [rp] = await target.need(RawPlans); return rp.slants; }); -const Widths = computed("metadata:global-widths", async (target) => { +const Widths = computed("metadata:global-widths", async target => { const [rp] = await target.need(RawPlans); return rp.widths; }); -const CollectConfig = computed("metadata:collect-config", async (target) => { +const CollectConfig = computed("metadata:collect-config", async target => { const [rp] = await target.need(RawPlans); return rp.collectConfig; }); @@ -158,7 +158,7 @@ const recommendedMenuWeights = { semibold: 600, bold: 700, extrabold: 800, - heavy: 900, + heavy: 900 }; function validateRecommendedWeight(w, value, label) { if (recommendedMenuWeights[w] && recommendedMenuWeights[w] !== value) { @@ -178,7 +178,7 @@ function getSuffixSet(weights, slants, widths) { for (const wd in widths) { const suffix = makeSuffix(w, wd, s, "regular"); mapping[suffix] = { - hives: [`shape-weight`, `s-${s}`, `wd-${widths[wd].shape}`], + hives: [`shapeWeight`, `s-${s}`, `wd-${widths[wd].shape}`], weight: w, shapeWeight: nValidate("Shape weight of " + w, weights[w].shape, vlShapeWeight), cssWeight: nValidate("CSS weight of " + w, weights[w].css, vlCssWeight), @@ -189,7 +189,7 @@ function getSuffixSet(weights, slants, widths) { menuWidth: nValidate("Menu width of " + wd, widths[wd].menu, vlMenuWidth), slant: s, cssStyle: slants[s] || s, - menuStyle: slants[s] || s, + menuSlant: slants[s] || s }; } } @@ -197,12 +197,12 @@ function getSuffixSet(weights, slants, widths) { return mapping; } -const Suffixes = computed(`metadata:suffixes`, async (target) => { +const Suffixes = computed(`metadata:suffixes`, async target => { const [weights, slants, widths] = await target.need(Weights, Slants, Widths); return getSuffixSet(weights, slants, widths); }); -const FontBuildingParameters = computed(`metadata:font-building-parameters`, async (target) => { +const FontBuildingParameters = computed(`metadata:font-building-parameters`, async target => { const [buildPlans, defaultWeights, defaultSlants, defaultWidths] = await target.need( BuildPlans, Weights, @@ -233,18 +233,18 @@ const FontBuildingParameters = computed(`metadata:font-building-parameters`, asy shapeWidth: suffixMapping[suffix].shapeWidth, menuWeight: suffixMapping[suffix].menuWeight, menuWidth: suffixMapping[suffix].menuWidth, - menuStyle: suffixMapping[suffix].menuStyle, + menuSlant: suffixMapping[suffix].menuSlant, cssWeight: suffixMapping[suffix].cssWeight, cssStretch: suffixMapping[suffix].cssStretch, cssStyle: suffixMapping[suffix].cssStyle, - hintParams: hintParams || [], + hintParams: hintParams || [] }; targets.push(fileName); } bp[prefix] = { family, prefix, - targets, + targets }; } return { fontInfos, buildPlans: bp }; @@ -292,7 +292,7 @@ function fnStandardTtc(collectConfig, prefix, w, wd, s) { return `${prefix}-${ttcSuffix}`; } -const CollectPlans = computed(`metadata:collect-plans`, async (target) => { +const CollectPlans = computed(`metadata:collect-plans`, async target => { const [rawCollectPlans, suffixMapping, collectConfig] = await target.need( RawCollectPlans, Suffixes, @@ -345,24 +345,23 @@ const BuildTTF = file.make( (gr, fn) => `${BUILD}/${gr}/${fn}.ttf`, async (target, output, _gr, fn) => { const [ - { hives, family, shapeWeight, menuWeight, menuStyle, menuWidth }, - version, + { hives, family, shapeWeight, menuWeight, menuSlant, menuWidth }, + version ] = await target.need(HivesOf(fn), Version); const otdTmp = output.dir + "/" + output.name + ".tmp.otd"; const charmap = output.dir + "/" + output.name + ".charmap"; await target.need(Scripts, fu`parameters.toml`, de`${output.dir}`); - await run( - GENERATE, - ["-o", otdTmp], - ["--charmap", charmap], - ["--family", family], - ["--ver", version], - ["--shape-weight", shapeWeight], - ["--menu-weight", menuWeight], - ["--menu-slant", menuStyle], - ["--menu-width", menuWidth], + await node("gen/index", { + o: otdTmp, + charmap, + family, + version, + shapeWeight, + menuWeight, + menuSlant, + menuWidth, hives - ); + }); await run( "otfccbuild", otdTmp, @@ -423,23 +422,23 @@ const DistTTC = file.make( } ); const SuperTTC = file.make( - (f) => `${DIST}/super-ttc/${f}.ttc`, + f => `${DIST}/super-ttc/${f}.ttc`, async (target, out, f) => { await target.need(de(out.dir)); const [inputs] = await target.need(CollectionFontsOf(f)); await run( OTF2OTC, ["-o", out.full], - inputs.map((f) => f.full) + inputs.map(f => f.full) ); } ); async function buildTtcForFile(target, parts, out, xMode) { await target.need(de`${out.dir}`); - const [ttfs] = await target.need(parts.map((part) => DistHintedTTF(part.dir, part.file))); + const [ttfs] = await target.need(parts.map(part => DistHintedTTF(part.dir, part.file))); await run( TTCIZE, - ttfs.map((p) => p.full), + ttfs.map(p => p.full), ["-o", out.full], [xMode ? "-x" : "-h", "--common-width=500"] ); @@ -448,36 +447,27 @@ async function buildTtcForFile(target, parts, out, xMode) { // Group-level const GroupTTFs = task.group("ttf", async (target, gid) => { const [ts] = await target.need(GroupFontsOf(gid)); - await target.need(ts.map((tn) => DistHintedTTF(gid, tn))); + await target.need(ts.map(tn => DistHintedTTF(gid, tn))); }); const GroupUnhintedTTFs = task.group("ttf-unhinted", async (target, gid) => { const [ts] = await target.need(GroupFontsOf(gid)); - await target.need(ts.map((tn) => DistUnhintedTTF(gid, tn))); + await target.need(ts.map(tn => DistUnhintedTTF(gid, tn))); }); const GroupWoffs = task.group("woff", async (target, gid) => { const [ts] = await target.need(GroupFontsOf(gid)); - await target.need(ts.map((tn) => DistWoff(gid, tn))); + await target.need(ts.map(tn => DistWoff(gid, tn))); }); const GroupWoff2s = task.group("woff2", async (target, gid) => { const [ts] = await target.need(GroupFontsOf(gid)); - await target.need(ts.map((tn) => DistWoff2(gid, tn))); + await target.need(ts.map(tn => DistWoff2(gid, tn))); }); const GroupFonts = task.group("fonts", async (target, gid) => { await target.need(GroupTTFs(gid), GroupUnhintedTTFs(gid), GroupWoffs(gid), GroupWoff2s(gid)); }); -// Charmap (for specimen) -const DistCharMaps = file.make( - (gid, suffix) => `${DIST}/${gid}/${suffix}.charmap`, - async (target, { full, dir }, gid, suffix) => { - const [src] = await target.need(BuildCM(gid, suffix), de`${dir}`); - await cp(src.full, full); - } -); - // Webfont CSS const DistWebFontCSS = file.make( - (gid) => `${DIST}/${gid}/webfont.css`, + gid => `${DIST}/${gid}/webfont.css`, async (target, { dir }, gid) => { // Note: this target does NOT depend on the font files. const [gr, ts] = await target.need(GroupInfo(gid), GroupFontsOf(gid), de(dir)); @@ -493,12 +483,7 @@ const DistWebFontCSS = file.make( ); const GroupContents = task.group("contents", async (target, gid) => { - const [gr] = await target.need(GroupInfo(gid)); - await target.need( - GroupFonts(gid), - DistWebFontCSS(gid), - DistCharMaps(gid, `${gr.prefix}-regular`) - ); + await target.need(GroupFonts(gid), DistWebFontCSS(gid)); return gid; }); @@ -525,7 +510,7 @@ const GroupArchives = task.group(`archive`, async (target, gid) => { // Collection-level const CollectionFontsOf = task.group("collection-fonts", async (target, cid) => { const [{ groups }] = await target.need(CollectPlans); - const [files] = await target.need(groups[cid].map((file) => DistTTC(cid, file))); + const [files] = await target.need(groups[cid].map(file => DistTTC(cid, file))); return files; }); const TTCArchiveFile = file.make( @@ -552,7 +537,7 @@ const CollectionArchive = task.group(`collection-archive`, async (target, cid) = ////// Root Tasks ////// /////////////////////////////////////////////////////////// -const PagesDir = oracle(`pages-dir-path`, async (target) => { +const PagesDir = oracle(`pages-dir-path`, async target => { const pagesDir = path.resolve(__dirname, "../Iosevka-Pages"); if (!fs.existsSync(pagesDir)) { return ""; @@ -561,12 +546,12 @@ const PagesDir = oracle(`pages-dir-path`, async (target) => { } }); -const PagesDataExport = task(`pages:data-export`, async (target) => { +const PagesDataExport = task(`pages:data-export`, async target => { target.is.volatile(); const [version, pagesDir] = await target.need(Version, PagesDir); if (!pagesDir) return; await target.need(sfu`variants.toml`, sfu`ligation-set.toml`, UtilScripts); - const [cm] = await target.need(DistCharMaps("iosevka", "iosevka-regular")); + const [cm] = await target.need(BuildCM("iosevka", "iosevka-regular")); await run( `node`, `utility/export-data/index`, @@ -575,7 +560,7 @@ const PagesDataExport = task(`pages:data-export`, async (target) => { ); }); -const PagesFontExport = task(`pages:font-export`, async (target) => { +const PagesFontExport = task(`pages:font-export`, async target => { const [pagesDir] = await target.need(PagesDir); if (!pagesDir) return; const dirs = await target.need( @@ -590,7 +575,7 @@ const PagesFontExport = task(`pages:font-export`, async (target) => { } }); -const PagesFastFontExport = task(`pages:fast-font-export`, async (target) => { +const PagesFastFontExport = task(`pages:fast-font-export`, async target => { const [pagesDir] = await target.need(PagesDir); if (!pagesDir) return; const dirs = await target.need(GroupContents`iosevka`); @@ -599,14 +584,14 @@ const PagesFastFontExport = task(`pages:fast-font-export`, async (target) => { } }); -const Pages = task(`pages`, async (target) => { +const Pages = task(`pages`, async target => { await target.need(PagesDataExport, PagesFontExport); }); -const PagesFast = task(`pages-fast`, async (target) => { +const PagesFast = task(`pages-fast`, async target => { await target.need(PagesDataExport, PagesFastFontExport); }); -const SampleImagesPre = task(`sample-images:pre`, async (target) => { +const SampleImagesPre = task(`sample-images:pre`, async target => { const [sans, slab] = await target.need( GroupContents`iosevka`, GroupContents`iosevka-slab`, @@ -617,9 +602,9 @@ const SampleImagesPre = task(`sample-images:pre`, async (target) => { await cp(`${DIST}/${sans}`, `snapshot/${sans}`); await cp(`${DIST}/${slab}`, `snapshot/${slab}`); }); -const SnapShotHtml = file(`snapshot/index.html`, async (target) => { +const SnapShotHtml = file(`snapshot/index.html`, async target => { const [cm] = await target.need( - DistCharMaps("iosevka", "iosevka-regular"), + BuildCM("iosevka", "iosevka-regular"), sfu`variants.toml`, sfu`ligation-set.toml`, UtilScripts @@ -627,20 +612,20 @@ const SnapShotHtml = file(`snapshot/index.html`, async (target) => { await run(`node`, `utility/generate-snapshot-page/index.js`); await run(`node`, `utility/amend-readme/index`, cm.full); }); -const SnapShotCSS = file(`snapshot/index.css`, async (target) => { +const SnapShotCSS = file(`snapshot/index.css`, async target => { await target.need(sfu`snapshot/index.styl`); await run(`npx`, `stylus`, `snapshot/index.styl`, `-c`); }); -const TakeSampleImages = task(`sample-images:take`, async (target) => { +const TakeSampleImages = task(`sample-images:take`, async target => { await target.need(SampleImagesPre); - await cd(`snapshot`).run("npx", "electron", "get-snap.js", ["--dir", "../images"]); + await cd(`snapshot`).run("npx", "electron", "get-snap.js", "../images"); }); const ScreenShot = file.glob(`images/*.png`, async (target, { full }) => { await target.need(TakeSampleImages); await run("optipng", full); }); -const SampleImages = task(`sample-images`, async (target) => { +const SampleImages = task(`sample-images`, async target => { await target.need(TakeSampleImages); await target.need( ScreenShot`images/charvars.png`, @@ -653,7 +638,7 @@ const SampleImages = task(`sample-images`, async (target) => { ); }); -const AllArchives = task(`all:archives`, async (target) => { +const AllArchives = task(`all:archives`, async target => { const [exportPlans, collectPlans] = await target.need(ExportPlans, CollectPlans); await target.need( Object.keys(exportPlans).map(GroupArchives), @@ -661,12 +646,12 @@ const AllArchives = task(`all:archives`, async (target) => { ); }); -const AllTtfArchives = task(`all:ttf`, async (target) => { +const AllTtfArchives = task(`all:ttf`, async target => { const [exportPlans] = await target.need(ExportPlans); await target.need(Object.keys(exportPlans).map(GroupArchives)); }); -const AllTtcArchives = task(`all:ttc`, async (target) => { +const AllTtcArchives = task(`all:ttc`, async target => { const [collectPlans] = await target.need(CollectPlans); await target.need(Object.keys(collectPlans.groups).map(CollectionArchive)); }); @@ -674,17 +659,17 @@ const AllTtcArchives = task(`all:ttc`, async (target) => { const SpecificSuperTtc = task.group(`super-ttc`, async (target, gr) => { await target.need(SuperTTC(gr)); }); -const AllSuperTtc = task(`all:super-ttc`, async (target) => { +const AllSuperTtc = task(`all:super-ttc`, async target => { const [collectPlans] = await target.need(CollectPlans); - await target.need(Object.keys(collectPlans.groups).map((gr) => SuperTTC(gr))); + await target.need(Object.keys(collectPlans.groups).map(gr => SuperTTC(gr))); }); const ChangeFileList = oracle.make( () => `release:change-file-list`, - (target) => FileList({ under: "changes", pattern: "*.md" })(target) + target => FileList({ under: "changes", pattern: "*.md" })(target) ); const ReleaseNotesFile = file.make( - (version) => `${ARCHIVE_DIR}/release-notes-${version}.md`, + version => `${ARCHIVE_DIR}/release-notes-${version}.md`, async (t, out, version) => { await t.need(UtilScripts, de(ARCHIVE_DIR)); const [changeFiles] = await t.need(ChangeFileList()); @@ -692,7 +677,7 @@ const ReleaseNotesFile = file.make( await run("node", "utility/generate-release-note/index", version, out.full); } ); -const ReleaseNotes = task(`release:release-note`, async (t) => { +const ReleaseNotes = task(`release:release-note`, async t => { const [version] = await t.need(Version); await t.need(ReleaseNotesFile(version)); }); @@ -703,7 +688,7 @@ phony(`clean`, async () => { await rm(`release-archives`); build.deleteJournal(); // Disable journal }); -phony(`release`, async (target) => { +phony(`release`, async target => { await target.need(AllArchives, AllSuperTtc); await target.need(SampleImages, Pages); await target.need(ReleaseNotes); @@ -718,7 +703,7 @@ const ScriptsUnder = oracle.make( (ext, dir) => `${ext}-scripts-under::${dir}`, (target, ext, dir) => FileList({ under: dir, pattern: `**/*.${ext}` })(target) ); -const UtilScriptFiles = computed("util-script-files", async (target) => { +const UtilScriptFiles = computed("util-script-files", async target => { const [js, ejs, md] = await target.need( ScriptsUnder("js", "utility"), ScriptsUnder("ejs", "utility"), @@ -736,9 +721,9 @@ const ScriptFiles = computed.group("script-files", async (target, ext) => { ); return ss.reduce((a, b) => [...a, ...b]); }); -const JavaScriptFromPtl = computed("scripts-js-from-ptl", async (target) => { +const JavaScriptFromPtl = computed("scripts-js-from-ptl", async target => { const [ptl] = await target.need(ScriptFiles("ptl")); - return ptl.map((x) => x.replace(/\.ptl$/g, ".js")); + return ptl.map(x => x.replace(/\.ptl$/g, ".js")); }); const ScriptJS = file.glob(`{gen|glyphs|meta|otl|support}/**/*.js`, async (target, path) => { @@ -754,14 +739,14 @@ const ScriptJS = file.glob(`{gen|glyphs|meta|otl|support}/**/*.js`, async (targe await target.need(fu`${path.full}`); } }); -const Scripts = task("scripts", async (target) => { +const Scripts = task("scripts", async target => { await target.need(sfu`parameters.toml`, sfu`variants.toml`, sfu`ligation-set.toml`); const [jsFromPtl] = await target.need(JavaScriptFromPtl); await target.need(jsFromPtl); const [js] = await target.need(ScriptFiles("js")); await target.need(js.map(ScriptJS)); }); -const UtilScripts = task("util-scripts", async (target) => { +const UtilScripts = task("util-scripts", async target => { const [files] = await target.need(UtilScriptFiles); - await target.need(files.map((f) => fu`${f}`)); + await target.need(files.map(f => fu`${f}`)); });