@icebreakers/commitlint-config 4.0.6 → 4.1.0

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.cjs CHANGED
@@ -19,7 +19,7 @@ var __copyProps = (to, from, except, desc) => {
19
19
  }
20
20
  return to;
21
21
  };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
23
23
  value: mod,
24
24
  enumerable: true
25
25
  }) : target, mod));
@@ -110,8 +110,10 @@ function buildScopeRules(options) {
110
110
  "always",
111
111
  scopeValues
112
112
  ];
113
- if (options.required !== void 0) if (options.required) rules["scope-empty"] = [severity, "never"];
114
- else rules["scope-empty"] = [_commitlint_types.RuleConfigSeverity.Disabled];
113
+ if (options.required !== void 0) {
114
+ if (options.required) rules["scope-empty"] = [severity, "never"];
115
+ else rules["scope-empty"] = [_commitlint_types.RuleConfigSeverity.Disabled];
116
+ }
115
117
  const scopeCases = mergeUnique(asArray(options.case));
116
118
  if (scopeCases.length > 0) rules["scope-case"] = [
117
119
  severity,
@@ -129,14 +131,18 @@ function buildSubjectRules(options) {
129
131
  options.caseCondition ?? "never",
130
132
  forbiddenCases
131
133
  ];
132
- if (options.allowEmpty !== void 0) if (options.allowEmpty) rules["subject-empty"] = [_commitlint_types.RuleConfigSeverity.Disabled];
133
- else rules["subject-empty"] = [options.allowEmptySeverity ?? _commitlint_types.RuleConfigSeverity.Error, "never"];
134
- if (options.fullStop !== void 0) if (options.fullStop) rules["subject-full-stop"] = [
135
- options.fullStopSeverity ?? _commitlint_types.RuleConfigSeverity.Error,
136
- "always",
137
- options.fullStopCharacter ?? "."
138
- ];
139
- else rules["subject-full-stop"] = [_commitlint_types.RuleConfigSeverity.Disabled];
134
+ if (options.allowEmpty !== void 0) {
135
+ if (options.allowEmpty) rules["subject-empty"] = [_commitlint_types.RuleConfigSeverity.Disabled];
136
+ else rules["subject-empty"] = [options.allowEmptySeverity ?? _commitlint_types.RuleConfigSeverity.Error, "never"];
137
+ }
138
+ if (options.fullStop !== void 0) {
139
+ if (options.fullStop) rules["subject-full-stop"] = [
140
+ options.fullStopSeverity ?? _commitlint_types.RuleConfigSeverity.Error,
141
+ "always",
142
+ options.fullStopCharacter ?? "."
143
+ ];
144
+ else rules["subject-full-stop"] = [_commitlint_types.RuleConfigSeverity.Disabled];
145
+ }
140
146
  return rules;
141
147
  }
