@zairakai/js-dev-tools 1.2.0 → 1.2.2
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/package.json +3 -3
- package/scripts/build.sh +17 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zairakai/js-dev-tools",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
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",
|
|
@@ -90,14 +90,14 @@
|
|
|
90
90
|
"dependencies": {
|
|
91
91
|
"@eslint/compat": "^2.0.3",
|
|
92
92
|
"@eslint/js": "^10.0.0",
|
|
93
|
-
"@prettier/plugin-php": "^0.
|
|
93
|
+
"@prettier/plugin-php": "^0.25.0",
|
|
94
94
|
"@typescript-eslint/eslint-plugin": "^8.40.0",
|
|
95
95
|
"@typescript-eslint/parser": "^8.40.0",
|
|
96
96
|
"eslint": "^10.0.0",
|
|
97
97
|
"eslint-config-prettier": "^10.0.0",
|
|
98
98
|
"eslint-plugin-vue": "^10.0.0",
|
|
99
99
|
"globals": "^17.0.0",
|
|
100
|
-
"markdownlint-cli2": "^0.
|
|
100
|
+
"markdownlint-cli2": "^0.22.0",
|
|
101
101
|
"prettier": "^3.0.0",
|
|
102
102
|
"prettier-plugin-blade": "^2.1.0",
|
|
103
103
|
"prettier-plugin-organize-imports": "^4.0.0",
|
package/scripts/build.sh
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
#
|
|
3
|
-
#
|
|
4
|
-
# Compiles TypeScript to JavaScript for distribution.
|
|
5
|
-
#
|
|
3
|
+
# Build script for npm packages.
|
|
6
4
|
# Supports (in order of preference):
|
|
7
|
-
# 1.
|
|
8
|
-
# 2.
|
|
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
|
|
9
8
|
#
|
|
10
9
|
# Usage:
|
|
11
10
|
# bash scripts/build.sh
|
|
12
11
|
#
|
|
13
12
|
# Recommendation:
|
|
14
|
-
# Use
|
|
15
|
-
# Use
|
|
13
|
+
# Use Vite for Vue component libraries (vite.config.ts present)
|
|
14
|
+
# Use tsup for pure TypeScript packages: npm install --save-dev tsup
|
|
15
|
+
# Use tsc for simple transpilation: npm install --save-dev typescript
|
|
16
16
|
#
|
|
17
17
|
|
|
18
18
|
set -euo pipefail
|
|
@@ -24,9 +24,14 @@ source "${SCRIPT_DIR}/config.sh"
|
|
|
24
24
|
TSUP_BIN="${BIN_DIR}/tsup"
|
|
25
25
|
TSC_BIN="${BIN_DIR}/tsc"
|
|
26
26
|
|
|
27
|
-
log_header "
|
|
27
|
+
log_header "Build"
|
|
28
|
+
|
|
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/"
|
|
28
33
|
|
|
29
|
-
|
|
34
|
+
elif [[ -f "$TSUP_BIN" ]]; then
|
|
30
35
|
log_info "Builder: tsup (fast, esbuild-based)"
|
|
31
36
|
if [[ -n "$TSUP_CONFIG" ]]; then
|
|
32
37
|
"$TSUP_BIN" --config "$TSUP_CONFIG"
|
|
@@ -50,9 +55,9 @@ elif [[ -f "$TSC_BIN" ]]; then
|
|
|
50
55
|
log_success "Build complete"
|
|
51
56
|
|
|
52
57
|
else
|
|
53
|
-
log_error "No
|
|
58
|
+
log_error "No builder found. Expected one of: vite.config.ts, tsup, tsc"
|
|
54
59
|
log_info "Install one of:"
|
|
55
|
-
log_info " npm install --save-dev tsup (recommended for
|
|
56
|
-
log_info " npm install --save-dev typescript (for
|
|
60
|
+
log_info " npm install --save-dev tsup (recommended for pure TS packages)"
|
|
61
|
+
log_info " npm install --save-dev typescript (for simple transpilation)"
|
|
57
62
|
exit 1
|
|
58
63
|
fi
|