Skip to content

Commit

Permalink
Small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sodic committed Jan 22, 2025
1 parent 821b287 commit 818b52c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions waspc/src/Wasp/Project/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ where
import StrongPath (Abs, Dir, File, File', Path', Rel, reldir, relfile, toFilePath, (</>))
import System.Directory (doesFileExist)
import Wasp.AppSpec.ExternalFiles (SourceExternalCodeDir, SourceExternalPublicDir)
import qualified Wasp.Generator.Common as Generator
import qualified Wasp.Generator.Common as Generator.Common

type CompileError = String

Expand Down Expand Up @@ -66,29 +66,29 @@ nodeModulesDirInWaspProjectDir :: Path' (Rel WaspProjectDir) (Dir NodeModulesDir
nodeModulesDirInWaspProjectDir = [reldir|node_modules|]

-- | NOTE: If you change the depth of this path, also update @waspProjectDirFromProjectRootDir@ below.
-- TODO: Hm this has different name than it has in Generator.
generatedCodeDirInDotWaspDir :: Path' (Rel DotWaspDir) (Dir Generator.ProjectRootDir)
-- TODO: Hm this has different name than it has in Generator.Common.
generatedCodeDirInDotWaspDir :: Path' (Rel DotWaspDir) (Dir Generator.Common.ProjectRootDir)
generatedCodeDirInDotWaspDir = [reldir|out|]

-- | NOTE: If you change the depth of this path, also update @waspProjectDirFromProjectRootDir@ below.
buildDirInDotWaspDir :: Path' (Rel DotWaspDir) (Dir Generator.ProjectRootDir)
buildDirInDotWaspDir :: Path' (Rel DotWaspDir) (Dir Generator.Common.ProjectRootDir)
buildDirInDotWaspDir = [reldir|build|]

-- Todo: find a better way to define this
waspProjectDirFromAppComponentDir :: Generator.AppComponentRootDir d => Path' (Rel d) (Dir WaspProjectDir)
waspProjectDirFromAppComponentDir :: Generator.Common.AppComponentRootDir d => Path' (Rel d) (Dir WaspProjectDir)
waspProjectDirFromAppComponentDir = [reldir|../../../|]

-- | NOTE: This path is calculated from the values of @dotWaspDirInWaspProjectDir@,
-- @generatedCodeDirInDotWaspDir@ and @buildDirInDotWaspDir@., which are the three functions just above.
-- Also, it assumes @generatedCodeDirInDotWaspDir@ and @buildDirInDotWaspDir@ have same depth.
-- If any of those change significantly (their depth), this path should be adjusted.
waspProjectDirFromProjectRootDir :: Path' (Rel Generator.ProjectRootDir) (Dir WaspProjectDir)
waspProjectDirFromProjectRootDir :: Path' (Rel Generator.Common.ProjectRootDir) (Dir WaspProjectDir)
waspProjectDirFromProjectRootDir = [reldir|../../|]

dotWaspRootFileInWaspProjectDir :: Path' (Rel WaspProjectDir) File'
dotWaspRootFileInWaspProjectDir = [relfile|.wasproot|]

dotWaspInfoFileInGeneratedCodeDir :: Path' (Rel Generator.ProjectRootDir) File'
dotWaspInfoFileInGeneratedCodeDir :: Path' (Rel Generator.Common.ProjectRootDir) File'
dotWaspInfoFileInGeneratedCodeDir = [relfile|.waspinfo|]

packageJsonInWaspProjectDir :: Path' (Rel WaspProjectDir) (File PackageJsonFile)
Expand Down
2 changes: 1 addition & 1 deletion waspc/src/Wasp/Util/IO.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import Data.Text (Text)
import qualified Data.Text.IO as T.IO
import qualified Data.Text.IO as Text.IO
import qualified Path.IO as PathIO
import StrongPath (Abs, Dir, Dir', File, Path', Rel, basename, parseRelDir, parseRelFile, toFilePath, (</>))
import StrongPath (Abs, Dir, File, Path', Rel, basename, parseRelDir, parseRelFile, toFilePath, (</>))
import qualified StrongPath as SP
import qualified StrongPath.Path as SP.Path
import qualified System.Directory as SD
Expand Down

0 comments on commit 818b52c

Please sign in to comment.