@w5s/conventional-changelog 3.32.0 โ 3.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -16
- package/dist/index.js +11 -20
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/parser.ts +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/parser.d.ts
|
|
2
1
|
interface ParserOptions {
|
|
3
2
|
headerCorrespondence?: Array<string> | null | string;
|
|
4
3
|
headerPattern?: null | RegExp | string;
|
|
@@ -6,8 +5,6 @@ interface ParserOptions {
|
|
|
6
5
|
revertCorrespondence?: Array<string> | null | string;
|
|
7
6
|
revertPattern?: null | RegExp | string;
|
|
8
7
|
}
|
|
9
|
-
//#endregion
|
|
10
|
-
//#region src/data.d.ts
|
|
11
8
|
interface Commit {
|
|
12
9
|
body: Commit.Field;
|
|
13
10
|
footer: Commit.Field;
|
|
@@ -67,8 +64,6 @@ interface CommitConventionalTypeData {
|
|
|
67
64
|
'emoji': string;
|
|
68
65
|
'en-US': string;
|
|
69
66
|
}
|
|
70
|
-
//#endregion
|
|
71
|
-
//#region src/transform.d.ts
|
|
72
67
|
type CommitTransformFunction<TCommit extends Commit = Commit> = (commit: Commit, context: WriterContext, ...args: Array<unknown>) => false | TCommit;
|
|
73
68
|
interface WriterContext {
|
|
74
69
|
host?: string | undefined;
|
|
@@ -76,8 +71,6 @@ interface WriterContext {
|
|
|
76
71
|
repository?: string | undefined;
|
|
77
72
|
repoUrl?: string | undefined;
|
|
78
73
|
}
|
|
79
|
-
//#endregion
|
|
80
|
-
//#region src/writer.d.ts
|
|
81
74
|
interface WriterOptions {
|
|
82
75
|
commitGroupsSort?: false | ReadonlyArray<string> | string | undefined;
|
|
83
76
|
commitPartial?: string | undefined;
|
|
@@ -89,8 +82,6 @@ interface WriterOptions {
|
|
|
89
82
|
noteGroupsSort?: false | ReadonlyArray<string> | string | undefined;
|
|
90
83
|
transform?: CommitTransformFunction<Commit> | undefined;
|
|
91
84
|
}
|
|
92
|
-
//#endregion
|
|
93
|
-
//#region src/gitmoji.d.ts
|
|
94
85
|
export type Emoji = Emoji.Text | Emoji.Unicode;
|
|
95
86
|
export declare namespace Emoji {
|
|
96
87
|
type Text = string & {
|
|
@@ -133,8 +124,6 @@ export declare const GitmojiCode: Readonly<{
|
|
|
133
124
|
isValid: typeof isValid;
|
|
134
125
|
toConventionalCommitType: typeof toConventionalCommitType;
|
|
135
126
|
}>;
|
|
136
|
-
//#endregion
|
|
137
|
-
//#region src/createPreset.d.ts
|
|
138
127
|
declare function createPreset(): Promise<{
|
|
139
128
|
gitRawCommitOpts: {
|
|
140
129
|
format: string;
|
|
@@ -146,13 +135,9 @@ declare function createPreset(): Promise<{
|
|
|
146
135
|
};
|
|
147
136
|
writer: WriterOptions;
|
|
148
137
|
}>;
|
|
149
|
-
//#endregion
|
|
150
|
-
//#region src/meta.d.ts
|
|
151
138
|
export declare const meta: Readonly<{
|
|
152
139
|
buildNumber: number;
|
|
153
140
|
name: string;
|
|
154
141
|
version: string;
|
|
155
142
|
}>;
|
|
156
|
-
|
|
157
|
-
export { createPreset as default };
|
|
158
|
-
//# sourceMappingURL=index.d.ts.map
|
|
143
|
+
export { createPreset as default };
|
package/dist/index.js
CHANGED
|
@@ -3,10 +3,9 @@ import { gitmojis } from "gitmojis";
|
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import nodePath from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
|
-
|
|
6
|
+
// src/git-raw-commit-opts.ts
|
|
7
7
|
const gitRawCommitOpts = { format: "%B%n-hash-%n%H%n-gitTags-%n%d%n-committerDate-%n%ci%n-authorName-%n%an%n-authorEmail-%n%ae" };
|
|
8
|
-
|
|
9
|
-
//#region src/parser.ts
|
|
8
|
+
// src/parser.ts
|
|
10
9
|
const createParserOpts = () => ({
|
|
11
10
|
headerCorrespondence: [
|
|
12
11
|
"type",
|
|
@@ -18,8 +17,7 @@ const createParserOpts = () => ({
|
|
|
18
17
|
revertCorrespondence: [`header`, `hash`],
|
|
19
18
|
revertPattern: /^(?:revert|revert:)\s"?([\S\s]+?)"?\s*this reverts commit (\w*)\./i
|
|
20
19
|
});
|
|
21
|
-
|
|
22
|
-
//#region src/data.ts
|
|
20
|
+
// src/data.ts
|
|
23
21
|
const CommitConventionalType = (() => {
|
|
24
22
|
const enumObject = Object.freeze({
|
|
25
23
|
Build: "build",
|
|
@@ -123,8 +121,7 @@ const CommitConventionalType = (() => {
|
|
|
123
121
|
values
|
|
124
122
|
};
|
|
125
123
|
})();
|
|
126
|
-
|
|
127
|
-
//#region src/gitmoji.ts
|
|
124
|
+
// src/gitmoji.ts
|
|
128
125
|
const reEmojiUnicode = emojiRegexp();
|
|
129
126
|
const reEmojiText = /:\w*:/;
|
|
130
127
|
const reMatchOnly = (input) => new RegExp(`^${input.source}$`, "");
|
|
@@ -189,8 +186,7 @@ const GitmojiCode = Object.freeze({
|
|
|
189
186
|
isValid,
|
|
190
187
|
toConventionalCommitType: toConventionalCommitType$1
|
|
191
188
|
});
|
|
192
|
-
|
|
193
|
-
//#region src/whatBump.ts
|
|
189
|
+
// src/whatBump.ts
|
|
194
190
|
function toConventionalCommitType(text) {
|
|
195
191
|
return GitmojiCode.isValid(text) ? GitmojiCode.toConventionalCommitType(text) : CommitConventionalType.hasInstance(text) ? text : void 0;
|
|
196
192
|
}
|
|
@@ -213,8 +209,7 @@ const whatBump = (commits) => {
|
|
|
213
209
|
reason: breakings === 1 ? `There is ${breakings} BREAKING CHANGE and ${features} features` : `There are ${breakings} BREAKING CHANGES and ${features} features`
|
|
214
210
|
};
|
|
215
211
|
};
|
|
216
|
-
|
|
217
|
-
//#region src/transform.ts
|
|
212
|
+
// src/transform.ts
|
|
218
213
|
function displayScope(scope, scopeDisplayNameMap) {
|
|
219
214
|
return scope == null || scope.length === 0 ? scopeDisplayNameMap["*"] : scopeDisplayNameMap[scope] ?? scope;
|
|
220
215
|
}
|
|
@@ -280,8 +275,7 @@ function createTransform(config) {
|
|
|
280
275
|
};
|
|
281
276
|
return transform;
|
|
282
277
|
}
|
|
283
|
-
|
|
284
|
-
//#region src/writer.ts
|
|
278
|
+
// src/writer.ts
|
|
285
279
|
const _dirname = nodePath.dirname(fileURLToPath(import.meta.url));
|
|
286
280
|
const basePath = nodePath.resolve(nodePath.dirname(_dirname), "./template");
|
|
287
281
|
const defaultDisplayTypes = CommitConventionalType.findWhere((_) => _.changelog);
|
|
@@ -303,8 +297,7 @@ const createWriterOpts = async () => {
|
|
|
303
297
|
transform: createTransform({ displayTypes: defaultDisplayTypes })
|
|
304
298
|
};
|
|
305
299
|
};
|
|
306
|
-
|
|
307
|
-
//#region src/createPreset.ts
|
|
300
|
+
// src/createPreset.ts
|
|
308
301
|
async function createPreset() {
|
|
309
302
|
return {
|
|
310
303
|
gitRawCommitOpts,
|
|
@@ -313,14 +306,12 @@ async function createPreset() {
|
|
|
313
306
|
writer: await createWriterOpts()
|
|
314
307
|
};
|
|
315
308
|
}
|
|
316
|
-
|
|
317
|
-
//#region src/meta.ts
|
|
309
|
+
// src/meta.ts
|
|
318
310
|
const meta = Object.freeze({
|
|
319
|
-
buildNumber:
|
|
311
|
+
buildNumber: 0x6b04cca5,
|
|
320
312
|
name: "@w5s/conventional-changelog",
|
|
321
|
-
version: "3.
|
|
313
|
+
version: "3.34.0"
|
|
322
314
|
});
|
|
323
|
-
//#endregion
|
|
324
315
|
export { Emoji, GitmojiCode, createPreset as default, meta };
|
|
325
316
|
|
|
326
317
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["toConventionalCommitType"],"sources":["../src/git-raw-commit-opts.ts","../src/parser.ts","../src/data.ts","../src/gitmoji.ts","../src/whatBump.ts","../src/transform.ts","../src/writer.ts","../src/createPreset.ts","../src/meta.ts"],"sourcesContent":["export const gitRawCommitOpts = {\n format: '%B%n-hash-%n%H%n-gitTags-%n%d%n-committerDate-%n%ci%n-authorName-%n%an%n-authorEmail-%n%ae',\n};\n","export interface ParserOptions {\n headerCorrespondence?: Array<string> | null | string;\n headerPattern?: null | RegExp | string;\n noteKeywords?: Array<string> | null | string;\n revertCorrespondence?: Array<string> | null | string;\n revertPattern?: null | RegExp | string;\n}\n\nexport const createParserOpts = (): ParserOptions => ({\n headerCorrespondence: ['type', 'scope', 'subject'],\n headerPattern: new RegExp(\n // Type\n // eslint-disable-next-line unicorn/prefer-string-raw\n `^(?<type>\\\\S*)? ` +\n // Scope\n // eslint-disable-next-line unicorn/prefer-string-raw\n `(?:\\\\((?<scope>.*)\\\\):? )?` +\n // Subject\n `(?<subject>.*)$`,\n 'u',\n ),\n noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES'],\n // revertPattern: /revert:\\s([\\S\\s]*?)\\s*this reverts commit (\\w*)\\./i,\n revertCorrespondence: [`header`, `hash`],\n // eslint-disable-next-line e18e/prefer-static-regex\n revertPattern: /^(?:revert|revert:)\\s\"?([\\S\\s]+?)\"?\\s*this reverts commit (\\w*)\\./i,\n});\n","export interface Commit {\n body: Commit.Field;\n footer: Commit.Field;\n hash: null | string;\n header: Commit.Field;\n mentions: Array<string>;\n merge: Commit.Field;\n notes: Array<Commit.Note>;\n references: Array<Commit.Reference>;\n revert: Commit.Revert | null;\n scope: null | string;\n subject: null | string;\n type: null | string;\n}\n\nexport namespace Commit {\n export type Field = null | string;\n\n export interface Note {\n text: string;\n title: string;\n }\n\n export interface Reference {\n action: Field;\n issue: string;\n owner: Field;\n prefix: string;\n raw: string;\n repository: Field;\n }\n\n export interface Revert {\n [field: string]: Field | undefined;\n hash?: Field | undefined;\n header?: Field | undefined;\n }\n}\n\nexport type CommitConventionalType =\n | 'build'\n | 'chore'\n | 'ci'\n | 'docs'\n | 'feat'\n | 'fix'\n | 'perf'\n | 'refactor'\n | 'revert'\n | 'style'\n | 'test'\n | 'wip';\n\nexport const CommitConventionalType = (() => {\n const enumObject = Object.freeze({\n Build: 'build',\n Chore: 'chore',\n CI: 'ci',\n Docs: 'docs',\n Feat: 'feat',\n Fix: 'fix',\n Perf: 'perf',\n Refactor: 'refactor',\n Revert: 'revert',\n Style: 'style',\n Test: 'test',\n WIP: 'wip',\n });\n // eslint-disable-next-line unicorn/no-array-sort\n const enumValues: ReadonlyArray<CommitConventionalType> = Object.freeze(Object.values(enumObject).sort((left, right) => left.localeCompare(right)));\n const enumValuesSet = new Set(enumValues);\n\n const typeData: Record<CommitConventionalType, CommitConventionalTypeData> = {\n build: {\n 'changelog': false,\n 'emoji': '๐ท',\n 'en-US': 'Build System',\n },\n chore: {\n 'changelog': false,\n 'emoji': '๐ซ',\n 'en-US': 'Chores',\n },\n ci: {\n 'changelog': false,\n 'emoji': '๐ง',\n 'en-US': 'Continuous Integration',\n },\n docs: {\n 'changelog': false,\n 'emoji': '๐',\n 'en-US': 'Documentation',\n },\n feat: {\n 'changelog': true,\n 'emoji': 'โจ',\n 'en-US': 'Features',\n },\n fix: {\n 'changelog': true,\n 'emoji': '๐',\n 'en-US': 'Bug Fixes',\n },\n perf: {\n 'changelog': true,\n 'emoji': 'โก',\n 'en-US': 'Performance Improvements',\n },\n refactor: {\n 'changelog': false,\n 'emoji': 'โป',\n 'en-US': 'Code Refactoring',\n },\n revert: {\n 'changelog': true,\n 'emoji': 'โช',\n 'en-US': 'Reverts',\n },\n style: {\n 'changelog': false,\n 'emoji': '๐',\n 'en-US': 'Styles',\n },\n test: {\n 'changelog': false,\n 'emoji': 'โ
',\n 'en-US': 'Tests',\n },\n wip: {\n 'changelog': false,\n 'emoji': '๐ง',\n 'en-US': 'Work in progress',\n },\n };\n\n function hasInstance(anyValue: unknown): anyValue is CommitConventionalType {\n return typeof anyValue === 'string' && enumValuesSet.has(anyValue as unknown as CommitConventionalType);\n }\n\n function getData(commitType: CommitConventionalType): CommitConventionalTypeData {\n return typeData[commitType];\n }\n\n function parse(anyValue: string): CommitConventionalType | undefined {\n return hasInstance(anyValue) ? anyValue : undefined;\n }\n\n function values() {\n return enumValues;\n }\n\n function findWhere(predicate: (data: CommitConventionalTypeData) => boolean): Array<CommitConventionalType> {\n return enumValues.filter((enumValue) => predicate(getData(enumValue)));\n }\n\n return { ...enumObject, findWhere, getData, hasInstance, parse, values };\n})();\n\nexport interface CommitConventionalTypeData {\n 'changelog': boolean;\n 'emoji': string;\n 'en-US': string;\n}\n","import emojiRegexp from 'emoji-regex';\nimport { type Gitmoji, gitmojis } from 'gitmojis';\n\nimport type { CommitConventionalType } from './data.js';\n\nexport type Emoji = Emoji.Text | Emoji.Unicode;\nexport namespace Emoji {\n export type Text = string & { '@@EmojiStyle': 'text' };\n export type Unicode = string & { '@@EmojiStyle': 'unicode' };\n}\n\nconst reEmojiUnicode = emojiRegexp();\nconst reEmojiText = /:\\w*:/;\n\nconst reMatchOnly = (input: RegExp) => new RegExp(`^${input.source}$`, '');\nconst _reEmojiUnicode = reMatchOnly(reEmojiUnicode);\nconst _reEmojiText = reMatchOnly(reEmojiText);\n\nfunction hasInstance(anyValue: string): anyValue is Emoji {\n return isText(anyValue) || isUnicode(anyValue);\n}\n\nfunction isText(anyValue: string): anyValue is Emoji.Text {\n return _reEmojiText.test(anyValue);\n}\n\nfunction isUnicode(anyValue: string): anyValue is Emoji.Unicode {\n return _reEmojiUnicode.test(anyValue);\n}\n\n/**\n * @namespace\n */\nexport const Emoji = Object.freeze({\n hasInstance,\n isText,\n isUnicode,\n reEmojiText,\n reEmojiUnicode,\n});\n\nexport type GitmojiCode = Emoji & { '@@Gitmoji': true };\nexport namespace GitmojiCode {\n export type Emoji = Emoji.Text & { '@@Gitmoji': true };\n export type Unicode = Emoji.Unicode & { '@@Gitmoji': true };\n}\n\nconst allGitmojiCodes = new Set(\n gitmojis\n .map((gitmoji) => gitmoji.code as GitmojiCode)\n .concat(gitmojis.map((gitmoji) => gitmoji.emoji as GitmojiCode)),\n);\nconst index = {\n // code: createIndex(gitmojis, 'code'),\n emoji: createIndex(gitmojis, 'emoji'),\n};\n\nfunction createIndex<K extends keyof Gitmoji>(list: ReadonlyArray<Gitmoji>, key: K): ReadonlyMap<Gitmoji[K], Gitmoji> {\n return new Map(list.map((gitmoji) => [gitmoji[key], gitmoji]));\n}\n\nfunction isValid(anyValue: string): anyValue is GitmojiCode {\n return allGitmojiCodes.has(anyValue as GitmojiCode);\n}\n\nconst defaultType = 'chore';\nconst conversionMap: ReadonlyMap<GitmojiCode, CommitConventionalType> = (() => {\n const data: Record<CommitConventionalType, Array<GitmojiCode.Unicode>> = {\n build: [] as Array<GitmojiCode.Unicode>,\n chore: ['๐ง'] as Array<GitmojiCode.Unicode>,\n ci: ['๐ท', '๐'] as Array<GitmojiCode.Unicode>,\n docs: ['๐'] as Array<GitmojiCode.Unicode>,\n feat: ['โจ', 'โฟ๏ธ', '๐ธ'] as Array<GitmojiCode.Unicode>,\n fix: ['๐'] as Array<GitmojiCode.Unicode>,\n perf: ['โก๏ธ'] as Array<GitmojiCode.Unicode>,\n refactor: ['โป๏ธ', '๐๏ธ'] as Array<GitmojiCode.Unicode>,\n revert: ['โช๏ธ'] as Array<GitmojiCode.Unicode>,\n style: ['๐จ', '๐จ'] as Array<GitmojiCode.Unicode>,\n test: ['โ
', '๐งช'] as Array<GitmojiCode.Unicode>,\n wip: ['๐ง'] as Array<GitmojiCode.Unicode>,\n };\n\n const entries = Array.from<[CommitConventionalType, Array<GitmojiCode.Unicode>]>(\n // @ts-ignore entries are not well typed\n Object.entries(data),\n );\n return new Map(\n entries.reduce<Array<[GitmojiCode, CommitConventionalType]>>(\n (acc, [commitType, gitmojiUnicodeArray]) =>\n acc\n .concat(gitmojiUnicodeArray.map((gitmojiUnicode) => [gitmojiUnicode, commitType]))\n\n .concat(\n gitmojiUnicodeArray.map((gitmojiUnicode) => [\n // eslint-disable-next-line ts/no-non-null-assertion, ts/no-non-null-asserted-optional-chain\n index.emoji.get(gitmojiUnicode)?.code! as GitmojiCode,\n commitType,\n ]),\n ),\n [],\n ),\n );\n})();\n\nfunction toConventionalCommitType(gitmoji: GitmojiCode): CommitConventionalType {\n return conversionMap.get(gitmoji) ?? defaultType;\n}\n\n/**\n * @namespace\n */\nexport const GitmojiCode = Object.freeze({\n isValid,\n toConventionalCommitType,\n});\n","import { type Commit, CommitConventionalType } from './data.js';\nimport { GitmojiCode } from './gitmoji.js';\n\nfunction toConventionalCommitType(text: string) {\n return GitmojiCode.isValid(text)\n ? GitmojiCode.toConventionalCommitType(text)\n : CommitConventionalType.hasInstance(text)\n ? text\n : undefined;\n}\n\nexport const whatBump = (commits: ReadonlyArray<Commit>) => {\n let level = 2;\n let breakings = 0;\n let features = 0;\n\n for (const { notes, type } of commits) {\n const conventionalType = type == null ? type : toConventionalCommitType(type);\n if (notes.length > 0) {\n breakings += notes.length;\n level = 0;\n } else if (conventionalType === CommitConventionalType.Feat) {\n features += 1;\n if (level === 2) {\n level = 1;\n }\n }\n }\n\n return {\n level,\n reason:\n breakings === 1\n ? `There is ${breakings} BREAKING CHANGE and ${features} features`\n : `There are ${breakings} BREAKING CHANGES and ${features} features`,\n };\n};\n","import { type Commit, CommitConventionalType } from './data.js';\nimport { GitmojiCode } from './gitmoji.js';\n\nexport type CommitTransformFunction<TCommit extends Commit = Commit> = (commit: Commit, context: WriterContext, ...args: Array<unknown>) => false | TCommit;\n\nexport type Language = 'en-US';\n\nexport interface TransformConfig {\n displayScopes?: Array<string>;\n displayTypes?: Array<CommitConventionalType>;\n language?: Language;\n scopeDisplayName?: Record<string, string>;\n showAuthor?: boolean;\n withEmoji?: boolean;\n}\n\nexport interface WriterContext {\n host?: string | undefined;\n owner?: string | undefined;\n repository?: string | undefined;\n repoUrl?: string | undefined;\n}\n\nexport function displayScope(scope: null | string | undefined, scopeDisplayNameMap: Record<string, string>) {\n return scope == null || scope.length === 0\n ? scopeDisplayNameMap['*']\n : scopeDisplayNameMap[scope] ?? scope;\n}\n\nexport function displayType(type: string, options: displayType.Options = {}): string {\n const { language = 'en-US', withEmoji = true } = options;\n\n if (CommitConventionalType.hasInstance(type)) {\n // eslint-disable-next-line unicorn/no-unreadable-object-destructuring\n const { emoji, [language]: title } = CommitConventionalType.getData(type);\n return `${withEmoji ? `${emoji} ` : ''}${title}`;\n }\n\n return type;\n}\nexport namespace displayType {\n export interface Options {\n readonly language?: Language;\n readonly withEmoji?: boolean | undefined;\n }\n}\n\nexport function createTransform(config: TransformConfig): CommitTransformFunction<Commit> {\n const displayTypes = new Set(config.displayTypes ?? CommitConventionalType.values());\n const shouldIgnoreType = (type: string | undefined) => type == null || !displayTypes.has(type as CommitConventionalType);\n const shouldIgnoreScope = (scope: null | string | undefined) =>\n config.displayScopes != null && scope != null && !config.displayScopes.includes(scope);\n\n const transform = (commit: Commit, { host, owner, repository, repoUrl }: WriterContext): Commit | false => {\n const isDiscard = commit.notes.length === 0;\n const issues = new Set<string>();\n const notes = commit.notes.map((note) => ({\n ...note,\n title: `${config.withEmoji === false ? '' : '๐ฅ '}BREAKING CHANGES`,\n }));\n const conventionalType =\n commit.type == null\n ? undefined\n : (CommitConventionalType.parse(commit.type) ??\n (GitmojiCode.isValid(commit.type) ? GitmojiCode.toConventionalCommitType(commit.type) : undefined));\n\n if (shouldIgnoreType(conventionalType) && isDiscard) return false;\n\n if (shouldIgnoreScope(commit.scope)) return false;\n\n const type =\n conventionalType == null\n ? null\n : displayType(conventionalType, {\n withEmoji: config.withEmoji,\n });\n\n const scopeIntermediate = commit.scope === '*' ? '' : commit.scope;\n const scope =\n config.scopeDisplayName == null ? null : (displayScope(scopeIntermediate, config.scopeDisplayName) ?? null);\n const hash = typeof commit.hash === 'string' ? commit.hash.slice(0, 7) : commit.hash;\n\n const subject =\n typeof commit.subject === 'string'\n ? (() => {\n let returnValue = commit.subject;\n const url = repository == null ? repoUrl : [host, owner, repository].filter(Boolean).join('/');\n if (url != null) {\n const issueURL = `${url}/issues/`;\n // Issue URLs.\n // eslint-disable-next-line unicorn/prefer-string-replace-all\n returnValue = returnValue.replace(/#(\\d+)/g, (_, issue: string) => {\n issues.add(issue);\n\n return `[#${issue}](${issueURL}${issue})`;\n });\n }\n if (host != null) {\n // User URLs.\n // eslint-disable-next-line unicorn/prefer-string-replace-all\n returnValue = returnValue.replace(/\\B@([\\da-z](?:-?[\\d/a-z]){0,38})/g, (_, username: string) =>\n username.includes('/') ? `@${username}` : `[@${username}](${host}/${username})`,\n );\n }\n return returnValue;\n })()\n : commit.subject;\n\n // Remove references that already appear in the subject\n const references = commit.references.filter((reference) => !issues.has(reference.issue));\n\n return {\n ...commit,\n body: commit.body,\n footer: commit.footer,\n hash,\n header: commit.header,\n mentions: commit.mentions,\n merge: commit.merge,\n notes,\n references,\n revert: commit.revert,\n scope,\n subject,\n type,\n };\n };\n\n return transform;\n}\n","import { readFileSync } from 'node:fs';\nimport nodePath from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nimport { type Commit, CommitConventionalType } from './data.js';\nimport { type CommitTransformFunction, createTransform } from './transform.js';\n\nexport interface WriterOptions {\n commitGroupsSort?: false | ReadonlyArray<string> | string | undefined;\n commitPartial?: string | undefined;\n commitsSort?: false | ReadonlyArray<string> | string | undefined;\n footerPartial?: string | undefined;\n groupBy?: false | string | undefined;\n headerPartial?: string | undefined;\n mainTemplate?: string | undefined;\n noteGroupsSort?: false | ReadonlyArray<string> | string | undefined;\n transform?: CommitTransformFunction<Commit> | undefined;\n}\n\nconst _dirname = nodePath.dirname(fileURLToPath(import.meta.url));\nconst basePath = nodePath.resolve(nodePath.dirname(_dirname), './template');\n\nexport const defaultDisplayTypes = CommitConventionalType.findWhere((_) => _.changelog);\n\nexport const createWriterOpts = async (): Promise<WriterOptions> => {\n const mainTemplate = readFileSync(`${basePath}/template.hbs`, 'utf8');\n const headerPartial = readFileSync(`${basePath}/header.hbs`, 'utf8');\n const commitPartial = readFileSync(`${basePath}/commit.hbs`, 'utf8');\n const footerPartial = readFileSync(`${basePath}/footer.hbs`, 'utf8');\n const author = readFileSync(`${basePath}/author.hbs`, 'utf8');\n\n return {\n commitGroupsSort: 'title',\n // eslint-disable-next-line unicorn/prefer-string-replace-all\n commitPartial: commitPartial.replace(/{{gitUserInfo}}/g, author),\n // @ts-ignore FIXME: unknown error\n commitsSort: ['scope', 'subject'],\n footerPartial,\n groupBy: 'type',\n headerPartial,\n mainTemplate,\n noteGroupsSort: 'title',\n transform: createTransform({\n displayTypes: defaultDisplayTypes,\n }),\n };\n};\n","import { gitRawCommitOpts } from './git-raw-commit-opts.js';\nimport { createParserOpts } from './parser.js';\nimport { whatBump } from './whatBump.js';\nimport { createWriterOpts } from './writer.js';\n\nexport { Emoji, GitmojiCode } from './gitmoji.js';\n\nexport async function createPreset() {\n return {\n gitRawCommitOpts,\n parser: createParserOpts(),\n whatBump,\n writer: await createWriterOpts(),\n };\n}\n","export const meta = Object.freeze({\n // @ts-ignore - these variables are injected at build time\n buildNumber: (typeof __PACKAGE_BUILD_NUMBER__ === 'undefined' ? 0 : __PACKAGE_BUILD_NUMBER__) as number,\n // @ts-ignore - these variables are injected at build time\n name: (typeof __PACKAGE_NAME__ === 'undefined' ? '' : __PACKAGE_NAME__) as string,\n // @ts-ignore - these variables are injected at build time\n version: (typeof __PACKAGE_VERSION__ === 'undefined' ? '' : __PACKAGE_VERSION__) as string,\n});\n"],"mappings":";;;;;;AAAA,MAAa,mBAAmB,EAC9B,QAAQ,6FACV;;;ACMA,MAAa,0BAAyC;CACpD,sBAAsB;EAAC;EAAQ;EAAS;CAAS;CACjD,+BAAe,IAAI,OAGjB,6DAMA,GACF;CACA,cAAc,CAAC,mBAAmB,kBAAkB;CAEpD,sBAAsB,CAAC,UAAU,MAAM;CAEvC,eAAe;AACjB;;;AC2BA,MAAa,gCAAgC;CAC3C,MAAM,aAAa,OAAO,OAAO;EAC/B,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACN,MAAM;EACN,KAAK;EACL,MAAM;EACN,UAAU;EACV,QAAQ;EACR,OAAO;E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,QAAQ,oBAAoB,MAAM;EAE/D,aAAa,CAAC,SAAS,SAAS;EAChC;EACA,SAAS;EACT;EACA;EACA,gBAAgB;EAChB,WAAW,gBAAgB,EACzB,cAAc,oBAChB,CAAC;CACH;AACF;;;ACvCA,eAAsB,eAAe;CACnC,OAAO;EACL;EACA,QAAQ,iBAAiB;EACzB;EACA,QAAQ,MAAM,iBAAiB;CACjC;AACF;;;ACdA,MAAa,OAAO,OAAO,OAAO;CAEhC,aAAA;CAEA,MAAA;CAEA,SAAA;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["toConventionalCommitType"],"sources":["../src/git-raw-commit-opts.ts","../src/parser.ts","../src/data.ts","../src/gitmoji.ts","../src/whatBump.ts","../src/transform.ts","../src/writer.ts","../src/createPreset.ts","../src/meta.ts"],"sourcesContent":["export const gitRawCommitOpts = {\n format: '%B%n-hash-%n%H%n-gitTags-%n%d%n-committerDate-%n%ci%n-authorName-%n%an%n-authorEmail-%n%ae',\n};\n","export interface ParserOptions {\n headerCorrespondence?: Array<string> | null | string;\n headerPattern?: null | RegExp | string;\n noteKeywords?: Array<string> | null | string;\n revertCorrespondence?: Array<string> | null | string;\n revertPattern?: null | RegExp | string;\n}\n\nexport const createParserOpts = (): ParserOptions => ({\n headerCorrespondence: ['type', 'scope', 'subject'],\n headerPattern: new RegExp(\n // Type\n\n `^(?<type>\\\\S*)? ` +\n // Scope\n\n `(?:\\\\((?<scope>.*)\\\\):? )?` +\n // Subject\n `(?<subject>.*)$`,\n 'u',\n ),\n noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES'],\n // revertPattern: /revert:\\s([\\S\\s]*?)\\s*this reverts commit (\\w*)\\./i,\n revertCorrespondence: [`header`, `hash`],\n // eslint-disable-next-line e18e/prefer-static-regex\n revertPattern: /^(?:revert|revert:)\\s\"?([\\S\\s]+?)\"?\\s*this reverts commit (\\w*)\\./i,\n});\n","export interface Commit {\n body: Commit.Field;\n footer: Commit.Field;\n hash: null | string;\n header: Commit.Field;\n mentions: Array<string>;\n merge: Commit.Field;\n notes: Array<Commit.Note>;\n references: Array<Commit.Reference>;\n revert: Commit.Revert | null;\n scope: null | string;\n subject: null | string;\n type: null | string;\n}\n\nexport namespace Commit {\n export type Field = null | string;\n\n export interface Note {\n text: string;\n title: string;\n }\n\n export interface Reference {\n action: Field;\n issue: string;\n owner: Field;\n prefix: string;\n raw: string;\n repository: Field;\n }\n\n export interface Revert {\n [field: string]: Field | undefined;\n hash?: Field | undefined;\n header?: Field | undefined;\n }\n}\n\nexport type CommitConventionalType =\n | 'build'\n | 'chore'\n | 'ci'\n | 'docs'\n | 'feat'\n | 'fix'\n | 'perf'\n | 'refactor'\n | 'revert'\n | 'style'\n | 'test'\n | 'wip';\n\nexport const CommitConventionalType = (() => {\n const enumObject = Object.freeze({\n Build: 'build',\n Chore: 'chore',\n CI: 'ci',\n Docs: 'docs',\n Feat: 'feat',\n Fix: 'fix',\n Perf: 'perf',\n Refactor: 'refactor',\n Revert: 'revert',\n Style: 'style',\n Test: 'test',\n WIP: 'wip',\n });\n // eslint-disable-next-line unicorn/no-array-sort\n const enumValues: ReadonlyArray<CommitConventionalType> = Object.freeze(Object.values(enumObject).sort((left, right) => left.localeCompare(right)));\n const enumValuesSet = new Set(enumValues);\n\n const typeData: Record<CommitConventionalType, CommitConventionalTypeData> = {\n build: {\n 'changelog': false,\n 'emoji': '๐ท',\n 'en-US': 'Build System',\n },\n chore: {\n 'changelog': false,\n 'emoji': '๐ซ',\n 'en-US': 'Chores',\n },\n ci: {\n 'changelog': false,\n 'emoji': '๐ง',\n 'en-US': 'Continuous Integration',\n },\n docs: {\n 'changelog': false,\n 'emoji': '๐',\n 'en-US': 'Documentation',\n },\n feat: {\n 'changelog': true,\n 'emoji': 'โจ',\n 'en-US': 'Features',\n },\n fix: {\n 'changelog': true,\n 'emoji': '๐',\n 'en-US': 'Bug Fixes',\n },\n perf: {\n 'changelog': true,\n 'emoji': 'โก',\n 'en-US': 'Performance Improvements',\n },\n refactor: {\n 'changelog': false,\n 'emoji': 'โป',\n 'en-US': 'Code Refactoring',\n },\n revert: {\n 'changelog': true,\n 'emoji': 'โช',\n 'en-US': 'Reverts',\n },\n style: {\n 'changelog': false,\n 'emoji': '๐',\n 'en-US': 'Styles',\n },\n test: {\n 'changelog': false,\n 'emoji': 'โ
',\n 'en-US': 'Tests',\n },\n wip: {\n 'changelog': false,\n 'emoji': '๐ง',\n 'en-US': 'Work in progress',\n },\n };\n\n function hasInstance(anyValue: unknown): anyValue is CommitConventionalType {\n return typeof anyValue === 'string' && enumValuesSet.has(anyValue as unknown as CommitConventionalType);\n }\n\n function getData(commitType: CommitConventionalType): CommitConventionalTypeData {\n return typeData[commitType];\n }\n\n function parse(anyValue: string): CommitConventionalType | undefined {\n return hasInstance(anyValue) ? anyValue : undefined;\n }\n\n function values() {\n return enumValues;\n }\n\n function findWhere(predicate: (data: CommitConventionalTypeData) => boolean): Array<CommitConventionalType> {\n return enumValues.filter((enumValue) => predicate(getData(enumValue)));\n }\n\n return { ...enumObject, findWhere, getData, hasInstance, parse, values };\n})();\n\nexport interface CommitConventionalTypeData {\n 'changelog': boolean;\n 'emoji': string;\n 'en-US': string;\n}\n","import emojiRegexp from 'emoji-regex';\nimport { type Gitmoji, gitmojis } from 'gitmojis';\n\nimport type { CommitConventionalType } from './data.js';\n\nexport type Emoji = Emoji.Text | Emoji.Unicode;\nexport namespace Emoji {\n export type Text = string & { '@@EmojiStyle': 'text' };\n export type Unicode = string & { '@@EmojiStyle': 'unicode' };\n}\n\nconst reEmojiUnicode = emojiRegexp();\nconst reEmojiText = /:\\w*:/;\n\nconst reMatchOnly = (input: RegExp) => new RegExp(`^${input.source}$`, '');\nconst _reEmojiUnicode = reMatchOnly(reEmojiUnicode);\nconst _reEmojiText = reMatchOnly(reEmojiText);\n\nfunction hasInstance(anyValue: string): anyValue is Emoji {\n return isText(anyValue) || isUnicode(anyValue);\n}\n\nfunction isText(anyValue: string): anyValue is Emoji.Text {\n return _reEmojiText.test(anyValue);\n}\n\nfunction isUnicode(anyValue: string): anyValue is Emoji.Unicode {\n return _reEmojiUnicode.test(anyValue);\n}\n\n/**\n * @namespace\n */\nexport const Emoji = Object.freeze({\n hasInstance,\n isText,\n isUnicode,\n reEmojiText,\n reEmojiUnicode,\n});\n\nexport type GitmojiCode = Emoji & { '@@Gitmoji': true };\nexport namespace GitmojiCode {\n export type Emoji = Emoji.Text & { '@@Gitmoji': true };\n export type Unicode = Emoji.Unicode & { '@@Gitmoji': true };\n}\n\nconst allGitmojiCodes = new Set(\n gitmojis\n .map((gitmoji) => gitmoji.code as GitmojiCode)\n .concat(gitmojis.map((gitmoji) => gitmoji.emoji as GitmojiCode)),\n);\nconst index = {\n // code: createIndex(gitmojis, 'code'),\n emoji: createIndex(gitmojis, 'emoji'),\n};\n\nfunction createIndex<K extends keyof Gitmoji>(list: ReadonlyArray<Gitmoji>, key: K): ReadonlyMap<Gitmoji[K], Gitmoji> {\n return new Map(list.map((gitmoji) => [gitmoji[key], gitmoji]));\n}\n\nfunction isValid(anyValue: string): anyValue is GitmojiCode {\n return allGitmojiCodes.has(anyValue as GitmojiCode);\n}\n\nconst defaultType = 'chore';\nconst conversionMap: ReadonlyMap<GitmojiCode, CommitConventionalType> = (() => {\n const data: Record<CommitConventionalType, Array<GitmojiCode.Unicode>> = {\n build: [] as Array<GitmojiCode.Unicode>,\n chore: ['๐ง'] as Array<GitmojiCode.Unicode>,\n ci: ['๐ท', '๐'] as Array<GitmojiCode.Unicode>,\n docs: ['๐'] as Array<GitmojiCode.Unicode>,\n feat: ['โจ', 'โฟ๏ธ', '๐ธ'] as Array<GitmojiCode.Unicode>,\n fix: ['๐'] as Array<GitmojiCode.Unicode>,\n perf: ['โก๏ธ'] as Array<GitmojiCode.Unicode>,\n refactor: ['โป๏ธ', '๐๏ธ'] as Array<GitmojiCode.Unicode>,\n revert: ['โช๏ธ'] as Array<GitmojiCode.Unicode>,\n style: ['๐จ', '๐จ'] as Array<GitmojiCode.Unicode>,\n test: ['โ
', '๐งช'] as Array<GitmojiCode.Unicode>,\n wip: ['๐ง'] as Array<GitmojiCode.Unicode>,\n };\n\n const entries = Array.from<[CommitConventionalType, Array<GitmojiCode.Unicode>]>(\n // @ts-ignore entries are not well typed\n Object.entries(data),\n );\n return new Map(\n entries.reduce<Array<[GitmojiCode, CommitConventionalType]>>(\n (acc, [commitType, gitmojiUnicodeArray]) =>\n acc\n .concat(gitmojiUnicodeArray.map((gitmojiUnicode) => [gitmojiUnicode, commitType]))\n\n .concat(\n gitmojiUnicodeArray.map((gitmojiUnicode) => [\n // eslint-disable-next-line ts/no-non-null-assertion, ts/no-non-null-asserted-optional-chain\n index.emoji.get(gitmojiUnicode)?.code! as GitmojiCode,\n commitType,\n ]),\n ),\n [],\n ),\n );\n})();\n\nfunction toConventionalCommitType(gitmoji: GitmojiCode): CommitConventionalType {\n return conversionMap.get(gitmoji) ?? defaultType;\n}\n\n/**\n * @namespace\n */\nexport const GitmojiCode = Object.freeze({\n isValid,\n toConventionalCommitType,\n});\n","import { type Commit, CommitConventionalType } from './data.js';\nimport { GitmojiCode } from './gitmoji.js';\n\nfunction toConventionalCommitType(text: string) {\n return GitmojiCode.isValid(text)\n ? GitmojiCode.toConventionalCommitType(text)\n : CommitConventionalType.hasInstance(text)\n ? text\n : undefined;\n}\n\nexport const whatBump = (commits: ReadonlyArray<Commit>) => {\n let level = 2;\n let breakings = 0;\n let features = 0;\n\n for (const { notes, type } of commits) {\n const conventionalType = type == null ? type : toConventionalCommitType(type);\n if (notes.length > 0) {\n breakings += notes.length;\n level = 0;\n } else if (conventionalType === CommitConventionalType.Feat) {\n features += 1;\n if (level === 2) {\n level = 1;\n }\n }\n }\n\n return {\n level,\n reason:\n breakings === 1\n ? `There is ${breakings} BREAKING CHANGE and ${features} features`\n : `There are ${breakings} BREAKING CHANGES and ${features} features`,\n };\n};\n","import { type Commit, CommitConventionalType } from './data.js';\nimport { GitmojiCode } from './gitmoji.js';\n\nexport type CommitTransformFunction<TCommit extends Commit = Commit> = (commit: Commit, context: WriterContext, ...args: Array<unknown>) => false | TCommit;\n\nexport type Language = 'en-US';\n\nexport interface TransformConfig {\n displayScopes?: Array<string>;\n displayTypes?: Array<CommitConventionalType>;\n language?: Language;\n scopeDisplayName?: Record<string, string>;\n showAuthor?: boolean;\n withEmoji?: boolean;\n}\n\nexport interface WriterContext {\n host?: string | undefined;\n owner?: string | undefined;\n repository?: string | undefined;\n repoUrl?: string | undefined;\n}\n\nexport function displayScope(scope: null | string | undefined, scopeDisplayNameMap: Record<string, string>) {\n return scope == null || scope.length === 0\n ? scopeDisplayNameMap['*']\n : scopeDisplayNameMap[scope] ?? scope;\n}\n\nexport function displayType(type: string, options: displayType.Options = {}): string {\n const { language = 'en-US', withEmoji = true } = options;\n\n if (CommitConventionalType.hasInstance(type)) {\n // eslint-disable-next-line unicorn/no-unreadable-object-destructuring\n const { emoji, [language]: title } = CommitConventionalType.getData(type);\n return `${withEmoji ? `${emoji} ` : ''}${title}`;\n }\n\n return type;\n}\nexport namespace displayType {\n export interface Options {\n readonly language?: Language;\n readonly withEmoji?: boolean | undefined;\n }\n}\n\nexport function createTransform(config: TransformConfig): CommitTransformFunction<Commit> {\n const displayTypes = new Set(config.displayTypes ?? CommitConventionalType.values());\n const shouldIgnoreType = (type: string | undefined) => type == null || !displayTypes.has(type as CommitConventionalType);\n const shouldIgnoreScope = (scope: null | string | undefined) =>\n config.displayScopes != null && scope != null && !config.displayScopes.includes(scope);\n\n const transform = (commit: Commit, { host, owner, repository, repoUrl }: WriterContext): Commit | false => {\n const isDiscard = commit.notes.length === 0;\n const issues = new Set<string>();\n const notes = commit.notes.map((note) => ({\n ...note,\n title: `${config.withEmoji === false ? '' : '๐ฅ '}BREAKING CHANGES`,\n }));\n const conventionalType =\n commit.type == null\n ? undefined\n : (CommitConventionalType.parse(commit.type) ??\n (GitmojiCode.isValid(commit.type) ? GitmojiCode.toConventionalCommitType(commit.type) : undefined));\n\n if (shouldIgnoreType(conventionalType) && isDiscard) return false;\n\n if (shouldIgnoreScope(commit.scope)) return false;\n\n const type =\n conventionalType == null\n ? null\n : displayType(conventionalType, {\n withEmoji: config.withEmoji,\n });\n\n const scopeIntermediate = commit.scope === '*' ? '' : commit.scope;\n const scope =\n config.scopeDisplayName == null ? null : (displayScope(scopeIntermediate, config.scopeDisplayName) ?? null);\n const hash = typeof commit.hash === 'string' ? commit.hash.slice(0, 7) : commit.hash;\n\n const subject =\n typeof commit.subject === 'string'\n ? (() => {\n let returnValue = commit.subject;\n const url = repository == null ? repoUrl : [host, owner, repository].filter(Boolean).join('/');\n if (url != null) {\n const issueURL = `${url}/issues/`;\n // Issue URLs.\n // eslint-disable-next-line unicorn/prefer-string-replace-all\n returnValue = returnValue.replace(/#(\\d+)/g, (_, issue: string) => {\n issues.add(issue);\n\n return `[#${issue}](${issueURL}${issue})`;\n });\n }\n if (host != null) {\n // User URLs.\n // eslint-disable-next-line unicorn/prefer-string-replace-all\n returnValue = returnValue.replace(/\\B@([\\da-z](?:-?[\\d/a-z]){0,38})/g, (_, username: string) =>\n username.includes('/') ? `@${username}` : `[@${username}](${host}/${username})`,\n );\n }\n return returnValue;\n })()\n : commit.subject;\n\n // Remove references that already appear in the subject\n const references = commit.references.filter((reference) => !issues.has(reference.issue));\n\n return {\n ...commit,\n body: commit.body,\n footer: commit.footer,\n hash,\n header: commit.header,\n mentions: commit.mentions,\n merge: commit.merge,\n notes,\n references,\n revert: commit.revert,\n scope,\n subject,\n type,\n };\n };\n\n return transform;\n}\n","import { readFileSync } from 'node:fs';\nimport nodePath from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nimport { type Commit, CommitConventionalType } from './data.js';\nimport { type CommitTransformFunction, createTransform } from './transform.js';\n\nexport interface WriterOptions {\n commitGroupsSort?: false | ReadonlyArray<string> | string | undefined;\n commitPartial?: string | undefined;\n commitsSort?: false | ReadonlyArray<string> | string | undefined;\n footerPartial?: string | undefined;\n groupBy?: false | string | undefined;\n headerPartial?: string | undefined;\n mainTemplate?: string | undefined;\n noteGroupsSort?: false | ReadonlyArray<string> | string | undefined;\n transform?: CommitTransformFunction<Commit> | undefined;\n}\n\nconst _dirname = nodePath.dirname(fileURLToPath(import.meta.url));\nconst basePath = nodePath.resolve(nodePath.dirname(_dirname), './template');\n\nexport const defaultDisplayTypes = CommitConventionalType.findWhere((_) => _.changelog);\n\nexport const createWriterOpts = async (): Promise<WriterOptions> => {\n const mainTemplate = readFileSync(`${basePath}/template.hbs`, 'utf8');\n const headerPartial = readFileSync(`${basePath}/header.hbs`, 'utf8');\n const commitPartial = readFileSync(`${basePath}/commit.hbs`, 'utf8');\n const footerPartial = readFileSync(`${basePath}/footer.hbs`, 'utf8');\n const author = readFileSync(`${basePath}/author.hbs`, 'utf8');\n\n return {\n commitGroupsSort: 'title',\n // eslint-disable-next-line unicorn/prefer-string-replace-all\n commitPartial: commitPartial.replace(/{{gitUserInfo}}/g, author),\n // @ts-ignore FIXME: unknown error\n commitsSort: ['scope', 'subject'],\n footerPartial,\n groupBy: 'type',\n headerPartial,\n mainTemplate,\n noteGroupsSort: 'title',\n transform: createTransform({\n displayTypes: defaultDisplayTypes,\n }),\n };\n};\n","import { gitRawCommitOpts } from './git-raw-commit-opts.js';\nimport { createParserOpts } from './parser.js';\nimport { whatBump } from './whatBump.js';\nimport { createWriterOpts } from './writer.js';\n\nexport { Emoji, GitmojiCode } from './gitmoji.js';\n\nexport async function createPreset() {\n return {\n gitRawCommitOpts,\n parser: createParserOpts(),\n whatBump,\n writer: await createWriterOpts(),\n };\n}\n","export const meta = Object.freeze({\n // @ts-ignore - these variables are injected at build time\n buildNumber: (typeof __PACKAGE_BUILD_NUMBER__ === 'undefined' ? 0 : __PACKAGE_BUILD_NUMBER__) as number,\n // @ts-ignore - these variables are injected at build time\n name: (typeof __PACKAGE_NAME__ === 'undefined' ? '' : __PACKAGE_NAME__) as string,\n // @ts-ignore - these variables are injected at build time\n version: (typeof __PACKAGE_VERSION__ === 'undef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AC;AAChE,MAAM,WAAW,SAAS,QAAQ,SAAS,QAAQ,QAAQ,GAAG,YAAY;AAE1E,MAAa,sBAAsB,uBAAuB,WAAW,MAAM,EAAE,SAAS;AAEtF,MAAa,mBAAmB,YAAoC;CAClE,MAAM,eAAe,aAAa,GAAG,SAAS,gBAAgB,MAAM;CACpE,MAAM,gBAAgB,aAAa,GAAG,SAAS,cAAc,MAAM;CACnE,MAAM,gBAAgB,aAAa,GAAG,SAAS,cAAc,MAAM;CACnE,MAAM,gBAAgB,aAAa,GAAG,SAAS,cAAc,MAAM;CACnE,MAAM,SAAS,aAAa,GAAG,SAAS,cAAc,MAAM;CAE5D,OAAO;EACL,kBAAkB;EAElB,eAAe,cAAc,QAAQ,oBAAoB,MAAM;EAE/D,aAAa,CAAC,SAAS,SAAS;EAChC;EACA,SAAS;EACT;EACA;EACA,gBAAgB;EAChB,WAAW,gBAAgB,EACzB,cAAc,oBAChB,CAAC;CACH;AACF;;ACvCA,eAAsB,eAAe;CACnC,OAAO;EACL;EACA,QAAQ,iBAAiB;EACzB;EACA,QAAQ,MAAM,iBAAiB;CACjC;AACF;;ACdA,MAAa,OAAO,OAAO,OAAO;CAEhC,aAAA;CAEA,MAAA;CAEA,SAAA;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@w5s/conventional-changelog",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.34.0",
|
|
4
4
|
"description": "Conventional changelog plugin for @w5s",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"homepage": "https://github.com/w5s/project-config/blob/main/packages/conventional-changelog#readme",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "8c839f967fbc4477af3e767c4ecfa2d8a693eda0"
|
|
48
48
|
}
|
package/src/parser.ts
CHANGED
|
@@ -10,10 +10,10 @@ export const createParserOpts = (): ParserOptions => ({
|
|
|
10
10
|
headerCorrespondence: ['type', 'scope', 'subject'],
|
|
11
11
|
headerPattern: new RegExp(
|
|
12
12
|
// Type
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
`^(?<type>\\S*)? ` +
|
|
15
15
|
// Scope
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
`(?:\\((?<scope>.*)\\):? )?` +
|
|
18
18
|
// Subject
|
|
19
19
|
`(?<subject>.*)$`,
|