packages feed

yesod-fay 0.7.1 → 0.8.0

raw patch · 4 files changed

+32/−11 lines, 4 filesdep +filepathdep −system-fileiodep −system-filepathPVP ok

version bump matches the API change (PVP)

Dependencies added: filepath

Dependencies removed: system-fileio, system-filepath

API changes (from Hackage documentation)

- Fay.Yesod: instance Data.Data.Data a => Data.Data.Data (Fay.Yesod.Returns a)
- Fay.Yesod: instance GHC.Classes.Eq (Fay.Yesod.Returns a)
- Fay.Yesod: instance GHC.Read.Read (Fay.Yesod.Returns a)
- Fay.Yesod: instance GHC.Show.Show (Fay.Yesod.Returns a)
- Yesod.Fay: [yfsExternal] :: YesodFaySettings -> Maybe (FilePath, Exp)
- Yesod.Fay: [yfsModuleName] :: YesodFaySettings -> String
- Yesod.Fay: [yfsPackages] :: YesodFaySettings -> [String]
- Yesod.Fay: [yfsPostProcess] :: YesodFaySettings -> String -> IO String
- Yesod.Fay: [yfsRequireJQuery] :: YesodFaySettings -> Bool
- Yesod.Fay: [yfsSeparateRuntime] :: YesodFaySettings -> Maybe (FilePath, Exp)
- Yesod.Fay: [yfsTypecheckDevel] :: YesodFaySettings -> Bool
- Yesod.Fay: instance Yesod.Fay.YesodFay master => Yesod.Core.Class.Dispatch.YesodSubDispatch Yesod.Fay.Data.FaySite (Yesod.Core.Types.HandlerT master GHC.Types.IO)
+ Fay.Yesod: instance Data a => Data (Returns a)
+ Fay.Yesod: instance Eq (Returns a)
+ Fay.Yesod: instance Read (Returns a)
+ Fay.Yesod: instance Show (Returns a)
+ Fay.Yesod: instance Typeable Returns
+ Yesod.Fay: instance YesodFay master => YesodSubDispatch FaySite (HandlerT master IO)
+ Yesod.Fay: yfsExternal :: YesodFaySettings -> Maybe (FilePath, Exp)
+ Yesod.Fay: yfsModuleName :: YesodFaySettings -> String
+ Yesod.Fay: yfsPackages :: YesodFaySettings -> [String]
+ Yesod.Fay: yfsPostProcess :: YesodFaySettings -> String -> IO String
+ Yesod.Fay: yfsRequireJQuery :: YesodFaySettings -> Bool
+ Yesod.Fay: yfsSeparateRuntime :: YesodFaySettings -> Maybe (FilePath, Exp)
+ Yesod.Fay: yfsTypecheckDevel :: YesodFaySettings -> Bool
- Yesod.Fay: type CommandHandler master = forall s. (forall a. (Data a) => Returns a -> a -> HandlerT master IO s) -> Value -> HandlerT master IO s
+ Yesod.Fay: type CommandHandler master = forall s. (forall a. Data a => Returns a -> a -> HandlerT master IO s) -> Value -> HandlerT master IO s

Files

+ ChangeLog.md view
@@ -0,0 +1,3 @@+## 0.8.0++* Drop system-filepath
+ README.md view
@@ -0,0 +1,18 @@+yesod-fay+=========++Utilities for using the [Fay](https://github.com/faylang/fay/wiki) Haskell-to-JS compiler with [Yesod](http://www.yesodweb.com).++For an example of a Yesod application with Fay integrated, have a look at the `sample/` directory in this repository, or alternatively use the experimental Postgres-Fay (`pf`) application template (select it when running `yesod init` with recent versions of Yesod).+++Usage with cabal sandboxes+--------------------------++You are highly encouraged to create a cabal sandbox for your Yesod app. This feature is available in cabal 1.18+.++Use the following command to set an environment variable (this is a workaround, needed until Fay integrates with [haskell-packages](http://hackage.haskell.org/package/haskell-packages), only possible after cabal 1.20 is released). ++    export HASKELL_PACKAGE_SANDBOX=`echo .cabal-sandbox/*-packages.conf.d/`++Make sure to run this from the root of the Yesod project.
Yesod/Fay.hs view
@@ -102,8 +102,8 @@ import           Data.Text.Encoding         (encodeUtf8) import qualified Data.Text.Lazy.Encoding as TLE import           Data.Text.Lazy.Builder     (fromText, toLazyText, Builder)-import           Filesystem                 (createTree, isFile, readTextFile)-import           Filesystem.Path.CurrentOS  (directory, encodeString, decodeString)+import           System.Directory           (createDirectoryIfMissing, doesFileExist)+import           System.FilePath            (takeDirectory) import           Fay                        (getRuntime, showCompileError) import           Fay.Convert                (showToFay) #if MIN_VERSION_fay(0,20,0)@@ -226,7 +226,7 @@     }  updateRuntime :: FilePath -> IO ()-updateRuntime fp = getRuntime >>= \js -> createTree (directory $ decodeString fp) >> copyFile js fp+updateRuntime fp = getRuntime >>= \js -> createDirectoryIfMissing True (takeDirectory fp) >> copyFile js fp  instance YesodFay master => YesodSubDispatch FaySite (HandlerT master IO) where     yesodSubDispatch = $(mkYesodSubDispatch resourcesFaySite)@@ -257,20 +257,20 @@           returnJson $ fayEncode master value -- FIXME what should we do for Nothing values?  langYesodFay :: String-langYesodFay = $(qRunIO $ fmap (LitE . StringL . unpack) $ readTextFile "Fay/Yesod.hs")+langYesodFay = $(qRunIO $ fmap (LitE . StringL . unpack) $ T.readFile "Fay/Yesod.hs")  writeYesodFay :: IO () writeYesodFay = do     let fp = "fay/Fay/Yesod.hs"         content = "-- NOTE: This file is auto-generated.\n" ++ langYesodFay-    exists <- isFile fp+    exists <- doesFileExist fp     mcurrent <-         if exists-            then fmap (Just . unpack) $ readTextFile fp+            then fmap (Just . unpack) $ T.readFile fp             else return Nothing     unless (mcurrent == Just content) $ do-        createTree $ directory fp-        writeFile (encodeString fp) content+        createDirectoryIfMissing True $ takeDirectory fp+        writeFile fp content  maybeRequireJQuery :: YesodFay master => Bool -> WidgetT master IO () maybeRequireJQuery needJQuery = when needJQuery requireJQuery
yesod-fay.cabal view
@@ -1,5 +1,5 @@ name:                yesod-fay-version:             0.7.1+version:             0.8.0 synopsis:            Utilities for using the Fay Haskell-to-JS compiler with Yesod. description:         For initial discussion, see <http://www.yesodweb.com/blog/2012/10/yesod-fay-js>. This is a work-in-progress. homepage:            https://github.com/fpco/yesod-fay@@ -10,6 +10,7 @@ category:            Web, Yesod build-type:          Simple cabal-version:       >=1.8+extra-source-files:  README.md ChangeLog.md  library   exposed-modules:     Yesod.Fay@@ -24,8 +25,6 @@                      , data-default >= 0.4                      , directory >= 1.1.0.2                      , text >= 0.11-                     , system-fileio >= 0.3-                     , system-filepath >= 0.4                      , template-haskell                      , process                      , shakespeare@@ -35,3 +34,4 @@                      , pureMD5 >= 2.1.2.1                      , utf8-string >= 0.3.7                      , monad-loops >= 0.3.3.0+                     , filepath