From 70213480ea5e8da413ea318c20df9583fbb42dc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kol=C3=A1rik?= Date: Mon, 7 Jul 2014 17:19:52 +0200 Subject: [PATCH 1/2] v0.5.0 --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 569f20b..8e2318a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ractify", - "version": "0.4.1", + "version": "0.5.0", "description": "browserify 2 + precompiled Ractive.js components", "main": "index.js", "scripts": { @@ -12,12 +12,12 @@ }, "dependencies": { "through": "2.3.4", - "rcu": "0.1.8", + "rcu": "0.2.0", "tosource": "0.1.2" }, "devDependencies": { "mocha": "1.18.2", - "ractive": "0.4.0" + "ractive": "0.5.4" }, "browser": "runtime.js", "keywords": [ From 715fe85b9c55b5aa0254757d773ff673cbedea7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kol=C3=A1rik?= Date: Mon, 7 Jul 2014 18:01:09 +0200 Subject: [PATCH 2/2] Update tests --- test/Clock-component.ract-output | 175 +++++++++++++++---------------- test/simple.js | 4 +- test/test.ract-output | 9 +- test/test2.ract-output | 15 +-- 4 files changed, 102 insertions(+), 101 deletions(-) diff --git a/test/Clock-component.ract-output b/test/Clock-component.ract-output index 7de439b..43a190d 100644 --- a/test/Clock-component.ract-output +++ b/test/Clock-component.ract-output @@ -23,93 +23,92 @@ var component = module }; -component.exports.template = [ { t:7, - e:"div", - a:{ "class":[ "rvc-clock-demo" ] }, - f:[ { t:7, - e:"svg", - a:{ viewBox:[ "0 0 100 100" ] }, - f:[ { t:7, - e:"g", - a:{ transform:[ "translate(50,50)" ] }, - f:[ { t:7, - e:"circle", - a:{ "class":[ "clock-face" ], - r:[ "48" ] } }, - " ", - { t:4, - r:"minor", - i:"i", - f:[ " ", - { t:7, - e:"line", - a:{ "class":[ "minor" ], - y1:[ "42" ], - y2:[ "45" ], - transform:[ "rotate( ", - { t:2, - x:{ r:[ "i", - "minor.length" ], - s:"360*${0}/${1}" } }, - " )" ] } }, - " " ] }, - " ", - { t:4, - r:"major", - i:"i", - f:[ " ", - { t:7, - e:"line", - a:{ "class":[ "major" ], - y1:[ "35" ], - y2:[ "45" ], - transform:[ "rotate( ", - { t:2, - x:{ r:[ "i", - "major.length" ], - s:"360*${0}/${1}" } }, - " )" ] } }, - " " ] }, - " ", - { t:7, - e:"line", - a:{ "class":[ "hour" ], - y1:[ "2" ], - y2:[ "-20" ], - transform:[ "rotate( ", - { t:2, - x:{ r:[ "date" ], - s:"30*${0}.getHours()+${0}.getMinutes()/2" } }, - " )" ] } }, - " ", - { t:7, - e:"line", - a:{ "class":[ "minute" ], - y1:[ "4" ], - y2:[ "-30" ], - transform:[ "rotate( ", - { t:2, - x:{ r:[ "date" ], - s:"6*${0}.getMinutes()+${0}.getSeconds()/10" } }, - " )" ] } }, - " ", - { t:7, - e:"g", - a:{ transform:[ "rotate( ", - { t:2, - x:{ r:[ "date" ], - s:"6*${0}.getSeconds()" } }, - " )" ] }, - f:[ { t:7, - e:"line", - a:{ "class":[ "second" ], - y1:[ "10" ], - y2:[ "-38" ] } }, - " ", - { t:7, - e:"line", - a:{ "class":[ "second-counterweight" ], - y1:[ "10" ], - y2:[ "2" ] } } ] } ] } ] } ] } ] +component.exports.template = { v:1, + t:[ { t:7, + e:"div", + a:{ "class":"rvc-clock-demo" }, + f:[ " ", + { t:7, + e:"svg", + a:{ viewBox:"0 0 100 100" }, + f:[ " ", + { t:7, + e:"g", + a:{ transform:"translate(50,50)" }, + f:[ { t:7, + e:"circle", + a:{ "class":"clock-face", + r:"48" } }, + " ", + { t:4, + r:"minor", + i:"i", + f:[ { t:7, + e:"line", + a:{ "class":"minor", + y1:"42", + y2:"45", + transform:[ "rotate( ", + { t:2, + x:{ r:[ "i", + "minor.length" ], + s:"360*${0}/${1}" } }, + " )" ] } } ] }, + " ", + { t:4, + r:"major", + i:"i", + f:[ { t:7, + e:"line", + a:{ "class":"major", + y1:"35", + y2:"45", + transform:[ "rotate( ", + { t:2, + x:{ r:[ "i", + "major.length" ], + s:"360*${0}/${1}" } }, + " )" ] } } ] }, + " ", + { t:7, + e:"line", + a:{ "class":"hour", + y1:"2", + y2:"-20", + transform:[ "rotate( ", + { t:2, + x:{ r:[ "date" ], + s:"30*${0}.getHours()+${0}.getMinutes()/2" } }, + " )" ] } }, + " ", + { t:7, + e:"line", + a:{ "class":"minute", + y1:"4", + y2:"-30", + transform:[ "rotate( ", + { t:2, + x:{ r:[ "date" ], + s:"6*${0}.getMinutes()+${0}.getSeconds()/10" } }, + " )" ] } }, + " ", + { t:7, + e:"g", + a:{ transform:[ "rotate( ", + { t:2, + x:{ r:[ "date" ], + s:"6*${0}.getSeconds()" } }, + " )" ] }, + f:[ { t:7, + e:"line", + a:{ "class":"second", + y1:"10", + y2:"-38" } }, + " ", + { t:7, + e:"line", + a:{ "class":"second-counterweight", + y1:"10", + y2:"2" } } ] } ] } ] } ] } ] } component.exports.css = "\n .rvc-clock-demo {\n position: relative;\n width: 100%;\n height: 0;\n padding-bottom: 100%;\n }\n\n .rvc-clock-demo svg {\n position: absolute;\n width: 100%;\n height: 100%;\n }\n\n .rvc-clock-demo .clock-face {\n stroke: #333;\n fill: white;\n }\n\n .rvc-clock-demo .minor {\n stroke: #999;\n stroke-width: 0.5;\n }\n\n .rvc-clock-demo .major {\n stroke: #333;\n stroke-width: 1;\n }\n\n .rvc-clock-demo .hour {\n stroke: #333;\n }\n\n .rvc-clock-demo .minute {\n stroke: #666;\n }\n\n .rvc-clock-demo .second, .second-counterweight {\n stroke: rgb(180,0,0);\n }\n\n .rvc-clock-demo .second-counterweight {\n stroke-width: 3;\n }\n" \ No newline at end of file diff --git a/test/simple.js b/test/simple.js index e952b49..5819e79 100644 --- a/test/simple.js +++ b/test/simple.js @@ -47,7 +47,7 @@ test('Clock-component.ract', function(done) { test('bad.ract', function(done) { getTransformedOutput(__dirname+"/bad.ract", function(error, output) { assert.ok(error) - assert.equal(error.toString(), 'Error: Could not parse template: failed at character 0 ->{{#inverse Unexpecte...') + assert.equal(error.toString(), 'ParseError: Expected closing delimiter \'}}\' after reference at line 1 character 12:\n{{#inverse Unexpected\n ^----') done() }) -}) +}) \ No newline at end of file diff --git a/test/test.ract-output b/test/test.ract-output index ef0e514..30d25e4 100644 --- a/test/test.ract-output +++ b/test/test.ract-output @@ -1,4 +1,5 @@ -exports.template = [ "Hello ", - { t:2, - r:"world" }, - "!" ] \ No newline at end of file +exports.template = { v:1, + t:[ "Hello ", + { t:2, + r:"world" }, + "!" ] } \ No newline at end of file diff --git a/test/test2.ract-output b/test/test2.ract-output index ff38723..c4dd239 100644 --- a/test/test2.ract-output +++ b/test/test2.ract-output @@ -1,9 +1,10 @@ -exports.template = [ { t:7, - e:"div", - a:{ "class":[ "kickass" ] }, - f:[ "Testing ", - { t:2, - r:"styles" }, - " only." ] } ] +exports.template = { v:1, + t:[ { t:7, + e:"div", + a:{ "class":"kickass" }, + f:[ "Testing ", + { t:2, + r:"styles" }, + " only." ] } ] } exports.css = "\ndiv.kickass {\n /* blue is pretty kickass */\n color: blue;\n}\n" \ No newline at end of file