From fb899a09ea11867b52781e71531399ce09fee4bb Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Tue, 29 Oct 2024 15:10:18 +0100 Subject: [PATCH] Clean up --- .../Generator/templates/sdk/wasp/client/config.ts | 1 - waspc/src/Wasp/Generator/SdkGenerator.hs | 14 ++------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/waspc/data/Generator/templates/sdk/wasp/client/config.ts b/waspc/data/Generator/templates/sdk/wasp/client/config.ts index 978755541..fff77cb01 100644 --- a/waspc/data/Generator/templates/sdk/wasp/client/config.ts +++ b/waspc/data/Generator/templates/sdk/wasp/client/config.ts @@ -1,4 +1,3 @@ -{{={= =}=}} import { stripTrailingSlash } from '../universal/url.js' import { env } from './env.js' diff --git a/waspc/src/Wasp/Generator/SdkGenerator.hs b/waspc/src/Wasp/Generator/SdkGenerator.hs index 8646cef6d..146cfa3c2 100644 --- a/waspc/src/Wasp/Generator/SdkGenerator.hs +++ b/waspc/src/Wasp/Generator/SdkGenerator.hs @@ -66,7 +66,6 @@ import Wasp.Generator.WebAppGenerator.Common reactRouterVersion, reactVersion, ) -import qualified Wasp.Generator.WebAppGenerator.Common as WebApp import qualified Wasp.Node.Version as NodeVersion import Wasp.Project.Common (WaspProjectDir) import qualified Wasp.Project.Db as Db @@ -100,7 +99,7 @@ genSdk spec = genFileCopy [relfile|client/test/index.ts|], genFileCopy [relfile|client/index.ts|], genFileCopy [relfile|dev/index.ts|], - genClientConfigFile, + genFileCopy [relfile|client/config.ts|], genServerConfigFile spec, genTsConfigJson, genServerUtils spec, @@ -249,18 +248,9 @@ genServerConfigFile spec = return $ C.mkTmplFdWithData relConfigFilePath tmplDat tmplData = object [ "isAuthEnabled" .= isAuthEnabled spec, - "databaseUrlEnvVarName" .= Db.databaseUrlEnvVarName, - "defaultClientUrl" .= WebApp.getDefaultDevClientUrl spec, - "defaultServerUrl" .= Server.defaultDevServerUrl, - "defaultServerPort" .= Server.defaultServerPort + "databaseUrlEnvVarName" .= Db.databaseUrlEnvVarName ] -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 -- ServerGenerator. genTsConfigJson :: Generator FileDraft