Skip to content

Commit

Permalink
feat: Extend list of conventional commit filters with core and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sylc committed Jun 12, 2022
1 parent 11d6236 commit 95a4a1e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 31 deletions.
3 changes: 2 additions & 1 deletion doc/doc.md
Expand Up @@ -14,7 +14,8 @@ release change log
interface GithubConfig {
github: {
/**
* Perform a release. Can also be set to 'draft' to performa draft release
* Perform a release. Can also be set to 'draft' to perform a draft release
* default is true
*/
release?: boolean | "draft";
};
Expand Down
16 changes: 1 addition & 15 deletions plugins/changelog/mod.ts
Expand Up @@ -3,7 +3,7 @@ import { join } from "./deps.ts";
import type { ReleasePlugin } from "../../plugin.ts";
import {
Document,
Filter,
filters,
polyfillVersion,
pushHeader,
pushTag,
Expand All @@ -24,20 +24,6 @@ const plugin: ReleasePlugin = {
pushHeader(doc);

const [tags, commits] = polyfillVersion(repo, to);
const filters: Filter[] = [
{
type: "breaking",
title: "Breaking",
},
{
type: "feat",
title: "Features",
},
{
type: "fix",
title: "Bug Fixes",
},
];

for (let i = 0; i < tags.length; i++) {
const tag = tags[i];
Expand Down
16 changes: 1 addition & 15 deletions plugins/github/mod.ts
@@ -1,7 +1,7 @@
import { ReleasePlugin } from "../../plugin.ts";
import {
Document,
Filter,
filters,
polyfillVersion,
pushTag,
render,
Expand Down Expand Up @@ -49,20 +49,6 @@ const plugin: ReleasePlugin<GithubConfig> = {
const doc: Document = { sections: [], links: [] };

const [tags, commits] = polyfillVersion(repo, to);
const filters: Filter[] = [
{
type: "breaking",
title: "Breakeage",
},
{
type: "feat",
title: "Features",
},
{
type: "fix",
title: "Bug Fixes",
},
];

const latest = tags[0];
const belonging = commits.filter((_) => _.belongs?.hash === latest.hash);
Expand Down
23 changes: 23 additions & 0 deletions src/changelog.ts
Expand Up @@ -7,6 +7,29 @@ export interface Filter {
title: string;
}

export const filters: Filter[] = [
{
type: "breaking",
title: "Breaking",
},
{
type: "feat",
title: "Features",
},
{
type: "fix",
title: "Bug Fixes",
},
{
type: "docs",
title: "Docs",
},
{
type: "core",
title: "Core",
},
];

export interface Document {
sections: string[];
links: string[];
Expand Down

0 comments on commit 95a4a1e

Please sign in to comment.