Merge branch 'upcoming'

This commit is contained in:
Yanick Champoux 2023-05-11 08:55:25 -04:00
commit 0d1fca8dbb
3 changed files with 28 additions and 1 deletions

View File

@ -6,7 +6,7 @@ project:
releases: releases:
- version: NEXT - version: NEXT
changes: changes:
- port the Perl changelord to JavaScript. - port the core of the Perl changelord to JavaScript.
change_types: change_types:
- title: "" - title: ""
level: minor level: minor

View File

@ -12,6 +12,7 @@ import init from "./command/init.js";
import schema from "./command/schema.js"; import schema from "./command/schema.js";
import add from "./command/add.js"; import add from "./command/add.js";
import cut from "./command/cut.js"; import cut from "./command/cut.js";
import upcoming from "./command/upcoming.js";
consola.raw = (...args) => console.log(...args); consola.raw = (...args) => console.log(...args);
@ -27,5 +28,7 @@ yargs(hideBin(process.argv))
.command(schema) .command(schema)
.command(cut) .command(cut)
.command(print) .command(print)
.command(upcoming)
.strictCommands()
.help() .help()
.parse(); .parse();

24
src/command/upcoming.js Normal file
View File

@ -0,0 +1,24 @@
import u from "@yanick/updeep-remeda";
import fs from "fs-extra";
import yaml from "yaml";
import { render_release } from "./print.js";
const handler = async (config) => {
const source = await fs.readFile(config.source, "utf-8").then(yaml.parse);
const res = render_release(
{ ...config, next: true },
source
)(source.releases.find(u.matches({ version: "NEXT" })));
config.consola.raw("\n" + res.body);
};
export default {
command: "upcoming",
desc: "output the changes in NEXT",
builder: (yargs) => {
yargs;
},
handler,
};