Skip to content

Commit

Permalink
changed wrapper to use same distribution file on all the environments…
Browse files Browse the repository at this point in the history
…. see #33
  • Loading branch information
millermedeiros committed Sep 2, 2011
1 parent 9403689 commit 33ec52b
Show file tree
Hide file tree
Showing 14 changed files with 79 additions and 797 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.markdown
@@ -1,6 +1,12 @@
# JS-Signals Changelog #


## Next ##

- changed the way the code is wrapped to have a single distribution file for
all the environments. (issue #33)


## v0.6.3 (2011/07/11) ##

### Fixes ###
Expand Down
7 changes: 4 additions & 3 deletions README.markdown
Expand Up @@ -21,12 +21,13 @@ For a more in-depth introduction read the [JS-Signals Project Page](http://mille

## Distribution Files ##

Files inside `dist` folder.
You can use the same distribution file for all the evironments, browser script
tag, AMD, CommonJS (since v0.6.3+).

Files inside `dist` folder:

* docs/index.html : Documentation.
* signals.js : Uncompressed source code with comments.
* signals.amd.js : Uncompressed source code wrapped as an [asynchronous module](http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition) to be used together with [RequireJS](http://requirejs.org/).
* signals.cjs.js : Uncompressed source code wrapped as an [CommonJS module](http://wiki.commonjs.org/wiki/Modules/1.1) to be used on [nodejs](http://nodejs.org/) or any other environment that supports CommonJS modules.
* signals.min.js : Compressed code.

You can install JS-Signals on Node.js using [NPM](http://npmjs.org/)
Expand Down
10 changes: 4 additions & 6 deletions build.xml
Expand Up @@ -12,7 +12,7 @@

<target name="-purgeJsDeploy">
<delete>
<fileset dir="${dist.dir}" includes="${dist.name} ${dist.min.name} ${dist.amd.name} ${dist.cjs.name}" />
<fileset dir="${dist.dir}" includes="${dist.name} ${dist.min.name}" />
</delete>
</target>

Expand All @@ -22,20 +22,18 @@
<buildnumber file="${build.dir}/build.number"/>

<tstamp>
<format property="build.date" pattern="MM/dd/yyyy hh:mm aa" unit="hour"/>
<format property="build.date" pattern="yyyy/MM/dd hh:mm aa" unit="hour"/>
</tstamp>

<loadfile property="license.txt" srcFile="${src.dir}/license.txt"/>
<loadfile property="signals.js" srcFile="${src.dir}/signals.js"/>
<loadfile property="SignalBinding.js" srcFile="${src.dir}/SignalBinding.js"/>
<loadfile property="Signal.js" srcFile="${src.dir}/Signal.js"/>

<copy file="${src.dir}/wrapper_closure.js" tofile="${dist.dir}/${dist.name}" />
<copy file="${src.dir}/wrapper_amd.js" tofile="${dist.dir}/${dist.amd.name}" />
<copy file="${src.dir}/wrapper_cjs.js" tofile="${dist.dir}/${dist.cjs.name}" />
<copy file="${src.dir}/wrapper.js" tofile="${dist.dir}/${dist.name}" />

<replace>
<fileset dir="${dist.dir}" includes="${dist.name} ${dist.amd.name} ${dist.cjs.name}" />
<fileset dir="${dist.dir}" includes="${dist.name}" />
<replacefilter token="//::LICENSE:://" value="${license.txt}" />
<replacefilter token="//::SIGNALS_JS:://" value="${signals.js}" />
<replacefilter token="//::SIGNAL_BINDING_JS:://" value="${SignalBinding.js}" />
Expand Down
4 changes: 2 additions & 2 deletions dev/build/build.number
@@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
#Mon Jul 11 10:14:28 BRT 2011
build.number=188
#Fri Sep 02 19:06:58 BRT 2011
build.number=190
3 changes: 0 additions & 3 deletions dev/build/build.properties
Expand Up @@ -13,8 +13,5 @@ yuitest-coverage-report.jar = ${build.dir}/yuitest-coverage/yuitest-coverage-rep
product.name = signals
version.number = 0.6.3
dist.name = ${product.name}.js
dist.amd.name = ${product.name}.amd.js
dist.min.name = ${product.name}.min.js
dist.inst.name = ${product.name}.inst.js
dist.cjs.name = ${product.name}.cjs.js
coverage.json = ${coverage.dir}/coverage.json
34 changes: 34 additions & 0 deletions dev/src/wrapper.js
@@ -0,0 +1,34 @@
/*jslint onevar:true, undef:true, newcap:true, regexp:true, bitwise:true, maxerr:50, indent:4, white:false, nomen:false, plusplus:false */
/*global define:false, require:false, exports:false, module:false*/

//::LICENSE:://
(function(def){
def(function(){

//::SIGNALS_JS:://

//::SIGNAL_BINDING_JS:://

//::SIGNAL_JS:://

return signals;
});
}(
// wrapper to run code everywhere
// based on http://bit.ly/c7U4h5
typeof require === 'undefined'?
//Browser (regular script tag)
function(factory){
this.signals = factory();
} :
((typeof exports === 'undefined')?
//AMD
function(factory){
define('signals', [], factory);
} :
//CommonJS
function(factory){
module.exports = factory();
}
)
));
14 changes: 0 additions & 14 deletions dev/src/wrapper_amd.js

This file was deleted.

13 changes: 0 additions & 13 deletions dev/src/wrapper_cjs.js

This file was deleted.

15 changes: 0 additions & 15 deletions dev/src/wrapper_closure.js

This file was deleted.

0 comments on commit 33ec52b

Please sign in to comment.