arlolra / otr

Off-the-Record Messaging Protocol implemented in JavaScript
https://arlolra.github.io/otr/
Mozilla Public License 2.0
458 stars 61 forks source link

what is the intended difference between build/dep/* and vendor/* ? #40

Closed daira closed 11 years ago

daira commented 11 years ago

A diff seems to show them as identical apart from the presence of the vendor/cryptojs directory.

arlolra commented 11 years ago

Anything in build only gets updated when a release is made. During the normal development cycle you would see changes going into vendor.

arlolra commented 11 years ago

The commit history of build is indicative, https://github.com/arlolra/otr/commits/master/build As is vendor, https://github.com/arlolra/otr/commits/master/vendor

arlolra commented 11 years ago

Added to the readme https://github.com/arlolra/otr/commit/01b550b237f971ceb0f08f743a7e48371edb9072.

Hope that clarifies. Feel free to reopen.

arlolra commented 11 years ago

Almost forgot, the vendor/cryptojs directory contains the individual files from the CryptoJS library. I use a build step to concatenate those files together and wrap them up for packaging. The result is vendor/crypto.js. You can reproduce it with, make build TASK=concat:cryptojs.

daira commented 11 years ago

Okay. Is it correct that various files do require('../vendor/$FOO.js'), in that case?

arlolra commented 11 years ago

Yeah, I think it's ok.

The library supports two module patterns in the browser: AMD, and just exposing a global variable. The lines you're referring to correspond to CommonJS, which is only used in node.js

When a release is made for node, npm publish tars up a specific commit tied to a version number, at which point vendor/ and build/ will be identical, as noted above.

The build/ dir is for people coming to github in between releases to get a frozen copy for use in the browser.

I suppose if someone wanted CommonJS support in the browser those strings could be substituted to point to dep/.

arlolra commented 11 years ago

Wrote this up for you, https://github.com/arlolra/otr/commit/8d365b1de756159b8c4feb3e316307d2f13bee03

daira commented 11 years ago

Thanks!