This commit is contained in:
Mihovil Ilakovac 2024-10-29 15:10:18 +01:00
parent 80baf9c3b1
commit fb899a09ea
2 changed files with 2 additions and 13 deletions

View File

@ -1,4 +1,3 @@
{{={= =}=}}
import { stripTrailingSlash } from '../universal/url.js' import { stripTrailingSlash } from '../universal/url.js'
import { env } from './env.js' import { env } from './env.js'

View File

@ -66,7 +66,6 @@ import Wasp.Generator.WebAppGenerator.Common
reactRouterVersion, reactRouterVersion,
reactVersion, reactVersion,
) )
import qualified Wasp.Generator.WebAppGenerator.Common as WebApp
import qualified Wasp.Node.Version as NodeVersion import qualified Wasp.Node.Version as NodeVersion
import Wasp.Project.Common (WaspProjectDir) import Wasp.Project.Common (WaspProjectDir)
import qualified Wasp.Project.Db as Db import qualified Wasp.Project.Db as Db
@ -100,7 +99,7 @@ genSdk spec =
genFileCopy [relfile|client/test/index.ts|], genFileCopy [relfile|client/test/index.ts|],
genFileCopy [relfile|client/index.ts|], genFileCopy [relfile|client/index.ts|],
genFileCopy [relfile|dev/index.ts|], genFileCopy [relfile|dev/index.ts|],
genClientConfigFile, genFileCopy [relfile|client/config.ts|],
genServerConfigFile spec, genServerConfigFile spec,
genTsConfigJson, genTsConfigJson,
genServerUtils spec, genServerUtils spec,
@ -249,18 +248,9 @@ genServerConfigFile spec = return $ C.mkTmplFdWithData relConfigFilePath tmplDat
tmplData = tmplData =
object object
[ "isAuthEnabled" .= isAuthEnabled spec, [ "isAuthEnabled" .= isAuthEnabled spec,
"databaseUrlEnvVarName" .= Db.databaseUrlEnvVarName, "databaseUrlEnvVarName" .= Db.databaseUrlEnvVarName
"defaultClientUrl" .= WebApp.getDefaultDevClientUrl spec,
"defaultServerUrl" .= Server.defaultDevServerUrl,
"defaultServerPort" .= Server.defaultServerPort
] ]
genClientConfigFile :: Generator FileDraft
genClientConfigFile = return $ C.mkTmplFdWithData relConfigFilePath tmplData
where
relConfigFilePath = [relfile|client/config.ts|]
tmplData = object ["defaultServerUrl" .= Server.defaultDevServerUrl]
-- todo(filip): remove this duplication, we have almost the same thing in the -- todo(filip): remove this duplication, we have almost the same thing in the
-- ServerGenerator. -- ServerGenerator.
genTsConfigJson :: Generator FileDraft genTsConfigJson :: Generator FileDraft