@abelxiaoxing/cadence 1.2.1 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,7 +20,6 @@ import { isValidRelativePath } from "./contracts.ts";
20
20
  import { observeSafePath } from "./safe-path.ts";
21
21
 
22
22
  const SHA256 = /^[a-f0-9]{64}$/u;
23
- const REVISION_VERSION = 2 as const;
24
23
 
25
24
  export interface WorkspaceFileEntry {
26
25
  kind: "file";
@@ -37,7 +36,6 @@ export type WorkspaceEntry = WorkspaceFileEntry | WorkspaceAbsentEntry;
37
36
  export type WorkspaceEntries = Record<string, WorkspaceEntry>;
38
37
 
39
38
  export interface WorkspaceRevision {
40
- version: typeof REVISION_VERSION;
41
39
  revisionId: string;
42
40
  parentRevisionId: string | null;
43
41
  manifestHash: string;
@@ -89,17 +87,13 @@ function stableEntries(entries: WorkspaceEntries): WorkspaceEntries {
89
87
 
90
88
  function manifestHash(entries: WorkspaceEntries): string {
91
89
  return hash(
92
- "cadence-workspace-manifest-v2",
90
+ "cadence-workspace-manifest",
93
91
  JSON.stringify(stableEntries(entries)),
94
92
  );
95
93
  }
96
94
 
97
95
  function revisionId(parentRevisionId: string | null, manifest: string): string {
98
- return hash(
99
- "cadence-workspace-revision-v2",
100
- parentRevisionId ?? "",
101
- manifest,
102
- );
96
+ return hash("cadence-workspace-revision", parentRevisionId ?? "", manifest);
103
97
  }
104
98
 
105
99
  function ensureDirectory(directory: string): void {
@@ -219,7 +213,6 @@ function requireRevisionShape(value: unknown): WorkspaceRevision {
219
213
  }
220
214
  const candidate = value as Partial<WorkspaceRevision>;
221
215
  if (
222
- candidate.version !== REVISION_VERSION ||
223
216
  typeof candidate.revisionId !== "string" ||
224
217
  !SHA256.test(candidate.revisionId) ||
225
218
  (candidate.parentRevisionId !== null &&
@@ -287,7 +280,6 @@ export class WorkspaceStore {
287
280
  const manifest = manifestHash(entries);
288
281
  const id = revisionId(parentRevisionId, manifest);
289
282
  const revision: WorkspaceRevision = {
290
- version: REVISION_VERSION,
291
283
  revisionId: id,
292
284
  parentRevisionId,
293
285
  manifestHash: manifest,