Skip to content

Unify our naming around the generated app (code)#3949

Merged
FranjoMindek merged 5 commits intomainfrom
franjo/fix-project-root-dir-name
Mar 20, 2026
Merged

Unify our naming around the generated app (code)#3949
FranjoMindek merged 5 commits intomainfrom
franjo/fix-project-root-dir-name

Conversation

@FranjoMindek
Copy link
Contributor

@FranjoMindek FranjoMindek commented Mar 20, 2026

We had an old TODO:

generatedCodeDirInDotWaspDir :: Path' (Rel DotWaspDir) (Dir G.Common.ProjectRootDir)
-- TODO: We sometimes call this directory "ProjectRootDir" and sometimes
-- "GeneratedCodeDir". We should unify the naming (the latter is the beter
-- name).
generatedCodeDirInDotWaspDir = [reldir|out|]

The name ProjectRootDir is really confusing because it is very close to WaspProjectDir and it's easy to confuse the two.

The ProjectRootDir is of course the .wasp/out/ dir.
The WaspProjectDir is the user's project root dir.

Most likely the reason why the TODO suggests using the GeneratedCodeDir dir instead.

I wanted to resolve this issue since these names often confused me, and Claude can do it easily. But renaming to GeneratedCodeDir gave me another problem.

Now we had all: GeneratedCodeDir, AppComponentRootDir and GeneratedSrcDir in Wasp/Generator/Common.hs. The problem is that all these names are related and concepts with structure, but that is not clear in their names.

AppComponentRootDir is app component in GeneratedCodeDir, e.g. .wasp/out/server/.
GeneratedSrcDir is src/ dir in any app component, e.g. .wasp/out/server/src/.

So I refactored further:
ProjectRootDir -> GeneratedAppDir
AppComponentRootDir -> GeneratedAppComponentDir
GeneratedSrcDir -> GeneratedAppComponentSrcDir

In other words, I'm throwing away the whole "generated code" term and I'm suggesting using the "generated app" term instead. Other than that, I make sure that names related to this concept include it as a prefix.

The most important file to look at is: waspc/src/Wasp/Generator/Common.hs

@FranjoMindek FranjoMindek marked this pull request as ready for review March 20, 2026 13:51
@FranjoMindek FranjoMindek requested a review from a team as a code owner March 20, 2026 13:51
@FranjoMindek FranjoMindek requested review from infomiho and removed request for a team March 20, 2026 13:51
data DbRootDir

instance AppComponentRootDir DbRootDir
instance GeneratedAppComponentDir DbRootDir
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just moved it below, so all connected data is next to each other.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 20, 2026

Open in StackBlitz

@wasp.sh/wasp-cli

npx https://pkg.pr.new/@wasp.sh/wasp-cli@3949

@wasp.sh/wasp-cli-darwin-arm64-unknown

npx https://pkg.pr.new/@wasp.sh/wasp-cli-darwin-arm64-unknown@3949

@wasp.sh/wasp-cli-darwin-x64-unknown

npx https://pkg.pr.new/@wasp.sh/wasp-cli-darwin-x64-unknown@3949

@wasp.sh/wasp-cli-linux-x64-glibc

npx https://pkg.pr.new/@wasp.sh/wasp-cli-linux-x64-glibc@3949

@wasp.sh/wasp-cli-linux-x64-musl

npx https://pkg.pr.new/@wasp.sh/wasp-cli-linux-x64-musl@3949

commit: 9e3d495

Copy link
Member

@infomiho infomiho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better, nice!

Left one comment

cmd " clean Deletes the generated app, all cached artifacts, and the node_modules dir.",
" Wasp equivalent of 'have you tried closing and opening it again?'.",
cmd " build Generates full web app code, ready for deployment. Use when deploying or ejecting.",
cmd " build Generates the full web app, ready for deployment. Use when deploying or ejecting.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we are here, let's maybe drop the ejecting bit? We don't really talk about that concept anywhere as a supported thing. Of course you can take the code and go with it, but you can't really eject from Wasp or Wasp SDK anymore.

Copy link
Member

@infomiho infomiho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to approve

@FranjoMindek FranjoMindek temporarily deployed to railway-deploy-test March 20, 2026 15:51 — with GitHub Actions Inactive
@FranjoMindek FranjoMindek merged commit 9e0f341 into main Mar 20, 2026
34 of 36 checks passed
@FranjoMindek FranjoMindek deleted the franjo/fix-project-root-dir-name branch March 20, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants