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
542 stars 129 forks source link

Node.js integration #36

Open lisbakke opened 7 years ago

ashald commented 7 years ago

What exact run configurations you would like to have supported?

lisbakke commented 7 years ago

Support for the Node.js configuration would be awesome!

ashald commented 7 years ago

No promises at this time since there is no guarantees it can be done (it always depends on the way how the run configuration is implemented in the platform) but I'll take a look and will let you know!

lisbakke commented 7 years ago

Thanks!

rbirbeck commented 6 years ago

Hey @Ashald - did this seem feasible? it would be a great feature for node

ashald commented 6 years ago

I recall looking at it... And on one hand I didn't find what I was looking for but on the other hand I didn't find a proof that this cannot be done. I'll try to find some time for it. OTOH, I just got in touch with JetBrains and I want to talk them into either adding required interfaces or incorporating plugin functionality into the IDE on its own.

joseSantacruz commented 6 years ago

Any update on support Webstorm

WilcoBakker commented 6 years ago

@Ashald Any updates concerning this request?

ashald commented 6 years ago

Last time I checked it was still the same. I'd suggest following an example of #37 and filing an issue for JetBrains as was done in https://github.com/Ashald/EnvFile/issues/37#issuecomment-362879301

sjentzsch commented 5 years ago

Hi @Ashald Asking again, as our team would also be very happy to make use of EnvFile for node.js applications, how can we help or what would be missing to have access to the plugin? Would it also be possible (if not easier?) to have it in Goland when installing the node.js plugin? Thanks a lot! :)

ashald commented 5 years ago

If I recall correctly, last time I checked the node.js plugin it was not compatible with plugin APIs used for integration with other platforms so it was not possible to do that at all. But I will take another look.

ashald commented 5 years ago

I will use this ticket to track progress related to Node.js integration. Regardless of an IDE (WebStorm, IDEA, PyCharm etc) under the cover all of them rely on the same plugin to provide support for Node.js run configurations.

Last time I checked the Node.js plugin was missing support for the standard plugin interface that EnvFile plugins requires (other language plugins support it). I will check the latest version of the plugin when I can and will post an update here. If it was added it should be straightforward to implement this. Otherwise I will ask everybody interested in this follow the example of https://github.com/Ashald/EnvFile/issues/37#issuecomment-362879301 and request JetBrains to add the required plugin interface to Node.js - as seen in referenced comment they reacted to similar request within few months in the past.

sjentzsch commented 5 years ago

Created https://youtrack.jetbrains.com/issue/WEB-36734 to support this issue.

RafaelKr commented 5 years ago

As a workaround I currently use https://github.com/motdotla/dotenv

image

To do this, just run

npm i -D dotenv # short for npm install --save-dev
# or if you're using yarn
yarn add -D dotenv

Then add -r dotenv/config to the Node parameters in the Run/Debug Configurations window as seen in the picture. (-r is short for --require)

The other options are just needed for my TypeScript setup. You probably don't need this. -r ts-node/register is used to compile TypeScript "on the fly" -r tsconfig-paths/register loads TypeScript path aliases for Node.js

Edit: Interestingly today it the debugger stopped working. It just didn't attach anymore. I had to remove the --inspect flag from the Node arguments. (I also updated the screenshot)

mlsquires commented 5 years ago

I've been using the plugin in GoLand and RubyMine for quite awhile. I just started a Node project (using WebStorm) and I miss it.

BTW RafaelKr your workaround is working for me at the moment - thanks!

ashald commented 5 years ago

@mlsquires there is nothing that can be done about it until https://youtrack.jetbrains.com/issue/WEB-36734 is addressed - please upvote the linked issue to help it happen sooner.

RafaelKr commented 3 years ago

It should be possible now finally! :) https://youtrack.jetbrains.com/issue/WEB-36734#focus=Comments-27-4463491.0-0

anatoly314 commented 3 years ago

Any updates on this?

JamieStivala commented 2 years ago

+1, this would be a great addition for this plugin

mrchave3-hl commented 11 months ago

+1, would love to see this get updated. Just started to dip my toe in React and have been using this for Rails for years now.