Comparing version 3.0.1 to 3.1.0
3.1.0 / 2017-03-02 | ||
================== | ||
* feat: use framework instead of customEgg (#31) | ||
3.0.1 / 2017-02-22 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -18,3 +18,3 @@ 'use strict'; | ||
* - {Object} plugins - Tustom you plugins | ||
* - {String} customEgg - The directory of the egg framework | ||
* - {String} framework - The directory of the egg framework | ||
* - {Boolean} [true] cache - Cache application based on baseDir | ||
@@ -21,0 +21,0 @@ * - {Boolean} [true] coverage - Swtich on process coverage, but it'll be slower |
@@ -58,3 +58,3 @@ 'use strict'; | ||
debug('get clusterPort %s', this.options.clusterPort); | ||
const egg = require(this.options.customEgg); | ||
const egg = require(this.options.framework); | ||
@@ -61,0 +61,0 @@ const Agent = egg.Agent; |
@@ -48,3 +48,3 @@ 'use strict'; | ||
* - {Object} plugins - Tustom you plugins | ||
* - {String} customEgg - The directory of the egg framework | ||
* - {String} framework - The directory of the egg framework | ||
* - {Boolean} [cache=true] - Cache application based on baseDir | ||
@@ -51,0 +51,0 @@ * - {Boolean} [coverage=true] - Swtich on process coverage, but it'll be slower |
@@ -6,3 +6,2 @@ 'use strict'; | ||
const debug = require('debug')('mm'); | ||
const assert = require('assert'); | ||
const utils = require('egg-utils'); | ||
@@ -32,20 +31,13 @@ | ||
let framework = options.framework || options.customEgg; | ||
// test for framework | ||
if (options.customEgg === true) { | ||
options.customEgg = process.cwd(); | ||
if (framework === true) { | ||
framework = process.cwd(); | ||
// diable plugin test when framwork test | ||
options.plugin = false; | ||
} else { | ||
// it will throw when framework is not found | ||
framework = utils.getFrameworkPath({ framework, baseDir: options.baseDir }); | ||
} | ||
if (!options.customEgg) { | ||
options.customEgg = utils.getFrameworkOrEggPath(options.baseDir); | ||
if (!options.customEgg) { | ||
// try to resolve egg | ||
try { | ||
options.customEgg = path.dirname(require.resolve('egg')); | ||
} catch (_) { | ||
// can't find egg | ||
} | ||
} | ||
} | ||
assert(options.customEgg, 'options.customEgg is required'); | ||
options.customEgg = options.framework = framework; | ||
@@ -52,0 +44,0 @@ const plugins = options.plugins = options.plugins || {}; |
{ | ||
"name": "egg-mock", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"eggPlugin": { | ||
@@ -29,3 +29,3 @@ "name": "egg-mock" | ||
"detect-port": "^1.1.0", | ||
"egg-utils": "^1.1.0", | ||
"egg-utils": "^2.1.0", | ||
"get-ready": "^2.0.1", | ||
@@ -36,11 +36,12 @@ "is-type-of": "^1.0.0", | ||
"mm": "^2.1.0", | ||
"rimraf": "^2.5.4" | ||
"rimraf": "^2.6.1" | ||
}, | ||
"devDependencies": { | ||
"autod": "^2.7.1", | ||
"egg": "^0.12.0", | ||
"egg-bin": "^2.0.2", | ||
"egg-ci": "^1.1.0", | ||
"eslint": "^3.15.0", | ||
"egg": "^1.0.0-rc.2", | ||
"egg-bin": "^2.2.3", | ||
"egg-ci": "^1.3.0", | ||
"eslint": "^3.16.1", | ||
"eslint-config-egg": "^3.2.0", | ||
"mkdirp": "^0.5.1", | ||
"pedding": "^1.1.0", | ||
@@ -47,0 +48,0 @@ "sdk-base": "^3.0.1", |
@@ -78,3 +78,3 @@ # egg-mock | ||
customEgg is optional, it's `node_modules/egg` by default. | ||
framework is optional, it's `node_modules/egg` by default. | ||
@@ -85,3 +85,3 @@ ```js | ||
baseDir: 'apps/demo', | ||
customEgg: true, | ||
framework: true, | ||
}); | ||
@@ -113,3 +113,3 @@ return app.ready(); | ||
baseDir: 'apps/demo', | ||
customEgg: path.join(__dirname, 'node_modules/aliyun-egg'), | ||
framework: path.join(__dirname, 'node_modules/aliyun-egg'), | ||
}); | ||
@@ -125,3 +125,3 @@ return app.ready(); | ||
baseDir: 'apps/demo', | ||
customEgg: path.join(__dirname, 'node_modules/framework-b'), | ||
framework: path.join(__dirname, 'node_modules/framework-b'), | ||
}); | ||
@@ -236,3 +236,3 @@ return app.ready(); | ||
#### customEgg {String/Boolean} | ||
#### framework {String/Boolean} | ||
@@ -244,3 +244,3 @@ The directory of framework | ||
baseDir: 'apps/demo', | ||
customEgg: path.join(__dirname, 'fixtures/egg'), | ||
framework: path.join(__dirname, 'fixtures/egg'), | ||
}) | ||
@@ -247,0 +247,0 @@ ``` |
Sorry, the diff of this file is not supported yet
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
36310
10
886
+ Addedegg-utils@2.5.0(transitive)
+ Addedextend-shallow@2.0.1(transitive)
+ Addedis-extendable@0.1.1(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addedmz@2.7.0(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedthenify-all@1.6.0(transitive)
+ Addedunescape@1.0.1(transitive)
+ Addedutility@1.18.0(transitive)
- Removedegg-utils@1.1.0(transitive)
Updatedegg-utils@^2.1.0
Updatedrimraf@^2.6.1