@design.estate/wcctools 6.1.0 → 6.2.0

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.
Files changed (63) hide show
  1. package/changelog.md +20 -0
  2. package/dist_shell/bundle.js +405 -368
  3. package/dist_shell/bundle.js.map +1 -1
  4. package/dist_shell/bundle.js.third-party-notices.json +52 -0
  5. package/dist_shell/bundle.js.third-party-notices.txt +107 -1
  6. package/dist_shell/index.html +1 -1
  7. package/dist_ts/00_commitinfo_data.js +1 -1
  8. package/dist_ts/classes.bundlestatus.d.ts +36 -0
  9. package/dist_ts/classes.bundlestatus.js +110 -0
  10. package/dist_ts/classes.devapi.d.ts +3 -0
  11. package/dist_ts/classes.devapi.js +8 -1
  12. package/dist_ts/classes.devserver.d.ts +45 -10
  13. package/dist_ts/classes.devserver.js +123 -49
  14. package/dist_ts/cli.js +5 -2
  15. package/dist_ts/index.d.ts +0 -2
  16. package/dist_ts/index.js +1 -3
  17. package/dist_ts_interfaces/requests.d.ts +35 -0
  18. package/dist_ts_shell/bundlestatus.d.ts +15 -0
  19. package/dist_ts_shell/bundlestatus.js +64 -0
  20. package/dist_ts_shell/elements/wcc-contextmenu.d.ts +3 -0
  21. package/dist_ts_shell/elements/wcc-contextmenu.js +18 -3
  22. package/dist_ts_shell/elements/wcc-preview-frame.d.ts +6 -0
  23. package/dist_ts_shell/elements/wcc-preview-frame.js +50 -2
  24. package/dist_ts_shell/elements/wcc-shell.d.ts +15 -0
  25. package/dist_ts_shell/elements/wcc-shell.js +45 -3
  26. package/dist_ts_shell/plugins.d.ts +2 -1
  27. package/dist_ts_shell/plugins.js +3 -2
  28. package/dist_ts_web/00_commitinfo_data.js +1 -1
  29. package/package.json +5 -2
  30. package/readme.md +6 -2
  31. package/ts/00_commitinfo_data.ts +1 -1
  32. package/ts/classes.bundlestatus.ts +123 -0
  33. package/ts/classes.devapi.ts +9 -0
  34. package/ts/classes.devserver.ts +127 -47
  35. package/ts/cli.ts +4 -1
  36. package/ts/index.ts +0 -2
  37. package/ts_interfaces/bridge.ts +95 -0
  38. package/ts_interfaces/catalog.ts +37 -0
  39. package/ts_interfaces/index.ts +4 -0
  40. package/ts_interfaces/plugins.ts +3 -0
  41. package/ts_interfaces/requests.ts +65 -0
  42. package/ts_interfaces/standard.ts +103 -0
  43. package/ts_shared/index.ts +1 -0
  44. package/ts_shared/plugins.ts +3 -0
  45. package/ts_shared/previewroute.ts +58 -0
  46. package/ts_shell/bundlestatus.ts +68 -0
  47. package/ts_shell/elements/wcc-contextmenu.ts +306 -0
  48. package/ts_shell/elements/wcc-preview-frame.ts +167 -0
  49. package/ts_shell/elements/wcc-properties.ts +998 -0
  50. package/ts_shell/elements/wcc-record-button.ts +108 -0
  51. package/ts_shell/elements/wcc-recording-panel.ts +1005 -0
  52. package/ts_shell/elements/wcc-shell.ts +485 -0
  53. package/ts_shell/elements/wcc-sidebar.ts +1419 -0
  54. package/ts_shell/index.html +21 -0
  55. package/ts_shell/index.ts +4 -0
  56. package/ts_shell/plugins.ts +12 -0
  57. package/ts_shell/previewconnection.ts +103 -0
  58. package/ts_shell/services/recorder.service.ts +451 -0
  59. package/ts_shell/types/dom-mediacapture-stub/index.d.ts +12 -0
  60. package/ts_shell/types/dom-mediacapture-stub/package.json +6 -0
  61. package/ts_shell/types/dom-webcodecs-stub/index.d.ts +2 -0
  62. package/ts_shell/types/dom-webcodecs-stub/package.json +6 -0
  63. package/ts_web/00_commitinfo_data.ts +1 -1
