Light Table plugins and node.js plugins

341 views
Skip to first unread message

Robert Schroll

unread,
Jul 3, 2014, 4:16:44 PM7/3/14
to light-table...@googlegroups.com
Hi all,

Is it possible for a Light Table plugin to depend on a plugin from npm?
That is, in a way that the npm plugin be downloaded automatically when
the user installs the Light Table plugin? If so, does this work only
for pure JS plugins, or does it also work for compiled plugins?

I've never used node.js or npm before, so I hope these are reasonable
questions. But if I'm misunderstanding something basic, please educate
me.

Thanks,
Robert



Robert Schroll

unread,
Jul 11, 2014, 1:18:09 PM7/11/14
to light-table...@googlegroups.com
Sorry to be so gauche by bumping my own thread, but I'd really like to
know the answer to this. If there's no way to get a Light Table plugin
to install an npm plugin automatically, that's fine -- I'll just use a
pure JS plugin and include it in my plugin for Light Table.

Thanks,
Robert


On Thu, Jul 3, 2014 at 4:16 PM, Robert Schroll <rsch...@gmail.com>
wrote:

Chris Granger

unread,
Jul 11, 2014, 1:22:49 PM7/11/14
to light-table...@googlegroups.com
Yes they can rely on them, see the jshint plugin. Right now though, you have to check in the node_modules. Someone at one point had a version of npm that correctly worked with nodewebkit, if we got that hooked in, then we could add an npm fetch to the plugin install sequence.

Cheers,
Chris.


--
You received this message because you are subscribed to the Google Groups "Light Table Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to light-table-discussion+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robert Schroll

unread,
Jul 11, 2014, 1:33:51 PM7/11/14
to light-table...@googlegroups.com
On Fri, Jul 11, 2014 at 1:22 PM, Chris Granger <ibd...@gmail.com>
wrote:
> Yes they can rely on them, see the jshint plugin. Right now though,
> you have to check in the node_modules. Someone at one point had a
> version of npm that correctly worked with nodewebkit, if we got that
> hooked in, then we could add an npm fetch to the plugin install
> sequence.

So am I correct in understanding that, right now, the node plugin has
to be shipped as part of the Light Table plugin? And as a result, only
pure JS plugins will work? (Sorry for the basic questions; I'm new in
this area.)

Thanks,
Robert



Rainer Schuster

unread,
Jul 17, 2014, 7:06:44 PM7/17/14
to light-table...@googlegroups.com
Native plugins need some more magic. I once tried it to compile (still some issues, but the basic concept works)
For  a node-webkit project to use nom modules you have to build with nw-gyp.

Right now, LT bootstraps the binaries from amazon cloud storage and just cljs compiles the plugin source.

http://github.com/ackalker/LightTable is a basic rebuild of LT to use nw-npm to grab its dependencies and compile from source (which takes some time ... and some coffees).

But this way you can bootstrap from scratch (having said that I didn't fully test it, as there were some quirks in. Highlighting didn't work) But I wanted to test it. Because I did some testing with edge.js and clojure-clr.

ackalker also created a patch for npm. Basically a fork, where he uses nw-gyp in nw-npm instead, so that you don't have to run manual commands after install.
If you would like to do it manually: https://github.com/rogerwang/nw-gyp

Still there is no automation to let LightTable do this.

In the end it didn't work out for me as expected. There needs to be done some polishing. But I'd really prefer to have nw-npm and be able to require nmp modules, too and compile from scratch.
Some awesome sauce out there on npm ... so why not reusing it ..
Reply all
Reply to author
Forward
0 new messages