commitlint-plugin-function-rules 3.1.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.
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commitlint-plugin-function-rules",
3
- "version": "3.1.0",
3
+ "version": "4.0.0-beta.1",
4
4
  "description": "commitlint plugin to use functions as rule value",
5
5
  "keywords": [
6
6
  "commitlint",
@@ -20,24 +20,17 @@
20
20
  "license": "GPL-3.0-or-later",
21
21
  "author": "Jeroen de Bruijn",
22
22
  "type": "module",
23
- "exports": {
24
- ".": {
25
- "import": "./dist/plugin.js",
26
- "require": "./dist/index.cjs"
27
- }
28
- },
23
+ "exports": "./dist/index.js",
29
24
  "files": [
30
25
  "./dist/**/!(*.test).{js,d.ts,cjs}"
31
26
  ],
32
27
  "scripts": {
33
- "build": "npm run build:esm && npm run build:cjs",
34
- "build:cjs": "esbuild src/index.ts --bundle --target=ES2022 --platform=node --outfile=dist/index.cjs",
35
- "build:esm": "tsc",
28
+ "build": "tsc",
36
29
  "format": "prettier --ignore-path .gitignore --write \"**/*.{vue,css,less,scss,html,htm,json,md,markdown,yml,yaml}\" --log-level warn",
37
30
  "format:check": "prettier --ignore-path .gitignore --check \"**/*.{vue,css,less,scss,html,htm,json,md,markdown,yml,yaml}\" --log-level warn",
38
31
  "lint": "npm run format:check && xo",
39
32
  "lint:fix": "npm run format && xo --fix",
40
- "prepare": "husky install .github/husky",
33
+ "prepare": "husky .github/husky",
41
34
  "test": "c8 ava"
42
35
  },
43
36
  "xo": {
@@ -193,49 +186,30 @@
193
186
  },
194
187
  "devDependencies": {
195
188
  "@ava/typescript": "4.1.0",
196
- "@commitlint/cli": "18.6.0",
197
- "@commitlint/config-conventional": "18.6.0",
198
- "@commitlint/lint-10.x": "npm:@commitlint/lint@10.0.0",
199
- "@commitlint/lint-11.x": "npm:@commitlint/lint@11.0.0",
200
- "@commitlint/lint-12.x": "npm:@commitlint/lint@12.1.4",
201
- "@commitlint/lint-13.x": "npm:@commitlint/lint@13.2.0",
202
- "@commitlint/lint-14.x": "npm:@commitlint/lint@14.1.0",
203
- "@commitlint/lint-15.x": "npm:@commitlint/lint@15.0.0",
204
- "@commitlint/lint-16.x": "npm:@commitlint/lint@16.2.4",
205
- "@commitlint/lint-17.x": "npm:@commitlint/lint@17.8.1",
206
- "@commitlint/lint-18.x": "npm:@commitlint/lint@18.6.0",
207
- "@commitlint/lint-9.x": "npm:@commitlint/lint@9.1.2",
208
- "@commitlint/load-10.x": "npm:@commitlint/load@10.0.0",
209
- "@commitlint/load-11.x": "npm:@commitlint/load@11.0.0",
210
- "@commitlint/load-12.x": "npm:@commitlint/load@12.1.4",
211
- "@commitlint/load-13.x": "npm:@commitlint/load@13.2.1",
212
- "@commitlint/load-14.x": "npm:@commitlint/load@14.1.0",
213
- "@commitlint/load-15.x": "npm:@commitlint/load@15.0.0",
214
- "@commitlint/load-16.x": "npm:@commitlint/load@16.3.0",
215
- "@commitlint/load-17.x": "npm:@commitlint/load@17.8.1",
216
- "@commitlint/load-18.x": "npm:@commitlint/load@18.6.0",
217
- "@commitlint/load-9.x": "npm:@commitlint/load@9.1.2",
218
- "@commitlint/rules": "18.6.0",
219
- "@commitlint/types": "18.6.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",
220
195
  "@semantic-release/changelog": "6.0.3",
221
196
  "@semantic-release/exec": "6.0.3",
222
197
  "@semantic-release/git": "10.0.1",
223
198
  "@types/sinon": "17.0.3",
224
- "ava": "6.1.1",
199
+ "ava": "6.1.2",
225
200
  "c8": "9.1.0",
226
- "esbuild": "0.20.0",
227
- "husky": "8.0.3",
201
+ "husky": "9.0.11",
228
202
  "lint-staged": "15.2.2",
229
203
  "prettier": "3.2.5",
230
204
  "semantic-release": "23.0.2",
231
205
  "sinon": "17.0.1",
232
- "typescript": "5.3.3",
233
- "xo": "0.57.0"
206
+ "typescript": "5.4.2",
207
+ "xo": "0.58.0"
234
208
  },
235
209
  "peerDependencies": {
236
- "@commitlint/lint": ">=9.1.2 <19"
210
+ "@commitlint/lint": ">=19 <20"
237
211
  },
238
212
  "engines": {
239
- "node": ">=18"
213
+ "node": ">=20"
240
214
  }
241
215
  }
package/dist/index.cjs DELETED
@@ -1,58 +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/header-trim": functionRule,
33
- "function-rules/references-empty": functionRule,
34
- "function-rules/scope-case": functionRule,
35
- "function-rules/scope-empty": functionRule,
36
- "function-rules/scope-enum": functionRule,
37
- "function-rules/scope-max-length": functionRule,
38
- "function-rules/scope-min-length": functionRule,
39
- "function-rules/signed-off-by": functionRule,
40
- "function-rules/subject-case": functionRule,
41
- "function-rules/subject-empty": functionRule,
42
- "function-rules/subject-exclamation-mark": functionRule,
43
- "function-rules/subject-full-stop": functionRule,
44
- "function-rules/subject-max-length": functionRule,
45
- "function-rules/subject-min-length": functionRule,
46
- "function-rules/trailer-exists": functionRule,
47
- "function-rules/type-case": functionRule,
48
- "function-rules/type-empty": functionRule,
49
- "function-rules/type-enum": functionRule,
50
- "function-rules/type-max-length": functionRule,
51
- "function-rules/type-min-length": functionRule
52
- };
53
-
54
- // src/plugin.ts
55
- var plugin = { rules };
56
-
57
- // src/index.ts
58
- 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