@dxos/echo-generator 0.9.0 → 0.9.1-staging.ee54ba693a

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/echo-generator",
3
- "version": "0.9.0",
3
+ "version": "0.9.1-staging.ee54ba693a",
4
4
  "description": "ECHO data generator for testing.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -25,21 +25,22 @@
25
25
  "src"
26
26
  ],
27
27
  "dependencies": {
28
- "@automerge/automerge": "3.3.0-fragments.1",
29
- "effect": "3.21.3",
30
- "@dxos/client": "0.9.0",
31
- "@dxos/echo": "0.9.0",
32
- "@dxos/echo-client": "0.9.0",
33
- "@dxos/invariant": "0.9.0",
34
- "@dxos/node-std": "0.9.0",
35
- "@dxos/util": "0.9.0"
28
+ "@automerge/automerge": "3.3.0-fragments.2",
29
+ "effect": "3.21.4",
30
+ "@dxos/echo": "0.9.1-staging.ee54ba693a",
31
+ "@dxos/echo-client": "0.9.1-staging.ee54ba693a",
32
+ "@dxos/client": "0.9.1-staging.ee54ba693a",
33
+ "@dxos/invariant": "0.9.1-staging.ee54ba693a",
34
+ "@dxos/echo-doc": "0.9.1-staging.ee54ba693a",
35
+ "@dxos/node-std": "0.9.1-staging.ee54ba693a",
36
+ "@dxos/util": "0.9.1-staging.ee54ba693a"
36
37
  },
37
38
  "devDependencies": {
38
- "@dxos/random": "0.9.0"
39
+ "@dxos/random": "0.9.1-staging.ee54ba693a"
39
40
  },
40
41
  "peerDependencies": {
41
- "effect": "3.21.3",
42
- "@dxos/random": "0.9.0"
42
+ "effect": "3.21.4",
43
+ "@dxos/random": "0.9.1-staging.ee54ba693a"
43
44
  },
44
45
  "publishConfig": {
45
46
  "access": "public"
package/src/data.ts CHANGED
@@ -7,7 +7,7 @@ import * as Schema from 'effect/Schema';
7
7
 
8
8
  import { type Space } from '@dxos/client/echo';
9
9
  import { DXN, Ref, Type } from '@dxos/echo';
10
- import { createDocAccessor } from '@dxos/echo-client';
10
+ import { Doc } from '@dxos/echo-doc';
11
11
  import { random } from '@dxos/random';
12
12
 
13
13
  import { SpaceObjectGenerator, TestObjectGenerator } from './generator';
@@ -87,7 +87,7 @@ const testObjectGenerators: TestGeneratorMap<TestSchemaType> = {
87
87
 
88
88
  [TestSchemaType.contact]: async (provider) => {
89
89
  const organizations = await provider?.(TestSchemaType.organization);
90
- const location = random.datatype.boolean() ? random.geo.airport() : {};
90
+ const airport = random.datatype.boolean() ? random.geo.airport() : undefined;
91
91
 
92
92
  return {
93
93
  name: random.person.fullName(),
@@ -96,7 +96,8 @@ const testObjectGenerators: TestGeneratorMap<TestSchemaType> = {
96
96
  organizations?.length && random.datatype.boolean({ probability: 0.8 })
97
97
  ? Ref.make(random.helpers.arrayElement(organizations))
98
98
  : undefined,
99
- ...location,
99
+ lat: airport?.location?.[1],
100
+ lng: airport?.location?.[0],
100
101
  };
101
102
  },
102
103
 
@@ -113,7 +114,7 @@ const testObjectGenerators: TestGeneratorMap<TestSchemaType> = {
113
114
 
114
115
  const testObjectMutators: TestMutationsMap<TestSchemaType> = {
115
116
  [TestSchemaType.document]: async (object, params) => {
116
- const accessor = createDocAccessor(object, ['content']);
117
+ const accessor = Doc.createAccessor(object, ['content']);
117
118
  for (let i = 0; i < params.count; i++) {
118
119
  const length = object.content?.content?.length ?? 0;
119
120
  accessor.handle.change((doc) => {
@@ -93,9 +93,11 @@ describe('TestObjectGenerator', () => {
93
93
  });
94
94
 
95
95
  test('create object with in memory schema', async () => {
96
- const Task = Schema.Struct({
97
- name: Schema.optional(Schema.String),
98
- }).pipe(Type.makeObject(DXN.make('com.example.type.task', '0.1.0')));
96
+ const Task = Type.makeObject(DXN.make('com.example.type.task', '0.1.0'))(
97
+ Schema.Struct({
98
+ name: Schema.optional(Schema.String),
99
+ }),
100
+ );
99
101
 
100
102
  enum Types {
101
103
  task = 'com.example.type.task',