Comparing version 2.0.2 to 2.0.3
@@ -24,2 +24,4 @@ #!/usr/bin/env node | ||
' -c, --compact Minify </p> <p> to </p><p>', | ||
' -t, --type JavaScript parser: none, es6, coffeescript ...', | ||
' --expr Run expressions trough parser defined with --type', | ||
'', | ||
@@ -45,2 +47,3 @@ 'Build a single .tag file:', | ||
' riot foo bar --compact', | ||
' riot test.tag --type coffeescript --expr', | ||
'' | ||
@@ -54,3 +57,3 @@ ].join('\n')) | ||
chokidar = require('chokidar'), | ||
compile = require('./compile') | ||
compiler = require('./compiler') | ||
@@ -116,3 +119,3 @@ | ||
function parse(from) { return compile(sh.cat(from), {compact: opt.compact}) } | ||
function parse(from) { return compiler.compile(sh.cat(from), opt.compile_opts) } | ||
function toFile(from, to) { from.map(parse).join('\n').to(to[0]) } | ||
@@ -123,3 +126,3 @@ function toDir(from, to) { from.map(function(from, i) { parse(from).to(to[i]) }) } | ||
// Print what's been done | ||
from.map(function(src, i) { | ||
@@ -138,3 +141,3 @@ log(toRelative(src) + ' -> ' + toRelative(to[i] || to[0])) | ||
var glob = opt.flow[0] == 'f' ? opt.from : ph.join(opt.from, '**/*.tag') | ||
chokidar.watch(glob, { ignoreInitial: true }) | ||
@@ -170,3 +173,3 @@ .on('ready', function() { log('Watching ' + toRelative(glob)) }) | ||
boolean: ['watch', 'compact', 'help'], | ||
alias: { w: 'watch', c: 'compact', h: 'help' } | ||
alias: { w: 'watch', c: 'compact', h: 'help', t: 'type' } | ||
}) | ||
@@ -179,3 +182,7 @@ | ||
method: args.watch ? 'watch' : 'make', | ||
compact: args.compact, | ||
compile_opts: { | ||
compact: args.compact, | ||
type: args.type, | ||
expr: args.expr | ||
}, | ||
from: args._.shift(), | ||
@@ -182,0 +189,0 @@ to: args._.shift() |
{ | ||
"name": "riot", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "A React- like, 2.5K user interface library", | ||
@@ -45,5 +45,6 @@ "homepage": "https://muut.com/riotjs/", | ||
"files": [ | ||
"compiler", | ||
"riot.js", | ||
"riot.min.js" | ||
"compiler/compile.js", | ||
"compiler/index.js", | ||
"riot.min.js", | ||
"riot.js" | ||
], | ||
@@ -50,0 +51,0 @@ "bin": { |
@@ -67,2 +67,9 @@ | ||
### Growing ecosystem | ||
- NPM, CommonJS, AMD, Bower and Component support | ||
- [Gulp](https://github.com/e-jigsaw/gulp-riot) and [Grunt](https://github.com/ariesjia/grunt-riot) plugins | ||
- Hosted on [cdnjs](https://cdnjs.com/libraries/riot) and [jsdelivr](http://www.jsdelivr.com/#!riot) | ||
### DEMOS | ||
@@ -73,3 +80,5 @@ - [Simple TODO](https://muut.com/riotjs/dist/demo/) | ||
- [Flux- like event controller for Riot](https://github.com/jimsparkman/RiotControl) | ||
- [Multi- selector](http://plnkr.co/edit/NmcxgZ?p=preview) | ||
https://muut.com/riotjs/ | ||
@@ -1,6 +0,6 @@ | ||
/* Riot 2.0.2, @license MIT, (c) 2015 Muut Inc. + contributors */ | ||
/* Riot 2.0.3, @license MIT, (c) 2015 Muut Inc. + contributors */ | ||
;(function() { | ||
var riot = { version: 'v2.0.2' } | ||
var riot = { version: 'v2.0.3' } | ||
@@ -7,0 +7,0 @@ 'use strict' |
@@ -1,2 +0,2 @@ | ||
/* Riot 2.0.2, @license MIT, (c) 2015 Muut Inc. + contributors */ | ||
(function(){var e={version:"v2.0.2"};"use strict";e.observable=function(e){var t={};e.on=function(n,r){if(typeof r=="function"){n.replace(/\S+/g,function(e,n){(t[e]=t[e]||[]).push(r);r.typed=n>0})}return e};e.off=function(n,r){if(n=="*")t={};else if(r){var i=t[n];for(var o=0,u;u=i&&i[o];++o){if(u==r){i.splice(o,1);o--}}}else{n.replace(/\S+/g,function(e){t[e]=[]})}return e};e.one=function(t,n){if(n)n.one=1;return e.on(t,n)};e.trigger=function(n){var r=[].slice.call(arguments,1),i=t[n]||[];for(var o=0,u;u=i[o];++o){if(!u.busy){u.busy=1;u.apply(e,u.typed?[n].concat(r):r);if(u.one){i.splice(o,1);o--}u.busy=0}}return e};return e};(function(e,t){if(!this.top)return;var n=location,r=e.observable({}),i=u(),o=window;function u(){return n.hash.slice(1)}function f(e){if(e.type)e=u();if(e!=i){r.trigger.apply(null,["H"].concat(e.split("/")));i=e}}var a=e.route=function(e){if(e[0]){n.hash=e;f(e)}else{r.on("H",e)}};a.exec=function(e){e.apply(null,u().split("/"))};o.addEventListener?o.addEventListener(t,f,false):o.attachEvent("on"+t,f)})(e,"hashchange");e._tmpl=function(){var e={},t=/("|').+?[^\\]\1|\.\w*|\w*:|\b(?:this|true|false|null|undefined|new|typeof|Number|String|Object|Array|Math|Date|JSON)\b|([a-z_]\w*)/gi;return function(t,r){return t&&(e[t]=e[t]||n(t))(r)};function n(e,t){t=(e||"{}").replace(/\\{/g,"").replace(/\\}/g,"").split(/({[\s\S]*?})/);return new Function("d","return "+(!t[0]&&!t[2]?r(t[1]):"["+t.map(function(e,t){return t%2?r(e,1):'"'+e.replace(/\n/g,"\\n").replace(/"/g,'\\"')+'"'}).join(",")+'].join("")').replace(/\uFFF0/g,"{").replace(/\uFFF1/g,"}"))}function r(e,t){e=e.replace(/\n/g," ").replace(/^[{ ]+|[ }]+$|\/\*.+?\*\//g,"");return/^\s*[\w-"']+ *:/.test(e)?"["+e.replace(/\W*([\w-]+)\W*:([^,]+)/g,function(e,n,r){return r.replace(/\w[^,|& ]*/g,function(e){return i(e,t)})+'?"'+n+'":"",'})+'].join(" ")':i(e,t)}function i(e,n){return"(function(v){try{v="+(e.replace(t,function(e,t,n){return n?"d."+n:e})||"x")+"}finally{return "+(n?'!v&&v!==0?"":v':"v")+"}}).call(d)"}}();(function(e,t){var n=e._tmpl,r=[],i={};function o(e,t){for(var n=0;n<(e||[]).length;n++){if(t(e[n],n)===false)n--}}function u(e,t){t&&Object.keys(t).map(function(n){e[n]=t[n]});return e}function f(e,t){return e.filter(function(e){return t.indexOf(e)<0})}function a(e,t){e=t(e)===false?e.nextSibling:e.firstChild;while(e){a(e,t);e=e.nextSibling}}function l(e){var n=t.createElement("div");n.innerHTML=e;return n}function c(e,t){t.trigger("update");o(e,function(e){var r=e.tag,i=e.dom;function o(e){i.removeAttribute(e)}if(e.loop){o("each");return d(e,t)}if(r)return r.update?r.update():e.tag=s({tmpl:r[0],fn:r[1],root:i,parent:t});var u=e.attr,f=n(e.expr,t);if(f==null)f="";if(e.value===f)return;e.value=f;if(!u)return i.nodeValue=f;if(!f&&e.bool||/obj|func/.test(typeof f))o(u);if(typeof f=="function"){i[u]=function(e){e=e||window.event;e.which=e.which||e.charCode||e.keyCode;e.target=e.target||e.srcElement;e.currentTarget=i;e.item=t.__item||t;if(f.call(t,e)!==true){e.preventDefault&&e.preventDefault();e.returnValue=false}t.update()}}else if(/^(show|hide|if)$/.test(u)){o(u);if(u=="hide")f=!f;i.style.display=f?"":"none"}else{if(e.bool){if(!f)return;f=u}i.setAttribute(u,f)}});t.trigger("updated")}function p(e){var t={},n=[];a(e,function(e){var r=e.nodeType,f=e.nodeValue;function a(t,r){if(t?t.indexOf("{")>=0:r){var i={dom:e,expr:t};n.push(u(i,r||{}))}}if(r==3&&e.parentNode.tagName!="STYLE"){a(f)}else if(r==1){f=e.getAttribute("each");if(f){a(f,{loop:1});return false}var l=i[e.tagName.toLowerCase()];o(e.attributes,function(n){var r=n.name,i=n.value;if(/^(name|id)$/.test(r))t[i]=e;if(!l){var o=r.split("__")[1];a(i,{attr:o||r,bool:o});if(o){e.removeAttribute(r);return false}}});if(l)a(0,{tag:l})}});return{expr:n,elem:t}}function s(i){var f=i.opts||{},a=l(i.tmpl),s=i.root,d=i.parent,v=p(a),m={root:s,opts:f,parent:d,__item:i.item},g={};u(m,v.elem);o(s.attributes,function(e){g[e.name]=e.value});function h(){Object.keys(g).map(function(e){var t=f[e]=n(g[e],d||m);if(typeof t=="object")s.removeAttribute(e)})}h();if(!m.on){e.observable(m);delete m.off}if(i.fn)i.fn.call(m,f);m.update=function(e,n){if(d&&a&&!a.firstChild){s=d.root;a=null}if(n||t.body.contains(s)){u(m,e);u(m,m.__item);h();c(v.expr,m);!n&&m.__item&&d.update();return true}else{m.trigger("unmount")}};m.update(0,true);while(a.firstChild){if(i.before)s.insertBefore(a.firstChild,i.before);else s.appendChild(a.firstChild)}m.trigger("mount");r.push(m);return m}function d(e,t){if(e.done)return;e.done=true;var r=e.dom,i=r.previousSibling,o=r.parentNode,u=r.outerHTML,a=e.expr,l=a.split(/\s+in\s+/),c=[],p,d;if(l[1]){a="{ "+l[1];d=l[0].slice(1).trim().split(/,\s*/)}t.one("mount",function(){var e=r.parentNode;if(e){o=e;o.removeChild(r)}});function v(){return Array.prototype.indexOf.call(o.childNodes,i)+1}t.on("updated",function(){var e=n(a,t);is_array=Array.isArray(e);if(is_array)e=e.slice(0);else{if(!e)return;var r=JSON.stringify(e);if(r==p)return;p=r;e=Object.keys(e).map(function(t,n){var r={};r[d[0]]=t;r[d[1]]=e[t];return r})}f(c,e).map(function(e){var t=c.indexOf(e);o.removeChild(o.childNodes[v()+t]);c.splice(t,1)});f(e,c).map(function(n,r){var i=e.indexOf(n);if(d&&!p){var f={};f[d[0]]=n;f[d[1]]=r;n=f}var a=s({before:o.childNodes[v()+i],parent:t,tmpl:u,item:n,root:o});t.on("update",function(){a.update(0,true)})});c=e})}e.tag=function(e,t,n){n=n||noop,i[e]=[t,n]};e.mountTo=function(e,t,n){var r=i[t];return r&&s({tmpl:r[0],fn:r[1],root:e,opts:n})};e.mount=function(n,r){if(n=="*")n=Object.keys(i).join(", ");var u=[];o(t.querySelectorAll(n),function(t){if(t.riot)return;var n=t.tagName.toLowerCase(),i=e.mountTo(t,n,r);if(i){u.push(i);t.riot=1}});return u};e.update=function(){return r=r.filter(function(e){return!!e.update()})}})(e,document);if(typeof exports==="object")module.exports=e;else if(typeof define==="function"&&define.amd)define(function(){return e});else this.riot=e})(); | ||
/* Riot 2.0.3, @license MIT, (c) 2015 Muut Inc. + contributors */ | ||
(function(){var e={version:"v2.0.3"};"use strict";e.observable=function(e){var t={};e.on=function(n,r){if(typeof r=="function"){n.replace(/\S+/g,function(e,n){(t[e]=t[e]||[]).push(r);r.typed=n>0})}return e};e.off=function(n,r){if(n=="*")t={};else if(r){var i=t[n];for(var o=0,u;u=i&&i[o];++o){if(u==r){i.splice(o,1);o--}}}else{n.replace(/\S+/g,function(e){t[e]=[]})}return e};e.one=function(t,n){if(n)n.one=1;return e.on(t,n)};e.trigger=function(n){var r=[].slice.call(arguments,1),i=t[n]||[];for(var o=0,u;u=i[o];++o){if(!u.busy){u.busy=1;u.apply(e,u.typed?[n].concat(r):r);if(u.one){i.splice(o,1);o--}u.busy=0}}return e};return e};(function(e,t){if(!this.top)return;var n=location,r=e.observable({}),i=u(),o=window;function u(){return n.hash.slice(1)}function f(e){if(e.type)e=u();if(e!=i){r.trigger.apply(null,["H"].concat(e.split("/")));i=e}}var a=e.route=function(e){if(e[0]){n.hash=e;f(e)}else{r.on("H",e)}};a.exec=function(e){e.apply(null,u().split("/"))};o.addEventListener?o.addEventListener(t,f,false):o.attachEvent("on"+t,f)})(e,"hashchange");e._tmpl=function(){var e={},t=/("|').+?[^\\]\1|\.\w*|\w*:|\b(?:this|true|false|null|undefined|new|typeof|Number|String|Object|Array|Math|Date|JSON)\b|([a-z_]\w*)/gi;return function(t,r){return t&&(e[t]=e[t]||n(t))(r)};function n(e,t){t=(e||"{}").replace(/\\{/g,"").replace(/\\}/g,"").split(/({[\s\S]*?})/);return new Function("d","return "+(!t[0]&&!t[2]?r(t[1]):"["+t.map(function(e,t){return t%2?r(e,1):'"'+e.replace(/\n/g,"\\n").replace(/"/g,'\\"')+'"'}).join(",")+'].join("")').replace(/\uFFF0/g,"{").replace(/\uFFF1/g,"}"))}function r(e,t){e=e.replace(/\n/g," ").replace(/^[{ ]+|[ }]+$|\/\*.+?\*\//g,"");return/^\s*[\w-"']+ *:/.test(e)?"["+e.replace(/\W*([\w-]+)\W*:([^,]+)/g,function(e,n,r){return r.replace(/\w[^,|& ]*/g,function(e){return i(e,t)})+'?"'+n+'":"",'})+'].join(" ")':i(e,t)}function i(e,n){return"(function(v){try{v="+(e.replace(t,function(e,t,n){return n?"d."+n:e})||"x")+"}finally{return "+(n?'!v&&v!==0?"":v':"v")+"}}).call(d)"}}();(function(e,t){var n=e._tmpl,r=[],i={};function o(e,t){for(var n=0;n<(e||[]).length;n++){if(t(e[n],n)===false)n--}}function u(e,t){t&&Object.keys(t).map(function(n){e[n]=t[n]});return e}function f(e,t){return e.filter(function(e){return t.indexOf(e)<0})}function a(e,t){e=t(e)===false?e.nextSibling:e.firstChild;while(e){a(e,t);e=e.nextSibling}}function l(e){var n=t.createElement("div");n.innerHTML=e;return n}function c(e,t){t.trigger("update");o(e,function(e){var r=e.tag,i=e.dom;function o(e){i.removeAttribute(e)}if(e.loop){o("each");return d(e,t)}if(r)return r.update?r.update():e.tag=s({tmpl:r[0],fn:r[1],root:i,parent:t});var u=e.attr,f=n(e.expr,t);if(f==null)f="";if(e.value===f)return;e.value=f;if(!u)return i.nodeValue=f;if(!f&&e.bool||/obj|func/.test(typeof f))o(u);if(typeof f=="function"){i[u]=function(e){e=e||window.event;e.which=e.which||e.charCode||e.keyCode;e.target=e.target||e.srcElement;e.currentTarget=i;e.item=t.__item||t;if(f.call(t,e)!==true){e.preventDefault&&e.preventDefault();e.returnValue=false}t.update()}}else if(/^(show|hide|if)$/.test(u)){o(u);if(u=="hide")f=!f;i.style.display=f?"":"none"}else{if(e.bool){if(!f)return;f=u}i.setAttribute(u,f)}});t.trigger("updated")}function p(e){var t={},n=[];a(e,function(e){var r=e.nodeType,f=e.nodeValue;function a(t,r){if(t?t.indexOf("{")>=0:r){var i={dom:e,expr:t};n.push(u(i,r||{}))}}if(r==3&&e.parentNode.tagName!="STYLE"){a(f)}else if(r==1){f=e.getAttribute("each");if(f){a(f,{loop:1});return false}var l=i[e.tagName.toLowerCase()];o(e.attributes,function(n){var r=n.name,i=n.value;if(/^(name|id)$/.test(r))t[i]=e;if(!l){var o=r.split("__")[1];a(i,{attr:o||r,bool:o});if(o){e.removeAttribute(r);return false}}});if(l)a(0,{tag:l})}});return{expr:n,elem:t}}function s(i){var f=i.opts||{},a=l(i.tmpl),s=i.root,d=i.parent,v=p(a),m={root:s,opts:f,parent:d,__item:i.item},g={};u(m,v.elem);o(s.attributes,function(e){g[e.name]=e.value});function h(){Object.keys(g).map(function(e){var t=f[e]=n(g[e],d||m);if(typeof t=="object")s.removeAttribute(e)})}h();if(!m.on){e.observable(m);delete m.off}if(i.fn)i.fn.call(m,f);m.update=function(e,n){if(d&&a&&!a.firstChild){s=d.root;a=null}if(n||t.body.contains(s)){u(m,e);u(m,m.__item);h();c(v.expr,m);!n&&m.__item&&d.update();return true}else{m.trigger("unmount")}};m.update(0,true);while(a.firstChild){if(i.before)s.insertBefore(a.firstChild,i.before);else s.appendChild(a.firstChild)}m.trigger("mount");r.push(m);return m}function d(e,t){if(e.done)return;e.done=true;var r=e.dom,i=r.previousSibling,o=r.parentNode,u=r.outerHTML,a=e.expr,l=a.split(/\s+in\s+/),c=[],p,d;if(l[1]){a="{ "+l[1];d=l[0].slice(1).trim().split(/,\s*/)}t.one("mount",function(){var e=r.parentNode;if(e){o=e;o.removeChild(r)}});function v(){return Array.prototype.indexOf.call(o.childNodes,i)+1}t.on("updated",function(){var e=n(a,t);is_array=Array.isArray(e);if(is_array)e=e.slice(0);else{if(!e)return;var r=JSON.stringify(e);if(r==p)return;p=r;e=Object.keys(e).map(function(t,n){var r={};r[d[0]]=t;r[d[1]]=e[t];return r})}f(c,e).map(function(e){var t=c.indexOf(e);o.removeChild(o.childNodes[v()+t]);c.splice(t,1)});f(e,c).map(function(n,r){var i=e.indexOf(n);if(d&&!p){var f={};f[d[0]]=n;f[d[1]]=r;n=f}var a=s({before:o.childNodes[v()+i],parent:t,tmpl:u,item:n,root:o});t.on("update",function(){a.update(0,true)})});c=e})}e.tag=function(e,t,n){n=n||noop,i[e]=[t,n]};e.mountTo=function(e,t,n){var r=i[t];return r&&s({tmpl:r[0],fn:r[1],root:e,opts:n})};e.mount=function(n,r){if(n=="*")n=Object.keys(i).join(", ");var u=[];o(t.querySelectorAll(n),function(t){if(t.riot)return;var n=t.tagName.toLowerCase(),i=e.mountTo(t,n,r);if(i){u.push(i);t.riot=1}});return u};e.update=function(){return r=r.filter(function(e){return!!e.update()})}})(e,document);if(typeof exports==="object")module.exports=e;else if(typeof define==="function"&&define.amd)define(function(){return e});else this.riot=e})(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
83
1
0
29136
5
633