@jupyterlite/server 0.6.0-alpha.0 → 0.6.0-alpha.10
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/lib/index.d.ts +1 -3
- package/lib/index.js +1 -3
- package/lib/index.js.map +1 -1
- package/lib/service-worker-manager.d.ts +68 -0
- package/lib/service-worker-manager.js +195 -0
- package/lib/service-worker-manager.js.map +1 -0
- package/lib/service-worker.d.ts +2 -2
- package/lib/service-worker.js +18 -11
- package/lib/service-worker.js.map +1 -1
- package/lib/tokens.d.ts +25 -0
- package/lib/tokens.js +1 -1
- package/lib/tokens.js.map +1 -1
- package/package.json +16 -17
- package/src/index.ts +1 -3
- package/src/service-worker-manager.ts +253 -0
- package/src/service-worker.ts +21 -11
- package/src/tokens.ts +34 -1
- package/lib/app.d.ts +0 -87
- package/lib/app.js +0 -155
- package/lib/app.js.map +0 -1
- package/lib/router.d.ts +0 -99
- package/lib/router.js +0 -111
- package/lib/router.js.map +0 -1
- package/lib/service-manager.d.ts +0 -21
- package/lib/service-manager.js +0 -96
- package/lib/service-manager.js.map +0 -1
- package/lib/status.d.ts +0 -18
- package/lib/status.js +0 -21
- package/lib/status.js.map +0 -1
- package/src/app.ts +0 -200
- package/src/router.ts +0 -170
- package/src/service-manager.ts +0 -118
- package/src/status.ts +0 -21
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
// Copyright (c) Jupyter Development Team.
|
|
2
2
|
// Distributed under the terms of the Modified BSD License.
|
|
3
|
-
export * from './app';
|
|
4
|
-
export * from './router';
|
|
5
3
|
export * from './tokens';
|
|
6
|
-
export * from './service-manager';
|
|
4
|
+
export * from './service-worker-manager';
|
|
7
5
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,cAAc,UAAU,CAAC;AACzB,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { ISignal } from '@lumino/signaling';
|
|
2
|
+
import { IServiceWorkerManager } from './tokens';
|
|
3
|
+
/**
|
|
4
|
+
* A class that manages the ServiceWorker registration and communication,
|
|
5
|
+
* used for accessing the file system.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ServiceWorkerManager implements IServiceWorkerManager {
|
|
8
|
+
/**
|
|
9
|
+
* Construct a new ServiceWorkerManager.
|
|
10
|
+
*/
|
|
11
|
+
constructor(options: IServiceWorkerManager.IOptions);
|
|
12
|
+
/**
|
|
13
|
+
* A signal emitted when the registration changes.
|
|
14
|
+
*/
|
|
15
|
+
get registrationChanged(): ISignal<IServiceWorkerManager, ServiceWorkerRegistration | null>;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the ServiceWorker is enabled or not.
|
|
18
|
+
*/
|
|
19
|
+
get enabled(): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* A unique id to identify the browsing context where the ServiceWorkerManager was instantiated.
|
|
22
|
+
*/
|
|
23
|
+
get browsingContextId(): string;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the ServiceWorker is ready or not.
|
|
26
|
+
*/
|
|
27
|
+
get ready(): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Register a handler for stdin requests received via ServiceWorker.
|
|
30
|
+
* @param pathnameSuffix URL pathname suffix to match such as "kernel" or "terminal".
|
|
31
|
+
* @param stdinHandler
|
|
32
|
+
*/
|
|
33
|
+
registerStdinHandler(pathnameSuffix: string, stdinHandler: IServiceWorkerManager.IStdinHandler): void;
|
|
34
|
+
/**
|
|
35
|
+
* Initialize the ServiceWorkerManager.
|
|
36
|
+
*/
|
|
37
|
+
private _initialize;
|
|
38
|
+
/**
|
|
39
|
+
* Unregister old service workers if the version has changed.
|
|
40
|
+
*/
|
|
41
|
+
private _unregisterOldServiceWorkers;
|
|
42
|
+
/**
|
|
43
|
+
* Ping the service worker to keep it alive.
|
|
44
|
+
*/
|
|
45
|
+
private _pingServiceWorker;
|
|
46
|
+
/**
|
|
47
|
+
* Set the registration and emit a signal.
|
|
48
|
+
*/
|
|
49
|
+
private _setRegistration;
|
|
50
|
+
/**
|
|
51
|
+
* Handle a message received on the BroadcastChannel
|
|
52
|
+
*
|
|
53
|
+
* Message data is `any` because it can either be a drive message of type `TDriveReqiest<T>`
|
|
54
|
+
* or a stdin message of type `any` as ServiceWorkerManager passes it through to the
|
|
55
|
+
* stdinHandler without understanding or altering it.
|
|
56
|
+
*/
|
|
57
|
+
private _onBroadcastMessage;
|
|
58
|
+
private _onDriveMessage;
|
|
59
|
+
private _onStdinMessage;
|
|
60
|
+
private _registration;
|
|
61
|
+
private _registrationChanged;
|
|
62
|
+
private _ready;
|
|
63
|
+
private _broadcastChannel;
|
|
64
|
+
private _browsingContextId;
|
|
65
|
+
private _contents;
|
|
66
|
+
private _driveContentsProcessor;
|
|
67
|
+
private _stdinHandlers;
|
|
68
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { PageConfig, URLExt } from '@jupyterlab/coreutils';
|
|
2
|
+
import { DRIVE_API_PATH, DriveContentsProcessor, } from '@jupyterlite/contents';
|
|
3
|
+
import { PromiseDelegate, UUID } from '@lumino/coreutils';
|
|
4
|
+
import { Signal } from '@lumino/signaling';
|
|
5
|
+
import { WORKER_NAME } from './tokens';
|
|
6
|
+
/**
|
|
7
|
+
* The version of the app
|
|
8
|
+
*/
|
|
9
|
+
const VERSION = PageConfig.getOption('appVersion');
|
|
10
|
+
/**
|
|
11
|
+
* Used to keep the service worker alive
|
|
12
|
+
*/
|
|
13
|
+
const SW_PING_ENDPOINT = '/api/service-worker-heartbeat';
|
|
14
|
+
/**
|
|
15
|
+
* A class that manages the ServiceWorker registration and communication,
|
|
16
|
+
* used for accessing the file system.
|
|
17
|
+
*/
|
|
18
|
+
export class ServiceWorkerManager {
|
|
19
|
+
/**
|
|
20
|
+
* Construct a new ServiceWorkerManager.
|
|
21
|
+
*/
|
|
22
|
+
constructor(options) {
|
|
23
|
+
var _a;
|
|
24
|
+
/**
|
|
25
|
+
* Handle a message received on the BroadcastChannel
|
|
26
|
+
*
|
|
27
|
+
* Message data is `any` because it can either be a drive message of type `TDriveReqiest<T>`
|
|
28
|
+
* or a stdin message of type `any` as ServiceWorkerManager passes it through to the
|
|
29
|
+
* stdinHandler without understanding or altering it.
|
|
30
|
+
*/
|
|
31
|
+
this._onBroadcastMessage = async (event) => {
|
|
32
|
+
const { data, browsingContextId, pathname } = event.data;
|
|
33
|
+
if (browsingContextId !== this._browsingContextId) {
|
|
34
|
+
// Message is not meant for us
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (pathname.includes('/api/stdin/')) {
|
|
38
|
+
this._onStdinMessage(pathname, data);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
this._onDriveMessage(data);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
this._onDriveMessage = async (data) => {
|
|
45
|
+
const response = await this._driveContentsProcessor.processDriveRequest(data);
|
|
46
|
+
// pass the browsingContextId along so the Service Worker can identify the request
|
|
47
|
+
this._broadcastChannel.postMessage({
|
|
48
|
+
response,
|
|
49
|
+
browsingContextId: this._browsingContextId,
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
this._onStdinMessage = async (pathname, data) => {
|
|
53
|
+
// Expecting pathname of the form '<optional something>/api/stdin/<suffix>' from which
|
|
54
|
+
// suffix is used to identify which stdinHandler to call.
|
|
55
|
+
// `data: any` because ServiceWorkerManager accepts any data and passes it through
|
|
56
|
+
// to the stdinHandler without understanding or altering it.
|
|
57
|
+
const suffix = pathname.slice(pathname.lastIndexOf('/') + 1);
|
|
58
|
+
const stdinHandler = this._stdinHandlers.get(suffix);
|
|
59
|
+
if (stdinHandler !== undefined) {
|
|
60
|
+
const response = await stdinHandler(data);
|
|
61
|
+
this._broadcastChannel.postMessage({
|
|
62
|
+
response,
|
|
63
|
+
browsingContextId: this._browsingContextId,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
console.warn(`No stdin handler registered for '${pathname}'`);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
this._registration = null;
|
|
71
|
+
this._registrationChanged = new Signal(this);
|
|
72
|
+
this._ready = new PromiseDelegate();
|
|
73
|
+
this._stdinHandlers = new Map();
|
|
74
|
+
const workerUrl = (_a = options.workerUrl) !== null && _a !== void 0 ? _a : URLExt.join(PageConfig.getBaseUrl(), WORKER_NAME);
|
|
75
|
+
const fullWorkerUrl = new URL(workerUrl, window.location.href);
|
|
76
|
+
const enableCache = PageConfig.getOption('enableServiceWorkerCache') || 'false';
|
|
77
|
+
fullWorkerUrl.searchParams.set('enableCache', enableCache);
|
|
78
|
+
// Initialize broadcast channel related properties
|
|
79
|
+
this._browsingContextId = UUID.uuid4();
|
|
80
|
+
this._contents = options.contents;
|
|
81
|
+
this._broadcastChannel = new BroadcastChannel(DRIVE_API_PATH);
|
|
82
|
+
this._broadcastChannel.addEventListener('message', this._onBroadcastMessage);
|
|
83
|
+
this._driveContentsProcessor = new DriveContentsProcessor({
|
|
84
|
+
contentsManager: this._contents,
|
|
85
|
+
});
|
|
86
|
+
void this._initialize(fullWorkerUrl.href).catch(console.warn);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* A signal emitted when the registration changes.
|
|
90
|
+
*/
|
|
91
|
+
get registrationChanged() {
|
|
92
|
+
return this._registrationChanged;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Whether the ServiceWorker is enabled or not.
|
|
96
|
+
*/
|
|
97
|
+
get enabled() {
|
|
98
|
+
return this._registration !== null;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* A unique id to identify the browsing context where the ServiceWorkerManager was instantiated.
|
|
102
|
+
*/
|
|
103
|
+
get browsingContextId() {
|
|
104
|
+
return this._browsingContextId;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Whether the ServiceWorker is ready or not.
|
|
108
|
+
*/
|
|
109
|
+
get ready() {
|
|
110
|
+
return this._ready.promise;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Register a handler for stdin requests received via ServiceWorker.
|
|
114
|
+
* @param pathnameSuffix URL pathname suffix to match such as "kernel" or "terminal".
|
|
115
|
+
* @param stdinHandler
|
|
116
|
+
*/
|
|
117
|
+
registerStdinHandler(pathnameSuffix, stdinHandler) {
|
|
118
|
+
this._stdinHandlers.set(pathnameSuffix, stdinHandler);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Initialize the ServiceWorkerManager.
|
|
122
|
+
*/
|
|
123
|
+
async _initialize(workerUrl) {
|
|
124
|
+
const { serviceWorker } = navigator;
|
|
125
|
+
let registration = null;
|
|
126
|
+
if (!serviceWorker) {
|
|
127
|
+
console.warn('ServiceWorkers not supported in this browser');
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
else if (serviceWorker.controller) {
|
|
131
|
+
const scriptURL = serviceWorker.controller.scriptURL;
|
|
132
|
+
await this._unregisterOldServiceWorkers(scriptURL);
|
|
133
|
+
registration = (await serviceWorker.getRegistration(scriptURL)) || null;
|
|
134
|
+
// eslint-disable-next-line no-console
|
|
135
|
+
console.info('JupyterLite ServiceWorker was already registered');
|
|
136
|
+
}
|
|
137
|
+
if (!registration && serviceWorker) {
|
|
138
|
+
try {
|
|
139
|
+
// eslint-disable-next-line no-console
|
|
140
|
+
console.info('Registering new JupyterLite ServiceWorker', workerUrl);
|
|
141
|
+
registration = await serviceWorker.register(workerUrl);
|
|
142
|
+
// eslint-disable-next-line no-console
|
|
143
|
+
console.info('JupyterLite ServiceWorker was sucessfully registered');
|
|
144
|
+
}
|
|
145
|
+
catch (err) {
|
|
146
|
+
console.warn(err);
|
|
147
|
+
console.warn(`JupyterLite ServiceWorker registration unexpectedly failed: ${err}`);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
this._setRegistration(registration);
|
|
151
|
+
if (!registration) {
|
|
152
|
+
this._ready.reject(void 0);
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
this._ready.resolve(void 0);
|
|
156
|
+
setTimeout(this._pingServiceWorker, 20000);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Unregister old service workers if the version has changed.
|
|
161
|
+
*/
|
|
162
|
+
async _unregisterOldServiceWorkers(scriptURL) {
|
|
163
|
+
const versionKey = `${scriptURL}-version`;
|
|
164
|
+
// Check if we have an installed version. If we do, compare it to the current version
|
|
165
|
+
// and unregister all service workers if they are different.
|
|
166
|
+
const installedVersion = localStorage.getItem(versionKey);
|
|
167
|
+
if ((installedVersion && installedVersion !== VERSION) || !installedVersion) {
|
|
168
|
+
// eslint-disable-next-line no-console
|
|
169
|
+
console.info('New version, unregistering existing service workers.');
|
|
170
|
+
const registrations = await navigator.serviceWorker.getRegistrations();
|
|
171
|
+
await Promise.all(registrations.map((registration) => registration.unregister()));
|
|
172
|
+
// eslint-disable-next-line no-console
|
|
173
|
+
console.info('All existing service workers have been unregistered.');
|
|
174
|
+
}
|
|
175
|
+
localStorage.setItem(versionKey, VERSION);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Ping the service worker to keep it alive.
|
|
179
|
+
*/
|
|
180
|
+
async _pingServiceWorker() {
|
|
181
|
+
const response = await fetch(SW_PING_ENDPOINT);
|
|
182
|
+
const text = await response.text();
|
|
183
|
+
if (text === 'ok') {
|
|
184
|
+
setTimeout(this._pingServiceWorker, 20000);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Set the registration and emit a signal.
|
|
189
|
+
*/
|
|
190
|
+
_setRegistration(registration) {
|
|
191
|
+
this._registration = registration;
|
|
192
|
+
this._registrationChanged.emit(this._registration);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
//# sourceMappingURL=service-worker-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-worker-manager.js","sourceRoot":"","sources":["../src/service-worker-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI3D,OAAO,EACL,cAAc,EACd,sBAAsB,GAGvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAW,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAyB,WAAW,EAAE,MAAM,UAAU,CAAC;AAE9D;;GAEG;AACH,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;AAEnD;;GAEG;AACH,MAAM,gBAAgB,GAAG,+BAA+B,CAAC;AAEzD;;;GAGG;AACH,MAAM,OAAO,oBAAoB;IAC/B;;OAEG;IACH,YAAY,OAAuC;;QAsJnD;;;;;;WAMG;QACK,wBAAmB,GAAG,KAAK,EACjC,KAIE,EACa,EAAE;YACjB,MAAM,EAAE,IAAI,EAAE,iBAAiB,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;YAEzD,IAAI,iBAAiB,KAAK,IAAI,CAAC,kBAAkB,EAAE,CAAC;gBAClD,8BAA8B;gBAC9B,OAAO;YACT,CAAC;YAED,IAAI,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;gBACrC,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YACvC,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;YAC7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gBAAgB,CAAC,YAA8C;QACrE,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;QAClC,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACrD,CAAC;CAqEF"}
|
package/lib/service-worker.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference
|
|
1
|
+
/// <reference path="../../../node_modules/@types/serviceworker/index.d.ts" preserve="true" />
|
|
2
2
|
/**
|
|
3
3
|
* The name of the cache
|
|
4
4
|
*/
|
|
@@ -45,7 +45,7 @@ declare function shouldDrop(request: Request, url: URL): boolean;
|
|
|
45
45
|
/**
|
|
46
46
|
* Forward request to main using the broadcast channel
|
|
47
47
|
*/
|
|
48
|
-
declare function broadcastOne(request: Request): Promise<Response>;
|
|
48
|
+
declare function broadcastOne(request: Request, url: URL): Promise<Response>;
|
|
49
49
|
declare function openCache(): Promise<Cache>;
|
|
50
50
|
/**
|
|
51
51
|
* Cache a request/response pair.
|
package/lib/service-worker.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
|
|
3
|
-
/// <reference path="../../../node_modules/@types/serviceworker/index.d.ts" />
|
|
3
|
+
/// <reference path="../../../node_modules/@types/serviceworker/index.d.ts" preserve="true" />
|
|
4
4
|
/**
|
|
5
5
|
* The name of the cache
|
|
6
6
|
*/
|
|
@@ -48,7 +48,7 @@ async function onFetch(event) {
|
|
|
48
48
|
}
|
|
49
49
|
let responsePromise = null;
|
|
50
50
|
if (shouldBroadcast(url)) {
|
|
51
|
-
responsePromise = broadcastOne(request);
|
|
51
|
+
responsePromise = broadcastOne(request, url);
|
|
52
52
|
}
|
|
53
53
|
else if (!shouldDrop(request, url)) {
|
|
54
54
|
responsePromise = maybeFromCache(event);
|
|
@@ -98,7 +98,8 @@ async function refetch(request) {
|
|
|
98
98
|
* Whether a given URL should be broadcast
|
|
99
99
|
*/
|
|
100
100
|
function shouldBroadcast(url) {
|
|
101
|
-
return url.origin === location.origin &&
|
|
101
|
+
return (url.origin === location.origin &&
|
|
102
|
+
(url.pathname.includes('/api/drive') || url.pathname.includes('/api/stdin/')));
|
|
102
103
|
}
|
|
103
104
|
/**
|
|
104
105
|
* Whether the fallback behavior should be used
|
|
@@ -111,17 +112,23 @@ function shouldDrop(request, url) {
|
|
|
111
112
|
/**
|
|
112
113
|
* Forward request to main using the broadcast channel
|
|
113
114
|
*/
|
|
114
|
-
async function broadcastOne(request) {
|
|
115
|
+
async function broadcastOne(request, url) {
|
|
116
|
+
const message = await request.json();
|
|
115
117
|
const promise = new Promise((resolve) => {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
+
const messageHandler = (event) => {
|
|
119
|
+
const data = event.data;
|
|
120
|
+
if (data.browsingContextId !== message.browsingContextId) {
|
|
121
|
+
// bail if the message is not for us
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const response = data.response;
|
|
125
|
+
resolve(new Response(JSON.stringify(response)));
|
|
126
|
+
broadcast.removeEventListener('message', messageHandler);
|
|
118
127
|
};
|
|
128
|
+
broadcast.addEventListener('message', messageHandler);
|
|
119
129
|
});
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
// This makes sure we won't get problems with messages
|
|
123
|
-
// across tabs with multiple notebook tabs open
|
|
124
|
-
message.receiver = 'broadcast.ts';
|
|
130
|
+
// Add URL pathname to message
|
|
131
|
+
message.pathname = url.pathname;
|
|
125
132
|
broadcast.postMessage(message);
|
|
126
133
|
return await promise;
|
|
127
134
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-worker.js","sourceRoot":"","sources":["../src/service-worker.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"service-worker.js","sourceRoot":"","sources":["../src/service-worker.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,8FAA8F;AAE9F;;GAEG;A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CAAC,CAAC,CAAC;YAChD,SAAS,CAAC,mBAAmB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QAC3D,CAAC,CAAC;QAEF,SAAS,CAAC,gBAAgB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,8BAA8B;IAC9B,OAAO,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;IAChC,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAE/B,OAAO,MAAM,OAAO,CAAC;AACvB,CAAC;AAED,KAAK,UAAU,SAAS;IACtB,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,WAAW,CAAC,OAAgB,EAAE,QAAkB;IAC7D,MAAM,KAAK,GAAG,MAAM,SAAS,EAAE,CAAC;IAChC,OAAO,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACtC,CAAC;AAED;;;;GAIG;AACH,KAAK,UAAU,QAAQ;IACrB,MAAM,KAAK,GAAG,MAAM,SAAS,EAAE,CAAC;IAChC,OAAO,MAAM,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAChC,CAAC"}
|
package/lib/tokens.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Token } from '@lumino/coreutils';
|
|
2
2
|
import { ISignal } from '@lumino/signaling';
|
|
3
|
+
import { Contents } from '@jupyterlab/services';
|
|
3
4
|
/**
|
|
4
5
|
* The token for the ServiceWorker.
|
|
5
6
|
*/
|
|
@@ -16,10 +17,20 @@ export interface IServiceWorkerManager {
|
|
|
16
17
|
* Whether the ServiceWorker is enabled or not.
|
|
17
18
|
*/
|
|
18
19
|
readonly enabled: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* A unique id to identify the browsing context where the ServiceWorkerManager was instantiated.
|
|
22
|
+
*/
|
|
23
|
+
readonly browsingContextId: string;
|
|
19
24
|
/**
|
|
20
25
|
* A Promise that resolves when the ServiceWorker is registered, or rejects if it cannot
|
|
21
26
|
*/
|
|
22
27
|
ready: Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Register a handler for stdin requests received via ServiceWorker.
|
|
30
|
+
* @param pathnameSuffix URL pathname suffix to match such as "kernel" or "terminal".
|
|
31
|
+
* @param stdinHandler
|
|
32
|
+
*/
|
|
33
|
+
registerStdinHandler(pathnameSuffix: string, stdinHandler: IServiceWorkerManager.IStdinHandler): void;
|
|
23
34
|
}
|
|
24
35
|
/**
|
|
25
36
|
* A namespace for `ServiceWorkerManager` class.
|
|
@@ -29,10 +40,24 @@ export declare namespace IServiceWorkerManager {
|
|
|
29
40
|
* An options object for initializing a worker manager.
|
|
30
41
|
*/
|
|
31
42
|
interface IOptions {
|
|
43
|
+
/**
|
|
44
|
+
* The contents manager to use for handling drive contents requests
|
|
45
|
+
*/
|
|
46
|
+
contents: Contents.IManager;
|
|
32
47
|
/**
|
|
33
48
|
* URL to load the worker file. Default to "{baseURL}/service-worker.js"
|
|
34
49
|
*/
|
|
35
50
|
workerUrl?: string;
|
|
36
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Interface for handler of stdin requests received via Service Worker.
|
|
54
|
+
*
|
|
55
|
+
* Types are `any` because they are defined by whatever calls `registerStdinHandler`
|
|
56
|
+
* and the ServiceWorkerManager does not need to understand them, it just passes them
|
|
57
|
+
* through without altering them.
|
|
58
|
+
*/
|
|
59
|
+
interface IStdinHandler {
|
|
60
|
+
(message: any): Promise<any>;
|
|
61
|
+
}
|
|
37
62
|
}
|
|
38
63
|
export declare const WORKER_NAME: string;
|
package/lib/tokens.js
CHANGED
|
@@ -3,6 +3,6 @@ import SW_URL from './service-worker?text';
|
|
|
3
3
|
/**
|
|
4
4
|
* The token for the ServiceWorker.
|
|
5
5
|
*/
|
|
6
|
-
export const IServiceWorkerManager = new Token('@jupyterlite/server
|
|
6
|
+
export const IServiceWorkerManager = new Token('@jupyterlite/server:IServiceWorkerManager');
|
|
7
7
|
export const WORKER_NAME = `${SW_URL}`.split('/').slice(-1)[0];
|
|
8
8
|
//# sourceMappingURL=tokens.js.map
|
package/lib/tokens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAM1C,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAE3C;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,KAAK,CAC5C,2CAA2C,CAC5C,CAAC;AAuEF,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyterlite/server",
|
|
3
|
-
"version": "0.6.0-alpha.
|
|
3
|
+
"version": "0.6.0-alpha.10",
|
|
4
4
|
"description": "JupyterLite - Server",
|
|
5
5
|
"homepage": "https://github.com/jupyterlite/jupyterlite",
|
|
6
6
|
"bugs": {
|
|
@@ -43,32 +43,31 @@
|
|
|
43
43
|
"watch": "tsc -b --watch"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@jupyterlab/coreutils": "~6.4.
|
|
47
|
-
"@jupyterlab/nbformat": "~4.4.
|
|
48
|
-
"@jupyterlab/observables": "~5.4.
|
|
49
|
-
"@jupyterlab/services": "~7.4.
|
|
50
|
-
"@jupyterlab/settingregistry": "~4.4.
|
|
51
|
-
"@jupyterlab/statedb": "~4.4.
|
|
52
|
-
"@jupyterlite/contents": "^0.6.0-alpha.
|
|
53
|
-
"@jupyterlite/kernel": "^0.6.0-alpha.
|
|
54
|
-
"@jupyterlite/session": "^0.6.0-alpha.
|
|
55
|
-
"@jupyterlite/settings": "^0.6.0-alpha.
|
|
56
|
-
"@
|
|
57
|
-
"@lumino/
|
|
58
|
-
"@lumino/
|
|
59
|
-
"@lumino/signaling": "^2.1.3",
|
|
46
|
+
"@jupyterlab/coreutils": "~6.4.2",
|
|
47
|
+
"@jupyterlab/nbformat": "~4.4.2",
|
|
48
|
+
"@jupyterlab/observables": "~5.4.2",
|
|
49
|
+
"@jupyterlab/services": "~7.4.2",
|
|
50
|
+
"@jupyterlab/settingregistry": "~4.4.2",
|
|
51
|
+
"@jupyterlab/statedb": "~4.4.2",
|
|
52
|
+
"@jupyterlite/contents": "^0.6.0-alpha.10",
|
|
53
|
+
"@jupyterlite/kernel": "^0.6.0-alpha.10",
|
|
54
|
+
"@jupyterlite/session": "^0.6.0-alpha.10",
|
|
55
|
+
"@jupyterlite/settings": "^0.6.0-alpha.10",
|
|
56
|
+
"@lumino/application": "^2.4.4",
|
|
57
|
+
"@lumino/coreutils": "^2.2.1",
|
|
58
|
+
"@lumino/signaling": "^2.1.4",
|
|
60
59
|
"mock-socket": "^9.3.1"
|
|
61
60
|
},
|
|
62
61
|
"devDependencies": {
|
|
63
62
|
"@babel/core": "^7.11.6",
|
|
64
63
|
"@babel/preset-env": "^7.12.1",
|
|
65
|
-
"@jupyterlab/testutils": "~4.4.
|
|
64
|
+
"@jupyterlab/testutils": "~4.4.2",
|
|
66
65
|
"@types/jest": "^29.5.3",
|
|
67
66
|
"@types/serviceworker": "^0.0.56",
|
|
68
67
|
"jest": "^29.6.2",
|
|
69
68
|
"rimraf": "~5.0.1",
|
|
70
69
|
"ts-jest": "^29.1.1",
|
|
71
|
-
"typescript": "~5.
|
|
70
|
+
"typescript": "~5.5.4"
|
|
72
71
|
},
|
|
73
72
|
"publishConfig": {
|
|
74
73
|
"access": "public"
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
// Copyright (c) Jupyter Development Team.
|
|
2
2
|
// Distributed under the terms of the Modified BSD License.
|
|
3
3
|
|
|
4
|
-
export * from './app';
|
|
5
|
-
export * from './router';
|
|
6
4
|
export * from './tokens';
|
|
7
|
-
export * from './service-manager';
|
|
5
|
+
export * from './service-worker-manager';
|