Fix client peer dependencies

This commit is contained in:
Chocobozzz 2016-09-20 22:45:14 +02:00
parent ec8d8440a8
commit f9b2d2cedd
4 changed files with 117 additions and 122 deletions

View File

@ -27,135 +27,136 @@ const METADATA = webpackMerge(commonConfig({env: ENV}).metadata, {
* *
* See: http://webpack.github.io/docs/configuration.html#cli * See: http://webpack.github.io/docs/configuration.html#cli
*/ */
module.exports = webpackMerge(commonConfig({env: ENV}), { module.exports = function (env) {
/** return webpackMerge(commonConfig({env: ENV}), {
* Merged metadata from webpack.common.js for index.html
*
* See: (custom attribute)
*/
metadata: METADATA,
/**
* Switch loaders to debug mode.
*
* See: http://webpack.github.io/docs/configuration.html#debug
*/
debug: true,
/**
* Developer tool to enhance debugging
*
* See: http://webpack.github.io/docs/configuration.html#devtool
* See: https://github.com/webpack/docs/wiki/build-performance#sourcemaps
*/
devtool: 'cheap-module-source-map',
/**
* Options affecting the output of the compilation.
*
* See: http://webpack.github.io/docs/configuration.html#output
*/
output: {
/** /**
* The output directory as absolute path (required). * Merged metadata from webpack.common.js for index.html
* *
* See: http://webpack.github.io/docs/configuration.html#output-path * See: (custom attribute)
*/ */
path: helpers.root('dist'), metadata: METADATA,
/** /**
* Specifies the name of each output file on disk. * Switch loaders to debug mode.
* IMPORTANT: You must not specify an absolute path here!
* *
* See: http://webpack.github.io/docs/configuration.html#output-filename * See: http://webpack.github.io/docs/configuration.html#debug
*/ */
filename: '[name].bundle.js', debug: true,
/** /**
* The filename of the SourceMaps for the JavaScript files. * Developer tool to enhance debugging
* They are inside the output.path directory.
* *
* See: http://webpack.github.io/docs/configuration.html#output-sourcemapfilename * See: http://webpack.github.io/docs/configuration.html#devtool
* See: https://github.com/webpack/docs/wiki/build-performance#sourcemaps
*/ */
sourceMapFilename: '[name].map', devtool: 'cheap-module-source-map',
/** The filename of non-entry chunks as relative path
* inside the output.path directory.
*
* See: http://webpack.github.io/docs/configuration.html#output-chunkfilename
*/
chunkFilename: '[id].chunk.js',
library: 'ac_[name]',
libraryTarget: 'var'
},
externals: {
webtorrent: 'WebTorrent'
},
plugins: [
/** /**
* Plugin: DefinePlugin * Options affecting the output of the compilation.
* Description: Define free variables.
* Useful for having development builds with debug logging or adding global constants.
* *
* Environment helpers * See: http://webpack.github.io/docs/configuration.html#output
*
* See: https://webpack.github.io/docs/list-of-plugins.html#defineplugin
*/ */
// NOTE: when adding more properties, make sure you include them in custom-typings.d.ts output: {
new DefinePlugin({ /**
'ENV': JSON.stringify(METADATA.ENV), * The output directory as absolute path (required).
'HMR': METADATA.HMR, *
'process.env': { * See: http://webpack.github.io/docs/configuration.html#output-path
'ENV': JSON.stringify(METADATA.ENV), */
'NODE_ENV': JSON.stringify(METADATA.ENV), path: helpers.root('dist'),
'HMR': METADATA.HMR
}
}),
new NamedModulesPlugin() /**
], * Specifies the name of each output file on disk.
* IMPORTANT: You must not specify an absolute path here!
*
* See: http://webpack.github.io/docs/configuration.html#output-filename
*/
filename: '[name].bundle.js',
/** /**
* Static analysis linter for TypeScript advanced options configuration * The filename of the SourceMaps for the JavaScript files.
* Description: An extensible linter for the TypeScript language. * They are inside the output.path directory.
* *
* See: https://github.com/wbuchwalter/tslint-loader * See: http://webpack.github.io/docs/configuration.html#output-sourcemapfilename
*/ */
tslint: { sourceMapFilename: '[name].map',
emitErrors: false,
failOnHint: false, /** The filename of non-entry chunks as relative path
resourcePath: 'src' * inside the output.path directory.
}, *
* See: http://webpack.github.io/docs/configuration.html#output-chunkfilename
*/
chunkFilename: '[id].chunk.js',
library: 'ac_[name]',
libraryTarget: 'var'
devServer: {
port: METADATA.port,
host: METADATA.host,
historyApiFallback: true,
watchOptions: {
aggregateTimeout: 300,
poll: 1000
}, },
outputPath: helpers.root('dist')
},
/* externals: {
* Include polyfills or mocks for various node stuff webtorrent: 'WebTorrent'
* Description: Node configuration },
*
* See: https://webpack.github.io/docs/configuration.html#node
*/
node: {
global: 'window',
crypto: 'empty',
process: true,
module: false,
clearImmediate: false,
setImmediate: false
}
}) plugins: [
/**
* Plugin: DefinePlugin
* Description: Define free variables.
* Useful for having development builds with debug logging or adding global constants.
*
* Environment helpers
*
* See: https://webpack.github.io/docs/list-of-plugins.html#defineplugin
*/
// NOTE: when adding more properties, make sure you include them in custom-typings.d.ts
new DefinePlugin({
'ENV': JSON.stringify(METADATA.ENV),
'HMR': METADATA.HMR,
'process.env': {
'ENV': JSON.stringify(METADATA.ENV),
'NODE_ENV': JSON.stringify(METADATA.ENV),
'HMR': METADATA.HMR
}
}),
new NamedModulesPlugin()
],
/**
* Static analysis linter for TypeScript advanced options configuration
* Description: An extensible linter for the TypeScript language.
*
* See: https://github.com/wbuchwalter/tslint-loader
*/
tslint: {
emitErrors: false,
failOnHint: false,
resourcePath: 'src'
},
devServer: {
port: METADATA.port,
host: METADATA.host,
historyApiFallback: true,
watchOptions: {
aggregateTimeout: 300,
poll: 1000
},
outputPath: helpers.root('dist')
},
/*
* Include polyfills or mocks for various node stuff
* Description: Node configuration
*
* See: https://webpack.github.io/docs/configuration.html#node
*/
node: {
global: 'window',
crypto: 'empty',
process: true,
module: false,
clearImmediate: false,
setImmediate: false
}
})
}

