Skip to content

Commit

Permalink
Include highlight.js using cljsjs instead of npm-deps
Browse files Browse the repository at this point in the history
This fixes the failing uberjar creation of intermine/bluegenes.
  • Loading branch information
heralden committed Aug 29, 2019
1 parent 613d128 commit febcc67
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 17 deletions.
5 changes: 0 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"dependencies": {
"@cljs-oss/module-deps": "^1.1.1",
"highlight.js": "^9.12.0"
"@cljs-oss/module-deps": "^1.1.1"
}
}
7 changes: 2 additions & 5 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject org.intermine/im-tables "0.8.2"
(defproject org.intermine/im-tables "0.8.3"
:dependencies [[org.clojure/clojure "1.10.1"]
[org.clojure/clojurescript "1.10.520"]
[org.clojure/core.async "0.4.500"]
Expand All @@ -8,6 +8,7 @@
[reagent "0.8.1"]
[cljsjs/react-transition-group "1.2.0-0"
:exclusions [cljsjs/react cljsjs/react-dom]]
[cljsjs/highlight "9.12.0-2"]
[compojure "1.6.1"]
[ring "1.7.1"]
[cljs-http "0.1.46"]
Expand Down Expand Up @@ -57,8 +58,6 @@
:source-map-timestamp true
:preloads [devtools.preload]
:parallel-build true
:npm-deps {:highlight.js "9.12.0"}
:install-deps true
:external-config {:devtools/config {:features-to-install :all}}}}


Expand All @@ -69,8 +68,6 @@
:output-to "resources/public/js/compiled/app.js"
:optimizations :advanced
:closure-defines {goog.DEBUG false}
:npm-deps {:highlight.js "9.12.0"}
:install-deps true
:pretty-print false}}

{:id "test"
Expand Down
8 changes: 7 additions & 1 deletion src/im_tables/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@
[im-tables.config :as config]
[imcljs.query :as query]
[re-frisk.core :refer [enable-re-frisk!]]
[cljsjs.react-transition-group]))
[cljsjs.react-transition-group]
[cljsjs.highlight]
[cljsjs.highlight.langs.javascript]
[cljsjs.highlight.langs.perl]
[cljsjs.highlight.langs.python]
[cljsjs.highlight.langs.ruby]
[cljsjs.highlight.langs.java]))


(defn dev-setup []
Expand Down
7 changes: 3 additions & 4 deletions src/im_tables/views/dashboard/manager/codegen/main.cljs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
(ns im-tables.views.dashboard.manager.codegen.main
(:require [re-frame.core :refer [subscribe dispatch]]
[reagent.core :as r]
["highlight.js" :as hljs]
[clojure.string :as string]
[imcljs.internal.utils :refer [scrub-url]]
[oops.core :refer [ocall oget oset!]]))
Expand Down Expand Up @@ -66,11 +65,11 @@
(reset! max-height (-> js/window js/$ (ocall :height)))
(ocall (js/$ "pre code") :each
(fn [i block]
(ocall hljs :highlightBlock block))))
(ocall js/hljs :highlightBlock block))))
:component-did-update (fn [this]
(ocall (js/$ "pre code") :each
(fn [i block]
(ocall hljs :highlightBlock block))))
(ocall js/hljs :highlightBlock block))))
:reagent-render (fn [loc]
(let [highlight? (:highlight? @codegen-settings)]
[:div.container-fluid
Expand Down Expand Up @@ -120,4 +119,4 @@
[:li {:on-click (fn []
(dispatch [:main/set-codegen-option loc :lang value true])
(dispatch [:prep-modal loc (build-modal loc)]))}
[:a label]]) languages))]])))
[:a label]]) languages))]])))

0 comments on commit febcc67

Please sign in to comment.