I've been putting my mind to trying to figure out the mess of craziness
that is lodash with the aim up updating it... There are basically two
upstream repos I believe:
https://github.com/lodash/lodash-cli - the build tool
https://github.com/lodash - the actual source
Currently have three source packages:
nodejs-lodash-cli - generates nodejs-lodash-cli
nodejs-lodash - generates nodejs-lodash
nodejs-lodash-node - generates many packages
It's very dubious to what extent the sources those packages are using
are the genuine root source though.
The basic story upstream is that the main lodash repo has a build script
that can generate a lodash.js single file build and the lodash tool in
the lodash-cli repo can then generate all sorts of different builds of
lodash from that.
Except that lodash-cli is a node program that does require("lodash") but
the may the lodash npm is build is to use the lodash command line tool
so that's all a bit circular.
My feeling is that we should move to a single source package that uses
both the upstream repos as sources. The strategy would then be something
like this:
cd lodash
node lib/main/build.js [generates dist/lodash.js]
cd ../lodash-cli
mkdir node_modules
ln -s ../../lodash/dist/lodash.js node_modules
lodash modularize modern exports=node -o nodejs-lodash
and then a serious of further lodash commands to generate the different
builds.
It could then spit out a number of different RPMs corresponding to the
many different versions that the lodash project publish to the npm
registry and also some js- versions if we wanted.
My gut feeling is we should all three current source packages and create
a new one just called lodash that can spit out whatever node and
non-node ones we need but we could also repurpose the existing
nodejs-lodash package as the source.
So, what do people think?
Tom
--
Tom Hughes (tom(a)compton.nu)
http://compton.nu/