ashald / EnvFile

EnvFile 3.x is a plugin for JetBrains IDEs that allows you to set environment variables for your run configurations from one or multiple files.
MIT License
539 stars 129 forks source link

Please add support for NodeJS Express projects in Intellij IDEA #101

Open dharmeshds opened 4 years ago

dharmeshds commented 4 years ago

Kindly add support for NodeJS Express projects in Intellij IDEA..

ashald commented 4 years ago

I will look into this someday. Until then - contributions are welcome.

Alex-Wauters commented 4 years ago

Until then - contributions are welcome.

Sure, do you have any quick pointers on how to best add the configuration and build/test the plug-in?

ClintEsteMadera commented 4 years ago

I totally support this addition request. Node.js is widely used enough for making this a priority. Thanks a lot!

SJrX commented 3 years ago

I took a look at this, and have something works in a not great way.

Ignoring the mess I made in gradle, this branch (not to this repo since it's not mergable), does add EnvFile support to the NodeJS Run Configuration.

image

Unfortunately, the only way I could get it to work was by editing the RunConfiguration's environment variables, instead of patching the command line before it runs. This might not actually be terrible (and maybe better than not having this support at all).

(e.g., image )

In 2018.3, com.jetbrains.nodejs.run.NodeJSRunConfigurationExtension#patchCommandLine is final, and after spending a couple hours, I couldn't find an easy way to hook into it another way, although I'm by no means an expert. It's also possible / doubtful, that it's fixed in a later version of the plugin. Even if that method was unprotected, I can only assume that it would only be in 2020.3 or 2021.1 and that means upgrading the plugin.

So some outstanding things are:

  1. I made a mess of the build and am not sure the best way to structure the gradle changes necessary to support this (but might be able to figure it out).
  2. I assume changes to a run configuration EnvFile settings aren't saved.
  3. I don't really have a plan forward for how to get around the above.

Anyway @ashald not sure if you have any advice or recommendations.

ashald commented 3 years ago

Hi @SJrX, appreciate your effort! First of all, it's great to hear you got something to work. My experience developing this plugin was mostly trial and error as IDE interfaces are not really consistent (at least, weren't) and it took a lot of hacking to get anything to work.

Recently I don't have much time for OSS activity, unfortunately. That being said, I don't want to abandon this plugin either. I hope to find some time review recent contributions in the next few months, and will be sure to check your work. Please keep your branch in place so that I can learn from your findings!

yarotskiu commented 8 months ago

Hi I am a bit confused, so here a few issues about support for node js above is a completed pull request which (probably) should implement it in to the plugin for intellij IDE, isn't? Or I misunderstood something, because I can't see it in intellij unfortunately :(

image