@@ -1,6 +1,19 @@
1
1
  {
2
2
  "generator": "@git.zone/tsbundle",
3
3
  "packages": [
4
+ {
5
+ "name": "@api.global/typedrequest",
6
+ "version": "8.2.0",
7
+ "license": "MIT",
8
+ "files": [
9
+ {
10
+ "name": "license.md",
11
+ "origin": "package",
12
+ "sha256": "d4df21792a018c250ee96e4fcf8c3914dc69dc24a710c34a5902b94102febbb9",
13
+ "text": "Copyright (c) 2019 Lossless GmbH (hello@lossless.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
14
+ }
15
+ ]
16
+ },
4
17
  {
5
18
  "name": "@api.global/typedrequest",
6
19
  "version": "9.0.2",
@@ -105,6 +118,19 @@
105
118
  }
106
119
  ]
107
120
  },
121
+ {
122
+ "name": "@push.rocks/isounique",
123
+ "version": "1.0.5",
124
+ "license": "MIT",
125
+ "files": [
126
+ {
127
+ "name": "license",
128
+ "origin": "package",
129
+ "sha256": "e1e7bd6c95d8e5bceb1e98922a47ebe72f281313a10ad80d6189758e007e07b1",
130
+ "text": "Copyright (c) 2020 Lossless GmbH (hello@lossless.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
131
+ }
132
+ ]
133
+ },
108
134
  {
109
135
  "name": "@push.rocks/lik",
110
136
  "version": "6.4.4",
@@ -144,6 +170,19 @@
144
170
  }
145
171
  ]
146
172
  },
173
+ {
174
+ "name": "@push.rocks/smartdelay",
175
+ "version": "3.1.0",
176
+ "license": "MIT",
177
+ "files": [
178
+ {
179
+ "name": "license",
180
+ "origin": "package",
181
+ "sha256": "08a29c2b5fd80963b14f876049437c4f8e7c13e352067ba330457bbe8074d7d1",
182
+ "text": "The MIT License (MIT)\n\nCopyright (c) 2017 Task Venture Capital GmbH <hello@task.vc>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
183
+ }
184
+ ]
185
+ },
147
186
  {
148
187
  "name": "@push.rocks/smartenv",
149
188
  "version": "6.1.0",
@@ -352,6 +391,19 @@
352
391
  }
353
392
  ]
354
393
  },
