Skip to content
Browse files

[react-highlight] provide npm style name

  • Loading branch information...
Deraen committed Apr 26, 2018
1 parent 0cad932 commit dc78e64e406f9c3f78ecd0184575a39aabade281
@@ -0,0 +1,4 @@
@@ -1,18 +1,15 @@
:resource-paths #{"resources"}
:dependencies '[[cljsjs/boot-cljsjs "0.9.0" :scope "test"]
[cljsjs/react "15.3.0-0"]
:dependencies '[[cljsjs/boot-cljsjs "0.10.0" :scope "test"]
[cljsjs/react "16.3.2-0"]
[cljsjs/react-dom "16.3.2-0"]
[cljsjs/prop-types "15.6.0-0"]
[cljsjs/highlight "9.6.0-0"]])
[cljsjs/highlight "9.12.0-2"]])

(require '[cljsjs.boot-cljsjs.packaging :refer :all]
'[boot.core :as boot]
'[boot.tmpdir :as tmpd]
'[ :as io]
'[boot.util :refer [sh]])
(require '[cljsjs.boot-cljsjs.packaging :refer :all])

(def +lib-version+ "1.0.7")
(def +version+ (str +lib-version+ "-1"))
(def +version+ (str +lib-version+ "-2"))
(def +lib-folder+ (format "react-highlight.js-%s" +lib-version+))

@@ -23,52 +20,25 @@
:scm {:url ""}
:license {"MIT" ""}})

(require '[boot.core :as c]
'[boot.tmpdir :as tmpd]
'[ :as io]
'[clojure.string :as string])

(def main-file-name "main.js")

(deftask build []
(let [tmp (boot/tmp-dir!)]
(doseq [f (boot/input-files fileset)]
(let [target (io/file tmp (tmpd/path f))]
(io/make-parents target)
(io/copy (tmpd/file f) target)))
(io/file tmp main-file-name)
(io/file tmp +lib-folder+ main-file-name))
(io/file tmp "webpack.config.js")
(io/file tmp +lib-folder+ "webpack-cljsjs.config.js"))
(binding [*sh-dir* (str (io/file tmp +lib-folder+))]
((sh "npm" "install" "--ignore-scripts"))
((sh "npm" "install" "webpack"))
((sh "./node_modules/.bin/webpack" "--config" "webpack-cljsjs.config.js")))
(-> fileset (boot/add-resource tmp) boot/commit!))))

(deftask download-react-highlight []
(download :url (str "" +lib-version+ ".zip")
:checksum "0A03CD61E43498E4A1FB381808AE72A9"
:unzip true))

(deftask package []
(sift :move
{#"^react-highlight\.js.*[/ \\]dist[/ \\]main.js$"
(minify :in "cljsjs/react-highlight/development/"
:out "cljsjs/react-highlight/development/")
(sift :include #{#"^cljsjs"})

(deps-cljs :name "cljsjs.react-highlight"
:requires ["cljsjs.react"
(download :url (str "" +lib-version+ ".zip")
:unzip true)
(sift :move {#"^react-highlight\.js-\d*\.\d*.\d*/" ""})
(run-commands :commands [["npm" "install" "--ignore-scripts"]
["npm" "install" "webpack@3.11.0"]
["./node_modules/.bin/webpack" "--config" "webpack.config.js"]])
(sift :move {#"^main\.js$" "cljsjs/react-highlight/development/"})
(minify :in "cljsjs/react-highlight/development/"
:out "cljsjs/react-highlight/development/")
(sift :include #{#"^cljsjs"})

(deps-cljs :provides ["react-highlight.js" "cljsjs.react-highlight"]
:global-exports '{react-highlight.js Highlight}
:requires ["react"
@@ -14,7 +14,6 @@ module.exports = {

output: {
path: 'dist',
filename: '[name].js',
libraryTarget: "var",
library: "Highlight"
@@ -24,7 +23,7 @@ module.exports = {
loaders: [
test: /\.js$/,
loader: 'babel',
loader: 'babel-loader',
include: path.join(__dirname, 'src')

0 comments on commit dc78e64

Please sign in to comment.
You can’t perform that action at this time.