commitlint-plugin-function-rules 3.0.0 → 4.0.0-beta.1

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/README.md CHANGED
@@ -58,7 +58,7 @@ module.exports = {
58
58
 
59
59
  ## Contributing
60
60
 
61
- Please [create an issue](https://github.com/vidavidorra/commitlint-plugin-function-rules/issues/new/choose) if you have a bug report or feature proposal, or [create a discussion](https://github.com/vidavidorra/commitlint-plugin-function-rules/discussions) if you have a question. If you like this project, please consider giving it a star ⭐ and/or become a [sponsor](https://github.com/sponsors/jdbruijn) to support my work.
61
+ Please [create an issue](https://github.com/vidavidorra/commitlint-plugin-function-rules/issues/new/choose) if you have a bug report or feature proposal, or [create a discussion](https://github.com/vidavidorra/commitlint-plugin-function-rules/discussions) if you have a question. If you like this project, please consider giving it a star ⭐
62
62
 
63
63
  Refer to the [contributing guide](https://github.com/vidavidorra/.github/blob/main/CONTRIBUTING.md) detailed information about other contributions, like pull requests.
64
64
 
@@ -74,7 +74,7 @@ Please refer to the [Security Policy on GitHub](https://github.com/vidavidorra/c
74
74
 
75
75
  This project is licensed under the [GPLv3 license](https://www.gnu.org/licenses/gpl.html).
76
76
 
77
- Copyright © 2020-2023 Jeroen de Bruijn
77
+ Copyright © 2020-2024 Jeroen de Bruijn
78
78
 
79
79
  <details><summary>License notice</summary>
80
80
  <p>
@@ -1,4 +1,5 @@
1
- import { type Commit, type Rule, type RuleConfigCondition, type RuleOutcome } from '@commitlint/types';
1
+ import { type Rule, type RuleConfigCondition, type RuleOutcome } from '@commitlint/types';
2
+ type Commit = Parameters<Rule>[0];
2
3
  type FunctionRule = (parsed: Commit, when: RuleConfigCondition) => RuleOutcome | Promise<RuleOutcome>;
3
4
  declare const functionRule: Rule<FunctionRule>;
4
- export { type FunctionRule, functionRule };
5
+ export { type Commit, functionRule };
package/dist/index.d.ts CHANGED
@@ -1,9 +1 @@
1
- import { plugin } from './plugin.js';
2
- /**
3
- * Export single object, according to the CommonJS model. The CommonJS module is
4
- * explicitly used here as that's the kind of module commitlint requires for
5
- * shareable configurations. This project is an ES module for ease of
6
- * development, and thus requires the error for an export assignment to be
7
- * disabled.
8
- */
9
- export = plugin;
1
+ export { rules } from './rules.js';
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { plugin } from './plugin.js';
1
+ export { rules } from './rules.js';
2
2
  //# sourceMappingURL=index.js.map
package/dist/rules.js CHANGED
@@ -16,6 +16,7 @@ const rules = {
16
16
  'function-rules/header-full-stop': functionRule,
17
17
  'function-rules/header-max-length': functionRule,
18
18
  'function-rules/header-min-length': functionRule,
19
+ 'function-rules/header-trim': functionRule,
19
20
  'function-rules/references-empty': functionRule,
20
21
  'function-rules/scope-case': functionRule,
21
22
  'function-rules/scope-empty': functionRule,
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "commitlint-plugin-function-rules",
3
- "version": "3.0.0",
4
- "description": "commitlint plugin to define rules as functions.",
3
+ "version": "4.0.0-beta.1",
4
+ "description": "commitlint plugin to use functions as rule value",
5
5
  "keywords": [
6
6
  "commitlint",
7
7
  "commitlintplugin",
8
+ "function",
8
9
  "plugin",
9
10
  "rules"
10
11
  ],
@@ -19,24 +20,17 @@
19
20
  "license": "GPL-3.0-or-later",
20
21
  "author": "Jeroen de Bruijn",
21
22
  "type": "module",
22
- "exports": {
23
- ".": {
24
- "import": "./dist/plugin.js",
25
- "require": "./dist/index.cjs"
26
- }
27
- },
23
+ "exports": "./dist/index.js",
28
24
  "files": [
29
25
  "./dist/**/!(*.test).{js,d.ts,cjs}"
30
26
  ],
31
27
  "scripts": {
32
- "build": "npm run build:esm && npm run build:cjs",
33
- "build:cjs": "esbuild src/index.ts --bundle --target=ES2022 --platform=node --outfile=dist/index.cjs",
34
- "build:esm": "tsc",
28
+ "build": "tsc",
35
29
  "format": "prettier --ignore-path .gitignore --write \"**/*.{vue,css,less,scss,html,htm,json,md,markdown,yml,yaml}\" --log-level warn",
36
30
  "format:check": "prettier --ignore-path .gitignore --check \"**/*.{vue,css,less,scss,html,htm,json,md,markdown,yml,yaml}\" --log-level warn",
37
31
  "lint": "npm run format:check && xo",
38
32
  "lint:fix": "npm run format && xo --fix",
39
- "prepare": "husky install .github/husky",
33
+ "prepare": "husky .github/husky",
40
34
  "test": "c8 ava"
41
35
  },
42
36
  "xo": {
@@ -192,49 +186,30 @@
192
186
  },
193
187
  "devDependencies": {
194
188
  "@ava/typescript": "4.1.0",
195
- "@commitlint/cli": "18.2.0",
196
- "@commitlint/config-conventional": "18.1.0",
197
- "@commitlint/lint-10.x": "npm:@commitlint/lint@10.0.0",
198
- "@commitlint/lint-11.x": "npm:@commitlint/lint@11.0.0",
199
- "@commitlint/lint-12.x": "npm:@commitlint/lint@12.1.4",
200
- "@commitlint/lint-13.x": "npm:@commitlint/lint@13.2.0",
201
- "@commitlint/lint-14.x": "npm:@commitlint/lint@14.1.0",
202
- "@commitlint/lint-15.x": "npm:@commitlint/lint@15.0.0",
203
- "@commitlint/lint-16.x": "npm:@commitlint/lint@16.2.4",
204
- "@commitlint/lint-17.x": "npm:@commitlint/lint@17.8.1",
205
- "@commitlint/lint-18.x": "npm:@commitlint/lint@18.1.0",
206
- "@commitlint/lint-9.x": "npm:@commitlint/lint@9.1.2",
207
- "@commitlint/load-10.x": "npm:@commitlint/load@10.0.0",
208
- "@commitlint/load-11.x": "npm:@commitlint/load@11.0.0",
209
- "@commitlint/load-12.x": "npm:@commitlint/load@12.1.4",
210
- "@commitlint/load-13.x": "npm:@commitlint/load@13.2.1",
211
- "@commitlint/load-14.x": "npm:@commitlint/load@14.1.0",
212
- "@commitlint/load-15.x": "npm:@commitlint/load@15.0.0",
213
- "@commitlint/load-16.x": "npm:@commitlint/load@16.3.0",
214
- "@commitlint/load-17.x": "npm:@commitlint/load@17.8.1",
215
- "@commitlint/load-18.x": "npm:@commitlint/load@18.2.0",
216
- "@commitlint/load-9.x": "npm:@commitlint/load@9.1.2",
217
- "@commitlint/rules": "18.1.0",
218
- "@commitlint/types": "18.1.0",
189
+ "@commitlint/cli": "19.2.0",
190
+ "@commitlint/config-conventional": "19.1.0",
191
+ "@commitlint/lint-19.x": "npm:@commitlint/lint@19.1.0",
192
+ "@commitlint/load-19.x": "npm:@commitlint/load@19.1.0",
193
+ "@commitlint/rules": "19.0.3",
194
+ "@commitlint/types": "19.0.3",
219
195
  "@semantic-release/changelog": "6.0.3",
220
196
  "@semantic-release/exec": "6.0.3",
221
197
  "@semantic-release/git": "10.0.1",
222
- "@types/sinon": "17.0.0",
223
- "ava": "5.3.1",
224
- "c8": "8.0.1",
225
- "esbuild": "0.19.5",
226
- "husky": "8.0.3",
227
- "lint-staged": "15.0.2",
228
- "prettier": "3.0.3",
229
- "semantic-release": "22.0.7",
198
+ "@types/sinon": "17.0.3",
199
+ "ava": "6.1.2",
200
+ "c8": "9.1.0",
201
+ "husky": "9.0.11",
202
+ "lint-staged": "15.2.2",
203
+ "prettier": "3.2.5",
204
+ "semantic-release": "23.0.2",
230
205
  "sinon": "17.0.1",
231
- "typescript": "5.2.2",
232
- "xo": "0.56.0"
206
+ "typescript": "5.4.2",
207
+ "xo": "0.58.0"
233
208
  },
234
209
  "peerDependencies": {
235
- "@commitlint/lint": ">=9.1.2 <19"
210
+ "@commitlint/lint": ">=19 <20"
236
211
  },
237
212
  "engines": {
238
- "node": ">=18"
213
+ "node": ">=20"
239
214
  }
240
215
  }
package/dist/index.cjs DELETED
@@ -1,57 +0,0 @@
1
- "use strict";
2
-
3
- // src/function-rule.ts
4
- var functionRule = async (parsed, when = "always", functionRule2) => {
5
- if (functionRule2 === void 0) {
6
- return [true];
7
- }
8
- if (typeof functionRule2 !== "function") {
9
- throw new TypeError("Not a valid function!");
10
- }
11
- return functionRule2(parsed, when);
12
- };
13
-
14
- // src/rules.ts
15
- var rules = {
16
- "function-rules/body-case": functionRule,
17
- "function-rules/body-empty": functionRule,
18
- "function-rules/body-full-stop": functionRule,
19
- "function-rules/body-leading-blank": functionRule,
20
- "function-rules/body-max-length": functionRule,
21
- "function-rules/body-max-line-length": functionRule,
22
- "function-rules/body-min-length": functionRule,
23
- "function-rules/footer-empty": functionRule,
24
- "function-rules/footer-leading-blank": functionRule,
25
- "function-rules/footer-max-length": functionRule,
26
- "function-rules/footer-max-line-length": functionRule,
27
- "function-rules/footer-min-length": functionRule,
28
- "function-rules/header-case": functionRule,
29
- "function-rules/header-full-stop": functionRule,
30
- "function-rules/header-max-length": functionRule,
31
- "function-rules/header-min-length": functionRule,
32
- "function-rules/references-empty": functionRule,
33
- "function-rules/scope-case": functionRule,
34
- "function-rules/scope-empty": functionRule,
35
- "function-rules/scope-enum": functionRule,
36
- "function-rules/scope-max-length": functionRule,
37
- "function-rules/scope-min-length": functionRule,
38
- "function-rules/signed-off-by": functionRule,
39
- "function-rules/subject-case": functionRule,
40
- "function-rules/subject-empty": functionRule,
41
- "function-rules/subject-exclamation-mark": functionRule,
42
- "function-rules/subject-full-stop": functionRule,
43
- "function-rules/subject-max-length": functionRule,
44
- "function-rules/subject-min-length": functionRule,
45
- "function-rules/trailer-exists": functionRule,
46
- "function-rules/type-case": functionRule,
47
- "function-rules/type-empty": functionRule,
48
- "function-rules/type-enum": functionRule,
49
- "function-rules/type-max-length": functionRule,
50
- "function-rules/type-min-length": functionRule
51
- };
52
-
53
- // src/plugin.ts
54
- var plugin = { rules };
55
-
56
- // src/index.ts
57
- module.exports = plugin;
package/dist/plugin.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { type Plugin } from '@commitlint/types';
2
- declare const plugin: Plugin;
3
- export { plugin };
package/dist/plugin.js DELETED
@@ -1,4 +0,0 @@
1
- import { rules } from './rules.js';
2
- const plugin = { rules };
3
- export { plugin };
4
- //# sourceMappingURL=plugin.js.map