@dxos/react-client 2.23.1-dev.a5468396 → 2.23.1-dev.edbbc2b5
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/.rush/temp/package-deps_build.json +5 -5
- package/.rush/temp/package-deps_build:test.json +5 -5
- package/dist/src/containers/ClientProvider.d.ts +2 -2
- package/dist/src/containers/ClientProvider.d.ts.map +1 -1
- package/dist/src/hooks/bot-factory/useBotFactoryClient.js +1 -1
- package/dist/src/hooks/bot-factory/useBotFactoryClient.js.map +1 -1
- package/dist/src/hooks/client/client.test.js +6 -3
- package/dist/src/hooks/client/client.test.js.map +1 -1
- package/dist/src/hooks/client/config.test.js +8 -5
- package/dist/src/hooks/client/config.test.js.map +1 -1
- package/dist/src/hooks/client/useConfig.d.ts +1 -1
- package/dist/src/hooks/client/useConfig.d.ts.map +1 -1
- package/dist/stories/halo-invitations.stories.js +1 -1
- package/dist/stories/halo-invitations.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/src/containers/ClientProvider.tsx +2 -2
- package/src/hooks/bot-factory/useBotFactoryClient.ts +1 -1
- package/src/hooks/client/client.test.tsx +8 -5
- package/src/hooks/client/config.test.tsx +9 -6
- package/stories/halo-invitations.stories.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-client",
|
|
3
|
-
"version": "2.23.1-dev.
|
|
3
|
+
"version": "2.23.1-dev.edbbc2b5",
|
|
4
4
|
"description": "React client API",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "AGPL-3.0",
|
|
@@ -8,22 +8,22 @@
|
|
|
8
8
|
"main": "dist/src/index.js",
|
|
9
9
|
"types": "dist/src/index.d.ts",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@dxos/async": "2.23.1-dev.
|
|
12
|
-
"@dxos/bot-factory-client": "2.23.1-dev.
|
|
13
|
-
"@dxos/client": "2.23.1-dev.
|
|
14
|
-
"@dxos/config": "2.23.1-dev.
|
|
15
|
-
"@dxos/credentials": "2.23.1-dev.
|
|
16
|
-
"@dxos/crypto": "2.23.1-dev.
|
|
17
|
-
"@dxos/debug": "2.23.1-dev.
|
|
18
|
-
"@dxos/echo-db": "2.23.1-dev.
|
|
19
|
-
"@dxos/util": "2.23.1-dev.
|
|
11
|
+
"@dxos/async": "2.23.1-dev.edbbc2b5",
|
|
12
|
+
"@dxos/bot-factory-client": "2.23.1-dev.edbbc2b5",
|
|
13
|
+
"@dxos/client": "2.23.1-dev.edbbc2b5",
|
|
14
|
+
"@dxos/config": "2.23.1-dev.edbbc2b5",
|
|
15
|
+
"@dxos/credentials": "2.23.1-dev.edbbc2b5",
|
|
16
|
+
"@dxos/crypto": "2.23.1-dev.edbbc2b5",
|
|
17
|
+
"@dxos/debug": "2.23.1-dev.edbbc2b5",
|
|
18
|
+
"@dxos/echo-db": "2.23.1-dev.edbbc2b5",
|
|
19
|
+
"@dxos/util": "2.23.1-dev.edbbc2b5",
|
|
20
20
|
"assert": "^2.0.0",
|
|
21
21
|
"debug": "^4.3.3",
|
|
22
22
|
"react-display-name": "^0.2.5",
|
|
23
23
|
"use-subscription": "^1.4.1"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@dxos/esbuild-plugins": "2.23.1-dev.
|
|
26
|
+
"@dxos/esbuild-plugins": "2.23.1-dev.edbbc2b5",
|
|
27
27
|
"@dxos/esbuild-server": "~1.7.4",
|
|
28
28
|
"@dxos/toolchain-node-library": "2.23.0",
|
|
29
29
|
"@mui/material": "^5.0.1",
|
|
@@ -6,7 +6,7 @@ import debug from 'debug';
|
|
|
6
6
|
import React, { MutableRefObject, ReactNode, useEffect, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { Client, ClientOptions } from '@dxos/client';
|
|
9
|
-
import { Config, ConfigObject } from '@dxos/config';
|
|
9
|
+
import { Config, ConfigObject, ConfigV1Object } from '@dxos/config';
|
|
10
10
|
import { MaybeFunction, MaybePromise, getAsyncValue } from '@dxos/util';
|
|
11
11
|
|
|
12
12
|
import { printBanner } from '../banner';
|
|
@@ -17,7 +17,7 @@ const log = debug('dxos:react-client');
|
|
|
17
17
|
export type ClientProvider = MaybeFunction<MaybePromise<Client>>
|
|
18
18
|
|
|
19
19
|
// TODO(burdon): Why defs?
|
|
20
|
-
export type ConfigProvider = MaybeFunction<MaybePromise<Config | ConfigObject>>
|
|
20
|
+
export type ConfigProvider = MaybeFunction<MaybePromise<Config | ConfigObject | ConfigV1Object>>
|
|
21
21
|
|
|
22
22
|
export interface ClientProviderProps {
|
|
23
23
|
children?: ReactNode
|
|
@@ -18,7 +18,7 @@ export const useBotFactoryClient = (): BotFactoryClient | undefined => {
|
|
|
18
18
|
|
|
19
19
|
useEffect(() => {
|
|
20
20
|
const botFactoryClient = new BotFactoryClient(client.echo.networkManager);
|
|
21
|
-
const topic = config.get('services.bot.topic') ??
|
|
21
|
+
const topic = config.get('runtime.services.bot.topic') ??
|
|
22
22
|
raise(new Error('Bot factory topic is not provided'));
|
|
23
23
|
setImmediate(async () => {
|
|
24
24
|
await botFactoryClient.start(PublicKey.from(topic));
|
|
@@ -7,7 +7,7 @@ import expect from 'expect';
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
9
|
import { Client } from '@dxos/client';
|
|
10
|
-
import {
|
|
10
|
+
import { ConfigV1Object } from '@dxos/config';
|
|
11
11
|
|
|
12
12
|
import { ClientProvider } from '../../containers';
|
|
13
13
|
import { useClient } from './useClient';
|
|
@@ -21,10 +21,13 @@ describe('Client hook', () => {
|
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
it('should return client when used properly in a context', () => {
|
|
24
|
-
const config:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
const config: ConfigV1Object = {
|
|
25
|
+
version: 1,
|
|
26
|
+
runtime: {
|
|
27
|
+
client: {
|
|
28
|
+
storage: {
|
|
29
|
+
persistent: false
|
|
30
|
+
}
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
33
|
};
|
|
@@ -7,7 +7,7 @@ import expect from 'expect';
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
9
|
import { Client } from '@dxos/client';
|
|
10
|
-
import {
|
|
10
|
+
import { ConfigV1Object } from '@dxos/config';
|
|
11
11
|
|
|
12
12
|
import { ClientProvider } from '../../containers';
|
|
13
13
|
import { useConfig } from './useConfig';
|
|
@@ -29,10 +29,13 @@ describe('Config hook', () => {
|
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
it('should return custom client config when used properly in a context', () => {
|
|
32
|
-
const config:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
const config: ConfigV1Object = {
|
|
33
|
+
version: 1,
|
|
34
|
+
runtime: {
|
|
35
|
+
client: {
|
|
36
|
+
storage: {
|
|
37
|
+
persistent: false
|
|
38
|
+
}
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
};
|
|
@@ -40,6 +43,6 @@ describe('Config hook', () => {
|
|
|
40
43
|
const wrapper = ({ children }: any) => <ClientProvider client={client}>{children}</ClientProvider>;
|
|
41
44
|
const { result } = renderHook(render, { wrapper });
|
|
42
45
|
expect(result.error?.message).not.toBeDefined();
|
|
43
|
-
expect(result.current.get('
|
|
46
|
+
expect(result.current.get('runtime.client.storage')).toEqual(config.runtime?.client?.storage);
|
|
44
47
|
});
|
|
45
48
|
});
|