Git Komut Rehberi & Terminal Asistanı
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
release: SnapCAD Studio 1.0.10 (desktop menuler, macOS kisayollari, YakNet SSO)
Build and Push Docker Images / build (push) Canceled after 0s
Desktop Release / Build linux desktop (push) Canceled after 0s
Desktop Release / Build windows desktop (push) Canceled after 0s
Desktop Release / Attach packages to release (push) Canceled after 0s
Desktop Release / Build macos desktop (push) Canceled after 0s
CI / Typecheck and unit tests (push) Canceled after 0s
Build and Push Docker Images / build (push) Canceled after 0s
Desktop Release / Build linux desktop (push) Canceled after 0s
Desktop Release / Build windows desktop (push) Canceled after 0s
Desktop Release / Attach packages to release (push) Canceled after 0s
Desktop Release / Build macos desktop (push) Canceled after 0s
CI / Typecheck and unit tests (push) Canceled after 0s
This commit is contained in:
@@ -6,7 +6,12 @@ import { fileURLToPath } from "node:url";
|
||||
const desktopDir = path.dirname(fileURLToPath(import.meta.url));
|
||||
const repoRoot = path.resolve(desktopDir, "..", "..");
|
||||
const nextBin = path.join(repoRoot, "node_modules", "next", "dist", "bin", "next");
|
||||
const copyOcctScript = path.join(repoRoot, "scripts", "copy-occt-wasm.mjs");
|
||||
const wasmCopyScripts = [
|
||||
path.join(repoRoot, "scripts", "copy-occt-wasm.mjs"),
|
||||
path.join(repoRoot, "scripts", "copy-dwg-wasm.mjs"),
|
||||
path.join(repoRoot, "scripts", "copy-ifc-wasm.mjs"),
|
||||
path.join(repoRoot, "scripts", "copy-planegcs-wasm.mjs"),
|
||||
];
|
||||
|
||||
function runNode(args, env = process.env) {
|
||||
const result = spawnSync(process.execPath, args, {
|
||||
@@ -25,7 +30,9 @@ function runNode(args, env = process.env) {
|
||||
}
|
||||
}
|
||||
|
||||
runNode([copyOcctScript]);
|
||||
for (const scriptPath of wasmCopyScripts) {
|
||||
runNode([scriptPath]);
|
||||
}
|
||||
runNode([nextBin, "build", "apps/web"], {
|
||||
...process.env,
|
||||
SKETCHFORGE_DOCKER_BUILD: "true",
|
||||
@@ -34,6 +41,7 @@ runNode([nextBin, "build", "apps/web"], {
|
||||
|
||||
const requiredPaths = [
|
||||
path.join(repoRoot, "apps", "web", ".next", "standalone", "apps", "web", "server.js"),
|
||||
path.join(repoRoot, "apps", "web", ".next", "standalone", "node_modules"),
|
||||
path.join(repoRoot, "apps", "web", ".next", "static"),
|
||||
path.join(repoRoot, "apps", "web", "public"),
|
||||
];
|
||||
@@ -45,4 +53,9 @@ for (const requiredPath of requiredPaths) {
|
||||
}
|
||||
}
|
||||
|
||||
console.log("[desktop:web:build] Standalone SketchForge web bundle is ready.");
|
||||
const standaloneModulesSrc = path.join(repoRoot, "apps", "web", ".next", "standalone", "node_modules");
|
||||
const stagedRuntimeModules = path.join(repoRoot, "apps", "web", ".next", "desktop-runtime_modules");
|
||||
fs.rmSync(stagedRuntimeModules, { recursive: true, force: true });
|
||||
fs.cpSync(standaloneModulesSrc, stagedRuntimeModules, { recursive: true, dereference: true });
|
||||
|
||||
console.log("[desktop:web:build] Standalone SnapCAD web bundle is ready.");
|
||||
+15
-8
@@ -7,7 +7,12 @@ import electronPath from "electron";
|
||||
const desktopDir = path.dirname(fileURLToPath(import.meta.url));
|
||||
const repoRoot = path.resolve(desktopDir, "..", "..");
|
||||
const nextBin = path.join(repoRoot, "node_modules", "next", "dist", "bin", "next");
|
||||
const copyOcctScript = path.join(repoRoot, "scripts", "copy-occt-wasm.mjs");
|
||||
const wasmCopyScripts = [
|
||||
path.join(repoRoot, "scripts", "copy-occt-wasm.mjs"),
|
||||
path.join(repoRoot, "scripts", "copy-dwg-wasm.mjs"),
|
||||
path.join(repoRoot, "scripts", "copy-ifc-wasm.mjs"),
|
||||
path.join(repoRoot, "scripts", "copy-planegcs-wasm.mjs"),
|
||||
];
|
||||
const electronMain = path.join(desktopDir, "main.cjs");
|
||||
|
||||
function findFreePort() {
|
||||
@@ -50,14 +55,16 @@ async function waitForUrl(url, child, timeoutMs = 45_000) {
|
||||
throw new Error(`Timed out waiting for SketchForge dev server.${detail}`);
|
||||
}
|
||||
|
||||
const copyResult = spawnSync(process.execPath, [copyOcctScript], {
|
||||
cwd: repoRoot,
|
||||
stdio: "inherit",
|
||||
env: process.env,
|
||||
});
|
||||
for (const scriptPath of wasmCopyScripts) {
|
||||
const copyResult = spawnSync(process.execPath, [scriptPath], {
|
||||
cwd: repoRoot,
|
||||
stdio: "inherit",
|
||||
env: process.env,
|
||||
});
|
||||
|
||||
if (copyResult.status !== 0) {
|
||||
process.exit(copyResult.status ?? 1);
|
||||
if (copyResult.status !== 0) {
|
||||
process.exit(copyResult.status ?? 1);
|
||||
}
|
||||
}
|
||||
|
||||
const port = await findFreePort();
|
||||
|
||||
@@ -1,36 +1,61 @@
|
||||
appId: com.sketchforge.desktop
|
||||
productName: SketchForge
|
||||
appId: com.snapcad.desktop
|
||||
productName: SnapCAD Studio
|
||||
executableName: SnapCAD
|
||||
asar: true
|
||||
npmRebuild: false
|
||||
|
||||
directories:
|
||||
output: dist/desktop
|
||||
|
||||
publish:
|
||||
provider: github
|
||||
owner: Formsmith746
|
||||
repo: SketchForge-3D
|
||||
releaseType: release
|
||||
provider: generic
|
||||
url: https://snap.yakhub.com.tr/updates
|
||||
|
||||
fileAssociations:
|
||||
- ext: skf
|
||||
name: SnapCAD Project
|
||||
description: SnapCAD Studio 3D Parametric CAD Project
|
||||
role: Editor
|
||||
|
||||
files:
|
||||
- apps/desktop/main.cjs
|
||||
- apps/desktop/preload.cjs
|
||||
- package.json
|
||||
- "!node_modules/**/*"
|
||||
- "node_modules/electron-updater/**/*"
|
||||
- "node_modules/builder-util-runtime/**/*"
|
||||
- "node_modules/fs-extra/**/*"
|
||||
- "node_modules/graceful-fs/**/*"
|
||||
- "node_modules/jsonfile/**/*"
|
||||
- "node_modules/universalify/**/*"
|
||||
- "node_modules/js-yaml/**/*"
|
||||
- "node_modules/argparse/**/*"
|
||||
- "node_modules/debug/**/*"
|
||||
- "node_modules/ms/**/*"
|
||||
- "node_modules/lazy-val/**/*"
|
||||
- "node_modules/lodash.escaperegexp/**/*"
|
||||
- "node_modules/lodash.isequal/**/*"
|
||||
- "node_modules/sax/**/*"
|
||||
- "node_modules/semver/**/*"
|
||||
- "node_modules/tiny-typed-emitter/**/*"
|
||||
|
||||
extraResources:
|
||||
- from: apps/web/.next/standalone
|
||||
to: web
|
||||
- from: apps/web/.next/desktop-runtime_modules
|
||||
to: web/runtime_modules
|
||||
- from: apps/web/.next/static
|
||||
to: web/apps/web/.next/static
|
||||
- from: apps/web/public
|
||||
to: web/apps/web/public
|
||||
|
||||
win:
|
||||
icon: apps/web/public/assets/sketchforge/sketchforge-logo.png
|
||||
icon: apps/web/public/assets/sketchforge/sketchforge-logo.ico
|
||||
target:
|
||||
- target: nsis
|
||||
arch:
|
||||
- x64
|
||||
artifactName: ${productName}-Setup-${version}-${arch}.${ext}
|
||||
artifactName: SnapCAD-Setup-${version}-${arch}.${ext}
|
||||
|
||||
nsis:
|
||||
oneClick: false
|
||||
@@ -44,7 +69,7 @@ mac:
|
||||
- dmg
|
||||
- zip
|
||||
category: public.app-category.graphics-design
|
||||
artifactName: ${productName}-${version}-${arch}.${ext}
|
||||
artifactName: SnapCAD-${version}-${arch}.${ext}
|
||||
|
||||
linux:
|
||||
syncDesktopName: true
|
||||
@@ -52,4 +77,4 @@ linux:
|
||||
target:
|
||||
- AppImage
|
||||
category: Graphics
|
||||
artifactName: ${productName}-${version}-${arch}.${ext}
|
||||
artifactName: SnapCAD-${version}-${arch}.${ext}
|
||||
+2085
-83
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,81 @@
|
||||
const { contextBridge, ipcRenderer } = require("electron");
|
||||
|
||||
contextBridge.exposeInMainWorld("sketchforgeDesktop", {
|
||||
function toUint8Array(data) {
|
||||
if (data instanceof Uint8Array) return data;
|
||||
if (data instanceof ArrayBuffer) return new Uint8Array(data);
|
||||
if (ArrayBuffer.isView(data)) {
|
||||
return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
|
||||
}
|
||||
return new Uint8Array(0);
|
||||
}
|
||||
|
||||
function subscribeChannel(channel, transform) {
|
||||
return (listener) => {
|
||||
if (typeof listener !== "function") return () => {};
|
||||
const wrapped = (_event, payload) => {
|
||||
listener(transform ? transform(payload) : payload);
|
||||
};
|
||||
ipcRenderer.on(channel, wrapped);
|
||||
return () => {
|
||||
ipcRenderer.removeListener(channel, wrapped);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
function normalizeOpenedFile(payload) {
|
||||
if (!payload || typeof payload.filePath !== "string" || typeof payload.fileName !== "string") {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
filePath: payload.filePath,
|
||||
fileName: payload.fileName,
|
||||
bytes: toUint8Array(payload.bytes),
|
||||
};
|
||||
}
|
||||
|
||||
const desktopBridge = Object.freeze({
|
||||
isDesktop: true,
|
||||
platform: process.platform,
|
||||
getVersion: () => ipcRenderer.invoke("sketchforge:get-version"),
|
||||
checkForUpdates: () => ipcRenderer.invoke("sketchforge:check-for-updates"),
|
||||
installUpdate: () => ipcRenderer.invoke("sketchforge:install-update"),
|
||||
getUpdateState: () => ipcRenderer.invoke("snapcad:get-update-state"),
|
||||
onUpdateState: subscribeChannel("snapcad:update-state"),
|
||||
getDesktopPrefs: () => ipcRenderer.invoke("snapcad:get-desktop-prefs"),
|
||||
setDesktopPrefs: (patch) =>
|
||||
ipcRenderer.invoke("snapcad:set-desktop-prefs", patch && typeof patch === "object" ? patch : {}),
|
||||
hideToTray: () => ipcRenderer.invoke("snapcad:hide-to-tray"),
|
||||
onDesktopPrefsChanged: subscribeChannel("snapcad:prefs-changed"),
|
||||
startYakNetLogin: () => ipcRenderer.invoke("snapcad:yaknet-login"),
|
||||
logoutYakNet: () => ipcRenderer.invoke("snapcad:yaknet-logout"),
|
||||
cloudRequest: (options) =>
|
||||
ipcRenderer.invoke("snapcad:cloud-request", options && typeof options === "object" ? options : {}),
|
||||
onAuthUpdated: subscribeChannel("snapcad:auth-updated"),
|
||||
openSkfDialog: async () => normalizeOpenedFile(await ipcRenderer.invoke("snapcad:open-skf-dialog")),
|
||||
saveSkfDialog: (options) =>
|
||||
ipcRenderer.invoke("snapcad:save-skf-dialog", {
|
||||
defaultFileName: options?.defaultFileName,
|
||||
targetPath: options?.targetPath ?? null,
|
||||
forceDialog: Boolean(options?.forceDialog),
|
||||
bytes: toUint8Array(options?.bytes),
|
||||
}),
|
||||
saveExportFileDialog: (options) =>
|
||||
ipcRenderer.invoke("snapcad:save-export-dialog", {
|
||||
defaultFileName: options?.defaultFileName,
|
||||
filters: Array.isArray(options?.filters) ? options.filters : undefined,
|
||||
bytes: toUint8Array(options?.bytes),
|
||||
}),
|
||||
consumePendingOpenFile: async () =>
|
||||
normalizeOpenedFile(await ipcRenderer.invoke("snapcad:consume-pending-open-file")),
|
||||
onOpenFile: subscribeChannel("snapcad:open-file", normalizeOpenedFile),
|
||||
onMenuCommand: subscribeChannel("snapcad:menu-command"),
|
||||
setMenuState: (state) =>
|
||||
ipcRenderer.invoke("snapcad:set-menu-state", state && typeof state === "object" ? state : {}),
|
||||
setDirty: (dirty) => ipcRenderer.invoke("snapcad:set-dirty", Boolean(dirty)),
|
||||
setWindowTitle: (title) => ipcRenderer.invoke("snapcad:set-window-title", String(title ?? "")),
|
||||
confirmCloseAfterSave: () => ipcRenderer.invoke("snapcad:confirm-close-after-save"),
|
||||
openExternal: (url) => ipcRenderer.invoke("snapcad:open-external", String(url ?? "")),
|
||||
});
|
||||
|
||||
contextBridge.exposeInMainWorld("snapcadDesktop", desktopBridge);
|
||||
contextBridge.exposeInMainWorld("sketchforgeDesktop", desktopBridge);
|
||||
Reference in New Issue
Block a user