@dxos/migrations 0.8.3 → 0.8.4-main.1068cf700f
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.
- package/README.md +2 -2
- package/dist/lib/browser/index.mjs +88 -50
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +88 -50
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/migration-builder.d.ts +4 -4
- package/dist/types/src/migration-builder.d.ts.map +1 -1
- package/dist/types/src/migrations.d.ts +2 -1
- package/dist/types/src/migrations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +19 -13
- package/src/migration-builder.ts +33 -32
- package/src/migrations.test.ts +25 -17
- package/src/migrations.ts +14 -6
- package/dist/lib/node/index.cjs +0 -290
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
|
|
3
|
-
//
|
|
4
|
-
import { next as
|
|
3
|
+
// src/migration-builder.ts
|
|
4
|
+
import { next as A } from "@automerge/automerge";
|
|
5
5
|
import { CreateEpochRequest } from "@dxos/client/halo";
|
|
6
|
+
import { getSchemaDXN } from "@dxos/echo/internal";
|
|
6
7
|
import { ObjectCore, migrateDocument } from "@dxos/echo-db";
|
|
7
|
-
import {
|
|
8
|
-
import { requireTypeReference } from "@dxos/echo-schema";
|
|
8
|
+
import { EncodedReference, SpaceDocVersion } from "@dxos/echo-protocol";
|
|
9
9
|
import { invariant } from "@dxos/invariant";
|
|
10
|
-
|
|
10
|
+
import { DXN } from "@dxos/keys";
|
|
11
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/sdk/migrations/src/migration-builder.ts";
|
|
11
12
|
var MigrationBuilder = class {
|
|
13
|
+
_space;
|
|
14
|
+
_repo;
|
|
15
|
+
_rootDoc;
|
|
16
|
+
// echoId -> automergeUrl
|
|
17
|
+
_newLinks = {};
|
|
18
|
+
_flushIds = [];
|
|
19
|
+
_deleteObjects = [];
|
|
20
|
+
_newRoot = void 0;
|
|
12
21
|
constructor(_space) {
|
|
13
22
|
this._space = _space;
|
|
14
|
-
this.
|
|
15
|
-
this.
|
|
16
|
-
this._deleteObjects = [];
|
|
17
|
-
this._newRoot = void 0;
|
|
18
|
-
this._repo = this._space.db.coreDatabase._repo;
|
|
19
|
-
this._rootDoc = this._space.db.coreDatabase._automergeDocLoader.getSpaceRootDocHandle().doc();
|
|
23
|
+
this._repo = this._space.internal.db.coreDatabase._repo;
|
|
24
|
+
this._rootDoc = this._space.internal.db.coreDatabase._automergeDocLoader.getSpaceRootDocHandle().doc();
|
|
20
25
|
}
|
|
21
26
|
async findObject(id) {
|
|
22
27
|
const documentId = (this._rootDoc.links?.[id] || this._newLinks[id])?.toString();
|
|
@@ -37,7 +42,7 @@ var MigrationBuilder = class {
|
|
|
37
42
|
const oldHandle = await this._findObjectContainingHandle(id);
|
|
38
43
|
invariant(oldHandle, void 0, {
|
|
39
44
|
F: __dxlog_file,
|
|
40
|
-
L:
|
|
45
|
+
L: 79,
|
|
41
46
|
S: this,
|
|
42
47
|
A: [
|
|
43
48
|
"oldHandle",
|
|
@@ -52,7 +57,7 @@ var MigrationBuilder = class {
|
|
|
52
57
|
objects: {
|
|
53
58
|
[id]: {
|
|
54
59
|
system: {
|
|
55
|
-
type:
|
|
60
|
+
type: EncodedReference.fromDXN(getSchemaDXN(schema))
|
|
56
61
|
},
|
|
57
62
|
data: props,
|
|
58
63
|
meta: {
|
|
@@ -62,30 +67,40 @@ var MigrationBuilder = class {
|
|
|
62
67
|
}
|
|
63
68
|
};
|
|
64
69
|
const migratedDoc = migrateDocument(oldHandle.doc(), newState);
|
|
65
|
-
const newHandle = this._repo.import(
|
|
70
|
+
const newHandle = this._repo.import(A.save(migratedDoc));
|
|
71
|
+
await newHandle.whenReady();
|
|
72
|
+
invariant(newHandle.url, "Migrated document URL not available after whenReady", {
|
|
73
|
+
F: __dxlog_file,
|
|
74
|
+
L: 101,
|
|
75
|
+
S: this,
|
|
76
|
+
A: [
|
|
77
|
+
"newHandle.url",
|
|
78
|
+
"'Migrated document URL not available after whenReady'"
|
|
79
|
+
]
|
|
80
|
+
});
|
|
66
81
|
this._newLinks[id] = newHandle.url;
|
|
67
|
-
this._addHandleToFlushList(newHandle);
|
|
82
|
+
this._addHandleToFlushList(newHandle.documentId);
|
|
68
83
|
}
|
|
69
84
|
async addObject(schema, props) {
|
|
70
|
-
const core = this._createObject({
|
|
85
|
+
const core = await this._createObject({
|
|
71
86
|
schema,
|
|
72
87
|
props
|
|
73
88
|
});
|
|
74
89
|
return core.id;
|
|
75
90
|
}
|
|
76
91
|
createReference(id) {
|
|
77
|
-
return
|
|
92
|
+
return EncodedReference.fromDXN(DXN.fromLocalObjectId(id));
|
|
78
93
|
}
|
|
79
94
|
deleteObject(id) {
|
|
80
95
|
this._deleteObjects.push(id);
|
|
81
96
|
}
|
|
82
|
-
changeProperties(changeFn) {
|
|
97
|
+
async changeProperties(changeFn) {
|
|
83
98
|
if (!this._newRoot) {
|
|
84
|
-
this._buildNewRoot();
|
|
99
|
+
await this._buildNewRoot();
|
|
85
100
|
}
|
|
86
101
|
invariant(this._newRoot, "New root not created", {
|
|
87
102
|
F: __dxlog_file,
|
|
88
|
-
L:
|
|
103
|
+
L: 123,
|
|
89
104
|
S: this,
|
|
90
105
|
A: [
|
|
91
106
|
"this._newRoot",
|
|
@@ -96,18 +111,19 @@ var MigrationBuilder = class {
|
|
|
96
111
|
const propertiesStructure = doc.objects?.[this._space.properties.id];
|
|
97
112
|
propertiesStructure && changeFn(propertiesStructure);
|
|
98
113
|
});
|
|
99
|
-
this.
|
|
114
|
+
await this._newRoot.whenReady();
|
|
115
|
+
this._addHandleToFlushList(this._newRoot.documentId);
|
|
100
116
|
}
|
|
101
117
|
/**
|
|
102
118
|
* @internal
|
|
103
119
|
*/
|
|
104
120
|
async _commit() {
|
|
105
121
|
if (!this._newRoot) {
|
|
106
|
-
this._buildNewRoot();
|
|
122
|
+
await this._buildNewRoot();
|
|
107
123
|
}
|
|
108
124
|
invariant(this._newRoot, "New root not created", {
|
|
109
125
|
F: __dxlog_file,
|
|
110
|
-
L:
|
|
126
|
+
L: 140,
|
|
111
127
|
S: this,
|
|
112
128
|
A: [
|
|
113
129
|
"this._newRoot",
|
|
@@ -115,6 +131,15 @@ var MigrationBuilder = class {
|
|
|
115
131
|
]
|
|
116
132
|
});
|
|
117
133
|
await this._space.db.flush();
|
|
134
|
+
invariant(this._newRoot.url, "New root URL not available", {
|
|
135
|
+
F: __dxlog_file,
|
|
136
|
+
L: 145,
|
|
137
|
+
S: this,
|
|
138
|
+
A: [
|
|
139
|
+
"this._newRoot.url",
|
|
140
|
+
"'New root URL not available'"
|
|
141
|
+
]
|
|
142
|
+
});
|
|
118
143
|
await this._space.internal.createEpoch({
|
|
119
144
|
migration: CreateEpochRequest.Migration.REPLACE_AUTOMERGE_ROOT,
|
|
120
145
|
automergeRootUrl: this._newRoot.url
|
|
@@ -129,7 +154,7 @@ var MigrationBuilder = class {
|
|
|
129
154
|
await docHandle.whenReady();
|
|
130
155
|
return docHandle;
|
|
131
156
|
}
|
|
132
|
-
_buildNewRoot() {
|
|
157
|
+
async _buildNewRoot() {
|
|
133
158
|
const links = {
|
|
134
159
|
...this._rootDoc.links ?? {}
|
|
135
160
|
};
|
|
@@ -137,7 +162,7 @@ var MigrationBuilder = class {
|
|
|
137
162
|
delete links[id];
|
|
138
163
|
}
|
|
139
164
|
for (const [id, url] of Object.entries(this._newLinks)) {
|
|
140
|
-
links[id] = new
|
|
165
|
+
links[id] = new A.RawString(url);
|
|
141
166
|
}
|
|
142
167
|
this._newRoot = this._repo.create({
|
|
143
168
|
version: SpaceDocVersion.CURRENT,
|
|
@@ -147,15 +172,16 @@ var MigrationBuilder = class {
|
|
|
147
172
|
objects: this._rootDoc.objects,
|
|
148
173
|
links
|
|
149
174
|
});
|
|
150
|
-
this.
|
|
175
|
+
await this._newRoot.whenReady();
|
|
176
|
+
this._addHandleToFlushList(this._newRoot.documentId);
|
|
151
177
|
}
|
|
152
|
-
_createObject({ id, schema, props }) {
|
|
178
|
+
async _createObject({ id, schema, props }) {
|
|
153
179
|
const core = new ObjectCore();
|
|
154
180
|
if (id) {
|
|
155
181
|
core.id = id;
|
|
156
182
|
}
|
|
157
183
|
core.initNewObject(props);
|
|
158
|
-
core.setType(
|
|
184
|
+
core.setType(EncodedReference.fromDXN(getSchemaDXN(schema)));
|
|
159
185
|
const newHandle = this._repo.create({
|
|
160
186
|
version: SpaceDocVersion.CURRENT,
|
|
161
187
|
access: {
|
|
@@ -165,28 +191,29 @@ var MigrationBuilder = class {
|
|
|
165
191
|
[core.id]: core.getDoc()
|
|
166
192
|
}
|
|
167
193
|
});
|
|
194
|
+
await newHandle.whenReady();
|
|
168
195
|
this._newLinks[core.id] = newHandle.url;
|
|
169
|
-
this._addHandleToFlushList(newHandle);
|
|
196
|
+
this._addHandleToFlushList(newHandle.documentId);
|
|
170
197
|
return core;
|
|
171
198
|
}
|
|
172
|
-
_addHandleToFlushList(
|
|
173
|
-
this._flushIds.push(
|
|
199
|
+
_addHandleToFlushList(id) {
|
|
200
|
+
this._flushIds.push(id);
|
|
174
201
|
}
|
|
175
202
|
};
|
|
176
203
|
|
|
177
|
-
//
|
|
178
|
-
import {
|
|
204
|
+
// src/migrations.ts
|
|
205
|
+
import { Atom } from "@effect-atom/atom";
|
|
206
|
+
import * as Registry from "@effect-atom/atom/Registry";
|
|
207
|
+
import { SpaceState } from "@dxos/client/echo";
|
|
179
208
|
import { invariant as invariant2 } from "@dxos/invariant";
|
|
180
|
-
var __dxlog_file2 = "/
|
|
209
|
+
var __dxlog_file2 = "/__w/dxos/dxos/packages/sdk/migrations/src/migrations.ts";
|
|
181
210
|
var Migrations = class {
|
|
182
|
-
static
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
static {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
});
|
|
189
|
-
}
|
|
211
|
+
static namespace;
|
|
212
|
+
static migrations = [];
|
|
213
|
+
static _registry = Registry.make();
|
|
214
|
+
static _stateAtom = Atom.make({
|
|
215
|
+
running: []
|
|
216
|
+
}).pipe(Atom.keepAlive);
|
|
190
217
|
static get versionProperty() {
|
|
191
218
|
return this.namespace && `${this.namespace}.version`;
|
|
192
219
|
}
|
|
@@ -194,7 +221,8 @@ var Migrations = class {
|
|
|
194
221
|
return this.migrations[this.migrations.length - 1]?.version;
|
|
195
222
|
}
|
|
196
223
|
static running(space) {
|
|
197
|
-
|
|
224
|
+
const state = this._registry.get(this._stateAtom);
|
|
225
|
+
return state.running.includes(space.key.toHex());
|
|
198
226
|
}
|
|
199
227
|
static define(namespace, migrations) {
|
|
200
228
|
this.namespace = namespace;
|
|
@@ -203,7 +231,7 @@ var Migrations = class {
|
|
|
203
231
|
static async migrate(space, targetVersion) {
|
|
204
232
|
invariant2(!this.running(space), "Migration already running", {
|
|
205
233
|
F: __dxlog_file2,
|
|
206
|
-
L:
|
|
234
|
+
L: 49,
|
|
207
235
|
S: this,
|
|
208
236
|
A: [
|
|
209
237
|
"!this.running(space)",
|
|
@@ -212,7 +240,7 @@ var Migrations = class {
|
|
|
212
240
|
});
|
|
213
241
|
invariant2(this.versionProperty, "Migrations namespace not set", {
|
|
214
242
|
F: __dxlog_file2,
|
|
215
|
-
L:
|
|
243
|
+
L: 50,
|
|
216
244
|
S: this,
|
|
217
245
|
A: [
|
|
218
246
|
"this.versionProperty",
|
|
@@ -221,7 +249,7 @@ var Migrations = class {
|
|
|
221
249
|
});
|
|
222
250
|
invariant2(space.state.get() === SpaceState.SPACE_READY, "Space not ready", {
|
|
223
251
|
F: __dxlog_file2,
|
|
224
|
-
L:
|
|
252
|
+
L: 51,
|
|
225
253
|
S: this,
|
|
226
254
|
A: [
|
|
227
255
|
"space.state.get() === SpaceState.SPACE_READY",
|
|
@@ -235,7 +263,14 @@ var Migrations = class {
|
|
|
235
263
|
if (currentIndex === targetIndex) {
|
|
236
264
|
return false;
|
|
237
265
|
}
|
|
238
|
-
|
|
266
|
+
const spaceKey = space.key.toHex();
|
|
267
|
+
const currentState = this._registry.get(this._stateAtom);
|
|
268
|
+
this._registry.set(this._stateAtom, {
|
|
269
|
+
running: [
|
|
270
|
+
...currentState.running,
|
|
271
|
+
spaceKey
|
|
272
|
+
]
|
|
273
|
+
});
|
|
239
274
|
if (targetIndex > currentIndex) {
|
|
240
275
|
const migrations = this.migrations.slice(currentIndex, targetIndex);
|
|
241
276
|
for (const migration of migrations) {
|
|
@@ -244,10 +279,10 @@ var Migrations = class {
|
|
|
244
279
|
space,
|
|
245
280
|
builder
|
|
246
281
|
});
|
|
247
|
-
builder.changeProperties((propertiesStructure) => {
|
|
282
|
+
await builder.changeProperties((propertiesStructure) => {
|
|
248
283
|
invariant2(this.versionProperty, "Migrations namespace not set", {
|
|
249
284
|
F: __dxlog_file2,
|
|
250
|
-
L:
|
|
285
|
+
L: 69,
|
|
251
286
|
S: this,
|
|
252
287
|
A: [
|
|
253
288
|
"this.versionProperty",
|
|
@@ -259,7 +294,10 @@ var Migrations = class {
|
|
|
259
294
|
await builder._commit();
|
|
260
295
|
}
|
|
261
296
|
}
|
|
262
|
-
this.
|
|
297
|
+
const finalState = this._registry.get(this._stateAtom);
|
|
298
|
+
this._registry.set(this._stateAtom, {
|
|
299
|
+
running: finalState.running.filter((key) => key !== spaceKey)
|
|
300
|
+
});
|
|
263
301
|
return true;
|
|
264
302
|
}
|
|
265
303
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/migration-builder.ts", "../../../src/migrations.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { next as
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,QAAQC,
|
|
6
|
-
"names": ["next", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { next as A, type Doc } from '@automerge/automerge';\nimport { type AnyDocumentId, type DocumentId } from '@automerge/automerge-repo';\nimport type * as Schema from 'effect/Schema';\n\nimport { type Space } from '@dxos/client/echo';\nimport { CreateEpochRequest } from '@dxos/client/halo';\nimport { getSchemaDXN } from '@dxos/echo/internal';\nimport { type DocHandleProxy, ObjectCore, type RepoProxy, migrateDocument } from '@dxos/echo-db';\nimport { type DatabaseDirectory, EncodedReference, type ObjectStructure, SpaceDocVersion } from '@dxos/echo-protocol';\nimport { invariant } from '@dxos/invariant';\nimport { DXN } from '@dxos/keys';\nimport { type MaybePromise } from '@dxos/util';\n\n/*\n\nConsidering a better API for this:\n\n```ts\nconst migration = space.db.beginMigration(); // all actions are not visible to queries and are only applied once you call `apply`\n\nmigration.applyObjectMigration(defineMigration(From, To, { ... }));\n\nmigration.delete(id);\nmigration.add(obj);\n\nawait migration.apply(); // Will create new epoch.\n```\n\n*/\n\n// TODO(dmaretskyi): We no longer need to hook into ECHO internals, with the changes to echo APIs.\nexport class MigrationBuilder {\n private readonly _repo: RepoProxy;\n private readonly _rootDoc: Doc<DatabaseDirectory>;\n\n // echoId -> automergeUrl\n private readonly _newLinks: Record<string, string> = {};\n private readonly _flushIds: DocumentId[] = [];\n private readonly _deleteObjects: string[] = [];\n\n private _newRoot?: DocHandleProxy<DatabaseDirectory> = undefined;\n\n constructor(private readonly _space: Space) {\n this._repo = this._space.internal.db.coreDatabase._repo;\n // TODO(wittjosiah): Accessing private API.\n this._rootDoc = (this._space.internal.db.coreDatabase as any)._automergeDocLoader\n .getSpaceRootDocHandle()\n .doc() as Doc<DatabaseDirectory>;\n }\n\n async findObject(id: string): Promise<ObjectStructure | undefined> {\n const documentId = (this._rootDoc.links?.[id] || this._newLinks[id])?.toString() as AnyDocumentId | undefined;\n const docHandle = documentId && this._repo.find(documentId);\n if (!docHandle) {\n return undefined;\n }\n\n await docHandle.whenReady();\n const doc = docHandle.doc() as Doc<DatabaseDirectory>;\n return doc.objects?.[id];\n }\n\n async migrateObject(\n id: string,\n migrate: (objectStructure: ObjectStructure) => MaybePromise<{ schema: Schema.Schema.AnyNoContext; props: any }>,\n ): Promise<void> {\n const objectStructure = await this.findObject(id);\n if (!objectStructure) {\n return;\n }\n\n const { schema, props } = await migrate(objectStructure);\n\n const oldHandle = await this._findObjectContainingHandle(id);\n invariant(oldHandle);\n\n const newState: DatabaseDirectory = {\n version: SpaceDocVersion.CURRENT,\n access: {\n spaceKey: this._space.key.toHex(),\n },\n objects: {\n [id]: {\n system: {\n type: EncodedReference.fromDXN(getSchemaDXN(schema)!),\n },\n data: props,\n meta: {\n keys: [],\n },\n },\n },\n };\n const migratedDoc = migrateDocument(oldHandle.doc() as Doc<DatabaseDirectory>, newState);\n const newHandle = this._repo.import<DatabaseDirectory>(A.save(migratedDoc));\n await newHandle.whenReady();\n invariant(newHandle.url, 'Migrated document URL not available after whenReady');\n this._newLinks[id] = newHandle.url;\n this._addHandleToFlushList(newHandle.documentId!);\n }\n\n async addObject(schema: Schema.Schema.AnyNoContext, props: any): Promise<string> {\n const core = await this._createObject({ schema, props });\n return core.id;\n }\n\n createReference(id: string) {\n return EncodedReference.fromDXN(DXN.fromLocalObjectId(id));\n }\n\n deleteObject(id: string): void {\n this._deleteObjects.push(id);\n }\n\n async changeProperties(changeFn: (properties: ObjectStructure) => void): Promise<void> {\n if (!this._newRoot) {\n await this._buildNewRoot();\n }\n invariant(this._newRoot, 'New root not created');\n\n this._newRoot.change((doc: DatabaseDirectory) => {\n const propertiesStructure = doc.objects?.[this._space.properties.id];\n propertiesStructure && changeFn(propertiesStructure);\n });\n await this._newRoot.whenReady();\n this._addHandleToFlushList(this._newRoot.documentId!);\n }\n\n /**\n * @internal\n */\n async _commit(): Promise<void> {\n if (!this._newRoot) {\n await this._buildNewRoot();\n }\n invariant(this._newRoot, 'New root not created');\n\n await this._space.db.flush();\n\n // Create new epoch.\n invariant(this._newRoot.url, 'New root URL not available');\n await this._space.internal.createEpoch({\n migration: CreateEpochRequest.Migration.REPLACE_AUTOMERGE_ROOT,\n automergeRootUrl: this._newRoot.url,\n });\n }\n\n private async _findObjectContainingHandle(id: string): Promise<DocHandleProxy<DatabaseDirectory> | undefined> {\n const documentId = (this._rootDoc.links?.[id] || this._newLinks[id])?.toString() as AnyDocumentId | undefined;\n const docHandle = documentId && this._repo.find(documentId);\n if (!docHandle) {\n return undefined;\n }\n\n await docHandle.whenReady();\n return docHandle;\n }\n\n private async _buildNewRoot(): Promise<void> {\n const links = { ...(this._rootDoc.links ?? {}) };\n for (const id of this._deleteObjects) {\n delete links[id];\n }\n\n for (const [id, url] of Object.entries(this._newLinks)) {\n links[id] = new A.RawString(url);\n }\n\n this._newRoot = this._repo.create<DatabaseDirectory>({\n version: SpaceDocVersion.CURRENT,\n access: {\n spaceKey: this._space.key.toHex(),\n },\n objects: this._rootDoc.objects,\n links,\n });\n await this._newRoot.whenReady();\n this._addHandleToFlushList(this._newRoot.documentId!);\n }\n\n private async _createObject({\n id,\n schema,\n props,\n }: {\n id?: string;\n schema: Schema.Schema.AnyNoContext;\n props: any;\n }): Promise<ObjectCore> {\n const core = new ObjectCore();\n if (id) {\n core.id = id;\n }\n\n core.initNewObject(props);\n core.setType(EncodedReference.fromDXN(getSchemaDXN(schema)!));\n const newHandle = this._repo.create<DatabaseDirectory>({\n version: SpaceDocVersion.CURRENT,\n access: {\n spaceKey: this._space.key.toHex(),\n },\n objects: {\n [core.id]: core.getDoc() as ObjectStructure,\n },\n });\n await newHandle.whenReady();\n this._newLinks[core.id] = newHandle.url!;\n this._addHandleToFlushList(newHandle.documentId!);\n\n return core;\n }\n\n private _addHandleToFlushList(id: DocumentId): void {\n this._flushIds.push(id);\n }\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Atom } from '@effect-atom/atom';\nimport * as Registry from '@effect-atom/atom/Registry';\n\nimport { type Space, SpaceState } from '@dxos/client/echo';\nimport { invariant } from '@dxos/invariant';\nimport { type MaybePromise } from '@dxos/util';\n\nimport { MigrationBuilder } from './migration-builder';\n\nexport type MigrationContext = {\n space: Space;\n builder: MigrationBuilder;\n};\n\nexport type Migration = {\n version: string;\n next: (context: MigrationContext) => MaybePromise<void>;\n};\n\nexport class Migrations {\n static namespace?: string;\n static migrations: Migration[] = [];\n private static _registry = Registry.make();\n private static _stateAtom = Atom.make<{ running: string[] }>({ running: [] }).pipe(Atom.keepAlive);\n\n static get versionProperty() {\n return this.namespace && `${this.namespace}.version`;\n }\n\n static get targetVersion() {\n return this.migrations[this.migrations.length - 1]?.version;\n }\n\n static running(space: Space): boolean {\n const state = this._registry.get(this._stateAtom);\n return state.running.includes(space.key.toHex());\n }\n\n static define(namespace: string, migrations: Migration[]): void {\n this.namespace = namespace;\n this.migrations = migrations;\n }\n\n static async migrate(space: Space, targetVersion?: string | number): Promise<boolean> {\n invariant(!this.running(space), 'Migration already running');\n invariant(this.versionProperty, 'Migrations namespace not set');\n invariant(space.state.get() === SpaceState.SPACE_READY, 'Space not ready');\n const currentVersion = space.properties[this.versionProperty];\n const currentIndex = this.migrations.findIndex((m) => m.version === currentVersion) + 1;\n const i = this.migrations.findIndex((m) => m.version === targetVersion);\n const targetIndex = i === -1 ? this.migrations.length : i + 1;\n if (currentIndex === targetIndex) {\n return false;\n }\n\n const spaceKey = space.key.toHex();\n const currentState = this._registry.get(this._stateAtom);\n this._registry.set(this._stateAtom, { running: [...currentState.running, spaceKey] });\n if (targetIndex > currentIndex) {\n const migrations = this.migrations.slice(currentIndex, targetIndex);\n for (const migration of migrations) {\n const builder = new MigrationBuilder(space);\n await migration.next({ space, builder });\n await builder.changeProperties((propertiesStructure) => {\n invariant(this.versionProperty, 'Migrations namespace not set');\n propertiesStructure.data[this.versionProperty] = migration.version;\n });\n await builder._commit();\n }\n }\n const finalState = this._registry.get(this._stateAtom);\n this._registry.set(this._stateAtom, { running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AAKzC,UAAUa,IAAI,KAAKX,UAAU;AACrD,SAAKF,UAAU+B,IAAI,KAAK7B,YAAY;MAAEE,SAASqC,WAAWrC,QAAQsC,OAAO,CAAC3B,QAAQA,QAAQc,QAAAA;IAAU,CAAA;AAEpG,WAAO;EACT;AACF;",
|
|
6
|
+
"names": ["next", "A", "CreateEpochRequest", "getSchemaDXN", "ObjectCore", "migrateDocument", "EncodedReference", "SpaceDocVersion", "invariant", "DXN", "MigrationBuilder", "_repo", "_rootDoc", "_newLinks", "_flushIds", "_deleteObjects", "_newRoot", "undefined", "_space", "internal", "db", "coreDatabase", "_automergeDocLoader", "getSpaceRootDocHandle", "doc", "findObject", "id", "documentId", "links", "toString", "docHandle", "find", "whenReady", "objects", "migrateObject", "migrate", "objectStructure", "schema", "props", "oldHandle", "_findObjectContainingHandle", "newState", "version", "CURRENT", "access", "spaceKey", "key", "toHex", "system", "type", "fromDXN", "data", "meta", "keys", "migratedDoc", "newHandle", "import", "save", "url", "_addHandleToFlushList", "addObject", "core", "_createObject", "createReference", "fromLocalObjectId", "deleteObject", "push", "changeProperties", "changeFn", "_buildNewRoot", "change", "propertiesStructure", "properties", "_commit", "flush", "createEpoch", "migration", "Migration", "REPLACE_AUTOMERGE_ROOT", "automergeRootUrl", "Object", "entries", "RawString", "create", "initNewObject", "setType", "getDoc", "Atom", "Registry", "SpaceState", "invariant", "Migrations", "namespace", "migrations", "_registry", "make", "_stateAtom", "Atom", "running", "pipe", "keepAlive", "versionProperty", "targetVersion", "length", "version", "space", "state", "get", "includes", "key", "toHex", "define", "migrate", "invariant", "SpaceState", "SPACE_READY", "currentVersion", "properties", "currentIndex", "findIndex", "m", "i", "targetIndex", "spaceKey", "currentState", "set", "slice", "migration", "builder", "MigrationBuilder", "next", "changeProperties", "propertiesStructure", "data", "_commit", "finalState", "filter"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"
|
|
1
|
+
{"inputs":{"src/migration-builder.ts":{"bytes":23919,"imports":[{"path":"@automerge/automerge","kind":"import-statement","external":true},{"path":"@dxos/client/halo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/echo-protocol","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true}],"format":"esm"},"src/migrations.ts":{"bytes":11487,"imports":[{"path":"@effect-atom/atom","kind":"import-statement","external":true},{"path":"@effect-atom/atom/Registry","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"src/migration-builder.ts","kind":"import-statement","original":"./migration-builder"}],"format":"esm"},"src/index.ts":{"bytes":653,"imports":[{"path":"src/migration-builder.ts","kind":"import-statement","original":"./migration-builder"},{"path":"src/migrations.ts","kind":"import-statement","original":"./migrations"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":17171},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"@automerge/automerge","kind":"import-statement","external":true},{"path":"@dxos/client/halo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/echo-protocol","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@effect-atom/atom","kind":"import-statement","external":true},{"path":"@effect-atom/atom/Registry","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"exports":["MigrationBuilder","Migrations"],"entryPoint":"src/index.ts","inputs":{"src/migration-builder.ts":{"bytesInOutput":5571},"src/index.ts":{"bytesInOutput":0},"src/migrations.ts":{"bytesInOutput":3215}},"bytes":9009}}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type * as Schema from 'effect/Schema';
|
|
2
2
|
import { type Space } from '@dxos/client/echo';
|
|
3
|
-
import { type ObjectStructure } from '@dxos/echo-protocol';
|
|
3
|
+
import { EncodedReference, type ObjectStructure } from '@dxos/echo-protocol';
|
|
4
4
|
import { type MaybePromise } from '@dxos/util';
|
|
5
5
|
export declare class MigrationBuilder {
|
|
6
6
|
private readonly _space;
|
|
@@ -17,9 +17,9 @@ export declare class MigrationBuilder {
|
|
|
17
17
|
props: any;
|
|
18
18
|
}>): Promise<void>;
|
|
19
19
|
addObject(schema: Schema.Schema.AnyNoContext, props: any): Promise<string>;
|
|
20
|
-
createReference(id: string):
|
|
20
|
+
createReference(id: string): EncodedReference;
|
|
21
21
|
deleteObject(id: string): void;
|
|
22
|
-
changeProperties(changeFn: (properties: ObjectStructure) => void): void
|
|
22
|
+
changeProperties(changeFn: (properties: ObjectStructure) => void): Promise<void>;
|
|
23
23
|
private _findObjectContainingHandle;
|
|
24
24
|
private _buildNewRoot;
|
|
25
25
|
private _createObject;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-builder.d.ts","sourceRoot":"","sources":["../../../src/migration-builder.ts"],"names":[],"mappings":"AAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"migration-builder.d.ts","sourceRoot":"","sources":["../../../src/migration-builder.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAI/C,OAAO,EAA0B,gBAAgB,EAAE,KAAK,eAAe,EAAmB,MAAM,qBAAqB,CAAC;AAGtH,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAoB/C,qBAAa,gBAAgB;IAWf,OAAO,CAAC,QAAQ,CAAC,MAAM;IAVnC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAY;IAClC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyB;IAGlD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA8B;IACxD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoB;IAC9C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAgB;IAE/C,OAAO,CAAC,QAAQ,CAAC,CAAgD;gBAEpC,MAAM,EAAE,KAAK;IAQpC,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;IAY5D,aAAa,CACjB,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,CAAC,eAAe,EAAE,eAAe,KAAK,YAAY,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;QAAC,KAAK,EAAE,GAAG,CAAA;KAAE,CAAC,GAC9G,OAAO,CAAC,IAAI,CAAC;IAoCV,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;IAKhF,eAAe,CAAC,EAAE,EAAE,MAAM;IAI1B,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAIxB,gBAAgB,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,eAAe,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;YAiCxE,2BAA2B;YAW3B,aAAa;YAsBb,aAAa;IAgC3B,OAAO,CAAC,qBAAqB;CAG9B"}
|
|
@@ -12,7 +12,8 @@ export type Migration = {
|
|
|
12
12
|
export declare class Migrations {
|
|
13
13
|
static namespace?: string;
|
|
14
14
|
static migrations: Migration[];
|
|
15
|
-
private static
|
|
15
|
+
private static _registry;
|
|
16
|
+
private static _stateAtom;
|
|
16
17
|
static get versionProperty(): string | undefined;
|
|
17
18
|
static get targetVersion(): string;
|
|
18
19
|
static running(space: Space): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../../src/migrations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../../src/migrations.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,KAAK,EAAc,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,gBAAgB,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;CACzD,CAAC;AAEF,qBAAa,UAAU;IACrB,MAAM,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,UAAU,EAAE,SAAS,EAAE,CAAM;IACpC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAmB;IAC3C,OAAO,CAAC,MAAM,CAAC,UAAU,CAA0E;IAEnG,MAAM,KAAK,eAAe,uBAEzB;IAED,MAAM,KAAK,aAAa,WAEvB;IAED,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;IAKrC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,IAAI;WAKlD,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAgCtF"}
|