lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


It was thus said that the Great Pierre Chapuis once stated:
> 
> Finally, I am starting to like the practice of module
> namespacing by organization, i.e. "mycompany.util.stack".
> However when doing this I am unsure how to package those
> modules as rocks. Make a single "mycompany" rock?
> Make "mycompany-util"? Make "mycompany-util-stack"?
> 
> For close source, pure Lua modules I am shifting towards
> the second solution, but still allow users to just require
> a part of it (i.e. the Penlight model minus the global
> namespace pollution when requiring "pl"). For Open
> Source the third one appears to make more sense, but
> I am wondering if the trade-off in usability from the
> second one would not make sense as well ("mycompany"
> could be anything else, like "org.conman" here).

  As the creator of "org.conman", my case is slightly different in that each
module is pretty independent of the others (a few exceptions, like
"org.conman.string" requires "org.conman.strcore" and "org.conman.cc"
requires "org.conman.tcc" [1]).  As such, I have created separate rockspec
files for each module (only a few are published on luarocks.org) as it makes
sense for these modules.  As for names:

	org.conman.cbor-1.0.0-1.rockspec
	org.conman.env-1.0.2-2.rockspec
	org.conman.errno-1.0.1-1.rockspec
	org.conman.iconv-2.0.0-1.rockspec
	org.conman.parsers.email-1.0.1-0.rockspec
	org.conman.parsers.ini-1.0.0-0.rockspec
	org.conman.parsers.ip-1.0.0-0.rockspec
	org.conman.syslog-2.1.3-1.rockspec
	org.conman.uuid-1.2.5-2.rockspec

  -spc (But no "org.conman" or "org.conman.parsers" oddly enough ... )

[1]	A TCC (a C-compiler as library) wrapper.  I would not recoomend this
	at all, as TCC is, unfortunately, pretty rough around the edges.