View File

@ -37,16 +37,17 @@
"angular2-template-loader": "^0.5.0", "angular2-template-loader": "^0.5.0",
"assets-webpack-plugin": "^3.4.0", "assets-webpack-plugin": "^3.4.0",
"awesome-typescript-loader": "^2.2.1", "awesome-typescript-loader": "^2.2.1",
"bootstrap-loader": "^1.0.8", "bootstrap-loader": "^2.0.0-beta.11",
"bootstrap-sass": "^3.3.6", "bootstrap-sass": "^3.3.6",
"compression-webpack-plugin": "^0.3.1", "compression-webpack-plugin": "^0.3.1",
"copy-webpack-plugin": "^3.0.1", "copy-webpack-plugin": "^3.0.1",
"core-js": "^2.4.1", "core-js": "^2.4.1",
"css-loader": "^0.25.0", "css-loader": "^0.25.0",
"css-to-string-loader": "^0.1.1", "css-to-string-loader": "https://github.com/Chocobozzz/css-to-string-loader#patch-1",
"es6-promise": "^3.0.2", "es6-promise": "^3.0.2",
"es6-promise-loader": "^1.0.1", "es6-promise-loader": "^1.0.1",
"es6-shim": "^0.35.0", "es6-shim": "^0.35.0",
"extract-text-webpack-plugin": "^2.0.0-beta.4",
"file-loader": "^0.9.0", "file-loader": "^0.9.0",
"html-webpack-plugin": "^2.19.0", "html-webpack-plugin": "^2.19.0",
"ie-shim": "^0.1.0", "ie-shim": "^0.1.0",
@ -69,7 +70,7 @@
"tslint-loader": "^2.1.4", "tslint-loader": "^2.1.4",
"typescript": "^2.0.0", "typescript": "^2.0.0",
"url-loader": "^0.5.7", "url-loader": "^0.5.7",
"webpack": "^2.1.0-beta.21", "webpack": "2.1.0-beta.22",
"webpack-md5-hash": "0.0.5", "webpack-md5-hash": "0.0.5",
"webpack-merge": "^0.14.1", "webpack-merge": "^0.14.1",
"webpack-notifier": "^1.3.0", "webpack-notifier": "^1.3.0",

View File

@ -23,7 +23,7 @@ function authenticate (req, res, next) {
return res.sendStatus(500) return res.sendStatus(500)
} }
if (res.statusCode === 401 || res.statusCode === 400) return res.end() if (res.statusCode === 401 || res.statusCode === 400 || res.statusCode === 503) return res.end()
return next() return next()
}) })

View File

@ -697,13 +697,6 @@ describe('Test parameters validator', function () {
.set('Authorization', 'Bearer ' + server.accessToken) .set('Authorization', 'Bearer ' + server.accessToken)
.expect(404, done) .expect(404, done)
}) })
it('Should success with the correct parameters', function (done) {
request(server.url)
.delete(path + userId)
.set('Authorization', 'Bearer ' + server.accessToken)
.expect(204, done)
})
}) })
}) })