142
148
  function buildHeaderRules(options) {
package/dist/index.d.cts CHANGED
@@ -44,9 +44,9 @@ interface IcebreakerCommitlintOptions {
44
44
  }
45
45
  //#endregion
46
46
  //#region src/index.d.ts
47
- declare function createIcebreakerCommitlintConfig(options?: IcebreakerCommitlintOptions): UserConfig$1;
48
- declare function icebreaker(options?: IcebreakerCommitlintOptions): UserConfig$1;
49
- type IcebreakerCommitlintConfig = ReturnType<typeof icebreaker>;
47
+ export declare function createIcebreakerCommitlintConfig(options?: IcebreakerCommitlintOptions): UserConfig$1;
48
+ export declare function icebreaker(options?: IcebreakerCommitlintOptions): UserConfig$1;
49
+ export type IcebreakerCommitlintConfig = ReturnType<typeof icebreaker>;
50
50
  declare const _default: UserConfig$1;
51
51
  //#endregion
52
- export { type CommitHeaderOptions, type CommitScopeOptions, type CommitSubjectOptions, type CommitTypeDefinition, type CommitTypesOptions, type UserConfig as CommitlintUserConfig, IcebreakerCommitlintConfig, type IcebreakerCommitlintOptions, RuleConfigSeverity, createIcebreakerCommitlintConfig, _default as default, icebreaker };
52
+ export { type CommitHeaderOptions, type CommitScopeOptions, type CommitSubjectOptions, type CommitTypeDefinition, type CommitTypesOptions, type UserConfig as CommitlintUserConfig, type IcebreakerCommitlintOptions, RuleConfigSeverity, _default as default };
package/dist/index.d.ts CHANGED
@@ -44,9 +44,9 @@ interface IcebreakerCommitlintOptions {
44
44
  }
45
45
  //#endregion
46
46
  //#region src/index.d.ts
47
- declare function createIcebreakerCommitlintConfig(options?: IcebreakerCommitlintOptions): UserConfig$1;
48
- declare function icebreaker(options?: IcebreakerCommitlintOptions): UserConfig$1;
49
- type IcebreakerCommitlintConfig = ReturnType<typeof icebreaker>;
47
+ export declare function createIcebreakerCommitlintConfig(options?: IcebreakerCommitlintOptions): UserConfig$1;
48
+ export declare function icebreaker(options?: IcebreakerCommitlintOptions): UserConfig$1;
49
+ export type IcebreakerCommitlintConfig = ReturnType<typeof icebreaker>;
50
50
  declare const _default: UserConfig$1;
51
51
  //#endregion
52
- export { type CommitHeaderOptions, type CommitScopeOptions, type CommitSubjectOptions, type CommitTypeDefinition, type CommitTypesOptions, type UserConfig as CommitlintUserConfig, IcebreakerCommitlintConfig, type IcebreakerCommitlintOptions, RuleConfigSeverity, createIcebreakerCommitlintConfig, _default as default, icebreaker };
52
+ export { type CommitHeaderOptions, type CommitScopeOptions, type CommitSubjectOptions, type CommitTypeDefinition, type CommitTypesOptions, type UserConfig as CommitlintUserConfig, type IcebreakerCommitlintOptions, RuleConfigSeverity, _default as default };
package/dist/index.js CHANGED
@@ -83,8 +83,10 @@ function buildScopeRules(options) {
83
83
  "always",
84
84
  scopeValues
85
85
  ];
86
- if (options.required !== void 0) if (options.required) rules["scope-empty"] = [severity, "never"];
87
- else rules["scope-empty"] = [RuleConfigSeverity.Disabled];
86
+ if (options.required !== void 0) {
87
+ if (options.required) rules["scope-empty"] = [severity, "never"];
88
+ else rules["scope-empty"] = [RuleConfigSeverity.Disabled];
89
+ }
88
90
  const scopeCases = mergeUnique(asArray(options.case));
89
91
  if (scopeCases.length > 0) rules["scope-case"] = [
90
92
  severity,
@@ -102,14 +104,18 @@ function buildSubjectRules(options) {
102
104
  options.caseCondition ?? "never",
103
105
  forbiddenCases
104
106
  ];
105
- if (options.allowEmpty !== void 0) if (options.allowEmpty) rules["subject-empty"] = [RuleConfigSeverity.Disabled];
106
- else rules["subject-empty"] = [options.allowEmptySeverity ?? RuleConfigSeverity.Error, "never"];
107
- if (options.fullStop !== void 0) if (options.fullStop) rules["subject-full-stop"] = [
108
- options.fullStopSeverity ?? RuleConfigSeverity.Error,
109
- "always",
110
- options.fullStopCharacter ?? "."
111
- ];
112
- else rules["subject-full-stop"] = [RuleConfigSeverity.Disabled];
107
+ if (options.allowEmpty !== void 0) {
108
+ if (options.allowEmpty) rules["subject-empty"] = [RuleConfigSeverity.Disabled];
109
+ else rules["subject-empty"] = [options.allowEmptySeverity ?? RuleConfigSeverity.Error, "never"];
110
+ }
111
+ if (options.fullStop !== void 0) {
112
+ if (options.fullStop) rules["subject-full-stop"] = [
113
+ options.fullStopSeverity ?? RuleConfigSeverity.Error,
114
+ "always",
115
+ options.fullStopCharacter ?? "."
116
+ ];
117
+ else rules["subject-full-stop"] = [RuleConfigSeverity.Disabled];
118
+ }
113
119
  return rules;
114
120
  }
115
121
  function buildHeaderRules(options) {
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@icebreakers/commitlint-config",
3
3
  "type": "module",
4
- "version": "4.0.6",
4
+ "version": "4.1.0",
5
5
  "description": "Commitlint preset from the repoctl development toolchain",
6
- "author": "ice breaker <1324318532@qq.com>",
6
+ "author": "ice breaker <hi@sonofmagic.top>",
7
7
  "license": "MIT",
8
8
  "homepage": "https://repoctl.icebreaker.top",
9
9
  "repository": {
@@ -31,10 +31,16 @@
31
31
  "module": "./dist/index.js",
32
32
  "types": "./dist/index.d.ts",
33
33
  "files": [
34
+ "README.md",
35
+ "README.zh.md",
34
36
  "dist"
35
37
  ],
36
38
  "engines": {
37
- "node": ">=22.12.0"
39
+ "node": ">=22.13.0"
40
+ },
41
+ "publishConfig": {
42
+ "access": "public",
43
+ "registry": "https://registry.npmjs.org"
38
44
  },
39
45
  "tsd": {
40
46
  "directory": "test-d",