Skip to content

Commit

Permalink
feat: expose egg.Controller and egg.Service (#741)
Browse files Browse the repository at this point in the history
  • Loading branch information
dead-horse authored and fengmk2 committed Apr 11, 2017
1 parent 26efa42 commit 241b4e8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
12 changes: 12 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,15 @@ exports.AppWorkerLoader = require('./lib/loader').AppWorkerLoader;
* @since 1.0.0
*/
exports.AgentWorkerLoader = require('./lib/loader').AgentWorkerLoader;

/**
* @member {Controller} Egg#Controller
* @since 1.1.0
*/
exports.Controller = require('egg-core').BaseContextClass;

/**
* @member {Service} Egg#Service
* @since 1.1.0
*/
exports.Service = require('egg-core').BaseContextClass;
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"delegates": "^1.0.0",
"egg-cluster": "^1.6.2",
"egg-cookies": "^2.2.1",
"egg-core": "^3.0.0",
"egg-core": "^3.2.0",
"egg-development": "^1.2.0",
"egg-i18n": "^1.1.0",
"egg-jsonp": "^1.0.0",
Expand All @@ -33,7 +33,7 @@
"egg-security": "^1.9.0",
"egg-session": "^2.1.0",
"egg-static": "^1.3.0",
"egg-view": "^1.0.1",
"egg-view": "^1.1.0",
"egg-watcher": "^2.1.0",
"extend2": "^1.0.0",
"graceful": "^1.0.1",
Expand All @@ -42,19 +42,19 @@
"koa-is-json": "^1.0.0",
"mime-types": "^2.1.15",
"sendmessage": "^1.1.0",
"urllib": "^2.21.2",
"urllib": "^2.22.0",
"utility": "^1.11.0"
},
"devDependencies": {
"autod": "^2.8.0",
"autod-egg": "^1.0.0",
"coffee": "^3.3.0",
"egg-alinode": "^1.0.3",
"egg-bin": "^3.1.0",
"egg-bin": "^3.2.1",
"egg-mock": "^3.2.0",
"egg-plugin-puml": "^1.0.0",
"egg-view-nunjucks": "^2.0.0",
"eslint": "^3.18.0",
"eslint": "^3.19.0",
"eslint-config-egg": "^3.2.0",
"formstream": "^1.1.0",
"gh-pages": "^0.12.0",
Expand Down
18 changes: 18 additions & 0 deletions test/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';

const assert = require('assert');
const egg = require('..');

describe('test/index.test.js', () => {
it('should expose properties', () => {
assert.deepEqual(Object.keys(egg).sort(), [
'Agent',
'AgentWorkerLoader',
'AppWorkerLoader',
'Application',
'Controller',
'Service',
'startCluster',
]);
});
});

0 comments on commit 241b4e8

Please sign in to comment.