@zairakai/js-dev-tools 3.20.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.
Files changed (48) hide show
  1. package/.editorconfig +6 -72
  2. package/.gitlab/ci/parts/base.yml +95 -0
  3. package/.gitlab/ci/parts/publish.yml +156 -0
  4. package/.gitlab/ci/parts/quality.yml +161 -0
  5. package/.gitlab/ci/parts/security.yml +40 -0
  6. package/.gitlab/ci/parts/updates.yml +60 -0
  7. package/.gitlab/ci/pipeline-js-app.yml +19 -38
  8. package/.gitlab/ci/pipeline-js-package.yml +23 -528
  9. package/README.md +51 -6
  10. package/config/.markdownlintignore +9 -1
  11. package/config/.prettierignore +8 -0
  12. package/config/.stylelintignore +7 -0
  13. package/config/eslint.config.js +7 -1
  14. package/config/knip.config.js +2 -2
  15. package/package.json +28 -25
  16. package/scripts/build.sh +28 -28
  17. package/scripts/ci-quality.sh +6 -6
  18. package/scripts/config.sh +164 -148
  19. package/scripts/doctor.sh +12 -12
  20. package/scripts/eslint-fix.sh +8 -8
  21. package/scripts/eslint.sh +15 -15
  22. package/scripts/install-bats.sh +143 -146
  23. package/scripts/install-hooks.sh +108 -111
  24. package/scripts/install-markdownlint.sh +4 -4
  25. package/scripts/install-shellcheck.sh +135 -138
  26. package/scripts/knip.sh +7 -7
  27. package/scripts/markdownlint.sh +38 -38
  28. package/scripts/outdated.sh +30 -29
  29. package/scripts/prettier-fix.sh +13 -13
  30. package/scripts/prettier.sh +13 -13
  31. package/scripts/setup-project.sh +691 -629
  32. package/scripts/stylelint-fix.sh +17 -17
  33. package/scripts/stylelint.sh +18 -18
  34. package/scripts/test.sh +13 -11
  35. package/scripts/typecheck.sh +11 -11
  36. package/scripts/update-dependencies.mjs +68 -68
  37. package/scripts/validate-shellcheck.sh +18 -18
  38. package/stubs/githooks/commit-msg +18 -18
  39. package/stubs/githooks/pre-commit +19 -19
  40. package/stubs/githooks/pre-push +18 -18
  41. package/stubs/githooks/prepare-commit-msg +6 -6
  42. package/stubs/gitlab-ci/gitlab-ci.yml.stub +1 -1
  43. package/stubs/governance/CONTRIBUTING.md.stub +5 -3
  44. package/stubs/quality/eslint.config.js.stub +1 -1
  45. package/stubs/quality/knip.config.js.stub +1 -1
  46. package/stubs/style/prettier.config.js.stub +3 -3
  47. package/stubs/style/stylelint.config.js.stub +1 -1
  48. package/stubs/testing/vitest.config.js.stub +1 -1
@@ -1,5 +1,13 @@
1
1
  .cache/
2
2
  .git/
3
- .opencode/
3
+ build/
4
+ coverage/
5
+ dist/
6
+ docs/
4
7
  node_modules/
8
+ vendor/
5
9
  *.min.md
10
+
11
+ # Laravel: the runtime files and the cache are not source
12
+ storage/
13
+ bootstrap/cache/
@@ -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/
@@ -1,7 +1,14 @@
1
1
  node_modules/
2
2
  dist/
3
+ docs/
3
4
  build/
4
5
  coverage/
5
6
  vendor/
6
7
  public/
8
+ .nuxt/
9
+ .output/
7
10
  *.min.css
11
+
12
+ # Laravel: the runtime files and the cache are not source
13
+ storage/
14
+ bootstrap/cache/
@@ -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
- export { default } from '@stanislas-poisson/js-dev-tools/eslint'
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
+ ]
@@ -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 — stylelint is intentionally optional
14
+ // "Referenced optional peerDependencies" is informational - stylelint is intentionally optional
15
15
  exclude: ['optionalPeerDependencies'],
16
16
 
17
17
  ignoreDependencies: [
18
- // Coverage provider — referenced as string in config/vitest.config.js (provider: 'v8')
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.20.0",
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,24 +71,39 @@
71
71
  "README.md"
72
72
  ],
73
73
  "scripts": {
74
- "eslint": "eslint --config config/eslint.config.js config/*.{js,ts}",
75
- "eslint:fix": "eslint --config config/eslint.config.js config/*.{js,ts} --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": "markdownlint-cli2 --config config/.markdownlint.json --ignore-path config/.markdownlintignore '**/*.md' '#node_modules'",
79
- "markdownlint:fix": "markdownlint-cli2 --fix --config config/.markdownlint.json --ignore-path config/.markdownlintignore '**/*.md' '#node_modules'",
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": "prettier . --check --config ./config/prettier.config.js --ignore-path ./config/.prettierignore",
83
- "prettier:fix": "prettier . --write --config ./config/prettier.config.js --ignore-path ./config/.prettierignore",
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": "stylelint --config config/stylelint.config.js --ignore-path config/.stylelintignore '**/*.scss'",
86
- "stylelint:fix": "stylelint --config config/stylelint.config.js --ignore-path config/.stylelintignore '**/*.scss' --fix",
87
- "test": "make test-all",
88
- "validate": "make quality"
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.2",
106
+ "@stanislas-poisson/js-dev-tools": "^2.1.1",
92
107
  "eslint": "^10.14.0",
93
108
  "markdownlint-cli2": "^0.24.0",
94
109
  "prettier": "^3.9.10",
@@ -97,7 +112,7 @@
97
112
  },
98
113
  "devDependencies": {
99
114
  "@vitest/coverage-v8": "^5.1.0",
100
- "knip": "^6.44.1",
115
+ "knip": "^6.44.2",
101
116
  "sort-package-json": "^4.1.0",
102
117
  "typescript": "^6.0.3",
103
118
  "vitest": "^5.1.0",
@@ -124,17 +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
- "re2js": "2.9.1"
139
142
  }
140
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 — 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
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
- log_info "Builder: Vite (vite.config detected — running npm run build)"
31
- npm run build
32
- log_success "Build complete — output in dist/"
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
- 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/"
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
- log_info "Builder: tsc (official TypeScript compiler)"
44
+ log_info "Builder: tsc (official TypeScript compiler)"
45
45
 
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
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
- log_info "Config: tsconfig.json"
54
- "$TSC_BIN"
55
- log_success "Build complete"
53
+ log_info "Config: tsconfig.json"
54
+ "$TSC_BIN"
55
+ log_success "Build complete"
56
56
 
57
57
  else
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
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
@@ -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
- run_check "TypeScript (tsc --noEmit)" "bash '${SCRIPT_DIR}/typecheck.sh'" || true
41
- echo ""
40
+ run_check "TypeScript (tsc --noEmit)" "bash '${SCRIPT_DIR}/typecheck.sh'" || true
41
+ echo ""
42
42
  else
43
- log_info "TypeScript: no tsconfig.json or tsc — skipping"
44
- echo ""
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
- exit 0
48
+ exit 0
49
49
  else
50
- exit 1
50
+ exit 1
51
51
  fi