jekyll-theme-zer0 0.8.1 → 0.10.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +201 -4
- data/README.md +58 -25
- data/_data/README.md +4 -5
- data/_includes/README.md +1 -1
- data/_includes/stats/README.md +14 -2
- data/_layouts/README.md +3 -3
- data/_sass/core/_theme.scss +4 -1
- data/scripts/bin/build +115 -0
- data/scripts/bin/release +240 -0
- data/scripts/bin/test +203 -0
- data/scripts/features/generate-preview-images +846 -0
- data/scripts/features/install-preview-generator +531 -0
- data/scripts/features/preview_generator.py +646 -0
- data/scripts/generate-preview-images.sh +38 -93
- data/scripts/lib/README.md +35 -7
- data/scripts/test/integration/auto-version +243 -0
- data/scripts/test/integration/mermaid +252 -0
- data/scripts/test/lib/run_tests.sh +151 -0
- data/scripts/test/lib/test_changelog.sh +90 -0
- data/scripts/test/lib/test_gem.sh +71 -0
- data/scripts/test/lib/test_git.sh +85 -0
- data/scripts/test/lib/test_validation.sh +75 -0
- data/scripts/test/lib/test_version.sh +101 -0
- data/scripts/test/theme/validate +120 -0
- data/scripts/utils/analyze-commits +300 -0
- data/scripts/utils/fix-markdown +251 -0
- data/scripts/utils/setup +137 -0
- data/scripts/version.sh +26 -0
- metadata +20 -8
- data/scripts/build.sh +0 -33
- data/scripts/build.sh.legacy +0 -174
- data/scripts/gem-publish.sh +0 -42
- data/scripts/gem-publish.sh.legacy +0 -700
- data/scripts/release.sh +0 -33
- data/scripts/release.sh.legacy +0 -342
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
#
|
|
4
|
+
# Markdown Formatting Fix Script
|
|
5
|
+
# Addresses common markdown linting violations across the repository
|
|
6
|
+
#
|
|
7
|
+
|
|
8
|
+
set -euo pipefail
|
|
9
|
+
|
|
10
|
+
# Get script and library directories
|
|
11
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
12
|
+
LIB_DIR="$SCRIPT_DIR/../lib"
|
|
13
|
+
PROJECT_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")"
|
|
14
|
+
|
|
15
|
+
# Source common library for logging and utilities
|
|
16
|
+
source "$LIB_DIR/common.sh"
|
|
17
|
+
|
|
18
|
+
# Aliases for backward compatibility with logging function names
|
|
19
|
+
log_info() { info "$@"; }
|
|
20
|
+
log_success() { success "$@"; }
|
|
21
|
+
log_warning() { warn "$@"; }
|
|
22
|
+
log_error() { error "$@"; }
|
|
23
|
+
|
|
24
|
+
# Function to fix common markdown issues
|
|
25
|
+
fix_markdown_file() {
|
|
26
|
+
local file="$1"
|
|
27
|
+
local temp_file="${file}.tmp"
|
|
28
|
+
|
|
29
|
+
info "Fixing markdown formatting in: $file"
|
|
30
|
+
|
|
31
|
+
# Create backup
|
|
32
|
+
cp "$file" "${file}.backup"
|
|
33
|
+
|
|
34
|
+
# Apply fixes using sed (macOS compatible)
|
|
35
|
+
sed -e 's/[[:space:]]*$//' \
|
|
36
|
+
-e '/^#/a\
|
|
37
|
+
' \
|
|
38
|
+
-e '/^##/a\
|
|
39
|
+
' \
|
|
40
|
+
-e '/^###/a\
|
|
41
|
+
' \
|
|
42
|
+
-e '/^####/a\
|
|
43
|
+
' \
|
|
44
|
+
-e '/^#####/a\
|
|
45
|
+
' \
|
|
46
|
+
-e '/^######/a\
|
|
47
|
+
' \
|
|
48
|
+
-e '/^- /i\
|
|
49
|
+
' \
|
|
50
|
+
-e '/^* /i\
|
|
51
|
+
' \
|
|
52
|
+
-e '/^+ /i\
|
|
53
|
+
' \
|
|
54
|
+
-e '/^[0-9]/i\
|
|
55
|
+
' \
|
|
56
|
+
-e 's/```$/```bash/' \
|
|
57
|
+
-e 's/^```[[:space:]]*$/```bash/' \
|
|
58
|
+
"$file" > "$temp_file"
|
|
59
|
+
|
|
60
|
+
# Additional fixes with awk for more complex patterns
|
|
61
|
+
awk '
|
|
62
|
+
BEGIN { prev_was_heading = 0; prev_was_list = 0 }
|
|
63
|
+
|
|
64
|
+
# Handle headings - ensure blank line before and after
|
|
65
|
+
/^#/ {
|
|
66
|
+
if (NR > 1 && prev_line != "" && !prev_was_heading) print ""
|
|
67
|
+
print $0
|
|
68
|
+
prev_was_heading = 1
|
|
69
|
+
prev_was_list = 0
|
|
70
|
+
prev_line = $0
|
|
71
|
+
next
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
# Handle list items - ensure blank line before first item
|
|
75
|
+
/^[[:space:]]*[-*+]/ || /^[[:space:]]*[0-9]+\./ {
|
|
76
|
+
if (!prev_was_list && prev_line != "" && !prev_was_heading) print ""
|
|
77
|
+
print $0
|
|
78
|
+
prev_was_list = 1
|
|
79
|
+
prev_was_heading = 0
|
|
80
|
+
prev_line = $0
|
|
81
|
+
next
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
# Handle code blocks - ensure they have language specification
|
|
85
|
+
/^```[[:space:]]*$/ {
|
|
86
|
+
print "```bash"
|
|
87
|
+
prev_was_heading = 0
|
|
88
|
+
prev_was_list = 0
|
|
89
|
+
prev_line = $0
|
|
90
|
+
next
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
# Regular lines
|
|
94
|
+
{
|
|
95
|
+
print $0
|
|
96
|
+
prev_was_heading = 0
|
|
97
|
+
prev_was_list = 0
|
|
98
|
+
prev_line = $0
|
|
99
|
+
}
|
|
100
|
+
' "$temp_file" > "$file"
|
|
101
|
+
|
|
102
|
+
# Clean up
|
|
103
|
+
rm "$temp_file"
|
|
104
|
+
|
|
105
|
+
log_success "Fixed formatting in: $file"
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
# Function to remove trailing whitespace
|
|
109
|
+
remove_trailing_whitespace() {
|
|
110
|
+
local file="$1"
|
|
111
|
+
log_info "Removing trailing whitespace from: $file"
|
|
112
|
+
|
|
113
|
+
# Remove trailing whitespace
|
|
114
|
+
sed -i '' 's/[[:space:]]*$//' "$file"
|
|
115
|
+
|
|
116
|
+
log_success "Removed trailing whitespace from: $file"
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
# Function to fix heading punctuation
|
|
120
|
+
fix_heading_punctuation() {
|
|
121
|
+
local file="$1"
|
|
122
|
+
log_info "Fixing heading punctuation in: $file"
|
|
123
|
+
|
|
124
|
+
# Remove trailing punctuation from headings
|
|
125
|
+
sed -i '' 's/^\(#\+[[:space:]]*.*\)[.!?:;,]*[[:space:]]*$/\1/' "$file"
|
|
126
|
+
|
|
127
|
+
log_success "Fixed heading punctuation in: $file"
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
# Function to fix emphasis formatting
|
|
131
|
+
fix_emphasis_formatting() {
|
|
132
|
+
local file="$1"
|
|
133
|
+
log_info "Fixing emphasis formatting in: $file"
|
|
134
|
+
|
|
135
|
+
# Fix common emphasis issues
|
|
136
|
+
sed -i '' \
|
|
137
|
+
-e 's/\*\*\([^*]*\) \*\*/\*\*\1\*\*/g' \
|
|
138
|
+
-e 's/\*\([^*]*\) \*/\*\1\*/g' \
|
|
139
|
+
"$file"
|
|
140
|
+
|
|
141
|
+
log_success "Fixed emphasis formatting in: $file"
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
# Main execution function
|
|
145
|
+
main() {
|
|
146
|
+
log_info "Starting markdown formatting fixes..."
|
|
147
|
+
|
|
148
|
+
# Find all markdown files
|
|
149
|
+
local md_files
|
|
150
|
+
mapfile -t md_files < <(find "$PROJECT_ROOT" -name "*.md" \
|
|
151
|
+
-not -path "*/node_modules/*" \
|
|
152
|
+
-not -path "*/.git/*" \
|
|
153
|
+
-not -path "*/vendor/*" \
|
|
154
|
+
-not -path "*/_site/*")
|
|
155
|
+
|
|
156
|
+
if [ ${#md_files[@]} -eq 0 ]; then
|
|
157
|
+
log_warning "No markdown files found"
|
|
158
|
+
return 0
|
|
159
|
+
fi
|
|
160
|
+
|
|
161
|
+
log_info "Found ${#md_files[@]} markdown files to process"
|
|
162
|
+
|
|
163
|
+
# Process each file
|
|
164
|
+
for file in "${md_files[@]}"; do
|
|
165
|
+
if [ -f "$file" ]; then
|
|
166
|
+
remove_trailing_whitespace "$file"
|
|
167
|
+
fix_heading_punctuation "$file"
|
|
168
|
+
fix_emphasis_formatting "$file"
|
|
169
|
+
fix_markdown_file "$file"
|
|
170
|
+
fi
|
|
171
|
+
done
|
|
172
|
+
|
|
173
|
+
log_success "Completed markdown formatting fixes for ${#md_files[@]} files"
|
|
174
|
+
|
|
175
|
+
# Provide summary
|
|
176
|
+
echo
|
|
177
|
+
log_info "Summary of fixes applied:"
|
|
178
|
+
echo " ✓ Removed trailing whitespace"
|
|
179
|
+
echo " ✓ Added blank lines around headings"
|
|
180
|
+
echo " ✓ Added blank lines before list items"
|
|
181
|
+
echo " ✓ Fixed code block language specifications"
|
|
182
|
+
echo " ✓ Fixed heading punctuation"
|
|
183
|
+
echo " ✓ Fixed emphasis formatting"
|
|
184
|
+
echo
|
|
185
|
+
log_info "Backup files created with .backup extension"
|
|
186
|
+
log_info "Run 'git diff' to review changes before committing"
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
# Help function
|
|
190
|
+
show_help() {
|
|
191
|
+
cat << EOF
|
|
192
|
+
Markdown Formatting Fix Script
|
|
193
|
+
|
|
194
|
+
USAGE:
|
|
195
|
+
$0 [OPTIONS]
|
|
196
|
+
|
|
197
|
+
OPTIONS:
|
|
198
|
+
-h, --help Show this help message
|
|
199
|
+
--dry-run Show what would be fixed without making changes
|
|
200
|
+
--file FILE Fix only the specified file
|
|
201
|
+
|
|
202
|
+
EXAMPLES:
|
|
203
|
+
$0 # Fix all markdown files
|
|
204
|
+
$0 --file README.md # Fix only README.md
|
|
205
|
+
$0 --dry-run # Preview changes without applying
|
|
206
|
+
|
|
207
|
+
This script fixes common markdown linting violations:
|
|
208
|
+
- Trailing whitespace
|
|
209
|
+
- Missing blank lines around headings
|
|
210
|
+
- Missing blank lines before lists
|
|
211
|
+
- Code blocks without language specification
|
|
212
|
+
- Heading punctuation issues
|
|
213
|
+
- Emphasis formatting problems
|
|
214
|
+
|
|
215
|
+
EOF
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
# Parse command line arguments
|
|
219
|
+
case "${1:-}" in
|
|
220
|
+
-h|--help)
|
|
221
|
+
show_help
|
|
222
|
+
exit 0
|
|
223
|
+
;;
|
|
224
|
+
--dry-run)
|
|
225
|
+
log_info "DRY RUN MODE - No changes will be made"
|
|
226
|
+
# Implementation for dry run would go here
|
|
227
|
+
exit 0
|
|
228
|
+
;;
|
|
229
|
+
--file)
|
|
230
|
+
if [ -n "${2:-}" ] && [ -f "$2" ]; then
|
|
231
|
+
log_info "Fixing single file: $2"
|
|
232
|
+
remove_trailing_whitespace "$2"
|
|
233
|
+
fix_heading_punctuation "$2"
|
|
234
|
+
fix_emphasis_formatting "$2"
|
|
235
|
+
fix_markdown_file "$2"
|
|
236
|
+
log_success "Completed fixing: $2"
|
|
237
|
+
else
|
|
238
|
+
log_error "File not found: ${2:-}"
|
|
239
|
+
exit 1
|
|
240
|
+
fi
|
|
241
|
+
exit 0
|
|
242
|
+
;;
|
|
243
|
+
"")
|
|
244
|
+
main
|
|
245
|
+
;;
|
|
246
|
+
*)
|
|
247
|
+
log_error "Unknown option: $1"
|
|
248
|
+
show_help
|
|
249
|
+
exit 1
|
|
250
|
+
;;
|
|
251
|
+
esac
|
data/scripts/utils/setup
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Development setup script for zer0-mistakes Jekyll theme
|
|
4
|
+
# Usage: ./scripts/utils/setup
|
|
5
|
+
|
|
6
|
+
set -euo pipefail
|
|
7
|
+
|
|
8
|
+
# Get script and library directories
|
|
9
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
10
|
+
LIB_DIR="$SCRIPT_DIR/../lib"
|
|
11
|
+
|
|
12
|
+
# Source common library for logging and utilities
|
|
13
|
+
source "$LIB_DIR/common.sh"
|
|
14
|
+
|
|
15
|
+
log "Setting up zer0-mistakes Jekyll theme development environment..."
|
|
16
|
+
|
|
17
|
+
# Check system requirements
|
|
18
|
+
log "Checking system requirements..."
|
|
19
|
+
|
|
20
|
+
# Check Ruby
|
|
21
|
+
if ! command -v ruby &> /dev/null; then
|
|
22
|
+
error "Ruby is not installed. Please install Ruby >= 2.7.0"
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
RUBY_VERSION=$(ruby --version | awk '{print $2}')
|
|
26
|
+
log "Ruby version: $RUBY_VERSION"
|
|
27
|
+
|
|
28
|
+
# Check Bundler
|
|
29
|
+
if ! command -v bundle &> /dev/null; then
|
|
30
|
+
log "Installing Bundler..."
|
|
31
|
+
gem install bundler
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
# Check jq
|
|
35
|
+
if ! command -v jq &> /dev/null; then
|
|
36
|
+
warn "jq is not installed. Installing via Homebrew (macOS)..."
|
|
37
|
+
if command -v brew &> /dev/null; then
|
|
38
|
+
brew install jq
|
|
39
|
+
else
|
|
40
|
+
error "jq is required but not installed. Please install jq manually."
|
|
41
|
+
fi
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
# Check Git
|
|
45
|
+
if ! command -v git &> /dev/null; then
|
|
46
|
+
error "Git is not installed"
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
# Install dependencies
|
|
50
|
+
log "Installing Ruby dependencies..."
|
|
51
|
+
bundle install
|
|
52
|
+
|
|
53
|
+
# Make scripts executable
|
|
54
|
+
log "Making scripts executable..."
|
|
55
|
+
chmod +x scripts/*.sh
|
|
56
|
+
|
|
57
|
+
# Validate gemspec
|
|
58
|
+
log "Validating gemspec..."
|
|
59
|
+
if gem specification jekyll-theme-zer0.gemspec > /dev/null 2>&1; then
|
|
60
|
+
info "✓ Gemspec is valid"
|
|
61
|
+
else
|
|
62
|
+
error "Gemspec validation failed"
|
|
63
|
+
fi
|
|
64
|
+
|
|
65
|
+
# Create CHANGELOG if it doesn't exist
|
|
66
|
+
if [[ ! -f "CHANGELOG.md" ]]; then
|
|
67
|
+
log "Creating CHANGELOG.md..."
|
|
68
|
+
cat > CHANGELOG.md << 'EOF'
|
|
69
|
+
# Changelog
|
|
70
|
+
|
|
71
|
+
All notable changes to this project will be documented in this file.
|
|
72
|
+
|
|
73
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
74
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
75
|
+
|
|
76
|
+
## [Unreleased]
|
|
77
|
+
|
|
78
|
+
### Added
|
|
79
|
+
- Initial development setup
|
|
80
|
+
|
|
81
|
+
EOF
|
|
82
|
+
fi
|
|
83
|
+
|
|
84
|
+
# Create .gitignore additions for gem development
|
|
85
|
+
if ! grep -q "*.gem" .gitignore 2>/dev/null; then
|
|
86
|
+
log "Adding gem development entries to .gitignore..."
|
|
87
|
+
cat >> .gitignore << 'EOF'
|
|
88
|
+
|
|
89
|
+
# Gem development
|
|
90
|
+
*.gem
|
|
91
|
+
.bundle/
|
|
92
|
+
vendor/
|
|
93
|
+
pkg/
|
|
94
|
+
EOF
|
|
95
|
+
fi
|
|
96
|
+
|
|
97
|
+
# Setup Git hooks (optional)
|
|
98
|
+
if [[ -d ".git" ]]; then
|
|
99
|
+
log "Setting up Git hooks..."
|
|
100
|
+
mkdir -p .git/hooks
|
|
101
|
+
|
|
102
|
+
# Pre-commit hook to run basic validations
|
|
103
|
+
cat > .git/hooks/pre-commit << 'EOF'
|
|
104
|
+
#!/bin/bash
|
|
105
|
+
# Pre-commit hook for zer0-mistakes Jekyll theme
|
|
106
|
+
|
|
107
|
+
echo "Running pre-commit validations..."
|
|
108
|
+
|
|
109
|
+
# Validate gemspec
|
|
110
|
+
if ! gem specification jekyll-theme-zer0.gemspec > /dev/null 2>&1; then
|
|
111
|
+
echo "❌ Gemspec validation failed"
|
|
112
|
+
exit 1
|
|
113
|
+
fi
|
|
114
|
+
|
|
115
|
+
# Check if package.json version is valid
|
|
116
|
+
if ! jq -e '.version' package.json > /dev/null 2>&1; then
|
|
117
|
+
echo "❌ Invalid version in package.json"
|
|
118
|
+
exit 1
|
|
119
|
+
fi
|
|
120
|
+
|
|
121
|
+
echo "✅ Pre-commit validations passed"
|
|
122
|
+
EOF
|
|
123
|
+
chmod +x .git/hooks/pre-commit
|
|
124
|
+
fi
|
|
125
|
+
|
|
126
|
+
log "Setup complete!"
|
|
127
|
+
log ""
|
|
128
|
+
log "Available commands:"
|
|
129
|
+
log " ./scripts/version.sh [patch|minor|major] - Bump version"
|
|
130
|
+
log " ./scripts/build.sh [--publish] - Build (and optionally publish) gem"
|
|
131
|
+
log " ./scripts/test.sh - Run tests"
|
|
132
|
+
log ""
|
|
133
|
+
log "Development workflow:"
|
|
134
|
+
log "1. Make your changes"
|
|
135
|
+
log "2. Run ./scripts/test.sh to validate"
|
|
136
|
+
log "3. Run ./scripts/version.sh to bump version"
|
|
137
|
+
log "4. Run ./scripts/build.sh --publish to release"
|
data/scripts/version.sh
CHANGED
|
@@ -1,10 +1,36 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
|
+
# ============================================================================
|
|
4
|
+
# DEPRECATED: This script is deprecated and will be removed in a future release.
|
|
5
|
+
#
|
|
6
|
+
# Please use the modular release system instead:
|
|
7
|
+
# - For version management: source scripts/lib/version.sh
|
|
8
|
+
# - For full release workflow: scripts/bin/release [patch|minor|major]
|
|
9
|
+
#
|
|
10
|
+
# The new system provides:
|
|
11
|
+
# - Better error handling and dry-run support
|
|
12
|
+
# - Automatic changelog generation from commits
|
|
13
|
+
# - Modular library architecture
|
|
14
|
+
# - Comprehensive testing
|
|
15
|
+
#
|
|
16
|
+
# This script will continue to work but is no longer maintained.
|
|
17
|
+
# ============================================================================
|
|
18
|
+
|
|
3
19
|
# Version management script for zer0-mistakes Jekyll theme
|
|
4
20
|
# Usage: ./scripts/version.sh [patch|minor|major] [--dry-run]
|
|
5
21
|
|
|
6
22
|
set -e
|
|
7
23
|
|
|
24
|
+
# Show deprecation warning
|
|
25
|
+
echo ""
|
|
26
|
+
echo "⚠️ DEPRECATION WARNING: scripts/version.sh is deprecated."
|
|
27
|
+
echo " Please use 'scripts/bin/release' instead for the full release workflow."
|
|
28
|
+
echo " Or source 'scripts/lib/version.sh' for version management functions."
|
|
29
|
+
echo ""
|
|
30
|
+
echo " Continuing in 3 seconds... (Press Ctrl+C to abort)"
|
|
31
|
+
sleep 3
|
|
32
|
+
echo ""
|
|
33
|
+
|
|
8
34
|
# Colors for output
|
|
9
35
|
RED='\033[0;31m'
|
|
10
36
|
GREEN='\033[0;32m'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jekyll-theme-zer0
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.10.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Amr Abdel
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-11-
|
|
11
|
+
date: 2025-11-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jekyll
|
|
@@ -181,13 +181,15 @@ files:
|
|
|
181
181
|
- assets/particles.json
|
|
182
182
|
- scripts/README.md
|
|
183
183
|
- scripts/analyze-commits.sh
|
|
184
|
+
- scripts/bin/build
|
|
185
|
+
- scripts/bin/release
|
|
186
|
+
- scripts/bin/test
|
|
184
187
|
- scripts/build
|
|
185
|
-
- scripts/build.sh
|
|
186
|
-
- scripts/build.sh.legacy
|
|
187
188
|
- scripts/example-usage.sh
|
|
189
|
+
- scripts/features/generate-preview-images
|
|
190
|
+
- scripts/features/install-preview-generator
|
|
191
|
+
- scripts/features/preview_generator.py
|
|
188
192
|
- scripts/fix-markdown-format.sh
|
|
189
|
-
- scripts/gem-publish.sh
|
|
190
|
-
- scripts/gem-publish.sh.legacy
|
|
191
193
|
- scripts/generate-preview-images.sh
|
|
192
194
|
- scripts/install-preview-generator.sh
|
|
193
195
|
- scripts/lib/README.md
|
|
@@ -205,12 +207,22 @@ files:
|
|
|
205
207
|
- scripts/lib/validation.sh
|
|
206
208
|
- scripts/lib/version.sh
|
|
207
209
|
- scripts/release
|
|
208
|
-
- scripts/release.sh
|
|
209
|
-
- scripts/release.sh.legacy
|
|
210
210
|
- scripts/setup.sh
|
|
211
211
|
- scripts/test-auto-version.sh
|
|
212
212
|
- scripts/test-mermaid.sh
|
|
213
213
|
- scripts/test.sh
|
|
214
|
+
- scripts/test/integration/auto-version
|
|
215
|
+
- scripts/test/integration/mermaid
|
|
216
|
+
- scripts/test/lib/run_tests.sh
|
|
217
|
+
- scripts/test/lib/test_changelog.sh
|
|
218
|
+
- scripts/test/lib/test_gem.sh
|
|
219
|
+
- scripts/test/lib/test_git.sh
|
|
220
|
+
- scripts/test/lib/test_validation.sh
|
|
221
|
+
- scripts/test/lib/test_version.sh
|
|
222
|
+
- scripts/test/theme/validate
|
|
223
|
+
- scripts/utils/analyze-commits
|
|
224
|
+
- scripts/utils/fix-markdown
|
|
225
|
+
- scripts/utils/setup
|
|
214
226
|
- scripts/version.sh
|
|
215
227
|
homepage: https://github.com/bamr87/zer0-mistakes
|
|
216
228
|
licenses:
|
data/scripts/build.sh
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# DEPRECATED: This script is deprecated and will be removed in v0.8.0
|
|
4
|
-
# Please use the new simplified build command instead.
|
|
5
|
-
|
|
6
|
-
set -e
|
|
7
|
-
|
|
8
|
-
# Colors
|
|
9
|
-
YELLOW='\033[1;33m'
|
|
10
|
-
CYAN='\033[0;36m'
|
|
11
|
-
NC='\033[0m'
|
|
12
|
-
|
|
13
|
-
echo -e "${YELLOW}╔════════════════════════════════════════════════════════════╗${NC}"
|
|
14
|
-
echo -e "${YELLOW}║ ⚠️ DEPRECATION WARNING ║${NC}"
|
|
15
|
-
echo -e "${YELLOW}╚════════════════════════════════════════════════════════════╝${NC}"
|
|
16
|
-
echo ""
|
|
17
|
-
echo -e "${YELLOW}This script (build.sh) is deprecated and will be removed in v0.8.0${NC}"
|
|
18
|
-
echo ""
|
|
19
|
-
echo -e "Please use the new simplified command instead:"
|
|
20
|
-
echo -e " ${CYAN}./scripts/build${NC} [options]"
|
|
21
|
-
echo ""
|
|
22
|
-
echo -e "The new command is:"
|
|
23
|
-
echo -e " ✅ Simpler and more focused"
|
|
24
|
-
echo -e " ✅ Uses modular libraries"
|
|
25
|
-
echo -e " ✅ Better error handling"
|
|
26
|
-
echo -e " ✅ Fully tested"
|
|
27
|
-
echo ""
|
|
28
|
-
echo -e "${YELLOW}Redirecting to new command in 3 seconds...${NC}"
|
|
29
|
-
sleep 3
|
|
30
|
-
echo ""
|
|
31
|
-
|
|
32
|
-
# Redirect to new command
|
|
33
|
-
exec "$(dirname "$0")/build" "$@"
|
data/scripts/build.sh.legacy
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Build and publish script for zer0-mistakes Jekyll theme
|
|
4
|
-
# Usage: ./scripts/build.sh [--publish] [--dry-run]
|
|
5
|
-
|
|
6
|
-
set -e
|
|
7
|
-
|
|
8
|
-
# Colors for output
|
|
9
|
-
RED='\033[0;31m'
|
|
10
|
-
GREEN='\033[0;32m'
|
|
11
|
-
YELLOW='\033[1;33m'
|
|
12
|
-
BLUE='\033[0;34m'
|
|
13
|
-
NC='\033[0m' # No Color
|
|
14
|
-
|
|
15
|
-
# Default values
|
|
16
|
-
PUBLISH=false
|
|
17
|
-
DRY_RUN=false
|
|
18
|
-
|
|
19
|
-
# Parse arguments
|
|
20
|
-
while [[ $# -gt 0 ]]; do
|
|
21
|
-
case $1 in
|
|
22
|
-
--publish)
|
|
23
|
-
PUBLISH=true
|
|
24
|
-
shift
|
|
25
|
-
;;
|
|
26
|
-
--dry-run)
|
|
27
|
-
DRY_RUN=true
|
|
28
|
-
shift
|
|
29
|
-
;;
|
|
30
|
-
*)
|
|
31
|
-
echo -e "${RED}Unknown option: $1${NC}"
|
|
32
|
-
exit 1
|
|
33
|
-
;;
|
|
34
|
-
esac
|
|
35
|
-
done
|
|
36
|
-
|
|
37
|
-
# Function to log messages
|
|
38
|
-
log() {
|
|
39
|
-
echo -e "${GREEN}[BUILD]${NC} $1"
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
warn() {
|
|
43
|
-
echo -e "${YELLOW}[WARNING]${NC} $1"
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
error() {
|
|
47
|
-
echo -e "${RED}[ERROR]${NC} $1"
|
|
48
|
-
exit 1
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
info() {
|
|
52
|
-
echo -e "${BLUE}[INFO]${NC} $1"
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
# Check if gemspec exists
|
|
56
|
-
if [[ ! -f "jekyll-theme-zer0.gemspec" ]]; then
|
|
57
|
-
error "jekyll-theme-zer0.gemspec not found"
|
|
58
|
-
fi
|
|
59
|
-
|
|
60
|
-
# Check if package.json exists
|
|
61
|
-
if [[ ! -f "package.json" ]]; then
|
|
62
|
-
error "package.json not found"
|
|
63
|
-
fi
|
|
64
|
-
|
|
65
|
-
# Get version from package.json
|
|
66
|
-
VERSION=$(jq -r '.version' package.json)
|
|
67
|
-
if [[ "$VERSION" == "null" ]]; then
|
|
68
|
-
error "Could not read version from package.json"
|
|
69
|
-
fi
|
|
70
|
-
|
|
71
|
-
log "Building jekyll-theme-zer0 version $VERSION"
|
|
72
|
-
|
|
73
|
-
# Create build directory
|
|
74
|
-
log "Creating build directory..."
|
|
75
|
-
mkdir -p build
|
|
76
|
-
|
|
77
|
-
# Clean up old gem files
|
|
78
|
-
log "Cleaning up old gem files..."
|
|
79
|
-
rm -f jekyll-theme-zer0-*.gem
|
|
80
|
-
rm -f build/jekyll-theme-zer0-*.gem
|
|
81
|
-
|
|
82
|
-
# Validate dependencies
|
|
83
|
-
log "Checking dependencies..."
|
|
84
|
-
if ! command -v bundle &> /dev/null; then
|
|
85
|
-
error "Bundler is not installed. Run 'gem install bundler' first."
|
|
86
|
-
fi
|
|
87
|
-
|
|
88
|
-
if ! command -v jq &> /dev/null; then
|
|
89
|
-
error "jq is not installed. Run 'brew install jq' (macOS) or appropriate package manager."
|
|
90
|
-
fi
|
|
91
|
-
|
|
92
|
-
# Run bundle install to ensure dependencies are up to date
|
|
93
|
-
log "Installing/updating dependencies..."
|
|
94
|
-
if [[ "$DRY_RUN" != true ]]; then
|
|
95
|
-
bundle install
|
|
96
|
-
fi
|
|
97
|
-
|
|
98
|
-
# Validate gemspec
|
|
99
|
-
log "Validating gemspec..."
|
|
100
|
-
if [[ "$DRY_RUN" != true ]]; then
|
|
101
|
-
ruby -c jekyll-theme-zer0.gemspec > /dev/null
|
|
102
|
-
info "✓ Gemspec is valid"
|
|
103
|
-
fi
|
|
104
|
-
|
|
105
|
-
# Build the gem
|
|
106
|
-
log "Building gem..."
|
|
107
|
-
if [[ "$DRY_RUN" == true ]]; then
|
|
108
|
-
log "Dry run mode - would build jekyll-theme-zer0-${VERSION}.gem"
|
|
109
|
-
else
|
|
110
|
-
if gem build jekyll-theme-zer0.gemspec; then
|
|
111
|
-
# Move gem to build directory
|
|
112
|
-
mv jekyll-theme-zer0-${VERSION}.gem build/
|
|
113
|
-
info "✓ Successfully built jekyll-theme-zer0-${VERSION}.gem"
|
|
114
|
-
else
|
|
115
|
-
error "Failed to build gem"
|
|
116
|
-
fi
|
|
117
|
-
fi
|
|
118
|
-
|
|
119
|
-
# List gem contents for verification
|
|
120
|
-
if [[ "$DRY_RUN" != true ]] && [[ -f "build/jekyll-theme-zer0-${VERSION}.gem" ]]; then
|
|
121
|
-
log "Gem contents:"
|
|
122
|
-
# Use tar to list contents since gem contents only works for installed gems
|
|
123
|
-
tar -tzf build/jekyll-theme-zer0-${VERSION}.gem | head -20
|
|
124
|
-
echo "..."
|
|
125
|
-
echo "Total files: $(tar -tzf build/jekyll-theme-zer0-${VERSION}.gem | wc -l)"
|
|
126
|
-
fi
|
|
127
|
-
|
|
128
|
-
# Check if we should publish
|
|
129
|
-
if [[ "$PUBLISH" == true ]]; then
|
|
130
|
-
if [[ "$DRY_RUN" == true ]]; then
|
|
131
|
-
log "Dry run mode - would publish jekyll-theme-zer0-${VERSION}.gem to RubyGems"
|
|
132
|
-
else
|
|
133
|
-
log "Publishing gem to RubyGems..."
|
|
134
|
-
|
|
135
|
-
# Check if user is authenticated with RubyGems
|
|
136
|
-
if [[ ! -f ~/.gem/credentials ]]; then
|
|
137
|
-
error "Not authenticated with RubyGems. Run 'gem signin' first."
|
|
138
|
-
fi
|
|
139
|
-
|
|
140
|
-
# Check if this version already exists on RubyGems
|
|
141
|
-
if gem list --remote jekyll-theme-zer0 | grep -q "jekyll-theme-zer0 (${VERSION})"; then
|
|
142
|
-
warn "Version ${VERSION} already exists on RubyGems"
|
|
143
|
-
echo -e "${YELLOW}You need to bump the version first. Use ./scripts/version.sh --bump [--major|--minor|--patch]${NC}"
|
|
144
|
-
error "Cannot republish existing version ${VERSION}"
|
|
145
|
-
fi
|
|
146
|
-
|
|
147
|
-
# Confirm publication
|
|
148
|
-
echo -e "${YELLOW}Are you sure you want to publish jekyll-theme-zer0-${VERSION}.gem to RubyGems? (y/N)${NC}"
|
|
149
|
-
read -r response
|
|
150
|
-
if [[ "$response" =~ ^[Yy]$ ]]; then
|
|
151
|
-
if gem push build/jekyll-theme-zer0-${VERSION}.gem; then
|
|
152
|
-
info "✓ Successfully published jekyll-theme-zer0-${VERSION}.gem"
|
|
153
|
-
log "Gem is now available at: https://rubygems.org/gems/jekyll-theme-zer0"
|
|
154
|
-
else
|
|
155
|
-
error "Failed to publish gem"
|
|
156
|
-
fi
|
|
157
|
-
else
|
|
158
|
-
log "Publication cancelled"
|
|
159
|
-
fi
|
|
160
|
-
fi
|
|
161
|
-
else
|
|
162
|
-
log "Build complete! Gem file: jekyll-theme-zer0-${VERSION}.gem"
|
|
163
|
-
log "To publish, run: ./scripts/build.sh --publish"
|
|
164
|
-
fi
|
|
165
|
-
|
|
166
|
-
# Cleanup option
|
|
167
|
-
if [[ "$PUBLISH" == true ]] && [[ "$DRY_RUN" != true ]]; then
|
|
168
|
-
echo -e "${YELLOW}Remove local gem file? (y/N)${NC}"
|
|
169
|
-
read -r response
|
|
170
|
-
if [[ "$response" =~ ^[Yy]$ ]]; then
|
|
171
|
-
rm -f build/jekyll-theme-zer0-${VERSION}.gem
|
|
172
|
-
log "Local gem file removed"
|
|
173
|
-
fi
|
|
174
|
-
fi
|