Skip to content

Commit

Permalink
Scripts (#866)
Browse files Browse the repository at this point in the history
* scripts

* config

* config

* releasy

* package

* update
  • Loading branch information
nalchevanidze authored Jun 9, 2024
1 parent 4614725 commit fbc53a1
Show file tree
Hide file tree
Showing 12 changed files with 70 additions and 334 deletions.
25 changes: 25 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@actions/core": "^1.9.1",
"axios": "^0.26.1",
"commander": "^9.1.0",
"gh-rel-easy": "^0.3.0",
"glob": "^8.0.3",
"js-yaml": "^4.1.0",
"ramda": "^0.28.0",
Expand Down
51 changes: 44 additions & 7 deletions scripts/cli.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,44 @@
import { github } from "./lib/gh";
import { exit, write } from "./lib/utils";
import { changelog } from "./lib/changelog";
import { exit, hconf, write } from "./utils";

import { Command } from "commander";
import { format } from "./lib/format";
import { format } from "./format";
import { GHRelEasy } from "gh-rel-easy";

const cli = new Command();

cli.name("cli").description("cli").version("0.0.0");

const scope: Record<string, string> = {
server: "morpheus-graphql",
client: "morpheus-graphql-client",
core: "morpheus-graphql-core",
subscriptions: "morpheus-graphql-subscriptions",
tests: "morpheus-graphql-tests",
app: "morpheus-graphql-app",
};

const relEasy = new GHRelEasy({
pkg: (name) => `https://hackage.haskell.org/package/${scope[name]}`,
gh: {
org: "morpheusgraphql",
repo: "morpheus-graphql",
},
scope,
pr: {
major: "Major Change",
breaking: "Breaking Change",
feature: "New features",
fix: "Bug Fixes",
chore: "Minor Changes",
},
version: () => hconf("version"),
next: async (isBreaking) => {
await hconf("next", ...(isBreaking ? ["-b"] : []));

return hconf("version");
},
});

cli
.command("format")
.description("format")
Expand All @@ -22,13 +52,20 @@ release
.command("open")
.option("-p, --preview", "preview", false)
.action(({ preview }: { preview: string }) =>
changelog(true)
.then(preview ? () => Promise.resolve() : github.release)
relEasy
.changelog()
.then(async (body) => {
await hconf("setup");

if (preview) return;

await relEasy.open(body);
})
.catch(exit)
);

release
.command("changelog")
.action(() => changelog().then(write("changelog.md")).catch(exit));
.action(() => relEasy.changelog().then(write("changelog.md")).catch(exit));

cli.parse();
File renamed without changes.
81 changes: 0 additions & 81 deletions scripts/lib/changelog/fetch.ts

This file was deleted.

22 changes: 0 additions & 22 deletions scripts/lib/changelog/index.ts

This file was deleted.

71 changes: 0 additions & 71 deletions scripts/lib/changelog/render.ts

This file was deleted.

44 changes: 0 additions & 44 deletions scripts/lib/changelog/types.ts

This file was deleted.

Loading

0 comments on commit fbc53a1

Please sign in to comment.