Skip to content

Organize lib/projects and use lang objects #1465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 24, 2025
Merged

Conversation

camden11
Copy link
Contributor

Description and Context

The upcoming work to support the Local Dev UI will require a lot of additions to the lib/projects folder, so I figured now would be a good time to clean things up there a bit. This PR makes a variety of housekeeping changes

  • Moves all project local dev related files from/lib into `lib/projects/localDev``
    • localDev renamed to helpers
    • LocalDevManager and LocalDevManagerV2
    • DevServerManager and DevServerManagerV2
  • Splits up lib/projects/index since it wasn't actually an index file
    • Most of the functions in this file are now in lib/projects/config
    • ensureProjectExists moved to lib/projects/ensureProjectExists
    • logFeedbackMessage moved to lib/projects/ui
  • Updates all project files to use the new lang objects
    • this surfaced a lot of lang errors, so those have now been fixed

TODO

Due to file renaming, some files lang keys no longer match their file names. I didn't want to do even more in this PR, so we can update that at a later time if it ever becomes a problem

Who to Notify

@brandenrodgers @kemmerle @joe-yeager

@@ -1122,8 +1128,8 @@ export const commands = {
failedToFetchProjectDetails:
'There was an error fetching project details',
noFunctionsLinkText: 'Visit developer docs',
noFunctionsInProject: link =>
`There aren't any functions in this project\n\t- Run ${chalk.orange('hs project logs --help')} to learn more about logs\n\t- ${link} to learn more about serverless functions`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Haha you beat me to it, I saw that cursor made up the chalk.orange function 🤦

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Haha cursor making things up was a common theme in this PR

@camden11
Copy link
Contributor Author

@joe-yeager Just noticed you inlining uiCommandReference, uiLink etc in the lang file - going to update this to do that as well

joe-yeager
joe-yeager previously approved these changes Apr 24, 2025
Copy link
Contributor

@joe-yeager joe-yeager left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for splitting that up and switching these over.

@joe-yeager
Copy link
Contributor

@joe-yeager Just noticed you inlining uiCommandReference, uiLink etc in the lang file - going to update this to do that as well

@camden11 yeah, I started out just converting the the function calls, and then I realized I can just move most of them to inline calls. I think we could start small as well, just start by leaving them as variables and then slowly move them over. Up to you if you want to do it as part of this PR.

@camden11
Copy link
Contributor Author

Yeah, I just went ahead and did it for uiCommandReferences that didn't involve any other variables. Let me turn a lot of lang functions into just strings

@camden11 camden11 merged commit 75d69a7 into main Apr 24, 2025
1 check passed
@camden11 camden11 deleted the reorganize-project-lib branch April 24, 2025 21:07
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