@zairakai/js-dev-tools 3.19.0 → 3.21.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 -72
- package/.gitlab/ci/parts/base.yml +95 -0
- package/.gitlab/ci/parts/publish.yml +156 -0
- package/.gitlab/ci/parts/quality.yml +161 -0
- package/.gitlab/ci/parts/security.yml +40 -0
- package/.gitlab/ci/parts/updates.yml +60 -0
- package/.gitlab/ci/pipeline-js-app.yml +19 -38
- package/.gitlab/ci/pipeline-js-package.yml +23 -528
- package/README.md +51 -6
- package/config/.markdownlintignore +9 -1
- package/config/.prettierignore +8 -0
- package/config/.stylelintignore +7 -0
- package/config/eslint.config.js +7 -1
- package/config/knip.config.js +2 -2
- package/package.json +33 -29
- package/scripts/build.sh +28 -28
- package/scripts/ci-quality.sh +6 -6
- package/scripts/config.sh +164 -148
- package/scripts/doctor.sh +12 -12
- package/scripts/eslint-fix.sh +8 -8
- package/scripts/eslint.sh +15 -15
- package/scripts/install-bats.sh +143 -146
- package/scripts/install-hooks.sh +108 -111
- package/scripts/install-markdownlint.sh +4 -4
- package/scripts/install-shellcheck.sh +135 -138
- package/scripts/knip.sh +7 -7
- package/scripts/markdownlint.sh +38 -38
- package/scripts/outdated.sh +30 -29
- package/scripts/prettier-fix.sh +13 -13
- package/scripts/prettier.sh +13 -13
- package/scripts/setup-project.sh +691 -629
- package/scripts/stylelint-fix.sh +17 -17
- package/scripts/stylelint.sh +18 -18
- package/scripts/test.sh +13 -11
- package/scripts/typecheck.sh +11 -11
- package/scripts/update-dependencies.mjs +68 -68
- package/scripts/validate-shellcheck.sh +18 -18
- package/stubs/githooks/commit-msg +18 -18
- package/stubs/githooks/pre-commit +19 -19
- package/stubs/githooks/pre-push +18 -18
- package/stubs/githooks/prepare-commit-msg +6 -6
- package/stubs/gitlab-ci/gitlab-ci.yml.stub +1 -1
- package/stubs/governance/CONTRIBUTING.md.stub +5 -3
- package/stubs/quality/eslint.config.js.stub +1 -1
- package/stubs/quality/knip.config.js.stub +1 -1
- package/stubs/style/prettier.config.js.stub +3 -3
- package/stubs/style/stylelint.config.js.stub +1 -1
- package/stubs/testing/vitest.config.js.stub +1 -1
package/config/.prettierignore
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
build/
|
|
2
2
|
coverage/
|
|
3
3
|
dist/
|
|
4
|
+
docs/
|
|
4
5
|
node_modules/
|
|
5
6
|
public/
|
|
7
|
+
storybook-static/
|
|
6
8
|
vendor/
|
|
9
|
+
.nuxt/
|
|
10
|
+
.output/
|
|
7
11
|
*.lock
|
|
8
12
|
*.md
|
|
9
13
|
*.min.css
|
|
10
14
|
*.min.js
|
|
11
15
|
gl-*.json
|
|
16
|
+
|
|
17
|
+
# Laravel: the runtime files and the cache are not source
|
|
18
|
+
storage/
|
|
19
|
+
bootstrap/cache/
|
package/config/.stylelintignore
CHANGED
package/config/eslint.config.js
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
// The rules live in @stanislas-poisson/js-dev-tools; this path stays for the projects that use it.
|
|
2
|
-
|
|
2
|
+
import base from '@stanislas-poisson/js-dev-tools/eslint'
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
...base,
|
|
6
|
+
// Laravel: the runtime files and the cache are not source
|
|
7
|
+
{ ignores: ['storage/**', 'bootstrap/cache/**'] },
|
|
8
|
+
]
|
package/config/knip.config.js
CHANGED
|
@@ -11,11 +11,11 @@ export default {
|
|
|
11
11
|
// The documentation site (VitePress) has its own tools and is not part of the package.
|
|
12
12
|
ignore: ['docs/**'],
|
|
13
13
|
|
|
14
|
-
// "Referenced optional peerDependencies" is informational
|
|
14
|
+
// "Referenced optional peerDependencies" is informational - stylelint is intentionally optional
|
|
15
15
|
exclude: ['optionalPeerDependencies'],
|
|
16
16
|
|
|
17
17
|
ignoreDependencies: [
|
|
18
|
-
// Coverage provider
|
|
18
|
+
// Coverage provider - referenced as string in config/vitest.config.js (provider: 'v8')
|
|
19
19
|
'@vitest/coverage-v8',
|
|
20
20
|
|
|
21
21
|
// Optional peer dep bundled for consumers
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zairakai/js-dev-tools",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.21.0",
|
|
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",
|
|
@@ -71,40 +71,55 @@
|
|
|
71
71
|
"README.md"
|
|
72
72
|
],
|
|
73
73
|
"scripts": {
|
|
74
|
-
"eslint": "
|
|
75
|
-
"eslint:fix": "
|
|
74
|
+
"eslint": "bash ./scripts/eslint.sh",
|
|
75
|
+
"eslint:fix": "bash ./scripts/eslint-fix.sh",
|
|
76
76
|
"postinstall": "bash ./scripts/setup-project.sh --silent || true",
|
|
77
77
|
"knip": "bash ./scripts/knip.sh",
|
|
78
|
-
"markdownlint": "
|
|
79
|
-
"markdownlint:fix": "markdownlint-
|
|
78
|
+
"markdownlint": "bash ./scripts/markdownlint.sh",
|
|
79
|
+
"markdownlint:fix": "bash ./scripts/markdownlint-fix.sh",
|
|
80
80
|
"normalize": "make package-normalize",
|
|
81
81
|
"package:validate": "make package-validate",
|
|
82
|
-
"prettier": "
|
|
83
|
-
"prettier:fix": "
|
|
82
|
+
"prettier": "bash ./scripts/prettier.sh",
|
|
83
|
+
"prettier:fix": "bash ./scripts/prettier-fix.sh",
|
|
84
|
+
"quality": "make quality",
|
|
85
|
+
"quality:fix": "make quality-fix",
|
|
84
86
|
"setup": "bash ./scripts/setup-project.sh",
|
|
85
|
-
"stylelint": "
|
|
86
|
-
"stylelint:fix": "
|
|
87
|
-
"test": "make test-all"
|
|
88
|
-
|
|
87
|
+
"stylelint": "bash ./scripts/stylelint.sh",
|
|
88
|
+
"stylelint:fix": "bash ./scripts/stylelint-fix.sh",
|
|
89
|
+
"test": "make test-all"
|
|
90
|
+
},
|
|
91
|
+
"overrides": {
|
|
92
|
+
"brace-expansion": "5.0.12",
|
|
93
|
+
"colord": "2.9.7",
|
|
94
|
+
"fast-uri": "3.1.9",
|
|
95
|
+
"js-yaml": {
|
|
96
|
+
".": "4.3.2"
|
|
97
|
+
},
|
|
98
|
+
"katex": "0.18.11",
|
|
99
|
+
"markdown-it": "14.3.3",
|
|
100
|
+
"minimatch": "11.0.6",
|
|
101
|
+
"nanoid": "3.3.20",
|
|
102
|
+
"re2js": "2.9.1",
|
|
103
|
+
"smol-toml": "1.9.0"
|
|
89
104
|
},
|
|
90
105
|
"dependencies": {
|
|
91
|
-
"@stanislas-poisson/js-dev-tools": "^1.1
|
|
92
|
-
"eslint": "^10.
|
|
106
|
+
"@stanislas-poisson/js-dev-tools": "^2.1.1",
|
|
107
|
+
"eslint": "^10.14.0",
|
|
93
108
|
"markdownlint-cli2": "^0.24.0",
|
|
94
109
|
"prettier": "^3.9.10",
|
|
95
|
-
"semver": "^7.8.
|
|
110
|
+
"semver": "^7.8.6",
|
|
96
111
|
"stylelint": "^17.16.0"
|
|
97
112
|
},
|
|
98
113
|
"devDependencies": {
|
|
99
|
-
"@vitest/coverage-v8": "^5.0
|
|
100
|
-
"knip": "^6.
|
|
114
|
+
"@vitest/coverage-v8": "^5.1.0",
|
|
115
|
+
"knip": "^6.44.2",
|
|
101
116
|
"sort-package-json": "^4.1.0",
|
|
102
117
|
"typescript": "^6.0.3",
|
|
103
|
-
"vitest": "^5.0
|
|
118
|
+
"vitest": "^5.1.0",
|
|
104
119
|
"zod": "^4.6.7"
|
|
105
120
|
},
|
|
106
121
|
"peerDependencies": {
|
|
107
|
-
"eslint": "^10.
|
|
122
|
+
"eslint": "^10.14.0",
|
|
108
123
|
"typedoc": "^0.28.0",
|
|
109
124
|
"zod": "^3.0.0 || ^4.0.0"
|
|
110
125
|
},
|
|
@@ -124,16 +139,5 @@
|
|
|
124
139
|
},
|
|
125
140
|
"publishConfig": {
|
|
126
141
|
"access": "public"
|
|
127
|
-
},
|
|
128
|
-
"overrides": {
|
|
129
|
-
"markdown-it": "14.3.3",
|
|
130
|
-
"nanoid": "3.3.20",
|
|
131
|
-
"smol-toml": "1.9.0",
|
|
132
|
-
"colord": "2.9.7",
|
|
133
|
-
"fast-uri": "3.1.9",
|
|
134
|
-
"js-yaml": {
|
|
135
|
-
".": "4.3.2"
|
|
136
|
-
},
|
|
137
|
-
"brace-expansion": "5.0.12"
|
|
138
142
|
}
|
|
139
143
|
}
|
package/scripts/build.sh
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
#
|
|
3
3
|
# Build script for npm packages.
|
|
4
4
|
# Supports (in order of preference):
|
|
5
|
-
# 1. Vite
|
|
6
|
-
# 2. tsup
|
|
7
|
-
# 3. tsc
|
|
5
|
+
# 1. Vite - detected via vite.config.ts / vite.config.js (runs npm run build)
|
|
6
|
+
# 2. tsup - fast, esbuild-based bundler (recommended for pure TS packages)
|
|
7
|
+
# 3. tsc - official TypeScript compiler
|
|
8
8
|
#
|
|
9
9
|
# Usage:
|
|
10
10
|
# bash scripts/build.sh
|
|
@@ -27,37 +27,37 @@ TSC_BIN="${BIN_DIR}/tsc"
|
|
|
27
27
|
log_header "Build"
|
|
28
28
|
|
|
29
29
|
if [[ -f "${PROJECT_ROOT}/vite.config.ts" ]] || [[ -f "${PROJECT_ROOT}/vite.config.js" ]]; then
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
log_info "Builder: Vite (vite.config detected - running npm run build)"
|
|
31
|
+
npm run build
|
|
32
|
+
log_success "Build complete - output in dist/"
|
|
33
33
|
|
|
34
34
|
elif [[ -f "$TSUP_BIN" ]]; then
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
log_info "Builder: tsup (fast, esbuild-based)"
|
|
36
|
+
if [[ -n "$TSUP_CONFIG" ]]; then
|
|
37
|
+
"$TSUP_BIN" --config "$TSUP_CONFIG"
|
|
38
|
+
else
|
|
39
|
+
"$TSUP_BIN"
|
|
40
|
+
fi
|
|
41
|
+
log_success "Build complete - output in dist/"
|
|
42
42
|
|
|
43
43
|
elif [[ -f "$TSC_BIN" ]]; then
|
|
44
|
-
|
|
44
|
+
log_info "Builder: tsc (official TypeScript compiler)"
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
if [[ ! -f "${PROJECT_ROOT}/tsconfig.json" ]]; then
|
|
47
|
+
log_error "No tsconfig.json found at project root"
|
|
48
|
+
log_info "Publish one with:"
|
|
49
|
+
log_info " bash node_modules/@zairakai/js-dev-tools/scripts/setup-project.sh --publish=tsconfig"
|
|
50
|
+
exit 1
|
|
51
|
+
fi
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
log_info "Config: tsconfig.json"
|
|
54
|
+
"$TSC_BIN"
|
|
55
|
+
log_success "Build complete"
|
|
56
56
|
|
|
57
57
|
else
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
log_error "No builder found. Expected one of: vite.config.ts, tsup, tsc"
|
|
59
|
+
log_info "Install one of:"
|
|
60
|
+
log_info " npm install --save-dev tsup (recommended for pure TS packages)"
|
|
61
|
+
log_info " npm install --save-dev typescript (for simple transpilation)"
|
|
62
|
+
exit 1
|
|
63
63
|
fi
|
package/scripts/ci-quality.sh
CHANGED
|
@@ -37,15 +37,15 @@ echo ""
|
|
|
37
37
|
|
|
38
38
|
# 3. Static Analysis (Optional, Project aware)
|
|
39
39
|
if [[ -f "${PROJECT_ROOT}/tsconfig.json" ]] && [[ -f "${BIN_DIR}/tsc" ]]; then
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
run_check "TypeScript (tsc --noEmit)" "bash '${SCRIPT_DIR}/typecheck.sh'" || true
|
|
41
|
+
echo ""
|
|
42
42
|
else
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
log_info "TypeScript: no tsconfig.json or tsc - skipping"
|
|
44
|
+
echo ""
|
|
45
45
|
fi
|
|
46
46
|
|
|
47
47
|
if exit_with_error_count "Quality Checks"; then
|
|
48
|
-
|
|
48
|
+
exit 0
|
|
49
49
|
else
|
|
50
|
-
|
|
50
|
+
exit 1
|
|
51
51
|
fi
|