-
Notifications
You must be signed in to change notification settings - Fork 2
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
base: main
Are you sure you want to change the base?
fix(config): Enhance ReactConfig and improve file handling logic #71
Conversation
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.
There was a problem hiding this 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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
Added new properties to ReactConfig, including
iconLibrary
and extended aliases withlib
andhooks
. 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