Skip to content

Commit

Permalink
v1.1.2 June 8, 2014
Browse files Browse the repository at this point in the history
- Added `domain.createDomain()` alias
	- Thanks to [James Halliday](https://github.com/substack) for [pull request #1](#1)
  • Loading branch information
balupton committed Jun 7, 2014
1 parent 7bd6ef1 commit 43e73cb
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 60 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# v1.3.5 October 31, 2013
# v1.3.10 December 10, 2013
# https://github.com/bevry/base

# Temp Files
**/*.log
**/.docpad.db

# Build Files
build/
components/
bower_components/
node_modules/
out/

# =====================================
# CUSTOM MODIFICATIONS

# None
10 changes: 8 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# v1.3.3 October 26, 2013
# v1.3.10 December 10, 2013
# https://github.com/bevry/base

# Temp Files
**/*.log
**/.docpad.db

# Build Files
build/
Expand All @@ -23,4 +24,9 @@ HISTORY.md
# Other Package Definitions
template.js
component.json
bower.json
bower.json

# =====================================
# CUSTOM MODIFICATIONS

# None
13 changes: 11 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
# v1.3.8 November 7, 2013
# v1.3.17 May 29, 2014
# https://github.com/bevry/base
language: node_js
# ensure npm is the latest (handled via npm install -g npm)
# ensure dev dependencies are installed (handled via npm install)
# ensure test dependencies are installed (handled via cake install)
install: "npm install -g npm && npm install && ./node_modules/.bin/cake install"
# ensure our application is compiled before we run our tests
before_script: "./node_modules/.bin/cake compile"
script: "npm test"
node_js:
- "0.8"
- "0.10"
cache:
directories:
- node_modules
notifications:
irc:
- "irc.freenode.org#bevry-dev"
email:
recipients:
- [email protected]
- [email protected]
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ For project maintainers
```

5. Publish new version

``` bash
cake publish
```

31 changes: 15 additions & 16 deletions Cakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# v1.3.13 December 19, 2013
# v1.3.16 May 23, 2014
# https://github.com/bevry/base


Expand All @@ -24,18 +24,17 @@ PACKAGE_DATA = require(PACKAGE_PATH)

MODULES_PATH = pathUtil.join(APP_PATH, "node_modules")
DOCPAD_PATH = pathUtil.join(MODULES_PATH, "docpad")
BIN_PATH = pathUtil.join(MODULES_PATH, ".bin")
CAKE = pathUtil.join(BIN_PATH, "cake" + EXT)
COFFEE = pathUtil.join(BIN_PATH, "coffee" + EXT)
PROJECTZ = pathUtil.join(BIN_PATH, "projectz" + EXT)
DOCCO = pathUtil.join(BIN_PATH, "docco" + EXT)
DOCPAD = pathUtil.join(BIN_PATH, "docpad" + EXT)
CAKE = pathUtil.join(MODULES_PATH, "coffee-script/bin/cake")
COFFEE = pathUtil.join(MODULES_PATH, "coffee-script/bin/coffee")
PROJECTZ = pathUtil.join(MODULES_PATH, "projectz/bin/projectz")
DOCCO = pathUtil.join(MODULES_PATH, "docco/bin/docco")
DOCPAD = pathUtil.join(MODULES_PATH, "docpad/bin/docpad")

config = {}
config.TEST_PATH = "test"
config.DOCCO_SRC_PATH = null
config.DOCCO_OUT_PATH = "docs"
config.COFFEE_SRC_PATH = "src" # eventually we'll set this to null, right now it isn't for b/c compat
config.COFFEE_SRC_PATH = null
config.COFFEE_OUT_PATH = "out"
config.DOCPAD_SRC_PATH = null
config.DOCPAD_OUT_PATH = "out"
Expand Down Expand Up @@ -82,10 +81,10 @@ actions =
clean: (opts,next) ->
# Prepare
(next = opts; opts = {}) unless next?

# Add compilation paths
args = ['-Rf', config.COFFEE_OUT_PATH, config.DOCPAD_OUT_PATH, config.DOCCO_OUT_PATH]

# Add common ignore paths
for path in [APP_PATH, config.TEST_PATH]
args.push(
Expand Down Expand Up @@ -133,11 +132,11 @@ actions =
step2 = ->
return step3() if !config.COFFEE_SRC_PATH or !fsUtil.existsSync(COFFEE)
console.log('coffee compile')
spawn(COFFEE, ['-co', config.COFFEE_OUT_PATH, config.COFFEE_SRC_PATH], {stdio:'inherit', cwd:APP_PATH}).on('close', safe next, step3)
spawn(NODE, [COFFEE, '-co', config.COFFEE_OUT_PATH, config.COFFEE_SRC_PATH], {stdio:'inherit', cwd:APP_PATH}).on('close', safe next, step3)
step3 = ->
return step4() if !config.DOCPAD_SRC_PATH or !fsUtil.existsSync(DOCPAD)
console.log('docpad generate')
spawn(DOCPAD, ['generate'], {stdio:'inherit', cwd:APP_PATH}).on('close', safe next, step4)
spawn(NODE, [DOCPAD, 'generate'], {stdio:'inherit', cwd:APP_PATH}).on('close', safe next, step4)
step4 = next

# Start
Expand All @@ -154,12 +153,12 @@ actions =
step2 = ->
return step3() if !config.COFFEE_SRC_PATH or !fsUtil.existsSync(COFFEE)
console.log('coffee watch')
spawn(COFFEE, ['-wco', config.COFFEE_OUT_PATH, config.COFFEE_SRC_PATH], {stdio:'inherit', cwd:APP_PATH}).on('close', safe) # background
spawn(NODE, [COFFEE, '-wco', config.COFFEE_OUT_PATH, config.COFFEE_SRC_PATH], {stdio:'inherit', cwd:APP_PATH}).on('close', safe) # background
step3() # continue while coffee runs in background
step3 = ->
return step4() if !config.DOCPAD_SRC_PATH or !fsUtil.existsSync(DOCPAD)
console.log('docpad run')
spawn(DOCPAD, ['run'], {stdio:'inherit', cwd:APP_PATH}).on('close', safe) # background
spawn(NODE, [DOCPAD, 'run'], {stdio:'inherit', cwd:APP_PATH}).on('close', safe) # background
step4() # continue while docpad runs in background
step4 = next

Expand Down Expand Up @@ -193,11 +192,11 @@ actions =
step2 = ->
return step3() if !fsUtil.existsSync(PROJECTZ)
console.log('projectz compile')
spawn(PROJECTZ, ['compile'], {stdio:'inherit', cwd:APP_PATH}).on('close', safe next, step3)
spawn(NODE, [PROJECTZ, 'compile'], {stdio:'inherit', cwd:APP_PATH}).on('close', safe next, step3)
step3 = ->
return step4() if !config.DOCCO_SRC_PATH or !fsUtil.existsSync(DOCCO)
console.log('docco compile')
exec("#{DOCCO} -o #{config.DOCCO_OUT_PATH} #{config.DOCCO_SRC_PATH}", {stdio:'inherit', cwd:APP_PATH}, safe next, step4)
exec("#{NODE} #{DOCCO} -o #{config.DOCCO_OUT_PATH} #{config.DOCCO_SRC_PATH}", {stdio:'inherit', cwd:APP_PATH}, safe next, step4)
step4 = ->
console.log('cake test')
actions.test(opts, safe next, step5)
Expand Down
20 changes: 12 additions & 8 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# History

- v1.1.1 December 27, 2013
- Fixed `domain.create()` not returning anything
## v1.1.2 June 8, 2014
- Added `domain.createDomain()` alias
- Thanks to [James Halliday](https://github.com/substack) for [pull request #1](https://github.com/bevry/domain-browser/pull/1)

- v1.1.0 November 1, 2013
- Dropped component.io and bower support, just use ender or browserify
## v1.1.1 December 27, 2013
- Fixed `domain.create()` not returning anything

- v1.0.1 September 18, 2013
- Now called `domain-browser` everywhere
## v1.1.0 November 1, 2013
- Dropped component.io and bower support, just use ender or browserify

- v1.0.0 September 18, 2013
- Initial release
## v1.0.1 September 18, 2013
- Now called `domain-browser` everywhere

## v1.0.0 September 18, 2013
- Initial release
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@

[![Build Status](http://img.shields.io/travis-ci/bevry/domain-browser.png?branch=master)](http://travis-ci.org/bevry/domain-browser "Check this project's build status on TravisCI")
[![NPM version](http://badge.fury.io/js/domain-browser.png)](https://npmjs.org/package/domain-browser "View this project on NPM")
[![Dependency Status](https://david-dm.org/bevry/domain-browser.png?theme=shields.io)](https://david-dm.org/bevry/domain-browser)
[![Development Dependency Status](https://david-dm.org/bevry/domain-browser/dev-status.png?theme=shields.io)](https://david-dm.org/bevry/domain-browser#info=devDependencies)<br/>
[![Gittip donate button](http://img.shields.io/gittip/bevry.png)](https://www.gittip.com/bevry/ "Donate weekly to this project using Gittip")
[![Flattr donate button](http://img.shields.io/flattr/donate.png?color=yellow)](http://flattr.com/thing/344188/balupton-on-Flattr "Donate monthly to this project using Flattr")
[![PayPayl donate button](http://img.shields.io/paypal/donate.png?color=yellow)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QB8GQPZAH84N6 "Donate once-off to this project using Paypal")
[![BitCoin donate button](http://img.shields.io/bitcoin/donate.png?color=yellow)](https://coinbase.com/checkouts/9ef59f5479eec1d97d63382c9ebcb93a "Donate once-off to this project using BitCoin")
[![Wishlist browse button](http://img.shields.io/wishlist/browse.png?color=yellow)](http://amzn.com/w/2F8TXKSNAFG4V "Buy an item on our wishlist for us")

<!-- /BADGES -->

Expand All @@ -28,14 +32,14 @@ Note, this is merely an evented try...catch with the same API as node. Nothing m

## Install

### [Node](http://nodejs.org/)
### [NPM](http://npmjs.org/)
- Use: `require('domain-browser')`
- Install: `npm install --save domain-browser`

### [Browserify](http://browserify.org/)
- Use: `require('domain-browser')`
- Install: `npm install --save domain-browser`
- CDN URL: `//wzrd.in/bundle/[email protected].1`
- CDN URL: `//wzrd.in/bundle/[email protected].2`

### [Ender](http://ender.jit.su/)
- Use: `require('domain-browser')`
Expand Down Expand Up @@ -69,6 +73,8 @@ No sponsors yet! Will you be the first?
[![Gittip donate button](http://img.shields.io/gittip/bevry.png)](https://www.gittip.com/bevry/ "Donate weekly to this project using Gittip")
[![Flattr donate button](http://img.shields.io/flattr/donate.png?color=yellow)](http://flattr.com/thing/344188/balupton-on-Flattr "Donate monthly to this project using Flattr")
[![PayPayl donate button](http://img.shields.io/paypal/donate.png?color=yellow)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QB8GQPZAH84N6 "Donate once-off to this project using Paypal")
[![BitCoin donate button](http://img.shields.io/bitcoin/donate.png?color=yellow)](https://coinbase.com/checkouts/9ef59f5479eec1d97d63382c9ebcb93a "Donate once-off to this project using BitCoin")
[![Wishlist browse button](http://img.shields.io/wishlist/browse.png?color=yellow)](http://amzn.com/w/2F8TXKSNAFG4V "Buy an item on our wishlist for us")

### Contributors

Expand Down
45 changes: 22 additions & 23 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
/*global define:false require:false */
module.exports = (function(){
// Import Events
var events = require('events');
// Import Events
var events = require('events');

// Export Domain
var domain = {};
domain.create = function(){
var d = new events.EventEmitter();
d.run = function(fn){
try {
fn();
}
catch (err) {
this.emit('error', err);
}
return this;
};
d.dispose = function(){
this.removeAllListeners();
return this;
};
return d;
};
domain.createDomain = domain.create;
return domain;
// Export Domain
var domain = {};
domain.createDomain = domain.create = function(){
var d = new events.EventEmitter();
d.run = function(fn){
try {
fn();
}
catch (err) {
this.emit('error', err);
}
return this;
};
d.dispose = function(){
this.removeAllListeners();
return this;
};
return d;
};
return domain;
}).call(this);
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "Node's [domain module](http://nodejs.org/api/domain.html) for the web browser",
"name": "domain-browser",
"version": "1.1.1",
"version": "1.1.2",
"description": "Note, this is merely an evented try...catch with the same API as node. Nothing more.",
"homepage": "https://github.com/bevry/domain-browser",
"license": {
Expand All @@ -10,9 +10,13 @@
"badges": {
"travis": true,
"npm": true,
"david": true,
"daviddev": true,
"gittip": "bevry",
"flattr": "344188/balupton-on-Flattr",
"paypal": "QB8GQPZAH84N6"
"paypal": "QB8GQPZAH84N6",
"bitcoin": "https://coinbase.com/checkouts/9ef59f5479eec1d97d63382c9ebcb93a",
"wishlist": "http://amzn.com/w/2F8TXKSNAFG4V"
},
"keywords": [
"domain",
Expand Down Expand Up @@ -53,8 +57,8 @@
"main": "./index.js",
"devDependencies": {
"projectz": "~0.3.2",
"chai": "~1.8.1",
"joe": "~1.3.2",
"chai": "~1.9.1",
"joe": "~1.4.0",
"joe-reporter-console": "~1.2.1"
},
"scripts": {
Expand Down

0 comments on commit 43e73cb

Please sign in to comment.