├── .gitignore ├── .gitmodules ├── README.md ├── jscoverage-server.sh ├── jscoverage.sh └── update-repos.sh /.gitignore: -------------------------------------------------------------------------------- 1 | coverage 2 | *~ 3 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Base"] 2 | path = Base 3 | url = git://github.com/mootools/Base.git 4 | [submodule "DOM"] 5 | path = DOM 6 | url = git://github.com/mootools/DOM.git 7 | [submodule "Fx"] 8 | path = Fx 9 | url = git://github.com/mootools/Fx.git 10 | [submodule "Color"] 11 | path = Color 12 | url = git://github.com/mootools/Color.git 13 | [submodule "JSON"] 14 | path = JSON 15 | url = git://github.com/mootools/JSON.git 16 | [submodule "Request"] 17 | path = Request 18 | url = git://github.com/mootools/Request.git 19 | [submodule "Table"] 20 | path = Table 21 | url = git://github.com/mootools/Table.git 22 | [submodule "slick"] 23 | path = slick 24 | url = git://github.com/mootools/slick.git 25 | [submodule "Sprinter"] 26 | path = Sprinter 27 | url = git://github.com/mootools/Sprinter.git 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Milk.js 2 | ======= 3 | 4 | Milk.js is the new super modular JavaScript framework and is a MooTools project. 5 | 6 | Milk.js consist out of: 7 | 8 | - *Base* - Base functionality, Array, Function, String, Number and Object methods, Class and other goodies 9 | - *DOM* - A OOP based DOM API with Class as Element wrappers. 10 | - *Slick* - Our super duper famous and precise selector engine. 11 | - *Request* - Everything you requests. Especially a XHR wrapper, but also JSONP. 12 | - *Fx* - Shiny Animations 13 | - *JSON* - JSON decoding and encoding 14 | - *Color* - Convert your HEX codes to rgb values, other transformations, a colorfull package. 15 | - *Table* - Actually a Map, but can store values with non scalar keys. 16 | 17 | Use the [issues](https://github.com/mootools/Milk/issues) for any Milk.js project 18 | related issues. For package specific issues please create a new issue there. 19 | 20 | AMD 21 | --- 22 | 23 | All these cool packages will use [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD), the new relatively and awesome module format. 24 | 25 | If you're brave enough to test some features you will need a AMD loader like [require.js](http://requirejs.org/). 26 | 27 | 28 | Testing 29 | ------- 30 | 31 | Testing will be done with our test suite *Sprinter*. Soon, in the near future, each repository will have a `Spec` folder containing all the specs for that project. Sprinter uses [Jasmine](https://github.com/pivotal/jasmine/wiki) and (usually) Require.JS. 32 | 33 | ### Coverage 34 | 35 | Code coverage can be tested with [JSCoverage](http://siliconforks.com/jscoverage/). Once you've got JSCoverage installed, there are two sh scripts that can help to analize the coverage: 36 | 37 | #### jscoverage.sh 38 | 39 | Example `./jscoverage.sh` or `./jscoverage Base DOM`. 40 | This will generate a new folder in the `coverage` folder with a `jscoverage.html` file. If this file is accessed (through a (local)) server, it will analize the coverage. To instantly run the specs, browse to: 41 | 42 | http://localhost/coverage/Base/jscoverage.html?Specs/SpecRunner.html 43 | 44 | In the *Summary* tab, you will see which lines are executed, and covered by the specs. 45 | 46 | #### jscoverage-server.sh 47 | 48 | Because some code is for specific browsers only, running the coverage in one browser is often not enough. With jscoverage-server it is possible to save te results for multiple browsers which are joined in one result. 49 | 50 | ./jscoverage-server.sh Base 51 | 52 | This command will start a new server for the Base repository. Now you should the specs in multiple browsers and save the results. In most cases the URL that shoudl be opened is `http://127.0.0.1:8080/jscoverage.html?Specs/SpecRunner.html`. 53 | 54 | When this is done, the results are saved in `coverage/Base-results` with a `jscoverage.html` file which can be vieuwed in a browser. 55 | 56 | 57 | ### Updating all repositories 58 | 59 | To update each repository to the latest version, running the following command will update each submodule to it's latest version: 60 | 61 | ./update-repos.sh 62 | 63 | Be careful if you have unpushed commits in the master branches, because it might overwrite them. 64 | 65 | -------------------------------------------------------------------------------- /jscoverage-server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -z `which jscoverage-server` ]; then 4 | 5 | echo " 6 | Install jscoverage-server with: 7 | 8 | $ svn co http://svn.siliconforks.com/jscoverage/trunk jscoverage 9 | $ cd jscoverage 10 | $ ./bootstrap.sh 11 | $ make 12 | $ cd jscoverage-server /usr/local/bin/jscoverage-server 13 | 14 | or see http://siliconforks.com/jscoverage/download.html 15 | " 16 | 17 | else 18 | 19 | if [ -z $1 ]; then 20 | echo "You need to specify which project you would like to test" 21 | else 22 | 23 | TARGET="coverage/${1}-report" 24 | 25 | echo "Starting coverage for ${1}" 26 | echo "Report will be in ${TARGET}" 27 | 28 | test -d coverage || mkdir coverage 29 | test -d $TARGET && rm -r $TARGET 30 | 31 | jscoverage-server --no-instrument=/Specs/ --document-root=$1 --report-dir=$TARGET --verbose 32 | fi 33 | 34 | fi 35 | 36 | -------------------------------------------------------------------------------- /jscoverage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | AVAILABLE='Base' 4 | SOURCE=$PWD 5 | TARGET=$PWD 6 | 7 | JSCOVERAGE='/usr/bin/jscoverage' 8 | OPTIONS='--no-instrument=Specs --exclude=Docs --exclude=package.json --exclude=README.md --exclude=.git --exclude=.gitignore --exclude=.gitmodules' 9 | 10 | if [ -z "$1" ]; then 11 | MODULES=$AVAILABLE 12 | else 13 | MODULES='' 14 | for M in $@; do 15 | if [[ $AVAILABLE == *$M* ]]; then 16 | MODULES="$MODULES $M" 17 | fi 18 | done 19 | fi 20 | 21 | test -d coverage || mkdir coverage 22 | 23 | for M in $MODULES; do 24 | echo "creating $M-coverage..." 25 | test -d "$TARGET/coverage/$M" && rm -r "$TARGET/coverage/$M" 26 | $JSCOVERAGE $OPTIONS "$SOURCE/$M" "$TARGET/coverage/$M" 27 | done 28 | -------------------------------------------------------------------------------- /update-repos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | for repo in `find . -maxdepth 2 -mindepth 2 -wholename '*/.git'` 4 | do 5 | cd $repo/.. 6 | echo "updating $(pwd)" 7 | remote='origin' 8 | if [ `git remote | grep mootools` ]; then 9 | remote='mootools' 10 | fi 11 | git fetch $remote 12 | git reset --hard $remote/master 13 | cd .. 14 | done 15 | 16 | --------------------------------------------------------------------------------