EnvFile icon indicating copy to clipboard operation
EnvFile copied to clipboard

Node.js integration

Open lisbakke opened this issue 8 years ago • 20 comments

lisbakke avatar May 09 '17 15:05 lisbakke

What exact run configurations you would like to have supported?

ashald avatar May 09 '17 15:05 ashald

Support for the Node.js configuration would be awesome!

lisbakke avatar May 09 '17 15:05 lisbakke

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!

ashald avatar May 09 '17 15:05 ashald

Thanks!

lisbakke avatar May 09 '17 15:05 lisbakke

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

rbirbeck avatar Sep 26 '17 15:09 rbirbeck

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.

ashald avatar Sep 26 '17 15:09 ashald

Any update on support Webstorm

joseSantacruz avatar Dec 11 '17 00:12 joseSantacruz

@Ashald Any updates concerning this request?

WilcoBakker avatar Dec 14 '17 13:12 WilcoBakker

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

ashald avatar Mar 07 '18 03:03 ashald

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! :)

sjentzsch avatar Jan 03 '19 18:01 sjentzsch

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 avatar Jan 04 '19 19:01 ashald

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.

ashald avatar Jan 14 '19 00:01 ashald

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

sjentzsch avatar Jan 14 '19 15:01 sjentzsch

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)

RafaelKr avatar Mar 30 '19 12:03 RafaelKr

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!

mlsquires avatar May 27 '19 18:05 mlsquires

@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.

ashald avatar May 28 '19 15:05 ashald

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

RafaelKr avatar Oct 23 '20 10:10 RafaelKr

Any updates on this?

anatoly314 avatar Mar 22 '21 18:03 anatoly314

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

JamieStivala avatar May 02 '22 11:05 JamieStivala

+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.

mrchave3-hl avatar Oct 18 '23 21:10 mrchave3-hl