Skip to content
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

fix(config): Enhance ReactConfig and improve file handling logic #71

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thelooter
Copy link

@thelooter thelooter commented Dec 17, 2024

Added new properties to ReactConfig, including iconLibrary and extended aliases with lib and hooks. These have been added by the 2.0 CLI.

Improved filtering of package.json files to exclude hidden directories and added logic to remove block comments in Source parsing.

Implements changes first made in #61

Added new properties to ReactConfig, including `iconLibrary` and extended aliases with `lib` and `hooks`. These have been added by the 2.0 CLI.

 Improved filtering of `package.json` files to exclude hidden directories and added logic to remove block comments in Source parsing.
Copy link
Owner

@WarningImHack3r WarningImHack3r left a comment

Choose a reason for hiding this comment

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

Thanks! Isn't there a way to also allow additional arbitrary values inside the deserializer?

@@ -111,6 +111,8 @@ abstract class Source<C : Config>(val project: Project, private val serializer:
.split("\n").joinToString("\n") { line ->
// Remove // comments
line.substringBefore("//").trim()
// Remove /* */ comments
line.replace(Regex("/\\*.*?\\*/"), "").trim()
Copy link
Owner

Choose a reason for hiding this comment

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

This sounds like a good idea but it causes issues
See 29e4726 and #66

Copy link
Author

Choose a reason for hiding this comment

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

Alright, I'll look into a more robust solution for this tomorrow

@@ -23,7 +23,8 @@ class ISPPanelPopulator(private val project: Project) {
CoroutineScope(SupervisorJob() + Dispatchers.Default).async {
return@async Pair(
SourceScanner.findShadcnImplementation(project),
FileManager.getInstance(project).getVirtualFilesByName("package.json").size
FileManager.getInstance(project).getVirtualFilesByName("package.json")
.filter { !it.parent.name.startsWith('.') }.size
Copy link
Owner

@WarningImHack3r WarningImHack3r Dec 17, 2024

Choose a reason for hiding this comment

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

You can add this directly inside the getVirtualFilesByName function instead
Was it an issue you encountered?

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