@rtorcato/js-tooling 1.0.9 ā 1.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/cli/index.js +11 -4
- package/package.json +1 -1
- package/tooling/commitlint/commitlint.mjs +26 -26
package/dist/cli/index.js
CHANGED
|
@@ -44,8 +44,9 @@ program
|
|
|
44
44
|
try {
|
|
45
45
|
const fs = (await import('fs-extra')).default;
|
|
46
46
|
const path = (await import('node:path')).default;
|
|
47
|
-
// Get the package installation path
|
|
48
|
-
const
|
|
47
|
+
// Get the package installation path - CLI is in dist/cli/index.js, need to go up 3 levels
|
|
48
|
+
const cliFile = new URL(import.meta.url).pathname;
|
|
49
|
+
const packagePath = path.dirname(path.dirname(path.dirname(cliFile)));
|
|
49
50
|
const sourcePath = path.join(packagePath, source);
|
|
50
51
|
const targetPath = path.join(process.cwd(), target);
|
|
51
52
|
await fs.copy(sourcePath, targetPath);
|
|
@@ -64,12 +65,18 @@ program
|
|
|
64
65
|
.action(() => {
|
|
65
66
|
console.log(chalk.cyan('\nš ļø Available tooling configurations:\n'));
|
|
66
67
|
const configs = [
|
|
67
|
-
{
|
|
68
|
+
{
|
|
69
|
+
name: 'TypeScript',
|
|
70
|
+
desc: 'Base, React, Next.js, Node.js, Express configurations',
|
|
71
|
+
},
|
|
68
72
|
{ name: 'ESLint', desc: 'Base and Next.js ESLint configurations' },
|
|
69
73
|
{ name: 'Biome', desc: 'Fast formatter and linter configuration' },
|
|
70
74
|
{ name: 'Prettier', desc: 'Code formatter configuration' },
|
|
71
75
|
{ name: 'Vitest', desc: 'Testing framework configuration' },
|
|
72
|
-
{
|
|
76
|
+
{
|
|
77
|
+
name: 'Jest',
|
|
78
|
+
desc: 'Testing framework presets for browser and Node.js',
|
|
79
|
+
},
|
|
73
80
|
{ name: 'Playwright', desc: 'End-to-end testing configuration' },
|
|
74
81
|
{ name: 'Commitlint', desc: 'Conventional commit linting' },
|
|
75
82
|
{ name: 'Husky', desc: 'Git hooks for pre-commit validation' },
|
package/package.json
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
extends: [
|
|
3
|
-
ignores: [(commit) => commit.includes(
|
|
2
|
+
extends: ["@commitlint/config-conventional"],
|
|
3
|
+
ignores: [(commit) => commit.includes("[skip ci]")],
|
|
4
4
|
rules: {
|
|
5
5
|
// Enforce strict type validation
|
|
6
|
-
|
|
6
|
+
"type-enum": [
|
|
7
7
|
2,
|
|
8
|
-
|
|
8
|
+
"always",
|
|
9
9
|
[
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
"build",
|
|
11
|
+
"chore",
|
|
12
|
+
"ci",
|
|
13
|
+
"docs",
|
|
14
|
+
"feat",
|
|
15
|
+
"fix",
|
|
16
|
+
"perf",
|
|
17
|
+
"refactor",
|
|
18
|
+
"revert",
|
|
19
|
+
"style",
|
|
20
|
+
"test",
|
|
21
21
|
],
|
|
22
22
|
],
|
|
23
|
-
// Enforce length limits
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
// Enforce length limits (strict)
|
|
24
|
+
"header-max-length": [2, "always", 50],
|
|
25
|
+
"body-max-line-length": [2, "always", 72],
|
|
26
|
+
"footer-max-line-length": [2, "always", 72],
|
|
27
27
|
// Enforce case rules (allow common patterns)
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
"subject-case": [0], // Disable case enforcement to allow flexibility
|
|
29
|
+
"type-case": [2, "always", "lower-case"],
|
|
30
30
|
// Enforce required elements
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
"type-empty": [2, "never"],
|
|
32
|
+
"subject-empty": [2, "never"],
|
|
33
33
|
// Enforce punctuation rules
|
|
34
|
-
|
|
34
|
+
"subject-full-stop": [2, "never", "."],
|
|
35
35
|
// Enforce scope rules (optional but recommended)
|
|
36
|
-
|
|
36
|
+
"scope-case": [2, "always", "lower-case"],
|
|
37
37
|
},
|
|
38
|
-
}
|
|
38
|
+
};
|