mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-06-13 19:11:01 +00:00
feat(web): authenticated home redesign + Telegram OAuth + SMTP
- AppLayout: logged-in desktop home redesigned — score cards, 4 section cards (Finance/Governance/Social/Education), governance extras, fixed bottom tab bar (Home/Citizen/Referral) matching mobile layout - AppLayout: Trading dropdown in header (Presale/Staking/MultiSig), Logout button; removed 8-button grid - Removed PalletsGrid and TokenomicsSection components - Login: Telegram OAuth via oauth.telegram.org popup + postMessage + custom Edge Function (hash verification, find-or-create user, magic link token exchange) - Login: X (Twitter) OAuth 2.0 wired to Supabase - supabase/functions/telegram-auth: new Edge Function — verifies Telegram Login Widget hash, issues Supabase magic link token - vite.config.ts: process-shim alias to fix TDZ with node polyfills - i18n: updated locales (en/tr/kmr) for new UI sections - SDK docs search index regenerated
This commit is contained in:
@@ -1,107 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Slow Crate Publisher - 6 dakikada bir 1 crate publish eder
|
||||
Rate limit'e takilmamak icin yavas yavas publish yapar.
|
||||
|
||||
Kullanim:
|
||||
nohup python3 publish_crates_slow.py > publish_log.txt 2>&1 &
|
||||
"""
|
||||
|
||||
import subprocess
|
||||
import os
|
||||
import time
|
||||
from datetime import datetime
|
||||
|
||||
PLACEHOLDER_DIR = '/home/mamostehp/kurdistan-sdk/crate_placeholders'
|
||||
LOG_FILE = '/home/mamostehp/kurdistan-sdk/publish_log.txt'
|
||||
INTERVAL_SECONDS = 360 # 6 dakika
|
||||
|
||||
def log(msg):
|
||||
timestamp = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||
line = f"[{timestamp}] {msg}"
|
||||
print(line, flush=True)
|
||||
with open(LOG_FILE, 'a') as f:
|
||||
f.write(line + '\n')
|
||||
|
||||
def is_published(name):
|
||||
"""crates.io'da mevcut mu kontrol et"""
|
||||
result = subprocess.run(
|
||||
['cargo', 'search', name, '--limit', '1'],
|
||||
capture_output=True, text=True, timeout=30
|
||||
)
|
||||
return f'{name} = ' in result.stdout
|
||||
|
||||
def publish_crate(name):
|
||||
"""Tek bir crate publish et"""
|
||||
crate_dir = os.path.join(PLACEHOLDER_DIR, name)
|
||||
manifest = os.path.join(crate_dir, 'Cargo.toml')
|
||||
|
||||
if not os.path.exists(manifest):
|
||||
return False, "Cargo.toml not found"
|
||||
|
||||
result = subprocess.run(
|
||||
['cargo', 'publish', '--manifest-path', manifest],
|
||||
capture_output=True, text=True, cwd=crate_dir, timeout=180
|
||||
)
|
||||
|
||||
if result.returncode == 0:
|
||||
return True, "Success"
|
||||
elif 'already uploaded' in result.stderr or 'already exists' in result.stderr:
|
||||
return True, "Already exists"
|
||||
elif '429' in result.stderr or 'Too Many Requests' in result.stderr:
|
||||
return False, "Rate limited"
|
||||
else:
|
||||
return False, result.stderr[:200]
|
||||
|
||||
def get_unpublished_crates():
|
||||
"""Henuz publish edilmemis crate'leri bul"""
|
||||
crates = sorted([d for d in os.listdir(PLACEHOLDER_DIR)
|
||||
if os.path.isdir(os.path.join(PLACEHOLDER_DIR, d))])
|
||||
|
||||
unpublished = []
|
||||
for crate in crates:
|
||||
if not is_published(crate):
|
||||
unpublished.append(crate)
|
||||
return unpublished
|
||||
|
||||
def main():
|
||||
log("=" * 60)
|
||||
log("Slow Crate Publisher baslatildi")
|
||||
log(f"Interval: {INTERVAL_SECONDS} saniye (6 dakika)")
|
||||
log("=" * 60)
|
||||
|
||||
unpublished = get_unpublished_crates()
|
||||
total = len(unpublished)
|
||||
log(f"Toplam {total} crate publish edilecek")
|
||||
|
||||
success_count = 0
|
||||
fail_count = 0
|
||||
|
||||
for i, crate in enumerate(unpublished, 1):
|
||||
log(f"[{i}/{total}] Publishing: {crate}")
|
||||
|
||||
success, msg = publish_crate(crate)
|
||||
|
||||
if success:
|
||||
log(f" ✓ {msg}")
|
||||
success_count += 1
|
||||
else:
|
||||
log(f" ✗ {msg}")
|
||||
fail_count += 1
|
||||
|
||||
# Rate limit durumunda ekstra bekle
|
||||
if "Rate limited" in msg:
|
||||
log(" Rate limited! 10 dakika bekleniyor...")
|
||||
time.sleep(600)
|
||||
|
||||
# Sonraki crate icin bekle
|
||||
if i < total:
|
||||
log(f" Sonraki crate icin {INTERVAL_SECONDS}s bekleniyor...")
|
||||
time.sleep(INTERVAL_SECONDS)
|
||||
|
||||
log("=" * 60)
|
||||
log(f"Tamamlandi! Basarili: {success_count}, Basarisiz: {fail_count}")
|
||||
log("=" * 60)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,214 +0,0 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Rebranding haritası
|
||||
REBRAND_MAP = [
|
||||
("asset-test-utils", "asset-test-pezutils"),
|
||||
("chain-spec-guide-runtime", "pez-chain-spec-guide-runtime"),
|
||||
("equivocation-detector", "pez-equivocation-detector"),
|
||||
("erasure-coding-fuzzer", "pez-erasure-coding-fuzzer"),
|
||||
("ethereum-standards", "pez-ethereum-standards"),
|
||||
("finality-relay", "pez-finality-relay"),
|
||||
("fork-tree", "pez-fork-tree"),
|
||||
("generate-bags", "pez-generate-bags"),
|
||||
("kitchensink-runtime", "pez-kitchensink-runtime"),
|
||||
("messages-relay", "pez-messages-relay"),
|
||||
("minimal-template-node", "pez-minimal-template-node"),
|
||||
("minimal-template-runtime", "pez-minimal-template-runtime"),
|
||||
("node-bench", "pez-node-bench"),
|
||||
("node-primitives", "pez-node-primitives"),
|
||||
("node-rpc", "pez-node-rpc"),
|
||||
("node-runtime-generate-bags", "pez-node-runtime-generate-bags"),
|
||||
("node-template-release", "pez-node-template-release"),
|
||||
("node-testing", "pez-node-testing"),
|
||||
("penpal-emulated-chain", "pez-penpal-emulated-chain"),
|
||||
("penpal-runtime", "pez-penpal-runtime"),
|
||||
("remote-ext-tests-bags-list", "pez-remote-ext-tests-bags-list"),
|
||||
("revive-dev-node", "pez-revive-dev-node"),
|
||||
("revive-dev-runtime", "pez-revive-dev-runtime"),
|
||||
("slot-range-helper", "pez-slot-range-helper"),
|
||||
("solochain-template-node", "pez-solochain-template-node"),
|
||||
("solochain-template-runtime", "pez-solochain-template-runtime"),
|
||||
("subkey", "pez-subkey"),
|
||||
("template-zombienet-tests", "pez-template-zombienet-tests"),
|
||||
("test-runtime-constants", "peztest-runtime-constants"),
|
||||
("tracing-gum", "pez-tracing-gum"),
|
||||
("tracing-gum-proc-macro", "pez-tracing-gum-proc-macro"),
|
||||
("bp-header-chain", "bp-header-pez-chain"),
|
||||
("bp-runtime", "pezbp-runtime"),
|
||||
("bridge-hub-pezkuwichain-emulated-chain", "pezbridge-hub-pezkuwichain-emulated-chain"),
|
||||
("bridge-hub-pezkuwichain-integration-tests", "pezbridge-hub-pezkuwichain-integration-tests"),
|
||||
("bridge-hub-pezkuwichain-runtime", "pezbridge-hub-pezkuwichain-runtime"),
|
||||
("bridge-hub-test-utils", "pezbridge-hub-test-utils"),
|
||||
("bridge-hub-zagros-emulated-chain", "pezbridge-hub-zagros-emulated-chain"),
|
||||
("bridge-hub-zagros-integration-tests", "pezbridge-hub-zagros-integration-tests"),
|
||||
("bridge-hub-zagros-runtime", "pezbridge-hub-zagros-runtime"),
|
||||
("bridge-runtime-common", "pezbridge-runtime-common"),
|
||||
("mmr-gadget", "pezmmr-gadget"),
|
||||
("mmr-rpc", "pezmmr-rpc"),
|
||||
("snowbridge-beacon-primitives", "pezsnowbridge-beacon-primitives"),
|
||||
("snowbridge-core", "pezsnowbridge-core"),
|
||||
("snowbridge-ethereum", "pezsnowbridge-ethereum"),
|
||||
("snowbridge-inbound-queue-primitives", "pezsnowbridge-inbound-queue-primitives"),
|
||||
("snowbridge-merkle-tree", "pezsnowbridge-merkle-tree"),
|
||||
("snowbridge-outbound-queue-primitives", "pezsnowbridge-outbound-queue-primitives"),
|
||||
("snowbridge-outbound-queue-runtime-api", "pezsnowbridge-outbound-queue-runtime-api"),
|
||||
("snowbridge-outbound-queue-v2-runtime-api", "pezsnowbridge-outbound-queue-v2-runtime-api"),
|
||||
("snowbridge-pezpallet-ethereum-client", "snowbridge-pezpallet-ethereum-client"),
|
||||
("snowbridge-pezpallet-ethereum-client-fixtures", "snowbridge-pezpallet-ethereum-client-fixtures"),
|
||||
("snowbridge-pezpallet-inbound-queue", "snowbridge-pezpallet-inbound-queue"),
|
||||
("snowbridge-pezpallet-inbound-queue-fixtures", "snowbridge-pezpallet-inbound-queue-fixtures"),
|
||||
("snowbridge-pezpallet-inbound-queue-v2", "snowbridge-pezpallet-inbound-queue-v2"),
|
||||
("snowbridge-pezpallet-inbound-queue-v2-fixtures", "snowbridge-pezpallet-inbound-queue-v2-fixtures"),
|
||||
("snowbridge-pezpallet-outbound-queue", "snowbridge-pezpallet-outbound-queue"),
|
||||
("snowbridge-pezpallet-outbound-queue-v2", "snowbridge-pezpallet-outbound-queue-v2"),
|
||||
("snowbridge-pezpallet-system", "snowbridge-pezpallet-system"),
|
||||
("snowbridge-pezpallet-system-frontend", "snowbridge-pezpallet-system-frontend"),
|
||||
("snowbridge-pezpallet-system-v2", "snowbridge-pezpallet-system-v2"),
|
||||
("snowbridge-runtime-common", "pezsnowbridge-runtime-common"),
|
||||
("snowbridge-runtime-test-common", "pezsnowbridge-runtime-test-common"),
|
||||
("snowbridge-system-runtime-api", "pezsnowbridge-system-runtime-api"),
|
||||
("snowbridge-system-v2-runtime-api", "pezsnowbridge-system-v2-runtime-api"),
|
||||
("snowbridge-test-utils", "pezsnowbridge-test-utils"),
|
||||
("snowbridge-verification-primitives", "pezsnowbridge-verification-primitives"),
|
||||
("xcm-docs", "xcm-pez-docs"),
|
||||
("xcm-emulator", "xcm-pez-emulator"),
|
||||
("xcm-executor-integration-tests", "xcm-pez-executor-integration-tests"),
|
||||
("xcm-procedural", "xcm-pez-procedural"),
|
||||
("xcm-runtime-apis", "xcm-runtime-pezapis"),
|
||||
("xcm-simulator", "xcm-pez-simulator"),
|
||||
("xcm-simulator-example", "xcm-pez-simulator-example"),
|
||||
("xcm-simulator-fuzzer", "xcm-pez-simulator-fuzzer"),
|
||||
]
|
||||
|
||||
# Hedef dosya uzantıları
|
||||
TARGET_EXTENSIONS = ('.rs', '.toml', '.md', '.txt', '.yml', '.yaml', '.json', '.py')
|
||||
|
||||
# HARİÇ TUTULACAK KLASÖRLER (KESİN LİSTE)
|
||||
EXCLUDE_DIRS = {'crate_placeholders', '.git', 'target', 'node_modules', '__pycache__'}
|
||||
|
||||
def is_path_excluded(path):
|
||||
"""Verilen yolun yasaklı bir klasörün içinde olup olmadığını kontrol eder."""
|
||||
parts = path.split(os.sep)
|
||||
# Eğer path'in herhangi bir parçası EXCLUDE_DIRS içindeyse True döner
|
||||
return any(excluded in parts for excluded in EXCLUDE_DIRS)
|
||||
|
||||
def replace_in_file(filepath):
|
||||
# Kendi kendimizi değiştirmeyelim
|
||||
if os.path.basename(filepath) == os.path.basename(__file__):
|
||||
return
|
||||
|
||||
try:
|
||||
with open(filepath, 'r', encoding='utf-8', errors='ignore') as f:
|
||||
content = f.read()
|
||||
|
||||
original_content = content
|
||||
|
||||
for old_name, new_name in REBRAND_MAP:
|
||||
# 1. Normal (tireli)
|
||||
content = content.replace(old_name, new_name)
|
||||
# 2. Snake case (alt çizgili)
|
||||
old_snake = old_name.replace('-', '_')
|
||||
new_snake = new_name.replace('-', '_')
|
||||
content = content.replace(old_snake, new_snake)
|
||||
|
||||
if content != original_content:
|
||||
with open(filepath, 'w', encoding='utf-8') as f:
|
||||
f.write(content)
|
||||
print(f" [GÜNCELLENDİ] Dosya içeriği: {filepath}")
|
||||
|
||||
except Exception as e:
|
||||
print(f" [HATA] Dosya okunamadı: {filepath} -> {e}")
|
||||
|
||||
def rename_directories_and_files(root_dir):
|
||||
# topdown=True kullanarak yukarıdan aşağıya iniyoruz, böylece dirs listesini modifiye edebiliriz
|
||||
for dirpath, dirnames, filenames in os.walk(root_dir, topdown=True):
|
||||
|
||||
# GÜVENLİK: Yasaklı klasörleri yerinde (in-place) listeden silerek os.walk'un oraya girmesini engelle
|
||||
# Bu en güvenli yöntemdir.
|
||||
dirnames[:] = [d for d in dirnames if d not in EXCLUDE_DIRS]
|
||||
|
||||
# Eğer şu anki dizin zaten yasaklı bir yolun altındaysa (üstteki koruma kaçırdıysa) atla
|
||||
if is_path_excluded(dirpath):
|
||||
continue
|
||||
|
||||
# 1. Dosya isimlerini değiştir
|
||||
for filename in filenames:
|
||||
if filename == os.path.basename(__file__):
|
||||
continue
|
||||
|
||||
for old_name, new_name in REBRAND_MAP:
|
||||
if old_name in filename:
|
||||
old_file_path = os.path.join(dirpath, filename)
|
||||
new_filename = filename.replace(old_name, new_name)
|
||||
new_file_path = os.path.join(dirpath, new_filename)
|
||||
if os.path.exists(old_file_path):
|
||||
try:
|
||||
os.rename(old_file_path, new_file_path)
|
||||
print(f" [RENAME] Dosya: {filename} -> {new_filename}")
|
||||
except OSError as e:
|
||||
print(f" [HATA] Dosya adlandırılamadı {filename}: {e}")
|
||||
|
||||
# 2. Klasör isimlerini değiştir
|
||||
# Not: dirnames listesi üzerinde iterasyon yapıyoruz ama rename işlemi riskli olabilir
|
||||
# O yüzden sadece şu anki seviyedeki klasörleri kontrol ediyoruz
|
||||
# Ancak os.walk çalışırken klasör adı değişirse alt dizin taraması sapıtabilir.
|
||||
# Bu yüzden klasör yeniden adlandırmayı en sona, ayrı bir "bottom-up" geçişe bırakmak daha iyidir
|
||||
# ama basitlik adına burada dikkatli yapıyoruz.
|
||||
|
||||
# İkinci Geçiş: Sadece Klasör İsimleri (Bottom-Up)
|
||||
# Klasör isimlerini değiştirirken path bozulmasın diye en alttan başlıyoruz
|
||||
for dirpath, dirnames, filenames in os.walk(root_dir, topdown=False):
|
||||
if is_path_excluded(dirpath):
|
||||
continue
|
||||
|
||||
for dirname in dirnames:
|
||||
if dirname in EXCLUDE_DIRS:
|
||||
continue
|
||||
|
||||
for old_name, new_name in REBRAND_MAP:
|
||||
if old_name == dirname:
|
||||
old_dir_path = os.path.join(dirpath, dirname)
|
||||
new_dir_path = os.path.join(dirpath, new_name)
|
||||
if os.path.exists(old_dir_path):
|
||||
try:
|
||||
os.rename(old_dir_path, new_dir_path)
|
||||
print(f" [RENAME] Klasör: {dirname} -> {new_name}")
|
||||
except OSError as e:
|
||||
print(f" [HATA] Klasör adlandırılamadı {dirname}: {e}")
|
||||
|
||||
def process_content_updates(root_dir):
|
||||
for dirpath, dirnames, filenames in os.walk(root_dir, topdown=True):
|
||||
# Yasaklı klasörlere girme
|
||||
dirnames[:] = [d for d in dirnames if d not in EXCLUDE_DIRS]
|
||||
|
||||
if is_path_excluded(dirpath):
|
||||
continue
|
||||
|
||||
for filename in filenames:
|
||||
if filename.endswith(TARGET_EXTENSIONS) or filename == 'Cargo.lock':
|
||||
filepath = os.path.join(dirpath, filename)
|
||||
replace_in_file(filepath)
|
||||
|
||||
def main():
|
||||
root_dir = os.getcwd()
|
||||
print("==================================================")
|
||||
print(f"⚠️ DİKKAT: Çalışma dizini: {root_dir}")
|
||||
print(f"⚠️ HARİÇ TUTULANLAR: {EXCLUDE_DIRS}")
|
||||
print("==================================================")
|
||||
|
||||
# Otomatik onay veya soru
|
||||
# confirm = input("Emin misin? (evet/hayir): ")
|
||||
# if confirm.lower() != "evet": return
|
||||
print("İşlem başlatılıyor...")
|
||||
|
||||
print("\n--- Adım 1: Dosya İçeriklerinin Güncellenmesi ---")
|
||||
process_content_updates(root_dir)
|
||||
|
||||
print("\n--- Adım 2: Klasör ve Dosya İsimlerinin Değiştirilmesi ---")
|
||||
rename_directories_and_files(root_dir)
|
||||
|
||||
print("\n✅ Rebranding işlemi tamamlandı.")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,320 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
crates.io İsim Rezervasyon Script'i (Gelişmiş Versiyon)
|
||||
|
||||
Özellikler:
|
||||
- Kaldığı yerden devam etme (--start-from)
|
||||
- Ayarlanabilir bekleme süresi (--interval)
|
||||
- Workspace izolasyonu (üst dizindeki Cargo.toml ile çakışmaz)
|
||||
- "Already exists" durumunu akıllıca yönetir (bekleme yapmaz)
|
||||
"""
|
||||
|
||||
import subprocess
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
import time
|
||||
from pathlib import Path
|
||||
import argparse
|
||||
|
||||
WORKSPACE_ROOT = Path(__file__).parent.resolve()
|
||||
PLACEHOLDER_DIR = WORKSPACE_ROOT / "crate_placeholders"
|
||||
|
||||
# Yeni isim listesi
|
||||
NEW_CRATE_NAMES = [
|
||||
"asset-hub-pezkuwichain-emulated-chain",
|
||||
"asset-hub-pezkuwichain-integration-tests",
|
||||
"asset-hub-pezkuwichain-runtime",
|
||||
"asset-hub-zagros-emulated-chain",
|
||||
"asset-hub-zagros-integration-tests",
|
||||
"asset-hub-zagros-runtime",
|
||||
"asset-test-pezutils",
|
||||
"pez-binary-merkle-tree",
|
||||
"pez-chain-spec-guide-runtime",
|
||||
"collectives-zagros-emulated-chain",
|
||||
"collectives-zagros-integration-tests",
|
||||
"collectives-zagros-runtime",
|
||||
"coretime-pezkuwichain-emulated-chain",
|
||||
"coretime-pezkuwichain-integration-tests",
|
||||
"coretime-pezkuwichain-runtime",
|
||||
"coretime-zagros-emulated-chain",
|
||||
"coretime-zagros-integration-tests",
|
||||
"coretime-zagros-runtime",
|
||||
"emulated-integration-tests-common",
|
||||
"pez-equivocation-detector",
|
||||
"pez-erasure-coding-fuzzer",
|
||||
"pez-ethereum-standards",
|
||||
"pez-finality-relay",
|
||||
"pez-fork-tree",
|
||||
"pezframe-election-solution-type-fuzzer",
|
||||
"pezframe-omni-bencher",
|
||||
"pezframe-remote-externalities",
|
||||
"pezframe-storage-access-test-runtime",
|
||||
"pez-generate-bags",
|
||||
"glutton-zagros-runtime",
|
||||
"governance-zagros-integration-tests",
|
||||
"pez-kitchensink-runtime",
|
||||
"pez-messages-relay",
|
||||
"pez-minimal-template-node",
|
||||
"pez-minimal-template-runtime",
|
||||
"pez-node-bench",
|
||||
"pez-node-primitives",
|
||||
"pez-node-rpc",
|
||||
"pez-node-runtime-pez-generate-bags",
|
||||
"pez-node-template-release",
|
||||
"pez-node-testing",
|
||||
"pez-penpal-emulated-chain",
|
||||
"pez-penpal-runtime",
|
||||
"people-pezkuwichain-emulated-chain",
|
||||
"people-pezkuwichain-integration-tests",
|
||||
"people-pezkuwichain-runtime",
|
||||
"people-zagros-emulated-chain",
|
||||
"people-zagros-integration-tests",
|
||||
"people-zagros-runtime",
|
||||
"pezkuwi",
|
||||
"pezkuwichain-emulated-chain",
|
||||
"pezkuwichain-runtime",
|
||||
"pezkuwichain-runtime-constants",
|
||||
"pezkuwichain-system-emulated-network",
|
||||
"pezkuwichain-teyrchain-runtime",
|
||||
"pezkuwichain-zagros-system-emulated-network",
|
||||
"relay-bizinikiwi-client",
|
||||
"relay-pezutils",
|
||||
"pez-remote-ext-tests-bags-list",
|
||||
"pez-revive-dev-node",
|
||||
"pez-revive-dev-runtime",
|
||||
"pez-slot-range-helper",
|
||||
"pez-solochain-template-node",
|
||||
"pez-solochain-template-runtime",
|
||||
"pez-pez_subkey",
|
||||
"pez-template-zombienet-tests",
|
||||
"peztest-runtime-constants",
|
||||
"test-teyrchain-adder",
|
||||
"test-teyrchain-adder-collator",
|
||||
"test-teyrchain-halt",
|
||||
"test-teyrchain-undying",
|
||||
"test-teyrchain-undying-collator",
|
||||
"testnet-teyrchains-constants",
|
||||
"teyrchain-template",
|
||||
"teyrchain-template-node",
|
||||
"teyrchain-template-runtime",
|
||||
"teyrchains-common",
|
||||
"teyrchains-relay",
|
||||
"teyrchains-runtimes-test-utils",
|
||||
"pez-tracing-gum",
|
||||
"pez-pez-tracing-gum-proc-macro",
|
||||
"yet-another-teyrchain-runtime",
|
||||
"zagros-emulated-chain",
|
||||
"zagros-runtime",
|
||||
"zagros-runtime-constants",
|
||||
"zagros-system-emulated-network",
|
||||
"pez-zombienet-backchannel",
|
||||
"pezassets-common",
|
||||
"bp-asset-hub-pezkuwichain",
|
||||
"bp-asset-hub-zagros",
|
||||
"bp-pezbeefy",
|
||||
"bp-bridge-hub-pezcumulus",
|
||||
"bp-bridge-hub-pezkuwichain",
|
||||
"bp-bridge-hub-zagros",
|
||||
"bp-header-pez-chain",
|
||||
"bp-pez-messages",
|
||||
"bp-pezkuwi-bulletin",
|
||||
"bp-pezkuwi-core",
|
||||
"bp-pezkuwichain",
|
||||
"bp-pez-relayers",
|
||||
"pezbp-runtime",
|
||||
"bp-test-pezutils",
|
||||
"bp-teyrchains",
|
||||
"bp-xcm-pezbridge-hub",
|
||||
"bp-xcm-pezbridge-hub-router",
|
||||
"bp-zagros",
|
||||
"pezbridge-hub-common",
|
||||
"pezbridge-hub-pezkuwichain-emulated-chain",
|
||||
"pezbridge-hub-pezkuwichain-integration-tests",
|
||||
"pezbridge-hub-pezkuwichain-runtime",
|
||||
"pezbridge-hub-test-utils",
|
||||
"pezbridge-hub-zagros-emulated-chain",
|
||||
"pezbridge-hub-zagros-integration-tests",
|
||||
"pezbridge-hub-zagros-runtime",
|
||||
"pezbridge-runtime-common",
|
||||
"pezmmr-gadget",
|
||||
"pezmmr-rpc",
|
||||
"pezsnowbridge-beacon-primitives",
|
||||
"pezsnowbridge-core",
|
||||
"pezsnowbridge-ethereum",
|
||||
"pezsnowbridge-inbound-queue-primitives",
|
||||
"pezsnowbridge-merkle-tree",
|
||||
"pezsnowbridge-outbound-queue-primitives",
|
||||
"pezsnowbridge-outbound-queue-runtime-api",
|
||||
"pezsnowbridge-outbound-queue-v2-runtime-api",
|
||||
"pezsnowbridge-pezpallet-ethereum-client",
|
||||
"pezsnowbridge-pezpallet-ethereum-client-fixtures",
|
||||
"pezsnowbridge-pezpallet-inbound-queue",
|
||||
"pezsnowbridge-pezpallet-inbound-queue-fixtures",
|
||||
"pezsnowbridge-pezpallet-inbound-queue-v2",
|
||||
"pezsnowbridge-pezpallet-inbound-queue-v2-fixtures",
|
||||
"pezsnowbridge-pezpallet-outbound-queue",
|
||||
"pezsnowbridge-pezpallet-outbound-queue-v2",
|
||||
"pezsnowbridge-pezpallet-system",
|
||||
"pezsnowbridge-pezpallet-system-frontend",
|
||||
"pezsnowbridge-pezpallet-system-v2",
|
||||
"pezsnowpezbridge-runtime-common",
|
||||
"pezsnowbridge-runtime-test-common",
|
||||
"pezsnowbridge-system-runtime-api",
|
||||
"pezsnowbridge-system-v2-runtime-api",
|
||||
"pezsnowbridge-test-utils",
|
||||
"pezsnowbridge-verification-primitives",
|
||||
"xcm-pez-docs",
|
||||
"xcm-pez-emulator",
|
||||
"xcm-pez-executor-integration-tests",
|
||||
"xcm-pez-procedural",
|
||||
"xcm-runtime-pezapis",
|
||||
"xcm-pez-simulator",
|
||||
"xcm-pez-simulator-example",
|
||||
"xcm-pez-simulator-fuzzer",
|
||||
]
|
||||
|
||||
def check_crate_available(name: str) -> bool:
|
||||
"""crates.io'da isim müsait mi kontrol et"""
|
||||
result = subprocess.run(
|
||||
["cargo", "search", name, "--limit", "1"],
|
||||
capture_output=True, text=True
|
||||
)
|
||||
return f'{name} = "' not in result.stdout
|
||||
|
||||
def create_placeholder(name: str) -> Path:
|
||||
"""Placeholder crate oluştur"""
|
||||
crate_dir = PLACEHOLDER_DIR / name
|
||||
crate_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# [workspace] ekleyerek parent workspace ile ilişkisini kesiyoruz
|
||||
cargo_toml = f'''[package]
|
||||
name = "{name}"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
description = "PezkuwiChain SDK component - placeholder for name reservation"
|
||||
license = "Apache-2.0"
|
||||
repository = "https://github.com/pezkuwichain/pezkuwi-sdk"
|
||||
homepage = "https://pezkuwichain.io"
|
||||
documentation = "https://docs.pezkuwichain.io/sdk/"
|
||||
authors = ["Kurdistan Tech Institute <info@pezkuwichain.io>"]
|
||||
keywords = ["pezkuwichain", "blockchain", "sdk"]
|
||||
categories = ["cryptography::cryptocurrencies"]
|
||||
|
||||
[workspace]
|
||||
|
||||
[dependencies]
|
||||
'''
|
||||
(crate_dir / "Cargo.toml").write_text(cargo_toml)
|
||||
|
||||
src_dir = crate_dir / "src"
|
||||
src_dir.mkdir(exist_ok=True)
|
||||
lib_rs = f'''//! {name}
|
||||
//! This crate is part of the PezkuwiChain SDK.
|
||||
//! Full implementation coming soon.
|
||||
#![doc = include_str!("../README.md")]
|
||||
'''
|
||||
(src_dir / "lib.rs").write_text(lib_rs)
|
||||
|
||||
readme = f'''# {name}
|
||||
Part of [PezkuwiChain SDK](https://github.com/pezkuwichain/pezkuwi-sdk).
|
||||
## About
|
||||
This crate is a component of the PezkuwiChain blockchain SDK.
|
||||
'''
|
||||
(crate_dir / "README.md").write_text(readme)
|
||||
return crate_dir
|
||||
|
||||
def publish_placeholder(crate_dir: Path, dry_run: bool = True):
|
||||
"""Placeholder'ı crates.io'ya publish et.
|
||||
Dönüş: (başarılı_mı, bekleme_gerekli_mi)
|
||||
"""
|
||||
args = ["cargo", "publish"]
|
||||
if dry_run:
|
||||
args.append("--dry-run")
|
||||
args.extend(["--manifest-path", str(crate_dir / "Cargo.toml")])
|
||||
|
||||
result = subprocess.run(args, capture_output=True, text=True, cwd=crate_dir)
|
||||
|
||||
if result.returncode == 0:
|
||||
return True, True # Başarılı, bekleme yap
|
||||
|
||||
# "already exists" hatasını kontrol et
|
||||
if "already exists" in result.stderr:
|
||||
return True, False # Zaten var, bekleme yapma
|
||||
|
||||
print(f"\n[HATA] {crate_dir.name} publish edilemedi:\n{result.stderr}")
|
||||
return False, False
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="crates.io isim rezervasyonu")
|
||||
parser.add_argument("--list", action="store_true", help="İsimleri listele")
|
||||
parser.add_argument("--check", action="store_true", help="crates.io'da müsaitlik kontrol et")
|
||||
parser.add_argument("--create", action="store_true", help="Placeholder crate'leri oluştur")
|
||||
parser.add_argument("--publish", action="store_true", help="crates.io'ya publish et")
|
||||
parser.add_argument("--dry-run", action="store_true", help="Publish dry-run")
|
||||
parser.add_argument("--start-from", type=str, help="İşleme bu crate isminden başla (öncekileri atlar)")
|
||||
parser.add_argument("--interval", type=int, default=360, help="Publish arası bekleme süresi (saniye). Varsayılan: 360")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.list:
|
||||
for name in sorted(NEW_CRATE_NAMES):
|
||||
print(f" {name}")
|
||||
return
|
||||
|
||||
# Create/Publish işlemleri
|
||||
if args.create or args.publish:
|
||||
# Placeholder klasörünü oluştur
|
||||
PLACEHOLDER_DIR.mkdir(exist_ok=True)
|
||||
|
||||
start_processing = False
|
||||
if not args.start_from:
|
||||
start_processing = True
|
||||
|
||||
print(f"Toplam Crate Sayısı: {len(NEW_CRATE_NAMES)}")
|
||||
print(f"Bekleme Süresi: {args.interval} saniye")
|
||||
if args.start_from:
|
||||
print(f"Başlangıç: {args.start_from} (Öncekiler atlanacak)")
|
||||
|
||||
success = 0
|
||||
failed = 0
|
||||
skipped = 0
|
||||
|
||||
for i, name in enumerate(NEW_CRATE_NAMES, 1):
|
||||
# Resume mantığı
|
||||
if not start_processing:
|
||||
if name == args.start_from:
|
||||
start_processing = True
|
||||
else:
|
||||
skipped += 1
|
||||
continue
|
||||
|
||||
print(f"[{i}/{len(NEW_CRATE_NAMES)}] {name}...", end=" ", flush=True)
|
||||
|
||||
# 1. Create
|
||||
crate_dir = create_placeholder(name)
|
||||
|
||||
# 2. Publish (Eğer istenmişse)
|
||||
if args.publish:
|
||||
success_status, needs_wait = publish_placeholder(crate_dir, args.dry_run)
|
||||
|
||||
if success_status:
|
||||
if needs_wait:
|
||||
print("✓ PUBLISHED")
|
||||
success += 1
|
||||
if not args.dry_run:
|
||||
print(f" -> Bekleniyor {args.interval}sn...")
|
||||
time.sleep(args.interval)
|
||||
else:
|
||||
print("✓ ZATEN VAR (Atlandı)")
|
||||
success += 1
|
||||
else:
|
||||
print("✗ FAILED")
|
||||
failed += 1
|
||||
else:
|
||||
print("✓ CREATED")
|
||||
|
||||
print(f"\nSonuç: {success} başarılı, {failed} başarısız, {skipped} atlandı.")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,192 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Eski (rebrand edilmemiş) kelimeleri tarayan script.
|
||||
Her crate için çalıştırılır ve kalan eski kelimeleri tespit eder.
|
||||
|
||||
Kullanım:
|
||||
python3 scan_old_words.py <crate_path>
|
||||
python3 scan_old_words.py /home/mamostehp/kurdistan-sdk/bizinikiwi/primitives/core
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
# Rebrand kuralları: (eski_pattern, yeni_kelime, açıklama)
|
||||
# Sıralama önemli - daha spesifik olanlar önce
|
||||
REBRAND_RULES = [
|
||||
# Terminoloji
|
||||
(r'\bparachain\b', 'teyrchain', 'parachain → teyrchain'),
|
||||
(r'\bParachain\b', 'Teyrchain', 'Parachain → Teyrchain'),
|
||||
(r'\bPARACHAIN\b', 'TEYRCHAIN', 'PARACHAIN → TEYRCHAIN'),
|
||||
(r'\brococo\b', 'pezkuwichain', 'rococo → pezkuwichain'),
|
||||
(r'\bRococo\b', 'Pezkuwichain', 'Rococo → Pezkuwichain'),
|
||||
(r'\bROCOCO\b', 'PEZKUWICHAIN', 'ROCOCO → PEZKUWICHAIN'),
|
||||
(r'\bwestend\b', 'zagros', 'westend → zagros'),
|
||||
(r'\bWestend\b', 'Zagros', 'Westend → Zagros'),
|
||||
(r'\bWESTEND\b', 'ZAGROS', 'WESTEND → ZAGROS'),
|
||||
(r'\bkusama\b', 'zagros', 'kusama → zagros'),
|
||||
(r'\bKusama\b', 'Zagros', 'Kusama → Zagros'),
|
||||
(r'\bKUSAMA\b', 'ZAGROS', 'KUSAMA → ZAGROS'),
|
||||
|
||||
# Crate prefix'leri (Cargo.toml name ve use statement'larda)
|
||||
# Dikkat: Bunlar sadece crate isimlerinde geçerli, rastgele "sp_" değil
|
||||
(r'\bsp-core\b', 'pezsp-core', 'sp-core → pezsp-core'),
|
||||
(r'\bsp-runtime\b', 'pezsp-runtime', 'sp-runtime → pezsp-runtime'),
|
||||
(r'\bsp-io\b', 'pezsp-io', 'sp-io → pezsp-io'),
|
||||
(r'\bsp-std\b', 'pezsp-std', 'sp-std → pezsp-std'),
|
||||
(r'\bsp-api\b', 'pezsp-api', 'sp-api → pezsp-api'),
|
||||
(r'\bsc-client\b', 'pezsc-client', 'sc-client → pezsc-client'),
|
||||
(r'\bsc-service\b', 'pezsc-service', 'sc-service → pezsc-service'),
|
||||
(r'\bframe-support\b', 'pezframe-support', 'frame-support → pezframe-support'),
|
||||
(r'\bframe-system\b', 'pezframe-system', 'frame-system → pezframe-system'),
|
||||
(r'\bpallet-balances\b', 'pezpallet-balances', 'pallet-balances → pezpallet-balances'),
|
||||
(r'\bcumulus-client\b', 'pezcumulus-client', 'cumulus-client → pezcumulus-client'),
|
||||
(r'\bcumulus-primitives\b', 'pezcumulus-primitives', 'cumulus-primitives → pezcumulus-primitives'),
|
||||
|
||||
# Snowbridge (pezsnowbridge-pezpallet önce, sonra genel snowbridge)
|
||||
(r'\bsnowbridge-pezpallet-', 'pezsnowbridge-pezpallet-', 'snowbridge-pezpallet- → pezsnowbridge-pezpallet-'),
|
||||
(r'\bsnowbridge-pallet-', 'pezsnowbridge-pezpallet-', 'snowbridge-pallet- → pezsnowbridge-pezpallet-'),
|
||||
(r'\bsnowbridge-', 'pezsnowbridge-', 'snowbridge- → pezsnowbridge-'),
|
||||
(r'\bsnowbridge_pallet_', 'pezsnowbridge_pezpallet_', 'snowbridge_pallet_ → pezsnowbridge_pezpallet_'),
|
||||
(r'\bsnowbridge_pezpallet_', 'pezsnowbridge_pezpallet_', 'snowbridge_pezpallet_ → pezsnowbridge_pezpallet_'),
|
||||
|
||||
# Bridge
|
||||
(r'\bbridge-hub-rococo\b', 'pezbridge-hub-pezkuwichain', 'bridge-hub-rococo → pezbridge-hub-pezkuwichain'),
|
||||
(r'\bbridge-hub-westend\b', 'pezbridge-hub-zagros', 'bridge-hub-westend → pezbridge-hub-zagros'),
|
||||
(r'\bbridge-runtime-common\b', 'pezbridge-runtime-common', 'bridge-runtime-common → pezbridge-runtime-common'),
|
||||
|
||||
# MMR
|
||||
(r'\bmmr-gadget\b', 'pezmmr-gadget', 'mmr-gadget → pezmmr-gadget'),
|
||||
(r'\bmmr-rpc\b', 'pezmmr-rpc', 'mmr-rpc → pezmmr-rpc'),
|
||||
|
||||
# Substrate (dikkatli - sadece proje referanslarında)
|
||||
(r'\bsubstrate-wasm-builder\b', 'bizinikiwi-wasm-builder', 'substrate-wasm-builder → bizinikiwi-wasm-builder'),
|
||||
(r'\bsubstrate-build-script-utils\b', 'bizinikiwi-build-script-utils', 'substrate-build-script-utils → bizinikiwi-build-script-utils'),
|
||||
|
||||
# Polkadot referansları
|
||||
(r'\bpolkadot-sdk\b', 'pezkuwi-sdk', 'polkadot-sdk → pezkuwi-sdk'),
|
||||
(r'\bpolkadot-runtime\b', 'pezkuwichain-runtime', 'polkadot-runtime → pezkuwichain-runtime'),
|
||||
(r'\bpolkadot-primitives\b', 'pezkuwi-primitives', 'polkadot-primitives → pezkuwi-primitives'),
|
||||
|
||||
# Rust module isimleri (underscore versiyonları)
|
||||
(r'\bsp_core\b', 'pezsp_core', 'sp_core → pezsp_core'),
|
||||
(r'\bsp_runtime\b', 'pezsp_runtime', 'sp_runtime → pezsp_runtime'),
|
||||
(r'\bsp_io\b', 'pezsp_io', 'sp_io → pezsp_io'),
|
||||
(r'\bsc_client\b', 'pezsc_client', 'sc_client → pezsc_client'),
|
||||
(r'\bframe_support\b', 'pezframe_support', 'frame_support → pezframe_support'),
|
||||
(r'\bframe_system\b', 'pezframe_system', 'frame_system → pezframe_system'),
|
||||
(r'\bpallet_balances\b', 'pezpallet_balances', 'pallet_balances → pezpallet_balances'),
|
||||
(r'\bcumulus_client\b', 'pezcumulus_client', 'cumulus_client → pezcumulus_client'),
|
||||
(r'\bcumulus_primitives\b', 'pezcumulus_primitives', 'cumulus_primitives → pezcumulus_primitives'),
|
||||
]
|
||||
|
||||
# Taranacak dosya uzantıları
|
||||
SCAN_EXTENSIONS = {'.rs', '.toml', '.md', '.json', '.yaml', '.yml'}
|
||||
|
||||
# Atlanacak dizinler
|
||||
SKIP_DIRS = {'target', '.git', 'node_modules', 'crate_placeholders'}
|
||||
|
||||
|
||||
def scan_file(file_path: Path) -> list:
|
||||
"""Tek bir dosyayı tarar ve bulunan eski kelimeleri döndürür."""
|
||||
findings = []
|
||||
|
||||
try:
|
||||
content = file_path.read_text(encoding='utf-8', errors='ignore')
|
||||
except Exception as e:
|
||||
return [(str(file_path), 0, f"OKUMA HATASI: {e}", "", "")]
|
||||
|
||||
lines = content.split('\n')
|
||||
|
||||
for line_num, line in enumerate(lines, 1):
|
||||
for pattern, replacement, description in REBRAND_RULES:
|
||||
matches = re.finditer(pattern, line)
|
||||
for match in matches:
|
||||
findings.append({
|
||||
'file': str(file_path),
|
||||
'line': line_num,
|
||||
'column': match.start() + 1,
|
||||
'found': match.group(),
|
||||
'replacement': replacement,
|
||||
'description': description,
|
||||
'context': line.strip()[:100]
|
||||
})
|
||||
|
||||
return findings
|
||||
|
||||
|
||||
def scan_crate(crate_path: str) -> list:
|
||||
"""Bir crate dizinini tarar."""
|
||||
crate_dir = Path(crate_path)
|
||||
|
||||
if not crate_dir.exists():
|
||||
print(f"HATA: Dizin bulunamadı: {crate_path}")
|
||||
return []
|
||||
|
||||
all_findings = []
|
||||
|
||||
for root, dirs, files in os.walk(crate_dir):
|
||||
# Skip directories
|
||||
dirs[:] = [d for d in dirs if d not in SKIP_DIRS]
|
||||
|
||||
for file in files:
|
||||
file_path = Path(root) / file
|
||||
|
||||
if file_path.suffix not in SCAN_EXTENSIONS:
|
||||
continue
|
||||
|
||||
findings = scan_file(file_path)
|
||||
all_findings.extend(findings)
|
||||
|
||||
return all_findings
|
||||
|
||||
|
||||
def print_report(findings: list, crate_path: str):
|
||||
"""Bulunan eski kelimelerin raporunu yazdırır."""
|
||||
print(f"\n{'='*60}")
|
||||
print(f"TARAMA RAPORU: {crate_path}")
|
||||
print(f"{'='*60}\n")
|
||||
|
||||
if not findings:
|
||||
print("✅ ESKİ KELİME BULUNAMADI - Crate temiz!")
|
||||
return
|
||||
|
||||
print(f"❌ {len(findings)} adet eski kelime bulundu:\n")
|
||||
|
||||
# Dosyaya göre grupla
|
||||
by_file = {}
|
||||
for f in findings:
|
||||
if f['file'] not in by_file:
|
||||
by_file[f['file']] = []
|
||||
by_file[f['file']].append(f)
|
||||
|
||||
for file_path, file_findings in sorted(by_file.items()):
|
||||
rel_path = file_path.replace(crate_path, '.')
|
||||
print(f"\n📄 {rel_path}")
|
||||
print(f" {'-'*50}")
|
||||
|
||||
for finding in file_findings:
|
||||
print(f" Satır {finding['line']}: {finding['found']} → {finding['replacement']}")
|
||||
print(f" Bağlam: {finding['context']}")
|
||||
print()
|
||||
|
||||
|
||||
def main():
|
||||
if len(sys.argv) < 2:
|
||||
print("Kullanım: python3 scan_old_words.py <crate_path>")
|
||||
print("Örnek: python3 scan_old_words.py ./bizinikiwi/primitives/core")
|
||||
sys.exit(1)
|
||||
|
||||
crate_path = sys.argv[1]
|
||||
|
||||
findings = scan_crate(crate_path)
|
||||
print_report(findings, crate_path)
|
||||
|
||||
# Çıkış kodu: bulgu varsa 1, yoksa 0
|
||||
sys.exit(1 if findings else 0)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user