@w5s/conventional-changelog 1.0.9 → 1.0.10
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/lib/gitmoji.js +4 -4
- package/lib/parser-opts.js +7 -2
- package/package.json +2 -2
- package/src/gitmoji.ts +4 -4
- package/src/parser-opts.ts +9 -2
package/lib/gitmoji.js
CHANGED
|
@@ -9,16 +9,16 @@ const gitmojis_1 = require("gitmojis");
|
|
|
9
9
|
var Emoji;
|
|
10
10
|
(function (Emoji) {
|
|
11
11
|
Emoji.reEmojiUnicode = (0, emoji_regex_1.default)();
|
|
12
|
-
Emoji.reEmojiText =
|
|
13
|
-
const reMatchOnly = (input) => new RegExp(`^${input.source}$`,
|
|
12
|
+
Emoji.reEmojiText = /:\w*:/;
|
|
13
|
+
const reMatchOnly = (input) => new RegExp(`^${input.source}$`, '');
|
|
14
14
|
const _reEmojiUnicode = reMatchOnly(Emoji.reEmojiUnicode);
|
|
15
15
|
const _reEmojiText = reMatchOnly(Emoji.reEmojiText);
|
|
16
16
|
function isUnicode(anyValue) {
|
|
17
|
-
return
|
|
17
|
+
return _reEmojiUnicode.test(anyValue);
|
|
18
18
|
}
|
|
19
19
|
Emoji.isUnicode = isUnicode;
|
|
20
20
|
function isText(anyValue) {
|
|
21
|
-
return
|
|
21
|
+
return _reEmojiText.test(anyValue);
|
|
22
22
|
}
|
|
23
23
|
Emoji.isText = isText;
|
|
24
24
|
function hasInstance(anyValue) {
|
package/lib/parser-opts.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parserOpts = void 0;
|
|
4
|
-
const gitmoji_1 = require("./gitmoji");
|
|
5
4
|
exports.parserOpts = {
|
|
6
|
-
headerPattern: new RegExp(
|
|
5
|
+
headerPattern: new RegExp(
|
|
6
|
+
// Type
|
|
7
|
+
`^(?<type>\\S*)? ` +
|
|
8
|
+
// Scope
|
|
9
|
+
`(?:\\((?<scope>.*)\\):? )?` +
|
|
10
|
+
// Subject
|
|
11
|
+
`(?<subject>.*)$`, 'u'),
|
|
7
12
|
headerCorrespondence: ['type', 'scope', 'subject'],
|
|
8
13
|
revertPattern: /^(?:revert|revert:)\s"?([\S\s]+?)"?\s*this reverts commit (\w*)\./i,
|
|
9
14
|
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES'],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@w5s/conventional-changelog",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
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",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "5913801bce7442cfeb53292901eb5ea3479bb878"
|
|
67
67
|
}
|
package/src/gitmoji.ts
CHANGED
|
@@ -6,9 +6,9 @@ export type Emoji = Emoji.Unicode | Emoji.Text;
|
|
|
6
6
|
export namespace Emoji {
|
|
7
7
|
export const reEmojiUnicode = emojiRegexp();
|
|
8
8
|
|
|
9
|
-
export const reEmojiText =
|
|
9
|
+
export const reEmojiText = /:\w*:/;
|
|
10
10
|
|
|
11
|
-
const reMatchOnly = (input: RegExp) => new RegExp(`^${input.source}$`,
|
|
11
|
+
const reMatchOnly = (input: RegExp) => new RegExp(`^${input.source}$`, '');
|
|
12
12
|
const _reEmojiUnicode = reMatchOnly(reEmojiUnicode);
|
|
13
13
|
const _reEmojiText = reMatchOnly(reEmojiText);
|
|
14
14
|
|
|
@@ -16,11 +16,11 @@ export namespace Emoji {
|
|
|
16
16
|
export type Text = string & { '@@EmojiStyle': 'text' };
|
|
17
17
|
|
|
18
18
|
export function isUnicode(anyValue: string): anyValue is Unicode {
|
|
19
|
-
return
|
|
19
|
+
return _reEmojiUnicode.test(anyValue);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export function isText(anyValue: string): anyValue is Text {
|
|
23
|
-
return
|
|
23
|
+
return _reEmojiText.test(anyValue);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export function hasInstance(anyValue: string): anyValue is Emoji {
|
package/src/parser-opts.ts
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import type { Options } from 'conventional-commits-parser';
|
|
2
|
-
import { Emoji } from './gitmoji';
|
|
3
2
|
|
|
4
3
|
export interface ParserOptions extends Options {}
|
|
5
4
|
|
|
6
5
|
export const parserOpts: ParserOptions = {
|
|
7
|
-
headerPattern: new RegExp(
|
|
6
|
+
headerPattern: new RegExp(
|
|
7
|
+
// Type
|
|
8
|
+
`^(?<type>\\S*)? ` +
|
|
9
|
+
// Scope
|
|
10
|
+
`(?:\\((?<scope>.*)\\):? )?` +
|
|
11
|
+
// Subject
|
|
12
|
+
`(?<subject>.*)$`,
|
|
13
|
+
'u'
|
|
14
|
+
),
|
|
8
15
|
headerCorrespondence: ['type', 'scope', 'subject'],
|
|
9
16
|
revertPattern: /^(?:revert|revert:)\s"?([\S\s]+?)"?\s*this reverts commit (\w*)\./i,
|
|
10
17
|
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES'],
|