@w5s/commitlint-config 1.0.0-alpha.5 → 1.0.0-alpha.6

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/index.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ declare const config: {
2
+ rules: Partial<import("@commitlint/types").RulesConfig<import("@commitlint/types").RuleConfigQuality.Qualified>>;
3
+ parserPreset: {
4
+ parserOpts: {
5
+ headerPattern: RegExp;
6
+ headerCorrespondence: string[];
7
+ };
8
+ plugins: {
9
+ gitmoji: import("@commitlint/types").Plugin;
10
+ };
11
+ };
12
+ plugins: import("@commitlint/types").Plugin[];
13
+ };
14
+ export default config;
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAyBA,QAAA,MAAM,MAAM;;;;;;;;;;;;CASX,CAAC;AAMF,eAAe,MAAM,CAAC"}
package/lib/index.js ADDED
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ /* eslint-disable import/no-import-module-exports */
7
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
8
+ var types_1 = require("@commitlint/types");
9
+ var commitlint_plugin_gitmoji_1 = __importDefault(require("commitlint-plugin-gitmoji"));
10
+ var parser_opts_1 = __importDefault(require("@gitmoji/parser-opts"));
11
+ var commit_types_1 = __importDefault(require("@gitmoji/commit-types"));
12
+ var Error = types_1.RuleConfigSeverity.Error, Warning = types_1.RuleConfigSeverity.Warning, Disabled = types_1.RuleConfigSeverity.Disabled;
13
+ var rules = {
14
+ 'start-with-gitmoji': [Error, 'always'],
15
+ 'body-leading-blank': [Warning, 'always'],
16
+ 'body-max-line-length': [Error, 'always', 100],
17
+ 'footer-leading-blank': [Warning, 'always'],
18
+ 'footer-max-line-length': [Error, 'always', 100],
19
+ 'header-max-length': [Error, 'always', 72],
20
+ 'scope-case': [Error, 'always', 'lower-case'],
21
+ 'subject-case': [Error, 'always', ['sentence-case']],
22
+ 'subject-empty': [Disabled, 'never'],
23
+ 'subject-full-stop': [Error, 'never', '.'],
24
+ 'type-case': [Error, 'always', 'lower-case'],
25
+ 'type-empty': [Error, 'always'],
26
+ 'type-enum': [Error, 'always', commit_types_1.default],
27
+ };
28
+ var config = {
29
+ rules: rules,
30
+ parserPreset: {
31
+ parserOpts: parser_opts_1.default,
32
+ plugins: {
33
+ gitmoji: commitlint_plugin_gitmoji_1.default,
34
+ },
35
+ },
36
+ plugins: [commitlint_plugin_gitmoji_1.default],
37
+ };
38
+ // FIXME: this is a workaround for commonjs loading
39
+ if (typeof module !== 'undefined') {
40
+ module.exports = config;
41
+ }
42
+ exports.default = config;
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,oDAAoD;AACpD,4DAA4D;AAC5D,2CAA4E;AAC5E,wFAAsD;AACtD,qEAAqD;AACrD,uEAAgD;AAExC,IAAA,KAAK,GAAwB,0BAAkB,MAA1C,EAAE,OAAO,GAAe,0BAAkB,QAAjC,EAAE,QAAQ,GAAK,0BAAkB,SAAvB,CAAwB;AAExD,IAAM,KAAK,GAAmB;IAC5B,oBAAoB,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;IACvC,oBAAoB,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC;IACzC,sBAAsB,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,CAAC;IAC9C,sBAAsB,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC;IAC3C,wBAAwB,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,CAAC;IAChD,mBAAmB,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC;IAC1C,YAAY,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,YAAY,CAAC;IAC7C,cAAc,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,CAAC;IACpD,eAAe,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;IACpC,mBAAmB,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC;IAC1C,WAAW,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,YAAY,CAAC;IAC5C,YAAY,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;IAC/B,WAAW,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,sBAAW,CAAC;CAC5C,CAAC;AAEF,IAAM,MAAM,GAAG;IACb,KAAK,OAAA;IACL,YAAY,EAAE;QACZ,UAAU,EAAE,qBAAiB;QAC7B,OAAO,EAAE;YACP,OAAO,EAAE,mCAAa;SACvB;KACF;IACD,OAAO,EAAE,CAAC,mCAAa,CAAC;CACzB,CAAC;AACF,mDAAmD;AACnD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACjC,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC;CACzB;AAED,kBAAe,MAAM,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w5s/commitlint-config",
3
- "version": "1.0.0-alpha.5",
3
+ "version": "1.0.0-alpha.6",
4
4
  "description": "Commitlint configuration presets",
5
5
  "keywords": [
6
6
  "commitlint",
@@ -18,22 +18,49 @@
18
18
  },
19
19
  "license": "MIT",
20
20
  "author": "Julien Polo <julien.polo@gmail.com>",
