Skip to content

Commit bd7aaa3

Browse files
authored
breaking: Update to latest convention commits packages. (#27)
* style(button): polished rounded corners * security(auth): improved logic fixes #3 * Revert PR #1 * ci(travis): fixed yaml config * build(deps): updated dev tools * test: setup testing framework * internal(ts): updated types * deps(babel,jest): Bumped to latest * patch(router): Fix params * types: Removed any * perf: Speeeeed * release: New major! Note: New build system. * break: Forms have changed Note: They are easier now! * new: amazing new module Not backward compatible. * fix: updated i18n * update(modal, button): added accessibility closes #1, #2 * feature(core): settings refactor * Random commit with no type * docs: added getting started * style(button): polished rounded corners * security(auth): improved logic fixes #3 * Revert PR #1 * ci(travis): fixed yaml config * build(deps): updated dev tools * test: setup testing framework * internal(ts): updated types * deps(babel,jest): Bumped to latest * patch(router): Fix params * types: Removed any * perf: Speeeeed * release: New major! Note: New build system. * break: Forms have changed Note: They are easier now! * new: amazing new module Not backward compatible. * fix: updated i18n * update(modal, button): added accessibility closes #1, #2 * feature(core): settings refactor * Random commit with no type * docs: added getting started * style(button): polished rounded corners * security(auth): improved logic fixes #3 * Revert PR #1 * ci(travis): fixed yaml config * build(deps): updated dev tools * test: setup testing framework * internal(ts): updated types * deps(babel,jest): Bumped to latest * patch(router): Fix params * types: Removed any * perf: Speeeeed * release: New major! Note: New build system. * break: Forms have changed Note: They are easier now! * new: amazing new module Not backward compatible. * fix: updated i18n * update(modal, button): added accessibility closes #1, #2 * feature(core): settings refactor * Random commit with no type * docs: added getting started * style(button): polished rounded corners * security(auth): improved logic fixes #3 * Revert PR #1 * ci(travis): fixed yaml config * build(deps): updated dev tools * test: setup testing framework * internal(ts): updated types * deps(babel,jest): Bumped to latest * patch(router): Fix params * types: Removed any * perf: Speeeeed * release: New major! Note: New build system. * break: Forms have changed Note: They are easier now! * new: amazing new module Not backward compatible. * fix: updated i18n * update(modal, button): added accessibility closes #1, #2 * feature(core): settings refactor * Random commit with no type * docs: added getting started * style(button): polished rounded corners * security(auth): improved logic fixes #3 * Revert PR #1 * ci(travis): fixed yaml config * build(deps): updated dev tools * test: setup testing framework * internal(ts): updated types * deps(babel,jest): Bumped to latest * patch(router): Fix params * types: Removed any * perf: Speeeeed * release: New major! Note: New build system. * break: Forms have changed Note: They are easier now! * new: amazing new module Not backward compatible. * fix: updated i18n * update(modal, button): added accessibility closes #1, #2 * feature(core): settings refactor * Random commit with no type * docs: added getting started * style(button): polished rounded corners * security(auth): improved logic fixes #3 * Revert PR #1 * ci(travis): fixed yaml config * build(deps): updated dev tools * test: setup testing framework * internal(ts): updated types * deps(babel,jest): Bumped to latest * patch(router): Fix params * types: Removed any * perf: Speeeeed * release: New major! Note: New build system. * break: Forms have changed Note: They are easier now! * new: amazing new module Not backward compatible. * fix: updated i18n * update(modal, button): added accessibility closes #1, #2 * feature(core): settings refactor * Random commit with no type * docs: added getting started * style(button): polished rounded corners * security(auth): improved logic fixes #3 * Revert PR #1 * ci(travis): fixed yaml config * build(deps): updated dev tools * test: setup testing framework * internal(ts): updated types * deps(babel,jest): Bumped to latest * patch(router): Fix params * types: Removed any * perf: Speeeeed * build: first build setup Note: New build system. * ci(travis): add TravisCI pipeline Continuously integrated. * new: amazing new module Not backward compatible. * fix(compile): avoid a bug The Change is huge. * update(ngOptions): make it faster closes #1, #2 * revert(ngOptions): bad commit * fix(*): oops * type: Added unknown * tests: Added before hooks * perf: Speeeeed * update: some more features * break: new stuff * break(todo): with scope * breaking: new stuff * breaking(todo): with scope * release: new stuff * release(todo): with scope * break: new stuff * break(todo): with scope * breaking: new stuff * breaking(todo): with scope * release: new stuff * release(todo): with scope * break: new stuff * break(todo): with scope * breaking: new stuff * breaking(todo): with scope * release: new stuff * release(todo): with scope * break: new stuff * break(todo): with scope * breaking: new stuff * breaking(todo): with scope * release: new stuff * release(todo): with scope * break: new stuff * break(todo): with scope * breaking: new stuff * breaking(todo): with scope * release: new stuff * release(todo): with scope * break: new stuff * break(todo): with scope * breaking: new stuff * breaking(todo): with scope * release: new stuff * release(todo): with scope * break: new stuff * break(todo): with scope * breaking: new stuff * breaking(todo): with scope * release: new stuff * release(todo): with scope * break: new stuff * break(todo): with scope * breaking: new stuff * breaking(todo): with scope * release: new stuff * release(todo): with scope * break: new stuff * break(todo): with scope * breaking: new stuff * breaking(todo): with scope * release: new stuff * release(todo): with scope * break: new stuff * break(todo): with scope * breaking: new stuff * breaking(todo): with scope * release: new stuff * release(todo): with scope * break: new stuff * break(todo): with scope * breaking: new stuff * breaking(todo): with scope * release: new stuff * release(todo): with scope * break: new stuff * break(todo): with scope * breaking: new stuff * breaking(todo): with scope * release: new stuff * release(todo): with scope * break: new stuff * break(todo): with scope * breaking: new stuff * breaking(todo): with scope * release: new stuff * release(todo): with scope * break: new stuff * break(todo): with scope * breaking: new stuff * breaking(todo): with scope * release: new stuff * release(todo): with scope * break: new stuff * break(todo): with scope * breaking: new stuff * breaking(todo): with scope * release: new stuff * release(todo): with scope * break: new stuff * break(todo): with scope * breaking: new stuff * breaking(todo): with scope * release: new stuff * release(todo): with scope * break: new stuff * break(todo): with scope * breaking: new stuff * breaking(todo): with scope * release: new stuff * release(todo): with scope * break: new stuff * break(todo): with scope * breaking: new stuff * breaking(todo): with scope * release: new stuff * release(todo): with scope * Update types. * Get bump passing. * Update tests. * Fix tests. * Fix ci. * Fix ci.
1 parent 7971fde commit bd7aaa3

27 files changed

+3517
-7558
lines changed

.github/workflows/build.yml

+9-8
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,24 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
node-version: [12, 14, 16]
13+
node-version: [18, 20]
1414
fail-fast: true
1515
steps:
16-
- uses: actions/checkout@v2
17-
- uses: actions/setup-node@v2
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-node@v4
1818
with:
1919
node-version: ${{ matrix.node-version }}
2020
- run: yarn install --immutable
2121
- run: yarn run type
22-
# Our fake git commit system doesnt work in GH jobs
23-
# - run: yarn run jest
24-
- run: yarn run lint
22+
# Required for our Git related tests
23+
- run: git config --global user.name 'CI'
24+
- run: git config --global user.email '[email protected]'
25+
- run: yarn run test
2526
build:
2627
name: Pack
2728
runs-on: ubuntu-latest
2829
steps:
29-
- uses: actions/checkout@v2
30-
- uses: actions/setup-node@v2
30+
- uses: actions/checkout@v4
31+
- uses: actions/setup-node@v4
3132
- run: yarn install --immutable
3233
- run: yarn run pack

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@ node_modules/
2525
.eslintignore
2626
/.eslintrc.js
2727
.flowconfig
28-
.prettierignore
2928
babel.config.js
3029
jest.config.js
31-
prettier.config.js
3230
webpack.config.js
3331

3432
# Yarn

.prettierignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
node_modules/
2+
build/
3+
cjs/
4+
coverage/
5+
dist/
6+
dts/
7+
esm/
8+
lib/
9+
mjs/
10+
umd/
11+
CHANGELOG.md
12+
*.d.ts
13+
*.d.cts
14+
*.d.mts
15+
.yarn
16+
*.hbs

package.json

+22-22
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,43 @@
88
"preset"
99
],
1010
"main": "./lib/index.js",
11-
"types": "./dts/index.d.ts",
11+
"types": "./lib/index.d.ts",
1212
"engines": {
13-
"node": ">=12.17.0",
14-
"npm": ">=6.13.0"
13+
"node": ">=18.12.0"
1514
},
1615
"repository": "https://github.com/beemojs/conventional-changelog-beemo",
1716
"author": "Miles Johnson",
1817
"license": "MIT",
1918
"files": [
20-
"dts/**/*.d.ts",
2119
"index.js",
22-
"lib/**/*.{js,map}",
23-
"src/**/*.{ts,tsx,json}",
20+
"lib/**/*",
21+
"src/**/*",
2422
"templates/**/*"
2523
],
2624
"scripts": {
27-
"prepare": "beemo create-config",
2825
"build": "packemon build --addEngines",
29-
"pack": "NODE_ENV=production packemon pack --addEngines --declaration standard --declarationConfig tsconfig.build.json",
30-
"check": "yarn run type && yarn run test && yarn run lint",
26+
"pack": "packemon pack --addEngines --declaration",
27+
"check": "yarn run type && yarn run test",
3128
"coverage": "yarn run jest --coverage",
32-
"lint": "beemo eslint",
33-
"test": "beemo jest -i",
34-
"format": "beemo prettier",
29+
"test": "vitest",
30+
"format": "prettier --write .",
3531
"release": "yarn run pack && yarn run check && npx np --yolo --no-yarn",
36-
"type": "beemo typescript --noEmit"
32+
"type": "tsc --noEmit"
33+
},
34+
"dependencies": {
35+
"conventional-changelog-writer": "^8.0.0",
36+
"conventional-commits-parser": "^6.0.0"
3737
},
3838
"devDependencies": {
39-
"@beemo/cli": "^2.0.6",
40-
"@beemo/core": "^2.1.4",
41-
"@beemo/dev": "^1.7.10",
42-
"@types/node": "^17.0.23",
43-
"@types/shelljs": "^0.8.11",
44-
"conventional-changelog-core": "^4.2.4",
45-
"conventional-recommended-bump": "^6.1.0",
46-
"packemon": "^1.14.1",
47-
"shelljs": "^0.8.5"
39+
"@types/node": "^20.12.11",
40+
"conventional-changelog-core": "^8.0.0",
41+
"conventional-recommended-bump": "^10.0.0",
42+
"packemon": "^4.0.1",
43+
"prettier": "^3.2.5",
44+
"prettier-config-moon": "^1.1.2",
45+
"tsconfig-moon": "^1.3.0",
46+
"typescript": "^5.4.5",
47+
"vitest": "^1.6.0"
4848
},
4949
"funding": {
5050
"type": "ko-fi",

prettier.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = 'prettier-config-moon';

src/checkCommitFormat.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { COMMIT_FORMAT_PREFIX } from './constants';
2-
import { CommitType } from './types';
2+
import type { CommitType } from './types';
33

44
export function checkCommitFormat(commit: string): { scope: string; type: CommitType } | null {
55
const match = commit.match(COMMIT_FORMAT_PREFIX);

src/constants.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Group } from './types';
1+
import type { Group } from './types';
22

33
export const COMMIT_FORMAT_PREFIX =
44
// eslint-disable-next-line unicorn/no-unsafe-regex

src/conventionalChangelog.ts

-4
This file was deleted.

src/getTypeGroup.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { GROUPS } from './constants';
2-
import { CommitType, Group } from './types';
2+
import type { CommitType, Group } from './types';
33

44
export function getTypeGroup(type: CommitType): Group {
55
const group = GROUPS.find((g) => g.types.includes(type));

src/index.ts

+14-4
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,21 @@
33
* @license https://opensource.org/licenses/MIT
44
*/
55

6+
import { parserOpts } from './parserOpts';
7+
import { writerOpts } from './writerOpts';
8+
import { whatBump } from './whatBump';
9+
610
export { checkCommitFormat } from './checkCommitFormat';
711
export * from './constants';
8-
export { conventionalChangelog } from './conventionalChangelog';
912
export { getTypeGroup } from './getTypeGroup';
10-
export { parserOpts } from './parserOpts';
11-
export { recommendedBumpOpts } from './recommendedBumpOpts';
1213
export * from './types';
13-
export { writerOpts } from './writerOpts';
14+
15+
export { parserOpts, writerOpts, whatBump };
16+
17+
export default function createPreset() {
18+
return {
19+
parser: parserOpts,
20+
writer: writerOpts,
21+
whatBump,
22+
};
23+
}

src/parserOpts.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { COMMIT_FORMAT_PREFIX } from './constants';
2-
import { ParserOptions } from './types';
2+
import type { ParserOptions } from './types';
33

4-
export const parserOpts: Partial<ParserOptions> = {
4+
export const parserOpts: ParserOptions = {
55
headerCorrespondence: ['type', 'scope', 'message'],
66
// Keep in sync with checkCommitFormat
77
headerPattern: new RegExp(`^${COMMIT_FORMAT_PREFIX.source} (.*)$`, 'u'),
88
mergeCorrespondence: ['pr', 'source'],
99
mergePattern: /^Merged? pull request #(\d+) from (.*)/u,
10-
noteKeywords: 'Note',
10+
noteKeywords: ['Note'],
1111
revertCorrespondence: [],
1212
revertPattern: /^Revert/u,
1313
};

src/recommendedBumpOpts.ts

-54
This file was deleted.

src/types.ts

+19-94
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
export interface Note {
2-
title: string;
3-
text: string;
4-
}
1+
import type { CommitBase, CommitReference } from 'conventional-commits-parser';
2+
import type {
3+
Context as ContextBase,
4+
TemplatesOptions,
5+
Options as WriterOptionsBase,
6+
} from 'conventional-changelog-writer';
7+
8+
export type { ParserOptions } from 'conventional-commits-parser';
59

6-
export interface Reference {
7-
action: string;
8-
owner: string | null;
9-
repository: string | null;
10-
issue: string;
11-
raw: string;
12-
prefix: string;
10+
export interface Reference extends CommitReference {
1311
// Beemo
14-
issueLink: string;
15-
source: string;
12+
issueLink?: string;
13+
source?: string;
1614
}
1715

1816
export type CommitType =
@@ -64,15 +62,8 @@ export interface Group {
6462
types: CommitType[];
6563
}
6664

67-
export interface Commit {
68-
body: string | null;
69-
footer: string | null;
70-
header: string;
71-
mentions: string[];
72-
merge: string | null;
73-
notes: Note[];
65+
export interface Commit extends CommitBase {
7466
references: Reference[];
75-
revert: Record<string, string> | null;
7667
// Beemo
7768
hash: string;
7869
hashLink: string;
@@ -84,80 +75,14 @@ export interface Commit {
8475
type: CommitType;
8576
}
8677

87-
export interface Context {
88-
commit: string;
89-
date: string;
90-
host: string;
91-
isPatch: boolean;
92-
isMinor: boolean;
93-
isMajor: boolean;
94-
issue: string;
95-
linkReferences: boolean;
96-
options: Record<string, unknown>;
97-
owner: string;
98-
repository: string;
99-
repoUrl: string;
100-
title: string;
101-
version: string;
102-
// Beemo
103-
headerLevel?: '#' | '##' | '###';
78+
export interface Context extends ContextBase<Commit> {
10479
groupEmojis?: { [K in CommitGroupLabel]: string };
80+
headerLevel?: '#' | '##' | '###';
81+
isMinor?: boolean;
82+
isMajor?: boolean;
83+
options?: Record<string, unknown>;
10584
}
10685

107-
export type Pattern = RegExp | string | null;
108-
109-
export type Correspondence = string[] | string;
110-
111-
export type Sorter<T> = string[] | string | ((a: T, b: T) => number);
112-
113-
export interface ParserOptions {
114-
fieldPattern: Pattern;
115-
headerPattern: Pattern;
116-
headerCorrespondence: Correspondence;
117-
issuePrefixes: string[] | string;
118-
mergePattern: Pattern;
119-
mergeCorrespondence: Correspondence;
120-
noteKeywords: string[] | string;
121-
referenceActions: string[] | string | null;
122-
revertPattern: Pattern;
123-
revertCorrespondence: Correspondence;
124-
warn: boolean | (() => void);
125-
}
126-
127-
export interface WriterOptions {
128-
commitGroupsSort: Sorter<{
129-
title: CommitGroupLabel;
130-
commits: Commit[];
131-
}>;
132-
commitPartial: string;
133-
commitsSort: Sorter<Commit>;
134-
debug: () => void;
135-
doFlush: boolean;
136-
finalizeContext:
137-
| ((context: Context, options: WriterOptions, commits: Commit[], keyCommit: Commit) => Context)
138-
| undefined;
139-
footerPartial: string;
140-
generateOn:
141-
| string
142-
| ((commit: Commit, commits: Commit[], context: Context, options: WriterOptions) => unknown);
143-
groupBy: string;
144-
headerPartial: string;
145-
ignoreReverted: boolean;
146-
includeDetails: boolean;
147-
mainTemplate: string;
148-
noteGroupsSort: Sorter<{
149-
title: string;
150-
notes: Note[];
151-
}>;
152-
notesSort: Sorter<Note>;
153-
partials: Record<string, unknown>;
154-
reverse: boolean;
155-
transform: (commit: Commit, context: Context) => Commit | undefined;
156-
}
157-
158-
export type SemverLevel = 0 | 1 | 2 | null; // major | minor | patch
159-
160-
export interface BumpOptions {
161-
parserOpts: Partial<ParserOptions>;
162-
whatBump: (commits: Commit[]) => { level: SemverLevel; reason: string };
86+
export interface WriterOptions extends WriterOptionsBase<Commit>, TemplatesOptions {
87+
includeDetails?: boolean;
16388
}

0 commit comments

Comments
 (0)