Files
xRPKRMAWorkspace/Documents/Developer/Azure Ext v3.html
T
2026-11-18 17:38:23 +03:30

645 lines
20 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>راهنمای تست و توسعه افزونه Azure DevOps | بدون دسترسی انتشار</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');
:root {
--primary: #1a365d;
--primary-light: #2c5282;
--accent: #c9a961;
--accent-dark: #a8893f;
--bg: #faf9f6;
--card-bg: #ffffff;
--text: #1a202c;
--text-muted: #4a5568;
--border: #e2e8f0;
--success: #38a169;
--danger: #e53e3e;
--warning: #dd6b20;
--shadow: 0 4px 6px rgba(0,0,0,0.05), 0 10px 30px rgba(26,54,93,0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: 'Vazirmatn', Tahoma, sans-serif;
background: var(--bg);
color: var(--text);
line-height: 1.9;
font-size: 15px;
padding: 30px 15px;
}
.document-container {
max-width: 950px;
margin: 0 auto;
background: var(--card-bg);
box-shadow: var(--shadow);
border-radius: 12px;
overflow: hidden;
}
.document-header {
background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
color: white;
padding: 50px 40px 40px;
position: relative;
border-bottom: 4px solid var(--accent);
}
.document-header::before {
content: '';
position: absolute;
top: 0; right: 0;
width: 200px; height: 200px;
background: radial-gradient(circle, rgba(201,169,97,0.15) 0%, transparent 70%);
border-radius: 50%;
transform: translate(50%, -50%);
}
.header-top {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30px;
position: relative;
z-index: 1;
}
.company-badge {
display: flex;
align-items: center;
gap: 12px;
}
.company-logo {
width: 60px; height: 60px;
background: var(--accent);
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.doc-meta {
text-align: left;
font-size: 12px;
opacity: 0.9;
}
.doc-meta div { margin-bottom: 3px; }
.document-title {
text-align: center;
position: relative;
z-index: 1;
padding: 20px 0;
}
.document-title .label {
display: inline-block;
background: rgba(201,169,97,0.2);
color: var(--accent);
padding: 4px 16px;
border-radius: 20px;
font-size: 12px;
font-weight: 600;
margin-bottom: 15px;
border: 1px solid rgba(201,169,97,0.4);
}
.document-title h1 {
font-size: 28px;
font-weight: 800;
margin-bottom: 10px;
letter-spacing: -0.5px;
}
.document-title h2 {
font-size: 16px;
font-weight: 400;
opacity: 0.9;
}
.document-body {
padding: 40px;
}
.intro-text {
background: linear-gradient(to left, #f7fafc, #edf2f7);
border-right: 4px solid var(--accent);
padding: 20px 25px;
border-radius: 8px;
margin-bottom: 35px;
font-size: 14px;
color: var(--text-muted);
}
.section {
margin-bottom: 40px;
page-break-inside: avoid;
}
.section-header {
display: flex;
align-items: center;
gap: 15px;
padding-bottom: 12px;
border-bottom: 2px solid var(--border);
margin-bottom: 20px;
}
.section-number {
width: 50px; height: 50px;
background: linear-gradient(135deg, var(--primary), var(--primary-light));
color: white;
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
font-weight: 800;
font-size: 20px;
flex-shrink: 0;
box-shadow: 0 4px 10px rgba(26,54,93,0.2);
}
.section-title { flex: 1; }
.section-title h3 {
font-size: 19px;
font-weight: 700;
color: var(--primary);
margin-bottom: 2px;
}
.section-title .subtitle {
font-size: 12px;
color: var(--text-muted);
}
.section-content {
padding-right: 10px;
}
.section-content p {
margin-bottom: 12px;
text-align: justify;
text-indent: 20px;
}
.section-content p.no-indent { text-indent: 0; }
.highlight-box {
background: linear-gradient(to left, #fffaf0, #fef5e7);
border: 1px solid #f6e05e;
border-right: 4px solid var(--accent);
padding: 18px 22px;
border-radius: 8px;
margin: 20px 0;
font-size: 14px;
}
.highlight-box strong {
color: var(--accent-dark);
}
.info-box {
background: linear-gradient(to left, #ebf8ff, #e6f6ff);
border: 1px solid #90cdf4;
border-right: 4px solid var(--primary-light);
padding: 18px 22px;
border-radius: 8px;
margin: 20px 0;
font-size: 14px;
}
.success-box {
background: linear-gradient(to left, #f0fff4, #e6fffa);
border: 1px solid #9ae6b4;
border-right: 4px solid var(--success);
padding: 18px 22px;
border-radius: 8px;
margin: 20px 0;
font-size: 14px;
}
.warning-box {
background: linear-gradient(to left, #fffaf0, #fef5e7);
border: 1px solid #fbd38d;
border-right: 4px solid var(--warning);
padding: 18px 22px;
border-radius: 8px;
margin: 20px 0;
font-size: 14px;
}
.styled-table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
background: white;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.styled-table thead {
background: linear-gradient(135deg, var(--primary), var(--primary-light));
color: white;
}
.styled-table th {
padding: 14px 16px;
text-align: right;
font-weight: 600;
font-size: 13px;
}
.styled-table td {
padding: 13px 16px;
border-bottom: 1px solid var(--border);
font-size: 13px;
}
.styled-table tbody tr:last-child td { border-bottom: none; }
.styled-table tbody tr:nth-child(even) { background: #f8fafc; }
.styled-table .highlight-row {
background: #fffaf0 !important;
font-weight: 600;
}
.code-block {
background: #1e1e1e;
color: #d4d4d4;
padding: 20px;
border-radius: 8px;
margin: 20px 0;
direction: ltr;
text-align: left;
font-family: 'Consolas', 'Courier New', monospace;
font-size: 13px;
line-height: 1.6;
overflow-x: auto;
border-right: 4px solid var(--accent);
}
.code-block .comment { color: #6a9955; }
.code-block .keyword { color: #569cd6; }
.code-block .string { color: #ce9178; }
.quote-box {
background: linear-gradient(135deg, #f7fafc, #edf2f7);
border-right: 4px solid var(--accent);
padding: 20px 25px;
border-radius: 8px;
margin: 20px 0;
position: relative;
}
.quote-box::before {
content: '"';
position: absolute;
top: -10px;
right: 15px;
font-size: 60px;
color: var(--accent);
opacity: 0.3;
font-family: Georgia, serif;
}
.quote-box p {
font-style: italic;
color: var(--text-muted);
margin-bottom: 10px;
text-indent: 0 !important;
}
.quote-box .source {
font-size: 12px;
color: var(--text-muted);
text-align: left;
font-style: normal;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 15px;
margin: 25px 0;
}
.stat-card {
background: linear-gradient(135deg, var(--primary), var(--primary-light));
color: white;
padding: 20px;
border-radius: 10px;
text-align: center;
box-shadow: 0 4px 12px rgba(26,54,93,0.2);
}
.stat-card .stat-value {
font-size: 24px;
font-weight: 800;
margin-bottom: 5px;
color: var(--accent);
line-height: 1.3;
}
.stat-card .stat-label {
font-size: 12px;
opacity: 0.9;
}
.comparison-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px;
margin: 25px 0;
}
.comparison-card {
background: #f8fafc;
border: 2px solid var(--border);
border-radius: 10px;
padding: 20px;
position: relative;
}
.comparison-card.recommended {
border-color: var(--success);
background: linear-gradient(to left, #f0fff4, #e6fffa);
}
.comparison-card .card-badge {
position: absolute;
top: -10px;
right: 20px;
background: var(--success);
color: white;
padding: 3px 12px;
border-radius: 15px;
font-size: 11px;
font-weight: 600;
}
.comparison-card h4 {
font-size: 16px;
font-weight: 700;
color: var(--primary);
margin-bottom: 15px;
padding-bottom: 10px;
border-bottom: 2px solid var(--border);
}
.comparison-card.recommended h4 {
border-bottom-color: var(--success);
}
.comparison-card ul {
list-style: none;
padding: 0;
}
.comparison-card ul li {
padding: 8px 0;
border-bottom: 1px solid var(--border);
font-size: 13px;
display: flex;
justify-content: space-between;
}
.comparison-card ul li:last-child { border-bottom: none; }
.comparison-card ul li .value {
font-weight: 600;
color: var(--primary);
}
.conclusion-box {
background: linear-gradient(135deg, var(--primary), var(--primary-light));
color: white;
padding: 30px;
border-radius: 12px;
margin: 30px 0;
text-align: center;
box-shadow: 0 8px 20px rgba(26,54,93,0.3);
}
.conclusion-box h3 {
font-size: 22px;
font-weight: 800;
margin-bottom: 15px;
color: var(--accent);
}
.conclusion-box p {
font-size: 14px;
line-height: 1.8;
text-indent: 0 !important;
margin-bottom: 15px;
}
.conclusion-box .highlight {
background: rgba(201,169,97,0.2);
padding: 15px 20px;
border-radius: 8px;
margin-top: 20px;
border: 1px solid rgba(201,169,97,0.4);
}
.document-footer {
background: var(--primary);
color: white;
padding: 25px 40px;
text-align: center;
font-size: 12px;
margin-top: 40px;
}
.document-footer .footer-brand {
font-weight: 700;
color: var(--accent);
margin-bottom: 5px;
font-size: 14px;
}
.footer-divider {
width: 60px;
height: 2px;
background: var(--accent);
margin: 10px auto;
}
.page-info {
text-align: center;
padding: 15px;
font-size: 11px;
color: var(--text-muted);
border-top: 1px solid var(--border);
margin-top: 30px;
}
@media print {
body { background: white; padding: 0; }
.document-container { box-shadow: none; border-radius: 0; }
.section { page-break-inside: avoid; }
}
@media (max-width: 768px) {
.document-body { padding: 25px 20px; }
.document-header { padding: 30px 20px; }
.comparison-grid { grid-template-columns: 1fr; }
.stats-grid { grid-template-columns: 1fr; }
.header-top { flex-direction: column; gap: 15px; }
.doc-meta { text-align: center; }
}
</style>
</head>
<body>
<div class="document-container">
<header class="document-header">
<div class="header-top">
<div class="company-badge">
<div class="company-logo"></div>
</div>
<div class="doc-meta">
<div>شماره مستند: AZDO-EXT-TEST-002</div>
<div>نسخه: ۱.۰</div>
<div>تاریخ تهیه: آبان ۱۴۰۵</div>
<div>طبقه‌بندی: فنی / آموزشی</div>
</div>
</div>
<div class="document-title">
<span class="label">DEVELOPMENT GUIDE</span>
<h1>تست و توسعه افزونه بدون دسترسی انتشار</h1>
<h2>راهکارهای عملی برای Sideload، دیباگ و چرخه توسعه سریع</h2>
</div>
</header>
<div class="document-body">
<div class="intro-text">
<strong>توسعه‌دهنده گرامی،</strong><br>
عدم دسترسی به پنل مدیریت Marketplace یا نداشتن مجوز انتشار عمومی، مانعی برای توسعه و تست افزونه نیست. مایکروسافت مکانیزم‌های اختصاصی را برای این منظور پیش‌بینی کرده است. این مستند، راهکارهای استاندارد و امن برای تست افزونه در محیط واقعی سازمان را تشریح می‌کند.
</div>
<div class="section">
<div class="section-header">
<div class="section-number">۱</div>
<div class="section-title">
<h3>روش Sideload: نصب خصوصی در سازمان</h3>
<div class="subtitle">Private Installation via Organization Settings</div>
</div>
</div>
<div class="section-content">
<p>حتی اگر دسترسی انتشار در Marketplace ندارید، می‌توانید فایل <code>.vsix</code> را مستقیماً در تنظیمات سازمان Azure DevOps خود بارگذاری کنید. این روش رسمی‌ترین راه برای تست افزونه‌ها قبل از انتشار است.</p>
<div class="stats-grid">
<div class="stat-card">
<div class="stat-value">بدون نیاز<br>به Publisher</div>
<div class="stat-label">فقط دسترسی Admin سازمان کافیست</div>
</div>
<div class="stat-card">
<div class="stat-value">محیط<br>واقعی</div>
<div class="stat-label">تست روی داده‌ها و کاربران واقعی</div>
</div>
<div class="stat-card">
<div class="stat-value">امنیت<br>کامل</div>
<div class="stat-label">افزونه فقط برای اعضای سازمان قابل مشاهده است</div>
</div>
</div>
<h4 style="margin-top: 25px; color: var(--primary); font-size: 16px;">مراحل انجام Sideload:</h4>
<ul style="padding-right: 20px; margin-top: 10px;">
<li style="margin-bottom: 8px;"><strong>مرحله ۱:</strong> ورود به Organization Settings > Extensions > Manage Extensions</li>
<li style="margin-bottom: 8px;"><strong>مرحله ۲:</strong> کلیک روی دکمه "Upload new extension" و انتخاب فایل .vsix</li>
<li style="margin-bottom: 8px;"><strong>مرحله ۳:</strong> پس از آپلود، روی "Install" کلیک کرده و سازمان مقصد را انتخاب کنید</li>
<li style="margin-bottom: 8px;"><strong>مرحله ۴:</strong> رفرش کردن صفحه Azure DevOps و مشاهده افزونه در منوی مربوطه</li>
</ul>
<div class="warning-box">
<strong>⚠️ نکته مهم:</strong> برای انجام Sideload باید نقش <strong>Project Collection Administrator</strong> یا حداقل دسترسی "Manage Extensions" در سطح سازمان را داشته باشید. در صورت عدم دسترسی، از مدیر سیستم بخواهید فایل vsix شما را نصب کند.
</div>
</div>
</div>
<div class="section">
<div class="section-header">
<div class="section-number">۲</div>
<div class="section-title">
<h3>توسعه محلی با Webpack Dev Server</h3>
<div class="subtitle">Local Development with Hot Reload</div>
</div>
</div>
<div class="section-content">
<p>برای جلوگیری از چرخه طولانی «تغییر کد > بسته‌بندی > آپلود > نصب»، می‌توانید از یک سرور محلی استفاده کنید. در این روش، iframe افزونه در Azure DevOps به جای فایل داخل vsix، به localhost شما اشاره می‌کند.</p>
<div class="comparison-grid">
<div class="comparison-card">
<h4>روش سنتی (Sideload)</h4>
<ul>
<li><span>چرخه تغییر</span> <span class="value">۲ تا ۵ دقیقه</span></li>
<li><span>نیاز به بسته‌بندی</span> <span class="value">بله (هر بار)</span></li>
<li><span>دیباگ کردن</span> <span class="value">سخت و زمان‌بر</span></li>
<li><span>مناسب برای</span> <span class="value">تست نهایی</span></li>
</ul>
</div>
<div class="comparison-card recommended">
<span class="card-badge">پیشنهاد ما ✓</span>
<h4>روش Dev Server</h4>
<ul>
<li><span>چرخه تغییر</span> <span class="value">آنی (Hot Reload)</span></li>
<li><span>نیاز به بسته‌بندی</span> <span class="value">خیر</span></li>
<li><span>دیباگ کردن</span> <span class="value">Source Maps فعال</span></li>
<li><span>مناسب برای</span> <span class="value">توسعه روزانه</span></li>
</ul>
</div>
</div>
<div class="code-block">
<span class="comment"># 1. تنظیم manifest برای اشاره به لوکال هاست</span>
<span class="comment"># در vss-extension.json بخش properties.uri را تغییر دهید:</span>
{
<span class="string">"properties"</span>: {
<span class="string">"name"</span>: <span class="string">"My Hub"</span>,
<span class="string">"uri"</span>: <span class="string">"https://localhost:3000"</span>
}
}
<span class="comment"># 2. اجرای سرور محلی با SSL (الزامی برای Azure DevOps)</span>
npx webpack serve --https --port 3000
<span class="comment"># 3. پذیرش گواهی SSL نامعتبر در مرورگر</span>
<span class="comment"># ابتدا https://localhost:3000 را در تب جدید باز کرده و Proceed کنید</span>
</div>
<div class="info-box">
<strong>💡 نکته حیاتی:</strong> Azure DevOps تنها از طریق HTTPS بارگذاری می‌شود. بنابراین سرور محلی شما حتماً باید SSL داشته باشد. همچنین به دلیل Self-Signed بودن گواهی، باید یک‌بار آدرس localhost را مستقیماً در مرورگر باز کرده و ریسک امنیتی را بپذیرید.
</div>
</div>
</div>
<div class="section">
<div class="section-header">
<div class="section-number">۳</div>
<div class="section-title">
<h3>دیباگ و عیب‌یابی پیشرفته</h3>
<div class="subtitle">Advanced Debugging Techniques</div>
</div>
</div>
<div class="section-content">
<p>از آنجا که افزونه‌ها در iframe اجرا می‌شوند، دیباگ کردن آن‌ها کمی متفاوت از وب‌اپلیکیشن‌های معمولی است. ابزارهای زیر ضروری هستند:</p>
<table class="styled-table">
<thead>
<tr>
<th>ابزار / تکنیک</th>
<th>کاربرد</th>
<th>اولویت</th>
</tr>
</thead>
<tbody>
<tr>
<td>Chrome DevTools (F12)</td>
<td>مشاهده Console، Network و DOM افزونه</td>
<td style="color: var(--danger); font-weight: 600;">الزامی</td>
</tr>
<tr>
<td>Azure DevOps SDK Logging</td>
<td>فعال‌سازی لاگ‌های داخلی SDK با متد setLogging(true)</td>
<td style="color: var(--warning); font-weight: 600;">توصیه شده</td>
</tr>
<tr>
<td>PostMessage Monitor</td>
<td>شنود پیام‌های رد و بدل شده بین هاست و iframe</td>
<td style="color: var(--success); font-weight: 600;">پیشرفته</td>
</tr>
<tr>
<td>Network Tab Filtering</td>
<td>فیلتر کردن درخواست‌های API مربوط به افزونه</td>
<td style="color: var(--warning); font-weight: 600;">توصیه شده</td>
</tr>
</tbody>
</table>
<div class="quote-box">
<p>همیشه قبل از گزارش باگ، مطمئن شوید که مشکل از سمت افزونه شماست و نه محدودیت‌های پلتفرم. بسیاری از خطاهای ظاهری ناشی از CSP (Content Security Policy) یا محدودیت‌های iframe هستند.</p>
<div class="source">— Azure DevOps Extension Troubleshooting Guide</div>
</div>
</div>
</div>
<div class="section">
<div class="section-header">
<div class="section-number">۴</div>
<div class="section-title">
<h3>مدیریت نسخه و چرخه به‌روزرسانی</h3>
<div class="subtitle">Versioning & Update Cycle</div>
</div>
</div>
<div class="section-content">
<p>در محیط توسعه بدون دسترسی انتشار، مدیریت نسخه‌ها اهمیت دوچندان دارد. هر بار که تغییری اعمال می‌کنید، باید نسخه manifest را افزایش دهید تا Azure DevOps فایل جدید را شناسایی کند.</p>
<div class="highlight-box">
<strong>🔑 قانون طلایی:</strong> Azure DevOps فایل vsix با همان نسخه قبلی را نادیده می‌گیرد. حتی برای یک تغییر کوچک CSS، باید عدد نسخه را در <code>vss-extension.json</code> افزایش دهید (مثلاً از 1.0.0 به 1.0.1).
</div>
<h4 style="margin-top: 20px; color: var(--primary); font-size: 16px;">استراتژی پیشنهادی نسخه‌گذاری:</h4>
<ul style="padding-right: 20px; margin-top: 10px;">
<li style="margin-bottom: 8px;"><strong>Major:</strong> تغییرات شکست‌ساز یا بازنویسی کامل (1.0.0 → 2.0.0)</li>
<li style="margin-bottom: 8px;"><strong>Minor:</strong> افزودن ویژگی جدید (1.0.0 → 1.1.0)</li>
<li style="margin-bottom: 8px;"><strong>Patch:</strong> رفع باگ و تغییرات جزئی (1.0.0 → 1.0.1)</li>
<li style="margin-bottom: 8px;"><strong>Pre-release:</strong> نسخه‌های تستی با پسوند -beta یا -dev (1.0.1-beta.1)</li>
</ul>
</div>
</div>
<div class="conclusion-box">
<h3>🎯 خلاصه راهکارها</h3>
<p>عدم دسترسی به Marketplace پایان راه نیست. با ترکیب Sideload برای تست نهایی و Dev Server برای توسعه سریع، می‌توانید چرخه توسعه کاملی را بدون هیچ مانعی طی کنید.</p>
<div class="highlight">
<strong>💎 مسیر پیشنهادی:</strong><br>
توسعه با Localhost (سریع) ← تست با Sideload (واقعی) ← دیباگ با DevTools ← تکرار چرخه
</div>
</div>
<div class="info-box">
<strong>📞 گام بعدی:</strong> اگر همچنان با مشکل مواجه هستید، لاگ‌های Console و Network Tab را همراه با نسخه manifest و ساختار پروژه ارسال کنید تا بررسی دقیق‌تری انجام شود.
</div>
<div class="page-info">
این مستند محرمانه بوده و صرفاً جهت استفاده تیم فنی و معماری تهیه شده است. هرگونه بازنشر بدون اجازه کتبی ممنوع است.
</div>
</div>
<footer class="document-footer">
<div class="footer-brand">واحد معماری نرم‌افزار | Azure DevOps Practice</div>
<div class="footer-divider"></div>
<div>تاریخ تهیه: آبان ۱۴۰۵ &nbsp;|&nbsp; نسخه: ۱.۰ &nbsp;|&nbsp; طبقه‌بندی: فنی</div>
</footer>
</div>
</body>
</html>