-
Notifications
You must be signed in to change notification settings - Fork 27
(cli): remove prettier #290
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
Comments
This looks like a fun task! If no one is currently working on it, would it be okay if I take it on? I'd also like to compare the actual time it takes to format code using Prettier versus the approach you've proposed—just adjusting the indent level. |
@luke0408 Thank you so much! We don't have so much time right now, so if you help us it must be really great! |
Sounds good! |
It will be fun! I'll support you! |
May I ask you a question? Here’s how I understand the two libraries:
Given this, I believe we need to recursively walk through indentation-relevant elements like braces ( So, under the assumption that we stick with these tools, I'm considering building a lightweight "depth tree" of the code — ignoring the content, but keeping track of structural depth for formatting purposes. Alternatively, I'm also exploring the idea of generating an actual AST using something like What do you think? |
@luke0408 I think our goal of this task is:
so I think
This approach might be a good choice. In our implementation, we replace the two lines in a template file: agentica/packages/cli/src/connectors.ts Lines 169 to 177 in 58d0824
So what we want is:
So overall, you don't need to do searching stuff. It will be simpler than you consider If I might miss, probably you think more than me. In that case please create a draft PR first then we can start discussing based on your prototype! Again, thank you for your effort! |
low priority
problem
prettier is really large. we want to remove it
solution
Instead of pass the whole code to prettier, we can indent the code
detect-indent
to identify the code indent width/// INSERT CONTROLLER HERE
code and/// INSERT IMPORT HERE
indent-string
Also
utils.ts
connectors.ts
(we can include code formatting logic)The text was updated successfully, but these errors were encountered: