@hydranium/data-server 1.0.0-next.22 → 1.0.0-next.221
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 +20 -6
- package/lib/data-server.d.ts +416 -284
- package/lib/data-server.d.ts.map +1 -1
- package/lib/data-server.js +652 -484
- 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.d.ts.map +1 -1
- package/lib/node/node-diagnostics-provider.js +2 -1
- package/lib/node/node-diagnostics-provider.js.map +1 -1
- package/lib/testing/data-server-harness.d.ts +31 -14
- package/lib/testing/data-server-harness.d.ts.map +1 -1
- package/lib/testing/data-server-harness.js +8 -3
- package/lib/testing/data-server-harness.js.map +1 -1
- package/lib/testing/index.d.ts +1 -0
- package/lib/testing/index.d.ts.map +1 -1
- package/lib/testing/index.js.map +1 -1
- package/package.json +35 -39
- package/src/data-server.ts +808 -525
- package/src/messages/index.ts +26 -0
- package/src/node/node-diagnostics-provider.ts +2 -8
- package/src/testing/data-server-harness.ts +55 -26
- package/src/testing/index.ts +5 -2
package/README.md
CHANGED
|
@@ -17,13 +17,24 @@ Installed by the server process that already composes
|
|
|
17
17
|
compose.
|
|
18
18
|
- **A document lifecycle over the shared workspace:** `openModelDocument`,
|
|
19
19
|
`getModelDocument`, `updateModelDocument`, `saveModelDocument`,
|
|
20
|
-
`closeModelDocument`, `watchModelDocument` / `unwatchModelDocument`, and
|
|
20
|
+
`persistModelDocument`, `closeModelDocument`, `watchModelDocument` / `unwatchModelDocument`, and
|
|
21
21
|
`waitForReady` for clients that must not race workspace initialisation.
|
|
22
|
+
- **Client sessions per connection:** `createSession` registers a participant,
|
|
23
|
+
whose requests then write only what it has open; `createModelDocument` and
|
|
24
|
+
the all-or-none `updateModelDocuments` serve sessions only; `closeSession`, or
|
|
25
|
+
the connection closing, ends a session and closes everything it has open. See
|
|
26
|
+
[Client sessions](../../docs/concepts/client-sessions.md).
|
|
22
27
|
- **Push notifications instead of polling:** `onDocumentUpdated` when a
|
|
23
28
|
subscribed document reaches the configured build phase
|
|
24
29
|
(`DataServerOptions.subscriptionPhase`, `DocumentState.Validated` by default),
|
|
25
|
-
`onDocumentSaved` on a separate channel,
|
|
26
|
-
|
|
30
|
+
`onDocumentSaved` on a separate channel, `onDocumentDirtyChanged` when a
|
|
31
|
+
subscribed document starts or stops differing from its file (every document
|
|
32
|
+
the head sends that it holds also carries its `text` block: version, hash
|
|
33
|
+
and current `dirty`), `onDocumentDeleted` (a deleted document has no built
|
|
34
|
+
state to carry, and the build-phase path never runs for one),
|
|
35
|
+
`onDocumentsBuilt` once per build for the documents nobody watches — chiefly
|
|
36
|
+
those rebuilt as a cascade, which no filesystem watcher can see because their
|
|
37
|
+
own files did not change — and `onProjectsChanged` from the project registry.
|
|
27
38
|
- **Projects as first-class:** `getProjects` and `getProjectForUri`, answered from
|
|
28
39
|
the framework's `ProjectManager`.
|
|
29
40
|
- **An opt-in reference/naming slice** — `findReferenceCandidates`,
|
|
@@ -38,6 +49,8 @@ The projection itself is not this package's: it delegates to `TransferEncoder`
|
|
|
38
49
|
and `ModelService` from `@hydranium/core`, so there is no second in-memory model
|
|
39
50
|
to keep in sync.
|
|
40
51
|
|
|
52
|
+
For the adopter extension path, see [Add a data-server method](../../docs/guides/data-server-method.md). It covers the typed subclass, `additionalMethods`, shared namespace, and client proxy as one wire contract.
|
|
53
|
+
|
|
41
54
|
## Install
|
|
42
55
|
|
|
43
56
|
```bash
|
|
@@ -58,12 +71,13 @@ launchers live in `@hydranium/core/node`, not here.
|
|
|
58
71
|
| `./node` | `nodeDataServerDiagnostics()`, the runtime-backed half of the diagnostics seam. | Node-only |
|
|
59
72
|
| `./testing` | `makeDataServerHarness` — a real server driven in-process over a duplex connection pair. | Node-only (`vscode-jsonrpc/node`) |
|
|
60
73
|
|
|
61
|
-
`.` is gated as browser-neutral in CI (`scripts/check-neutral-bundles.
|
|
74
|
+
`.` is gated as browser-neutral in CI (`scripts/check-neutral-bundles.mts`). It
|
|
62
75
|
stays that way through a `browser` field in `package.json` that swaps the
|
|
63
76
|
diagnostics default for a browser twin, so a bundler never follows the
|
|
64
77
|
`@hydranium/core/node` import a Node host resolves — see [what "gated neutral" does and does not promise](../../docs/concepts/browser-hosting.md#a-note-on-what-gated-neutral-does-and-does-not-promise).
|
|
65
|
-
|
|
66
|
-
`
|
|
78
|
+
Resolve the subpaths with [a resolver that reads
|
|
79
|
+
`exports`](../../docs/adopting/requirements.md#a-resolver-that-reads-exports);
|
|
80
|
+
`"Node"` (node10) reaches none of them.
|
|
67
81
|
|
|
68
82
|
## Getting oriented
|
|
69
83
|
|