From 0379eeb3caeadc685e71babda739008157145edf Mon Sep 17 00:00:00 2001 From: Matt Andrews Date: Wed, 15 Jan 2014 09:47:15 +0000 Subject: [PATCH 1/3] Update dependencies, update readme template, upgrade to the year 2014 --- README.md | 6 +++++- docs/templates/readme.hogan | 11 +++++++---- package.json | 16 ++++++++-------- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 4adbe4d..e065a6b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# FruitMachine [![Build Status](https://travis-ci.org/ftlabs/fruitmachine.svg?branch=master)](https://travis-ci.org/ftlabs/fruitmachine) +# FruitMachine [![Build Status](https://travis-ci.org/ftlabs/fruitmachine.svg?branch=master)](https://travis-ci.org/ftlabs/fruitmachine) [![Coverage Status](https://coveralls.io/repos/ftlabs/fruitmachine/badge.png?branch=master)](https://coveralls.io/r/ftlabs/fruitmachine?branch=master) [![Dependency Status](https://gemnasium.com/ftlabs/fruitmachine.png)](https://gemnasium.com/ftlabs/fruitmachine) A lightweight component layout engine for client and server. @@ -91,6 +91,10 @@ $ node_modules/.bin/buster-static - **Wilson Page** - [@wilsonpage](http://github.com/wilsonpage) - **Matt Andrews** - [@matthew-andrews](http://github.com/matthew-andrews) +## License +Copyright (c) 2014 The Financial Times Limited +Licensed under the MIT license. + ## Credits and collaboration The lead developer of FruitMachine is [Wilson Page](http://github.com/wilsonpage) at FT Labs. All open source code released by FT Labs is licenced under the MIT licence. We welcome comments, feedback and suggestions. Please feel free to raise an issue or pull request. diff --git a/docs/templates/readme.hogan b/docs/templates/readme.hogan index bd17993..92e1570 100644 --- a/docs/templates/readme.hogan +++ b/docs/templates/readme.hogan @@ -1,4 +1,4 @@ -# {{pkg.title}} [![Build Status](https://travis-ci.org/ftlabs/fruitmachine.svg?branch=master)](https://travis-ci.org/ftlabs/fruitmachine) +# {{pkg.title}} [![Build Status](https://travis-ci.org/ftlabs/fruitmachine.svg?branch=master)](https://travis-ci.org/ftlabs/fruitmachine) [![Coverage Status](https://coveralls.io/repos/ftlabs/fruitmachine/badge.png?branch=master)](https://coveralls.io/r/ftlabs/fruitmachine?branch=master) [![Dependency Status](https://gemnasium.com/ftlabs/fruitmachine.png)](https://gemnasium.com/ftlabs/fruitmachine) {{pkg.description}} @@ -35,10 +35,9 @@ $ bower install fruitmachine or -Download the [production version][min] (~2k gzipped) or the [development version][max]. +Download the [pre-built version][built] (~2k gzipped). -[min]: http://github.com/ftlabs/fruitmachine/raw/master/build/fruitmachine.min.js -[max]: http://github.com/ftlabs/fruitmachine/raw/master/build/fruitmachine.js +[built]: http://wzrd.in/standalone/fruitmachine@latest ## Examples @@ -95,6 +94,10 @@ $ node_modules/.bin/buster-static - **{{name}}** - [@{{github}}](http://github.com/{{github}}) {{/pkg.contributors}} +## License +Copyright (c) 2014 {{pkg.organization}} +Licensed under the MIT license. + ## Credits and collaboration The lead developer of {{pkg.title}} is [Wilson Page](http://github.com/wilsonpage) at FT Labs. All open source code released by FT Labs is licenced under the MIT licence. We welcome comments, feedback and suggestions. Please feel free to raise an issue or pull request. diff --git a/package.json b/package.json index d223971..1b0f6f9 100644 --- a/package.json +++ b/package.json @@ -32,27 +32,27 @@ "coveralls": "cat coverage/lcov.info | coveralls" }, "dependencies": { - "event": "git://github.com/wilsonpage/event.git", + "events": "git://github.com/wilsonpage/events.git", "model": "git://github.com/wilsonpage/model.git", "utils": "git://github.com/wilsonpage/utils.git", "extend": "git://github.com/wilsonpage/extend.git" }, "devDependencies": { "hogan.js": "^2.0.0", - "buster": "~0.6.6", + "buster": "~0.7.8", "grunt": "~0.4.1", "grunt-cli": "~0.1.8", "grunt-contrib-watch": "~0.5.1", "grunt-contrib-uglify": "~0.2.2", "grunt-readme": "git://github.com/wilsonpage/grunt-readme.git", "grunt-version": "git://github.com/wilsonpage/grunt-version.git", - "grunt-browserify": "1.2.2", - "grunt-buster": "~0.2.1", - "backbone": "~1.0.0", - "express": "^3.3.4", + "grunt-browserify": "1.3.0", + "grunt-buster": "~0.3.1", + "backbone": "~1.1.0", + "express": "^3.4.8", "grunt-istanbul": "~0.2.1", - "buster-istanbul": "~0.1.8", - "coveralls": "^2.1.0", + "buster-istanbul": "~0.1.10", + "coveralls": "^2.6.0", "phantomjs": "~1.9.1-0" }, "keywords": [], From b73dc41d216f7d8a603e39ebf862364882a3711f Mon Sep 17 00:00:00 2001 From: Matt Andrews Date: Wed, 15 Jan 2014 10:34:44 +0000 Subject: [PATCH 2/3] Fix one failing test (assertEquals now checking type); adding in assert/refute where required (buster upgrade problem); fixing a couple of jshint mixed tabs and spaces errors; fixing jshint unused variable error --- test/tests/define.js | 4 +++- test/tests/helpers.js | 4 +++- test/tests/module._getEl.js | 4 +++- test/tests/module._setEl.js | 4 ++-- test/tests/module.add.js | 3 +++ test/tests/module.classes.js | 3 ++- test/tests/module.destroy.js | 5 ++++- test/tests/module.empty.js | 4 +++- test/tests/module.extend.js | 1 + test/tests/module.fire.js | 16 +++++++++------- test/tests/module.fireStatic.js | 14 ++++++++------ test/tests/module.id.js | 4 +++- test/tests/module.inject.js | 3 ++- test/tests/module.js | 5 +++-- test/tests/module.module.js | 3 +++ test/tests/module.on.js | 2 ++ test/tests/module.remove.js | 6 +++--- test/tests/module.render.js | 1 + test/tests/module.setup.js | 4 +++- test/tests/module.teardown.js | 4 +++- test/tests/module.toHTML.js | 1 + test/tests/module.toJSON.js | 3 ++- 22 files changed, 67 insertions(+), 31 deletions(-) diff --git a/test/tests/define.js b/test/tests/define.js index 0224899..3b0bb9e 100644 --- a/test/tests/define.js +++ b/test/tests/define.js @@ -1,3 +1,5 @@ +var assert = buster.assertions.assert; +var refute = buster.assertions.refute; buster.testCase('fruitmachine.define()', { setUp: function() {}, @@ -73,4 +75,4 @@ buster.testCase('fruitmachine.define()', { delete fruitmachine.modules['my-module-1']; delete fruitmachine.modules['my-module-2']; } -}); \ No newline at end of file +}); diff --git a/test/tests/helpers.js b/test/tests/helpers.js index eace6e0..3bba772 100644 --- a/test/tests/helpers.js +++ b/test/tests/helpers.js @@ -1,3 +1,5 @@ +var assert = buster.assertions.assert; + buster.testCase('fruitmachine#helpers()', { setUp: function() { var helper = this.helper = function(view) { @@ -71,4 +73,4 @@ buster.testCase('fruitmachine#helpers()', { this.spys.teardown.restore(); this.spys.destroy.restore(); } -}); \ No newline at end of file +}); diff --git a/test/tests/module._getEl.js b/test/tests/module._getEl.js index 841a755..2b7692a 100644 --- a/test/tests/module._getEl.js +++ b/test/tests/module._getEl.js @@ -1,3 +1,5 @@ +var assert = buster.assertions.assert; +var refute = buster.assertions.refute; buster.testCase('View#_getEl()', { "setUp": helpers.createView, @@ -54,4 +56,4 @@ buster.testCase('View#_getEl()', { }, "tearDown": helpers.destroyView -}); \ No newline at end of file +}); diff --git a/test/tests/module._setEl.js b/test/tests/module._setEl.js index aceaa9b..5183491 100644 --- a/test/tests/module._setEl.js +++ b/test/tests/module._setEl.js @@ -1,3 +1,4 @@ +var assert = buster.assertions.assert; buster.testCase('View#_setEl()', { @@ -20,7 +21,6 @@ buster.testCase('View#_setEl()', { var apple = layout.module('apple'); var orange = layout.module('orange'); - var original = orange.el; var replacement = document.createElement('div'); orange._setEl(replacement); @@ -28,4 +28,4 @@ buster.testCase('View#_setEl()', { assert.equals(replacement.parentNode, apple.el); } -}); \ No newline at end of file +}); diff --git a/test/tests/module.add.js b/test/tests/module.add.js index b3ff451..cb5d9db 100644 --- a/test/tests/module.add.js +++ b/test/tests/module.add.js @@ -1,3 +1,6 @@ +var assert = buster.assertions.assert; +var refute = buster.assertions.refute; + buster.testCase('View#add()', { "setUp": function() { this.view = new helpers.Views.List(); diff --git a/test/tests/module.classes.js b/test/tests/module.classes.js index 5d3f200..9e7aea6 100644 --- a/test/tests/module.classes.js +++ b/test/tests/module.classes.js @@ -1,3 +1,4 @@ +var assert = buster.assertions.assert; buster.testCase('View#classes()', { @@ -32,4 +33,4 @@ buster.testCase('View#classes()', { assert.isTrue(!!~apple.el.className.indexOf('foo')); assert.isTrue(!!~apple.el.className.indexOf('bar')); } -}); \ No newline at end of file +}); diff --git a/test/tests/module.destroy.js b/test/tests/module.destroy.js index 74ba596..64f025d 100644 --- a/test/tests/module.destroy.js +++ b/test/tests/module.destroy.js @@ -1,3 +1,5 @@ +var assert = buster.assertions.assert; +var refute = buster.assertions.refute; buster.testCase('View#destroy()', { setUp: function() { @@ -15,6 +17,7 @@ buster.testCase('View#destroy()', { this.view.destroy(); + assert.called(destroy); assert.called(destroy2); }, @@ -105,4 +108,4 @@ buster.testCase('View#destroy()', { tearDown: function() { helpers.destroyView.call(this); } -}); \ No newline at end of file +}); diff --git a/test/tests/module.empty.js b/test/tests/module.empty.js index 99bbb98..31a88fb 100644 --- a/test/tests/module.empty.js +++ b/test/tests/module.empty.js @@ -1,3 +1,5 @@ +var assert = buster.assertions.assert; +var refute = buster.assertions.refute; buster.testCase('View#empty()', { @@ -38,4 +40,4 @@ buster.testCase('View#empty()', { refute(list.el.querySelector('apple')); } -}); \ No newline at end of file +}); diff --git a/test/tests/module.extend.js b/test/tests/module.extend.js index ef8c8ab..a4db499 100644 --- a/test/tests/module.extend.js +++ b/test/tests/module.extend.js @@ -1,3 +1,4 @@ +var assert = buster.assertions.assert; buster.testCase('Extend', { "Defining reserved methods should rewrite keys with prefixed with '_'": function() { diff --git a/test/tests/module.fire.js b/test/tests/module.fire.js index fb0262b..3efef55 100644 --- a/test/tests/module.fire.js +++ b/test/tests/module.fire.js @@ -1,3 +1,5 @@ +var assert = buster.assertions.assert; +var refute = buster.assertions.refute; buster.testCase('View#fire()', { setUp: helpers.createView, @@ -7,7 +9,7 @@ buster.testCase('View#fire()', { this.view.on('testevent', spy); this.view.fire('testevent'); - assert.called(spy); + assert.called(spy); }, "Events should bubble by default": function() { @@ -17,7 +19,7 @@ buster.testCase('View#fire()', { this.view.on('childtestevent', spy); child.fire('childtestevent'); - assert.called(spy); + assert.called(spy); }, "Calling event.stopPropagation() should stop bubbling": function() { @@ -30,7 +32,7 @@ buster.testCase('View#fire()', { }); child.fire('childtestevent'); - refute.called(spy); + refute.called(spy); }, "Should pass arguments to the callback": function() { @@ -42,9 +44,9 @@ buster.testCase('View#fire()', { this.view.on('childtestevent', spy); this.view.fire('childtestevent', arg1, arg2, arg3); - assert.equals(spy.args[0][0], arg1); - assert.equals(spy.args[0][1], arg2); - assert.equals(spy.args[0][2], arg3); + assert.equals(spy.args[0][0], arg1); + assert.equals(spy.args[0][1], arg2); + assert.equals(spy.args[0][2], arg3); }, "Should allow multiple events to be in progress on the same view": function() { @@ -71,4 +73,4 @@ buster.testCase('View#fire()', { }, tearDown: helpers.destroyView -}); \ No newline at end of file +}); diff --git a/test/tests/module.fireStatic.js b/test/tests/module.fireStatic.js index 9cb90f5..96cf504 100644 --- a/test/tests/module.fireStatic.js +++ b/test/tests/module.fireStatic.js @@ -1,3 +1,5 @@ +var assert = buster.assertions.assert; +var refute = buster.assertions.refute; buster.testCase('View#fireStatic()', { setUp: helpers.createView, @@ -7,7 +9,7 @@ buster.testCase('View#fireStatic()', { this.view.on('testevent', spy); this.view.fireStatic('testevent'); - assert.called(spy); + assert.called(spy); }, "Events should not bubble up to parent views": function() { @@ -16,7 +18,7 @@ buster.testCase('View#fireStatic()', { this.view.on('childtestevent', spy); child.fireStatic('childtestevent'); - refute.called(spy); + refute.called(spy); }, "Should pass arguments to the callback": function() { @@ -28,10 +30,10 @@ buster.testCase('View#fireStatic()', { this.view.on('childtestevent', spy); this.view.fireStatic('childtestevent', arg1, arg2, arg3); - assert.equals(spy.args[0][0], arg1); - assert.equals(spy.args[0][1], arg2); - assert.equals(spy.args[0][2], arg3); + assert.equals(spy.args[0][0], arg1); + assert.equals(spy.args[0][1], arg2); + assert.equals(spy.args[0][2], arg3); }, tearDown: helpers.destroyView -}); \ No newline at end of file +}); diff --git a/test/tests/module.id.js b/test/tests/module.id.js index ccfd923..6652e7b 100644 --- a/test/tests/module.id.js +++ b/test/tests/module.id.js @@ -1,3 +1,5 @@ +var assert = buster.assertions.assert; +var refute = buster.assertions.refute; buster.testCase('View#id()', { setUp: helpers.createView, @@ -30,4 +32,4 @@ buster.testCase('View#id()', { }, tearDown: helpers.tearDown -}); \ No newline at end of file +}); diff --git a/test/tests/module.inject.js b/test/tests/module.inject.js index 731df00..6cbb9de 100644 --- a/test/tests/module.inject.js +++ b/test/tests/module.inject.js @@ -1,3 +1,4 @@ +var assert = buster.assertions.assert; buster.testCase('View#inject()', { setUp: helpers.createView, @@ -16,4 +17,4 @@ buster.testCase('View#inject()', { helpers.emptySandbox(); helpers.destroyView.call(this); } -}); \ No newline at end of file +}); diff --git a/test/tests/module.js b/test/tests/module.js index bd6ded5..78b0b4a 100644 --- a/test/tests/module.js +++ b/test/tests/module.js @@ -1,3 +1,4 @@ +var assert = buster.assertions.assert; buster.testCase('View', { "Should add any children passed into the constructor": function() { @@ -64,7 +65,7 @@ buster.testCase('View', { } }); - assert.equals(layout.module('apple').slot, 2); + assert.equals(layout.module('apple').slot, '2'); }, "Should create a model": function() { @@ -176,4 +177,4 @@ buster.testCase('View', { assert.equals(['my class'], options.classes); } -}); \ No newline at end of file +}); diff --git a/test/tests/module.module.js b/test/tests/module.module.js index 000437d..0f5b0be 100644 --- a/test/tests/module.module.js +++ b/test/tests/module.module.js @@ -1,3 +1,6 @@ +var assert = buster.assertions.assert; +var refute = buster.assertions.refute; + buster.testCase('View#module()', { setUp: function() { var layout = new Layout({}); diff --git a/test/tests/module.on.js b/test/tests/module.on.js index 43ac566..92dfa71 100644 --- a/test/tests/module.on.js +++ b/test/tests/module.on.js @@ -1,3 +1,5 @@ +var assert = buster.assertions.assert; +var refute = buster.assertions.refute; buster.testCase('View#on()', { setUp: helpers.createView, diff --git a/test/tests/module.remove.js b/test/tests/module.remove.js index 520efc4..769700b 100644 --- a/test/tests/module.remove.js +++ b/test/tests/module.remove.js @@ -1,3 +1,5 @@ +var assert = buster.assertions.assert; +var refute = buster.assertions.refute; buster.testCase('View#remove()', { @@ -37,7 +39,6 @@ buster.testCase('View#remove()', { var list = new helpers.Views.Layout(); var Apple = helpers.Views.Apple; var apple = new Apple({ slot: 1 }); - var inDOM; list .add(apple) @@ -57,7 +58,6 @@ buster.testCase('View#remove()', { var list = new helpers.Views.Layout(); var Apple = helpers.Views.Apple; var apple = new Apple(); - var inDOM; list .add(apple, 1) @@ -119,4 +119,4 @@ buster.testCase('View#remove()', { assert(layout.module('apple')); } -}); \ No newline at end of file +}); diff --git a/test/tests/module.render.js b/test/tests/module.render.js index 0c1f24b..25ca2a0 100644 --- a/test/tests/module.render.js +++ b/test/tests/module.render.js @@ -1,3 +1,4 @@ +var assert = buster.assertions.assert; buster.testCase('View#render()', { setUp: helpers.createView, diff --git a/test/tests/module.setup.js b/test/tests/module.setup.js index 798ff94..2dcf450 100644 --- a/test/tests/module.setup.js +++ b/test/tests/module.setup.js @@ -1,3 +1,5 @@ +var assert = buster.assertions.assert; +var refute = buster.assertions.refute; buster.testCase('View#setup()', { setUp: function() { @@ -81,4 +83,4 @@ buster.testCase('View#setup()', { tearDown: function() { helpers.destroyView.call(this); } -}); \ No newline at end of file +}); diff --git a/test/tests/module.teardown.js b/test/tests/module.teardown.js index b519377..21b8742 100644 --- a/test/tests/module.teardown.js +++ b/test/tests/module.teardown.js @@ -1,3 +1,5 @@ +var assert = buster.assertions.assert; +var refute = buster.assertions.refute; buster.testCase('View#teardown()', { setUp: function() { @@ -47,4 +49,4 @@ buster.testCase('View#teardown()', { tearDown: function() { helpers.destroyView.call(this); } -}); \ No newline at end of file +}); diff --git a/test/tests/module.toHTML.js b/test/tests/module.toHTML.js index ec4ac5b..3aa6ad8 100644 --- a/test/tests/module.toHTML.js +++ b/test/tests/module.toHTML.js @@ -1,3 +1,4 @@ +var assert = buster.assertions.assert; buster.testCase('View#toHTML()', { "setUp": helpers.createView, diff --git a/test/tests/module.toJSON.js b/test/tests/module.toJSON.js index 35cf748..db81c28 100644 --- a/test/tests/module.toJSON.js +++ b/test/tests/module.toJSON.js @@ -1,3 +1,4 @@ +var assert = buster.assertions.assert; buster.testCase('View#toJSON()', { @@ -56,4 +57,4 @@ buster.testCase('View#toJSON()', { assert.equals(layoutEl, layoutElInflated); assert.equals(appleEl, appleElInflated); } -}); \ No newline at end of file +}); From 1ec2f763db14109373636499680b82cfc424a13c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Tue, 31 Mar 2015 13:09:50 +0100 Subject: [PATCH 3/3] Renamed module --- lib/fruitmachine.js | 2 +- lib/module/events.js | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/fruitmachine.js b/lib/fruitmachine.js index 0b521f7..88fec8d 100644 --- a/lib/fruitmachine.js +++ b/lib/fruitmachine.js @@ -21,7 +21,7 @@ var mod = require('./module'); var define = require('./define'); var utils = require('utils'); -var events = require('event'); +var events = require('evt'); /** * Creates a fruitmachine diff --git a/lib/module/events.js b/lib/module/events.js index 0d89580..1e25c16 100644 --- a/lib/module/events.js +++ b/lib/module/events.js @@ -3,7 +3,7 @@ * Module Dependencies */ -var events = require('event'); +var events = require('evt'); /** * Local vars diff --git a/package.json b/package.json index 1b0f6f9..e7e215f 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "coveralls": "cat coverage/lcov.info | coveralls" }, "dependencies": { - "events": "git://github.com/wilsonpage/events.git", + "evt": "git://github.com/wilsonpage/evt.git", "model": "git://github.com/wilsonpage/model.git", "utils": "git://github.com/wilsonpage/utils.git", "extend": "git://github.com/wilsonpage/extend.git"