Closed cgrand closed 5 months ago
I don't know about others, but only the local/root case matters to me (and it would definitely be nice to have soon); I'd be happy to work on this, if it's a good candidate for getting my feet wet.
After more thoughts on the problem:
resolve-deps
to get a map of libs to paths.clojuredart
that we add as local deps to pubspec@momerath42 that's very nice but I think but we need it ASAP so we are going to do it. But we could need some help on review, testing, design & co
a76c09a41 is working great, with a bunch of dart dependencies pulled in from my other (root/local) project, as well as use of several of its .cljd files. Thanks!
In a76c09a we implemented a way to handle dart dependencies (transitively across deps.edn).
For lib users: it should just work, add the lib to deps.edn
and the next cljd command (compile, flutter, clean) will retrieve dart deps if needed.
For lib authors:
[ ] TODO: document it
The problem is allowing a package (typically a CLJC package) to declare dependencies to a Dart package and this dependencies declaration to be preserved irrespective of the packaging and of the number of intermediate dependency.
When a clojure lib is packaged as a jar, only "classes", resources are preserved.
deps.edn
is lost.pom.xml
is sometimes embedded under a descendant path ofMETA-INF
. Whatever we need we should put it underMETA-INF
.We could write in MANIFEST.MF but this would mean being dependent on the packaging of the lib and we would need something else for git or local deps.
We'd like to be be able to add dart deps under
:deps
indeps.edn
. But it's unclear how to make it participate to tools.deps. Even if it's not critical, dart deps are not namespaced, they use a single identifier but tools.deps complain about non-namespaced symbol so it could mean using symboles likepub/shared_preferences
.We are not interested into publishing clj libs to pub.dev so dart deps don't make sense for
tools.deps
in general to care about dart deps. Thus it may be easiest to follow the same route as shadow-cljs and use a:dart/deps
key.