Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from flyboarder/master
Initial commit
- Loading branch information
Showing
18 changed files
with
311 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
BOOT_VERSION=2.6.0 | ||
BOOT_EMIT_TARGET=no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
(defn read-file [file] (read-string (slurp file))) | ||
(defn get-deps [] (read-file "./dependencies.edn")) | ||
;(defn get-devdeps [] (read-file "./dev_dependencies.edn")) | ||
|
||
(set-env! | ||
:dependencies (get-deps) | ||
:resource-paths #{"src"}) | ||
|
||
(require | ||
'[adzerk.bootlaces :refer :all] | ||
'[degree9.boot-semver :refer :all] | ||
'[degree9.boot-semgit :refer :all] | ||
'[degree9.boot-semgit.workflow :refer :all] | ||
'[tolitius.boot-check :as check]) | ||
|
||
(task-options! | ||
pom {:project 'degree9/featherscript | ||
:version (get-version) | ||
:description "Feathersjs wrapper for ClojureScript." | ||
:url "http://github.com/degree9/featherscript" | ||
:scm {:url "http://github.com/degree9/featherscript"}}) | ||
|
||
(deftask ci-deps | ||
"Force CI to fetch dependencies." | ||
[] | ||
identity) | ||
|
||
(deftask tests | ||
"Run code tests." | ||
[] | ||
(comp | ||
(check/with-kibit) | ||
;(check/with-yagni) | ||
(check/with-eastwood) | ||
(check/with-bikeshed) | ||
)) | ||
|
||
(deftask deploy | ||
"Build project for deployment to clojars." | ||
[] | ||
(comp | ||
(version :minor 'inc :patch 'zero) | ||
(build-jar) | ||
(push-release))) | ||
|
||
(deftask develop | ||
"Build project for local development." | ||
[] | ||
(comp | ||
(watch) | ||
(version :no-update true | ||
:minor 'inc | ||
:patch 'zero | ||
:pre-release 'snapshot) | ||
(build-jar))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[[org.clojure/clojure "1.7.0" :scope "provided"] | ||
[org.clojure/clojurescript "1.7.228" :scope "provided"] | ||
[adzerk/boot-cljs "1.7.228-2" :scope "test"] | ||
[adzerk/bootlaces "0.1.13"] | ||
[adzerk/env "0.3.0"] | ||
[cljsjs/feathers "1.8.0-0"] | ||
[cljsjs/jquery "1.9.1-0"] | ||
[cljsjs/socket-io "1.6.0-0" :scope "provided"] | ||
[degree9/boot-semver "1.3.6" :scope "test"] | ||
[degree9/boot-semgit "0.2.1" :scope "test"] | ||
[degree9/boot-npm "0.2.0"] | ||
[tolitius/boot-check "0.1.3" :scope "test"]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
(ns feathers.app | ||
(:refer-clojure :exclude [rest]) | ||
(:require [feathers.core :as fs] | ||
[feathers.cors :as cors] | ||
[feathers.configuration :as config] | ||
[feathers.compression :as compression] | ||
[feathers.favicon :as favicon] | ||
[feathers.body-parser :as body-parser] | ||
[feathers.hooks :as hooks] | ||
[feathers.rest :as rest] | ||
[feathers.socketio :as socketio] | ||
[feathers.express :as express])) | ||
|
||
(defn feathers! [] (fs/feathers)) | ||
|
||
(def configuration config/configure) | ||
|
||
(def compress compression/use) | ||
|
||
(defn cors [app] | ||
(-> app | ||
(express/options "*" (cors/cors)) | ||
(cors/use))) | ||
|
||
(def favicon favicon/use) | ||
|
||
(defn body-parser [app] | ||
(-> app | ||
body-parser/json | ||
(body-parser/urlencoded #js{:extended true}))) | ||
|
||
(def hooks hooks/configure) | ||
|
||
(def rest rest/configure) | ||
|
||
(def socketio socketio/configure) | ||
|
||
(def api fs/use) | ||
|
||
(defn static [feathers path] | ||
(fs/use feathers (fs/static path))) | ||
|
||
(def listen fs/listen) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(ns feathers.body-parser | ||
(:require [cljs.nodejs :as node] | ||
[feathers.core :as fs])) | ||
|
||
(def body-parser (node/require "body-parser")) | ||
|
||
(defn json [app] | ||
(fs/use app (.json body-parser))) | ||
|
||
(defn urlencoded [app conf] | ||
(fs/use app (.urlencoded body-parser conf))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
(ns feathers.boot-feathers | ||
(:require [boot.core :as boot] | ||
[degree9.boot-npm :as npm])) | ||
|
||
(boot/deftask feathers | ||
"Download feathers.js npm packages." | ||
[f feathers VAL str "Version for feathers package." | ||
r rest VAL str "Version for feathers-rest package." | ||
s socketio VAL str "Version for feathers-socketio package." | ||
e errors VAL str "Version for feathers-errors package." | ||
m memory VAL str "Version for feathers-memory package." | ||
a authentication VAL str "Version for feathers-authentication package." | ||
c configuration VAL str "Version for feathers-configuration package." | ||
b body-parser VAL str "Version for body-parser package." | ||
o cors VAL str "Version for cors package." | ||
z compression VAL str "Version for compression package." | ||
i serve-favicon VAL str "Version for serve-favicon package."] | ||
(npm/npm :install | ||
{:feathers (:feathers *opts* "latest") | ||
:feathers-rest (:rest *opts* "latest") | ||
:feathers-socketio (:socketio *opts* "latest") | ||
:feathers-errors (:errors *opts* "latest") | ||
:feathers-memory (:memory *opts* "latest") | ||
:feathers-authentication (:authentication *opts* "latest") | ||
:feathers-configuration (:configuration *opts* "latest") | ||
:body-parser (:body-parser *opts* "latest") | ||
:cors (:cors *opts* "latest") | ||
:compression (:compression *opts* "latest") | ||
:serve-favicon (:serve-favicon *opts* "latest")} | ||
:cache-key ::feathers)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
(ns feathers.client | ||
(:refer-clojure :exclude [rest]) | ||
(:require [cljsjs.feathers] | ||
[cljsjs.jquery])) | ||
|
||
(def feathers js/feathers) | ||
|
||
(defn configure | ||
[app callback] | ||
(.configure app callback)) | ||
|
||
(defn rest [app] | ||
(configure app (.jquery (.rest feathers) js/jquery))) | ||
|
||
(defn socketio [app socket] | ||
(configure app (.socketio feathers socket))) | ||
|
||
(defn hooks [app] | ||
(configure app (.hooks feathers))) | ||
|
||
(defn authentication [app conf] | ||
(configure app (.authentication feathers conf))) | ||
|
||
(defn service | ||
[app svc] | ||
(.service app svc)) | ||
|
||
(defn authenticate | ||
([app] (.authenticate app)) | ||
([app conf] (.authenticate app (clj->js conf)))) | ||
|
||
(defn logout | ||
[app] | ||
(.logout app)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(ns feathers.compression | ||
(:require [cljs.nodejs :as node] | ||
[feathers.core :as fs])) | ||
|
||
(def compression (node/require "compression")) | ||
|
||
(defn use [app] | ||
(fs/use app (compression))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(ns feathers.configuration | ||
(:require [cljs.nodejs :as node] | ||
[feathers.core :as fs])) | ||
|
||
(def configuration (node/require "feathers-configuration")) | ||
|
||
(defn configure [app path] | ||
(fs/configure app (configuration path))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
(ns feathers.core | ||
(:require [cljs.nodejs :as node])) | ||
|
||
(def feathers (node/require "feathers")) | ||
|
||
(defn static [path] | ||
(.static feathers path)) | ||
|
||
(defn configure | ||
[app callback] | ||
(.configure app callback)) | ||
|
||
(defn listen | ||
[app & [port]] | ||
(.listen app port)) | ||
|
||
(defn setup | ||
[app server] | ||
(.setup app server)) | ||
|
||
(defn use | ||
([app service] | ||
(.use app service)) | ||
([app path service] | ||
(.use app path service))) | ||
|
||
(defn service | ||
([app path] | ||
(.service app path)) | ||
([app path service] | ||
(.service app path service))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(ns feathers.cors | ||
(:require [cljs.nodejs :as node] | ||
[feathers.core :as fs])) | ||
|
||
(def cors (node/require "cors")) | ||
|
||
(defn use [app] | ||
(fs/use app (cors))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(ns feathers.express | ||
(:require [cljs.nodejs :as node])) | ||
|
||
(def express (node/require "express")) | ||
|
||
(defn options | ||
([app opts] (.options app opts)) | ||
([app path opts] (.options app path opts))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(ns feathers.favicon | ||
(:require [cljs.nodejs :as node] | ||
[feathers.core :as fs])) | ||
|
||
(def favicon (node/require "serve-favicon")) | ||
|
||
(defn use [app path] | ||
(fs/use app (favicon path))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(ns feathers.hooks | ||
(:require [cljs.nodejs :as node] | ||
[feathers.core :as fs])) | ||
|
||
(def hooks (node/require "feathers-hooks")) | ||
|
||
(defn configure [app] | ||
(fs/configure app (hooks))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
(ns feathers.rest | ||
(:refer-clojure :exclude [rest]) | ||
(:require [cljs.nodejs :as node] | ||
[feathers.core :as fs])) | ||
|
||
(def rest (node/require "feathers-rest")) | ||
|
||
(defn configure [app] | ||
(fs/configure app (rest))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
(ns feathers.services | ||
(:require [cljs.nodejs :as node] | ||
[feathers.core :as fs])) | ||
|
||
(def service fs/service) | ||
|
||
(defn find [service params & [callback]] | ||
(.find service params callback)) | ||
|
||
(defn get [service id params & [callback]] | ||
(.get service id params callback)) | ||
|
||
(defn create [service data params & [callback]] | ||
(.create service data params callback)) | ||
|
||
(defn update [service id data params & [callback]] | ||
(.update service id data params callback)) | ||
|
||
(defn patch [service id data params & [callback]] | ||
(.patch service id data params callback)) | ||
|
||
(defn remove [service id params & [callback]] | ||
(.remove service id params callback)) | ||
|
||
(defn setup [service app path] | ||
(.setup service app path)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(ns feathers.socketio | ||
(:require [cljs.nodejs :as node] | ||
[feathers.core :as fs])) | ||
|
||
(def socketio (node/require "feathers-socketio")) | ||
|
||
(defn configure [app] | ||
(fs/configure app (socketio))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#Thu Jul 14 14:17:53 MDT 2016 | ||
VERSION=0.1.0 |