@statewalker/webrun-http-browser 0.6.0 → 0.6.2
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/dist/sw/sw-dispatcher.d.ts +8 -0
- package/dist/sw/sw-dispatcher.d.ts.map +1 -1
- package/dist/sw.js +10 -1
- package/package.json +15 -10
- package/src/sw/sw-dispatcher.ts +10 -1
|
@@ -35,6 +35,14 @@ export declare class SwPortHandler {
|
|
|
35
35
|
constructor(options: SwPortHandlerOptions);
|
|
36
36
|
get key(): string;
|
|
37
37
|
get scope(): string;
|
|
38
|
+
/**
|
|
39
|
+
* The scope as a url on the worker's origin. Resolved against the worker's
|
|
40
|
+
* own url when one is given, not against this module's: a bundle that is
|
|
41
|
+
* not an ES module (an IIFE, Theia's frontend) has no `import.meta.url`, and
|
|
42
|
+
* `new URL(scope, undefined)` threw `Invalid URL` there. Only without a
|
|
43
|
+
* worker url does the module's location decide (its default `index-sw.js`
|
|
44
|
+
* sits next to it).
|
|
45
|
+
*/
|
|
38
46
|
get rootUrl(): URL;
|
|
39
47
|
get serviceWorkerUrl(): string;
|
|
40
48
|
protected _newCommunicationChannel(): Promise<[MessagePort, MessagePort]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sw-dispatcher.d.ts","sourceRoot":"","sources":["../../src/sw/sw-dispatcher.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,UAAU,WAAW;IACnB,GAAG,E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AAM,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAgBnE;IAED,yDAAyD;IACzD,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEjC;IAED,KAAK,IAAI,IAAI,CAgCZ;IAEK,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAK1B;IAED,OAAO,CAAC,gBAAgB;YAOV,SAAS;YAgBT,kBAAkB;YAWlB,cAAc;YAOd,gBAAgB;CAY/B"}
|
package/dist/sw.js
CHANGED
|
@@ -1765,8 +1765,17 @@ var SwPortHandler = class {
|
|
|
1765
1765
|
get scope() {
|
|
1766
1766
|
return this.options.scope ?? new URL("./", this.serviceWorkerUrl).pathname;
|
|
1767
1767
|
}
|
|
1768
|
+
/**
|
|
1769
|
+
* The scope as a url on the worker's origin. Resolved against the worker's
|
|
1770
|
+
* own url when one is given, not against this module's: a bundle that is
|
|
1771
|
+
* not an ES module (an IIFE, Theia's frontend) has no `import.meta.url`, and
|
|
1772
|
+
* `new URL(scope, undefined)` threw `Invalid URL` there. Only without a
|
|
1773
|
+
* worker url does the module's location decide (its default `index-sw.js`
|
|
1774
|
+
* sits next to it).
|
|
1775
|
+
*/
|
|
1768
1776
|
get rootUrl() {
|
|
1769
|
-
|
|
1777
|
+
const base = this.options.serviceWorkerUrl ? this.serviceWorkerUrl : import.meta.url;
|
|
1778
|
+
return new URL(this.scope, base);
|
|
1770
1779
|
}
|
|
1771
1780
|
get serviceWorkerUrl() {
|
|
1772
1781
|
if (!this._serviceWorkerUrl) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@statewalker/webrun-http-browser",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "ServiceWorker-based HTTP server for browsers, with relay and same-origin dispatch modes",
|
|
@@ -19,21 +19,26 @@
|
|
|
19
19
|
"types": "./dist/index.d.ts",
|
|
20
20
|
"exports": {
|
|
21
21
|
".": {
|
|
22
|
+
"source": "./src/index.ts",
|
|
22
23
|
"types": "./dist/index.d.ts",
|
|
23
24
|
"import": "./dist/index.js"
|
|
24
25
|
},
|
|
25
26
|
"./sw": {
|
|
27
|
+
"source": "./src/sw.ts",
|
|
26
28
|
"types": "./dist/sw.d.ts",
|
|
27
29
|
"import": "./dist/sw.js"
|
|
28
30
|
},
|
|
29
31
|
"./relay-sw": {
|
|
32
|
+
"source": "./src/relay-sw.ts",
|
|
30
33
|
"default": "./dist/relay-sw.js"
|
|
31
34
|
},
|
|
32
35
|
"./relay-worker": {
|
|
36
|
+
"source": "./src/relay-worker.ts",
|
|
33
37
|
"types": "./dist/relay-worker.d.ts",
|
|
34
38
|
"import": "./dist/relay-worker.js"
|
|
35
39
|
},
|
|
36
40
|
"./sw-worker": {
|
|
41
|
+
"source": "./src/sw-worker.ts",
|
|
37
42
|
"default": "./dist/sw-worker.js"
|
|
38
43
|
}
|
|
39
44
|
},
|
|
@@ -46,20 +51,20 @@
|
|
|
46
51
|
],
|
|
47
52
|
"dependencies": {
|
|
48
53
|
"idb-keyval": "^6.3.0",
|
|
49
|
-
"@statewalker/webrun-http-streams": "0.2.
|
|
50
|
-
"@statewalker/webrun-rpc": "0.4.
|
|
51
|
-
"@statewalker/webrun-streams": "0.2.
|
|
54
|
+
"@statewalker/webrun-http-streams": "^0.2.4",
|
|
55
|
+
"@statewalker/webrun-rpc": "^0.4.2",
|
|
56
|
+
"@statewalker/webrun-streams": "^0.2.1"
|
|
52
57
|
},
|
|
53
58
|
"devDependencies": {
|
|
54
|
-
"@biomejs/biome": "^2.5.
|
|
55
|
-
"@types/node": "^26.
|
|
59
|
+
"@biomejs/biome": "^2.5.15",
|
|
60
|
+
"@types/node": "^26.6.4",
|
|
56
61
|
"http-server": "^14.1.1",
|
|
57
|
-
"playwright": "^1.
|
|
62
|
+
"playwright": "^1.63.0",
|
|
58
63
|
"rimraf": "^6.1.3",
|
|
59
|
-
"rolldown": "^1.2.
|
|
64
|
+
"rolldown": "^1.2.12",
|
|
60
65
|
"typescript": "^7.0.2",
|
|
61
|
-
"vite": "^8.2
|
|
62
|
-
"vitest": "^
|
|
66
|
+
"vite": "^8.3.2",
|
|
67
|
+
"vitest": "^5.0.3"
|
|
63
68
|
},
|
|
64
69
|
"sideEffects": false,
|
|
65
70
|
"publishConfig": {
|
package/src/sw/sw-dispatcher.ts
CHANGED
|
@@ -60,8 +60,17 @@ export class SwPortHandler {
|
|
|
60
60
|
return this.options.scope ?? new URL("./", this.serviceWorkerUrl).pathname;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
/**
|
|
64
|
+
* The scope as a url on the worker's origin. Resolved against the worker's
|
|
65
|
+
* own url when one is given, not against this module's: a bundle that is
|
|
66
|
+
* not an ES module (an IIFE, Theia's frontend) has no `import.meta.url`, and
|
|
67
|
+
* `new URL(scope, undefined)` threw `Invalid URL` there. Only without a
|
|
68
|
+
* worker url does the module's location decide (its default `index-sw.js`
|
|
69
|
+
* sits next to it).
|
|
70
|
+
*/
|
|
63
71
|
get rootUrl(): URL {
|
|
64
|
-
|
|
72
|
+
const base = this.options.serviceWorkerUrl ? this.serviceWorkerUrl : import.meta.url;
|
|
73
|
+
return new URL(this.scope, base);
|
|
65
74
|
}
|
|
66
75
|
|
|
67
76
|
get serviceWorkerUrl(): string {
|