Skip to content

Commit 2afa411

Browse files
authored
Make ClojureScript dependency :provided (#143)
Fixes #65
1 parent bb06691 commit 2afa411

File tree

8 files changed

+236
-196
lines changed

8 files changed

+236
-196
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ workflows:
190190
parameters:
191191
jdk_version: [openjdk8, openjdk11, openjdk16, openjdk17]
192192
clojure_version: ["1.8", "1.9", "1.10", "master"]
193-
test_profiles: ["+test", "+test,+enrich-classpath"]
193+
test_profiles: ["+test,-provided", "+test,+provided", "+test,+provided,+enrich-classpath"]
194194
- util_job:
195195
name: Code Linting, (latest LTS JDK)
196196
jdk_version: openjdk17

CHANGELOG.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
## master (unreleased)
44

5-
## 0.9.0 (2022-01-8)
6-
75
### Changes
86

9-
* [#51](https://github.com/clojure-emacs/orchard/issues/51): extend find-usages
10-
* `orchard.xref/fn-deps` now also finds anonymous function dependencies
11-
* added `orchard.xref/fn-deps-class` as a lower level API so you can still get the main functions deps only
12-
* added `orchard.xref/fn-transitive-deps`
7+
* [#51](https://github.com/clojure-emacs/orchard/issues/51): extend `find-usages`
8+
* `orchard.xref/fn-deps` now also finds anonymous function dependencies.
9+
* New: `orchard.xref/fn-deps-class` as a lower level API so you can still get the main functions deps only.
10+
* New: `orchard.xref/fn-transitive-deps`.
11+
* [#65](https://github.com/clojure-emacs/orchard/issues/65): make ClojureScript dependency `:provided`.
12+
* If you were using Orchard for ClojureScript functionality, it might be a good idea to make sure you have an explicit `org.clojure/clojurescript` dependency.
1313

1414
### Bugs fixed
1515

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ cljfmt:
2121
lein with-profile -user,-dev,+$(VERSION),+cljfmt cljfmt check
2222

2323
kondo:
24-
lein with-profile -user,-dev,+clj-kondo run -m clj-kondo.main --lint src test src-jdk8 src-newer-jdks test-newer-jdks
24+
lein with-profile -user,-dev,+clj-kondo run -m clj-kondo.main --lint src test src-jdk8 src-newer-jdks test-newer-jdks test-cljs
2525

2626
# When releasing, the BUMP variable controls which field in the
2727
# version string will be incremented in the *next* snapshot
@@ -30,17 +30,17 @@ kondo:
3030
BUMP ?= patch
3131

3232
release: clean
33-
lein with-profile -user,-dev,+$(VERSION) release $(BUMP)
33+
lein with-profile -user,-dev,+$(VERSION),-provided release $(BUMP)
3434

3535
# Deploying requires the caller to set environment variables as
3636
# specified in project.clj to provide a login and password to the
3737
# artifact repository.
3838

3939
deploy: clean
40-
lein with-profile -user,-dev,+$(VERSION) deploy clojars
40+
lein with-profile -user,-dev,+$(VERSION),-provided deploy clojars
4141

4242
install: clean
43-
lein with-profile -user,-dev,+$(VERSION) install
43+
lein with-profile -user,-dev,+$(VERSION),-provided install
4444

4545
clean:
4646
lein with-profile -user,-dev clean

project.clj

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
:url "http://www.eclipse.org/legal/epl-v10.html"}
88
:scm {:name "git" :url "https://github.com/clojure-emacs/orchard"}
99

10-
:dependencies [[org.clojure/clojurescript "1.10.520"]]
11-
:exclusions [org.clojure/clojure] ; see versions matrix below
10+
:exclusions [org.clojure/clojure ; see versions matrix below
11+
org.clojure/clojurescript]
1212

1313
:aliases {"bump-version" ["change" "version" "leiningen.release/bump-version"]}
1414

@@ -33,8 +33,10 @@
3333

3434
:profiles {
3535
;; Clojure versions matrix
36-
:provided {:dependencies [[org.clojure/clojure "1.10.1"]
37-
[org.clojure/clojure "1.10.1" :classifier "sources"]]}
36+
:provided {:dependencies [[org.clojure/clojure "1.10.3"]
37+
[org.clojure/clojure "1.10.3" :classifier "sources"]
38+
[org.clojure/clojurescript "1.11.4"]]
39+
:test-paths ["test-cljs"]}
3840
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]
3941
[org.clojure/clojure "1.8.0" :classifier "sources"]]}
4042
:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]
@@ -72,9 +74,9 @@
7274
letfn [[:block 1] [:inner 2]]}}}
7375

7476
:clj-kondo [:test
75-
{:dependencies [[clj-kondo "2021.12.01"]]}]
77+
{:dependencies [[clj-kondo "2021.12.19"]]}]
7678

77-
:eastwood {:plugins [[jonase/eastwood "1.0.0"]]
79+
:eastwood {:plugins [[jonase/eastwood "1.1.0"]]
7880
:eastwood {:exclude-namespaces ~(cond-> []
7981
jdk8?
8082
(conj 'orchard.java.parser)

src/orchard/cljs/analysis.cljc

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,19 @@
66
[orchard.misc :as misc])
77
(:refer-clojure :exclude [find-ns find-var all-ns ns-aliases]))
88

9-
(defn all-ns
10-
[env]
11-
(->> (:cljs.analyzer/namespaces env)
12-
;; recent CLJS versions include data about macro namespaces in the
13-
;; compiler env, but we should not include them in completions or pass
14-
;; them to format-ns unless they're actually required (which is handled
15-
;; by macro-ns-candidates below)
16-
(into {} (filter (fn [[_ ns]]
17-
(not (and (contains? ns :macros)
18-
(= 1 (count ns)))))))))
9+
(defn all-ns [{namespaces :cljs.analyzer/namespaces}]
10+
(into {}
11+
(remove (fn [[ns-sym ns]]
12+
;; Remove pseudo-namespaces that the cljs analyzer
13+
;; started returning at some point:
14+
(or (-> ns-sym name (.startsWith "goog."))
15+
;; recent CLJS versions include data about macro namespaces in the
16+
;; compiler env, but we should not include them in completions or pass
17+
;; them to format-ns unless they're actually required (which is handled
18+
;; by macro-ns-candidates below):
19+
(and (contains? ns :macros)
20+
(= 1 (count ns))))))
21+
namespaces))
1922

2023
(defn find-ns
2124
[env ns]

0 commit comments

Comments
 (0)