Skip to content

Commit d3ca7fa

Browse files
author
Eva
committed
fix(workspaces): preserve private schema version constant
1 parent b2755da commit d3ca7fa

3 files changed

Lines changed: 6 additions & 11 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
24321facfa37c6c1f638742b5dfb72580c507f1162f407dafc812f4a2256b882 plugin-sdk-api-baseline.json
2-
8de0df0692c8141b4e942b1adac3ae3929beb078957c74ac89de13561d592302 plugin-sdk-api-baseline.jsonl
1+
4c6b07c0d8967bd07adc20d7c8d3e97a79cbf1bb0c0a495076a5f8b214b80688 plugin-sdk-api-baseline.json
2+
d0258a97a26d139b3dfb638237e75afacab1e125eada454c42f1fc538e3bd6f1 plugin-sdk-api-baseline.jsonl

extensions/workspaces/src/schema.test.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
import { describe, expect, it } from "vitest";
22
import { DEFAULT_WORKSPACE } from "./default-workspace.js";
3-
import {
4-
CURRENT_WORKSPACE_SCHEMA_VERSION,
5-
migrateWorkspaceDoc,
6-
validateWorkspaceDoc,
7-
type WorkspaceDoc,
8-
} from "./schema.js";
3+
import { migrateWorkspaceDoc, validateWorkspaceDoc, type WorkspaceDoc } from "./schema.js";
94

105
function validDoc(): WorkspaceDoc {
116
return structuredClone(DEFAULT_WORKSPACE);
@@ -25,7 +20,7 @@ describe("Workspaces document schema", () => {
2520

2621
it("requires stable workspace and tab resource ids in the canonical schema", () => {
2722
expect(validDoc()).toMatchObject({
28-
schemaVersion: CURRENT_WORKSPACE_SCHEMA_VERSION,
23+
schemaVersion: 2,
2924
workspaceId: "default",
3025
tabs: [expect.objectContaining({ id: "main", slug: "main", revision: 1 })],
3126
});
@@ -64,7 +59,7 @@ describe("Workspaces document schema", () => {
6459

6560
expect(migrated.changed).toBe(true);
6661
expect(migrated.doc).toMatchObject({
67-
schemaVersion: CURRENT_WORKSPACE_SCHEMA_VERSION,
62+
schemaVersion: 2,
6863
workspaceId: "default",
6964
tabs: [{ id: "main", slug: "main", revision: 1 }],
7065
});

extensions/workspaces/src/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export type WorkspaceDoc = {
6060
prefs: { tabOrder: string[] };
6161
};
6262

63-
export const CURRENT_WORKSPACE_SCHEMA_VERSION = 2;
63+
const CURRENT_WORKSPACE_SCHEMA_VERSION = 2;
6464
export const DEFAULT_WORKSPACE_ID = "default";
6565

6666
const TAB_SLUG_PATTERN = /^[a-z0-9-]{1,40}$/;

0 commit comments

Comments
 (0)