feature(bower) emitify v2.0.0

This commit is contained in:
coderaiser 2015-12-29 16:18:00 -05:00
parent 8cce30c9ad
commit 9170b8b6a7
20 changed files with 258 additions and 123 deletions

View file

@ -36,9 +36,10 @@
"menu": "~0.7.9",
"promise-polyfill": "~2.1.0",
"rendy": "~1.1.0",
"emitify": "~1.3.0",
"execon": "~1.2.8",
"philip": "~1.3.1",
"smalltalk": "~1.6.4"
"smalltalk": "~1.6.4",
"emitify": "~2.0.0",
"findit": "~1.1.4",
"philip": "~1.3.2"
}
}

View file

@ -34,7 +34,7 @@ var CloudCmd;
window.Promise ? '' : 'promise-polyfill/Promise.min',
libDir('format', 'format-io'),
libDir('rendy'),
libDir('emitify'),
libDir('emitify', '', 'dist'),
libDir('exec', 'execon')
].filter(function(name) {
return name;
@ -59,11 +59,18 @@ var CloudCmd;
});
}
function libDir(name, dir) {
function libDir(name, dir, libDir) {
var lib;
if (!dir)
dir = name;
return dir + '/lib/' + name;
if (libDir)
lib = '/' + libDir + '/';
else
lib = '/lib/';
return dir + lib + name;
}
function createScript(url, callback) {

View file

@ -28,9 +28,6 @@
return item.webkitGetAsEntry();
});
if (!window.Emitify)
array.unshift('emitify');
array = array.map(function(name) {
var result = [
'/modules/' + name,
@ -41,6 +38,9 @@
return result;
});
if (!window.Emitify)
array.unshift('/modules/emitify/dist/emitify.js');
if (!window.exec)
array.unshift('/modules/execon/lib/exec.js');

View file

@ -1,12 +1,12 @@
{
"name": "emitify",
"version": "1.3.0",
"version": "2.0.0",
"homepage": "https://github.com/coderaiser/emitify",
"authors": [
"coderaiser <mnemonic.enemy@gmail.com>"
],
"description": "Dead simple event emitter",
"main": "lib/emitify.js",
"main": "dist/emitify.min.js",
"moduleType": [
"globals",
"node"
@ -23,14 +23,14 @@
"test",
"tests"
],
"_release": "1.3.0",
"_release": "2.0.0",
"_resolution": {
"type": "version",
"tag": "v1.3.0",
"commit": "828df111561259b17cb3ec65aff7ab2228682b5b"
"tag": "v2.0.0",
"commit": "82014823cbf1b668e08fafe3aec7fbc2efc80805"
},
"_source": "git://github.com/coderaiser/emitify.git",
"_target": "~1.3.0",
"_target": "~2.0.0",
"_originalSource": "emitify",
"_direct": true
}

View file

@ -1,3 +1,17 @@
2015.12.29, v2.0.0
feature:
- (emitify) global: lib/emitify -> dist/emitify
- (jscsrc) add
- (jshintrc) add
- (package) jscs v2.7.0
- (package) jshint v2.8.0
- (travis) node.js v5
- (package) npm-run-all v1.4.0
- (package) scripts: add coverage, report
- (package) tape v4.4.0
2015.09.30, v1.3.0
feature:

View file

@ -1,4 +1,4 @@
# Emitify [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL]
# Emitify [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]
Dead simple event emitter.
@ -64,8 +64,10 @@ MIT
[BuildStatusIMGURL]: https://img.shields.io/travis/coderaiser/emitify/master.svg?style=flat
[DependencyStatusIMGURL]: https://img.shields.io/gemnasium/coderaiser/emitify.svg?style=flat
[LicenseIMGURL]: https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat
[CoverageIMGURL]: https://coveralls.io/repos/coderaiser/emitify/badge.svg?branch=master&service=github
[NPMURL]: https://npmjs.org/package/emitify "npm"
[BuildStatusURL]: https://travis-ci.org/coderaiser/emitify "Build Status"
[DependencyStatusURL]: https://gemnasium.com/coderaiser/emitify "Dependency Status"
[LicenseURL]: https://tldrlegal.com/license/mit-license "MIT License"
[CoverageURL]: https://coveralls.io/github/coderaiser/emitify?branch=master

View file

@ -1,12 +1,12 @@
{
"name": "emitify",
"version": "1.3.0",
"version": "2.0.0",
"homepage": "https://github.com/coderaiser/emitify",
"authors": [
"coderaiser <mnemonic.enemy@gmail.com>"
],
"description": "Dead simple event emitter",
"main": "lib/emitify.js",
"main": "dist/emitify.min.js",
"moduleType": [
"globals",
"node"

86
modules/emitify/dist/emitify.js vendored Normal file
View file

@ -0,0 +1,86 @@
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Emitify = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({"emitify":[function(require,module,exports){
'use strict';
module.exports = Emitify;
function Emitify() {
if (this instanceof Emitify)
this._all = {};
else
return new Emitify();
}
Emitify.prototype._check = function(event, callback) {
var isTwo = arguments.length === 2;
if (typeof event !== 'string')
throw Error('event should be string!');
if (isTwo && typeof callback !== 'function')
throw Error('callback should be function!');
};
Emitify.prototype.on = function(event, callback) {
var funcs = this._all[event];
this._check(event, callback);
if (funcs)
funcs.push(callback);
else
this._all[event] = [callback];
return this;
};
Emitify.prototype.addListener =
Emitify.prototype.on;
Emitify.prototype.once = function(event, callback) {
var self = this;
self._check(event, callback);
self.on(event, function fn() {
callback();
self.off(event, fn);
});
return this;
};
Emitify.prototype.off = function(event, callback) {
var events = this._all[event] || [],
index = events.indexOf(callback);
this._check(event, callback);
while (~index) {
events.splice(index, 1);
index = events.indexOf(callback);
}
return this;
};
Emitify.prototype.removeListener =
Emitify.prototype.off;
Emitify.prototype.emit = function(event) {
var args = [].slice.call(arguments, 1),
funcs = this._all[event];
this._check(event);
if (funcs)
funcs.forEach(function(fn) {
fn.apply(null, args);
});
else if (event === 'error')
throw args[0];
return this;
};
},{}]},{},["emitify"])("emitify")
});

1
modules/emitify/dist/emitify.min.js vendored Normal file
View file

@ -0,0 +1 @@
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Emitify=e()}}(function(){return function e(t,o,n){function r(f,u){if(!o[f]){if(!t[f]){var c="function"==typeof require&&require;if(!u&&c)return c(f,!0);if(i)return i(f,!0);var s=new Error("Cannot find module '"+f+"'");throw s.code="MODULE_NOT_FOUND",s}var p=o[f]={exports:{}};t[f][0].call(p.exports,function(e){var o=t[f][1][e];return r(o?o:e)},p,p.exports,e,t,o,n)}return o[f].exports}for(var i="function"==typeof require&&require,f=0;f<n.length;f++)r(n[f]);return r}({emitify:[function(e,t,o){"use strict";function n(){return this instanceof n?void(this._all={}):new n}t.exports=n,n.prototype._check=function(e,t){var o=2===arguments.length;if("string"!=typeof e)throw Error("event should be string!");if(o&&"function"!=typeof t)throw Error("callback should be function!")},n.prototype.on=function(e,t){var o=this._all[e];return this._check(e,t),o?o.push(t):this._all[e]=[t],this},n.prototype.addListener=n.prototype.on,n.prototype.once=function(e,t){var o=this;return o._check(e,t),o.on(e,function n(){t(),o.off(e,n)}),this},n.prototype.off=function(e,t){var o=this._all[e]||[],n=o.indexOf(t);for(this._check(e,t);~n;)o.splice(n,1),n=o.indexOf(t);return this},n.prototype.removeListener=n.prototype.off,n.prototype.emit=function(e){var t=[].slice.call(arguments,1),o=this._all[e];if(this._check(e),o)o.forEach(function(e){e.apply(null,t)});else if("error"===e)throw t[0];return this}},{}]},{},["emitify"])("emitify")});

