global-exports do not work with 'scoped' ns names

Description

Foreign-libs that provides an ns which is in the npm scoped format like "@foo/bar" can be required and used
in cljs, but global-exports for such nss do not work.

Repro:

in my-foreign-lib.js

var Something = {foo : "bar"}

in cljs file

(ns myns.x (:require ["@scoped/foreignlib" :as lib]))

(def foo-ref (str "test: " lib/foo))

in compiler-opts-scoped.cljs.edn

{:foreign-libs [{:file "src/my-foreign-lib.js" :provides ["@scoped/foreignlib"] :global-exports { "@scoped/foreignlib" Something} }]}

at the cmd line:

clj -m cljs.main -co compiler-opts-scoped.cljs.edn -re node --repl

at the repl:

(require 'myns.x)

=> ReferenceError: _CIRCA_scoped is not defined

The above repro can be found in this repository, please see the README there: https://github.com/henryw374/cljs-global-exports-problems

 

Environment

None

Status

Assignee

Unassigned

Reporter

Henry Widd

Labels

None

Approval

None

Patch

None

Priority

Major
Configure