Foswiki generally contains the source code in foo.uncompressed.js, and the minified version in foo.js. BuildContrib will take care of minifying and gzipping the uncompressed version for you, as long as the MANIFEST says that they should be there.
Read Crockford's "Javascript: The good parts" - or at least read what he has to say, Eg. google talk. IMHO this book is to Javascript what Damian Conway's Perl Best Practices is for perl.
Please remember to put copyright header and license information in your source files.