From f9b2d2cedd1b669516328b98e23f0c2298581025 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 20 Sep 2016 22:45:14 +0200 Subject: [PATCH] Fix client peer dependencies --- client/config/webpack.dev.js | 217 ++++++++++++++++--------------- client/package.json | 7 +- server/middlewares/oauth.js | 2 +- server/tests/api/check-params.js | 7 - 4 files changed, 114 insertions(+), 119 deletions(-) diff --git a/client/config/webpack.dev.js b/client/config/webpack.dev.js index 5e4c708d6..0b6c00cbd 100644 --- a/client/config/webpack.dev.js +++ b/client/config/webpack.dev.js @@ -27,135 +27,136 @@ const METADATA = webpackMerge(commonConfig({env: ENV}).metadata, { * * See: http://webpack.github.io/docs/configuration.html#cli */ -module.exports = 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: { +module.exports = function (env) { + return webpackMerge(commonConfig({env: ENV}), { /** - * 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. - * IMPORTANT: You must not specify an absolute path here! + * Switch loaders to debug mode. * - * 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. - * They are inside the output.path directory. + * Developer tool to enhance debugging * - * 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. + /** + * Options affecting the output of the compilation. * - * See: http://webpack.github.io/docs/configuration.html#output-chunkfilename + * See: http://webpack.github.io/docs/configuration.html#output */ - chunkFilename: '[id].chunk.js', + output: { + /** + * The output directory as absolute path (required). + * + * See: http://webpack.github.io/docs/configuration.html#output-path + */ + path: helpers.root('dist'), + + /** + * 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', + + /** + * The filename of the SourceMaps for the JavaScript files. + * They are inside the output.path directory. + * + * See: http://webpack.github.io/docs/configuration.html#output-sourcemapfilename + */ + sourceMapFilename: '[name].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' - library: 'ac_[name]', - libraryTarget: 'var' + }, - }, + externals: { + webtorrent: 'WebTorrent' + }, - externals: { - webtorrent: 'WebTorrent' - }, + 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 + } + }), - plugins: [ + new NamedModulesPlugin() + ], /** - * Plugin: DefinePlugin - * Description: Define free variables. - * Useful for having development builds with debug logging or adding global constants. - * - * Environment helpers + * Static analysis linter for TypeScript advanced options configuration + * Description: An extensible linter for the TypeScript language. * - * See: https://webpack.github.io/docs/list-of-plugins.html#defineplugin + * See: https://github.com/wbuchwalter/tslint-loader */ - // 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 + tslint: { + emitErrors: false, + failOnHint: false, + resourcePath: 'src' }, - 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 - } -}) + 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 + } + }) +} diff --git a/client/package.json b/client/package.json index 94b028ffd..629723b54 100644 --- a/client/package.json +++ b/client/package.json @@ -37,16 +37,17 @@ "angular2-template-loader": "^0.5.0", "assets-webpack-plugin": "^3.4.0", "awesome-typescript-loader": "^2.2.1", - "bootstrap-loader": "^1.0.8", + "bootstrap-loader": "^2.0.0-beta.11", "bootstrap-sass": "^3.3.6", "compression-webpack-plugin": "^0.3.1", "copy-webpack-plugin": "^3.0.1", "core-js": "^2.4.1", "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-loader": "^1.0.1", "es6-shim": "^0.35.0", + "extract-text-webpack-plugin": "^2.0.0-beta.4", "file-loader": "^0.9.0", "html-webpack-plugin": "^2.19.0", "ie-shim": "^0.1.0", @@ -69,7 +70,7 @@ "tslint-loader": "^2.1.4", "typescript": "^2.0.0", "url-loader": "^0.5.7", - "webpack": "^2.1.0-beta.21", + "webpack": "2.1.0-beta.22", "webpack-md5-hash": "0.0.5", "webpack-merge": "^0.14.1", "webpack-notifier": "^1.3.0", diff --git a/server/middlewares/oauth.js b/server/middlewares/oauth.js index 91a990509..08584c41c 100644 --- a/server/middlewares/oauth.js +++ b/server/middlewares/oauth.js @@ -23,7 +23,7 @@ function authenticate (req, res, next) { 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() }) diff --git a/server/tests/api/check-params.js b/server/tests/api/check-params.js index a696bc171..57b5ca024 100644 --- a/server/tests/api/check-params.js +++ b/server/tests/api/check-params.js @@ -697,13 +697,6 @@ describe('Test parameters validator', function () { .set('Authorization', 'Bearer ' + server.accessToken) .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) - }) }) }) -- 2.25.1