jekyll-theme-zer0 0.10.6 → 0.15.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +428 -0
- data/README.md +79 -31
- data/_data/README.md +419 -17
- data/_data/generate_statistics.rb +216 -9
- data/_data/generate_statistics.sh +106 -0
- data/_data/github-actions-example.yml +210 -0
- data/_data/navigation/about.yml +39 -11
- data/_data/navigation/docs.yml +53 -23
- data/_data/navigation/home.yml +27 -9
- data/_data/navigation/main.yml +27 -8
- data/_data/navigation/posts.yml +22 -6
- data/_data/navigation/quickstart.yml +19 -6
- data/_data/posts_organization.yml +153 -0
- data/_data/prerequisites.yml +112 -0
- data/_data/statistics_config.yml +203 -0
- data/_data/ui-text.yml +321 -0
- data/_data/update_statistics.sh +126 -0
- data/_includes/README.md +2 -0
- data/_includes/components/js-cdn.html +4 -1
- data/_includes/components/post-card.html +2 -11
- data/_includes/components/preview-image.html +32 -0
- data/_includes/content/intro.html +9 -10
- data/_includes/core/header.html +14 -0
- data/_includes/navigation/sidebar-categories.html +20 -9
- data/_includes/navigation/sidebar-folders.html +8 -7
- data/_includes/navigation/sidebar-right.html +16 -10
- data/_layouts/blog.html +15 -45
- data/_layouts/category.html +4 -24
- data/_layouts/collection.html +2 -12
- data/_layouts/default.html +1 -1
- data/_layouts/journals.html +2 -12
- data/_layouts/notebook.html +296 -0
- data/_sass/core/_docs.scss +1 -1
- data/_sass/custom.scss +54 -17
- data/_sass/notebooks.scss +458 -0
- data/assets/images/notebooks/test-notebook_files/test-notebook_4_0.png +0 -0
- data/assets/js/sidebar.js +511 -0
- data/scripts/README.md +131 -105
- data/scripts/analyze-commits.sh +9 -311
- data/scripts/bin/build +22 -22
- data/scripts/build +7 -111
- data/scripts/convert-notebooks.sh +415 -0
- data/scripts/features/validate_preview_urls.py +500 -0
- data/scripts/fix-markdown-format.sh +8 -262
- data/scripts/generate-preview-images.sh +7 -787
- data/scripts/install-preview-generator.sh +8 -528
- data/scripts/lib/README.md +5 -5
- data/scripts/lib/changelog.sh +89 -57
- data/scripts/lib/gem.sh +19 -7
- data/scripts/release +7 -236
- data/scripts/setup.sh +9 -153
- data/scripts/test/lib/run_tests.sh +1 -2
- data/scripts/test-auto-version.sh +7 -256
- data/scripts/test-mermaid.sh +7 -287
- data/scripts/test.sh +9 -154
- metadata +16 -10
- data/scripts/features/preview_generator.py +0 -646
- data/scripts/lib/test/run_tests.sh +0 -140
- data/scripts/lib/test/test_changelog.sh +0 -87
- data/scripts/lib/test/test_gem.sh +0 -68
- data/scripts/lib/test/test_git.sh +0 -82
- data/scripts/lib/test/test_validation.sh +0 -72
- data/scripts/lib/test/test_version.sh +0 -96
- data/scripts/version.sh +0 -178
data/scripts/lib/changelog.sh
CHANGED
|
@@ -2,14 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog generation library for zer0-mistakes release scripts
|
|
4
4
|
# Provides automatic changelog generation from git commit history
|
|
5
|
-
|
|
6
|
-
# Check Bash version (need 4+ for associative arrays)
|
|
7
|
-
if [[ "${BASH_VERSINFO[0]}" -lt 4 ]]; then
|
|
8
|
-
echo "[ERROR] This script requires Bash 4.0 or higher (current: ${BASH_VERSION})" >&2
|
|
9
|
-
echo "[INFO] On macOS, install via: brew install bash" >&2
|
|
10
|
-
echo "[INFO] Then update scripts to use: #!/usr/local/bin/bash" >&2
|
|
11
|
-
exit 1
|
|
12
|
-
fi
|
|
5
|
+
# Compatible with Bash 3.2+ (macOS default) and Bash 4+
|
|
13
6
|
|
|
14
7
|
# Source common utilities
|
|
15
8
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
@@ -119,18 +112,19 @@ generate_changelog() {
|
|
|
119
112
|
return 0
|
|
120
113
|
fi
|
|
121
114
|
|
|
122
|
-
# Parse and categorize commits
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
115
|
+
# Parse and categorize commits using parallel indexed arrays (Bash 3.2 compatible)
|
|
116
|
+
# Category names in order
|
|
117
|
+
local category_names=("breaking" "added" "changed" "deprecated" "removed" "fixed" "security" "other")
|
|
118
|
+
|
|
119
|
+
# Initialize category content arrays
|
|
120
|
+
local cat_breaking=""
|
|
121
|
+
local cat_added=""
|
|
122
|
+
local cat_changed=""
|
|
123
|
+
local cat_deprecated=""
|
|
124
|
+
local cat_removed=""
|
|
125
|
+
local cat_fixed=""
|
|
126
|
+
local cat_security=""
|
|
127
|
+
local cat_other=""
|
|
134
128
|
|
|
135
129
|
local commit_count=0
|
|
136
130
|
while IFS='|' read -r hash subject author date; do
|
|
@@ -176,10 +170,41 @@ generate_changelog() {
|
|
|
176
170
|
local clean_msg
|
|
177
171
|
clean_msg=$(clean_commit_message "$subject")
|
|
178
172
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
173
|
+
# Append to appropriate category variable
|
|
174
|
+
case "$category" in
|
|
175
|
+
"breaking")
|
|
176
|
+
[[ -n "$cat_breaking" ]] && cat_breaking+=$'\n'
|
|
177
|
+
cat_breaking+="- $clean_msg"
|
|
178
|
+
;;
|
|
179
|
+
"added")
|
|
180
|
+
[[ -n "$cat_added" ]] && cat_added+=$'\n'
|
|
181
|
+
cat_added+="- $clean_msg"
|
|
182
|
+
;;
|
|
183
|
+
"changed")
|
|
184
|
+
[[ -n "$cat_changed" ]] && cat_changed+=$'\n'
|
|
185
|
+
cat_changed+="- $clean_msg"
|
|
186
|
+
;;
|
|
187
|
+
"deprecated")
|
|
188
|
+
[[ -n "$cat_deprecated" ]] && cat_deprecated+=$'\n'
|
|
189
|
+
cat_deprecated+="- $clean_msg"
|
|
190
|
+
;;
|
|
191
|
+
"removed")
|
|
192
|
+
[[ -n "$cat_removed" ]] && cat_removed+=$'\n'
|
|
193
|
+
cat_removed+="- $clean_msg"
|
|
194
|
+
;;
|
|
195
|
+
"fixed")
|
|
196
|
+
[[ -n "$cat_fixed" ]] && cat_fixed+=$'\n'
|
|
197
|
+
cat_fixed+="- $clean_msg"
|
|
198
|
+
;;
|
|
199
|
+
"security")
|
|
200
|
+
[[ -n "$cat_security" ]] && cat_security+=$'\n'
|
|
201
|
+
cat_security+="- $clean_msg"
|
|
202
|
+
;;
|
|
203
|
+
"other")
|
|
204
|
+
[[ -n "$cat_other" ]] && cat_other+=$'\n'
|
|
205
|
+
cat_other+="- $clean_msg"
|
|
206
|
+
;;
|
|
207
|
+
esac
|
|
183
208
|
|
|
184
209
|
done <<< "$commits_raw"
|
|
185
210
|
|
|
@@ -192,39 +217,46 @@ generate_changelog() {
|
|
|
192
217
|
|
|
193
218
|
changelog_entry+="## [$new_version] - $date"$'\n\n'
|
|
194
219
|
|
|
195
|
-
# Add sections in order
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
220
|
+
# Add sections in order (using individual variables instead of associative array)
|
|
221
|
+
if [[ -n "$cat_breaking" ]]; then
|
|
222
|
+
changelog_entry+="### ⚠️ BREAKING CHANGES"$'\n'
|
|
223
|
+
changelog_entry+="$cat_breaking"$'\n\n'
|
|
224
|
+
fi
|
|
225
|
+
|
|
226
|
+
if [[ -n "$cat_added" ]]; then
|
|
227
|
+
changelog_entry+="### Added"$'\n'
|
|
228
|
+
changelog_entry+="$cat_added"$'\n\n'
|
|
229
|
+
fi
|
|
230
|
+
|
|
231
|
+
if [[ -n "$cat_changed" ]]; then
|
|
232
|
+
changelog_entry+="### Changed"$'\n'
|
|
233
|
+
changelog_entry+="$cat_changed"$'\n\n'
|
|
234
|
+
fi
|
|
235
|
+
|
|
236
|
+
if [[ -n "$cat_deprecated" ]]; then
|
|
237
|
+
changelog_entry+="### Deprecated"$'\n'
|
|
238
|
+
changelog_entry+="$cat_deprecated"$'\n\n'
|
|
239
|
+
fi
|
|
240
|
+
|
|
241
|
+
if [[ -n "$cat_removed" ]]; then
|
|
242
|
+
changelog_entry+="### Removed"$'\n'
|
|
243
|
+
changelog_entry+="$cat_removed"$'\n\n'
|
|
244
|
+
fi
|
|
245
|
+
|
|
246
|
+
if [[ -n "$cat_fixed" ]]; then
|
|
247
|
+
changelog_entry+="### Fixed"$'\n'
|
|
248
|
+
changelog_entry+="$cat_fixed"$'\n\n'
|
|
249
|
+
fi
|
|
250
|
+
|
|
251
|
+
if [[ -n "$cat_security" ]]; then
|
|
252
|
+
changelog_entry+="### Security"$'\n'
|
|
253
|
+
changelog_entry+="$cat_security"$'\n\n'
|
|
254
|
+
fi
|
|
255
|
+
|
|
256
|
+
if [[ -n "$cat_other" ]]; then
|
|
257
|
+
changelog_entry+="### Other"$'\n'
|
|
258
|
+
changelog_entry+="$cat_other"$'\n\n'
|
|
259
|
+
fi
|
|
228
260
|
|
|
229
261
|
# Preview changelog
|
|
230
262
|
info "Changelog preview:"
|
data/scripts/lib/gem.sh
CHANGED
|
@@ -47,15 +47,27 @@ build_gem() {
|
|
|
47
47
|
error "Gem file not found after build: $gem_file"
|
|
48
48
|
fi
|
|
49
49
|
|
|
50
|
-
# Show gem info
|
|
51
|
-
local file_count
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
# Show gem info (with error handling for tar extraction)
|
|
51
|
+
local file_count="unknown"
|
|
52
|
+
local file_size="unknown"
|
|
53
|
+
|
|
54
|
+
# Try to get file count (may fail on some platforms/tar versions)
|
|
55
|
+
if command -v tar &> /dev/null; then
|
|
56
|
+
file_count=$(tar -tzf "$gem_file" 2>/dev/null | wc -l | tr -d ' ') || file_count="unknown"
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
# Get file size (should always work)
|
|
60
|
+
if command -v ls &> /dev/null; then
|
|
61
|
+
file_size=$(ls -lh "$gem_file" 2>/dev/null | awk '{print $5}') || file_size="unknown"
|
|
62
|
+
fi
|
|
55
63
|
|
|
56
64
|
success "Built $gem_file"
|
|
57
|
-
|
|
58
|
-
|
|
65
|
+
if [[ "$file_count" != "unknown" ]]; then
|
|
66
|
+
info " Files: $file_count"
|
|
67
|
+
fi
|
|
68
|
+
if [[ "$file_size" != "unknown" ]]; then
|
|
69
|
+
info " Size: $file_size"
|
|
70
|
+
fi
|
|
59
71
|
}
|
|
60
72
|
|
|
61
73
|
# Check if gem version exists on RubyGems
|
data/scripts/release
CHANGED
|
@@ -1,240 +1,11 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
3
|
+
# ============================================================================
|
|
4
|
+
# WRAPPER: This script forwards to scripts/bin/release
|
|
5
|
+
#
|
|
6
|
+
# The canonical location is scripts/bin/release. This wrapper exists for
|
|
7
|
+
# backward compatibility with existing workflows and VS Code tasks.
|
|
8
|
+
# ============================================================================
|
|
7
9
|
|
|
8
|
-
set -euo pipefail
|
|
9
|
-
|
|
10
|
-
# Get script and library directories
|
|
11
10
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
# Source all required libraries
|
|
15
|
-
source "$LIB_DIR/common.sh"
|
|
16
|
-
source "$LIB_DIR/validation.sh"
|
|
17
|
-
source "$LIB_DIR/version.sh"
|
|
18
|
-
source "$LIB_DIR/git.sh"
|
|
19
|
-
source "$LIB_DIR/changelog.sh"
|
|
20
|
-
source "$LIB_DIR/gem.sh"
|
|
21
|
-
|
|
22
|
-
# Show usage function
|
|
23
|
-
show_usage() {
|
|
24
|
-
cat << EOF
|
|
25
|
-
🚀 Simplified Release Command for zer0-mistakes
|
|
26
|
-
|
|
27
|
-
USAGE:
|
|
28
|
-
./scripts/release [VERSION_TYPE] [OPTIONS]
|
|
29
|
-
|
|
30
|
-
VERSION TYPES:
|
|
31
|
-
patch Bump patch version (0.0.X) - Bug fixes (default)
|
|
32
|
-
minor Bump minor version (0.X.0) - New features
|
|
33
|
-
major Bump major version (X.0.0) - Breaking changes
|
|
34
|
-
|
|
35
|
-
OPTIONS:
|
|
36
|
-
--dry-run Preview changes without executing
|
|
37
|
-
--skip-tests Skip running test suite
|
|
38
|
-
--skip-publish Build but don't publish to RubyGems
|
|
39
|
-
--no-github-release Skip creating GitHub release
|
|
40
|
-
--non-interactive Run without confirmation prompts
|
|
41
|
-
--verbose Show detailed debug output
|
|
42
|
-
--help, -h Show this help message
|
|
43
|
-
|
|
44
|
-
EXAMPLES:
|
|
45
|
-
./scripts/release # Patch release (0.6.0 → 0.6.1)
|
|
46
|
-
./scripts/release minor # Minor release (0.6.0 → 0.7.0)
|
|
47
|
-
./scripts/release major --dry-run # Preview major release
|
|
48
|
-
./scripts/release patch --skip-tests # Quick release without tests
|
|
49
|
-
|
|
50
|
-
ENVIRONMENT VARIABLES:
|
|
51
|
-
DRY_RUN=true Enable dry run mode
|
|
52
|
-
INTERACTIVE=false Disable confirmation prompts
|
|
53
|
-
VERBOSE=true Enable debug output
|
|
54
|
-
|
|
55
|
-
WORKFLOW:
|
|
56
|
-
1. Validate environment
|
|
57
|
-
2. Calculate new version
|
|
58
|
-
3. Generate changelog from commits
|
|
59
|
-
4. Update version files
|
|
60
|
-
5. Run tests (unless --skip-tests)
|
|
61
|
-
6. Build gem
|
|
62
|
-
7. Commit and tag
|
|
63
|
-
8. Publish to RubyGems (unless --skip-publish)
|
|
64
|
-
9. Create GitHub release (unless --no-github-release)
|
|
65
|
-
10. Push changes to repository
|
|
66
|
-
|
|
67
|
-
For more information, see: scripts/lib/README.md
|
|
68
|
-
EOF
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
# Default configuration
|
|
72
|
-
VERSION_TYPE="patch"
|
|
73
|
-
SKIP_TESTS=false
|
|
74
|
-
SKIP_PUBLISH=false
|
|
75
|
-
SKIP_GITHUB_RELEASE=false
|
|
76
|
-
SHOW_HELP=false
|
|
77
|
-
|
|
78
|
-
# Parse arguments
|
|
79
|
-
for arg in "$@"; do
|
|
80
|
-
case $arg in
|
|
81
|
-
--help|-h)
|
|
82
|
-
SHOW_HELP=true
|
|
83
|
-
;;
|
|
84
|
-
patch|minor|major)
|
|
85
|
-
VERSION_TYPE="$arg"
|
|
86
|
-
;;
|
|
87
|
-
esac
|
|
88
|
-
done
|
|
89
|
-
|
|
90
|
-
# Show help if requested
|
|
91
|
-
if [[ "$SHOW_HELP" == "true" ]]; then
|
|
92
|
-
show_usage
|
|
93
|
-
exit 0
|
|
94
|
-
fi
|
|
95
|
-
|
|
96
|
-
# Parse remaining arguments
|
|
97
|
-
while [[ $# -gt 0 ]]; do
|
|
98
|
-
case $1 in
|
|
99
|
-
patch|minor|major)
|
|
100
|
-
# Already handled above
|
|
101
|
-
shift
|
|
102
|
-
;;
|
|
103
|
-
--help|-h)
|
|
104
|
-
# Already handled above
|
|
105
|
-
shift
|
|
106
|
-
;;
|
|
107
|
-
--dry-run)
|
|
108
|
-
export DRY_RUN=true
|
|
109
|
-
shift
|
|
110
|
-
;;
|
|
111
|
-
--skip-tests)
|
|
112
|
-
SKIP_TESTS=true
|
|
113
|
-
shift
|
|
114
|
-
;;
|
|
115
|
-
--skip-publish)
|
|
116
|
-
SKIP_PUBLISH=true
|
|
117
|
-
shift
|
|
118
|
-
;;
|
|
119
|
-
--no-github-release)
|
|
120
|
-
SKIP_GITHUB_RELEASE=true
|
|
121
|
-
shift
|
|
122
|
-
;;
|
|
123
|
-
--non-interactive)
|
|
124
|
-
export INTERACTIVE=false
|
|
125
|
-
shift
|
|
126
|
-
;;
|
|
127
|
-
--verbose)
|
|
128
|
-
export VERBOSE=true
|
|
129
|
-
shift
|
|
130
|
-
;;
|
|
131
|
-
*)
|
|
132
|
-
error "Unknown option: $1 (use --help for usage)"
|
|
133
|
-
;;
|
|
134
|
-
esac
|
|
135
|
-
done
|
|
136
|
-
|
|
137
|
-
# Main release workflow
|
|
138
|
-
main() {
|
|
139
|
-
print_header "🚀 Release Automation"
|
|
140
|
-
|
|
141
|
-
# Show configuration
|
|
142
|
-
info "Version type: $VERSION_TYPE"
|
|
143
|
-
info "Dry run: ${DRY_RUN:-false}"
|
|
144
|
-
info "Interactive: ${INTERACTIVE:-true}"
|
|
145
|
-
echo ""
|
|
146
|
-
|
|
147
|
-
# Step 1: Validate environment
|
|
148
|
-
validate_environment "$SKIP_PUBLISH" "$SKIP_GITHUB_RELEASE"
|
|
149
|
-
|
|
150
|
-
# Step 2: Version calculation
|
|
151
|
-
step "Calculating new version..."
|
|
152
|
-
local current_version
|
|
153
|
-
current_version=$(get_current_version)
|
|
154
|
-
info "Current version: $current_version"
|
|
155
|
-
|
|
156
|
-
local new_version
|
|
157
|
-
new_version=$(calculate_new_version "$current_version" "$VERSION_TYPE")
|
|
158
|
-
info "New version: $new_version"
|
|
159
|
-
|
|
160
|
-
# Confirm before proceeding
|
|
161
|
-
if [[ "$INTERACTIVE" == "true" ]] && [[ "$DRY_RUN" != "true" ]]; then
|
|
162
|
-
echo ""
|
|
163
|
-
if ! confirm "Proceed with release $current_version → $new_version?"; then
|
|
164
|
-
warn "Release cancelled by user"
|
|
165
|
-
exit 0
|
|
166
|
-
fi
|
|
167
|
-
fi
|
|
168
|
-
echo ""
|
|
169
|
-
|
|
170
|
-
# Step 3: Generate changelog
|
|
171
|
-
step "Generating changelog..."
|
|
172
|
-
local last_tag
|
|
173
|
-
last_tag=$(get_last_version_tag)
|
|
174
|
-
generate_changelog "$new_version" "$last_tag" "HEAD"
|
|
175
|
-
echo ""
|
|
176
|
-
|
|
177
|
-
# Step 4: Update version files
|
|
178
|
-
update_version_files "$new_version"
|
|
179
|
-
echo ""
|
|
180
|
-
|
|
181
|
-
# Step 5: Run tests
|
|
182
|
-
if [[ "$SKIP_TESTS" != "true" ]]; then
|
|
183
|
-
run_tests
|
|
184
|
-
echo ""
|
|
185
|
-
else
|
|
186
|
-
warn "Skipping tests (--skip-tests specified)"
|
|
187
|
-
echo ""
|
|
188
|
-
fi
|
|
189
|
-
|
|
190
|
-
# Step 6: Build gem
|
|
191
|
-
build_gem "$new_version"
|
|
192
|
-
echo ""
|
|
193
|
-
|
|
194
|
-
# Step 7: Commit and tag
|
|
195
|
-
commit_and_tag "$new_version"
|
|
196
|
-
echo ""
|
|
197
|
-
|
|
198
|
-
# Step 8: Publish gem
|
|
199
|
-
if [[ "$SKIP_PUBLISH" != "true" ]]; then
|
|
200
|
-
publish_gem "$new_version"
|
|
201
|
-
echo ""
|
|
202
|
-
else
|
|
203
|
-
warn "Skipping RubyGems publication (--skip-publish specified)"
|
|
204
|
-
echo ""
|
|
205
|
-
fi
|
|
206
|
-
|
|
207
|
-
# Step 9: Create GitHub release
|
|
208
|
-
if [[ "$SKIP_GITHUB_RELEASE" != "true" ]]; then
|
|
209
|
-
create_github_release "$new_version"
|
|
210
|
-
echo ""
|
|
211
|
-
else
|
|
212
|
-
warn "Skipping GitHub release (--no-github-release specified)"
|
|
213
|
-
echo ""
|
|
214
|
-
fi
|
|
215
|
-
|
|
216
|
-
# Step 10: Push changes
|
|
217
|
-
push_changes
|
|
218
|
-
echo ""
|
|
219
|
-
|
|
220
|
-
# Step 11: Cleanup
|
|
221
|
-
cleanup_gem_files "$new_version"
|
|
222
|
-
echo ""
|
|
223
|
-
|
|
224
|
-
# Success summary
|
|
225
|
-
print_header "✅ Release Complete!"
|
|
226
|
-
|
|
227
|
-
print_summary "Release $new_version" \
|
|
228
|
-
"Version: $current_version → $new_version" \
|
|
229
|
-
"Type: $VERSION_TYPE bump" \
|
|
230
|
-
"Tag: v$new_version" \
|
|
231
|
-
"" \
|
|
232
|
-
"📦 RubyGems: https://rubygems.org/gems/jekyll-theme-zer0/versions/$new_version" \
|
|
233
|
-
"🏷️ GitHub: https://github.com/bamr87/zer0-mistakes/releases/tag/v$new_version" \
|
|
234
|
-
"📂 Repository: https://github.com/bamr87/zer0-mistakes"
|
|
235
|
-
|
|
236
|
-
success "Release workflow completed successfully!"
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
# Run main function
|
|
240
|
-
main "$@"
|
|
11
|
+
exec "$SCRIPT_DIR/bin/release" "$@"
|
data/scripts/setup.sh
CHANGED
|
@@ -1,155 +1,11 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
#
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
BLUE='\033[0;34m'
|
|
13
|
-
NC='\033[0m' # No Color
|
|
14
|
-
|
|
15
|
-
# Function to log messages
|
|
16
|
-
log() {
|
|
17
|
-
echo -e "${GREEN}[SETUP]${NC} $1"
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
warn() {
|
|
21
|
-
echo -e "${YELLOW}[WARNING]${NC} $1"
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
error() {
|
|
25
|
-
echo -e "${RED}[ERROR]${NC} $1"
|
|
26
|
-
exit 1
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
info() {
|
|
30
|
-
echo -e "${BLUE}[INFO]${NC} $1"
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
log "Setting up zer0-mistakes Jekyll theme development environment..."
|
|
34
|
-
|
|
35
|
-
# Check system requirements
|
|
36
|
-
log "Checking system requirements..."
|
|
37
|
-
|
|
38
|
-
# Check Ruby
|
|
39
|
-
if ! command -v ruby &> /dev/null; then
|
|
40
|
-
error "Ruby is not installed. Please install Ruby >= 2.7.0"
|
|
41
|
-
fi
|
|
42
|
-
|
|
43
|
-
RUBY_VERSION=$(ruby --version | awk '{print $2}')
|
|
44
|
-
log "Ruby version: $RUBY_VERSION"
|
|
45
|
-
|
|
46
|
-
# Check Bundler
|
|
47
|
-
if ! command -v bundle &> /dev/null; then
|
|
48
|
-
log "Installing Bundler..."
|
|
49
|
-
gem install bundler
|
|
50
|
-
fi
|
|
51
|
-
|
|
52
|
-
# Check jq
|
|
53
|
-
if ! command -v jq &> /dev/null; then
|
|
54
|
-
warn "jq is not installed. Installing via Homebrew (macOS)..."
|
|
55
|
-
if command -v brew &> /dev/null; then
|
|
56
|
-
brew install jq
|
|
57
|
-
else
|
|
58
|
-
error "jq is required but not installed. Please install jq manually."
|
|
59
|
-
fi
|
|
60
|
-
fi
|
|
61
|
-
|
|
62
|
-
# Check Git
|
|
63
|
-
if ! command -v git &> /dev/null; then
|
|
64
|
-
error "Git is not installed"
|
|
65
|
-
fi
|
|
66
|
-
|
|
67
|
-
# Install dependencies
|
|
68
|
-
log "Installing Ruby dependencies..."
|
|
69
|
-
bundle install
|
|
70
|
-
|
|
71
|
-
# Make scripts executable
|
|
72
|
-
log "Making scripts executable..."
|
|
73
|
-
chmod +x scripts/*.sh
|
|
74
|
-
|
|
75
|
-
# Validate gemspec
|
|
76
|
-
log "Validating gemspec..."
|
|
77
|
-
if gem specification jekyll-theme-zer0.gemspec > /dev/null 2>&1; then
|
|
78
|
-
info "✓ Gemspec is valid"
|
|
79
|
-
else
|
|
80
|
-
error "Gemspec validation failed"
|
|
81
|
-
fi
|
|
82
|
-
|
|
83
|
-
# Create CHANGELOG if it doesn't exist
|
|
84
|
-
if [[ ! -f "CHANGELOG.md" ]]; then
|
|
85
|
-
log "Creating CHANGELOG.md..."
|
|
86
|
-
cat > CHANGELOG.md << 'EOF'
|
|
87
|
-
# Changelog
|
|
88
|
-
|
|
89
|
-
All notable changes to this project will be documented in this file.
|
|
90
|
-
|
|
91
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
92
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
93
|
-
|
|
94
|
-
## [Unreleased]
|
|
95
|
-
|
|
96
|
-
### Added
|
|
97
|
-
- Initial development setup
|
|
98
|
-
|
|
99
|
-
EOF
|
|
100
|
-
fi
|
|
101
|
-
|
|
102
|
-
# Create .gitignore additions for gem development
|
|
103
|
-
if ! grep -q "*.gem" .gitignore 2>/dev/null; then
|
|
104
|
-
log "Adding gem development entries to .gitignore..."
|
|
105
|
-
cat >> .gitignore << 'EOF'
|
|
106
|
-
|
|
107
|
-
# Gem development
|
|
108
|
-
*.gem
|
|
109
|
-
.bundle/
|
|
110
|
-
vendor/
|
|
111
|
-
pkg/
|
|
112
|
-
EOF
|
|
113
|
-
fi
|
|
114
|
-
|
|
115
|
-
# Setup Git hooks (optional)
|
|
116
|
-
if [[ -d ".git" ]]; then
|
|
117
|
-
log "Setting up Git hooks..."
|
|
118
|
-
mkdir -p .git/hooks
|
|
119
|
-
|
|
120
|
-
# Pre-commit hook to run basic validations
|
|
121
|
-
cat > .git/hooks/pre-commit << 'EOF'
|
|
122
|
-
#!/bin/bash
|
|
123
|
-
# Pre-commit hook for zer0-mistakes Jekyll theme
|
|
124
|
-
|
|
125
|
-
echo "Running pre-commit validations..."
|
|
126
|
-
|
|
127
|
-
# Validate gemspec
|
|
128
|
-
if ! gem specification jekyll-theme-zer0.gemspec > /dev/null 2>&1; then
|
|
129
|
-
echo "❌ Gemspec validation failed"
|
|
130
|
-
exit 1
|
|
131
|
-
fi
|
|
132
|
-
|
|
133
|
-
# Check if package.json version is valid
|
|
134
|
-
if ! jq -e '.version' package.json > /dev/null 2>&1; then
|
|
135
|
-
echo "❌ Invalid version in package.json"
|
|
136
|
-
exit 1
|
|
137
|
-
fi
|
|
138
|
-
|
|
139
|
-
echo "✅ Pre-commit validations passed"
|
|
140
|
-
EOF
|
|
141
|
-
chmod +x .git/hooks/pre-commit
|
|
142
|
-
fi
|
|
143
|
-
|
|
144
|
-
log "Setup complete!"
|
|
145
|
-
log ""
|
|
146
|
-
log "Available commands:"
|
|
147
|
-
log " ./scripts/version.sh [patch|minor|major] - Bump version"
|
|
148
|
-
log " ./scripts/build.sh [--publish] - Build (and optionally publish) gem"
|
|
149
|
-
log " ./scripts/test.sh - Run tests"
|
|
150
|
-
log ""
|
|
151
|
-
log "Development workflow:"
|
|
152
|
-
log "1. Make your changes"
|
|
153
|
-
log "2. Run ./scripts/test.sh to validate"
|
|
154
|
-
log "3. Run ./scripts/version.sh to bump version"
|
|
155
|
-
log "4. Run ./scripts/build.sh --publish to release"
|
|
3
|
+
# ============================================================================
|
|
4
|
+
# WRAPPER: This script forwards to scripts/utils/setup
|
|
5
|
+
#
|
|
6
|
+
# The canonical location is scripts/utils/setup. This wrapper exists for
|
|
7
|
+
# backward compatibility with existing workflows.
|
|
8
|
+
# ============================================================================
|
|
9
|
+
|
|
10
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
11
|
+
exec "$SCRIPT_DIR/utils/setup" "$@"
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# Test runner for library unit tests
|
|
4
4
|
# Usage: ./scripts/test/lib/run_tests.sh
|
|
5
5
|
#
|
|
6
|
-
#
|
|
7
|
-
# On macOS: brew install bash
|
|
6
|
+
# Compatible with Bash 3.2+ (macOS default) and Bash 4+
|
|
8
7
|
|
|
9
8
|
# Note: We intentionally don't use set -e here because test assertions
|
|
10
9
|
# may return non-zero and we want to continue running tests
|