Sıfırdan Yeni Bir Depo Başlatın:
Mevcut Bir Git Deposu veya Klasörü Gönderin:
Hataları Geri Alma, İptal & Temizlik:
Son commit'i geri al (yapılan değişiklikleri korur):
git reset --soft HEAD~1
Yapılan yerel değişiklikleri iptal et (çalışma ağacını temizler):
git restore .
Takip edilmeyen gereksiz dosyaları sil:
git clean -fd
Değişiklikleri geçici sakla ve geri getir (stash):
git stash git stash pop
Dal (Branch) ve Sürüm Etiketleri:
Yeni dal aç ve geçiş yap:
git checkout -b yeni-ozellik git push -u origin yeni-ozellik
Sürüm etiketi (tag) oluştur ve gönder:
git tag -a v1.0.0 -m "Sürüm 1.0.0" git push origin --tags
feat: SnapCAD Studio'yu YakHub deposuna taşı
- DWG/DXF içe aktarma ve .skf yeniden açma düzeltmeleri - YakNet Bulut eşitlemede boş/eski kopya koruması ve yerel-only proje bildirimi - Panelden içe aktarma duyuruları ve erişilebilir Türkçe hata mesajları - AGPL-3.0 lisansı, README ve YakHub bağlantıları
@@ -0,0 +1,57 @@
|
||||
DirectoryIndex index.html index.php
|
||||
Options -Indexes
|
||||
ServerSignature Off
|
||||
|
||||
<IfModule mod_mime.c>
|
||||
AddType application/wasm .wasm
|
||||
AddType application/javascript .js .mjs
|
||||
AddType image/svg+xml .svg
|
||||
</IfModule>
|
||||
|
||||
<IfModule mod_headers.c>
|
||||
Header always set X-Content-Type-Options "nosniff"
|
||||
Header always set X-Frame-Options "SAMEORIGIN"
|
||||
Header always set Referrer-Policy "strict-origin-when-cross-origin"
|
||||
Header always set Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=()"
|
||||
Header always set Cross-Origin-Opener-Policy "same-origin-allow-popups"
|
||||
# HSTS yalnızca HTTPS üzerinden sunulduğunda gönderilir.
|
||||
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains" "expr=%{HTTPS} == 'on'"
|
||||
</IfModule>
|
||||
|
||||
<FilesMatch "\.(html|htm)$">
|
||||
<IfModule mod_headers.c>
|
||||
Header set Cache-Control "no-cache, no-store, must-revalidate"
|
||||
Header set Pragma "no-cache"
|
||||
Header set Expires 0
|
||||
</IfModule>
|
||||
</FilesMatch>
|
||||
|
||||
# Service worker ve manifest güncellemeleri tarayıcıda takılı kalmasın.
|
||||
<FilesMatch "^(sw\.js|manifest\.json|manifest\.webmanifest)$">
|
||||
<IfModule mod_headers.c>
|
||||
Header set Cache-Control "no-cache, no-store, must-revalidate"
|
||||
Header set Pragma "no-cache"
|
||||
Header set Expires 0
|
||||
</IfModule>
|
||||
</FilesMatch>
|
||||
|
||||
# Gizli yapılandırma ve kaynak dosyalarına dışarıdan HTTP erişimini engelle
|
||||
<FilesMatch "^\.(env|git|htaccess)|snap-config\.php$|composer\.(json|lock)$|package(-lock)?\.json$|\.(sql|log|bak|ini|sh|ps1)$">
|
||||
Require all denied
|
||||
</FilesMatch>
|
||||
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteBase /
|
||||
|
||||
# Kaynak kod, bağımlılık ve geliştirme klasörlerini dışarıya kapat
|
||||
RewriteRule ^(?:vendor|node_modules|apps|scripts|tests|src|database|\.git|\.github|\.next-export)(?:/|$) - [F,L]
|
||||
|
||||
# Mevcut dosya (.php, .js, .wasm vb.) veya klasör varsa doğrudan sun
|
||||
RewriteCond %{REQUEST_FILENAME} -f [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -d
|
||||
RewriteRule ^ - [L]
|
||||
|
||||
# SPA yönlendirmesi: bulunamayan rotaları index.html'e yönlendir
|
||||
RewriteRule ^ index.html [L]
|
||||
</IfModule>
|
||||
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 52 KiB |
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"name": "SnapCAD Studio",
|
||||
"short_name": "SnapCAD",
|
||||
"description": "Tarayıcı tabanlı profesyonel 3B CAD modelleme, teknik çizim, mimari plan ve devre simülasyon stüdyosu",
|
||||
"start_url": "/",
|
||||
"scope": "/",
|
||||
"display": "standalone",
|
||||
"orientation": "any",
|
||||
"background_color": "#060810",
|
||||
"theme_color": "#0284c7",
|
||||
"lang": "tr",
|
||||
"categories": ["productivity", "utilities", "education", "design"],
|
||||
"icons": [
|
||||
{
|
||||
"src": "/icons/icon-192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "/icons/icon-512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "/icons/icon-maskable-192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
},
|
||||
{
|
||||
"src": "/icons/icon-maskable-512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
}
|
||||
],
|
||||
"shortcuts": [
|
||||
{
|
||||
"name": "Yeni 3B Çizim",
|
||||
"short_name": "Yeni 3B",
|
||||
"description": "Yeni bir 3B modelleme projesi başlat",
|
||||
"url": "/?action=new-3d",
|
||||
"icons": [{ "src": "/icons/icon-192.png", "sizes": "192x192" }]
|
||||
},
|
||||
{
|
||||
"name": "Devre Simülasyonu",
|
||||
"short_name": "Devreler",
|
||||
"description": "Elektronik devre ve Arduino stüdyosunu aç",
|
||||
"url": "/?view=circuits",
|
||||
"icons": [{ "src": "/icons/icon-192.png", "sizes": "192x192" }]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"name": "SnapCAD Studio",
|
||||
"short_name": "SnapCAD",
|
||||
"description": "Tarayıcı tabanlı profesyonel 3B CAD modelleme, teknik çizim, mimari plan ve devre simülasyon stüdyosu",
|
||||
"start_url": "/",
|
||||
"scope": "/",
|
||||
"display": "standalone",
|
||||
"orientation": "any",
|
||||
"background_color": "#060810",
|
||||
"theme_color": "#0284c7",
|
||||
"lang": "tr",
|
||||
"categories": ["productivity", "utilities", "education", "design"],
|
||||
"icons": [
|
||||
{
|
||||
"src": "/icons/icon-192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "/icons/icon-512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "/icons/icon-maskable-192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
},
|
||||
{
|
||||
"src": "/icons/icon-maskable-512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
}
|
||||
],
|
||||
"shortcuts": [
|
||||
{
|
||||
"name": "Yeni 3B Çizim",
|
||||
"short_name": "Yeni 3B",
|
||||
"description": "Yeni bir 3B modelleme projesi başlat",
|
||||
"url": "/?action=new-3d",
|
||||
"icons": [{ "src": "/icons/icon-192.png", "sizes": "192x192" }]
|
||||
},
|
||||
{
|
||||
"name": "Devre Simülasyonu",
|
||||
"short_name": "Devreler",
|
||||
"description": "Elektronik devre ve Arduino stüdyosunu aç",
|
||||
"url": "/?view=circuits",
|
||||
"icons": [{ "src": "/icons/icon-192.png", "sizes": "192x192" }]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
// SnapCAD Studio Progressive Web App (PWA) Service Worker
|
||||
const CACHE_NAME = "snapcad-v1.2.0";
|
||||
const PRECACHE_ASSETS = [
|
||||
"/",
|
||||
"/manifest.json",
|
||||
"/icons/icon-192.png",
|
||||
"/icons/icon-512.png",
|
||||
"/icons/icon-maskable-192.png",
|
||||
"/icons/icon-maskable-512.png",
|
||||
"/icons/apple-touch-icon.png",
|
||||
];
|
||||
|
||||
// Ağ hatasında her zaman geçerli bir Response döndür. respondWith(undefined)
|
||||
// "Failed to convert value to 'Response'" hatasına ve boş sayfaya yol açar.
|
||||
function gatewayTimeoutResponse() {
|
||||
return new Response("", { status: 504, statusText: "Gateway Timeout" });
|
||||
}
|
||||
|
||||
function offlinePageResponse() {
|
||||
return new Response(
|
||||
"<!doctype html><html lang=\"tr\"><meta charset=\"utf-8\"><title>SnapCAD Studio çevrimdışı</title>" +
|
||||
"<body style=\"font-family:system-ui;padding:2rem\"><h1>Bağlantı kurulamadı</h1>" +
|
||||
"<p>SnapCAD Studio şu anda yüklenemedi. İnternet bağlantınızı kontrol edip sayfayı yenileyin.</p></body></html>",
|
||||
{ status: 503, statusText: "Offline", headers: { "Content-Type": "text/html; charset=utf-8" } },
|
||||
);
|
||||
}
|
||||
|
||||
// Install Event - Pre-cache essential app shell
|
||||
self.addEventListener("install", (event) => {
|
||||
event.waitUntil(
|
||||
caches
|
||||
.open(CACHE_NAME)
|
||||
.then((cache) => {
|
||||
return cache.addAll(PRECACHE_ASSETS).catch((err) => {
|
||||
console.warn("[SnapCAD SW] Precache warning:", err);
|
||||
});
|
||||
})
|
||||
.then(() => self.skipWaiting()),
|
||||
);
|
||||
});
|
||||
|
||||
// Activate Event - Clean up stale cache versions
|
||||
self.addEventListener("activate", (event) => {
|
||||
event.waitUntil(
|
||||
caches
|
||||
.keys()
|
||||
.then((keys) => {
|
||||
return Promise.all(
|
||||
keys
|
||||
.filter((key) => key !== CACHE_NAME)
|
||||
.map((key) => caches.delete(key)),
|
||||
);
|
||||
})
|
||||
.then(() => self.clients.claim()),
|
||||
);
|
||||
});
|
||||
|
||||
// Fetch Event - Resilient caching strategies
|
||||
self.addEventListener("fetch", (event) => {
|
||||
const { request } = event;
|
||||
const url = new URL(request.url);
|
||||
|
||||
// Never cache non-GET requests or backend API endpoints
|
||||
if (
|
||||
request.method !== "GET" ||
|
||||
url.pathname.startsWith("/api/") ||
|
||||
url.pathname.endsWith(".php")
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Cross-origin istekleri (ör. Cloudflare Analytics beacon) service worker'a
|
||||
// sokma; aksi hâlde önbellekte olmayan istekler undefined döndürür.
|
||||
if (url.origin !== self.location.origin) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Strategy 1: Cache-First for Immutable WebAssembly Runtimes
|
||||
if (
|
||||
url.pathname.endsWith(".wasm") ||
|
||||
url.pathname.includes("/occt/") ||
|
||||
url.pathname.includes("/dwgdxf/") ||
|
||||
url.pathname.includes("/libredwg/")
|
||||
) {
|
||||
event.respondWith(
|
||||
caches.match(request).then(async (cached) => {
|
||||
if (cached) return cached;
|
||||
try {
|
||||
const response = await fetch(request);
|
||||
if (response && response.status === 200) {
|
||||
const clone = response.clone();
|
||||
caches.open(CACHE_NAME).then((cache) => cache.put(request, clone));
|
||||
}
|
||||
return response;
|
||||
} catch {
|
||||
return gatewayTimeoutResponse();
|
||||
}
|
||||
}),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// Strategy 2: Stale-While-Revalidate for Static Assets (_next/static, icons, images)
|
||||
if (
|
||||
url.pathname.startsWith("/_next/static/") ||
|
||||
url.pathname.startsWith("/icons/") ||
|
||||
url.pathname.startsWith("/assets/")
|
||||
) {
|
||||
event.respondWith(
|
||||
caches.match(request).then(async (cached) => {
|
||||
const fetchPromise = fetch(request)
|
||||
.then((networkResponse) => {
|
||||
if (networkResponse && networkResponse.status === 200) {
|
||||
const clone = networkResponse.clone();
|
||||
caches.open(CACHE_NAME).then((cache) => cache.put(request, clone));
|
||||
}
|
||||
return networkResponse;
|
||||
})
|
||||
.catch(() => cached || gatewayTimeoutResponse());
|
||||
|
||||
return cached || fetchPromise;
|
||||
}),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// Strategy 3: Network-First with Offline Fallback for HTML Pages / Navigation
|
||||
if (request.mode === "navigate") {
|
||||
event.respondWith(
|
||||
fetch(request)
|
||||
.then((response) => {
|
||||
if (response && response.status === 200) {
|
||||
const clone = response.clone();
|
||||
caches.open(CACHE_NAME).then((cache) => cache.put(request, clone));
|
||||
}
|
||||
return response;
|
||||
})
|
||||
.catch(async () => {
|
||||
const cached = await caches.match(request);
|
||||
if (cached) return cached;
|
||||
const fallback = await caches.match("/");
|
||||
return fallback || offlinePageResponse();
|
||||
}),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// Default: Network with Cache Fallback
|
||||
event.respondWith(
|
||||
fetch(request).catch(async () => {
|
||||
const cached = await caches.match(request);
|
||||
return cached || gatewayTimeoutResponse();
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
// Listen for message to skip waiting on update
|
||||
self.addEventListener("message", (event) => {
|
||||
if (event.data && event.data.type === "SKIP_WAITING") {
|
||||
self.skipWaiting();
|
||||
}
|
||||
});
|
||||