@markii/host 0.17.0-next.3 → 0.17.0-next.5

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 (55) hide show
  1. package/README.md +34 -1
  2. package/dist/browser-worker.classic.js +640 -0
  3. package/dist/browser-worker.js +19 -19
  4. package/dist/browser.d.ts +1 -1
  5. package/dist/browser.js +10 -3
  6. package/dist/conformance/host/05-export-html-pack-directive/expected.json +2 -0
  7. package/dist/conformance/host/06-install-pack-then-render/expected.json +6 -1
  8. package/dist/conformance/host/17-export-linked-set/expected.json +17 -0
  9. package/dist/conformance/host/17-export-linked-set/files/second.mk.md +3 -0
  10. package/dist/conformance/host/17-export-linked-set/note.mk.md +4 -0
  11. package/dist/conformance/host/17-export-linked-set/scenario.json +6 -0
  12. package/dist/conformance/host/README.md +17 -12
  13. package/dist/diagnostics/render-diagnostics.d.ts +1 -1
  14. package/dist/export/note-export.d.ts +1 -1
  15. package/dist/host/adapter.d.ts +13 -3
  16. package/dist/host/cascade-export-behavior.d.ts +24 -8
  17. package/dist/host/cascade-export-behavior.js +61 -1
  18. package/dist/host/conformance-runner.d.ts +3 -4
  19. package/dist/host/conformance-runner.js +58 -8
  20. package/dist/host/create-host.d.ts +65 -8
  21. package/dist/host/create-host.js +54 -23
  22. package/dist/host/export-behavior.d.ts +2 -1
  23. package/dist/host/export-behavior.js +1 -1
  24. package/dist/host/labels.d.ts +5 -14
  25. package/dist/host/labels.js +8 -22
  26. package/dist/host/pack-archive.d.ts +4 -10
  27. package/dist/host/pack-archive.js +11 -14
  28. package/dist/host/pack-install.d.ts +10 -21
  29. package/dist/host/pack-install.js +22 -16
  30. package/dist/host/pack-trust-behavior.js +1 -1
  31. package/dist/host/run-behavior.d.ts +4 -0
  32. package/dist/host/run-behavior.js +9 -1
  33. package/dist/host/terminal-packs.d.ts +1 -1
  34. package/dist/html-engine.js +4 -4
  35. package/dist/index.d.ts +19 -81
  36. package/dist/index.js +19 -62
  37. package/dist/internal.d.ts +28 -0
  38. package/dist/internal.js +31 -0
  39. package/dist/node-fs.d.ts +0 -3
  40. package/dist/node-fs.js +1 -21
  41. package/dist/node-worker.d.ts +8 -0
  42. package/dist/node-worker.js +36 -15
  43. package/dist/node.d.ts +1 -2
  44. package/dist/node.js +4 -3
  45. package/dist/packs/discover.d.ts +2 -0
  46. package/dist/packs/discover.js +1 -0
  47. package/dist/run/bundle-run.d.ts +1 -1
  48. package/dist/run/bundle-run.js +1 -1
  49. package/dist/run/net-bridge.js +7 -5
  50. package/dist/run/net-pinning.d.ts +2 -0
  51. package/dist/run/net-pinning.js +17 -3
  52. package/dist/run/net-provider.js +23 -12
  53. package/dist/run/net-refusal.d.ts +4 -0
  54. package/dist/run/net-refusal.js +24 -0
  55. package/package.json +28 -12
package/README.md CHANGED
@@ -10,13 +10,46 @@ load, trust and removal, export, completion, hover and component insertion.
10
10
  Entries:
11
11
 
12
12
  - `@markii/host`: environment-neutral; safe to bundle for a browser.
13
+ - `@markii/host/internal`: for the reference apps. No compatibility
14
+ promise; do not build on it.
13
15
  - `@markii/host/browser`: a Web Worker isolate and a `fetch` network
14
16
  provider bound to an origin allowlist.
15
17
  - `@markii/host/node`: a worker-thread isolate (`createNodeHostIsolate`),
16
18
  the address-pinning network provider, and the Node file system seams.
19
+ - `@markii/host/html-engine`: the HTML export engine. The one entry that
20
+ needs `@markii/html`.
21
+ - `@markii/host/browser-worker-classic`: the Web Worker as a classic
22
+ script, for a host that starts it from a blob URL.
17
23
  - `@markii/host/node-worker`: the self-contained worker file, for a host
18
24
  that bundles the worker itself.
19
25
  - `@markii/host/conformance`: the host scenario corpus and its runner, to
20
26
  prove an adapter behaves like the reference apps.
21
27
 
22
- See `docs/integration.md` in the repository for how to write a host.
28
+ A minimal browser host is one adapter and one call:
29
+
30
+ ```ts
31
+ import { createMarkiiHost } from '@markii/host';
32
+ import {
33
+ createBrowserHostIsolate,
34
+ createFetchNetProvider,
35
+ } from '@markii/host/browser';
36
+
37
+ const host = createMarkiiHost({
38
+ id: 'my-app',
39
+ labels,
40
+ readFile,
41
+ exists,
42
+ writeFile,
43
+ listFolder,
44
+ prompt: (request) => showDialog(request),
45
+ memento,
46
+ diagnostics: (line) => console.info(line),
47
+ now: () => Date.now(),
48
+ isolate: createBrowserHostIsolate({
49
+ netProvider: createFetchNetProvider({ allowedOrigins }),
50
+ }),
51
+ });
52
+ ```
53
+
54
+ See `docs/hosts.md` in the repository for the adapter fields, the host
55
+ responsibilities and the reference hosts.