@cluerise/tools 5.3.8 → 5.3.10

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.
@@ -10,6 +10,7 @@
10
10
  # Build
11
11
  build/
12
12
  dist/
13
+ packages/*/link/
13
14
 
14
15
  # Cloudflare
15
16
  .wrangler/
@@ -45,8 +46,9 @@ hooks/*
45
46
  *.svg
46
47
  *.webp
47
48
 
48
- # Lingui
49
+ # I18n
49
50
  *.po
51
+ packages/**/catalogs/*.ts
50
52
 
51
53
  # Lock files
52
54
  pnpm-lock.yaml
@@ -1,6 +1,7 @@
1
1
  # Build
2
2
  build/
3
3
  dist/
4
+ packages/*/link/
4
5
 
5
6
  # Cloudflare
6
7
  .wrangler/
@@ -15,6 +16,9 @@ node_modules/
15
16
  .env.*.local
16
17
  .envrc
17
18
 
19
+ # I18n
20
+ packages/**/catalogs/*.ts
21
+
18
22
  # Lint Staged
19
23
  .lint-staged-temp-tsconfig.json
20
24
 
@@ -363,6 +363,7 @@ export default defineConfig([
363
363
  // Build
364
364
  '**/build/',
365
365
  '**/dist/',
366
+ 'packages/*/link/',
366
367
 
367
368
  // Cloudflare
368
369
  '../.wrangler/',
@@ -400,6 +401,7 @@ export default defineConfig([
400
401
 
401
402
  // I18n
402
403
  '**/*.po',
404
+ 'packages/**/catalogs/*.ts',
403
405
 
404
406
  // Images
405
407
  '**/*.avif',
@@ -7,8 +7,8 @@
7
7
  "isolatedModules": true,
8
8
  "jsx": "preserve",
9
9
  "lib": ["esnext"],
10
- "module": "nodenext",
11
- "moduleResolution": "nodenext",
10
+ "module": "esnext",
11
+ "moduleResolution": "bundler",
12
12
  "rewriteRelativeImportExtensions": true,
13
13
  "noEmit": true,
14
14
  "noUncheckedIndexedAccess": true,
@@ -96,22 +96,30 @@ class CommitLinter {
96
96
  const { status } = ChildProcess.spawnSync("commitlint", args, { stdio: "inherit" });
97
97
  return status ?? 0;
98
98
  }
99
- #isValidEnumValue(ruleName, value) {
99
+ #getRuleValues(ruleName) {
100
100
  const rule = this.#config.rules[ruleName];
101
101
  if (!rule) {
102
- return true;
102
+ return null;
103
103
  }
104
104
  const [_severity, _condition, values] = rule;
105
+ return values ?? null;
106
+ }
107
+ #isValidType(type) {
108
+ const values = this.#getRuleValues("type-enum");
105
109
  if (!values) {
106
110
  return true;
107
111
  }
108
- return values.includes(value);
109
- }
110
- #isValidType(type) {
111
- return this.#isValidEnumValue("type-enum", type);
112
+ return values.includes(type);
112
113
  }
113
114
  #isValidScope(scope) {
114
- return this.#isValidEnumValue("scope-enum", scope);
115
+ const values = this.#getRuleValues("scope-enum");
116
+ if (!values) {
117
+ return true;
118
+ }
119
+ if ("scopes" in values) {
120
+ return values.scopes.includes(scope);
121
+ }
122
+ return values.includes(scope);
115
123
  }
