Skip to content

Commit

Permalink
Merge branch 'filip-ts-sdk' into filip-ts-sdk-setup
Browse files Browse the repository at this point in the history
  • Loading branch information
sodic committed Oct 9, 2024
2 parents 5041f55 + 522e131 commit acbd407
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 10 additions & 2 deletions waspc/src/Wasp/Project/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module Wasp.Project.Common
extPublicDirInWaspProjectDir,
prismaSchemaFileInWaspProjectDir,
getSrcTsConfigInWaspProjectDir,
tsConfigInWaspLangProject,
)
where

Expand Down Expand Up @@ -86,10 +87,17 @@ dotWaspInfoFileInGeneratedCodeDir = [relfile|.waspinfo|]
packageJsonInWaspProjectDir :: Path' (Rel WaspProjectDir) (File PackageJsonFile)
packageJsonInWaspProjectDir = [relfile|package.json|]

-- TODO: The entire tsconfig story is very fragile
getSrcTsConfigInWaspProjectDir :: WaspFilePath -> Path' (Rel WaspProjectDir) (File SrcTsConfigFile)
getSrcTsConfigInWaspProjectDir = \case
WaspTs _ -> [relfile|tsconfig.src.json|]
WaspLang _ -> [relfile|tsconfig.json|]
WaspTs _ -> tsConfigInWaspTsProject
WaspLang _ -> tsConfigInWaspLangProject

tsConfigInWaspLangProject :: Path' (Rel WaspProjectDir) (File SrcTsConfigFile)
tsConfigInWaspLangProject = [relfile|tsconfig.json|]

tsConfigInWaspTsProject :: Path' (Rel WaspProjectDir) (File SrcTsConfigFile)
tsConfigInWaspTsProject = [relfile|tsconfig.src.json|]

packageLockJsonInWaspProjectDir :: Path' (Rel WaspProjectDir) File'
packageLockJsonInWaspProjectDir = [relfile|package-lock.json|]
Expand Down
4 changes: 2 additions & 2 deletions waspc/waspls/src/Wasp/LSP/ExtImport/ExportsCache.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import Wasp.LSP.ExtImport.Path (WaspStyleExtFilePath, absPathToCachePath, cacheP
import Wasp.LSP.ExtImport.Syntax (ExtImportNode (einName, einPath), getAllExtImports)
import Wasp.LSP.ServerMonads (HandlerM, ServerM, getProjectRootDir, handler, modify)
import qualified Wasp.LSP.ServerState as State
import Wasp.Project.Common (tsconfigInWaspProjectDir)
import Wasp.Project.Common (tsConfigInWaspLangProject)
import qualified Wasp.TypeScript.Inspect.Exports as TS

-- | Based on the files imported in the external imports of the current concrete
Expand Down Expand Up @@ -63,7 +63,7 @@ refreshExportsOfFiles files = do
getExportRequestForFile projectRootDir file =
TS.TsExportsRequest
{ TS.filepaths = [SP.fromAbsFile file],
TS.tsconfig = Just $ SP.fromAbsFile $ projectRootDir </> tsconfigInWaspProjectDir
TS.tsconfig = Just $ SP.fromAbsFile $ projectRootDir </> tsConfigInWaspLangProject
}

-- Replaces entries in the exports cache with the exports lists in the
Expand Down

0 comments on commit acbd407

Please sign in to comment.