diff --git a/lib/codegen_node.ml b/lib/codegen_node.ml index 56abaae..beafed9 100644 --- a/lib/codegen_node.ml +++ b/lib/codegen_node.ml @@ -228,10 +228,10 @@ function _buildImports() { return 0; }, }; - // Phase 2 hook: callers can replace exports.extraImports with a function - // returning a `{ ModuleName: { exportName: fn, ... } }` map of concrete - // host bindings (e.g. the @hyperpolymath/affine-vscode adapter). Default - // is empty so the shim works standalone. + // Phase 2 hook: a caller may install an `extraImports` factory on the + // exports object returning a `{ ModuleName: { exportName: fn, ... } }` + // map of concrete host bindings (this is what the --vscode-extension + // wiring installs). Default is empty so the shim works standalone. const extras = (typeof exports.extraImports === "function") ? exports.extraImports() : %s; diff --git a/test/test_e2e.ml b/test/test_e2e.ml index fa5f417..f644d83 100644 --- a/test/test_e2e.ml +++ b/test/test_e2e.ml @@ -2851,8 +2851,11 @@ let test_vscode_extension_off_by_default () = let cjs = cjs_of activate_src in Alcotest.(check bool) "no extraImports assignment without the flag" false (contains cjs "exports.extraImports = function"); + (* Assert the absence of the actual adapter *wiring* (the require + call), not the bare specifier string — the latter legitimately + appears in an explanatory comment and is not adapter wiring. *) Alcotest.(check bool) "no adapter require without the flag" - false (contains cjs "@hyperpolymath/affine-vscode") + false (contains cjs {|require("@hyperpolymath/affine-vscode")|}) let test_vscode_extension_inlines_wiring () = let cjs = cjs_of ~vscode_extension:true activate_src in