Question: Location of node_modules and package.json
alexlafroscia opened this issue · 4 comments
I'm interested in making a plugin using this API, but am curious about what the directory structure is supposed to look like. Should the package.json
file (and therefore, the node_modules
directory) be inside the rplugin/node
directory in my plugin? Or can those things live at the root? Are there any known examples of plugins using this API, as a reference for best-practices?
For all but the simplest of plugins, you should create a directory called plugin_name.js
in rplugin/node
in which you place a package.json
of the usual format (just make sure that the entry point is set correctly!).
I'll post an example tomorrow shortly after 3 pm EST!
Awesome, thanks for the tips 😄
Another question -- when distributing the plugin, is there some way to have the :UpdateRemotePlugins
call be automatic? I know that you can invoke a post-install call using vim-plug
, but in this instance we really need to run both npm install
and :UpdateRemotePlugins
and it would be really nice if that were automated for the people installing them.
Unfortunately, remote plugins aren't automatically updated yet, but tarruda is working on it!
Well, it's a bit later than "shortly after 3 pm EST," but, as promised, here is an example plugin!
Hopefully this helps!