Coder Social home page Coder Social logo

Node.js integration about envfile HOT 20 OPEN

ashald avatar ashald commented on August 24, 2024 20
Node.js integration

from envfile.

Comments (20)

RafaelKr avatar RafaelKr commented on August 24, 2024 10

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

from envfile.

lisbakke avatar lisbakke commented on August 24, 2024 9

Support for the Node.js configuration would be awesome!

from envfile.

RafaelKr avatar RafaelKr commented on August 24, 2024 6

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)

from envfile.

ashald avatar ashald commented on August 24, 2024 3

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 #37 (comment) 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.

from envfile.

JamieStivala avatar JamieStivala commented on August 24, 2024 3

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

from envfile.

ashald avatar ashald commented on August 24, 2024 2

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!

from envfile.

ashald avatar ashald commented on August 24, 2024 2

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.

from envfile.

ashald avatar ashald commented on August 24, 2024 2

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

from envfile.

anatoly314 avatar anatoly314 commented on August 24, 2024 1

Any updates on this?

from envfile.

ashald avatar ashald commented on August 24, 2024

What exact run configurations you would like to have supported?

from envfile.

lisbakke avatar lisbakke commented on August 24, 2024

Thanks!

from envfile.

rbirbeck avatar rbirbeck commented on August 24, 2024

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

from envfile.

joseSantacruz avatar joseSantacruz commented on August 24, 2024

Any update on support Webstorm

from envfile.

WilcoBakker avatar WilcoBakker commented on August 24, 2024

@ashald Any updates concerning this request?

from envfile.

ashald avatar ashald commented on August 24, 2024

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 #37 (comment)

from envfile.

sjentzsch avatar sjentzsch commented on August 24, 2024

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

from envfile.

ashald avatar ashald commented on August 24, 2024

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.

from envfile.

sjentzsch avatar sjentzsch commented on August 24, 2024

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

from envfile.

mlsquires avatar mlsquires commented on August 24, 2024

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!

from envfile.

mrchave3-hl avatar mrchave3-hl commented on August 24, 2024

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

from envfile.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.