From eabf13ebdbbd3aecec7deadb79b67922ad8bd02b Mon Sep 17 00:00:00 2001 From: Alp Mestanogullari Date: Wed, 22 Jul 2015 12:55:44 +0200 Subject: [PATCH] rename servant-jquery to servant-js, Servant.JQuery to Servant.JS --- README.md | 2 +- scripts/shell.nix | 6 +++--- servant-examples/servant-examples.cabal | 2 +- {servant-jquery => servant-js}/CHANGELOG.md | 0 {servant-jquery => servant-js}/LICENSE | 0 {servant-jquery => servant-js}/README.md | 2 +- {servant-jquery => servant-js}/Setup.hs | 0 {servant-jquery => servant-js}/TODO.md | 0 {servant-jquery => servant-js}/default.nix | 4 ++-- {servant-jquery => servant-js}/docs.sh | 0 .../examples/README.md | 0 .../examples/counter.hs | 12 +++++------ .../examples/counter.md | 0 .../examples/www/angular/angular.min.js | 0 .../examples/www/angular/index.html | 1 - .../examples/www/angular/service.html | 1 - .../examples/www/index.html | 0 .../examples/www/jquery/index.html | 1 - .../examples/www/jquery/jquery.min.js | 0 .../examples/www/vanilla/index.html | 1 - .../servant-js.cabal | 20 ++++++++++--------- .../JQuery.hs => servant-js/src/Servant/JS.hs | 7 +++---- .../src/Servant/JS}/Angular.hs | 11 +++++----- .../src/Servant/JS}/Internal.hs | 2 +- .../src/Servant/JS}/JQuery.hs | 4 ++-- .../src/Servant/JS}/Vanilla.hs | 4 ++-- .../test/Servant/JSSpec.hs | 12 +++++------ .../test/Servant/JSSpec}/CustomHeaders.hs | 4 ++-- {servant-jquery => servant-js}/test/Spec.hs | 0 sources.txt | 2 +- 30 files changed, 48 insertions(+), 50 deletions(-) rename {servant-jquery => servant-js}/CHANGELOG.md (100%) rename {servant-jquery => servant-js}/LICENSE (100%) rename {servant-jquery => servant-js}/README.md (99%) rename {servant-jquery => servant-js}/Setup.hs (100%) rename {servant-jquery => servant-js}/TODO.md (100%) rename {servant-jquery => servant-js}/default.nix (81%) rename {servant-jquery => servant-js}/docs.sh (100%) rename {servant-jquery => servant-js}/examples/README.md (100%) rename {servant-jquery => servant-js}/examples/counter.hs (91%) rename {servant-jquery => servant-js}/examples/counter.md (100%) rename {servant-jquery => servant-js}/examples/www/angular/angular.min.js (100%) rename {servant-jquery => servant-js}/examples/www/angular/index.html (97%) rename {servant-jquery => servant-js}/examples/www/angular/service.html (97%) rename {servant-jquery => servant-js}/examples/www/index.html (100%) rename {servant-jquery => servant-js}/examples/www/jquery/index.html (96%) rename {servant-jquery => servant-js}/examples/www/jquery/jquery.min.js (100%) rename {servant-jquery => servant-js}/examples/www/vanilla/index.html (96%) rename servant-jquery/servant-jquery.cabal => servant-js/servant-js.cabal (81%) rename servant-jquery/src/Servant/JQuery.hs => servant-js/src/Servant/JS.hs (93%) rename {servant-jquery/src/Servant/JQuery => servant-js/src/Servant/JS}/Angular.hs (93%) rename {servant-jquery/src/Servant/JQuery => servant-js/src/Servant/JS}/Internal.hs (99%) rename {servant-jquery/src/Servant/JQuery => servant-js/src/Servant/JS}/JQuery.hs (97%) rename {servant-jquery/src/Servant/JQuery => servant-js/src/Servant/JS}/Vanilla.hs (97%) rename servant-jquery/test/Servant/JQuerySpec.hs => servant-js/test/Servant/JSSpec.hs (96%) rename {servant-jquery/test/Servant/JQuerySpec => servant-js/test/Servant/JSSpec}/CustomHeaders.hs (96%) rename {servant-jquery => servant-js}/test/Spec.hs (100%) diff --git a/README.md b/README.md index c0afc713..ebdae484 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ In order to minimize the dependencies depending on your needs, we provide these - `servant-server`, which lets you *implement* an HTTP server with handlers for each endpoint of an API. - `servant-client`, which lets you derive automatically Haskell functions that let you query each endpoint of a `servant` webservice. - `servant-docs`, which lets you generate API docs for your webservice. -- `servant-jquery`, which lets you derive Javascript functions (based on jquery) to query your API's endpoints, in the same spirit as `servant-client`. +- `servant-js`, which lets you derive Javascript functions (using vanilla JS ajax requests, angular or jquery) to query your API's endpoints, in the same spirit as `servant-client`. - `servant-blaze` and `servant-lucid` provide easy HTML rendering of your data as an `HTML` content-type "combinator". ## Tutorial diff --git a/scripts/shell.nix b/scripts/shell.nix index 61dda6c8..615506cc 100644 --- a/scripts/shell.nix +++ b/scripts/shell.nix @@ -9,12 +9,12 @@ let modifiedHaskellPackages = haskellngPackages.override { ../servant-server {}) "--ghc-options=-Werror"; servant-client = appendConfigureFlag (self.callPackage ../servant-client {}) "--ghc-options=-Werror"; - servant-jquery = appendConfigureFlag (self.callPackage - ../servant-jquery {}) "--ghc-options=-Werror"; + servant-js = appendConfigureFlag (self.callPackage + ../servant-js {}) "--ghc-options=-Werror"; servant-docs = appendConfigureFlag (self.callPackage ../servant-docs {}) "--ghc-options=-Werror"; }; }; in modifiedHaskellPackages.ghcWithPackages ( p : with p ; [ - servant servant-server servant-client servant-jquery servant-docs + servant servant-server servant-client servant-js servant-docs ]) diff --git a/servant-examples/servant-examples.cabal b/servant-examples/servant-examples.cabal index 0e8f096c..d91c585e 100644 --- a/servant-examples/servant-examples.cabal +++ b/servant-examples/servant-examples.cabal @@ -32,7 +32,7 @@ executable tutorial , random , servant == 0.4.* , servant-docs == 0.4.* - , servant-jquery == 0.4.* + , servant-js == 0.4.* , servant-lucid == 0.4.* , servant-server == 0.4.* , text diff --git a/servant-jquery/CHANGELOG.md b/servant-js/CHANGELOG.md similarity index 100% rename from servant-jquery/CHANGELOG.md rename to servant-js/CHANGELOG.md diff --git a/servant-jquery/LICENSE b/servant-js/LICENSE similarity index 100% rename from servant-jquery/LICENSE rename to servant-js/LICENSE diff --git a/servant-jquery/README.md b/servant-js/README.md similarity index 99% rename from servant-jquery/README.md rename to servant-js/README.md index f6c6c7b8..53d09880 100644 --- a/servant-jquery/README.md +++ b/servant-js/README.md @@ -1,4 +1,4 @@ -# servant-jquery +# servant-js ![servant](https://raw.githubusercontent.com/haskell-servant/servant/master/servant.png) diff --git a/servant-jquery/Setup.hs b/servant-js/Setup.hs similarity index 100% rename from servant-jquery/Setup.hs rename to servant-js/Setup.hs diff --git a/servant-jquery/TODO.md b/servant-js/TODO.md similarity index 100% rename from servant-jquery/TODO.md rename to servant-js/TODO.md diff --git a/servant-jquery/default.nix b/servant-js/default.nix similarity index 81% rename from servant-jquery/default.nix rename to servant-js/default.nix index 59f1da4e..f84d977e 100644 --- a/servant-jquery/default.nix +++ b/servant-js/default.nix @@ -3,7 +3,7 @@ , servant-server, stdenv, stm, text, transformers, warp }: mkDerivation { - pname = "servant-jquery"; + pname = "servant-js"; version = "0.4.0"; src = ./.; isLibrary = true; @@ -16,6 +16,6 @@ mkDerivation { base hspec hspec-expectations language-ecmascript lens servant ]; homepage = "http://haskell-servant.github.io/"; - description = "Automatically derive (jquery) javascript functions to query servant webservices"; + description = "Automatically derive javascript functions to query servant webservices"; license = stdenv.lib.licenses.bsd3; } diff --git a/servant-jquery/docs.sh b/servant-js/docs.sh similarity index 100% rename from servant-jquery/docs.sh rename to servant-js/docs.sh diff --git a/servant-jquery/examples/README.md b/servant-js/examples/README.md similarity index 100% rename from servant-jquery/examples/README.md rename to servant-js/examples/README.md diff --git a/servant-jquery/examples/counter.hs b/servant-js/examples/counter.hs similarity index 91% rename from servant-jquery/examples/counter.hs rename to servant-js/examples/counter.hs index 1e1cdd20..7fad2fc3 100644 --- a/servant-jquery/examples/counter.hs +++ b/servant-js/examples/counter.hs @@ -10,11 +10,11 @@ import Data.Proxy import GHC.Generics import Network.Wai.Handler.Warp (run) import Servant -import Servant.JQuery -import qualified Servant.JQuery as SJQ -import qualified Servant.JQuery.Vanilla as JS -import qualified Servant.JQuery.JQuery as JQ -import qualified Servant.JQuery.Angular as NG +import Servant.JS +import qualified Servant.JS as SJS +import qualified Servant.JS.Vanilla as JS +import qualified Servant.JS.JQuery as JQ +import qualified Servant.JS.Angular as NG import System.FilePath -- * A simple Counter data type @@ -77,7 +77,7 @@ writeJS gen fp functions = writeFile fp $ writeServiceJS :: FilePath -> [AjaxReq] -> IO () writeServiceJS fp functions = writeFile fp $ NG.wrapInServiceWith (NG.defAngularOptions { NG.serviceName = "counterSvc" }) - (defCommonGeneratorOptions { SJQ.moduleName = "counterApp" }) functions + (defCommonGeneratorOptions { SJS.moduleName = "counterApp" }) functions main :: IO () main = do diff --git a/servant-jquery/examples/counter.md b/servant-js/examples/counter.md similarity index 100% rename from servant-jquery/examples/counter.md rename to servant-js/examples/counter.md diff --git a/servant-jquery/examples/www/angular/angular.min.js b/servant-js/examples/www/angular/angular.min.js similarity index 100% rename from servant-jquery/examples/www/angular/angular.min.js rename to servant-js/examples/www/angular/angular.min.js diff --git a/servant-jquery/examples/www/angular/index.html b/servant-js/examples/www/angular/index.html similarity index 97% rename from servant-jquery/examples/www/angular/index.html rename to servant-js/examples/www/angular/index.html index 5467547a..81ce491a 100644 --- a/servant-jquery/examples/www/angular/index.html +++ b/servant-js/examples/www/angular/index.html @@ -13,7 +13,6 @@

Angular version

{{ 'Counter: ' + counter }} -or view the docs diff --git a/servant-jquery/examples/www/jquery/jquery.min.js b/servant-js/examples/www/jquery/jquery.min.js similarity index 100% rename from servant-jquery/examples/www/jquery/jquery.min.js rename to servant-js/examples/www/jquery/jquery.min.js diff --git a/servant-jquery/examples/www/vanilla/index.html b/servant-js/examples/www/vanilla/index.html similarity index 96% rename from servant-jquery/examples/www/vanilla/index.html rename to servant-js/examples/www/vanilla/index.html index a4d504b5..245172ab 100644 --- a/servant-jquery/examples/www/vanilla/index.html +++ b/servant-js/examples/www/vanilla/index.html @@ -11,7 +11,6 @@

Vanilla version

Counter: 0 -or view the docs