on master help sign in
Get parts of reactor working / remove blaze dependency
commitc25388e45582bcd6136f96bffe17c3de13fa9ef4 authorEvan Czaplicki <evancz@users.noreply.github.com> dateFri 6 Apr 2018, 16:27 (9 years ago) parent225e79b
7 files changed+154−315
builder/src/Reporting/Progress.hs+8 elm.cabal−3 ui/terminal/src/Develop.hs+39−56 ui/terminal/src/Develop/Compile.hs−30 ui/terminal/src/Develop/Generate/Help.hs+42−92 ui/terminal/src/Develop/Generate/Index.hs+63−133 ui/terminal/src/Develop/StaticFiles.hs+2−1
builder/src/Reporting/Progress.hs+8
@@ -2,6 +2,7 @@
22module Reporting.Progress
33 ( Reporter(..)
44 , makeReporter
5+ , silentReporter
56 , Msg(..)
67 , Progress(..)
78 , Outcome(..)
@@ -43,6 +44,13 @@ makeReporter chan mvar =
4344 Reporter tell end
4445
4546
47+silentReporter :: Reporter
48+silentReporter =
49+ Reporter
50+ (\_ -> return ())
51+ (\_ -> return ())
52+
53+
4654
4755-- MESSAGES
4856
elm.cabal−3
@@ -54,7 +54,6 @@ Executable elm
5454 other-modules:
5555 Bump
5656 Develop
57− Develop.Compile
5857 Develop.Generate.Help
5958 Develop.Generate.Index
6059 Develop.StaticFiles
@@ -229,8 +228,6 @@ Executable elm
229228 ansi-wl-pprint >= 0.6.7 && < 0.7,
230229 base >=4.8 && <5,
231230 binary >= 0.8 && < 0.9,
232− blaze-html,
233− blaze-markup,
234231 bytestring >= 0.9 && < 0.11,
235232 containers >= 0.5.8.2 && < 0.6,
236233 directory >= 1.2.3.0 && < 2.0,
ui/terminal/src/Develop.hs+39−56
@@ -6,20 +6,18 @@ module Develop
66 where
77
88import Control.Applicative ((<|>))
9−import Control.Concurrent (threadDelay)
109import Control.Monad (guard)
1110import Control.Monad.Trans (MonadIO(liftIO))
11+import qualified Data.ByteString.Builder as B
12+import qualified Data.ByteString as BS
1213import qualified Data.HashMap.Strict as HashMap
13−import qualified Data.ByteString.Char8 as BSC
14−import System.Directory
14+import Data.Monoid ((<>))
15+import qualified System.Directory as Dir
1516import System.FilePath
1617import Snap.Core
1718import Snap.Http.Server
1819import Snap.Util.FileServe
19−import qualified Text.Blaze.Html5 as H
20−import qualified Text.Blaze.Html.Renderer.Utf8 as Blaze
2120
22−import qualified Develop.Compile as Compile
2321import qualified Develop.Generate.Help as Generate
2422import qualified Develop.Generate.Index as Index
2523import qualified Develop.StaticFiles as StaticFiles
@@ -41,13 +39,10 @@ run () (Flags maybePort) =
4139 port =
4240 maybe 8000 id maybePort
4341 in
44− do putStrLn (startupMessage port)
42+ do putStrLn $ "Go to <http://localhost:" ++ show port ++ "> to see your project dashboard."
4543
4644 httpServe (config port) $
4745 serveFiles
48− <|> route [ ("_compile", compile) ]
49− <|> route [ ("_elm/move-to-root", moveToRoot)]
50− <|> route [ ("_elm/create-new-project", createNewProject)]
5146 <|> serveDirectoryWith directoryConfig "."
5247 <|> serveAssets
5348 <|> error404
@@ -68,21 +63,18 @@ config port =
6863
6964
7065
71−-- HELPERS
72−
73−
74−startupMessage :: Int -> String
75−startupMessage port =
76− "Go to <http://localhost:" ++ show port ++ "> to see your project dashboard."
66+-- INDEX
7767
7868
7969directoryConfig :: MonadSnap m => DirectoryConfig m
8070directoryConfig =
8171 let
82− customGenerator directory =
83− do project <- liftIO (Index.getProject directory)
84− modifyResponse $ setContentType "text/html; charset=utf-8"
85− writeBuilder (Blaze.renderHtmlBuilder (Index.toHtml project))
72+ customGenerator pwd =
73+ do modifyResponse $ setContentType "text/html; charset=utf-8"
74+ html <- liftIO $
75+ do root <- Dir.getCurrentDirectory
76+ Index.get root pwd
77+ writeBuilder html
8678 in
8779 fancyDirectoryConfig
8880 { indexFiles = []
@@ -90,38 +82,32 @@ directoryConfig =
9082 }
9183
9284
93−compile :: Snap ()
94−compile =
95− do file <- getSafePath
96− guard =<< liftIO (doesFileExist file)
97− modifyResponse (setContentType "text/javascript")
98− writeBS =<< liftIO (Compile.toJavaScript file)
9985
86+-- COMPILE
10087
101−error404 :: Snap ()
102−error404 =
103− do modifyResponse $ setResponseStatus 404 "Not Found"
104− modifyResponse $ setContentType "text/html; charset=utf-8"
105− writeBuilder $ Blaze.renderHtmlBuilder $
106− Generate.makeHtml
107− "Page Not Found"
108− ("/" ++ StaticFiles.elmPath)
109− "Elm.NotFound.fullscreen();"
88+
89+_compile :: Snap ()
90+_compile =
91+ do file <- getSafePath
92+ guard =<< liftIO (Dir.doesFileExist file)
93+ modifyResponse (setContentType "text/javascript")
94+ writeBS =<< liftIO (toJavaScript file)
11095
11196
97+toJavaScript :: FilePath -> IO BS.ByteString
98+toJavaScript filePath =
99+ error "TODO toJavaScript" filePath
112100
113−-- CREATE NEW PROJECT
114101
115102
116−createNewProject :: Snap ()
117−createNewProject =
118− do liftIO $ threadDelay (2 * 1000 * 1000)
119− return ()
103+-- NOT FOUND
120104
121105
122−moveToRoot :: Snap ()
123−moveToRoot =
124− liftIO Index.moveToRoot
106+error404 :: Snap ()
107+error404 =
108+ do modifyResponse $ setResponseStatus 404 "Not Found"
109+ modifyResponse $ setContentType "text/html; charset=utf-8"
110+ writeBuilder $ Generate.makePageHtml "NotFound" ""
125111
126112
127113
@@ -131,16 +117,10 @@ moveToRoot =
131117serveFiles :: Snap ()
132118serveFiles =
133119 do file <- getSafePath
134− guard =<< liftIO (doesFileExist file)
120+ guard =<< liftIO (Dir.doesFileExist file)
135121 serveElm file <|> serveFilePretty file
136122
137123
138−serveHtml :: MonadSnap m => H.Html -> m ()
139−serveHtml html =
140− do modifyResponse (setContentType "text/html")
141− writeBuilder (Blaze.renderHtmlBuilder html)
142−
143−
144124
145125-- SERVE FILES + CODE HIGHLIGHTING
146126
@@ -170,8 +150,10 @@ getSubExts fullExtension =
170150
171151serveCode :: String -> Snap ()
172152serveCode file =
173− do code <- liftIO (readFile file)
174− serveHtml $ Generate.makeCodeHtml ('~' : '/' : file) code
153+ do code <- liftIO (BS.readFile file)
154+ modifyResponse (setContentType "text/html")
155+ writeBuilder $
156+ Generate.makeCodeHtml ('~' : '/' : file) (B.byteString code)
175157
176158
177159
@@ -181,7 +163,8 @@ serveCode file =
181163serveElm :: FilePath -> Snap ()
182164serveElm file =
183165 do guard (takeExtension file == ".elm")
184− serveHtml (Generate.makeElmHtml file)
166+ modifyResponse (setContentType "text/html")
167+ writeBuilder (error "TODO")
185168
186169
187170
@@ -196,7 +179,7 @@ serveAssets =
196179 pass
197180
198181 Just (content, mimeType) ->
199− do modifyResponse (setContentType $ BSC.pack (mimeType ++ ";charset=utf-8"))
182+ do modifyResponse (setContentType (mimeType <> ";charset=utf-8"))
200183 writeBS content
201184
202185
@@ -204,7 +187,7 @@ serveAssets =
204187-- MIME TYPES
205188
206189
207−lookupMimeType :: FilePath -> Maybe BSC.ByteString
190+lookupMimeType :: FilePath -> Maybe BS.ByteString
208191lookupMimeType ext =
209192 HashMap.lookup ext mimeTypeDict
210193
@@ -214,7 +197,7 @@ lookupMimeType ext =
214197 (a, b)
215198
216199
217−mimeTypeDict :: HashMap.HashMap FilePath BSC.ByteString
200+mimeTypeDict :: HashMap.HashMap FilePath BS.ByteString
218201mimeTypeDict =
219202 HashMap.fromList
220203 [ ".asc" ==> "text/plain"
ui/terminal/src/Develop/Compile.hsdeleted−30
@@ -1,30 +0,0 @@
1−{-# OPTIONS_GHC -Wall #-}
2−{-# LANGUAGE OverloadedStrings #-}
3−module Develop.Compile
4− ( toJavaScript
5− )
6− where
7−
8−
9−import qualified Data.ByteString.Char8 as BS
10−
11−
12−
13−-- TO JAVASCRIPT
14−
15−
16−toJavaScript :: FilePath -> IO BS.ByteString
17−toJavaScript filePath =
18− do result <- error "TODO toJavaScript" filePath
19− case result of
20− Right (code, name) ->
21− return $ BS.append code $ BS.pack $
22− "var runElmProgram = Elm." ++ name ++ ".fullscreen;"
23−
24− Left errMsg ->
25− return $ BS.concat $
26− [ BS.pack $ "function runElmProgram() {\n\tElm.Errors.fullscreen("
27− , error "TODO show compile issues" errMsg
28− , ");\n}"
29− ]
30−
ui/terminal/src/Develop/Generate/Help.hs+42−92
@@ -1,113 +1,63 @@
11{-# OPTIONS_GHC -Wall #-}
22{-# LANGUAGE OverloadedStrings #-}
3+{-# LANGUAGE QuasiQuotes #-}
34module Develop.Generate.Help
4− ( makeHtml
5+ ( makePageHtml
56 , makeCodeHtml
6− , makeElmHtml
77 )
88 where
99
10−import Text.Blaze.Html5 ((!))
11−import qualified Text.Blaze.Html5 as H
12−import qualified Text.Blaze.Html5.Attributes as A
1310
14−import qualified Develop.StaticFiles as StaticFiles
11+import qualified Data.ByteString.Builder as B
12+import Data.Monoid ((<>))
13+import Text.RawString.QQ (r)
1514
15+import qualified Elm.Name as N
1616
1717
1818-- PAGES
1919
2020
21−makeHtml :: String -> String -> String -> H.Html
22−makeHtml title jsFile initCode =
23− H.docTypeHtml $ do
24− H.head $ do
25− H.meta ! A.charset "UTF-8"
26− H.title $ H.toHtml title
27− H.link
28− ! A.type_ "text/css"
29− ! A.rel "stylesheet"
30− ! A.href (H.toValue ("/" ++ StaticFiles.cssPath))
31− H.script ! A.src (H.toValue jsFile) $ ""
32−
33− H.body $ do
34− H.script $ H.preEscapedToMarkup initCode
21+makePageHtml :: N.Name -> B.Builder -> B.Builder
22+makePageHtml moduleName flags =
23+ [r|<!DOCTYPE HTML>
24+<html>
25+<head>
26+ <meta charset="UTF-8">
27+ <link type="text/css" rel="stylesheet" href="/_elm/styles.css">
28+ <script src="/_elm/elm.js"></script>
29+</head>
30+<body>
31+<script>
32+Elm.|] <> N.toBuilder moduleName <> [r|.fullscreen(|] <> flags <> [r|);
33+</script>
34+</body>
35+</html>
36+|]
3537
3638
3739
3840-- CODE
3941
4042
41−makeCodeHtml :: String -> String -> H.Html
43+makeCodeHtml :: FilePath -> B.Builder -> B.Builder
4244makeCodeHtml title code =
43− H.docTypeHtml $ do
44− H.head $ do
45− H.meta ! A.charset "UTF-8"
46− H.title $ H.toHtml title
47− H.style ! A.type_ "text/css" $ codeStyle
48−
49− H.link ! A.rel "stylesheet" ! A.href "//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.3.0/styles/default.min.css"
50− H.script ! A.src "//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.3.0/highlight.min.js" $ ""
51− H.script $ "if (hljs) { hljs.initHighlightingOnLoad(); }"
52−
53− H.body ! A.style "background-color: #F0F0F0;" $ do
54− H.pre $ H.code $ H.toHtml code
55−
56−
57−codeStyle :: H.Html
58−codeStyle =
59− H.toHtml $ unlines $
60− [ "html, head, body, pre {"
61− , " margin: 0;"
62− , " height: 100%;"
63− , "}"
64− , "body {"
65− , " font-family: 'Source Code Pro', monospace;"
66− , "}"
67− ]
68−
69−
70−
71−-- ELM CODE
72−
73−
74−makeElmHtml :: FilePath -> H.Html
75−makeElmHtml filePath =
76− H.docTypeHtml $ do
77− H.head $ do
78− H.meta ! A.charset "UTF-8"
79− H.title $ H.toHtml ("~/" ++ filePath)
80− H.style ! A.type_ "text/css" $ elmStyle
81−
82− H.body $ do
83− H.div ! A.style waitingStyle $ do
84− H.div ! A.style "font-size: 3em;" $ "Building your project!"
85− H.img ! A.src (H.toValue StaticFiles.waitingPath)
86− H.div ! A.style "font-size: 1em" $ "With new projects, I need a bunch of extra time to download packages."
87−
88− H.script ! A.src (H.toValue ("/_compile/" ++ filePath)) ! A.charset "utf-8" $ ""
89− H.script $ H.preEscapedToMarkup $ unlines $
90− [ "while (document.body.firstChild) {"
91− , " document.body.removeChild(document.body.firstChild);"
92− , "}"
93− , "runElmProgram();"
94− ]
95−
96−
97−elmStyle :: H.Html
98−elmStyle =
99− H.toHtml $ unlines $
100− [ "@import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro);"
101− , "html, head, body {"
102− , " margin: 0;"
103− , " height: 100%;"
104− , "}"
105− ]
106−
107−
108−waitingStyle :: H.AttributeValue
109−waitingStyle =
110− H.stringValue $
111− "width: 100%; height: 100%; display: flex; flex-direction: column;"
112− ++ " justify-content: center; align-items: center; color: #9A9A9A;"
113− ++ " font-family: 'Source Sans Pro';"
45+ [r|<!DOCTYPE HTML>
46+<html>
47+<head>
48+ <meta charset="UTF-8">
49+ <title>|] <> B.stringUtf8 title <> [r|</title>
50+ <style type="text/css">
51+ @import url(/_elm/source-code-pro.ttf);
52+ html, head, body, pre { margin: 0; height: 100%; }
53+ body { font-family: "Source Code Pro", monospace; }
54+ </style>
55+ <link type="text/css" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.3.0/styles/default.min.css">
56+ <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.3.0/highlight.min.js"></script>
57+ <script>if (hljs) { hljs.initHighlightingOnLoad(); }</script>
58+</head>
59+<body style="background-color: #F0F0F0;">
60+<pre><code>|] <> code <> [r|</code></pre>
61+</body>
62+</html>
63+|]
ui/terminal/src/Develop/Generate/Index.hs+63−133
@@ -1,50 +1,52 @@
11{-# OPTIONS_GHC -Wall #-}
22{-# LANGUAGE OverloadedStrings #-}
33module Develop.Generate.Index
4− ( toHtml
5− , getProject
6− , moveToRoot
4+ ( get
75 )
86 where
97
8+
109import Control.Monad (filterM)
1110import qualified Data.ByteString.Builder as B
12−import qualified Data.ByteString.Lazy.UTF8 as Utf8
13−import qualified Data.List as List
11+import qualified Data.Map as Map
1412import qualified Data.Text as Text
1513import qualified Data.Text.IO as Text
1614import qualified System.Directory as Dir
17−import System.FilePath ((</>), joinPath, splitDirectories, takeExtension)
18−import qualified Text.Blaze.Html5 as H
15+import System.FilePath ((</>), splitDirectories, takeExtension)
1916
2017import qualified Develop.Generate.Help as Help
21−import qualified Develop.StaticFiles as StaticFiles
18+import qualified Elm.Package as Pkg
19+import qualified Elm.Project.Json as Project
20+import qualified Elm.Project.Summary as Summary
2221import qualified Json.Encode as E
22+import qualified Reporting.Progress as Progress
23+import qualified Reporting.Task as Task
24+import qualified Stuff.Verify as Verify
2325
2426
2527
26−-- PROJECT
28+-- GET
2729
2830
29−data Project =
30− Project
31− { _root :: FilePath
32− , _info :: PerhapsInfo
33− }
31+get :: FilePath -> FilePath -> IO B.Builder
32+get root pwd =
33+ do flags <- getFlags root pwd
34+ return $ Help.makePageHtml "Index" (E.encode (encode flags))
3435
3536
36−data PerhapsInfo
37− = Bad (Maybe FilePath)
38− | Good Info
3937
38+-- FLAGS
4039
41−data Info =
42− Info
43− { _pwd :: [String]
40+
41+data Flags =
42+ Flags
43+ { _root :: FilePath
44+ , _pwd :: [String]
4445 , _dirs :: [FilePath]
4546 , _files :: [(FilePath, Bool)]
4647 , _readme :: Maybe Text.Text
47− , _config :: Text.Text
48+ , _project :: Maybe Project.Project
49+ , _exactDeps :: Map.Map Pkg.Name Pkg.Version
4850 }
4951
5052
@@ -52,17 +54,17 @@ data Info =
5254-- JSON
5355
5456
55−goodToJson :: FilePath -> Info -> String
56−goodToJson root (Info pwd dirs files readme config) =
57− Utf8.toString $ B.toLazyByteString $ E.encodeUgly $
58− E.object
59− [ ( "root", encodeFilePath root )
60− , ( "pwd", E.list encodeFilePath pwd )
61− , ( "dirs", E.list encodeFilePath dirs )
62− , ( "files", E.list encodeFile files )
63− , ( "readme", maybe E.null E.text readme )
64− , ( "config", E.text config )
65− ]
57+encode :: Flags -> E.Value
58+encode (Flags root pwd dirs files readme project exactDeps) =
59+ E.object
60+ [ ( "root", encodeFilePath root )
61+ , ( "pwd", E.list encodeFilePath pwd )
62+ , ( "dirs", E.list encodeFilePath dirs )
63+ , ( "files", E.list encodeFile files )
64+ , ( "readme", maybe E.null E.text readme )
65+ , ( "project", maybe E.null Project.encode project )
66+ , ( "exactDeps", E.dict Pkg.toText Pkg.encodeVersion exactDeps)
67+ ]
6668
6769
6870encodeFilePath :: FilePath -> E.Value
@@ -72,102 +74,37 @@ encodeFilePath filePath =
7274
7375encodeFile :: (FilePath, Bool) -> E.Value
7476encodeFile (file, hasMain) =
75− E.array [ encodeFilePath file, E.bool hasMain ]
76−
77−
78−badJson :: FilePath -> Maybe FilePath -> String
79−badJson root potentialRoot =
80− Utf8.toString $ B.toLazyByteString $ E.encodeUgly $
81− E.object
82− [ ( "root", encodeFilePath root )
83− , ( "suggestion", maybe E.null encodeFilePath potentialRoot )
84− ]
85−
86−
77+ E.object
78+ [ ("name", encodeFilePath file)
79+ , ("runnable", E.bool hasMain)
80+ ]
8781
88−-- GENERATE HTML
8982
9083
91−toHtml :: Project -> H.Html
92−toHtml (Project root perhapsInfo) =
93− case perhapsInfo of
94− Good info@(Info pwd _ _ _ _) ->
95− Help.makeHtml
96− (List.intercalate "/" ("~" : pwd))
97− ("/" ++ StaticFiles.elmPath)
98− ("Elm.Index.fullscreen(" ++ goodToJson root info ++ ");")
84+-- GET FLAGS
9985
100− Bad suggestion ->
101− Help.makeHtml
102− (maybe "New Project!" (const "Existing Project?") suggestion)
103− ("/" ++ StaticFiles.elmPath)
104− ("Elm.Start.fullscreen(" ++ badJson root suggestion ++ ");")
10586
87+getFlags :: FilePath -> FilePath -> IO Flags
88+getFlags root pwd =
89+ do (dirs, files) <- getDirsAndFiles pwd
90+ readme <- getReadme pwd
10691
92+ maybeSummary <-
93+ Task.run Progress.silentReporter $
94+ Verify.verify root =<< Project.read "elm.json"
10795
108−-- GET PROJECT
109−
110−
111−getProject :: FilePath -> IO Project
112−getProject directory =
113− do root <- Dir.getCurrentDirectory
114− exists <- Dir.doesFileExist "elm.json"
115− Project root <$>
116− case exists of
117− False ->
118− Bad <$> findNearestConfig (splitDirectories root)
119−
120− True ->
121− do json <- Text.readFile "elm.json"
122− Good <$> getInfo json directory
123−
124−
125−findNearestConfig :: [String] -> IO (Maybe FilePath)
126−findNearestConfig dirs =
127− if null dirs then
128− return Nothing
129−
130− else
131− do exists <- Dir.doesFileExist (joinPath dirs </> "elm.json")
132− if exists
133− then return (Just (joinPath dirs))
134− else findNearestConfig (init dirs)
135−
136−
137−moveToRoot :: IO ()
138−moveToRoot =
139− do subDir <- Dir.getCurrentDirectory
140− maybeRoot <- findNearestConfig (splitDirectories subDir)
141− case maybeRoot of
142− Nothing ->
143− return ()
144−
145− Just root ->
146− Dir.setCurrentDirectory root
147−
148−
149−
150−-- GET INFO
151−
152−
153−getInfo :: Text.Text -> FilePath -> IO Info
154−getInfo config directory =
155− do (dirs, files) <- getDirectoryInfo directory
156− readme <- getReadme directory
15796 return $
158− Info
159− { _pwd = dropWhile ("." ==) (splitDirectories directory)
97+ Flags
98+ { _root = root
99+ , _pwd = dropWhile ("." ==) (splitDirectories pwd)
160100 , _dirs = dirs
161101 , _files = files
162102 , _readme = readme
163− , _config = config
103+ , _project = fmap Summary._project maybeSummary
104+ , _exactDeps = maybe Map.empty (Map.map fst . Summary._depsGraph) maybeSummary
164105 }
165106
166107
167−
168−-- README
169−
170−
171108getReadme :: FilePath -> IO (Maybe Text.Text)
172109getReadme dir =
173110 do let readmePath = dir </> "README.md"
@@ -177,28 +114,21 @@ getReadme dir =
177114 else return Nothing
178115
179116
180−
181−-- DIRECTORIES / FILES
182−
183−
184−getDirectoryInfo :: FilePath -> IO ([FilePath], [(FilePath, Bool)])
185−getDirectoryInfo dir =
186− do contents <- Dir.getDirectoryContents dir
187−
188− allDirs <- filterM (Dir.doesDirectoryExist . (dir </>)) contents
189− rawFiles <- filterM (Dir.doesFileExist . (dir </>)) contents
190−
191− files <- mapM (inspectFile dir) rawFiles
192−
193− return (allDirs, files)
117+getDirsAndFiles :: FilePath -> IO ([FilePath], [(FilePath, Bool)])
118+getDirsAndFiles pwd =
119+ do contents <- Dir.getDirectoryContents pwd
120+ dirs <- filterM (Dir.doesDirectoryExist . (pwd </>)) contents
121+ filePaths <- filterM (Dir.doesFileExist . (pwd </>)) contents
122+ files <- mapM (inspectFile pwd) filePaths
123+ return (dirs, files)
194124
195125
196126inspectFile :: FilePath -> FilePath -> IO (FilePath, Bool)
197−inspectFile dir filePath =
198− if takeExtension filePath == ".elm" then
199− do source <- Text.readFile (dir </> filePath)
127+inspectFile pwd path =
128+ if takeExtension path == ".elm" then
129+ do source <- Text.readFile (pwd </> path)
200130 let hasMain = Text.isInfixOf "\nmain " source
201− return (filePath, hasMain)
131+ return (path, hasMain)
202132
203133 else
204− return (filePath, False)
134+ return (path, False)
ui/terminal/src/Develop/StaticFiles.hs+2−1
@@ -1,4 +1,5 @@
11{-# OPTIONS_GHC -Wall #-}
2+{-# LANGUAGE OverloadedStrings #-}
23{-# LANGUAGE TemplateHaskell #-}
34module Develop.StaticFiles
45 ( lookup
@@ -22,7 +23,7 @@ import qualified Develop.StaticFiles.Build as Build
2223
2324
2425type MimeType =
25− String
26+ BS.ByteString
2627
2728
2829lookup :: FilePath -> Maybe (BS.ByteString, MimeType)