this repo has no description

odoc-interactive-extension: consolidate dual-compiler builds, per-package findlib, cross-jsoo compat

- Consolidate js_top_worker and odoc dual-compiler stanzas into single
library stanzas with cppo rules generating impl.ml from impl.cppo.ml
- Per-package findlib_index.json with relative universe paths (../dep)
and implicit stdlib dependency injection
- Add find_stdlib_dcs to Impl.S interface for stdlib CMI lookup via
findlib metadata instead of hardcoded URLs
- Replace jsoo Json.output/Json.unsafe_input with plain JSON.stringify/
JSON.parse for cross-jsoo-version compatibility (6.0.1+ox vs 6.2.0)
- Cross-origin worker support: set __global_rel_url in blob worker,
skip URL rewriting for absolute http(s) URLs
- Fix odoc doc comments and ocamlformat-ignore for cppo files
- Add demo docs, helper scripts, and x-ocaml package-lock.json

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+70 -2
+11 -2
src/jtw_client.ml
··· 23 23 let effective_url = 24 24 if is_cross_origin url then begin 25 25 (* Cross-origin workers are blocked by browsers. Work around this by 26 - creating a blob: URL that uses importScripts to load the real script. *) 27 - let js_code = Printf.sprintf {|importScripts("%s");|} url in 26 + creating a blob: URL that uses importScripts to load the real script. 27 + We also set __global_rel_url so the worker can resolve relative paths 28 + (e.g., lib/ocaml/stdlib.cmi) back to the correct origin. *) 29 + let base_dir = 30 + match String.rindex_opt url '/' with 31 + | Some i -> String.sub url 0 i 32 + | None -> url 33 + in 34 + let js_code = Printf.sprintf 35 + {|globalThis.__global_rel_url="%s";importScripts("%s");|} 36 + base_dir url in 28 37 let blob = Jv.new' (Jv.get Jv.global "Blob") 29 38 [| Jv.of_jv_array [| Jv.of_string js_code |]; 30 39 Jv.obj [| "type", Jv.of_string "application/javascript" |] |] in
+59
test/package-lock.json
··· 1 + { 2 + "name": "x-ocaml-browser-tests", 3 + "version": "1.0.0", 4 + "lockfileVersion": 3, 5 + "requires": true, 6 + "packages": { 7 + "": { 8 + "name": "x-ocaml-browser-tests", 9 + "version": "1.0.0", 10 + "devDependencies": { 11 + "playwright": "^1.40.0" 12 + } 13 + }, 14 + "node_modules/fsevents": { 15 + "version": "2.3.2", 16 + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", 17 + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", 18 + "dev": true, 19 + "hasInstallScript": true, 20 + "optional": true, 21 + "os": [ 22 + "darwin" 23 + ], 24 + "engines": { 25 + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" 26 + } 27 + }, 28 + "node_modules/playwright": { 29 + "version": "1.58.2", 30 + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.58.2.tgz", 31 + "integrity": "sha512-vA30H8Nvkq/cPBnNw4Q8TWz1EJyqgpuinBcHET0YVJVFldr8JDNiU9LaWAE1KqSkRYazuaBhTpB5ZzShOezQ6A==", 32 + "dev": true, 33 + "dependencies": { 34 + "playwright-core": "1.58.2" 35 + }, 36 + "bin": { 37 + "playwright": "cli.js" 38 + }, 39 + "engines": { 40 + "node": ">=18" 41 + }, 42 + "optionalDependencies": { 43 + "fsevents": "2.3.2" 44 + } 45 + }, 46 + "node_modules/playwright-core": { 47 + "version": "1.58.2", 48 + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.58.2.tgz", 49 + "integrity": "sha512-yZkEtftgwS8CsfYo7nm0KE8jsvm6i/PTgVtB8DL726wNf6H2IMsDuxCpJj59KDaxCtSnrWan2AeDqM7JBaultg==", 50 + "dev": true, 51 + "bin": { 52 + "playwright-core": "cli.js" 53 + }, 54 + "engines": { 55 + "node": ">=18" 56 + } 57 + } 58 + } 59 + }