Shpadoinkle-developer-tools 0.0.0.1 → 0.0.0.2
raw patch · 2 files changed
+73/−52 lines, 2 files
Files
- Main.hs +9/−5
- Shpadoinkle-developer-tools.cabal +64/−47
Main.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE DeriveAnyClass #-}+{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE ExtendedDefaultRules #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE LambdaCase #-}@@ -17,6 +19,7 @@ import Data.Text (Text, pack, unpack) import Data.Time (UTCTime, defaultTimeLocale, formatTime, getCurrentTime)+import GHC.Generics (Generic) import Language.Javascript.JSaddle (FromJSVal (fromJSVal), JSM, MonadJSM, fun, js, js1, js2, jsg, liftJSM, obj, strictEqual, (<#))@@ -25,7 +28,8 @@ import UnliftIO (TVar, atomically, modifyTVar, newTVarIO) -import Shpadoinkle (Html, flagProp, shpadoinkle, text)+import Shpadoinkle (Html, NFData, flagProp,+ shpadoinkle, text) import Shpadoinkle.Backend.ParDiff (runParDiff) import Shpadoinkle.Html import Shpadoinkle.Run (runJSorWarp)@@ -35,14 +39,14 @@ newtype History = History { unHistory :: Text }- deriving (Eq, Ord, Show)+ deriving (Eq, Ord, Show, Generic, NFData) data Model = Model { _history :: Map UTCTime History , _active :: Maybe UTCTime , _sync :: Bool- } deriving (Eq, Show)+ } deriving (Eq, Show, Generic, NFData) makeLenses ''Model @@ -93,7 +97,7 @@ void $ jsg "chrome" ^. (js "tabs" . js2 "sendMessage" tabId msg) -prettyHtml :: Int -> Pretty.Value -> Html m a+prettyHtml :: Monad m => Int -> Pretty.Value -> Html m a prettyHtml depth = \case Pretty.Con con [] -> div "con-uniary" $ string con Pretty.Con con slots -> details [ className "con-wrap", ("open", flagProp $ depth < 3) ]@@ -148,7 +152,7 @@ app = do model <- liftIO $ newTVarIO emptyModel listenForOutput model- shpadoinkle id runParDiff emptyModel model panel getBody+ shpadoinkle id runParDiff model panel getBody main :: IO ()
Shpadoinkle-developer-tools.cabal view
@@ -1,42 +1,56 @@-cabal-version: 1.12---- This file has been generated from package.yaml by hpack version 0.33.0.------ see: https://github.com/sol/hpack------ hash: a1087083f64a24e1a337267f5340d0e7ed3089e4156374e0aef1cd1258fc313d--name: Shpadoinkle-developer-tools-version: 0.0.0.1-synopsis: Chrome extension to aide in development-description: A chrome extension to make developing Shpadoinkle applications easier-category: Web-author: Isaac Shapira-maintainer: fresheyeball@protonmail.com-license: BSD3-license-file: LICENSE-build-type: Simple+cabal-version: 2.2+name: Shpadoinkle-developer-tools+version: 0.0.0.2+category: Web+author: Isaac Shapira+maintainer: isaac.shapira@platonic.systems+license: BSD-3-Clause+license-file: LICENSE+build-type: Simple extra-source-files:- README.md+ README.md+synopsis:+ Chrome extension to aide in development+description:+ A chrome extension to make developing Shpadoinkle applications easier + source-repository head type: git- location: https://gitlab.com/fresheyeball/Shpadoinkle.git+ location: https://gitlab.com/platonic/shpadoinkle.git + flag development description: Add instrumentation for development purposes. manual: True default: False -library- exposed-modules:- Shpadoinkle.DeveloperTools- other-modules:- Main- Paths_Shpadoinkle_developer_tools- hs-source-dirs:- ./.- ghc-options: -Wall -Wcompat -fwarn-redundant-constraints -fwarn-incomplete-uni-patterns -fwarn-tabs -fwarn-incomplete-record-updates -fwarn-identities++common ghc-options+ ghc-options:+ -Wall+ -Wcompat+ -fwarn-redundant-constraints+ -fwarn-incomplete-uni-patterns+ -fwarn-tabs+ -fwarn-incomplete-record-updates+ -fwarn-identities+++common ghcjs-options+ ghcjs-options:+ -Wall+ -Wcompat+ -fno-warn-missing-home-modules+ -fwarn-redundant-constraints+ -fwarn-incomplete-uni-patterns+ -fwarn-tabs+ -fwarn-incomplete-record-updates+ -fwarn-identities+ -O2+++common build-depends build-depends: Shpadoinkle , Shpadoinkle-backend-pardiff@@ -50,29 +64,32 @@ , text , time , unliftio++library+ import: ghc-options, ghcjs-options, build-depends++ exposed-modules:+ Shpadoinkle.DeveloperTools++ other-modules:+ Main++ hs-source-dirs: .+ if flag(development) cpp-options: -DDEVELOPMENT+ default-language: Haskell2010 + executable devtools+ import: ghc-options, ghcjs-options, build-depends+ main-is: Main.hs+ other-modules:- Shpadoinkle.DeveloperTools- hs-source-dirs:- ./.- ghc-options: -Wall -Wcompat -fwarn-redundant-constraints -fwarn-incomplete-uni-patterns -fwarn-tabs -fwarn-incomplete-record-updates -fwarn-identities- ghcjs-options: -Wall -Wcompat -fno-warn-missing-home-modules -fwarn-redundant-constraints -fwarn-incomplete-uni-patterns -fwarn-tabs -fwarn-incomplete-record-updates -fwarn-identities -dedupe -O2- build-depends:- Shpadoinkle- , Shpadoinkle-backend-pardiff- , Shpadoinkle-html- , base >=4.12.0 && <4.16- , containers- , jsaddle- , lens- , pretty-show- , stm- , text- , time- , unliftio+ Shpadoinkle.DeveloperTools++ hs-source-dirs: .+ default-language: Haskell2010