Files

3.8 KiB

المساهمة

شكرًا لاهتمامك بالمساهمة في BentoPDF! سيساعدك هذا الدليل على البدء.

البدء

المتطلبات

  • Node.js 18+
  • npm 9+
  • Git

الإعداد

# Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/bentopdf.git
cd bentopdf

# Install dependencies
npm install

# Start development server
npm run dev

بنية المشروع

bentopdf/
├── src/
│   ├── js/
│   │   ├── config/       # Tool definitions
│   │   ├── logic/        # Tool page logic
│   │   ├── utils/        # Shared utilities
│   │   └── ui.ts         # UI helpers
│   ├── pages/            # Tool HTML pages
│   └── css/              # Styles
├── public/
│   ├── locales/          # Translations
│   └── pymupdf-wasm/     # WASM modules
├── docs/                 # Documentation (VitePress)
└── scripts/              # Build scripts

إضافة أداة جديدة

الخطوة 1: إنشاء ملف المنطق

أنشئ src/js/logic/your-tool-page.ts:

import { showLoader, hideLoader, showAlert } from '../ui.js';
import { state } from '../state.js';

document.addEventListener('DOMContentLoaded', () => {
  // Your tool logic here
});

الخطوة 2: إنشاء صفحة HTML

أنشئ src/pages/your-tool.html باتباع قوالب الأدوات الموجودة.

الخطوة 3: تسجيل الأداة

أضف إلى src/js/config/tools.ts:

{
  href: import.meta.env.BASE_URL + 'your-tool.html',
  name: 'Your Tool',
  icon: 'ph-icon-name',
  subtitle: 'Description of your tool.',
}

الخطوة 4: الإضافة إلى إعدادات البناء

أضف الصفحة إلى vite.config.ts:

'your-tool': resolve(__dirname, 'src/pages/your-tool.html'),

الخطوة 5: إضافة الترجمات

أضف مدخلات إلى جميع ملفات اللغات في public/locales/:

{
  "yourTool": {
    "name": "Your Tool",
    "subtitle": "Description"
  }
}

نمط الكود

  • استخدم TypeScript لكل الكود الجديد
  • اتبع الأنماط الموجودة للحفاظ على الاتساق
  • شغّل npm run format قبل الإيداع
  • لا تضف تعليقات في كود الإنتاج (تُزال التعليقات أثناء البناء)

عملية طلب السحب

  1. أنشئ فرعًا للميزة: git checkout -b feature/your-feature
  2. أجرِ تعديلاتك
  3. اختبر جيدًا: npm run build
  4. أرسل طلب سحب (PR) مع وصف واضح

الترجمة

راجع TRANSLATION.md لإضافة لغات جديدة.

اتفاقية ترخيص المساهم

قبل دمج طلب السحب، ستحتاج إلى توقيع اتفاقية CLA الخاصة بنا:

الحصول على المساعدة

الترخيص

BentoPDF مرخّص بترخيص مزدوج:

بمساهمتك، فإنك توافق على ترخيص مساهماتك بموجب هذه الشروط.