@dxos/migrations 0.8.4-main.a4bbb77 → 0.8.4-main.ae835ea

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/migrations",
3
- "version": "0.8.4-main.a4bbb77",
3
+ "version": "0.8.4-main.ae835ea",
4
4
  "description": "",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -26,15 +26,15 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "@automerge/automerge": "3.1.2",
29
- "@automerge/automerge-repo": "2.3.1",
30
- "@dxos/client": "0.8.4-main.a4bbb77",
31
- "@dxos/echo-db": "0.8.4-main.a4bbb77",
32
- "@dxos/echo-protocol": "0.8.4-main.a4bbb77",
33
- "@dxos/invariant": "0.8.4-main.a4bbb77",
34
- "@dxos/echo-schema": "0.8.4-main.a4bbb77",
35
- "@dxos/protocols": "0.8.4-main.a4bbb77",
36
- "@dxos/util": "0.8.4-main.a4bbb77",
37
- "@dxos/log": "0.8.4-main.a4bbb77"
29
+ "@automerge/automerge-repo": "2.4.0",
30
+ "@dxos/client": "0.8.4-main.ae835ea",
31
+ "@dxos/echo": "0.8.4-main.ae835ea",
32
+ "@dxos/echo-db": "0.8.4-main.ae835ea",
33
+ "@dxos/echo-protocol": "0.8.4-main.ae835ea",
34
+ "@dxos/invariant": "0.8.4-main.ae835ea",
35
+ "@dxos/protocols": "0.8.4-main.ae835ea",
36
+ "@dxos/util": "0.8.4-main.ae835ea",
37
+ "@dxos/log": "0.8.4-main.ae835ea"
38
38
  },
39
39
  "devDependencies": {},
40
40
  "publishConfig": {
@@ -2,12 +2,13 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { type Doc, next as am } from '@automerge/automerge';
5
+ import { next as A, type Doc } from '@automerge/automerge';
6
6
  import { type AnyDocumentId, type DocumentId } from '@automerge/automerge-repo';
7
- import { type Schema } from 'effect';
7
+ import type * as Schema from 'effect/Schema';
8
8
 
9
9
  import { type Space } from '@dxos/client/echo';
10
10
  import { CreateEpochRequest } from '@dxos/client/halo';
11
+ import { requireTypeReference } from '@dxos/echo/internal';
11
12
  import { type DocHandleProxy, ObjectCore, type RepoProxy, migrateDocument } from '@dxos/echo-db';
12
13
  import {
13
14
  type DatabaseDirectory,
@@ -16,7 +17,6 @@ import {
16
17
  SpaceDocVersion,
17
18
  encodeReference,
18
19
  } from '@dxos/echo-protocol';
19
- import { requireTypeReference } from '@dxos/echo-schema';
20
20
  import { invariant } from '@dxos/invariant';
21
21
  import { type MaybePromise } from '@dxos/util';
22
22
 
@@ -101,7 +101,7 @@ export class MigrationBuilder {
101
101
  },
102
102
  };
103
103
  const migratedDoc = migrateDocument(oldHandle.doc() as Doc<DatabaseDirectory>, newState);
104
- const newHandle = this._repo.import<DatabaseDirectory>(am.save(migratedDoc));
104
+ const newHandle = this._repo.import<DatabaseDirectory>(A.save(migratedDoc));
105
105
  this._newLinks[id] = newHandle.url;
106
106
  this._addHandleToFlushList(newHandle);
107
107
  }
@@ -168,7 +168,7 @@ export class MigrationBuilder {
168
168
  }
169
169
 
170
170
  for (const [id, url] of Object.entries(this._newLinks)) {
171
- links[id] = new am.RawString(url);
171
+ links[id] = new A.RawString(url);
172
172
  }
173
173
 
174
174
  this._newRoot = this._repo.create<DatabaseDirectory>({
@@ -5,9 +5,10 @@
5
5
  import { afterAll, beforeAll, beforeEach, describe, expect, test } from 'vitest';
6
6
 
7
7
  import { Client } from '@dxos/client';
8
- import { Filter, type Space, live } from '@dxos/client/echo';
8
+ import { Filter, type Space } from '@dxos/client/echo';
9
9
  import { TestBuilder } from '@dxos/client/testing';
10
- import { Expando } from '@dxos/echo-schema';
10
+ import { Obj, Type } from '@dxos/echo';
11
+ import { Expando } from '@dxos/echo/internal';
11
12
 
12
13
  import { Migrations } from './migrations';
13
14
 
@@ -75,7 +76,7 @@ describe('Migrations', () => {
75
76
 
76
77
  test('if some migrations have been run before, runs only the remaining migrations', async () => {
77
78
  space.properties['test.version'] = '1970-01-02';
78
- space.db.add(live(Expando, { namespace: 'test', count: 5 }));
79
+ space.db.add(Obj.make(Type.Expando, { namespace: 'test', count: 5 }));
79
80
  await Migrations.migrate(space);
80
81
  const { objects } = await space.db.query(Filter.type(Expando, { namespace: 'test' })).run();
81
82
  expect(objects).to.have.length(1);