@hydranium/data-client-theia 1.0.0-next.215 → 1.0.0-next.217
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 -14
- package/lib/browser/channel-data-port.d.ts +1 -1
- package/lib/browser/channel-data-port.d.ts.map +1 -1
- package/lib/browser/channel-data-port.js +1 -1
- package/lib/browser/channel-data-port.js.map +1 -1
- package/lib/browser/data-session-stop-contribution.d.ts +16 -4
- package/lib/browser/data-session-stop-contribution.d.ts.map +1 -1
- package/lib/browser/data-session-stop-contribution.js +32 -3
- package/lib/browser/data-session-stop-contribution.js.map +1 -1
- package/lib/browser/host-diagnostics-frontend.js +1 -1
- package/lib/browser/host-diagnostics-frontend.js.map +1 -1
- package/lib/node/data-server-connection-handler.d.ts +1 -1
- package/lib/node/data-server-connection-handler.d.ts.map +1 -1
- package/lib/node/data-server-connection-handler.js +1 -1
- package/lib/node/data-server-connection-handler.js.map +1 -1
- package/lib/node/host-diagnostics-server.js +1 -1
- package/lib/node/host-diagnostics-server.js.map +1 -1
- package/package.json +5 -17
- package/src/browser/channel-data-port.ts +1 -1
- package/src/browser/data-session-stop-contribution.ts +40 -6
- package/src/browser/host-diagnostics-frontend.ts +1 -1
- package/src/node/data-server-connection-handler.ts +1 -1
- package/src/node/host-diagnostics-server.ts +1 -1
package/README.md
CHANGED
|
@@ -45,9 +45,10 @@ text edits.
|
|
|
45
45
|
would hang in port discovery; pass this as `whenReady`.
|
|
46
46
|
- **`DataSessionStopContribution`** — ends a frontend's data sessions with its
|
|
47
47
|
page, so the server ends them as closed rather than waiting for the connection
|
|
48
|
-
to go, and holds the page while one of them is saving.
|
|
49
|
-
`
|
|
50
|
-
|
|
48
|
+
to go, and holds the page while one of them is saving.
|
|
49
|
+
`bindDataConnection(bind, isBound, ConnectionClass)` binds a connection with
|
|
50
|
+
its sessions tracked, and binds this contribution and the
|
|
51
|
+
`ConnectionReporter` the connection's port injects unless they are bound.
|
|
51
52
|
- **Backend (`./node`)** — `DataServerConnectionHandler` (the socket bridge,
|
|
52
53
|
over `@hydranium/client-theia`'s `SocketChannelForwarder`),
|
|
53
54
|
`createDataServerConnectionContainerModule(...handlers)` for the
|
|
@@ -80,11 +81,15 @@ This package declares no `theiaExtensions` — it is a library your own Theia
|
|
|
80
81
|
extension builds on. That extension's `package.json` declares the entries, and
|
|
81
82
|
each entry names one frontend/backend module pair:
|
|
82
83
|
|
|
83
|
-
- the **frontend** module
|
|
84
|
-
|
|
85
|
-
`
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
- the **frontend** module:
|
|
85
|
+
- binds your `ChannelDataPort` subclass in singleton scope;
|
|
86
|
+
- calls `bindDataConnection(bind, isBound, MyConnection)` for the connection
|
|
87
|
+
over it;
|
|
88
|
+
- calls `bindChannelLogger` from `@hydranium/client-theia`, where the port
|
|
89
|
+
logs the connection failures it leaves to the reporter;
|
|
90
|
+
- calls `bindEditorDiskSync` from `@hydranium/client-theia`, since a data
|
|
91
|
+
server save writes a file an editor can have open;
|
|
92
|
+
- calls `bindHostDiagnostics` for the diagnostics commands;
|
|
88
93
|
- the **backend** module is typically a one-liner:
|
|
89
94
|
`export default createDataServerConnectionContainerModule(MyHandler)`, where
|
|
90
95
|
`MyHandler` extends `DataServerConnectionHandler`.
|
|
@@ -107,14 +112,15 @@ its loading state indefinitely with nothing in the server log to say why.
|
|
|
107
112
|
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
|
|
108
113
|
| `.` | Nothing — the surface is split by environment, so the root barrel stays empty. | browser-neutral (gated) |
|
|
109
114
|
| `./common` | `EmitterDataClient` — a module lands here only when values, types and relative imports are all neutral or Theia COMMON tier. No error-reconstruction bridge, and that is a property of the transport: the direct `vscode-jsonrpc` connection carries a typed error across the relay natively. | browser-neutral (gated) |
|
|
110
|
-
| `./browser` | `openChannelConnection`, `createChannelConnection`, the three `Abstract*DataServiceFrontend` bases, `bindHostDiagnostics`, `whenWorkspaceOpen`, `DataSessionStopContribution` | browser / Theia frontend (gated) |
|
|
115
|
+
| `./browser` | `openChannelConnection`, `createChannelConnection`, the three `Abstract*DataServiceFrontend` bases, `bindHostDiagnostics`, `whenWorkspaceOpen`, `DataSessionStopContribution`, `bindDataConnection` | browser / Theia frontend (gated) |
|
|
111
116
|
| `./node` | `DataServerConnectionHandler`, `createDataServerConnectionContainerModule`, `HostDiagnosticsServer`, `createHostDiagnosticsBackendModule` | Node / Theia backend |
|
|
112
117
|
|
|
113
|
-
|
|
114
|
-
`
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
+
Resolve the subpaths with [a resolver that reads
|
|
119
|
+
`exports`](../../docs/adopting/requirements.md#a-resolver-that-reads-exports);
|
|
120
|
+
`"Node"` (node10) reaches none of them. "Gated" means the
|
|
121
|
+
repository's neutral-bundle check enforces that the entry bundles for the
|
|
122
|
+
browser with no `node:*` import, transitive ones included; `./node` is
|
|
123
|
+
deliberately outside that gate. Also worth reading: [what "gated neutral" does and does not promise](../../docs/concepts/browser-hosting.md#a-note-on-what-gated-neutral-does-and-does-not-promise).
|
|
118
124
|
|
|
119
125
|
## Status
|
|
120
126
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
|
-
import { ChannelLogger, ConnectionReporter, type ConnectionAttempt, type ConnectionTarget } from '@hydranium/client-theia/
|
|
9
|
+
import { ChannelLogger, ConnectionReporter, type ConnectionAttempt, type ConnectionTarget } from '@hydranium/client-theia/browser';
|
|
10
10
|
import { type DataPort, type ResolvedMessage, type RpcConnectionLifecycle } from '@hydranium/protocol';
|
|
11
11
|
import { Emitter, MessageService, type Event } from '@theia/core';
|
|
12
12
|
import { type ServiceConnectionProvider } from '@theia/core/lib/browser';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel-data-port.d.ts","sourceRoot":"","sources":["../../src/browser/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AAC,QAAQ,CAAC,yBAAyB,EAAE,OAAO,CAAQ;IAE7D,SAAS,CAAC,QAAQ,CAAC,cAAc,gBAAuB;IACxD,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAA6B;IAE5D,SAAS,CAAC,MAAM,CAAC,EAAE,uBAAuB,CAAC;IAE3C,6FAA6F;IAC7F,SAAS,CAAC,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAU;IAC3D,SAAS,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC;IACtC,SAAS,CAAC,YAAY,CAAC,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;IACvD,6FAA6F;IAC7F,SAAS,CAAC,kBAAkB,UAAS;IAErC,iFAAiF;IACjF,QAAQ,CAAC,mBAAmB,EAAE,sBAAsB,CAclD;IAEF;;;;;;;OAOG;IACH,OAAO,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAgBpC;IAED;;;;;;;;;OASG;IACH,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,GAAG,IAAI,CAS5D;IAED,8DAA8D;IAC9D,SAAS,CAAC,aAAa,CAAC,MAAM,GAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAqC,GAAG,IAAI,CAO3G;IAED,SAAS,KAAK,gBAAgB,IAAI,gBAAgB,CAKjD;IACD,sEAAsE;IACtE,SAAS,CAAC,sBAAsB,CAAC,EAAE,gBAAgB,CAAC;IAEpD,SAAS,CAAC,kBAAkB,IAAI,MAAM,CAErC;IAED,SAAS,CAAC,qBAAqB,IAAI,MAAM,CAMxC;IAED,OAAO,IAAI,IAAI,CAMd;CACH"}
|
|
@@ -18,7 +18,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.ChannelDataPort = void 0;
|
|
21
|
-
const browser_1 = require("@hydranium/client-theia/
|
|
21
|
+
const browser_1 = require("@hydranium/client-theia/browser");
|
|
22
22
|
const protocol_1 = require("@hydranium/protocol");
|
|
23
23
|
const core_1 = require("@theia/core");
|
|
24
24
|
const service_connection_provider_1 = require("@theia/core/lib/browser/messaging/service-connection-provider");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel-data-port.js","sourceRoot":"","sources":["../../src/browser/channel-data-port.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;AAElF,
|
|
1
|
+
{"version":3,"file":"channel-data-port.js","sourceRoot":"","sources":["../../src/browser/channel-data-port.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;AAElF,6DAAmI;AACnI,kDAO6B;AAC7B,sCAAuE;AAEvE,+GAAyG;AACzG,4DAAkE;AAClE,0DAAgE;AAEhE,6DAA2F;AAC3F,qDAAqD;AAErD;;;;;;;;;;;GAWG;AAEI,IAAe,eAAe,GAA9B,MAAe,eAAe;IACmB,kBAAkB,CAA6B;IACvD,gBAAgB,CAAoB;IACtC,cAAc,CAAkB;IAC5B,kBAAkB,CAAsB;IAC7C,MAAM,CAAiB;IAKjE;;;;;OAKG;IACgB,yBAAyB,GAAY,IAAI,CAAC;IAE1C,cAAc,GAAG,IAAI,cAAO,EAAQ,CAAC;IAC/C,SAAS,GAAgB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC;IAElD,MAAM,CAA2B;IAE3C,6FAA6F;IAC1E,sBAAsB,GAAW,MAAM,CAAC;IACjD,OAAO,CAAqB;IAC5B,YAAY,CAAiC;IACvD,6FAA6F;IACnF,kBAAkB,GAAG,KAAK,CAAC;IAErC,iFAAiF;IACxE,mBAAmB,GAA2B;QACpD,YAAY,EAAE,GAAG,EAAE;YAChB,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;YAC/B,IAAI,CAAC,aAAa,EAAE,CAAC;YACrB,MAAM,OAAO,GAAG,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,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ACvH,CAAC;IAES,qBAAqB;QAC5B,OAAO,UAAG,CAAC,QAAQ,CAChB,iDAAiD,EACjD,oDAAoD,EACpD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAAC,CACxD,CAAC;IACL,CAAC;IAED,OAAO;QACJ,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QACxB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACpC,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;IACjC,CAAC;CACH,CAAA;;AAnIuD;IAApD,IAAA,kBAAM,EAAC,sDAAwB,CAAC;;2DAAmE;AACvD;IAA5C,IAAA,kBAAM,EAAC,0BAAgB,CAAC;8BAAuC,0BAAgB;yDAAC;AACtC;IAA1C,IAAA,kBAAM,EAAC,qBAAc,CAAC;8BAAqC,qBAAc;uDAAC;AAC5B;IAA9C,IAAA,kBAAM,EAAC,4BAAkB,CAAC;;2DAA4D;AAC7C;IAAzC,IAAA,kBAAM,EAAC,uBAAa,CAAC;8BAA6B,uBAAa;+CAAC;0BAL9C,eAAe;IADpC,IAAA,sBAAU,GAAE;GACS,eAAe,CAoIpC"}
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
import type { DataConnection, DataServerProtocol, DataSession, DiagnosticOf, TransferElement } from '@hydranium/protocol';
|
|
10
|
-
import
|
|
10
|
+
import { FrontendApplicationContribution, type OnWillStopAction } from '@theia/core/lib/browser/frontend-application-contribution';
|
|
11
|
+
import { type interfaces } from '@theia/core/shared/inversify';
|
|
11
12
|
/**
|
|
12
13
|
* Ends a Theia frontend's data sessions with its page, and holds the page
|
|
13
|
-
* while one of them is still saving.
|
|
14
|
-
*
|
|
15
|
-
* data connection the frontend binds, once.
|
|
14
|
+
* while one of them is still saving. {@link bindDataConnection} binds it and
|
|
15
|
+
* has it {@link track} each data connection bound through it.
|
|
16
16
|
*
|
|
17
17
|
* **Stop.** {@link onStop} disposes every tracked session, which sends its
|
|
18
18
|
* `closeSession`, so the server ends it as closed: each document it was the
|
|
@@ -61,4 +61,16 @@ export declare class DataSessionStopContribution implements FrontendApplicationC
|
|
|
61
61
|
protected savingSessions(): DataSession<TransferElement>[];
|
|
62
62
|
onStop(): void;
|
|
63
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Bind `connectionClass` in singleton scope, its sessions tracked by the
|
|
66
|
+
* {@link DataSessionStopContribution}, and bind that contribution and the
|
|
67
|
+
* `ConnectionReporter` the connection's port injects unless they are bound
|
|
68
|
+
* already. The binding's `onActivation` is taken; a frontend's own hook on the
|
|
69
|
+
* connection goes on the container's `onActivation`, which runs after it. A
|
|
70
|
+
* subclass of the contribution is rebound after this call: one bound before it
|
|
71
|
+
* is never registered as a frontend contribution, so its stop never runs.
|
|
72
|
+
* Call it once per connection class: a second call makes the class's lookup
|
|
73
|
+
* ambiguous.
|
|
74
|
+
*/
|
|
75
|
+
export declare function bindDataConnection<TTransfer extends TransferElement, TServer extends DataServerProtocol<TTransfer, DiagnosticOf<TServer>>, TClient extends object>(bind: interfaces.Bind, isBound: interfaces.IsBound, connectionClass: interfaces.Newable<DataConnection<TTransfer, TServer, TClient>>): void;
|
|
64
76
|
//# sourceMappingURL=data-session-stop-contribution.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-session-stop-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/data-session-stop-contribution.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;
|
|
1
|
+
{"version":3,"file":"data-session-stop-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/data-session-stop-contribution.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,KAAK,E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O,EAAE,OAAO,CAAC,CAAC,GAChF,IAAI,CAaN"}
|
|
@@ -15,12 +15,16 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.DataSessionStopContribution = void 0;
|
|
18
|
+
exports.bindDataConnection = bindDataConnection;
|
|
19
|
+
const browser_1 = require("@hydranium/client-theia/browser");
|
|
20
|
+
// Not the `@theia/core/lib/browser` barrel: it touches DOM globals at module
|
|
21
|
+
// load, which the node-environment unit tests cannot provide.
|
|
22
|
+
const frontend_application_contribution_1 = require("@theia/core/lib/browser/frontend-application-contribution");
|
|
18
23
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
19
24
|
/**
|
|
20
25
|
* Ends a Theia frontend's data sessions with its page, and holds the page
|
|
21
|
-
* while one of them is still saving.
|
|
22
|
-
*
|
|
23
|
-
* data connection the frontend binds, once.
|
|
26
|
+
* while one of them is still saving. {@link bindDataConnection} binds it and
|
|
27
|
+
* has it {@link track} each data connection bound through it.
|
|
24
28
|
*
|
|
25
29
|
* **Stop.** {@link onStop} disposes every tracked session, which sends its
|
|
26
30
|
* `closeSession`, so the server ends it as closed: each document it was the
|
|
@@ -114,4 +118,29 @@ exports.DataSessionStopContribution = DataSessionStopContribution;
|
|
|
114
118
|
exports.DataSessionStopContribution = DataSessionStopContribution = __decorate([
|
|
115
119
|
(0, inversify_1.injectable)()
|
|
116
120
|
], DataSessionStopContribution);
|
|
121
|
+
/**
|
|
122
|
+
* Bind `connectionClass` in singleton scope, its sessions tracked by the
|
|
123
|
+
* {@link DataSessionStopContribution}, and bind that contribution and the
|
|
124
|
+
* `ConnectionReporter` the connection's port injects unless they are bound
|
|
125
|
+
* already. The binding's `onActivation` is taken; a frontend's own hook on the
|
|
126
|
+
* connection goes on the container's `onActivation`, which runs after it. A
|
|
127
|
+
* subclass of the contribution is rebound after this call: one bound before it
|
|
128
|
+
* is never registered as a frontend contribution, so its stop never runs.
|
|
129
|
+
* Call it once per connection class: a second call makes the class's lookup
|
|
130
|
+
* ambiguous.
|
|
131
|
+
*/
|
|
132
|
+
function bindDataConnection(bind, isBound, connectionClass) {
|
|
133
|
+
bind(connectionClass)
|
|
134
|
+
.toSelf()
|
|
135
|
+
.inSingletonScope()
|
|
136
|
+
.onActivation((context, connection) => {
|
|
137
|
+
context.container.get(DataSessionStopContribution).track(connection);
|
|
138
|
+
return connection;
|
|
139
|
+
});
|
|
140
|
+
if (!isBound(DataSessionStopContribution)) {
|
|
141
|
+
bind(DataSessionStopContribution).toSelf().inSingletonScope();
|
|
142
|
+
bind(frontend_application_contribution_1.FrontendApplicationContribution).toService(DataSessionStopContribution);
|
|
143
|
+
}
|
|
144
|
+
(0, browser_1.bindConnectionReporter)(bind, isBound);
|
|
145
|
+
}
|
|
117
146
|
//# sourceMappingURL=data-session-stop-contribution.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-session-stop-contribution.js","sourceRoot":"","sources":["../../src/browser/data-session-stop-contribution.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF
|
|
1
|
+
{"version":3,"file":"data-session-stop-contribution.js","sourceRoot":"","sources":["../../src/browser/data-session-stop-contribution.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;AAElF,6DAAyE;AAEzE,6EAA6E;AAC7E,8DAA8D;AAC9D,iHAAmI;AACnI,4DAA2E;AAE3E;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEI,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IACrC,wEAAwE;IACrD,QAAQ,GAAG,IAAI,GAAG,EAAgC,CAAC;IACtE;;;;OAIG;IACgB,eAAe,GAAW,CAAC,CAAC;IAE/C;;;;OAIG;IACH,KAAK,CACF,UAAuD;QAEvD,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CA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O,CAAC,EAAE,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;gBACxE,CAAC;gBACD,OAAO,IAAI,CAAC;YACf,CAAC;SACH,CAAC;IACL,CAAC;IAED,kDAAkD;IACxC,cAAc;QACrB,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACzE,CAAC;IAED,MAAM;QACH,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnC,OAAO,CAAC,OAAO,EAAE,CAAC;QACrB,CAAC;IACJ,CAAC;CACH,CAAA;;sCAzEY,2BAA2B;IADvC,IAAA,sBAAU,GAAE;GACA,2BAA2B,CAyEvC;AAED;;;;;;;;;;GAUG;AACH,4BAKG,IAAqB,EACrB,OAA2B,EAC3B,eAAgF;IAEhF,IAAI,CAAC,eAAe,CAAC;SACjB,MAAM,EAAE;SACR,gBAAgB,EAAE;SAClB,YAAY,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE;QACnC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACrE,OAAO,UAAU,CAAC;IACrB,CAAC,CAAC,CAAC;IACN,IAAI,CAAC,OAAO,CAAC,2BAA2B,CAAC,EAAE,CAAC;QACzC,IAAI,CAAC,2BAA2B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;QAC9D,IAAI,CAAC,mEAA+B,CAAC,CAAC,SAAS,CAAC,2BAA2B,CAAC,CAAC;IAChF,CAAC;IACD,IAAA,gCAAsB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
********************************************************************************/
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
11
|
exports.bindHostDiagnostics = bindHostDiagnostics;
|
|
12
|
-
const browser_1 = require("@hydranium/client-theia/
|
|
12
|
+
const browser_1 = require("@hydranium/client-theia/browser");
|
|
13
13
|
const protocol_1 = require("@hydranium/protocol");
|
|
14
14
|
const service_connection_provider_1 = require("@theia/core/lib/browser/messaging/service-connection-provider");
|
|
15
15
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-diagnostics-frontend.js","sourceRoot":"","sources":["../../src/browser/host-diagnostics-frontend.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAElF,
|
|
1
|
+
{"version":3,"file":"host-diagnostics-frontend.js","sourceRoot":"","sources":["../../src/browser/host-diagnostics-frontend.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAElF,6DAA+E;AAC/E,kDAA0F;AAC1F,+GAAyI;AAGzI;;;;;;;GAOG;AACH,6BAAoC,IAAqB;IACtD,IAAI,CAAC,sCAA4B,CAAC;SAC9B,cAAc,CAAC,OAAO,CAAC,EAAE;QACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,GAAG,CAA4B,sDAAwB,CAAC,CAAC;QAC5F,OAAO,QAAQ,CAAC,WAAW,CAA0B,gCAAqB,CAAC,CAAC;IAC/E,CAAC,CAAC;SACD,gBAAgB,EAAE,CAAC;AAC1B,CAAC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
|
-
import { AbstractSocketForwardingConnectionHandler } from '@hydranium/client-theia/
|
|
9
|
+
import { AbstractSocketForwardingConnectionHandler } from '@hydranium/client-theia/node';
|
|
10
10
|
import type * as net from 'node:net';
|
|
11
11
|
/** Options for {@link DataServerConnectionHandler}. `servicePath` is the Theia
|
|
12
12
|
* service path the browser frontend opens a channel to; `portCommand` is the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-server-connection-handler.d.ts","sourceRoot":"","sources":["../../src/node/data-server-connection-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,yCAAyC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"data-server-connection-handler.d.ts","sourceRoot":"","sources":["../../src/node/data-server-connection-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,yCAAyC,EAAE,MAAM,8BAA8B,CAAC;AAGzF,OAAO,KAAK,KAAK,GAAG,MAAM,UAAU,CAAC;AAErC;;;;kBAIkB;AAClB,MAAM,WAAW,kCAAkC;IAChD;;;;yDAIqD;IACrD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;uCAEmC;IACnC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,sDAAsD;IACtD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,KAAK,IAAI,CAAC;CAC1D;AAED;;;;;;;;GAQG;AACH,qBACa,2BAA4B,SAAQ,yCAAyC;IACvF,YAAyB,OAAO,GAAE,kCAAuC,EAWxE;IAED;2CACuC;IACvC,UAAmB,oBAAoB,IAAI,IAAI,CAAG;CACpD"}
|
|
@@ -21,7 +21,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
exports.DataServerConnectionHandler = void 0;
|
|
24
|
-
const node_1 = require("@hydranium/client-theia/
|
|
24
|
+
const node_1 = require("@hydranium/client-theia/node");
|
|
25
25
|
const protocol_1 = require("@hydranium/protocol");
|
|
26
26
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
27
27
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-server-connection-handler.js","sourceRoot":"","sources":["../../src/node/data-server-connection-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;AAElF,
|
|
1
|
+
{"version":3,"file":"data-server-connection-handler.js","sourceRoot":"","sources":["../../src/node/data-server-connection-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;AAElF,uDAAyF;AACzF,kDAAiF;AACjF,4DAAqE;AAkCrE;;;;;;;;GAQG;AAEI,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,gDAAyC;IACvF,YAAyB,UAA8C,EAAE;QACtE,KAAK,CAAC;YACH,IAAI,EAAE,OAAO,CAAC,WAAW,IAAI,2BAAgB;YAC7C,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,mCAAwB;YAC5D,YAAY,EAAE,YAAY;YAC1B,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,aAAa;YAC/C,eAAe,EAAE,OAAO,CAAC,eAAe;YACxC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;YAC1C,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;YAC1C,eAAe,EAAE,OAAO,CAAC,eAAe;SAC1C,CAAC,CAAC;IACN,CAAC;IAED;2CACuC;IACpB,oBAAoB,KAAU,CAAC;CACpD,CAAA;;sCAjBY,2BAA2B;IADvC,IAAA,sBAAU,GAAE;IAEG,WAAA,IAAA,qBAAS,GAAE,CAAA;;GADd,2BAA2B,CAiBvC"}
|
|
@@ -16,7 +16,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.HostDiagnosticsServer = void 0;
|
|
18
18
|
exports.createHostDiagnosticsBackendModule = createHostDiagnosticsBackendModule;
|
|
19
|
-
const node_1 = require("@hydranium/protocol/
|
|
19
|
+
const node_1 = require("@hydranium/protocol/node");
|
|
20
20
|
const protocol_1 = require("@hydranium/protocol");
|
|
21
21
|
const core_1 = require("@theia/core");
|
|
22
22
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-diagnostics-server.js","sourceRoot":"","sources":["../../src/node/host-diagnostics-server.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;AAElF,
|
|
1
|
+
{"version":3,"file":"host-diagnostics-server.js","sourceRoot":"","sources":["../../src/node/host-diagnostics-server.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;AAElF,mDAAuF;AACvF,kDAK6B;AAC7B,sCAAsE;AACtE,4DAA2E;AAE3E;;;;;;GAMG;AAEI,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAC/B,KAAK,CAAC,aAAa,CAAC,IAAuB;QACxC,MAAM,QAAQ,GAAG,IAAA,0BAAmB,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,uBAAuB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC;QAC/G,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvB,OAAO,QAAQ,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,qBAAqB,CAAC,IAA+B;QACxD,MAAM,QAAQ,GAAG,IAAA,6BAAsB,EAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,IAAI,SAAS,EAAE,cAAc,CAAC,CAAC;QACjG,OAAO,CAAC,IAAI,CAAC,iCAAiC,QAAQ,EAAE,CAAC,CAAC;QAC1D,OAAO,QAAQ,CAAC;IACnB,CAAC;CACH,CAAA;;gCAZY,qBAAqB;IADjC,IAAA,sBAAU,GAAE;GACA,qBAAqB,CAYjC;AAED;;;;;;;GAOG;AACH;IACG,OAAO,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;QAC/B,IAAI,CAAC,qBAAqB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;QACxD,IAAI,CAAC,wBAAiB,CAAC;aACnB,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,2BAAoB,CAAC,gCAAqB,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,CAAC;aAC9H,gBAAgB,EAAE,CAAC;IAC1B,CAAC,CAAC,CAAC;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hydranium/data-client-theia",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.217",
|
|
4
4
|
"description": "Theia-coupled client primitives for the hydranium data-server protocol head; companion of @hydranium/data-server. Bridges framework typed errors (e.g. ConflictError) across Theia's RPC boundary so their code + data survive the wire.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hydranium",
|
|
@@ -46,18 +46,6 @@
|
|
|
46
46
|
"./node": {
|
|
47
47
|
"types": "./lib/node/index.d.ts",
|
|
48
48
|
"default": "./lib/node/index.js"
|
|
49
|
-
},
|
|
50
|
-
"./lib/common": {
|
|
51
|
-
"types": "./lib/common/index.d.ts",
|
|
52
|
-
"default": "./lib/common/index.js"
|
|
53
|
-
},
|
|
54
|
-
"./lib/browser": {
|
|
55
|
-
"types": "./lib/browser/index.d.ts",
|
|
56
|
-
"default": "./lib/browser/index.js"
|
|
57
|
-
},
|
|
58
|
-
"./lib/node": {
|
|
59
|
-
"types": "./lib/node/index.d.ts",
|
|
60
|
-
"default": "./lib/node/index.js"
|
|
61
49
|
}
|
|
62
50
|
},
|
|
63
51
|
"publishConfig": {
|
|
@@ -73,8 +61,8 @@
|
|
|
73
61
|
"watch": "tsc -b -w --preserveWatchOutput"
|
|
74
62
|
},
|
|
75
63
|
"devDependencies": {
|
|
76
|
-
"@hydranium/client-theia": "1.0.0-next.
|
|
77
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
64
|
+
"@hydranium/client-theia": "1.0.0-next.217",
|
|
65
|
+
"@hydranium/protocol": "1.0.0-next.217",
|
|
78
66
|
"@theia/core": "^1.70.0",
|
|
79
67
|
"@theia/workspace": "^1.70.0",
|
|
80
68
|
"@types/node": "^22.0.0",
|
|
@@ -85,8 +73,8 @@
|
|
|
85
73
|
"vscode-jsonrpc": "9.0.0"
|
|
86
74
|
},
|
|
87
75
|
"peerDependencies": {
|
|
88
|
-
"@hydranium/client-theia": "1.0.0-next.
|
|
89
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
76
|
+
"@hydranium/client-theia": "1.0.0-next.217",
|
|
77
|
+
"@hydranium/protocol": "1.0.0-next.217",
|
|
90
78
|
"@theia/core": "^1.70.0",
|
|
91
79
|
"@theia/workspace": "^1.70.0",
|
|
92
80
|
"inversify": "^6.0.0",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
|
|
10
|
-
import { ChannelLogger, ConnectionReporter, type ConnectionAttempt, type ConnectionTarget } from '@hydranium/client-theia/
|
|
10
|
+
import { ChannelLogger, ConnectionReporter, type ConnectionAttempt, type ConnectionTarget } from '@hydranium/client-theia/browser';
|
|
11
11
|
import {
|
|
12
12
|
DATA_SERVER_CONNECT_FAILED,
|
|
13
13
|
DATA_SERVER_NOT_READY,
|
|
@@ -7,17 +7,17 @@
|
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
|
|
10
|
+
import { bindConnectionReporter } from '@hydranium/client-theia/browser';
|
|
10
11
|
import type { DataConnection, DataServerProtocol, DataSession, DiagnosticOf, TransferElement } from '@hydranium/protocol';
|
|
11
|
-
//
|
|
12
|
+
// Not the `@theia/core/lib/browser` barrel: it touches DOM globals at module
|
|
12
13
|
// load, which the node-environment unit tests cannot provide.
|
|
13
|
-
import
|
|
14
|
-
import { injectable } from '@theia/core/shared/inversify';
|
|
14
|
+
import { FrontendApplicationContribution, type OnWillStopAction } from '@theia/core/lib/browser/frontend-application-contribution';
|
|
15
|
+
import { injectable, type interfaces } from '@theia/core/shared/inversify';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* Ends a Theia frontend's data sessions with its page, and holds the page
|
|
18
|
-
* while one of them is still saving.
|
|
19
|
-
*
|
|
20
|
-
* data connection the frontend binds, once.
|
|
19
|
+
* while one of them is still saving. {@link bindDataConnection} binds it and
|
|
20
|
+
* has it {@link track} each data connection bound through it.
|
|
21
21
|
*
|
|
22
22
|
* **Stop.** {@link onStop} disposes every tracked session, which sends its
|
|
23
23
|
* `closeSession`, so the server ends it as closed: each document it was the
|
|
@@ -115,3 +115,37 @@ export class DataSessionStopContribution implements FrontendApplicationContribut
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Bind `connectionClass` in singleton scope, its sessions tracked by the
|
|
121
|
+
* {@link DataSessionStopContribution}, and bind that contribution and the
|
|
122
|
+
* `ConnectionReporter` the connection's port injects unless they are bound
|
|
123
|
+
* already. The binding's `onActivation` is taken; a frontend's own hook on the
|
|
124
|
+
* connection goes on the container's `onActivation`, which runs after it. A
|
|
125
|
+
* subclass of the contribution is rebound after this call: one bound before it
|
|
126
|
+
* is never registered as a frontend contribution, so its stop never runs.
|
|
127
|
+
* Call it once per connection class: a second call makes the class's lookup
|
|
128
|
+
* ambiguous.
|
|
129
|
+
*/
|
|
130
|
+
export function bindDataConnection<
|
|
131
|
+
TTransfer extends TransferElement,
|
|
132
|
+
TServer extends DataServerProtocol<TTransfer, DiagnosticOf<TServer>>,
|
|
133
|
+
TClient extends object
|
|
134
|
+
>(
|
|
135
|
+
bind: interfaces.Bind,
|
|
136
|
+
isBound: interfaces.IsBound,
|
|
137
|
+
connectionClass: interfaces.Newable<DataConnection<TTransfer, TServer, TClient>>
|
|
138
|
+
): void {
|
|
139
|
+
bind(connectionClass)
|
|
140
|
+
.toSelf()
|
|
141
|
+
.inSingletonScope()
|
|
142
|
+
.onActivation((context, connection) => {
|
|
143
|
+
context.container.get(DataSessionStopContribution).track(connection);
|
|
144
|
+
return connection;
|
|
145
|
+
});
|
|
146
|
+
if (!isBound(DataSessionStopContribution)) {
|
|
147
|
+
bind(DataSessionStopContribution).toSelf().inSingletonScope();
|
|
148
|
+
bind(FrontendApplicationContribution).toService(DataSessionStopContribution);
|
|
149
|
+
}
|
|
150
|
+
bindConnectionReporter(bind, isBound);
|
|
151
|
+
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
|
|
10
|
-
import { HostMemoryDiagnosticsService } from '@hydranium/client-theia/
|
|
10
|
+
import { HostMemoryDiagnosticsService } from '@hydranium/client-theia/browser';
|
|
11
11
|
import { HOST_DIAGNOSTICS_PATH, type HostDiagnosticsProtocol } from '@hydranium/protocol';
|
|
12
12
|
import { RemoteConnectionProvider, type ServiceConnectionProvider } from '@theia/core/lib/browser/messaging/service-connection-provider';
|
|
13
13
|
import { type interfaces } from '@theia/core/shared/inversify';
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
|
|
10
|
-
import { AbstractSocketForwardingConnectionHandler } from '@hydranium/client-theia/
|
|
10
|
+
import { AbstractSocketForwardingConnectionHandler } from '@hydranium/client-theia/node';
|
|
11
11
|
import { DATA_SERVER_PATH, DATA_SERVER_PORT_COMMAND } from '@hydranium/protocol';
|
|
12
12
|
import { injectable, unmanaged } from '@theia/core/shared/inversify';
|
|
13
13
|
import type * as net from 'node:net';
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
|
|
10
|
-
import { formatProcessMemory, writeHeapSnapshotToDir } from '@hydranium/protocol/
|
|
10
|
+
import { formatProcessMemory, writeHeapSnapshotToDir } from '@hydranium/protocol/node';
|
|
11
11
|
import {
|
|
12
12
|
HOST_DIAGNOSTICS_PATH,
|
|
13
13
|
type DumpHostStateArgs,
|