forked from jsnbuchanan/crowd-funder-for-time-pwa
feat: Complete PlatformServiceMixin migration and enhance tooling
- Update migration assessment: All database operations now migrated (60/60 components) - Enhance validate-migration.sh: Improved pattern detection and reporting - Upgrade format-markdown.sh: Add parallel processing and CI-friendly output - Clean up legacy logging patterns in ContactImportView.vue - Remove unused imports and optimize PlatformServiceMixin - Streamline deep links service and utility functions Migration Status: 100% database operations complete, only 4 logging cleanup files remain
This commit is contained in:
@@ -24,6 +24,10 @@ legacy_db_imports=0
|
||||
legacy_log_imports=0
|
||||
direct_platform_usage=0
|
||||
mixin_usage=0
|
||||
mixed_pattern_count=0
|
||||
technically_compliant_count=0
|
||||
needs_human_testing_count=0
|
||||
human_tested_count=0
|
||||
|
||||
# Function to log with timestamp
|
||||
log_with_timestamp() {
|
||||
@@ -37,7 +41,11 @@ check_legacy_patterns() {
|
||||
# Check for legacy databaseUtil imports
|
||||
echo -n " Checking databaseUtil imports... "
|
||||
legacy_db_files=$(find src -name "*.vue" -o -name "*.ts" | xargs grep -l "import.*databaseUtil" 2>/dev/null || true)
|
||||
legacy_db_imports=$(echo "$legacy_db_files" | grep -c . 2>/dev/null || echo "0")
|
||||
if [ -n "$legacy_db_files" ]; then
|
||||
legacy_db_imports=$(echo "$legacy_db_files" | wc -l)
|
||||
else
|
||||
legacy_db_imports=0
|
||||
fi
|
||||
|
||||
if [ "$legacy_db_imports" -gt 0 ]; then
|
||||
echo -e "${RED}Found $legacy_db_imports files${NC}"
|
||||
@@ -51,7 +59,11 @@ check_legacy_patterns() {
|
||||
# Check for legacy logging imports
|
||||
echo -n " Checking logConsoleAndDb imports... "
|
||||
legacy_log_files=$(find src -name "*.vue" -o -name "*.ts" | xargs grep -l "logConsoleAndDb" 2>/dev/null || true)
|
||||
legacy_log_imports=$(echo "$legacy_log_files" | grep -c . 2>/dev/null || echo "0")
|
||||
if [ -n "$legacy_log_files" ]; then
|
||||
legacy_log_imports=$(echo "$legacy_log_files" | wc -l)
|
||||
else
|
||||
legacy_log_imports=0
|
||||
fi
|
||||
|
||||
if [ "$legacy_log_imports" -gt 0 ]; then
|
||||
echo -e "${RED}Found $legacy_log_imports files${NC}"
|
||||
@@ -65,7 +77,11 @@ check_legacy_patterns() {
|
||||
# Check for direct PlatformServiceFactory usage
|
||||
echo -n " Checking direct PlatformServiceFactory usage... "
|
||||
direct_platform_files=$(find src -name "*.vue" -o -name "*.ts" | xargs grep -l "PlatformServiceFactory.getInstance" 2>/dev/null || true)
|
||||
direct_platform_usage=$(echo "$direct_platform_files" | grep -c . 2>/dev/null || echo "0")
|
||||
if [ -n "$direct_platform_files" ]; then
|
||||
direct_platform_usage=$(echo "$direct_platform_files" | wc -l)
|
||||
else
|
||||
direct_platform_usage=0
|
||||
fi
|
||||
|
||||
if [ "$direct_platform_usage" -gt 0 ]; then
|
||||
echo -e "${YELLOW}Found $direct_platform_usage files${NC}"
|
||||
@@ -83,7 +99,11 @@ check_positive_patterns() {
|
||||
# Check for PlatformServiceMixin usage
|
||||
echo -n " Checking PlatformServiceMixin usage... "
|
||||
mixin_files=$(find src -name "*.vue" | xargs grep -l "PlatformServiceMixin" 2>/dev/null || true)
|
||||
mixin_usage=$(echo "$mixin_files" | grep -c . 2>/dev/null || echo "0")
|
||||
if [ -n "$mixin_files" ]; then
|
||||
mixin_usage=$(echo "$mixin_files" | wc -l)
|
||||
else
|
||||
mixin_usage=0
|
||||
fi
|
||||
|
||||
if [ "$mixin_usage" -gt 0 ]; then
|
||||
echo -e "${GREEN}Found $mixin_usage files${NC}"
|
||||
@@ -116,7 +136,11 @@ analyze_migration_patterns() {
|
||||
fi
|
||||
' _ {} \;)
|
||||
|
||||
db_components_no_mixin_count=$(echo "$db_components_no_mixin" | grep -c . 2>/dev/null || echo "0")
|
||||
if [ -n "$db_components_no_mixin" ]; then
|
||||
db_components_no_mixin_count=$(echo "$db_components_no_mixin" | wc -l)
|
||||
else
|
||||
db_components_no_mixin_count=0
|
||||
fi
|
||||
|
||||
if [ "$db_components_no_mixin_count" -gt 0 ]; then
|
||||
echo -e "${RED}Found $db_components_no_mixin_count components${NC}"
|
||||
@@ -138,7 +162,11 @@ analyze_migration_patterns() {
|
||||
fi
|
||||
' _ {} \;)
|
||||
|
||||
mixed_pattern_count=$(echo "$mixed_pattern_files" | grep -c . 2>/dev/null || echo "0")
|
||||
if [ -n "$mixed_pattern_files" ]; then
|
||||
mixed_pattern_count=$(echo "$mixed_pattern_files" | wc -l)
|
||||
else
|
||||
mixed_pattern_count=0
|
||||
fi
|
||||
|
||||
if [ "$mixed_pattern_count" -gt 0 ]; then
|
||||
echo -e "${YELLOW}Found $mixed_pattern_count files${NC}"
|
||||
@@ -156,7 +184,11 @@ analyze_migration_patterns() {
|
||||
fi
|
||||
' _ {} \;)
|
||||
|
||||
technically_compliant_count=$(echo "$technically_compliant_files" | grep -c . 2>/dev/null || echo "0")
|
||||
if [ -n "$technically_compliant_files" ]; then
|
||||
technically_compliant_count=$(echo "$technically_compliant_files" | wc -l)
|
||||
else
|
||||
technically_compliant_count=0
|
||||
fi
|
||||
|
||||
if [ "$technically_compliant_count" -gt 0 ]; then
|
||||
echo -e "${GREEN}Found $technically_compliant_count files${NC}"
|
||||
@@ -181,7 +213,11 @@ check_human_testing_status() {
|
||||
# Files requiring human testing (technically compliant but not tested)
|
||||
echo -n " Files requiring human testing... "
|
||||
needs_human_testing=$(echo "$technically_compliant_files" | grep -v -F "$human_tested_files" | grep -v "^[[:space:]]*$" || true)
|
||||
needs_human_testing_count=$(echo "$needs_human_testing" | grep -v "^[[:space:]]*$" | wc -l 2>/dev/null || echo "0")
|
||||
if [ -n "$needs_human_testing" ]; then
|
||||
needs_human_testing_count=$(echo "$needs_human_testing" | grep -v "^[[:space:]]*$" | wc -l)
|
||||
else
|
||||
needs_human_testing_count=0
|
||||
fi
|
||||
|
||||
if [ "$needs_human_testing_count" -gt 0 ]; then
|
||||
echo -e "${YELLOW}Found $needs_human_testing_count files${NC}"
|
||||
@@ -193,7 +229,11 @@ check_human_testing_status() {
|
||||
|
||||
# Files with confirmed human testing
|
||||
echo -n " Human tested files... "
|
||||
human_tested_count=$(echo "$human_tested_files" | grep -v "^[[:space:]]*$" | wc -l 2>/dev/null || echo "0")
|
||||
if [ -n "$human_tested_files" ]; then
|
||||
human_tested_count=$(echo "$human_tested_files" | grep -v "^[[:space:]]*$" | wc -l)
|
||||
else
|
||||
human_tested_count=0
|
||||
fi
|
||||
|
||||
if [ "$human_tested_count" -gt 0 ]; then
|
||||
echo -e "${GREEN}Found $human_tested_count files${NC}"
|
||||
@@ -210,7 +250,12 @@ generate_report() {
|
||||
echo "=============================="
|
||||
|
||||
total_vue_files=$(find src -name "*.vue" | wc -l)
|
||||
migration_percentage=$((mixin_usage * 100 / total_vue_files))
|
||||
# Handle division by zero
|
||||
if [ "$total_vue_files" -gt 0 ]; then
|
||||
migration_percentage=$((mixin_usage * 100 / total_vue_files))
|
||||
else
|
||||
migration_percentage=0
|
||||
fi
|
||||
|
||||
echo "Total Vue components: $total_vue_files"
|
||||
echo "Components using PlatformServiceMixin: $mixin_usage"
|
||||
@@ -219,7 +264,12 @@ generate_report() {
|
||||
echo "Technical Migration Status:"
|
||||
echo " - Technically compliant files: $technically_compliant_count"
|
||||
echo " - Mixed pattern files: $mixed_pattern_count"
|
||||
echo " - Files needing migration: $((total_vue_files - technically_compliant_count - mixed_pattern_count))"
|
||||
# Ensure variables are numeric for arithmetic
|
||||
total_vue_files_num=${total_vue_files:-0}
|
||||
technically_compliant_num=${technically_compliant_count:-0}
|
||||
mixed_pattern_num=${mixed_pattern_count:-0}
|
||||
files_needing_migration=$((total_vue_files_num - technically_compliant_num - mixed_pattern_num))
|
||||
echo " - Files needing migration: $files_needing_migration"
|
||||
echo ""
|
||||
echo "Legacy patterns found:"
|
||||
echo " - databaseUtil imports: $legacy_db_imports"
|
||||
|
||||
Reference in New Issue
Block a user