@zairakai/js-dev-tools 1.3.1 → 1.4.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.
@@ -14,7 +14,6 @@
14
14
  "forceConsistentCasingInFileNames": true,
15
15
  "noUnusedLocals": true,
16
16
  "noUnusedParameters": true,
17
- "exactOptionalPropertyTypes": true,
18
- "ignoreDeprecations": "5.0"
17
+ "exactOptionalPropertyTypes": true
19
18
  }
20
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zairakai/js-dev-tools",
3
- "version": "1.3.1",
3
+ "version": "1.4.1",
4
4
  "description": "The unified and centralized development toolkit for JavaScript/TypeScript projects - ESLint, Prettier, Stylelint, Knip, Vitest, Git Hooks, and GitLab CI pipeline templates",
5
5
  "keywords": [
6
6
  "dev-tools",
@@ -96,12 +96,12 @@
96
96
  "eslint": "^10.0.0",
97
97
  "eslint-config-prettier": "^10.0.0",
98
98
  "eslint-plugin-vue": "^10.0.0",
99
- "globals": "^17.0.0",
99
+ "globals": "^17.5.0",
100
100
  "markdownlint-cli2": "^0.22.0",
101
- "prettier": "^3.0.0",
101
+ "prettier": "^3.8.3",
102
102
  "prettier-plugin-blade": "^2.1.0",
103
103
  "prettier-plugin-organize-imports": "^4.0.0",
104
- "stylelint": "^17.0.0",
104
+ "stylelint": "^17.8.0",
105
105
  "stylelint-config-html": "^1.1.0",
106
106
  "stylelint-config-recommended-vue": "^1.5.0",
107
107
  "stylelint-config-standard": "^40.0.0",
@@ -111,17 +111,15 @@
111
111
  "vue-eslint-parser": "^10.0.0"
112
112
  },
113
113
  "devDependencies": {
114
- "@vitest/coverage-v8": "^4.0.0",
115
- "knip": "^5.85.0",
114
+ "@vitest/coverage-v8": "^4.1.4",
115
+ "knip": "^6.4.1",
116
116
  "sort-package-json": "^3.6.1",
117
- "typescript": "^5.9.3",
118
- "vitest": "^4.0.0",
117
+ "typescript": "^6.0.3",
118
+ "vitest": "^4.1.4",
119
119
  "zod": "^4.0.0"
120
120
  },
121
121
  "peerDependencies": {
122
122
  "eslint": "^10.0.0",
123
- "prettier": "^3.0.0",
124
- "stylelint": "^17.0.0",
125
123
  "typedoc": "^0.28.0",
126
124
  "zod": "^3.0.0 || ^4.0.0"
127
125
  },
package/scripts/config.sh CHANGED
@@ -132,12 +132,25 @@ ensure_bin_optional() {
132
132
  }
133
133
  export -f ensure_bin_optional
134
134
 
135
- # Check if files matching pattern exist
135
+ # Check if files matching any of the given patterns exist.
136
+ #
137
+ # Variadic: accepts one or more glob patterns, returns success if ANY matches.
138
+ # Callers needing a brace-alternation pattern (e.g. *.{js,ts,vue}) must leave that
139
+ # portion unquoted at the call site so bash's brace expansion splits it into
140
+ # separate arguments BEFORE this function ever sees it — brace expansion only
141
+ # applies to unquoted literal text, never to the contents of a variable, so a
142
+ # pattern like "**/*.{js,ts}" passed as a single quoted string is matched
143
+ # literally (and never matches a real file) instead of being expanded.
136
144
  has_files() {
137
- local pattern="$1"
138
- # SC2086: unquoted intentionally — we need word splitting + glob expansion via nullglob+globstar
139
- # shellcheck disable=SC2086
140
- ( shopt -s nullglob globstar; set -- $pattern; [ $# -gt 0 ] )
145
+ local pattern
146
+ for pattern in "$@"; do
147
+ # SC2086: unquoted intentionally — we need word splitting + glob expansion via nullglob+globstar
148
+ # shellcheck disable=SC2086
149
+ if ( shopt -s nullglob globstar; set -- $pattern; [ $# -gt 0 ] ); then
150
+ return 0
151
+ fi
152
+ done
153
+ return 1
141
154
  }
142
155
  export -f has_files
143
156
 
@@ -21,8 +21,18 @@ fi
21
21
 
22
22
  log_step "Fixing: $LINT_TARGET"
23
23
 
24
- # Skip gracefully if no matching files exist
25
- if ! has_files "${PROJECT_ROOT}/${LINT_TARGET}**/*.{js,ts,vue,jsx,tsx}"; then
24
+ # Normalize away any trailing slash before appending our own — LINT_TARGET can be
25
+ # "resources/js/", "src/" or "." (via override) depending on project type, and
26
+ # concatenating "." directly with "**/*.ext" produces the invalid glob
27
+ # ".**/*.ext" (no match ever).
28
+ LINT_TARGET_GLOB_BASE="${LINT_TARGET%/}/"
29
+
30
+ # Skip gracefully if no matching files exist.
31
+ # The brace portion is intentionally left unquoted so bash's brace expansion
32
+ # splits it into separate arguments before has_files() sees it (see has_files
33
+ # doc comment in config.sh — brace expansion never applies to quoted text or
34
+ # to the contents of a variable).
35
+ if ! has_files "${PROJECT_ROOT}/${LINT_TARGET_GLOB_BASE}"**/*.{js,ts,vue,jsx,tsx}; then
26
36
  log_info "No JS/TS files found in ${LINT_TARGET} — skipping"
27
37
  exit 0
28
38
  fi
package/scripts/eslint.sh CHANGED
@@ -31,8 +31,17 @@ fi
31
31
 
32
32
  log_step "Checking: $LINT_TARGET"
33
33
 
34
- # Skip gracefully if no matching files exist
35
- if ! has_files "${PROJECT_ROOT}/${LINT_TARGET}**/*.{js,ts,vue,jsx,tsx}"; then
34
+ # Normalize away any trailing slash before appending our own — LINT_TARGET can be
35
+ # "resources/js/", "src/" or "." depending on project type, and concatenating "."
36
+ # directly with "**/*.ext" produces the invalid glob ".**/*.ext" (no match ever).
37
+ LINT_TARGET_GLOB_BASE="${LINT_TARGET%/}/"
38
+
39
+ # Skip gracefully if no matching files exist.
40
+ # The brace portion is intentionally left unquoted so bash's brace expansion
41
+ # splits it into separate arguments before has_files() sees it (see has_files
42
+ # doc comment in config.sh — brace expansion never applies to quoted text or
43
+ # to the contents of a variable).
44
+ if ! has_files "${PROJECT_ROOT}/${LINT_TARGET_GLOB_BASE}"**/*.{js,ts,vue,jsx,tsx}; then
36
45
  log_info "No JS/TS files found in ${LINT_TARGET} — skipping"
37
46
  exit 0
38
47
  fi