@w5s/commitlint-config 3.1.15 → 3.1.16
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 +8 -8
- package/dist/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/config.ts +5 -4
- package/src/index.ts +1 -1
- package/src/meta.ts +2 -2
- package/src/plugin.ts +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
//#region src/meta.d.ts
|
|
2
|
-
declare const meta: Readonly<{
|
|
3
|
-
name: string;
|
|
4
|
-
version: string;
|
|
5
|
-
buildNumber: number;
|
|
6
|
-
}>;
|
|
7
|
-
//#endregion
|
|
8
1
|
//#region src/config.d.ts
|
|
9
2
|
declare const config: {
|
|
10
3
|
parserPreset: {
|
|
11
4
|
parserOpts: any;
|
|
12
5
|
};
|
|
13
|
-
rules: Partial<import("@commitlint/types").RulesConfig<import("@commitlint/types").RuleConfigQuality.Qualified>>;
|
|
14
6
|
plugins: import("@commitlint/types").Plugin[];
|
|
7
|
+
rules: Partial<import("@commitlint/types").RulesConfig<import("@commitlint/types").RuleConfigQuality.Qualified>>;
|
|
15
8
|
};
|
|
16
9
|
//#endregion
|
|
10
|
+
//#region src/meta.d.ts
|
|
11
|
+
declare const meta: Readonly<{
|
|
12
|
+
buildNumber: number;
|
|
13
|
+
name: string;
|
|
14
|
+
version: string;
|
|
15
|
+
}>;
|
|
16
|
+
//#endregion
|
|
17
17
|
export { config as default, meta };
|
|
18
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import { RuleConfigSeverity } from "@commitlint/types";
|
|
2
2
|
import conventionalChangelogPreset, { Emoji, GitmojiCode } from "@w5s/conventional-changelog";
|
|
3
|
-
//#region src/meta.ts
|
|
4
|
-
const meta = Object.freeze({
|
|
5
|
-
name: "@w5s/commitlint-config",
|
|
6
|
-
version: "3.1.15",
|
|
7
|
-
buildNumber: 1
|
|
8
|
-
});
|
|
9
|
-
//#endregion
|
|
10
3
|
//#region src/plugin.ts
|
|
11
4
|
const $if = (when = "always") => (cond) => when === "always" ? cond : !cond;
|
|
12
5
|
const typeGitmojiStyle = (parsed, when = "always", value = "unicode") => {
|
|
@@ -29,9 +22,10 @@ const gitmojiPlugin = { rules: {
|
|
|
29
22
|
} };
|
|
30
23
|
//#endregion
|
|
31
24
|
//#region src/config.ts
|
|
32
|
-
const { Error, Warning
|
|
25
|
+
const { Disabled, Error, Warning } = RuleConfigSeverity;
|
|
33
26
|
const config = {
|
|
34
27
|
parserPreset: { parserOpts: (await conventionalChangelogPreset()).parser },
|
|
28
|
+
plugins: [gitmojiPlugin],
|
|
35
29
|
rules: {
|
|
36
30
|
"body-leading-blank": [Warning, "always"],
|
|
37
31
|
"body-max-line-length": [
|
|
@@ -80,10 +74,16 @@ const config = {
|
|
|
80
74
|
"unicode"
|
|
81
75
|
],
|
|
82
76
|
"type-valid-gitmoji": [Error, "always"]
|
|
83
|
-
}
|
|
84
|
-
plugins: [gitmojiPlugin]
|
|
77
|
+
}
|
|
85
78
|
};
|
|
86
79
|
//#endregion
|
|
80
|
+
//#region src/meta.ts
|
|
81
|
+
const meta = Object.freeze({
|
|
82
|
+
buildNumber: 1,
|
|
83
|
+
name: "@w5s/commitlint-config",
|
|
84
|
+
version: "3.1.16"
|
|
85
|
+
});
|
|
86
|
+
//#endregion
|
|
87
87
|
export { config as default, meta };
|
|
88
88
|
|
|
89
89
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/plugin.ts","../src/config.ts","../src/meta.ts"],"sourcesContent":["import type { Plugin, Rule, RuleConfigCondition } from '@commitlint/types';\n\nimport { Emoji, GitmojiCode } from '@w5s/conventional-changelog';\n\nconst $if =\n (when: RuleConfigCondition | undefined = 'always') =>\n (cond: boolean) =>\n when === 'always' ? cond : !cond;\n\nexport const typeGitmojiStyle: Rule<'emoji' | 'unicode'> = (parsed, when = 'always', value = 'unicode') => {\n const type = parsed['type'];\n const isUnicode = type != null && Emoji.isUnicode(type);\n const isEmoji = type != null && Emoji.isText(type);\n\n return value === 'unicode'\n ? $if(when)(isUnicode)\n ? [true]\n : [false, `Type should ${when} be an unicode character`]\n : $if(when)(isEmoji)\n ? [true]\n : [false, `Type should ${when} be an valid :emoji:`];\n};\n\nexport const typeValidGitmoji: Rule = (parsed, when = 'always') => {\n const type = parsed['type'];\n const isValidGitmoji = type != null && GitmojiCode.isValid(type);\n\n return $if(when)(isValidGitmoji)\n ? [true]\n : [false, `Type should ${when} be an valid gitmoji (see https://gitmoji.dev)`];\n};\n\n/**\n * Gitmoji plugins\n */\nexport const gitmojiPlugin: Plugin = {\n rules: {\n 'type-gitmoji-style': typeGitmojiStyle,\n 'type-valid-gitmoji': typeValidGitmoji,\n },\n};\n","import { type LintOptions, type QualifiedRules, RuleConfigSeverity } from '@commitlint/types';\nimport conventionalChangelogPreset from '@w5s/conventional-changelog';\n\nimport { gitmojiPlugin } from './plugin.js';\n\nconst { Disabled, Error, Warning } = RuleConfigSeverity;\n\nconst parserPreset = {\n\n parserOpts: (await conventionalChangelogPreset()).parser as any,\n} satisfies LintOptions;\n\nconst rules: QualifiedRules = {\n 'body-leading-blank': [Warning, 'always'],\n 'body-max-line-length': [Error, 'always', 100],\n 'footer-leading-blank': [Warning, 'always'],\n 'footer-max-line-length': [Error, 'always', 100],\n 'header-max-length': [Error, 'always', 100],\n 'scope-case': [Error, 'always', 'lower-case'],\n 'subject-case': [Error, 'always', ['sentence-case']],\n 'subject-empty': [Error, 'never'],\n 'subject-exclamation-mark': [Error, 'never'],\n 'subject-full-stop': [Error, 'never', '.'],\n 'type-case': [Error, 'always', 'lower-case'],\n 'type-empty': [Error, 'never'],\n 'type-enum': [Disabled],\n 'type-gitmoji-style': [Error, 'always', 'unicode'],\n 'type-valid-gitmoji': [Error, 'always'],\n};\n\nexport const config = {\n parserPreset,\n plugins: [gitmojiPlugin],\n rules,\n};\n","export const meta = Object.freeze({\n // @ts-ignore - these variables are injected at build time\n buildNumber: 1 as number, // (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":";;;AAIA,MAAM,OACH,OAAwC,cACtC,SACC,SAAS,WAAW,OAAO,CAAC;AAElC,MAAa,oBAA+C,QAAQ,OAAO,UAAU,QAAQ,cAAc;CACzG,MAAM,OAAO,OAAO;CACpB,MAAM,YAAY,QAAQ,QAAQ,MAAM,UAAU,IAAI;CACtD,MAAM,UAAU,QAAQ,QAAQ,MAAM,OAAO,IAAI;CAEjD,OAAO,UAAU,YACb,IAAI,IAAI,CAAC,CAAC,SAAS,IACjB,CAAC,IAAI,IACL,CAAC,OAAO,eAAe,KAAK,yBAAyB,IACvD,IAAI,IAAI,CAAC,CAAC,OAAO,IACf,CAAC,IAAI,IACL,CAAC,OAAO,eAAe,KAAK,qBAAqB;AACzD;AAEA,MAAa,oBAA0B,QAAQ,OAAO,aAAa;CACjE,MAAM,OAAO,OAAO;CACpB,MAAM,iBAAiB,QAAQ,QAAQ,YAAY,QAAQ,IAAI;CAE/D,OAAO,IAAI,IAAI,CAAC,CAAC,cAAc,IAC3B,CAAC,IAAI,IACL,CAAC,OAAO,eAAe,KAAK,+CAA+C;AACjF;;;;AAKA,MAAa,gBAAwB,EACnC,OAAO;CACL,sBAAsB;CACtB,sBAAsB;AACxB,EACF;;;ACnCA,MAAM,EAAE,UAAU,OAAO,YAAY;AAyBrC,MAAa,SAAS;CACpB,gBAtBA,aAAa,MAAM,4BAA4B,EAAA,CAAG,OAsBlD;CACA,SAAS,CAAC,aAAa;CACvB;EApBA,sBAAsB,CAAC,SAAS,QAAQ;EACxC,wBAAwB;GAAC;GAAO;GAAU;EAAG;EAC7C,wBAAwB,CAAC,SAAS,QAAQ;EAC1C,0BAA0B;GAAC;GAAO;GAAU;EAAG;EAC/C,qBAAqB;GAAC;GAAO;GAAU;EAAG;EAC1C,cAAc;GAAC;GAAO;GAAU;EAAY;EAC5C,gBAAgB;GAAC;GAAO;GAAU,CAAC,eAAe;EAAC;EACnD,iBAAiB,CAAC,OAAO,OAAO;EAChC,4BAA4B,CAAC,OAAO,OAAO;EAC3C,qBAAqB;GAAC;GAAO;GAAS;EAAG;EACzC,aAAa;GAAC;GAAO;GAAU;EAAY;EAC3C,cAAc,CAAC,OAAO,OAAO;EAC7B,aAAa,CAAC,QAAQ;EACtB,sBAAsB;GAAC;GAAO;GAAU;EAAS;EACjD,sBAAsB,CAAC,OAAO,QAAQ;CAMtC;AACF;;;AClCA,MAAa,OAAO,OAAO,OAAO;CAEhC,aAAa;CAEb,MAAA;CAEA,SAAA;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@w5s/commitlint-config",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.16",
|
|
4
4
|
"description": "Commitlint configuration presets",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"commitlint",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@commitlint/types": "^21.0.0",
|
|
40
|
-
"@w5s/conventional-changelog": "^3.2.
|
|
40
|
+
"@w5s/conventional-changelog": "^3.2.8"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@commitlint/cli": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0"
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
56
|
"sideEffect": false,
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "e6c63e0164ce2199e59bdca360f4766b6a78584d"
|
|
58
58
|
}
|
package/src/config.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type LintOptions, type QualifiedRules, RuleConfigSeverity } from '@commitlint/types';
|
|
2
2
|
import conventionalChangelogPreset from '@w5s/conventional-changelog';
|
|
3
|
+
|
|
3
4
|
import { gitmojiPlugin } from './plugin.js';
|
|
4
5
|
|
|
5
|
-
const { Error, Warning
|
|
6
|
+
const { Disabled, Error, Warning } = RuleConfigSeverity;
|
|
6
7
|
|
|
7
8
|
const parserPreset = {
|
|
8
|
-
|
|
9
|
+
|
|
9
10
|
parserOpts: (await conventionalChangelogPreset()).parser as any,
|
|
10
11
|
} satisfies LintOptions;
|
|
11
12
|
|
|
@@ -29,6 +30,6 @@ const rules: QualifiedRules = {
|
|
|
29
30
|
|
|
30
31
|
export const config = {
|
|
31
32
|
parserPreset,
|
|
32
|
-
rules,
|
|
33
33
|
plugins: [gitmojiPlugin],
|
|
34
|
+
rules,
|
|
34
35
|
};
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const meta = Object.freeze({
|
|
2
|
+
// @ts-ignore - these variables are injected at build time
|
|
3
|
+
buildNumber: 1 as number, // (typeof __PACKAGE_BUILD_NUMBER__ === 'undefined' ? 0 : __PACKAGE_BUILD_NUMBER__) as number,
|
|
2
4
|
// @ts-ignore - these variables are injected at build time
|
|
3
5
|
name: (typeof __PACKAGE_NAME__ === 'undefined' ? '' : __PACKAGE_NAME__) as string,
|
|
4
6
|
// @ts-ignore - these variables are injected at build time
|
|
5
7
|
version: (typeof __PACKAGE_VERSION__ === 'undefined' ? '' : __PACKAGE_VERSION__) as string,
|
|
6
|
-
// @ts-ignore - these variables are injected at build time
|
|
7
|
-
buildNumber: 1 as number, // (typeof __PACKAGE_BUILD_NUMBER__ === 'undefined' ? 0 : __PACKAGE_BUILD_NUMBER__) as number,
|
|
8
8
|
});
|
package/src/plugin.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Plugin, Rule, RuleConfigCondition } from '@commitlint/types';
|
|
2
|
+
|
|
2
3
|
import { Emoji, GitmojiCode } from '@w5s/conventional-changelog';
|
|
3
4
|
|
|
4
5
|
const $if =
|
|
@@ -6,7 +7,7 @@ const $if =
|
|
|
6
7
|
(cond: boolean) =>
|
|
7
8
|
when === 'always' ? cond : !cond;
|
|
8
9
|
|
|
9
|
-
export const typeGitmojiStyle: Rule<'
|
|
10
|
+
export const typeGitmojiStyle: Rule<'emoji' | 'unicode'> = (parsed, when = 'always', value = 'unicode') => {
|
|
10
11
|
const type = parsed['type'];
|
|
11
12
|
const isUnicode = type != null && Emoji.isUnicode(type);
|
|
12
13
|
const isEmoji = type != null && Emoji.isText(type);
|