Skip to content

Commit

Permalink
adding documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jhorlin committed Oct 12, 2015
1 parent 8e6e553 commit f10073e
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 23 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ A composition library built by extending [express](http://expressjs.com/)
[![Dependency Status](https://david-dm.org/jhorlin/express-composer.svg)](https://david-dm.org/jhorlin/express-composer)
[![devDependency Status](https://david-dm.org/jhorlin/express-composer/dev-status.svg)](https://david-dm.org/jhorlin/express-composer#info=devDependencies)

###[Coverage Report](http://htmlpreview.github.io/?https://github.com/Jhorlin/express-composer/blob/master/reports/coverage.html)

## Modules
<table>
<thead>
Expand Down
4 changes: 4 additions & 0 deletions docjs2md/README.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,9 @@ A composition library built by extending [express](http://expressjs.com/)
{{>docs}}
{{/module~}}

{{#module name="scopeProvider" ~}}
{{>docs}}
{{/module~}}



1 change: 1 addition & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
});

gulp.task('docjs2md', function () {
streamProcessors = [];
streamProcessors.push(concat("README.md"));
streamProcessors.push(docjs2md({template: fs.readFileSync("docjs2md/README.hbs", "utf8")}));
streamProcessors.push(gulp.dest("."));
Expand Down
8 changes: 4 additions & 4 deletions lib/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
/**
* Express application options passed into [express](http://expressjs.com/api.html)
* @typedef {Object} appOptions
* @property {String} [dotFiles] - Option for serving dotfiles. Possible values are allow�, �deny, and ignore
* @property {String} [dotFiles] - Option for serving dotfiles. Possible values are 'allow', 'deny', and 'ignore'
* @property {Boolean} [etag] - Enable or disable etag generation
* @property {Boolean} [extentions] - Sets file extension fallbacks.
* @property {Object | String} [index] - Sends directory index file. Set false to disable directory indexing.
Expand Down Expand Up @@ -65,7 +65,7 @@
strict: joi.boolean().optional()
}),
/**
* @typedef {object} requestMethod
* @typedef {Object} requestMethod
* @property {function} validator - function used to validate the request
* @property {requestHandlers} preHandlers - handlers that will be called during execution of the route
* @property {scopeArg} scope - scope values to inject into the context of the handlers
Expand All @@ -90,7 +90,7 @@
description: joi.string().optional()
}),
/**
* @typedef {object} requestMethods
* @typedef {Object} requestMethods
* @property {requestMethod | requestHandlers} checkout - handles checkout requests
* @property {requestMethod | requestHandlers} connect - handles connect requests
* @property {requestMethod | requestHandlers} copy - handles copy requests
Expand Down Expand Up @@ -128,7 +128,7 @@
methodsJsonSchema = joi.object(methodsJsonSchemaObject);

/**
* @typedef {(Object)} routeScore
* @typedef {Object} routeScore
* @property {requestMethods} methods - methods for this route
* @property {requestHandlers} preHandlers - handlers that are executed before a route method
* @property {requestHandlers} errorHandlers - handlers for errors within this route
Expand Down
19 changes: 13 additions & 6 deletions lib/scopeProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* ```javascript
* scopeProvider = require('express-Composer).Scope
* ```
* @module Scope
* @module scopeProvider
*/
(function (module, require) {
"use strict";
Expand All @@ -18,10 +18,10 @@
module.exports = ScopeProvider;

/**
*
* Factory class that generates a new scope per request
* @param {Object} scopeProperties - the properties used when creating a scope
* @param {Scope} parentScopeProvider - a parent scope to extend from
* @returns {Scope}
* @param {Scope} [parentScopeProvider] - an optional parent scope to extend from
* @alis module:scopeProvider
* @constructor
*/
function ScopeProvider (scopeProperties, parentScopeProvider) {
Expand All @@ -35,6 +35,13 @@

this.key = uuid.v4();

/**
* middleware used to initialize the provider
* @method init
* @param req
* @param res
* @param next
*/
this.init = function (req, res, next) {
var cacheStore = getCacheStore(req),
parentScope;
Expand All @@ -53,7 +60,7 @@
};

/**
* Creates an instance of scope
* Scope object used during handler execution
* @param {Object} arg
* @constructor
*/
Expand Down Expand Up @@ -137,7 +144,7 @@

/**
*
* @param {object} arg - extend argument properties onto the new course
* @param {Object} arg - extend argument properties onto the scope
* @returns {Scope}
*/
Scope.prototype.new = function (arg) {
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
},
"homepage": "https://github.com/Jhorlin/express-composer",
"devDependencies": {
"body-parser": "^1.13.3",
"chai": "^3.2.0",
"body-parser": "^1.14.1",
"chai": "^3.3.0",
"express": "^4.13.3",
"gulp": "^3.9.0",
"gulp-buddy.js": "^1.0.0",
Expand All @@ -32,32 +32,32 @@
"gulp-coveralls": "^0.1.4",
"gulp-exit": "0.0.2",
"gulp-expect-file": "0.0.7",
"gulp-jscs": "^2.0.0",
"gulp-jscs": "^3.0.1",
"gulp-jsdoc-to-markdown": "^1.1.1",
"gulp-jshint": "^1.11.2",
"gulp-jsinspect": "^1.0.1",
"gulp-jsinspect": "^2.0.0",
"gulp-mocha": "^2.1.3",
"gulp-nsp": "^0.4.5",
"gulp-util": "^3.0.6",
"gulp-watch": "^4.3.4",
"istanbul": "^0.3.17",
"gulp-watch": "^4.3.5",
"istanbul": "^0.3.22",
"jshint-stylish": "^2.0.1",
"mocha": "^2.2.5",
"run-sequence": "^1.1.2",
"mocha": "^2.3.3",
"run-sequence": "^1.1.4",
"supertest-as-promised": "^2.0.2"
},
"peerDependencies": {
"express": ">4.0.0"
},
"dependencies": {
"async-require": "^1.2.1",
"bluebird": "^2.9.34",
"bluebird": "^2.10.2",
"extend": "^3.0.0",
"inherit-multiple": "^1.0.1",
"joi": "^6.6.1",
"joi": "^6.9.0",
"methods": "^1.1.1",
"node-uuid": "^1.4.3",
"supertest": "^1.0.1",
"supertest": "^1.1.0",
"utils-merge": "^1.0.0",
"vhost": "^3.0.1"
}
Expand Down

0 comments on commit f10073e

Please sign in to comment.