View file

@ -1,88 +1,82 @@
(function(global) {
'use strict';
if (typeof module !== 'undefined' && module.exports)
module.exports = Emitify;
'use strict';
module.exports = Emitify;
function Emitify() {
if (this instanceof Emitify)
this._all = {};
else
global.Emitify = Emitify;
function Emitify() {
if (this instanceof Emitify)
this._all = {};
else
return new Emitify();
return new Emitify();
}
Emitify.prototype._check = function(event, callback) {
var isTwo = arguments.length === 2;
if (typeof event !== 'string')
throw Error('event should be string!');
if (isTwo && typeof callback !== 'function')
throw Error('callback should be function!');
};
Emitify.prototype.on = function(event, callback) {
var funcs = this._all[event];
this._check(event, callback);
if (funcs)
funcs.push(callback);
else
this._all[event] = [callback];
return this;
};
Emitify.prototype.addListener =
Emitify.prototype.on;
Emitify.prototype.once = function(event, callback) {
var self = this;
self._check(event, callback);
self.on(event, function fn() {
callback();
self.off(event, fn);
});
return this;
};
Emitify.prototype.off = function(event, callback) {
var events = this._all[event] || [],
index = events.indexOf(callback);
this._check(event, callback);
while (~index) {
events.splice(index, 1);
index = events.indexOf(callback);
}
Emitify.prototype._check = function(event, callback) {
var isTwo = arguments.length === 2;
if (typeof event !== 'string')
throw Error('event should be string!');
if (isTwo && typeof callback !== 'function')
throw Error('callback should be function!');
};
return this;
};
Emitify.prototype.removeListener =
Emitify.prototype.off;
Emitify.prototype.emit = function(event) {
var args = [].slice.call(arguments, 1),
funcs = this._all[event];
Emitify.prototype.on = function(event, callback) {
var funcs = this._all[event];
this._check(event, callback);
if (funcs)
funcs.push(callback);
else
this._all[event] = [callback];
return this;
};
this._check(event);
Emitify.prototype.addListener =
Emitify.prototype.on;
Emitify.prototype.once = function(event, callback) {
var self = this;
self._check(event, callback);
self.on(event, function fn() {
callback();
self.off(event, fn);
if (funcs)
funcs.forEach(function(fn) {
fn.apply(null, args);
});
return this;
};
else if (event === 'error')
throw args[0];
Emitify.prototype.off = function(event, callback) {
var events = this._all[event] || [],
index = events.indexOf(callback);
this._check(event, callback);
while (~index) {
events.splice(index, 1);
index = events.indexOf(callback);
}
return this;
};
Emitify.prototype.removeListener =
Emitify.prototype.off;
Emitify.prototype.emit = function(event) {
var args = [].slice.call(arguments, 1),
funcs = this._all[event];
this._check(event);
if (funcs)
funcs.forEach(function(fn) {
fn.apply(null, args);
});
else if (event === 'error')
throw args[0];
return this;
};
})(this);
return this;
};

View file

@ -1,10 +1,20 @@
{
"name": "emitify",
"version": "1.3.0",
"version": "2.0.0",
"description": "dead simple event emitter",
"main": "lib/emitify.js",
"scripts": {
"test": "tape test/*.js"
"test": "tape test/*.js",
"jscs": "jscs --esnext lib test",
"jshint": "jshint lib test",
"codestyle": "npm-run-all jshint jscs",
"coverage": "nyc npm test",
"report": "nyc report --reporter=text-lcov | coveralls",
"bundle:base": "browserify -s Emitify --dg false",
"bundle": "npm run bundle:base -- -r ./lib/emitify.js:emitify ./lib/emitify.js -o dist/emitify.js",
"minify": "minify dist/emitify.js > dist/emitify.min.js",
"build": "npm-run-all bundle minify",
"wisdom": "npm run build"
},
"repository": {
"type": "git",
@ -21,6 +31,13 @@
},
"homepage": "https://github.com/coderaiser/emitify",
"devDependencies": {
"tape": "~4.2.0"
"browserify": "~12.0.1",
"coveralls": "^2.11.6",
"jscs": "^2.7.0",
"jshint": "^2.8.0",
"minify": "~2.0.2",
"npm-run-all": "^1.4.0",
"nyc": "^5.0.1",
"tape": "^4.4.0"
}
}

View file

@ -29,6 +29,6 @@
"commit": "b71d2c60651f957486301e10462aab80a0f62ee1"
},
"_source": "git://github.com/coderaiser/execon.git",
"_target": "~1.2.2",
"_target": "~1.2.8",
"_originalSource": "execon"
}

View file

@ -22,17 +22,17 @@
"modules"
],
"dependencies": {
"emitify": "~1.3.0"
"emitify": "~2.0.0"
},
"version": "1.1.3",
"_release": "1.1.3",
"version": "1.1.4",
"_release": "1.1.4",
"_resolution": {
"type": "version",
"tag": "v1.1.3",
"commit": "40cd3158e92c5176386033feb2a1ce05c42cc334"
"tag": "v1.1.4",
"commit": "f581f83f9a06d89f8578a38774a2d32dbeb73698"
},
"_source": "git://github.com/coderaiser/domfs-findit.git",
"_target": "~1.1.3",
"_target": "~1.1.4",
"_originalSource": "findit",
"_direct": true
}

