on master help sign in
Merge branch 'develop' into readme-install-source
commit70207824f5b558aaa885b9f85884e5f2db66151d authorAli Abrar <aliabrar@gmail.com> dateThu 3 Oct 2019, 17:34 (7 years ago) parentbe121e245238f0
3 files changed+6−9
default.nix+1−1 lib/backend/src/Obelisk/Backend.hs+2−1 lib/selftest/src/Obelisk/SelfTest.hs+3−7
default.nix+1−1
@@ -128,7 +128,7 @@ in rec {
128128 obelisk = ghcObelisk;
129129 obeliskEnvs = ghcObeliskEnvs;
130130 command = ghcObelisk.obelisk-command;
131− shell = pinBuildInputs "obelisk-shell" ([command] ++ commandRuntimeDeps pkgs) [];
131+ shell = pinBuildInputs "obelisk-shell" ([command] ++ commandRuntimeDeps pkgs);
132132
133133 selftest = pkgs.writeScript "selftest" ''
134134 #!/usr/bin/env bash
lib/backend/src/Obelisk/Backend.hs+2−1
@@ -47,7 +47,7 @@ import Obelisk.Snap.Extras (doNotCache, serveFileIfExistsAs)
4747import Reflex.Dom
4848import Snap (MonadSnap, Snap, commandLineConfig, defaultConfig, getsRequest, httpServe, modifyResponse
4949 , rqPathInfo, rqQueryString, setContentType, writeBS, writeText
50− , rqCookies, Cookie(..))
50+ , rqCookies, Cookie(..) , setHeader)
5151import Snap.Internal.Http.Server.Config (Config (accessLog, errorLog), ConfigLog (ConfigIoLog))
5252import System.IO (BufferMode (..), hSetBuffering, stderr, stdout)
5353
@@ -167,6 +167,7 @@ serveGhcjsApp
167167serveGhcjsApp urlEnc app config = \case
168168 GhcjsAppRoute_App appRouteComponent :=> Identity appRouteRest -> do
169169 modifyResponse $ setContentType staticRenderContentType
170+ modifyResponse $ setHeader "Cache-Control" "no-store private"
170171 writeBS <=< renderGhcjsFrontend urlEnc (appRouteComponent :/ appRouteRest) config $ _ghcjsApp_value app
171172 GhcjsAppRoute_Resource :=> Identity pathSegments -> serveStaticAssets (_ghcjsApp_compiled app) pathSegments
172173
lib/selftest/src/Obelisk/SelfTest.hs+3−7
@@ -129,8 +129,8 @@ main = do
129129 ls tmp >>= liftIO . assertEqual "" []
130130
131131 it "produces a valid route config" $ inTmpObInit $ \tmp -> liftIO $ do
132− configs <- getConfigs
133− withCurrentDirectory (T.unpack $ toTextIgnore tmp) $
132+ withCurrentDirectory (T.unpack $ toTextIgnore tmp) $ do
133+ configs <- getConfigs
134134 return (either (const Nothing) Just $ getConfigRoute configs) `shouldNotReturn` Nothing
135135
136136 -- These tests fail with "Could not find module 'Obelisk.Generated.Static'"
@@ -145,8 +145,7 @@ main = do
145145 it "can build obelisk command" $ inTmpObInit $ \_ -> nixBuild ["-A", "command" , obeliskImpl]
146146 it "can build obelisk skeleton" $ inTmpObInit $ \_ -> nixBuild ["-A", "skeleton", obeliskImpl]
147147 it "can build obelisk shell" $ inTmpObInit $ \_ -> nixBuild ["-A", "shell", obeliskImpl]
148− -- See https://github.com/obsidiansystems/obelisk/issues/101
149− -- it "can build everything" $ shelly_ $ nixBuild [obeliskImpl]
148+ it "can build everything" $ inTmpObInit $ \_ -> nixBuild [obeliskImpl]
150149
151150 describe "blank initialized project" $ parallel $ do
152151
@@ -166,9 +165,6 @@ main = do
166165 it ("can enter " <> shell) $ inTmpObInit $ \_ -> inShell "exit"
167166 it ("can build in " <> shell) $ inTmpObInit $ \_ -> inShell $ "cabal new-build --" <> fromString compiler <> " all"
168167
169− it "can build reflex project" $ inTmpObInit $ \_ -> do
170− nixBuild []
171−
172168 it "has idempotent thunk update" $ inTmpObInit $ \_ -> do
173169 u <- update
174170 uu <- update