on master help sign in
Merge branch 'develop' into readme-install-source
7020782Ali Abrar
default.nix+1−1
@@ -128,7 +128,7 @@ in rec {
128 obelisk = ghcObelisk;
128 obelisk = ghcObelisk;
129 obeliskEnvs = ghcObeliskEnvs;
129 obeliskEnvs = ghcObeliskEnvs;
130 command = ghcObelisk.obelisk-command;
130 command = ghcObelisk.obelisk-command;
131− shell = pinBuildInputs "obelisk-shell" ([command] ++ commandRuntimeDeps pkgs) [];
131+ shell = pinBuildInputs "obelisk-shell" ([command] ++ commandRuntimeDeps pkgs);
132
132
133 selftest = pkgs.writeScript "selftest" ''
133 selftest = pkgs.writeScript "selftest" ''
134 #!/usr/bin/env bash
134 #!/usr/bin/env bash
lib/backend/src/Obelisk/Backend.hs+2−1
@@ -47,7 +47,7 @@ import Obelisk.Snap.Extras (doNotCache, serveFileIfExistsAs)
47import Reflex.Dom
47import Reflex.Dom
48import Snap (MonadSnap, Snap, commandLineConfig, defaultConfig, getsRequest, httpServe, modifyResponse
48import Snap (MonadSnap, Snap, commandLineConfig, defaultConfig, getsRequest, httpServe, modifyResponse
49 , rqPathInfo, rqQueryString, setContentType, writeBS, writeText
49 , rqPathInfo, rqQueryString, setContentType, writeBS, writeText
50− , rqCookies, Cookie(..))
50+ , rqCookies, Cookie(..) , setHeader)
51import Snap.Internal.Http.Server.Config (Config (accessLog, errorLog), ConfigLog (ConfigIoLog))
51import Snap.Internal.Http.Server.Config (Config (accessLog, errorLog), ConfigLog (ConfigIoLog))
52import System.IO (BufferMode (..), hSetBuffering, stderr, stdout)
52import System.IO (BufferMode (..), hSetBuffering, stderr, stdout)
53
53
@@ -167,6 +167,7 @@ serveGhcjsApp
167serveGhcjsApp urlEnc app config = \case
167serveGhcjsApp urlEnc app config = \case
168 GhcjsAppRoute_App appRouteComponent :=> Identity appRouteRest -> do
168 GhcjsAppRoute_App appRouteComponent :=> Identity appRouteRest -> do
169 modifyResponse $ setContentType staticRenderContentType
169 modifyResponse $ setContentType staticRenderContentType
170+ modifyResponse $ setHeader "Cache-Control" "no-store private"
170 writeBS <=< renderGhcjsFrontend urlEnc (appRouteComponent :/ appRouteRest) config $ _ghcjsApp_value app
171 writeBS <=< renderGhcjsFrontend urlEnc (appRouteComponent :/ appRouteRest) config $ _ghcjsApp_value app
171 GhcjsAppRoute_Resource :=> Identity pathSegments -> serveStaticAssets (_ghcjsApp_compiled app) pathSegments
172 GhcjsAppRoute_Resource :=> Identity pathSegments -> serveStaticAssets (_ghcjsApp_compiled app) pathSegments
172
173
lib/selftest/src/Obelisk/SelfTest.hs+3−7
@@ -129,8 +129,8 @@ main = do
129 ls tmp >>= liftIO . assertEqual "" []
129 ls tmp >>= liftIO . assertEqual "" []
130
130
131 it "produces a valid route config" $ inTmpObInit $ \tmp -> liftIO $ do
131 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
134 return (either (const Nothing) Just $ getConfigRoute configs) `shouldNotReturn` Nothing
134 return (either (const Nothing) Just $ getConfigRoute configs) `shouldNotReturn` Nothing
135
135
136 -- These tests fail with "Could not find module 'Obelisk.Generated.Static'"
136 -- These tests fail with "Could not find module 'Obelisk.Generated.Static'"
@@ -145,8 +145,7 @@ main = do
145 it "can build obelisk command" $ inTmpObInit $ \_ -> nixBuild ["-A", "command" , obeliskImpl]
145 it "can build obelisk command" $ inTmpObInit $ \_ -> nixBuild ["-A", "command" , obeliskImpl]
146 it "can build obelisk skeleton" $ inTmpObInit $ \_ -> nixBuild ["-A", "skeleton", obeliskImpl]
146 it "can build obelisk skeleton" $ inTmpObInit $ \_ -> nixBuild ["-A", "skeleton", obeliskImpl]
147 it "can build obelisk shell" $ inTmpObInit $ \_ -> nixBuild ["-A", "shell", obeliskImpl]
147 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]
150
149
151 describe "blank initialized project" $ parallel $ do
150 describe "blank initialized project" $ parallel $ do
152
151
@@ -166,9 +165,6 @@ main = do
166 it ("can enter " <> shell) $ inTmpObInit $ \_ -> inShell "exit"
165 it ("can enter " <> shell) $ inTmpObInit $ \_ -> inShell "exit"
167 it ("can build in " <> shell) $ inTmpObInit $ \_ -> inShell $ "cabal new-build --" <> fromString compiler <> " all"
166 it ("can build in " <> shell) $ inTmpObInit $ \_ -> inShell $ "cabal new-build --" <> fromString compiler <> " all"
168
167
169− it "can build reflex project" $ inTmpObInit $ \_ -> do
170− nixBuild []
171−
172 it "has idempotent thunk update" $ inTmpObInit $ \_ -> do
168 it "has idempotent thunk update" $ inTmpObInit $ \_ -> do
173 u <- update
169 u <- update
174 uu <- update
170 uu <- update