21
- "main": "commitlint.config.js",
21
+ "type": "commonjs",
22
+ "exports": "./lib/index.js",
22
23
  "files": [
23
- "commitlint.config.js"
24
+ "lib/**/!(*.spec).d.ts",
25
+ "lib/**/!(*.spec).d.ts.map",
26
+ "lib/**/!(*.spec).js.map",
27
+ "lib/**/!(*.spec).js",
28
+ "src/**/!(*.spec).ts"
24
29
  ],
25
30
  "scripts": {
26
31
  "build": "npm-run-all -p 'build:*'",
27
- "build:empty": ":",
32
+ "build:src": "tsc",
33
+ "clean": "tsc -- --build --clean",
28
34
  "docs": "md-magic --path '**/*.md' --ignore='node_modules'",
29
35
  "format": "eslint . --fix --ext=mjs,cjs,js,jsx,ts,tsx,json",
30
36
  "lint": "eslint . --ext=mjs,cjs,js,jsx,ts,tsx,json",
31
37
  "spellcheck": "cspell --no-progress '**'",
32
- "test": "exit 0",
33
- "test:git-log": "cd ../..;npm exec -- commitlint --from HEAD~3 --to HEAD --verbose"
38
+ "test": "jest",
39
+ "validate": "npm run lint && npm run build && npm run test"
40
+ },
41
+ "jest": {
42
+ "moduleNameMapper": {
43
+ "^(\\.{1,2}/.*)\\.js$": "$1"
44
+ },
45
+ "preset": "es-jest",
46
+ "testPathIgnorePatterns": [
47
+ "/node_modules/",
48
+ "/lib/",
49
+ "/build/",
50
+ "/.cache/",
51
+ "/docs/",
52
+ "/public/"
53
+ ]
34
54
  },
35
55
  "dependencies": {
36
- "@commitlint/config-conventional": "^17.0.0"
56
+ "@commitlint/types": "^17.0.0",
57
+ "@gitmoji/commit-types": "^1.1.5",
58
+ "@gitmoji/parser-opts": "^1.3.0",
59
+ "commitlint-plugin-gitmoji": "^2.2.0"
60
+ },
61
+ "devDependencies": {
62
+ "@commitlint/lint": "^17.0.0",
63
+ "@jest/globals": "^28.0.0"
37
64
  },
38
65
  "peerDependencies": {
39
66
  "@commitlint/cli": "^16.0.0 || ^17.0.0"
@@ -41,5 +68,5 @@
41
68
  "publishConfig": {
42
69
  "access": "public"
43
70
  },
44
- "gitHead": "55a9106dcf41315e4a1e0fa73b912853c6cf6f06"
71
+ "gitHead": "b24d9aa790950ac545776a79d9a58a637e8f4903"
45
72
  }
package/src/index.ts ADDED
@@ -0,0 +1,41 @@
1
+ /* eslint-disable import/no-import-module-exports */
2
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
3
+ import { RuleConfigSeverity, type QualifiedRules } from '@commitlint/types';
4
+ import gitmojiPlugin from 'commitlint-plugin-gitmoji';
5
+ import gitmojiParserOpts from '@gitmoji/parser-opts';
6
+ import commitTypes from '@gitmoji/commit-types';
7
+
8
+ const { Error, Warning, Disabled } = RuleConfigSeverity;
9
+
10
+ const rules: QualifiedRules = {
11
+ 'start-with-gitmoji': [Error, 'always'],
12
+ 'body-leading-blank': [Warning, 'always'],
13
+ 'body-max-line-length': [Error, 'always', 100],
14
+ 'footer-leading-blank': [Warning, 'always'],
15
+ 'footer-max-line-length': [Error, 'always', 100],
16
+ 'header-max-length': [Error, 'always', 72],
17
+ 'scope-case': [Error, 'always', 'lower-case'],
18
+ 'subject-case': [Error, 'always', ['sentence-case']],
19
+ 'subject-empty': [Disabled, 'never'], // [Error, 'never'],
20
+ 'subject-full-stop': [Error, 'never', '.'],
21
+ 'type-case': [Error, 'always', 'lower-case'],
22
+ 'type-empty': [Error, 'always'],
23
+ 'type-enum': [Error, 'always', commitTypes],
24
+ };
25
+
26
+ const config = {
27
+ rules,
28
+ parserPreset: {
29
+ parserOpts: gitmojiParserOpts,
30
+ plugins: {
31
+ gitmoji: gitmojiPlugin,
32
+ },
33
+ },
34
+ plugins: [gitmojiPlugin],
35
+ };
36
+ // FIXME: this is a workaround for commonjs loading
37
+ if (typeof module !== 'undefined') {
38
+ module.exports = config;
39
+ }
40
+
41
+ export default config;
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- extends: ['@commitlint/config-conventional'],
3
- };