Yattee v2 rewrite

This commit is contained in:
Arkadiusz Fal
2026-02-08 18:31:16 +01:00
parent 20d0cfc0c7
commit 05f921d605
1043 changed files with 163875 additions and 68430 deletions

52
bin/clean-weblate-credits Executable file
View File

@@ -0,0 +1,52 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# Clean Weblate Credits JSON
#
# Strips sensitive data (emails, date_joined) from weblate-credits.json
# and replaces emails with pre-computed Gravatar MD5 hashes.
#
# Usage:
# ./bin/clean-weblate-credits
#
require 'json'
require 'digest'
# Change to project directory
Dir.chdir(File.expand_path('..', __dir__))
CREDITS_FILE = 'Yattee/weblate-credits.json'
unless File.exist?(CREDITS_FILE)
warn "Error: #{CREDITS_FILE} not found"
exit 1
end
# Read and parse the JSON
data = JSON.parse(File.read(CREDITS_FILE))
# Process each language entry
cleaned_data = data.map do |language_entry|
language_entry.transform_values do |contributors|
contributors.map do |contributor|
email = contributor['email'].to_s.strip.downcase
gravatar_hash = Digest::MD5.hexdigest(email)
{
'gravatar_hash' => gravatar_hash,
'username' => contributor['username'],
'full_name' => contributor['full_name'],
'change_count' => contributor['change_count']
}
end
end
end
# Write back to file with pretty formatting
File.write(CREDITS_FILE, JSON.pretty_generate(cleaned_data))
puts "Cleaned #{CREDITS_FILE}"
puts " - Removed email addresses (replaced with gravatar_hash)"
puts " - Removed date_joined fields"

15
bin/install-debug Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
DEVICE_NAME="${1:-iPhone 17 Pro}"
echo "Building Yattee for $DEVICE_NAME..."
xcodebuild -project Yattee.xcodeproj -scheme "Yattee" -configuration Debug -destination "platform=iOS,name=$DEVICE_NAME" -derivedDataPath ./build build
if [ $? -eq 0 ]; then
echo "Installing to $DEVICE_NAME..."
xcrun devicectl device install app --device "$DEVICE_NAME" ./build/Build/Products/Debug-iphoneos/Yattee.app
else
echo "Build failed"
exit 1
fi

78
bin/ui-test Executable file
View File

@@ -0,0 +1,78 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# UI Test Runner for Yattee
#
# Usage:
# ./bin/ui-test [options]
#
# Options:
# --device NAME Simulator device (default: iPhone 17 Pro)
# --generate-baseline Capture new baseline screenshots
# --skip-build Skip building the app (use existing build)
# --keep-simulator Don't shutdown simulator after tests
# --keep-app-data Preserve app data between runs (skip uninstall)
# --tag TAG Run only tests with specific tag (e.g., smoke, visual)
# --help Show this help message
#
require 'optparse'
options = {
device: 'iPhone 17 Pro'
}
OptionParser.new do |opts|
opts.banner = "Usage: #{$PROGRAM_NAME} [options]"
opts.on('--device NAME', 'Simulator device (default: iPhone 17 Pro)') do |device|
options[:device] = device
end
opts.on('--generate-baseline', 'Capture new baseline screenshots') do
options[:generate_baseline] = true
end
opts.on('--skip-build', 'Skip building the app') do
options[:skip_build] = true
end
opts.on('--keep-simulator', "Don't shutdown simulator after tests") do
options[:keep_simulator] = true
end
opts.on('--keep-app-data', 'Preserve app data between runs (skip uninstall)') do
options[:keep_app_data] = true
end
opts.on('--tag TAG', 'Run only tests with specific tag') do |tag|
options[:tag] = tag
end
opts.on('-h', '--help', 'Show this help message') do
puts opts
exit
end
end.parse!
# Set environment variables for RSpec to pick up
ENV['UI_TEST_DEVICE'] = options[:device]
ENV['GENERATE_BASELINE'] = '1' if options[:generate_baseline]
ENV['SKIP_BUILD'] = '1' if options[:skip_build]
ENV['KEEP_SIMULATOR'] = '1' if options[:keep_simulator]
ENV['KEEP_APP_DATA'] = '1' if options[:keep_app_data]
# Build RSpec command
rspec_args = ['bundle', 'exec', 'rspec', 'spec/ui', '--format', 'documentation']
if options[:tag]
rspec_args << '--tag'
rspec_args << options[:tag]
end
# Change to project directory
Dir.chdir(File.expand_path('..', __dir__))
# Run RSpec
exec(*rspec_args)