feat: استيراد كود سيرو إلى تريبز (سيرو @ecfe7568) — بلا تعديل
قرار المالك 2026-07-27: باك إند سيرو PHP هو المعتمد، وتطبيقاته المجرّبة ميدانياً تحل محل إعادة البناء المؤرشفة. سيرو نفسه لم يُمسّ. الخريطة: backend · payment_server · loction_server · ride_server · passenger_server · docker · dashboard · stress_test → الجذر siro_rider → apps/rider siro_driver → apps/driver siro_admin → dashboards/admin siro_service → dashboards/service android_bot → apps/android_bot socialBot → apps/socialBot نُسخ المتعقَّب في git سيرو فقط عبر `git archive` (3,198 ملفاً / ~169 م.ب) لا `cp -r` — فاستُثنيت مخلفات البناء تلقائياً. بلا أي تعديل محتوى عمداً: كل ما يلي يصير فرقاً مقروءاً مقابل المصدر. لم يُستورد وسببه: siromove.com (الموقع التسويقي يبقى marketing/ في تريبز، سيرو فيه 8 ملفات) · docs و planning (تريبز له docs/ الخاص) · deploy.sh (ليس نشراً على سيرفر بل `git add . && git push origin --all` — فخّ في مستودع آخر) · transit_dashboard (بانتظار قرار مصير backend-transit و dashboards/transit-web). ⚠️ لا يبني بعد — ثلاثة نواقص متوقعة ومقصودة: 1. `.env` و `lib/env/env.g.dart` غير متعقَّبين في سيرو (أسرار لكل مستأجر): كل تطبيق فلاتر يحتاج .env خاصاً ثم توليد env.g.dart بـ build_runner. 2. إعدادات Firebase (9 ملفات google-services.json و GoogleService-Info.plist) يستبعدها .gitignore تريبز — ولكل مستأجر مشروع Firebase خاص أصلاً. 3. apps/driver في سيرو يشير إلى `../../Intaleq/packages/get` خارج المستودع → يجب ضمّ الحزم داخله أسوة بـ apps/rider. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
9909d9b4c1
commit
4d8414c96b
@@ -0,0 +1,89 @@
|
||||
#!/bin/bash
|
||||
|
||||
ORIG_FILE="lib/controller/home/map_passenger_controller.dart"
|
||||
ALL_FILES="lib/controller/home/map/location_search_controller.dart lib/controller/home/map/map_engine_controller.dart lib/controller/home/map/map_screen_binding.dart lib/controller/home/map/map_socket_controller.dart lib/controller/home/map/nearby_drivers_controller.dart lib/controller/home/map/ride_lifecycle_controller.dart lib/controller/home/map/ui_interactions_controller.dart"
|
||||
|
||||
echo "Extracting methods from original controller..."
|
||||
# Methods typically start with spaces and have patterns like:
|
||||
# returnType methodName( or methodName(
|
||||
# Let's extract words that precede ( on lines that don't start with keywords (if, for, while, switch, catch, etc.)
|
||||
# We will use awk to parse.
|
||||
METHODS=$(cat "$ORIG_FILE" | awk '
|
||||
# Skip single-line comments
|
||||
/\/\// { next }
|
||||
# Skip imports and class declarations
|
||||
/import/ || /class/ { next }
|
||||
# Find lines with "("
|
||||
/\(/ {
|
||||
# Replace anything inside parentheses and curly braces to simplify
|
||||
gsub(/\(.*\)/, "()")
|
||||
# Find word before "()"
|
||||
for (i = 1; i <= NF; i++) {
|
||||
if ($i ~ /[a-zA-Z0-9_]+\(\)/) {
|
||||
name = $i
|
||||
sub(/\(\)/, "", name)
|
||||
# Remove any leading modifiers like async, Future, static, etc.
|
||||
# Only keep valid identifiers that are not control keywords
|
||||
if (name !~ /^(if|for|while|switch|catch|super|await|print|assert|dynamic|void|return|with|override|get|set|else|try|final|const|var|late|static|factory|new|abstract|covariant|external|operator|part|required|typedef|yield)$/ && name ~ /^[a-zA-Z_][a-zA-Z0-9_]*$/) {
|
||||
print name
|
||||
}
|
||||
}
|
||||
}
|
||||
}' | sort -u)
|
||||
|
||||
echo "Extracting fields/variables from original controller..."
|
||||
# Fields are usually declared inside the class at the beginning of lines or indented.
|
||||
# e.g., RxBool isSearching = false.obs; or String? rideId;
|
||||
VARS=$(cat "$ORIG_FILE" | awk '
|
||||
/\/\// { next }
|
||||
/import/ || /class/ { next }
|
||||
# Lines ending with ";" or containing "=" followed by ";"
|
||||
/;/ {
|
||||
# Extract words that look like declarations.
|
||||
# We look for typical type names or var/final followed by variable name
|
||||
for (i = 1; i < NF; i++) {
|
||||
if ($i ~ /^(var|final|const|late|RxBool|RxInt|RxDouble|RxString|RxList|RxMap|RxSet|Rx|String|int|double|bool|List|Map|Set|Timer|LatLng|Position|SiroMapController)$/) {
|
||||
# The next field might be the variable name, or it might have a type like String?
|
||||
name = $(i+1)
|
||||
# Remove trailing ?, ;, =
|
||||
sub(/\?/, "", name)
|
||||
sub(/;/, "", name)
|
||||
sub(/=/, "", name)
|
||||
if (name ~ /^[a-zA-Z_][a-zA-Z0-9_]*$/) {
|
||||
print name
|
||||
}
|
||||
}
|
||||
}
|
||||
}' | sort -u)
|
||||
|
||||
echo "Checking split files for methods..."
|
||||
echo "--- MISSING METHODS ---"
|
||||
MISSING_METHODS_COUNT=0
|
||||
# Create a temporary file with all split contents to search efficiently
|
||||
cat $ALL_FILES > lib/controller/home/temp_split_combined.txt
|
||||
|
||||
for method in $METHODS; do
|
||||
# Search for this method name as a whole word in split controllers
|
||||
FOUND=$(grep -w "$method" lib/controller/home/temp_split_combined.txt 2>/dev/null)
|
||||
if [ -z "$FOUND" ]; then
|
||||
echo " - $method"
|
||||
MISSING_METHODS_COUNT=$((MISSING_METHODS_COUNT+1))
|
||||
fi
|
||||
done
|
||||
echo "Total missing methods: $MISSING_METHODS_COUNT"
|
||||
|
||||
echo ""
|
||||
echo "Checking split files for variables/fields..."
|
||||
echo "--- MISSING VARIABLES ---"
|
||||
MISSING_VARS_COUNT=0
|
||||
for var in $VARS; do
|
||||
FOUND=$(grep -w "$var" lib/controller/home/temp_split_combined.txt 2>/dev/null)
|
||||
if [ -z "$FOUND" ]; then
|
||||
echo " - $var"
|
||||
MISSING_VARS_COUNT=$((MISSING_VARS_COUNT+1))
|
||||
fi
|
||||
done
|
||||
echo "Total missing variables: $MISSING_VARS_COUNT"
|
||||
|
||||
# Clean up temp file
|
||||
rm lib/controller/home/temp_split_combined.txt
|
||||
Reference in New Issue
Block a user