Module boilerplate

2 views
Skip to first unread message

Brooks Boyd

unread,
Jan 12, 2014, 5:00:40 PM1/12/14
to Bitcoin...@googlegroups.com
As we're starting to work on components for the cryptocoinjs organization/app, all meant to jigsaw together, we should probably come up with a basic boilerplate layout for our modules, so we know we're all on the same page.

We talked about the javascript being intended to primarily run on Node, but could run through Browserify to be runnable in a browser. But some of the older components in the organization have RequireJS and other setups (Component, Bower, etc.). I think we came to the consensus to just focus on Node/Browserify, though does that mean we should do away with all the boilerplate like wrapping it in the "function(globals) {}" wrapper function? If not, what should we use as the basic wrapper for interoperability with the target runtime environments?

Brooks

Sidney Zhang

unread,
Jan 12, 2014, 6:24:00 PM1/12/14
to Bitcoin...@googlegroups.com
This is a good idea. I like that.

I would also like to suggest a styling guide.

I want to propose select a set of starndards using https://github.com/einars/js-beautify 

And all commits / pull requests must be formatted by the package (there is a sublime package that formats your code according to the standard after each save, same is available in vim and IDEs)

Brooks Boyd

unread,
Jan 12, 2014, 8:40:03 PM1/12/14
to Bitcoin...@googlegroups.com
There's already a style guide for the cryptocoinjs project over at https://github.com/cryptocoinjs/cryptocoin/wiki/Contributor-Guidelines as a current standard. I haven't heard of js-beautify (only uglify!); I'll have to take a look at that!


--
You received this message because you are subscribed to the Google Groups "Bitcoin Hackers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to BitcoinHacker...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

JP Richardson

unread,
Jan 13, 2014, 3:33:04 AM1/13/14
to Bitcoin...@googlegroups.com
Agreed. Ya, I think that we can remove and not use "bower.json" and "component.json" anymore. I think that we can also remove that wrapper function as well and anyone that wants to use the code via the script tag will have to pipe it through Browserify. 

Brooks Boyd

unread,
Jan 24, 2014, 1:36:07 AM1/24/14
to Bitcoin...@googlegroups.com
FYI, I went through and created issues for all the libraries that still have them in there, to serve as a todo item for us to chip away at.

Brooks

JP Richardson

unread,
Jan 25, 2014, 12:30:32 AM1/25/14
to Bitcoin...@googlegroups.com
Awesome, thanks! Glanced at 'em... looks good.


--
You received this message because you are subscribed to the Google Groups "Bitcoin Hackers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to BitcoinHacker...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Follow me on Twitter: http://twitter.com/jprichardson

Reply all
Reply to author
Forward
0 new messages