@dxos/plugin-testing 0.8.4-main.dfabb4ec29 → 0.8.4-main.effb148878
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/LICENSE +102 -5
- package/dist/lib/neutral/{chunk-7UPIIIZM.mjs → chunk-C7HWAFWJ.mjs} +5 -6
- package/dist/lib/neutral/chunk-C7HWAFWJ.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-ZVN23V74.mjs → chunk-G6UPW2TF.mjs} +2 -1
- package/dist/lib/neutral/chunk-G6UPW2TF.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-E4LBVPH5.mjs → chunk-S4IEYCPX.mjs} +2 -2
- package/dist/lib/neutral/components/index.mjs +2 -1
- package/dist/lib/neutral/components/index.mjs.map +3 -3
- package/dist/lib/neutral/core.mjs +1 -1
- package/dist/lib/neutral/harness.mjs +7 -8
- package/dist/lib/neutral/harness.mjs.map +3 -3
- package/dist/lib/neutral/index.mjs +2 -2
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/meta.mjs +1 -1
- package/dist/lib/neutral/{open-WBONYQ47.mjs → open-O5FFJF2B.mjs} +4 -1
- package/dist/lib/neutral/open-O5FFJF2B.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +1 -1
- package/dist/lib/neutral/plugin.mjs +2 -2
- package/dist/types/src/core.d.ts.map +1 -1
- package/dist/types/src/harness.d.ts +1 -1
- package/dist/types/src/harness.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/open.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -16
- package/src/components/Layout/Layout.tsx +3 -3
- package/src/core.ts +15 -18
- package/src/harness.ts +8 -9
- package/src/meta.ts +1 -0
- package/src/operations/open.ts +2 -0
- package/dist/lib/neutral/chunk-7UPIIIZM.mjs.map +0 -7
- package/dist/lib/neutral/chunk-ZVN23V74.mjs.map +0 -7
- package/dist/lib/neutral/open-WBONYQ47.mjs.map +0 -7
- /package/dist/lib/neutral/{chunk-E4LBVPH5.mjs.map → chunk-S4IEYCPX.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-testing",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.effb148878",
|
|
4
4
|
"description": "Plugin testing utils",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/dxos/dxos"
|
|
10
10
|
},
|
|
11
|
-
"license": "
|
|
11
|
+
"license": "FSL-1.1-Apache-2.0",
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
@@ -69,15 +69,16 @@
|
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@effect-atom/atom": "^0.5.1",
|
|
71
71
|
"@effect-atom/atom-react": "^0.5.0",
|
|
72
|
-
"@dxos/app-
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/plugin-
|
|
77
|
-
"@dxos/plugin-
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/
|
|
72
|
+
"@dxos/app-toolkit": "0.8.4-main.effb148878",
|
|
73
|
+
"@dxos/compute": "0.8.4-main.effb148878",
|
|
74
|
+
"@dxos/log": "0.8.4-main.effb148878",
|
|
75
|
+
"@dxos/app-framework": "0.8.4-main.effb148878",
|
|
76
|
+
"@dxos/plugin-attention": "0.8.4-main.effb148878",
|
|
77
|
+
"@dxos/plugin-graph": "0.8.4-main.effb148878",
|
|
78
|
+
"@dxos/plugin-theme": "0.8.4-main.effb148878",
|
|
79
|
+
"@dxos/plugin-settings": "0.8.4-main.effb148878",
|
|
80
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.effb148878",
|
|
81
|
+
"@dxos/util": "0.8.4-main.effb148878"
|
|
81
82
|
},
|
|
82
83
|
"devDependencies": {
|
|
83
84
|
"@types/react": "~19.2.7",
|
|
@@ -85,16 +86,16 @@
|
|
|
85
86
|
"effect": "3.20.0",
|
|
86
87
|
"react": "~19.2.3",
|
|
87
88
|
"react-dom": "~19.2.3",
|
|
88
|
-
"vite": "^8.0.
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/ui
|
|
89
|
+
"vite": "^8.0.14",
|
|
90
|
+
"@dxos/ui-theme": "0.8.4-main.effb148878",
|
|
91
|
+
"@dxos/react-ui": "0.8.4-main.effb148878"
|
|
91
92
|
},
|
|
92
93
|
"peerDependencies": {
|
|
93
94
|
"effect": "3.20.0",
|
|
94
95
|
"react": "~19.2.3",
|
|
95
96
|
"react-dom": "~19.2.3",
|
|
96
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
97
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
97
|
+
"@dxos/react-ui": "0.8.4-main.effb148878",
|
|
98
|
+
"@dxos/ui-theme": "0.8.4-main.effb148878"
|
|
98
99
|
},
|
|
99
100
|
"publishConfig": {
|
|
100
101
|
"access": "public"
|
|
@@ -188,7 +188,7 @@ export const Layout = ({ children }: PropsWithChildren<{}>) => {
|
|
|
188
188
|
<Popover.Viewport>
|
|
189
189
|
{layout.popoverKind === 'card' && (
|
|
190
190
|
<Card.Root>
|
|
191
|
-
<Card.
|
|
191
|
+
<Card.Header>
|
|
192
192
|
{/* TODO(wittjosiah): Cleaner way to handle no drag handle in toolbar? */}
|
|
193
193
|
<span />
|
|
194
194
|
{layout.popoverTitle ? (
|
|
@@ -196,8 +196,8 @@ export const Layout = ({ children }: PropsWithChildren<{}>) => {
|
|
|
196
196
|
) : (
|
|
197
197
|
<span />
|
|
198
198
|
)}
|
|
199
|
-
<Card.
|
|
200
|
-
</Card.
|
|
199
|
+
<Card.ActionIconButton action='close' onClick={handleClose} />
|
|
200
|
+
</Card.Header>
|
|
201
201
|
<Surface.Surface type={AppSurface.Card} data={layout.popoverContent} limit={1} />
|
|
202
202
|
</Card.Root>
|
|
203
203
|
)}
|
package/src/core.ts
CHANGED
|
@@ -2,27 +2,25 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
// `/
|
|
7
|
-
// `/plugin
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
// host that hits this. Production hosts (composer-app via `vite preview`)
|
|
16
|
-
// keep using the lazy `.` exports and their associated code splitting.
|
|
5
|
+
import { type Plugin, ProcessManagerPlugin } from '@dxos/app-framework';
|
|
6
|
+
// `/testing` entrypoints re-export the plugin eagerly (without `Plugin.lazy`).
|
|
7
|
+
// The default `.` and `/plugin` exports wrap each plugin in a lazy stub
|
|
8
|
+
// (`() => import('./XPlugin')`), which webkit cannot reliably resolve under
|
|
9
|
+
// vite-dev: the dynamic-import promise can settle with a partially-evaluated
|
|
10
|
+
// namespace, throwing `ReferenceError: Cannot access 'default' before
|
|
11
|
+
// initialization` from the loader's `mod.default` access. Storybook runs
|
|
12
|
+
// inside `storybook dev` (vite-dev) and is currently the only host that hits
|
|
13
|
+
// this. Production hosts (composer-app via `vite preview`) keep using the
|
|
14
|
+
// lazy `.` exports and their associated code splitting.
|
|
17
15
|
//
|
|
18
|
-
// Use these `/
|
|
16
|
+
// Use these `/testing` entrypoints from any storybook `withPluginManager`
|
|
19
17
|
// setup. The single-line `export * from './XPlugin'` re-exports avoid the
|
|
20
|
-
// dynamic-import path entirely — see e.g. `plugin-attention/src/
|
|
18
|
+
// dynamic-import path entirely — see e.g. `plugin-attention/src/testing.ts`.
|
|
21
19
|
import { AttentionPlugin } from '@dxos/plugin-attention/testing';
|
|
22
20
|
import { GraphPlugin } from '@dxos/plugin-graph/testing';
|
|
23
21
|
import { SettingsPlugin } from '@dxos/plugin-settings/testing';
|
|
24
|
-
import { ThemePlugin } from '@dxos/plugin-theme/
|
|
25
|
-
import { defaultTx } from '@dxos/ui
|
|
22
|
+
import { ThemePlugin } from '@dxos/plugin-theme/testing';
|
|
23
|
+
import { defaultTx } from '@dxos/react-ui';
|
|
26
24
|
|
|
27
25
|
/**
|
|
28
26
|
* Core plugins for testing/storybook environments.
|
|
@@ -32,8 +30,7 @@ import { defaultTx } from '@dxos/ui-theme';
|
|
|
32
30
|
export const corePlugins = (): Plugin.Plugin[] => [
|
|
33
31
|
AttentionPlugin(),
|
|
34
32
|
GraphPlugin(),
|
|
35
|
-
|
|
36
|
-
RuntimePlugin(),
|
|
33
|
+
ProcessManagerPlugin(),
|
|
37
34
|
SettingsPlugin(),
|
|
38
35
|
ThemePlugin({ tx: defaultTx }),
|
|
39
36
|
];
|
package/src/harness.ts
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// Copyright 2026 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { type Plugin, ProcessManagerPlugin } from '@dxos/app-framework';
|
|
6
6
|
import { createTestApp, type TestAppOptions, type TestHarness } from '@dxos/app-framework/testing';
|
|
7
|
-
import { AttentionPlugin } from '@dxos/plugin-attention/
|
|
8
|
-
import { GraphPlugin } from '@dxos/plugin-graph/
|
|
9
|
-
import { SettingsPlugin } from '@dxos/plugin-settings/
|
|
7
|
+
import { AttentionPlugin } from '@dxos/plugin-attention/testing';
|
|
8
|
+
import { GraphPlugin } from '@dxos/plugin-graph/testing';
|
|
9
|
+
import { SettingsPlugin } from '@dxos/plugin-settings/testing';
|
|
10
10
|
|
|
11
11
|
export type ComposerTestAppOptions = Omit<TestAppOptions, 'plugins'> & {
|
|
12
12
|
/** Plugins to register in addition to the Composer core plugins. */
|
|
@@ -26,14 +26,13 @@ export type ComposerTestAppOptions = Omit<TestAppOptions, 'plugins'> & {
|
|
|
26
26
|
const headlessCorePlugins = (): Plugin.Plugin[] => [
|
|
27
27
|
AttentionPlugin(),
|
|
28
28
|
GraphPlugin(),
|
|
29
|
-
|
|
30
|
-
RuntimePlugin(),
|
|
29
|
+
ProcessManagerPlugin(),
|
|
31
30
|
SettingsPlugin(),
|
|
32
31
|
];
|
|
33
32
|
|
|
34
33
|
/**
|
|
35
34
|
* Creates a TestHarness pre-loaded with the Composer core plugins
|
|
36
|
-
* (Attention, Graph,
|
|
35
|
+
* (Attention, Graph, ProcessManager, Settings, optionally Theme).
|
|
37
36
|
*
|
|
38
37
|
* For a ClientPlugin-backed harness, pass `ClientPlugin({ ... })` via `plugins`.
|
|
39
38
|
*/
|
|
@@ -41,8 +40,8 @@ export const createComposerTestApp = async (opts: ComposerTestAppOptions = {}):
|
|
|
41
40
|
const { plugins = [], theme = false, ...rest } = opts;
|
|
42
41
|
const core = headlessCorePlugins();
|
|
43
42
|
if (theme) {
|
|
44
|
-
const { ThemePlugin } = await import('@dxos/plugin-theme/
|
|
45
|
-
const { defaultTx } = await import('@dxos/ui
|
|
43
|
+
const { ThemePlugin } = await import('@dxos/plugin-theme/testing');
|
|
44
|
+
const { defaultTx } = await import('@dxos/react-ui');
|
|
46
45
|
core.push(ThemePlugin({ tx: defaultTx }));
|
|
47
46
|
}
|
|
48
47
|
return createTestApp({
|
package/src/meta.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { trim } from '@dxos/util';
|
|
|
8
8
|
export const meta: Plugin.Meta = {
|
|
9
9
|
id: 'org.dxos.plugin.storybook-layout',
|
|
10
10
|
name: 'Storybook',
|
|
11
|
+
author: 'DXOS',
|
|
11
12
|
description: trim`
|
|
12
13
|
Development layout optimized for Storybook component testing and documentation.
|
|
13
14
|
Provides specialized views for component development and design system exploration.
|
package/src/operations/open.ts
CHANGED
|
@@ -6,10 +6,12 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
|
|
7
7
|
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
8
8
|
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { log } from '@dxos/log';
|
|
9
10
|
|
|
10
11
|
const handler: Operation.WithHandler<typeof LayoutOperation.Open> = LayoutOperation.Open.pipe(
|
|
11
12
|
Operation.withHandler(
|
|
12
13
|
Effect.fnUntraced(function* (input) {
|
|
14
|
+
log('LayoutOperation.Open handler start');
|
|
13
15
|
return input.subject;
|
|
14
16
|
}),
|
|
15
17
|
),
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/core.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { OperationPlugin, type Plugin, RuntimePlugin } from '@dxos/app-framework';\n// `/plugin` entrypoints — `@dxos/plugin-attention/plugin`, `/plugin-client/plugin`,\n// `/plugin-graph/plugin`, `/plugin-preview/plugin`, `/plugin-settings/plugin`,\n// `/plugin-space/plugin`, `/plugin-theme/plugin` — re-export the plugin eagerly\n// (without `Plugin.lazy`). The default `.` export wraps each plugin in a lazy\n// stub (`() => import('./XPlugin')`), which webkit cannot reliably resolve\n// under vite-dev: the dynamic-import promise can settle with a\n// partially-evaluated namespace, throwing `ReferenceError: Cannot access\n// 'default' before initialization` from the loader's `mod.default` access.\n// Storybook runs inside `storybook dev` (vite-dev) and is currently the only\n// host that hits this. Production hosts (composer-app via `vite preview`)\n// keep using the lazy `.` exports and their associated code splitting.\n//\n// Use these `/plugin` entrypoints from any storybook `withPluginManager`\n// setup. The single-line `export * from './XPlugin'` re-exports avoid the\n// dynamic-import path entirely — see e.g. `plugin-attention/src/plugin.ts`.\nimport { AttentionPlugin } from '@dxos/plugin-attention/testing';\nimport { GraphPlugin } from '@dxos/plugin-graph/testing';\nimport { SettingsPlugin } from '@dxos/plugin-settings/testing';\nimport { ThemePlugin } from '@dxos/plugin-theme/plugin';\nimport { defaultTx } from '@dxos/ui-theme';\n\n/**\n * Core plugins for testing/storybook environments.\n * NOTE: Does not include SpacePlugin to avoid circular dependencies.\n * Import SpacePlugin directly in your stories if needed.\n */\nexport const corePlugins = (): Plugin.Plugin[] => [\n AttentionPlugin(),\n GraphPlugin(),\n OperationPlugin(),\n RuntimePlugin(),\n SettingsPlugin(),\n ThemePlugin({ tx: defaultTx }),\n];\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,iBAA8BC,qBAAqB;AAgB5D,SAASC,uBAAuB;AAChC,SAASC,mBAAmB;AAC5B,SAASC,sBAAsB;AAC/B,SAASC,mBAAmB;AAC5B,SAASC,iBAAiB;AAOnB,IAAMC,cAAc,MAAuB;EAChDL,gBAAAA;EACAC,YAAAA;EACAH,gBAAAA;EACAC,cAAAA;EACAG,eAAAA;EACAC,YAAY;IAAEG,IAAIF;EAAU,CAAA;;",
|
|
6
|
-
"names": ["OperationPlugin", "RuntimePlugin", "AttentionPlugin", "GraphPlugin", "SettingsPlugin", "ThemePlugin", "defaultTx", "corePlugins", "tx"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.storybook-layout',\n name: 'Storybook',\n description: trim`\n Development layout optimized for Storybook component testing and documentation.\n Provides specialized views for component development and design system exploration.\n `,\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-testing',\n};\n"],
|
|
5
|
-
"mappings": ";AAKA,SAASA,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaJ;;;;EAIbK,QAAQ;AACV;",
|
|
6
|
-
"names": ["trim", "meta", "id", "name", "description", "source"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/operations/open.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\n\nconst handler: Operation.WithHandler<typeof LayoutOperation.Open> = LayoutOperation.Open.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n return input.subject;\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
-
"mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAE1B,IAAMC,UAA8DF,gBAAgBG,KAAKC,KACvFH,UAAUI,YACDC,kBAAW,WAAWC,OAAK;AAChC,SAAOA,MAAMC;AACf,CAAA,CAAA,CAAA;AAIJ,IAAA,eAAeN;",
|
|
6
|
-
"names": ["Effect", "LayoutOperation", "Operation", "handler", "Open", "pipe", "withHandler", "fnUntraced", "input", "subject"]
|
|
7
|
-
}
|
|
File without changes
|