@dxos/app-solid 0.8.4-main.c85a9c8dae → 0.8.4-main.fcfe5033a5

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/app-solid",
3
- "version": "0.8.4-main.c85a9c8dae",
3
+ "version": "0.8.4-main.fcfe5033a5",
4
4
  "description": "SolidJS integration for @dxos/app-framework",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -29,22 +29,22 @@
29
29
  "src"
30
30
  ],
31
31
  "dependencies": {
32
- "@dxos/app-framework": "0.8.4-main.c85a9c8dae",
33
- "@dxos/app-toolkit": "0.8.4-main.c85a9c8dae",
34
- "@dxos/effect-atom-solid": "0.8.4-main.c85a9c8dae",
35
- "@dxos/invariant": "0.8.4-main.c85a9c8dae",
36
- "@dxos/operation": "0.8.4-main.c85a9c8dae",
37
- "@dxos/web-context-solid": "0.8.4-main.c85a9c8dae"
32
+ "@dxos/app-framework": "0.8.4-main.fcfe5033a5",
33
+ "@dxos/invariant": "0.8.4-main.fcfe5033a5",
34
+ "@dxos/app-toolkit": "0.8.4-main.fcfe5033a5",
35
+ "@dxos/effect-atom-solid": "0.8.4-main.fcfe5033a5",
36
+ "@dxos/web-context-solid": "0.8.4-main.fcfe5033a5",
37
+ "@dxos/operation": "0.8.4-main.fcfe5033a5"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@effect-atom/atom": "^0.5.1",
41
41
  "@solidjs/testing-library": "^0.8.10",
42
- "effect": "3.19.16",
42
+ "effect": "3.20.0",
43
43
  "solid-js": "^1.9.11",
44
44
  "vite-plugin-solid": "^2.11.10"
45
45
  },
46
46
  "peerDependencies": {
47
- "effect": "3.19.16",
47
+ "effect": "3.20.0",
48
48
  "solid-js": "^1.9.11"
49
49
  },
50
50
  "publishConfig": {
package/src/index.ts CHANGED
@@ -6,5 +6,4 @@ export * from '@dxos/app-framework';
6
6
 
7
7
  export * from './common';
8
8
  export * from './useCapabilities';
9
- export * from './useOperationResolver';
10
9
  export * from './usePluginManager';
@@ -1,3 +0,0 @@
1
- import { type OperationResolver } from '@dxos/operation';
2
- export declare const useOperationResolver: (module: string, resolver: OperationResolver.OperationResolver) => void;
3
- //# sourceMappingURL=useOperationResolver.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useOperationResolver.d.ts","sourceRoot":"","sources":["../../../src/useOperationResolver.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAIzD,eAAO,MAAM,oBAAoB,GAAI,QAAQ,MAAM,EAAE,UAAU,iBAAiB,CAAC,iBAAiB,SAgBjG,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=useOperationResolver.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useOperationResolver.test.d.ts","sourceRoot":"","sources":["../../../src/useOperationResolver.test.tsx"],"names":[],"mappings":""}
@@ -1,63 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { render } from '@solidjs/testing-library';
6
- import * as Effect from 'effect/Effect';
7
- import * as Schema from 'effect/Schema';
8
- import { describe, expect, test, vi } from 'vitest';
9
-
10
- import { type PluginManager, PluginManagerContext } from '@dxos/app-framework';
11
- import { Operation, OperationResolver } from '@dxos/operation';
12
- import { ContextProtocolProvider } from '@dxos/web-context-solid';
13
-
14
- import { useOperationResolver } from './useOperationResolver';
15
-
16
- const TestOperation = Operation.make({
17
- meta: { key: 'test/operation', name: 'Test Operation' },
18
- schema: {
19
- input: Schema.Struct({ value: Schema.String }),
20
- output: Schema.Struct({ result: Schema.String }),
21
- },
22
- });
23
-
24
- describe('useOperationResolver', () => {
25
- test('registers and unregisters operation resolver', () => {
26
- const contributeMock = vi.fn();
27
- const removeMock = vi.fn();
28
-
29
- const mockManager = {
30
- capabilities: {
31
- contribute: contributeMock,
32
- remove: removeMock,
33
- },
34
- } as unknown as PluginManager.PluginManager;
35
-
36
- const resolver = OperationResolver.make({
37
- operation: TestOperation,
38
- handler: ({ value }) => Effect.succeed({ result: value }),
39
- });
40
-
41
- const TestComponent = () => {
42
- useOperationResolver('test-module', resolver);
43
- return <div />;
44
- };
45
-
46
- const { unmount } = render(() => (
47
- <ContextProtocolProvider context={PluginManagerContext} value={mockManager}>
48
- <TestComponent />
49
- </ContextProtocolProvider>
50
- ));
51
-
52
- expect(contributeMock).toHaveBeenCalledWith(
53
- expect.objectContaining({
54
- module: 'test-module',
55
- implementation: [resolver],
56
- }),
57
- );
58
-
59
- unmount();
60
-
61
- expect(removeMock).toHaveBeenCalled();
62
- });
63
- });
@@ -1,28 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { createEffect, onCleanup } from 'solid-js';
6
-
7
- import { Capabilities } from '@dxos/app-framework';
8
- import { type OperationResolver } from '@dxos/operation';
9
-
10
- import { usePluginManager } from './usePluginManager';
11
-
12
- export const useOperationResolver = (module: string, resolver: OperationResolver.OperationResolver) => {
13
- const manager = usePluginManager();
14
-
15
- createEffect(() => {
16
- const implementation = [resolver];
17
-
18
- manager.capabilities.contribute({
19
- module,
20
- interface: Capabilities.OperationResolver,
21
- implementation,
22
- });
23
-
24
- onCleanup(() => {
25
- manager.capabilities.remove(Capabilities.OperationResolver, implementation);
26
- });
27
- });
28
- };