WebStorm doesn't understand Meteor Packages, help me ;)

Hello, I’m a fan of WebStorm but we have a problem that needs to be fixed for the Meteor community use it in a nice way.

WebStorm is not able to understand Meteor Packages and in projects with local Meteor Packages that is a problem because a good amount of the code lives inside packages.

You can help with your vote in this issue on JetBrains issue tracker https://youtrack.jetbrains.com/issue/WEB-21682

If you are using VSCode and want to understand why I prefer WebStorm you can read here the features that I think are still missing in VSCode https://medium.com/@filipenevola/vscode-missing-features-837a6bd660ca

If you have a workaround or something that is working for you related to IDE, let me know.

2 Likes

Do you have a specific issue with it? Perhaps I could help with a specific problem.
I am using Webstorm with meteor and a local package. I also use a lot of npm modules. I have the local meteor_package directory in my project and all the app directories there at the same directory level and in the run configuration for an app I set the METEOR_PACKAGE_DIRS=path_to_the_meteor_packages_directory environment variable and it all works great. I have a project structure something like this…
MY_GIT_PROJECT
apps_directory
app-1
.idea
.meteor
client
node_modules
private
public
server
app.css
package.json

   app-2
    .....
   app-n
   .....
   meteor_packages
  miscellaneous scripts
  static_stuff
 .gitignore
  RELEASE.txt

Most of the client side code is actually in the local package because all of my apps are heavily templated client side with common code from the package, the interfaces all being data driven. I guess my best advice is to just use the Webstorm template when you initially add a meteor app and if you are using a local package have the local package contained in the project directory at the same level as the app. It all works great for me. I love Webstorm, but then I love all the JetBrains stuff and my employer is kind enough to pay for the all inclusive license. I use IntelliJ, PyCharm, WebStorm, and DataGrip pretty much daily and I love them all. I also use Atom and it is pretty cool also.

Hello, is this kind of import working for you?

import { MyComponent } from 'meteor/my-package-ui/components/myComponent';

Working means:

  • You can auto-complete MyComponent with ctrl + space and WS generate the correct import
  • You can click on the import + ctrl and go to the declaration
  • You can paste code using MyComponent and WS auto import it for you
  • You can find usages of MyComponent and we will find every usage of it
  • Any feature that depends on WS understanding your code.

This is only one case, I can mention more cases or just check more cases here https://youtrack.jetbrains.com/oauth?state=%2Fissue%2FWEB-21682

As one developer from JetBrains is replying there (Andrey) and trying to improve it I’m pretty sure we have missing stuff for Meteor Packages support.

this works to import something from my local package…

import {matsDataPlotOpsUtils} from 'meteor/randyp:mats-common';

My code is always working, the problem is the awareness of WS and not the running code.

Are you talking about it too?

I think I can do all the things in WS that I need to. I can start processes in the run or debug modes, I can set breakpoints on the server side code. I use chrome to debug the client side. I can navigate to other pieces of the code using [cmd] B (I am using a mac), I can step into the package code when debugging or search through it. I can edit it and upon saving server side code the server process restarts automatically. I haven’t really tried things don’t actually work unless I have a problem of some sort in my code.

I admit that I have had one issue with incompatibility of node js version when debugging. If you are using an old version of node.js (which is bundled into a meteor app) with a newer version of node specified for an app there is a known issue when trying to debug. You get this message…
-debug-brk=51397 is not allowed in NODE_OPTIONS

but that is the only problem I am aware of.

Did you check this page out?

http://meteorpedia.com/read/Webstorm

randy

Yeah, looks like we are talking about different stuff.

My project is working, that is not the problem.

The problem is how much WS can help me.

See this example in my last comment here:
https://youtrack.jetbrains.com/issue/WEB-21682#comment=27-2878826

Is that working for you?