Skip to content

The open-source CapCut alternative

Merge branch 'staging'

Maze Winther7d5914353b8f
diff --cc apps/web/src/services/storage/migrations/v0-to-v1.ts
index 4997f3fa,18e15180..e183ddf2
--- a/apps/web/src/services/storage/migrations/v0-to-v1.ts
+++ b/apps/web/src/services/storage/migrations/v0-to-v1.ts
@@@ -1,16 -1,6 +1,12 @@@
+/*
+ * Ensures every project has at least one scene
+ * Adds a default "Main scene" if none exist
+ * Sets currentSceneId to the new scene's id
+ */
+
import { IndexedDBAdapter } from "@/services/storage/indexeddb-adapter";
- import type { SerializedScene } from "@/services/storage/types";
- import { buildDefaultScene } from "@/lib/scenes";
- import type { TScene } from "@/types/timeline";
import { StorageMigration } from "./base";
-
- type ProjectRecord = Record<string, unknown>;
+ import { getProjectId, transformProjectV0ToV1 } from "./transformers/v0-to-v1";
export class V0toV1Migration extends StorageMigration {
from = 0;
diff --cc apps/web/src/services/storage/migrations/v1-to-v2.ts
index b108f507,7519c6ac..a4e1f20b
--- a/apps/web/src/services/storage/migrations/v1-to-v2.ts
+++ b/apps/web/src/services/storage/migrations/v1-to-v2.ts
@@@ -1,17 -1,6 +1,10 @@@
+/*
+ * Adds default values for new project properties introduced in v2
+ */
+
- import {
- DEFAULT_BLUR_INTENSITY,
- DEFAULT_CANVAS_SIZE,
- DEFAULT_COLOR,
- DEFAULT_FPS,
- } from "@/constants/project-constants";
import { IndexedDBAdapter } from "@/services/storage/indexeddb-adapter";
import { StorageMigration } from "./base";
-
- type ProjectRecord = Record<string, unknown>;
+ import { getProjectId, transformProjectV1ToV2 } from "./transformers/v1-to-v2";
export class V1toV2Migration extends StorageMigration {
from = 1;
diff --cc apps/web/src/services/storage/migrations/v2-to-v3.ts
index 7869812c,100dc572..7c52f79d
--- a/apps/web/src/services/storage/migrations/v2-to-v3.ts
+++ b/apps/web/src/services/storage/migrations/v2-to-v3.ts
@@@ -1,12 -1,6 +1,10 @@@
+/*
- * Adds a "duration" field to each project's metadata,
++ * Adds a "duration" field to each project's metadata
+ */
- import { getProjectDurationFromScenes } from "@/lib/scenes";
++
import { IndexedDBAdapter } from "@/services/storage/indexeddb-adapter";
- import type { TScene } from "@/types/timeline";
import { StorageMigration } from "./base";
-
- type ProjectRecord = Record<string, unknown>;
+ import { getProjectId, transformProjectV2ToV3 } from "./transformers/v2-to-v3";
export class V2toV3Migration extends StorageMigration {
from = 2;