Skip to content
Permalink
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 @@
{"cljsjs/react-highlight/development/react-highlight.inc.js"
"67FBA9BAF39D07D3B35B6576207DC5B3",
"cljsjs/react-highlight/development/react-highlight.min.inc.js"
"85196F44C20A24E1B25F994B13755552"}
@@ -1,18 +1,15 @@
(set-env!
: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]
'[clojure.java.io :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+))

(task-options!
@@ -23,52 +20,25 @@
:scm {:url "https://github.com/cljsjs/packages"}
:license {"MIT" "http://opensource.org/licenses/MIT"}})

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

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

(deftask build []
(let [tmp (boot/tmp-dir!)]
(with-pre-wrap
fileset
(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/copy
(io/file tmp main-file-name)
(io/file tmp +lib-folder+ main-file-name))
(io/copy
(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 "https://github.com/bvaughn/react-highlight.js/archive/" +lib-version+ ".zip")
:checksum "0A03CD61E43498E4A1FB381808AE72A9"
:unzip true))

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

(deps-cljs :name "cljsjs.react-highlight"
:requires ["cljsjs.react"
"cljsjs.prop-types"
"cljsjs.highlight"])
(pom)
(jar)))
(comp
(download :url (str "https://github.com/bvaughn/react-highlight.js/archive/" +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/react-highlight.inc.js"})
(minify :in "cljsjs/react-highlight/development/react-highlight.inc.js"
:out "cljsjs/react-highlight/development/react-highlight.min.inc.js")
(sift :include #{#"^cljsjs"})

(deps-cljs :provides ["react-highlight.js" "cljsjs.react-highlight"]
:global-exports '{react-highlight.js Highlight}
:requires ["react"
"react-dom"
"prop-types"
"highlight.js"])
(pom)
(jar)
(validate)))
@@ -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.