Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[react-date-range] Add library version 0.2.4 #683

Merged
merged 1 commit into from Aug 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 26 additions & 0 deletions react-date-range/README.md
@@ -0,0 +1,26 @@
# cljsjs/react-date-range

[](dependency)
```clojure
[cljsjs/react-date-range "0.2.4-0"] ;; latest release
```
[](/dependency)

This jar comes with `deps.cljs` as used by the [Foreign Libs][flibs] feature
of the Clojurescript compiler. After adding the above dependency to your project
you can require the packaged library like so:

```clojure
(ns application.core
(:require cljsjs.react-date-range))
```

Usage might look something like this:

```clojure
(js/React.createElement
js/ReactDateRange.DateRange
#js {onChange: #(js/console.log %)})
```

[flibs]: https://github.com/clojure/clojurescript/wiki/Packaging-Foreign-Dependencies
70 changes: 70 additions & 0 deletions react-date-range/build.boot
@@ -0,0 +1,70 @@
(set-env!
:resource-paths #{"resources"}
:dependencies '[[cljsjs/boot-cljsjs "0.5.2" :scope "test"]
[cljsjs/react "15.3.0-0"]
[cljsjs/moment "2.10.6-0"]
[cljsjs/classnames "2.2.3-0"]])

(def +lib-version+ "0.2.4")
(def +version+ (str +lib-version+ "-0"))
(def +lib-folder+ (format "react-date-range-%s" +lib-version+))

(task-options!
pom {:project 'cljsjs/react-date-range
:version +version+
:description "A React component for choosing dates and date ranges"
:url "https://github.com/Adphorus/react-date-range"
:scm {:url "https://github.com/cljsjs/packages"}
:license {"GPLv3" "https://www.gnu.org/licenses/gpl-3.0.en.html"}})

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

(def url (format "https://github.com/Adphorus/react-date-range/archive/v%s.zip" +lib-version+))

(deftask download-react-date-range []
(download :url url
:checksum "90869c14c1dc07544f04a8640b9b10a2"
:unzip true))

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

(defn get-file [fileset file-name]
(io/file
(:dir (first (filter #(= (:path %) file-name) (boot/user-files fileset))))
file-name))

(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 "build/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 "npm" "run" "build"))
((sh "./node_modules/.bin/webpack" "--config" "webpack-cljsjs.config.js")))
(-> fileset (boot/add-resource tmp) boot/commit!))))


(deftask package []
(comp
(download-react-date-range)
(build)
(sift :move {#".*react-date-range.js"
"cljsjs/react-date-range/development/react-date-range.inc.js"})
(minify :in "cljsjs/react-date-range/development/react-date-range.inc.js"
:out "cljsjs/react-date-range/production/react-date-range.min.inc.js")
(deps-cljs :name "cljsjs.react-date-range" :requires ["cljsjs.react" "cljsjs.moment"])
(pom)
(jar)))
22 changes: 22 additions & 0 deletions react-date-range/resources/build/webpack.config.js
@@ -0,0 +1,22 @@
var path = require('path');

module.exports = {
entry: path.join(__dirname, "lib", "index.js"),

externals: {
"moment": "moment",
"react": "React"
},

output: {
path: path.join(__dirname, "build"),
publicPath: "/build/",
filename: "react-date-range.js",
libraryTarget: "var",
library: "ReactDateRange"
},

node: {
fs: 'empty'
}
}
@@ -0,0 +1,150 @@
// Built using externs generator
// Step 1: Load https://cdnjs.cloudflare.com/ajax/libs/react/15.3.0/react.js
// Step 2: Load https://cdnjs.cloudflare.com/ajax/libs/react/15.3.0/react-dom.js
// Step 3: Load https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.14.1/moment.js
// Step 4: Load <built js from target dir>
// Use js namespace "ReactDateRange"
/**********************************************************************
* Extern for ReactDateRange
* Generated by http://jmmk.github.io/javascript-externs-generator
**********************************************************************/
var ReactDateRange = {
"DateRange": {
"defaultProps": {
"linkedCalendars": {},
"theme": {},
"format": {},
"calendars": {},
"onlyClasses": {},
"classNames": {}
},
"propTypes": {
"format": {
"isRequired": function () {}
},
"firstDayOfWeek": {
"isRequired": function () {}
},
"calendars": {
"isRequired": function () {}
},
"startDate": {
"isRequired": function () {}
},
"endDate": {
"isRequired": function () {}
},
"minDate": {
"isRequired": function () {}
},
"maxDate": {
"isRequired": function () {}
},
"dateLimit": {
"isRequired": function () {}
},
"ranges": {
"isRequired": function () {}
},
"linkedCalendars": {
"isRequired": function () {}
},
"theme": {
"isRequired": function () {}
},
"onInit": {
"isRequired": function () {}
},
"onChange": {
"isRequired": function () {}
},
"onlyClasses": {
"isRequired": function () {}
},
"classNames": {
"isRequired": function () {}
}
}
},
"Calendar": {
"defaultProps": {
"format": {},
"theme": {},
"onlyClasses": {},
"classNames": {}
},
"propTypes": {
"sets": {
"isRequired": function () {}
},
"range": {
"isRequired": function () {}
},
"minDate": {
"isRequired": function () {}
},
"maxDate": {
"isRequired": function () {}
},
"date": {
"isRequired": function () {}
},
"format": function () {},
"firstDayOfWeek": {
"isRequired": function () {}
},
"onChange": {
"isRequired": function () {}
},
"onInit": {
"isRequired": function () {}
},
"link": {
"isRequired": function () {}
},
"linkCB": {
"isRequired": function () {}
},
"theme": {
"isRequired": function () {}
},
"onlyClasses": {
"isRequired": function () {}
},
"classNames": {
"isRequired": function () {}
}
}
},
"defaultRanges": {
"Today": {
"startDate": function () {},
"endDate": function () {}
},
"Yesterday": {
"startDate": function () {},
"endDate": function () {}
},
"Last 7 Days": {
"startDate": function () {},
"endDate": function () {}
},
"Last 30 Days": {
"startDate": function () {},
"endDate": function () {}
}
}
};
ReactDateRange.DateRange.prototype = {
"isReactComponent": function () {},
"setState": function () {},
"forceUpdate": function () {}
};
ReactDateRange.Calendar.prototype = {
"isReactComponent": function () {},
"setState": function () {},
"forceUpdate": function () {}
};
/**********************************************************************
* End Generated Extern for ReactDateRange
/**********************************************************************/