394
+ {
395
+ "name": "@push.rocks/webrequest",
396
+ "version": "4.3.1",
397
+ "license": "MIT",
398
+ "files": [
399
+ {
400
+ "name": "license.md",
401
+ "origin": "package",
402
+ "sha256": "5262baa104dbbcf18084c74a3693541936067eeb9460fcfe3ccbe25164f5cb84",
403
+ "text": "Copyright (c) 2018 Lossless GmbH (hello@lossless.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
404
+ }
405
+ ]
406
+ },
355
407
  {
356
408
  "name": "@push.rocks/websetup",
357
409
  "version": "3.1.0",
@@ -1,10 +1,36 @@
1
1
  Third-party notices
2
2
 
3
3
  The JavaScript bundle this file accompanies, including its chunks and module workers,
4
- contains code from the following 132 npm package(s). Each entry reproduces
4
+ contains code from the following 136 npm package(s). Each entry reproduces
5
5
  the license and notice files the package ships, or the license text the project
6
6
  or a bundled package supplied for it.
7
7
 
8
+ ================================================================================
9
+ @api.global/typedrequest@8.2.0
10
+ License: MIT
11
+
12
+ --- license.md ---
13
+
14
+ Copyright (c) 2019 Lossless GmbH (hello@lossless.com)
15
+
16
+ Permission is hereby granted, free of charge, to any person obtaining a copy
17
+ of this software and associated documentation files (the "Software"), to deal
18
+ in the Software without restriction, including without limitation the rights
19
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20
+ copies of the Software, and to permit persons to whom the Software is
21
+ furnished to do so, subject to the following conditions:
22
+
23
+ The above copyright notice and this permission notice shall be included in all
24
+ copies or substantial portions of the Software.
25
+
26
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32
+ SOFTWARE.
33
+
8
34
  ================================================================================
9
35
  @api.global/typedrequest@9.0.2
10
36
  License: MIT
@@ -232,6 +258,32 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
232
258
  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
233
259
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
234
260
 
261
+ ================================================================================
262
+ @push.rocks/isounique@1.0.5
263
+ License: MIT
264
+
265
+ --- license ---
266
+
267
+ Copyright (c) 2020 Lossless GmbH (hello@lossless.com)
268
+
269
+ Permission is hereby granted, free of charge, to any person obtaining a copy
270
+ of this software and associated documentation files (the "Software"), to deal
271
+ in the Software without restriction, including without limitation the rights
272
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
273
+ copies of the Software, and to permit persons to whom the Software is
274
+ furnished to do so, subject to the following conditions:
275
+
276
+ The above copyright notice and this permission notice shall be included in all
277
+ copies or substantial portions of the Software.
278
+
279
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
280
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
281
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
282
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
283
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
284
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
285
+ SOFTWARE.
286
+
235
287
  ================================================================================
236
288
  @push.rocks/lik@6.4.4
237
289
  License: MIT
@@ -314,6 +366,34 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
314
366
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
315
367
  SOFTWARE.
316
368
 
369
+ ================================================================================
370
+ @push.rocks/smartdelay@3.1.0
371
+ License: MIT
372
+
373
+ --- license ---
374
+
375
+ The MIT License (MIT)
376
+
377
+ Copyright (c) 2017 Task Venture Capital GmbH <hello@task.vc>
378
+
379
+ Permission is hereby granted, free of charge, to any person obtaining a copy
380
+ of this software and associated documentation files (the "Software"), to deal
381
+ in the Software without restriction, including without limitation the rights
382
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
383
+ copies of the Software, and to permit persons to whom the Software is
384
+ furnished to do so, subject to the following conditions:
385
+
386
+ The above copyright notice and this permission notice shall be included in all
387
+ copies or substantial portions of the Software.
388
+
389
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
390
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
391
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
392
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
393
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
394
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
395
+ SOFTWARE.
396
+
317
397
  ================================================================================
318
398
  @push.rocks/smartenv@6.1.0
319
399
  License: MIT
@@ -741,6 +821,32 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
741
821
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
742
822
  SOFTWARE.
743
823
 
824
+ ================================================================================
825
+ @push.rocks/webrequest@4.3.1
826
+ License: MIT
827
+
828
+ --- license.md ---
829
+
830
+ Copyright (c) 2018 Lossless GmbH (hello@lossless.com)
831
+
832
+ Permission is hereby granted, free of charge, to any person obtaining a copy
833
+ of this software and associated documentation files (the "Software"), to deal
834
+ in the Software without restriction, including without limitation the rights
835
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
836
+ copies of the Software, and to permit persons to whom the Software is
837
+ furnished to do so, subject to the following conditions:
838
+
839
+ The above copyright notice and this permission notice shall be included in all
840
+ copies or substantial portions of the Software.
841
+
842
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
843
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
844
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
845
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
846
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
847
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
848
+ SOFTWARE.
849
+
744
850
  ================================================================================
745
851
  @push.rocks/websetup@3.1.0
746
852
  License: MIT
@@ -16,6 +16,6 @@
16
16
  <script type="module" src="/wcctools/bundle.js"></script>
17
17
  </head>
18
18
  <body>
19
- <wcc-shell preview-path="/wcctools-preview"></wcc-shell>
19
+ <wcc-shell preview-path="/wcctools-preview" api-path="/wcctools/typedrequest"></wcc-shell>
20
20
  </body>
21
21
  </html>
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@design.estate/wcctools',
6
- version: '6.1.0',
6
+ version: '6.2.0',
7
7
  description: 'A set of web component tools for creating element catalogues, enabling the structured development and documentation of custom elements and pages.'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx5QkFBeUI7SUFDL0IsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLG1KQUFtSjtDQUNqSyxDQUFBIn0=
@@ -0,0 +1,36 @@
1
+ import * as plugins from './plugins.js';
2
+ /** The longest time a status request waits for a change before it answers the unchanged status. */
3
+ export declare const bundleStatusWaitLimitMs = 25000;
4
+ /** What a status request answers while the board is closed: the server is not serving. */
5
+ export declare const bundleStatusClosedMessage = "wcctools: the dev server is not serving the bundle status.";
6
+ /**
7
+ * The status of the catalog bundles, as tswatch's bundle events report it, for the shell's
8
+ * `getBundleStatus` requests. Every event raises the revision and answers the requests waiting for
9
+ * a change. While closed (the server is not serving), requests are refused with a typed error, so
10
+ * a client backs off as it does for any failed request.
11
+ */
12
+ export declare class WccBundleStatusBoard {
13
+ private readonly bundles;
14
+ private revision;
15
+ private isOpen;
16
+ /** Settles one waiting request: answers the current snapshot, or refuses; each removes itself. */
17
+ private readonly waiters;
18
+ /** Starts a run of the server: the bundles of an earlier run are forgotten. */
19
+ open(): void;
20
+ /** Ends the run: every waiting request is refused now, later ones at once. */
21
+ close(): void;
22
+ /** The number of requests waiting for a change. */
23
+ getWaiterCount(): number;
24
+ record(eventArg: plugins.tswatch.TBundleEvent): void;
25
+ getSnapshot(): plugins.interfaces.IWccBundleStatusSnapshot;
26
+ /**
27
+ * The snapshot once it differs from `afterRevisionArg`, or after the wait limit; at once without
28
+ * a revision or for a revision that is no longer current. Refused while closed. When
29
+ * `abortSignalArg` aborts (the client went away), the wait ends at once and releases its timer;
30
+ * it answers the current snapshot, which the transport drops.
31
+ */
32
+ waitForChange(afterRevisionArg: number | undefined, abortSignalArg?: AbortSignal): Promise<plugins.interfaces.IWccBundleStatusSnapshot>;
33
+ private changed;
34
+ private answerWaiters;
35
+ private createClosedError;
36
+ }
@@ -0,0 +1,110 @@
1
+ import * as plugins from './plugins.js';
2
+ /** The longest time a status request waits for a change before it answers the unchanged status. */
3
+ export const bundleStatusWaitLimitMs = 25_000;
4
+ /** What a status request answers while the board is closed: the server is not serving. */
5
+ export const bundleStatusClosedMessage = 'wcctools: the dev server is not serving the bundle status.';
6
+ /**
7
+ * The status of the catalog bundles, as tswatch's bundle events report it, for the shell's
8
+ * `getBundleStatus` requests. Every event raises the revision and answers the requests waiting for
9
+ * a change. While closed (the server is not serving), requests are refused with a typed error, so
10
+ * a client backs off as it does for any failed request.
11
+ */
12
+ export class WccBundleStatusBoard {
13
+ bundles = new Map();
14
+ revision = 0;
15
+ isOpen = false;
16
+ /** Settles one waiting request: answers the current snapshot, or refuses; each removes itself. */
17
+ waiters = new Set();
18
+ /** Starts a run of the server: the bundles of an earlier run are forgotten. */
19
+ open() {
20
+ this.bundles.clear();
21
+ this.isOpen = true;
22
+ this.changed();
23
+ }
24
+ /** Ends the run: every waiting request is refused now, later ones at once. */
25
+ close() {
26
+ this.isOpen = false;
27
+ const refusal = this.createClosedError();
28
+ for (const settle of [...this.waiters]) {
29
+ settle(refusal);
30
+ }
31
+ }
32
+ /** The number of requests waiting for a change. */
33
+ getWaiterCount() {
34
+ return this.waiters.size;
35
+ }
36
+ record(eventArg) {
37
+ const previous = this.bundles.get(eventArg.name);
38
+ const status = { name: eventArg.name, state: eventArg.type };
39
+ switch (eventArg.type) {
40
+ case 'started':
41
+ // The latest completed run stays reported while the next one runs
42
+ if (previous?.durationMs !== undefined) {
43
+ status.durationMs = previous.durationMs;
44
+ }
45
+ if (previous?.errorMessage !== undefined) {
46
+ status.errorMessage = previous.errorMessage;
47
+ }
48
+ break;
49
+ case 'finished':
50
+ status.durationMs = eventArg.durationMs;
51
+ break;
52
+ case 'failed':
53
+ status.durationMs = eventArg.durationMs;
54
+ status.errorMessage = eventArg.errorMessage;
55
+ break;
56
+ }
57
+ this.bundles.set(eventArg.name, status);
58
+ this.changed();
59
+ }
60
+ getSnapshot() {
61
+ return {
62
+ revision: this.revision,
63
+ bundles: [...this.bundles.values()].map((statusArg) => ({ ...statusArg })),
64
+ };
65
+ }
66
+ /**
67
+ * The snapshot once it differs from `afterRevisionArg`, or after the wait limit; at once without
68
+ * a revision or for a revision that is no longer current. Refused while closed. When
69
+ * `abortSignalArg` aborts (the client went away), the wait ends at once and releases its timer;
70
+ * it answers the current snapshot, which the transport drops.
71
+ */
72
+ waitForChange(afterRevisionArg, abortSignalArg) {
73
+ if (!this.isOpen) {
74
+ return Promise.reject(this.createClosedError());
75
+ }
76
+ if (afterRevisionArg === undefined || afterRevisionArg !== this.revision || abortSignalArg?.aborted) {
77
+ return Promise.resolve(this.getSnapshot());
78
+ }
79
+ return new Promise((resolve, reject) => {
80
+ const settle = (refusalArg) => {
81
+ clearTimeout(waitLimit);
82
+ abortSignalArg?.removeEventListener('abort', onAbort);
83
+ this.waiters.delete(settle);
84
+ if (refusalArg) {
85
+ reject(refusalArg);
86
+ }
87
+ else {
88
+ resolve(this.getSnapshot());
89
+ }
90
+ };
91
+ const onAbort = () => settle();
92
+ const waitLimit = setTimeout(() => settle(), bundleStatusWaitLimitMs);
93
+ abortSignalArg?.addEventListener('abort', onAbort, { once: true });
94
+ this.waiters.add(settle);
95
+ });
96
+ }
97
+ changed() {
98
+ this.revision++;
99
+ this.answerWaiters();
100
+ }
101
+ answerWaiters() {
102
+ for (const settle of [...this.waiters]) {
103
+ settle();
104
+ }
105
+ }
106
+ createClosedError() {
107
+ return new plugins.typedrequest.TypedResponseError(bundleStatusClosedMessage);
108
+ }
109
+ }
110
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xhc3Nlcy5idW5kbGVzdGF0dXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9jbGFzc2VzLmJ1bmRsZXN0YXR1cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLGNBQWMsQ0FBQztBQUV4QyxtR0FBbUc7QUFDbkcsTUFBTSxDQUFDLE1BQU0sdUJBQXVCLEdBQUcsTUFBTSxDQUFDO0FBRTlDLDBGQUEwRjtBQUMxRixNQUFNLENBQUMsTUFBTSx5QkFBeUIsR0FBRyw0REFBNEQsQ0FBQztBQUV0Rzs7Ozs7R0FLRztBQUNILE1BQU0sT0FBTyxvQkFBb0I7SUFDZCxPQUFPLEdB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QUFDO1lBQy9CLE1BQU0sU0FBUyxHQUFHLFVBQVUsQ0FBQyxHQUFHLEVBQUUsQ0FBQyxNQUFNLEVBQUUsRUFBRSx1QkFBdUIsQ0FBQyxDQUFDO1lBQ3RFLGNBQWMsRUFBRSxnQkFBZ0IsQ0FBQyxPQUFPLEVBQUUsT0FBTyxFQUFFLEVBQUUsSUFBSSxFQUFFLElBQUksRUFBRSxDQUFDLENBQUM7WUFDbkUsSUFBSSxDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsTUFBTSxDQUFDLENBQUM7UUFDM0IsQ0FBQyxDQUFDLENBQUM7SUFDTCxDQUFDO0lBRU8sT0FBTztRQUNiLElBQUksQ0FBQyxRQUFRLEVBQUUsQ0FBQztRQUNoQixJQUFJLENBQUMsYUFBYSxFQUFFLENBQUM7SUFDdkIsQ0FBQztJQUVPLGFBQWE7UUFDbkIsS0FBSyxNQUFNLE1BQU0sSUFBSSxDQUFDLEdBQUcsSUFBSSxDQUFDLE9BQU8sQ0FBQyxFQUFFLENBQUM7WUFDdkMsTUFBTSxFQUFFLENBQUM7UUFDWCxDQUFDO0lBQ0gsQ0FBQztJQUVPLGlCQUFpQjtRQUN2QixPQUFPLElBQUksT0FBTyxDQUFDLFlBQVksQ0FBQyxrQkFBa0IsQ0FBQyx5QkFBeUIsQ0FBQyxDQUFDO0lBQ2hGLENBQUM7Q0FDRiJ9
@@ -1,10 +1,13 @@
1
1
  import * as plugins from './plugins.js';
2
+ import { WccBundleStatusBoard } from './classes.bundlestatus.js';
2
3
  /**
3
4
  * The typed API the shell reaches on `/wcctools/typedrequest`. Later features register their
4
5
  * handlers on `typedrouter`.
5
6
  */
6
7
  export declare class WccDevApi {
7
8
  readonly typedrouter: plugins.typedrequest.TypedRouter<import("@api.global/typedrequest-interfaces").ITypedRequest>;
9
+ /** The catalog bundles' status, fed with tswatch's bundle events while the server runs. */
10
+ readonly bundleStatus: WccBundleStatusBoard;
8
11
  private serverInfo;
9
12
  constructor();
10
13
  setServerInfo(infoArg: plugins.interfaces.IWccDevServerInfo): void;
@@ -1,10 +1,13 @@
1
1
  import * as plugins from './plugins.js';
2
+ import { WccBundleStatusBoard } from './classes.bundlestatus.js';
2
3
  /**
3
4
  * The typed API the shell reaches on `/wcctools/typedrequest`. Later features register their
4
5
  * handlers on `typedrouter`.
5
6
  */
6
7
  export class WccDevApi {
7
8
  typedrouter = new plugins.typedrequest.TypedRouter();
9
+ /** The catalog bundles' status, fed with tswatch's bundle events while the server runs. */
10
+ bundleStatus = new WccBundleStatusBoard();
8
11
  serverInfo = null;
9
12
  constructor() {
10
13
  this.typedrouter.addTypedHandler(new plugins.typedrequest.TypedHandler('getDevServerInfo', async () => {
@@ -13,9 +16,13 @@ export class WccDevApi {
13
16
  }
14
17
  return { ...this.serverInfo };
15
18
  }));
19
+ this.typedrouter.addTypedHandler(new plugins.typedrequest.TypedHandler('getBundleStatus', async (requestArg, typedToolsArg) => {
20
+ // A client that goes away ends its wait, so no waiter or timer outlives the request
21
+ return this.bundleStatus.waitForChange(requestArg.afterRevision, typedToolsArg?.abortSignal);
22
+ }));
16
23
  }
17
24
  setServerInfo(infoArg) {
18
25
  this.serverInfo = { ...infoArg };
19
26
  }
20
27
  }
21
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xhc3Nlcy5kZXZhcGkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9jbGFzc2VzLmRldmFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLGNBQWMsQ0FBQztBQUV4Qzs7O0dBR0c7QUFDSCxNQUFNLE9BQU8sU0FBUztJQUNKLFdBQVcsR0FBRyxJQUFJLE9BQU8sQ0FBQyxZQUFZLENBQUMsV0FBVyxFQUFFLENBQUM7SUFDN0QsVUFBVSxHQUFnRCxJQUFJLENBQUM7SUFFdkU7UUFDRSxJQUFJL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BSSxPQUFPLENBQUMsWUFBWSxDQUFDLFlBQVksQ0FBMkMsa0JBQWtCLEVBQUUsS0FBSyxJQUFJLEVBQUU7WUFDN0csSUFBSSxDQUFDLElBQUksQ0FBQyxVQUFVLEVBQUUsQ0FBQztnQkFDckIsTUFBTSxJQUFJLEtBQUssQ0FBQyxpQ0FBaUMsQ0FBQyxDQUFDO1lBQ3JELENBQUM7WUFDRCxPQUFPLEVBQUUsR0FBRyxJQUFJLENBQUMsVUFBVSxFQUFFLENBQUM7UUFDaEMsQ0FBQyxDQUFDLENBQ0gsQ0FBQztRQUNGLElBQUksQ0FBQyxXQUFXLENBQUMsZUFBZSxDQUM5QixJQUFJLE9BQU8sQ0FBQyxZQUFZLENBQUMsWUFBWSxDQUEwQyxpQkFBaUIsRUFBRSxLQUFLLEVBQUUsVUFBVSxFQUFFLGFBQWEsRUFBRSxFQUFFO1lBQ3BJLG9GQUFvRjtZQUNwRixPQUFPLElBQUksQ0FBQyxZQUFZLENBQUMsYUFBYSxDQUFDLFVBQVUsQ0FBQyxhQUFhLEVBQUUsYUFBYSxFQUFFLFdBQVcsQ0FBQyxDQUFDO1FBQy9GLENBQUMsQ0FBQyxDQUNILENBQUM7SUFDSixDQUFDO0lBRU0sYUFBYSxDQUFDLE9BQTZDO1FBQ2hFLElBQUksQ0FBQyxVQUFVLEdBQUcsRUFBRSxHQUFHLE9BQU8sRUFBRSxDQUFDO0lBQ25DLENBQUM7Q0FDRiJ9
@@ -2,6 +2,11 @@ import { WccDevApi } from './classes.devapi.js';
2
2
  export interface IWccDevServerOptions {
3
3
  /** Port to listen on; overrides the tswatch configuration. 0 picks a free port. */
4
4
  port?: number;
5
+ /**
6
+ * The project directory: its tswatch configuration, package.json and catalog are served, and
7
+ * tswatch bundles and watches in it (default: `process.cwd()` when the server is constructed).
8
+ */
9
+ cwd?: string;
5
10
  }
6
11
  export interface IWccDevServerAddress {
7
12
  port: number;
@@ -9,34 +14,64 @@ export interface IWccDevServerAddress {
9
14
  url: string;
10
15
  }
11
16
  /**
12
- * `wcctools dev`: bundles the catalog of the current project with tswatch, as its
13
- * `@git.zone/tswatch` configuration (or the `element` preset) describes, and serves on one port:
17
+ * `wcctools dev`: bundles the catalog of a project with tswatch, as its `@git.zone/tswatch`
18
+ * configuration (or the `element` preset) describes, and serves on one port:
14
19
  *
15
20
  * - the shell on `/wcctools/` (`/` redirects there) and its routes `/wcctools-route/...`,
16
- * - the typed API on `/wcctools/typedrequest`,
21
+ * - the typed API on `/wcctools/typedrequest`, including the bundles' status,
17
22
  * - the catalog's preview document and bundle from the tswatch serve directory on every other
18
23
  * path, with live reload that reloads only the preview document.
19
24
  *
20
- * tswatch resolves its paths against the process's working directory, so the server serves the
21
- * project the process runs in.
25
+ * The server owns no process lifecycle: while it runs, a process shutdown through smartexit's
26
+ * `ProcessLifecycle` stops it. The entry point installs that lifecycle with
27
+ * `getShutdownTimeoutMs()`.
22
28
  */
23
29
  export declare class WccDevServer {
24
30
  private readonly options;
25
31
  /** The typed API on `/wcctools/typedrequest`; register further handlers before `start()`. */
26
32
  readonly api: WccDevApi;
27
- private tsWatch;
33
+ /** The project directory everything resolves against. */
34
+ readonly cwd: string;
35
+ /** The project's tswatch configuration, or the `element` preset; read once, on construction. */
36
+ private readonly config;
37
+ /** Bundling and watching stay tswatch's; its own server stays off. */
38
+ private readonly tsWatch;
28
39
  private typedServer;
29
- private readonly smartExit;
40
+ /** Stops the server on a process shutdown; registered by start(), released by stop(). */
41
+ private smartExit;
42
+ private unsubscribeBundleEvents;
43
+ private running;
44
+ private starting;
45
+ private stopping;
30
46
  constructor(options?: IWccDevServerOptions);
47
+ /**
48
+ * The shutdown deadline the server needs, tswatch's: the entry point installs smartexit's
49
+ * `ProcessLifecycle` with it, so every watcher command keeps its full grace period.
50
+ */
51
+ getShutdownTimeoutMs(): number;
52
+ /**
53
+ * Bundles the catalog, starts the watchers and serves. Refused while the server runs or stops;
54
+ * the server starts again after stop().
55
+ */
31
56
  start(): Promise<IWccDevServerAddress>;
32
- /** Stops the server, then tswatch's bundling and watching. */
57
+ /**
58
+ * Stops the server and tswatch's bundling and watching, and releases everything start()
59
+ * registered. A stop during start() waits for the start to settle first; concurrent and
60
+ * repeated calls share one stop.
61
+ */
33
62
  stop(): Promise<void>;
63
+ private release;
64
+ private startServing;
65
+ private getElementPreset;
34
66
  /**
35
67
  * The shell: the prebuilt shell bundle and the typed API.
36
68
  *
37
69
  * Seam for side-effecting APIs (assistant, capture, standards fixes): before any handler with
38
- * side effects is registered here, add a `websocketAdmission`/`requestAdmission` that accepts
39
- * only the shell's own origin, and keep surface mode's strict authority validation.
70
+ * side effects is registered here, the server binds to localhost by default (another interface
71
+ * only on explicit request), validates the Host header against the addresses it serves instead
72
+ * of accepting any hostname, and admits typedsocket connections and typed requests only from the
73
+ * shell's own origin (a `websocketAdmission`/`requestAdmission`), keeping surface mode's strict
74
+ * authority validation. Until then every handler here is read-only.
40
75
  */
41
76
  private createShellSurface;
42
77
  /**