View file

@ -1,3 +1,9 @@
2015.12.29, v1.1.4
feature:
- (bower) emitify v2.0.0
2015.09.30, v1.1.3
feature:

View file

@ -22,7 +22,7 @@
"modules"
],
"dependencies": {
"emitify": "~1.3.0"
"emitify": "~2.0.0"
},
"version": "1.1.3"
"version": "1.1.4"
}

View file

@ -1,7 +1,7 @@
{
"name": "findit",
"private": true,
"version": "1.1.3",
"version": "1.1.4",
"description": "Walk a directory tree in DOM File System",
"main": "lib/findit.js",
"dependencies": {},

View file

@ -1,6 +1,6 @@
{
"name": "philip",
"version": "1.3.1",
"version": "1.3.2",
"homepage": "https://github.com/coderaiser/domfs-philip",
"authors": [
"coderaiser <mnemonic.enemy@gmail.com>"
@ -22,18 +22,18 @@
"modules"
],
"dependencies": {
"emitify": "~1.3.0",
"execon": "~1.2.2",
"findit": "~1.1.3"
"emitify": "~2.0.0",
"findit": "~1.1.4"
},
"_release": "1.3.1",
"_release": "1.3.2",
"_resolution": {
"type": "version",
"tag": "v1.3.1",
"commit": "7b8bd3426400c03f68d92792c7bbc828a1e8073a"
"tag": "v1.3.2",
"commit": "5987cf63e2caa6037a47c9af1d4ab7068eef20ef"
},
"_source": "git://github.com/coderaiser/domfs-philip.git",
"_target": "~1.3.1",
"_target": "~1.3.2",
"_originalSource": "philip",
"_direct": true
}

View file

@ -1,3 +1,10 @@
2015.12.29, v1.3.2
feature:
- (bower) findit v1.1.4
- (bower) emitify v2.0.0
2015.09.30, v1.3.1
feature:

View file

@ -1,6 +1,6 @@
{
"name": "philip",
"version": "1.3.1",
"version": "1.3.2",
"homepage": "https://github.com/coderaiser/domfs-philip",
"authors": [
"coderaiser <mnemonic.enemy@gmail.com>"
@ -22,8 +22,8 @@
"modules"
],
"dependencies": {
"emitify": "~1.3.0",
"execon": "~1.2.2",
"findit": "~1.1.3"
"emitify": "~2.0.0",
"findit": "~1.1.4"
}
}

View file

@ -1,7 +1,7 @@
{
"name": "philip",
"private": true,
"version": "1.3.1",
"version": "1.3.2",
"description": "Process files and directories in DOM File System",
"main": "lib/philip.js",
"dependencies": {},