@zairakai/js-dev-tools 3.21.0 → 4.0.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/.editorconfig +6 -1
- package/README.md +49 -13
- package/config/.markdownlintignore +3 -4
- package/config/.prettierignore +11 -6
- package/config/.stylelintignore +13 -10
- package/config/knip.config.js +6 -2
- package/config/stylelint.config.js +1 -0
- package/package.json +19 -5
- package/scripts/update-dependencies.mjs +504 -133
- package/stubs/githooks/commit-msg +7 -4
- package/stubs/style/stylelint.config.js.stub +7 -0
- package/tools/make/bats.mk +3 -3
- package/tools/make/core.mk +3 -3
- package/tools/make/variables.mk +1 -1
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
# - type: feat, fix, docs, style, refactor, perf, test, chore, ci or build
|
|
9
9
|
# - scope: optional, in lowercase
|
|
10
10
|
# - #TICKET: the number of the issue
|
|
11
|
-
# - the
|
|
11
|
+
# - the subject (the text after the ticket) has 50 characters at most (Pro Git), and the second line is blank
|
|
12
12
|
#
|
|
13
13
|
# A work in progress follows the same format. The messages that Git writes itself
|
|
14
14
|
# (Merge, Revert, fixup!, squash!) are accepted as they are.
|
|
@@ -24,7 +24,7 @@ case "$first_line" in
|
|
|
24
24
|
"Merge "* | "Revert \""* | "fixup! "* | "squash! "* | "amend! "*) exit 0 ;;
|
|
25
25
|
esac
|
|
26
26
|
|
|
27
|
-
PATTERN='^(feat|fix|docs|style|refactor|perf|test|chore|ci|build)(\([a-z0-9][a-z0-9._/-]*\))?: #[0-9]+ [^[:space:]]
|
|
27
|
+
PATTERN='^(feat|fix|docs|style|refactor|perf|test|chore|ci|build)(\([a-z0-9][a-z0-9._/-]*\))?: #[0-9]+ ([^[:space:]].*)$'
|
|
28
28
|
|
|
29
29
|
fail() {
|
|
30
30
|
echo ""
|
|
@@ -47,8 +47,11 @@ if ! [[ $first_line =~ $PATTERN ]]; then
|
|
|
47
47
|
fail "Invalid commit message format"
|
|
48
48
|
fi
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
# The limit counts the subject only: the type, the scope and the ticket do not use its 50 characters
|
|
51
|
+
subject="${BASH_REMATCH[3]}"
|
|
52
|
+
|
|
53
|
+
if [[ ${#subject} -gt 50 ]]; then
|
|
54
|
+
fail "The subject has ${#subject} characters: the limit is 50"
|
|
52
55
|
fi
|
|
53
56
|
|
|
54
57
|
if [[ -n $second_line ]]; then
|
|
@@ -10,6 +10,13 @@
|
|
|
10
10
|
* 'color-no-invalid-hex': true,
|
|
11
11
|
* },
|
|
12
12
|
* }
|
|
13
|
+
*
|
|
14
|
+
* Example of changing the order of the properties (each option receives a copy of the list and returns the new one):
|
|
15
|
+
* import { createStylelintConfig } from '@zairakai/js-dev-tools/config/stylelint.config.js'
|
|
16
|
+
*
|
|
17
|
+
* export default createStylelintConfig({
|
|
18
|
+
* properties: (list) => list.filter((property) => property !== 'float'),
|
|
19
|
+
* })
|
|
13
20
|
*/
|
|
14
21
|
|
|
15
22
|
import baseConfig from '@zairakai/js-dev-tools/config/stylelint.config.js'
|
package/tools/make/bats.mk
CHANGED
|
@@ -10,7 +10,7 @@ bats:: ## Run shell script tests (BATS)
|
|
|
10
10
|
fi; \
|
|
11
11
|
FILES=$$(find tests/bats -name "*.bats" 2>/dev/null); \
|
|
12
12
|
if [ -z "$$FILES" ]; then \
|
|
13
|
-
echo "ℹ️ No BATS tests found
|
|
13
|
+
echo "ℹ️ No BATS tests found, skipping"; \
|
|
14
14
|
else \
|
|
15
15
|
bats $$FILES; \
|
|
16
16
|
fi
|
|
@@ -22,7 +22,7 @@ bats-unit:: ## Run BATS unit tests
|
|
|
22
22
|
exit 1; \
|
|
23
23
|
fi; \
|
|
24
24
|
if [ ! -d tests/bats/unit ] || [ -z "$$(find tests/bats/unit -name "*.bats" 2>/dev/null)" ]; then \
|
|
25
|
-
echo "ℹ️ No BATS unit tests found
|
|
25
|
+
echo "ℹ️ No BATS unit tests found, skipping"; \
|
|
26
26
|
else \
|
|
27
27
|
bats tests/bats/unit/*.bats; \
|
|
28
28
|
fi
|
|
@@ -34,7 +34,7 @@ bats-integration:: ## Run BATS integration tests
|
|
|
34
34
|
exit 1; \
|
|
35
35
|
fi; \
|
|
36
36
|
if [ ! -d tests/bats/integration ] || [ -z "$$(find tests/bats/integration -name "*.bats" 2>/dev/null)" ]; then \
|
|
37
|
-
echo "ℹ️ No BATS integration tests found
|
|
37
|
+
echo "ℹ️ No BATS integration tests found, skipping"; \
|
|
38
38
|
else \
|
|
39
39
|
bats tests/bats/integration/*.bats; \
|
|
40
40
|
fi
|
package/tools/make/core.mk
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Core Makefile
|
|
1
|
+
# Core Makefile: Zairakai NPM Dev Tools
|
|
2
2
|
# Aggregates all modular targets for JavaScript/TypeScript/Vue projects.
|
|
3
3
|
#
|
|
4
4
|
# Usage in a consumer project (Makefile):
|
|
@@ -31,10 +31,10 @@ include $(NPM_DIRECTORY_TOOLS_MAKE_DIR)markdownlint.mk
|
|
|
31
31
|
# 3. ShellCheck validation
|
|
32
32
|
include $(NPM_DIRECTORY_TOOLS_MAKE_DIR)shellcheck.mk
|
|
33
33
|
|
|
34
|
-
# 4. Code style
|
|
34
|
+
# 4. Code style: ESLint + Prettier
|
|
35
35
|
include $(NPM_DIRECTORY_TOOLS_MAKE_DIR)code-style.mk
|
|
36
36
|
|
|
37
|
-
# 5. CSS/SCSS
|
|
37
|
+
# 5. CSS/SCSS: Stylelint (optional)
|
|
38
38
|
include $(NPM_DIRECTORY_TOOLS_MAKE_DIR)stylelint.mk
|
|
39
39
|
|
|
40
40
|
# 6. Dead code detection (Knip)
|
package/tools/make/variables.mk
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Variables - Zairakai NPM Dev Tools
|
|
2
2
|
# Shared configuration and styling
|
|
3
3
|
|
|
4
|
-
# Critical path detection
|
|
4
|
+
# Critical path detection: works from any inclusion depth
|
|
5
5
|
NPM_DIRECTORY_TOOLS_MAKE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
|
|
6
6
|
NPM_DIRECTORY_TOOLS_PACKAGE_ROOT := $(abspath $(NPM_DIRECTORY_TOOLS_MAKE_DIR)../../)/
|
|
7
7
|
NPM_DIRECTORY_TOOLS_SCRIPTS_DIR := $(NPM_DIRECTORY_TOOLS_PACKAGE_ROOT)scripts/
|