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

feat: add support for aurelia 2 project detection #42

Closed

Conversation

CollinHerber
Copy link

@CollinHerber CollinHerber commented May 22, 2023

Sorry if there is things missing, bad, etc. This is my first ever intellij plugin and I also have not written any Java/Kotlin in 10+
years.

This changes the following

  • Removes the file name based detection for telling if aurelia is present
  • Add dependency based detection. (aurelia-cli = v1 , aurelia = v2)
  • Adds contribution documentation to satisfy Add Contributing Section to Readme #41

Adds support for the following

  • switch and case binding
  • ref is considered a valid attribute

I have confirmed this working on an aurelia 1 and aurelia 2 project. If I'm not mistaken these are the correct dependencies to check for.

@CollinHerber
Copy link
Author

Can we get some traction on this?

@anstarovoyt anstarovoyt self-requested a review July 21, 2023 15:11
private fun hasDependency(project: Project): Boolean {
var hasDependency = false

VfsUtilCore.iterateChildrenRecursively(project.baseDir, null) { virtualFile ->
Copy link
Collaborator

Choose a reason for hiding this comment

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

Vfs traversing is very expensive operation. Please check methods of com.intellij.javascript.nodejs.packageJson.PackageJsonFileManager, it provide high-level API to check package.json deps.

Copy link
Collaborator

Choose a reason for hiding this comment

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

this comment is still relevant. VFS processing can significantly degrade performance, especially for big projects.

Copy link
Collaborator

Choose a reason for hiding this comment

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

moreover, it looks like all usages of the method have a proper context psi element, so the best solution could be to traverse top to package.json and check its dependencies.


patchPluginXml {
sinceBuild = "231.0"
untilBuild = "231.*"
untilBuild = "233.*"
Copy link
Collaborator

Choose a reason for hiding this comment

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

no, we cannot sure that the plugin will be compatible with 233 version.

@@ -8,14 +8,14 @@ repositories {
}

intellij {
pluginName = 'AureliaStorm'
pluginName = 'AureliaStorm Community'
Copy link
Collaborator

Choose a reason for hiding this comment

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

what's the reason to change plugin name?

@anstarovoyt
Copy link
Collaborator

sorry, I wrote a comment in May but looks like I didn't submit it as a part of review 🤦


Either `aurelia-framework.js`, `aurelia-bootstrapper.js` or `aurelia-core.js` must be present in the project sources
Copy link
Collaborator

Choose a reason for hiding this comment

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

also, we still need to keep old behaviour for very old projects.

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