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
Support SKF hashing over HTTP
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import { strFromU8, strToU8, unzipSync, zipSync } from "fflate";
|
||||
import { editorHistoryEntry } from "@/lib/editorHistory";
|
||||
import { projectAssetFromBytes } from "@/lib/projectAssets";
|
||||
@@ -69,6 +69,8 @@ function mutateProject(bytes: Uint8Array, mutate: (document: SkfProjectDocumentV
|
||||
}
|
||||
|
||||
describe("SketchForge .skf project packages", () => {
|
||||
afterEach(() => vi.unstubAllGlobals());
|
||||
|
||||
it("round-trips every supported native shape kind and editable properties", async () => {
|
||||
const nativeKinds: ShapeKind[] = [
|
||||
"box", "cylinder", "sphere", "sketch", "scribble", "cone", "pyramid", "roof", "text", "roundRoof",
|
||||
@@ -194,6 +196,30 @@ describe("SketchForge .skf project packages", () => {
|
||||
expect(importCalls).toBe(1);
|
||||
});
|
||||
|
||||
it("exports and imports source-backed projects without Web Crypto", async () => {
|
||||
const sourceBytes = strToU8("solid http source");
|
||||
const asset = await projectAssetFromBytes("http.stl", "stl", sourceBytes);
|
||||
const importedMesh: NonNullable<WorkplaneShape["importedMesh"]> = {
|
||||
positions: [0, 0, 0, 1, 0, 0, 0, 1, 0],
|
||||
baseWidth: 1,
|
||||
baseDepth: 1,
|
||||
baseHeight: 1,
|
||||
triangleCount: 1,
|
||||
sourceFormat: "stl",
|
||||
assetId: asset.id,
|
||||
};
|
||||
vi.stubGlobal("crypto", {});
|
||||
|
||||
const exported = await exportSkfProject(input([shape("mesh", "http-object", { importedMesh })], { assets: [asset] }));
|
||||
const restored = await importSkfProject(exported, {
|
||||
sourceImporter: async () => ({ ...importedMesh, assetId: undefined }),
|
||||
});
|
||||
|
||||
expect(packageDocument(exported).document.assets[0].sha256).toBe(asset.sha256);
|
||||
expect(restored.assets[0].sha256).toBe(asset.sha256);
|
||||
expect(restored.shapes[0].importedMesh?.assetId).toBe(restored.assets[0].id);
|
||||
});
|
||||
|
||||
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"]> = {
|
||||
|
||||
Reference in New Issue
Block a user