Merge branch 'upcoming'

main
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:
- version: NEXT
changes:
- port the Perl changelord to JavaScript.
- port the core of the Perl changelord to JavaScript.
change_types:
- title: ""
level: minor

View File

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