mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-09-11 15:26:19 +03:00
Cleanup
This commit is contained in:
parent
6b8474af28
commit
abb0b82856
@ -22,7 +22,7 @@ const ioConfig = {= configFn.importIdentifier =}()
|
||||
{=/ configFn.isDefined =}
|
||||
{=^ configFn.isDefined =}
|
||||
const ioConfig = {
|
||||
autoConnect: {= autoConnect =},
|
||||
autoConnect: {=# autoConnect =}true{=/ autoConnect =}{=^ autoConnect =}false{=/ autoConnect =},
|
||||
transports: ['websocket'],
|
||||
} satisfies IoConfig;
|
||||
{=/ configFn.isDefined =}
|
||||
|
@ -11,7 +11,6 @@ module Wasp.Generator.Common
|
||||
GeneratedSrcDir,
|
||||
makeJsArrayFromHaskellList,
|
||||
dropExtensionFromImportPath,
|
||||
makeJsBoolFromHaskellBool,
|
||||
)
|
||||
where
|
||||
|
||||
@ -78,10 +77,6 @@ makeJsArrayFromHaskellList list = "[" ++ intercalate ", " listOfJsStrings ++ "]"
|
||||
where
|
||||
listOfJsStrings = map (\s -> "'" ++ s ++ "'") list
|
||||
|
||||
makeJsBoolFromHaskellBool :: Bool -> String
|
||||
makeJsBoolFromHaskellBool True = "true"
|
||||
makeJsBoolFromHaskellBool False = "false"
|
||||
|
||||
dropExtensionFromImportPath :: Path Posix (Rel r) (File f) -> Path Posix (Rel r) (File f)
|
||||
dropExtensionFromImportPath = fromJust . SP.parseRelFileP . dropExtension . SP.fromRelFileP
|
||||
where
|
||||
|
@ -12,7 +12,7 @@ import qualified Wasp.AppSpec.App as AS.App
|
||||
import qualified Wasp.AppSpec.App.Dependency as AS.Dependency
|
||||
import qualified Wasp.AppSpec.App.WebSocket as AS.App.WS
|
||||
import Wasp.AppSpec.Valid (getApp, isAuthEnabled)
|
||||
import Wasp.Generator.Common (makeJsBoolFromHaskellBool, makeJsonWithEntityData)
|
||||
import Wasp.Generator.Common (makeJsonWithEntityData)
|
||||
import Wasp.Generator.FileDraft (FileDraft)
|
||||
import qualified Wasp.Generator.JsImport as GJI
|
||||
import Wasp.Generator.Monad (Generator)
|
||||
@ -52,7 +52,7 @@ genWebSocketProvider spec = return $ C.mkTmplFdWithData [relfile|client/webSocke
|
||||
maybeClientConfigFn = extImportToJsImport <$> (maybeWebSocket >>= AS.App.WS.clientConfigFn)
|
||||
tmplData =
|
||||
object
|
||||
[ "autoConnect" .= makeJsBoolFromHaskellBool shouldAutoConnect,
|
||||
[ "autoConnect" .= shouldAutoConnect,
|
||||
"configFn" .= GJI.jsImportToImportJson maybeClientConfigFn
|
||||
]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user