@coherent.js/tooling 1.0.0-rc.2 → 1.0.0-rc.4

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.
@@ -7081,5 +7081,5 @@
7081
7081
  "optional": true
7082
7082
  }
7083
7083
  ],
7084
- "generatedAt": "2026-05-25T13:06:29.446Z"
7084
+ "generatedAt": "2026-07-19T20:18:27.772Z"
7085
7085
  }
package/package.json CHANGED
@@ -1,29 +1,29 @@
1
1
  {
2
2
  "name": "@coherent.js/tooling",
3
- "version": "1.0.0-rc.2",
3
+ "version": "1.0.0-rc.4",
4
4
  "description": "Coherent.js dev-time tooling: testing utilities (Vitest matchers, render harness) and Language Server Protocol implementation.",
5
5
  "type": "module",
6
6
  "main": "./dist/testing/index.js",
7
7
  "types": "./types/testing/index.d.ts",
8
8
  "exports": {
9
+ ".": {
10
+ "types": "./types/testing/index.d.ts",
11
+ "import": "./dist/testing/index.js"
12
+ },
9
13
  "./testing": {
10
14
  "types": "./types/testing/index.d.ts",
11
- "development": "./src/testing/index.js",
12
15
  "import": "./dist/testing/index.js"
13
16
  },
14
17
  "./testing/renderer": {
15
- "types": "./types/testing/index.d.ts",
16
- "development": "./src/testing/test-renderer.js",
18
+ "types": "./types/testing/renderer.d.ts",
17
19
  "import": "./dist/testing/test-renderer.js"
18
20
  },
19
21
  "./testing/utils": {
20
- "types": "./types/testing/index.d.ts",
21
- "development": "./src/testing/test-utils.js",
22
+ "types": "./types/testing/utils.d.ts",
22
23
  "import": "./dist/testing/test-utils.js"
23
24
  },
24
25
  "./testing/matchers": {
25
- "types": "./types/testing/index.d.ts",
26
- "development": "./src/testing/matchers.js",
26
+ "types": "./types/testing/matchers.d.ts",
27
27
  "import": "./dist/testing/matchers.js"
28
28
  },
29
29
  "./lsp": {
@@ -64,16 +64,16 @@
64
64
  "url": "https://github.com/Tomdrouv1/coherent.js/issues"
65
65
  },
66
66
  "peerDependencies": {
67
- "@coherent.js/core": "1.0.0-rc.2"
67
+ "@coherent.js/core": "1.0.0-rc.4"
68
68
  },
69
69
  "dependencies": {
70
70
  "vscode-languageserver": "9.0.1",
71
71
  "vscode-languageserver-textdocument": "1.0.12"
72
72
  },
73
73
  "devDependencies": {
74
- "tsx": "4.21.0",
74
+ "tsx": "4.23.0",
75
75
  "typescript": "5.9.3",
76
- "vitest": "1.6.1"
76
+ "vitest": "4.1.10"
77
77
  },
78
78
  "publishConfig": {
79
79
  "access": "public",
@@ -45,6 +45,38 @@ export interface RenderResult {
45
45
  getAllByText(text: string | RegExp): Element[];
46
46
  }
47
47
 
48
+ /** String-level match returned by TestRendererResult query helpers */
49
+ export interface TestRendererMatch {
50
+ text: string;
51
+ html: string;
52
+ exists: boolean;
53
+ testId?: string;
54
+ className?: string;
55
+ }
56
+
57
+ /**
58
+ * Result of renderComponent()/renderComponentAsync() — the rendered HTML
59
+ * plus string-level query helpers over it.
60
+ */
61
+ export class TestRendererResult {
62
+ constructor(component: CoherentNode, html: string, container?: unknown);
63
+ component: CoherentNode;
64
+ html: string;
65
+ container: unknown;
66
+ getByTestId(testId: string): TestRendererMatch;
67
+ queryByTestId(testId: string): TestRendererMatch | null;
68
+ getByText(text: string | RegExp): TestRendererMatch;
69
+ queryByText(text: string | RegExp): TestRendererMatch | null;
70
+ getByClassName(className: string): TestRendererMatch;
71
+ queryByClassName(className: string): TestRendererMatch | null;
72
+ getAllByTagName(tagName: string): TestRendererMatch[];
73
+ exists(selector: string, type?: 'testId' | 'text' | 'className'): boolean;
74
+ getHTML(): string;
75
+ getComponent(): CoherentNode;
76
+ toSnapshot(): string;
77
+ debug(): void;
78
+ }
79
+
48
80
  /**
49
81
  * Test renderer class
50
82
  */
@@ -88,11 +120,6 @@ export function createTestRenderer(): TestRenderer;
88
120
  */
89
121
  export function shallowRender(component: CoherentNode): RenderResult;
90
122
 
91
- /**
92
- * Render a node to HTML string
93
- */
94
- export function renderToString(node: CoherentNode): string;
95
-
96
123
  // ============================================================================
97
124
  // Custom Matchers for Coherent.js
98
125
  // ============================================================================
@@ -252,25 +279,6 @@ export function createSpy<T extends (...args: unknown[]) => unknown>(
252
279
  method: string
253
280
  ): Mock<T>;
254
281
 
255
- /**
256
- * Mock a component
257
- */
258
- export function mockComponent<P extends ComponentProps = ComponentProps>(
259
- name: string,
260
- render?: (props: P) => CoherentNode
261
- ): CoherentComponent<P>;
262
-
263
- /**
264
- * Create test state with reset capability
265
- */
266
- export function createTestState<T extends Record<string, unknown>>(
267
- initial: T
268
- ): {
269
- getState: () => T;
270
- setState: (updates: Partial<T>) => void;
271
- reset: () => void;
272
- };
273
-
274
282
  /**
275
283
  * Cleanup all mocks and rendered components
276
284
  */
@@ -326,14 +334,6 @@ export const userEvent: {
326
334
  // Assertion Utilities
327
335
  // ============================================================================
328
336
 
329
- /**
330
- * Assert element structure matches expected
331
- */
332
- export function assertElementStructure(
333
- element: CoherentElement,
334
- expected: Partial<CoherentElement>
335
- ): void;
336
-
337
337
  /**
338
338
  * Standard assertions
339
339
  */
@@ -0,0 +1,6 @@
1
+ // The slice of the shared testing declarations this subpath exports at runtime.
2
+ export {
3
+ assertions,
4
+ customMatchers,
5
+ extendExpect
6
+ } from './index.js';
@@ -0,0 +1,9 @@
1
+ // The slice of the shared testing declarations this subpath exports at runtime.
2
+ export {
3
+ TestRenderer,
4
+ TestRendererResult,
5
+ createTestRenderer,
6
+ renderComponent,
7
+ renderComponentAsync,
8
+ shallowRender
9
+ } from './index.js';
@@ -0,0 +1,14 @@
1
+ // The slice of the shared testing declarations this subpath exports at runtime.
2
+ export {
3
+ act,
4
+ cleanup,
5
+ createMock,
6
+ createSpy,
7
+ fireEvent,
8
+ screen,
9
+ userEvent,
10
+ waitFor,
11
+ waitForElement,
12
+ waitForElementToBeRemoved,
13
+ within
14
+ } from './index.js';