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: SketchForge 1.0.7
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
importSkfProject,
|
||||
inspectSkfProjectPackage,
|
||||
SKF_FORMAT_VERSION,
|
||||
SKF_LIMITS,
|
||||
SKF_SCHEMA_ID,
|
||||
type SkfProjectDocumentV1,
|
||||
type SkfProjectExportInput,
|
||||
@@ -330,6 +331,28 @@ describe("SketchForge .skf project packages", () => {
|
||||
expect(restored.shapes[0].importedMesh?.assetId).toBe(restored.assets[0].id);
|
||||
});
|
||||
|
||||
it("shares decoded derived-mesh arrays across restored history states", async () => {
|
||||
const importedMesh: NonNullable<WorkplaneShape["importedMesh"]> = {
|
||||
positions: [0, 0, 0, 1, 0, 0, 0, 1, 0],
|
||||
normals: [0, 0, 1, 0, 0, 1, 0, 0, 1],
|
||||
baseWidth: 1,
|
||||
baseDepth: 1,
|
||||
baseHeight: 1,
|
||||
triangleCount: 1,
|
||||
sourceFormat: "json",
|
||||
};
|
||||
const before = shape("mesh", "derived-history", { importedMesh, x: 0 });
|
||||
const after = { ...before, x: 20 };
|
||||
const history = [editorHistoryEntry([before], []), editorHistoryEntry([after], [after.id])];
|
||||
|
||||
const restored = await importSkfProject(await exportSkfProject(input([after], { history, historyIndex: 1 })));
|
||||
const firstPositions = restored.history[0].shapes[0].importedMesh?.positions;
|
||||
const secondPositions = restored.history[1].shapes[0].importedMesh?.positions;
|
||||
|
||||
expect(firstPositions).toBe(secondPositions);
|
||||
expect(restored.shapes[0].importedMesh?.positions).toBe(secondPositions);
|
||||
});
|
||||
|
||||
it.each(["svg", "step"] as const)("stores and restores original %s sources", async (sourceFormat) => {
|
||||
const asset = await projectAssetFromBytes(`source.${sourceFormat}`, sourceFormat, strToU8(`${sourceFormat} source`));
|
||||
const importedMesh: NonNullable<WorkplaneShape["importedMesh"]> = {
|
||||
@@ -429,6 +452,22 @@ describe("SketchForge .skf project packages", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("writes compact project data that stays compatible with the reader limit", async () => {
|
||||
const exported = await exportSkfProject(input([shape("box")]));
|
||||
const { files, document } = packageDocument(exported);
|
||||
const projectJson = strFromU8(files["project.json"]);
|
||||
|
||||
expect(projectJson).toBe(JSON.stringify(document));
|
||||
await expect(importSkfProject(exported)).resolves.toMatchObject({ projectName: "Round trip" });
|
||||
});
|
||||
|
||||
it("refuses to create an .skf package that its reader cannot reopen", async () => {
|
||||
const oversizedName = "x".repeat(SKF_LIMITS.projectJsonBytes);
|
||||
|
||||
await expect(exportSkfProject(input([shape("box")], { projectName: oversizedName })))
|
||||
.rejects.toThrow("Project data exceeds the 64 MB .skf limit");
|
||||
});
|
||||
|
||||
it("migrates the documented v0 JSON project without changing IDs", async () => {
|
||||
const box = shape("box", "legacy-box");
|
||||
const legacy = strToU8(JSON.stringify({
|
||||
|
||||
Reference in New Issue
Block a user