@hydranium/data-server 1.0.0-next.19 → 1.0.0-next.192
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/README.md +16 -3
- package/lib/data-server.d.ts +403 -221
- package/lib/data-server.d.ts.map +1 -1
- package/lib/data-server.js +641 -390
- package/lib/data-server.js.map +1 -1
- package/lib/messages/index.d.ts +18 -0
- package/lib/messages/index.d.ts.map +1 -0
- package/lib/messages/index.js +18 -0
- package/lib/messages/index.js.map +1 -0
- package/lib/node/node-diagnostics-provider.js.map +1 -1
- package/lib/testing/data-server-harness.d.ts +7 -1
- package/lib/testing/data-server-harness.d.ts.map +1 -1
- package/lib/testing/data-server-harness.js +5 -2
- package/lib/testing/data-server-harness.js.map +1 -1
- package/package.json +38 -29
- package/src/data-server.ts +798 -422
- package/src/messages/index.ts +26 -0
- package/src/testing/data-server-harness.ts +16 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Every user-facing message `@hydranium/data-server` raises.
|
|
12
|
+
*
|
|
13
|
+
* Declarations stay beside their call sites and are re-exported here, so this is
|
|
14
|
+
* enumeration rather than centralization: a code's package segment has to name
|
|
15
|
+
* the package that raises it. The English is a fallback, not a contract; the
|
|
16
|
+
* code is the contract, and renaming one is a breaking change.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
NO_ACTIVE_PROFILE,
|
|
21
|
+
NO_ACTIVE_PROFILE_CODE,
|
|
22
|
+
noActiveProfileError,
|
|
23
|
+
REFERENCE_SETTLE_TIMEOUT,
|
|
24
|
+
REFERENCE_SETTLE_TIMEOUT_CODE,
|
|
25
|
+
referenceSettleTimeoutError
|
|
26
|
+
} from '../data-server.js';
|
|
@@ -14,7 +14,10 @@ import {
|
|
|
14
14
|
type DataClientProtocol,
|
|
15
15
|
type DataServerProtocol,
|
|
16
16
|
type ProjectsChangedEvent,
|
|
17
|
+
type TransferDocumentDeletedEvent,
|
|
18
|
+
type TransferDocumentDirtyChangedEvent,
|
|
17
19
|
type TransferDocumentSavedEvent,
|
|
20
|
+
type TransferDocumentsBuiltEvent,
|
|
18
21
|
type TransferDocumentUpdatedEvent
|
|
19
22
|
} from '@hydranium/protocol/data';
|
|
20
23
|
import { type Harness, makeCapturingDataClient } from '@hydranium/protocol/testing';
|
|
@@ -87,6 +90,12 @@ export interface DataServerHarness<
|
|
|
87
90
|
readonly events: ReadonlyArray<TransferDocumentUpdatedEvent<TTransfer, TDiagnostic>>;
|
|
88
91
|
/** Captured `onDocumentSaved` events. */
|
|
89
92
|
readonly saves: ReadonlyArray<TransferDocumentSavedEvent<TTransfer, TDiagnostic>>;
|
|
93
|
+
/** Captured `onDocumentDirtyChanged` events. */
|
|
94
|
+
readonly dirtyChanges: ReadonlyArray<TransferDocumentDirtyChangedEvent>;
|
|
95
|
+
/** Captured `onDocumentDeleted` events. */
|
|
96
|
+
readonly deletions: ReadonlyArray<TransferDocumentDeletedEvent>;
|
|
97
|
+
/** Captured `onDocumentsBuilt` events, one per build that had unwatched documents. */
|
|
98
|
+
readonly builds: ReadonlyArray<TransferDocumentsBuiltEvent>;
|
|
90
99
|
/** Captured `onProjectsChanged` events. */
|
|
91
100
|
readonly projectsChanges: ReadonlyArray<ProjectsChangedEvent<TProject>>;
|
|
92
101
|
/** Dispose the underlying duplex pair. Idempotent. */
|
|
@@ -115,7 +124,7 @@ export function makeDataServerHarness<
|
|
|
115
124
|
const server = options.server(pair.left);
|
|
116
125
|
|
|
117
126
|
// The capture half is the shared client double, not a local copy: the same
|
|
118
|
-
// recording semantics (
|
|
127
|
+
// recording semantics (every channel, an override replacing rather than
|
|
119
128
|
// supplementing) then hold for a client-side suite that stands the double up
|
|
120
129
|
// without a server, so an assertion learnt against one reads the same in the
|
|
121
130
|
// other.
|
|
@@ -123,6 +132,9 @@ export function makeDataServerHarness<
|
|
|
123
132
|
client: localClient,
|
|
124
133
|
updates: events,
|
|
125
134
|
saves,
|
|
135
|
+
dirtyChanges,
|
|
136
|
+
deletions,
|
|
137
|
+
builds,
|
|
126
138
|
projectsChanges
|
|
127
139
|
} = makeCapturingDataClient<TTransfer, TDiagnostic, TProject>(options.client);
|
|
128
140
|
|
|
@@ -141,6 +153,9 @@ export function makeDataServerHarness<
|
|
|
141
153
|
pair,
|
|
142
154
|
events,
|
|
143
155
|
saves,
|
|
156
|
+
dirtyChanges,
|
|
157
|
+
deletions,
|
|
158
|
+
builds,
|
|
144
159
|
projectsChanges,
|
|
145
160
|
dispose: () => pair.dispose()
|
|
146
161
|
};
|