116
124
  /**
117
125
  * Parse a semantic branch name into its type and scope.
@@ -69,22 +69,30 @@ class CommitLinter {
69
69
  const { status } = ChildProcess.spawnSync("commitlint", args, { stdio: "inherit" });
70
70
  return status ?? 0;
71
71
  }
72
- #isValidEnumValue(ruleName, value) {
72
+ #getRuleValues(ruleName) {
73
73
  const rule = this.#config.rules[ruleName];
74
74
  if (!rule) {
75
- return true;
75
+ return null;
76
76
  }
77
77
  const [_severity, _condition, values] = rule;
78
+ return values ?? null;
79
+ }
80
+ #isValidType(type) {
81
+ const values = this.#getRuleValues("type-enum");
78
82
  if (!values) {
79
83
  return true;
80
84
  }
81
- return values.includes(value);
82
- }
83
- #isValidType(type) {
84
- return this.#isValidEnumValue("type-enum", type);
85
+ return values.includes(type);
85
86
  }
86
87
  #isValidScope(scope) {
87
- return this.#isValidEnumValue("scope-enum", scope);
88
+ const values = this.#getRuleValues("scope-enum");
89
+ if (!values) {
90
+ return true;
91
+ }
92
+ if ("scopes" in values) {
93
+ return values.scopes.includes(scope);
94
+ }
95
+ return values.includes(scope);
88
96
  }
89
97
  /**
90
98
  * Parse a semantic branch name into its type and scope.
@@ -152,22 +152,30 @@ class CommitLinter {
152
152
  const { status } = ChildProcess.spawnSync("commitlint", args, { stdio: "inherit" });
153
153
  return status ?? 0;
154
154
  }
155
- #isValidEnumValue(ruleName, value) {
155
+ #getRuleValues(ruleName) {
156
156
  const rule = this.#config.rules[ruleName];
157
157
  if (!rule) {
158
- return true;
158
+ return null;
159
159
  }
160
160
  const [_severity, _condition, values] = rule;
161
+ return values ?? null;
162
+ }
163
+ #isValidType(type) {
164
+ const values = this.#getRuleValues("type-enum");
161
165
  if (!values) {
162
166
  return true;
163
167
  }
164
- return values.includes(value);
165
- }
166
- #isValidType(type) {
167
- return this.#isValidEnumValue("type-enum", type);
168
+ return values.includes(type);
168
169
  }
169
170
  #isValidScope(scope) {
170
- return this.#isValidEnumValue("scope-enum", scope);
171
+ const values = this.#getRuleValues("scope-enum");
172
+ if (!values) {
173
+ return true;
174
+ }
175
+ if ("scopes" in values) {
176
+ return values.scopes.includes(scope);
177
+ }
178
+ return values.includes(scope);
171
179
  }
172
180
  /**
173
181
  * Parse a semantic branch name into its type and scope.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cluerise/tools",
3
- "version": "5.3.8",
3
+ "version": "5.3.10",
4
4
  "description": "Tools for maintaining TypeScript projects.",
5
5
  "author": "Branislav Holý <brano@holy.am>",
6
6
  "repository": "github:cluerise/tools",
@@ -17,17 +17,17 @@
17
17
  "./dist/"
18
18
  ],
19
19
  "dependencies": {
20
- "@actions/core": "2.0.1",
21
- "@commitlint/cli": "20.2.0",
22
- "@commitlint/config-conventional": "20.2.0",
23
- "@commitlint/load": "20.2.0",
24
- "@commitlint/types": "20.2.0",
20
+ "@actions/core": "2.0.2",
21
+ "@commitlint/cli": "20.3.1",
22
+ "@commitlint/config-conventional": "20.3.1",
23
+ "@commitlint/load": "20.3.1",
24
+ "@commitlint/types": "20.3.1",
25
25
  "@eslint/js": "9.39.2",
26
26
  "@eslint/json": "0.14.0",
27
27
  "@eslint/markdown": "7.5.1",
28
- "@html-eslint/eslint-plugin": "0.52.0",
28
+ "@html-eslint/eslint-plugin": "0.52.1",
29
29
  "@html-eslint/parser": "0.52.0",
30
- "@typescript-eslint/parser": "8.50.0",
30
+ "@typescript-eslint/parser": "8.52.0",
31
31
  "conventional-changelog-conventionalcommits": "9.1.0",
32
32
  "eslint": "9.39.2",
33
33
  "eslint-config-prettier": "10.1.8",
@@ -38,14 +38,14 @@
38
38
  "eslint-plugin-unicorn": "62.0.0",
39
39
  "eslint-plugin-yml": "1.19.1",
40
40
  "glob": "13.0.0",
41
- "globals": "16.5.0",
41
+ "globals": "17.0.0",
42
42
  "lint-staged": "16.2.7",
43
43
  "prettier": "3.7.4",
44
44
  "prettier-plugin-sh": "0.18.0",
45
45
  "semantic-release": "25.0.2",
46
46
  "semver": "7.7.3",
47
- "smol-toml": "1.5.2",
48
- "typescript-eslint": "8.50.0",
49
- "zod": "4.2.1"
47
+ "smol-toml": "1.6.0",
48
+ "typescript-eslint": "8.52.0",
49
+ "zod": "4.3.5"
50
50
  }
51
51
  }