mirror of
https://github.com/tenrok/axios.git
synced 2026-06-23 20:40:40 +03:00
Update dev dependencies (#3401)
- Everything still works as expected.
- Remove bundlesize
- It still uses libtorb which is deprecated and broken on Win and
requires a full suite of build tools on Mac. Keeping it in the
package makes it difficult for anyone filing issues to run tests.
- See: #3396
- Update grunt and it's plugins
- Update karma to v4...so much faster!
- Changed the karma config. Better changes: #3394
- Update Webpack
- Uses terser over uglify
- Update eslint
- Caused an error in util.js from the `global` directive so the
directive is removed (it was not needed).
- Update typescript
- The old version of tsc didn't know about new features in
@types/node (like `asserts value`).
Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
+16
-30
@@ -15,10 +15,11 @@ function createCustomLauncher(browser, version, platform) {
|
|||||||
module.exports = function(config) {
|
module.exports = function(config) {
|
||||||
var customLaunchers = {};
|
var customLaunchers = {};
|
||||||
var browsers = [];
|
var browsers = [];
|
||||||
|
var sauceLabs;
|
||||||
|
|
||||||
if (process.env.SAUCE_USERNAME || process.env.SAUCE_ACCESS_KEY) {
|
if (process.env.SAUCE_USERNAME || process.env.SAUCE_ACCESS_KEY) {
|
||||||
customLaunchers = {};
|
customLaunchers = {};
|
||||||
|
|
||||||
var runAll = true;
|
var runAll = true;
|
||||||
var options = [
|
var options = [
|
||||||
'SAUCE_CHROME',
|
'SAUCE_CHROME',
|
||||||
@@ -107,6 +108,15 @@ module.exports = function(config) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
browsers = Object.keys(customLaunchers);
|
browsers = Object.keys(customLaunchers);
|
||||||
|
|
||||||
|
sauceLabs = {
|
||||||
|
recordScreenshots: false,
|
||||||
|
connectOptions: {
|
||||||
|
// port: 5757,
|
||||||
|
logfile: 'sauce_connect.log'
|
||||||
|
},
|
||||||
|
public: 'public'
|
||||||
|
};
|
||||||
} else if (process.env.TRAVIS_PULL_REQUEST && process.env.TRAVIS_PULL_REQUEST !== 'false') {
|
} else if (process.env.TRAVIS_PULL_REQUEST && process.env.TRAVIS_PULL_REQUEST !== 'false') {
|
||||||
console.log(
|
console.log(
|
||||||
'Cannot run on Sauce Labs as encrypted environment variables are not available to PRs. ' +
|
'Cannot run on Sauce Labs as encrypted environment variables are not available to PRs. ' +
|
||||||
@@ -115,9 +125,9 @@ module.exports = function(config) {
|
|||||||
browsers = ['Firefox'];
|
browsers = ['Firefox'];
|
||||||
} else {
|
} else {
|
||||||
console.log('Running locally since SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are not set.');
|
console.log('Running locally since SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are not set.');
|
||||||
browsers = ['Firefox', 'Chrome', 'Safari', 'Opera'];
|
browsers = ['Firefox', 'Chrome'];
|
||||||
}
|
}
|
||||||
|
|
||||||
config.set({
|
config.set({
|
||||||
// base path that will be used to resolve all patterns (eg. files, exclude)
|
// base path that will be used to resolve all patterns (eg. files, exclude)
|
||||||
basePath: '',
|
basePath: '',
|
||||||
@@ -154,7 +164,7 @@ module.exports = function(config) {
|
|||||||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
||||||
// Disable code coverage, as it's breaking CI:
|
// Disable code coverage, as it's breaking CI:
|
||||||
// reporters: ['dots', 'coverage', 'saucelabs'],
|
// reporters: ['dots', 'coverage', 'saucelabs'],
|
||||||
reporters: ['dots', 'saucelabs'],
|
reporters: ['progress'],
|
||||||
|
|
||||||
|
|
||||||
// web server port
|
// web server port
|
||||||
@@ -192,28 +202,14 @@ module.exports = function(config) {
|
|||||||
|
|
||||||
// Webpack config
|
// Webpack config
|
||||||
webpack: {
|
webpack: {
|
||||||
|
mode: 'development',
|
||||||
cache: true,
|
cache: true,
|
||||||
devtool: 'inline-source-map',
|
devtool: 'inline-source-map',
|
||||||
// Disable code coverage, as it's breaking CI
|
|
||||||
// module: {
|
|
||||||
// postLoaders: [
|
|
||||||
// {
|
|
||||||
// test: /\.js$/,
|
|
||||||
// exclude: /(node_modules|test)/,
|
|
||||||
// loader: 'istanbul-instrumenter'
|
|
||||||
// }
|
|
||||||
// ]
|
|
||||||
// },
|
|
||||||
externals: [
|
externals: [
|
||||||
{
|
{
|
||||||
'./adapters/http': 'var undefined'
|
'./adapters/http': 'var undefined'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
plugins: [
|
|
||||||
new webpack.DefinePlugin({
|
|
||||||
'process.env.NODE_ENV': JSON.stringify('test')
|
|
||||||
})
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
|
|
||||||
webpackServer: {
|
webpackServer: {
|
||||||
@@ -230,17 +226,7 @@ module.exports = function(config) {
|
|||||||
subdir: '.'
|
subdir: '.'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
sauceLabs: sauceLabs,
|
||||||
// SauceLabs config
|
|
||||||
sauceLabs: {
|
|
||||||
recordScreenshots: false,
|
|
||||||
connectOptions: {
|
|
||||||
// port: 5757,
|
|
||||||
logfile: 'sauce_connect.log'
|
|
||||||
},
|
|
||||||
public: 'public'
|
|
||||||
},
|
|
||||||
|
|
||||||
customLaunchers: customLaunchers
|
customLaunchers: customLaunchers
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
var bind = require('./helpers/bind');
|
var bind = require('./helpers/bind');
|
||||||
|
|
||||||
/*global toString:true*/
|
|
||||||
|
|
||||||
// utils is a library of generic helper functions non-specific to axios
|
// utils is a library of generic helper functions non-specific to axios
|
||||||
|
|
||||||
var toString = Object.prototype.toString;
|
var toString = Object.prototype.toString;
|
||||||
|
|||||||
+15
-18
@@ -4,7 +4,7 @@
|
|||||||
"description": "Promise based HTTP client for the browser and node.js",
|
"description": "Promise based HTTP client for the browser and node.js",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "grunt test && bundlesize",
|
"test": "grunt test",
|
||||||
"start": "node ./sandbox/server.js",
|
"start": "node ./sandbox/server.js",
|
||||||
"build": "NODE_ENV=production grunt build",
|
"build": "NODE_ENV=production grunt build",
|
||||||
"preversion": "npm test",
|
"preversion": "npm test",
|
||||||
@@ -32,41 +32,38 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/axios/axios",
|
"homepage": "https://github.com/axios/axios",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"bundlesize": "^0.17.0",
|
|
||||||
"coveralls": "^3.0.0",
|
"coveralls": "^3.0.0",
|
||||||
"es6-promise": "^4.2.4",
|
"es6-promise": "^4.2.4",
|
||||||
"grunt": "^1.0.2",
|
"grunt": "^1.3.0",
|
||||||
"grunt-banner": "^0.6.0",
|
"grunt-banner": "^0.6.0",
|
||||||
"grunt-cli": "^1.2.0",
|
"grunt-cli": "^1.2.0",
|
||||||
"grunt-contrib-clean": "^1.1.0",
|
"grunt-contrib-clean": "^1.1.0",
|
||||||
"grunt-contrib-watch": "^1.0.0",
|
"grunt-contrib-watch": "^1.0.0",
|
||||||
"grunt-eslint": "^20.1.0",
|
"grunt-eslint": "^23.0.0",
|
||||||
"grunt-karma": "^2.0.0",
|
"grunt-karma": "^4.0.0",
|
||||||
"grunt-mocha-test": "^0.13.3",
|
"grunt-mocha-test": "^0.13.3",
|
||||||
"grunt-ts": "^6.0.0-beta.19",
|
"grunt-ts": "^6.0.0-beta.19",
|
||||||
"grunt-webpack": "^1.0.18",
|
"grunt-webpack": "^4.0.2",
|
||||||
"istanbul-instrumenter-loader": "^1.0.0",
|
"istanbul-instrumenter-loader": "^1.0.0",
|
||||||
"jasmine-core": "^2.4.1",
|
"jasmine-core": "^2.4.1",
|
||||||
"karma": "^1.3.0",
|
"karma": "^5.2.3",
|
||||||
"karma-chrome-launcher": "^2.2.0",
|
"karma-chrome-launcher": "^3.1.0",
|
||||||
"karma-coverage": "^1.1.1",
|
"karma-firefox-launcher": "^2.1.0",
|
||||||
"karma-firefox-launcher": "^1.1.0",
|
|
||||||
"karma-jasmine": "^1.1.1",
|
"karma-jasmine": "^1.1.1",
|
||||||
"karma-jasmine-ajax": "^0.1.13",
|
"karma-jasmine-ajax": "^0.1.13",
|
||||||
"karma-opera-launcher": "^1.0.0",
|
|
||||||
"karma-safari-launcher": "^1.0.0",
|
"karma-safari-launcher": "^1.0.0",
|
||||||
"karma-sauce-launcher": "^1.2.0",
|
|
||||||
"karma-sinon": "^1.0.5",
|
"karma-sinon": "^1.0.5",
|
||||||
"karma-sourcemap-loader": "^0.3.7",
|
"karma-sourcemap-loader": "^0.3.8",
|
||||||
"karma-webpack": "^1.7.0",
|
"karma-webpack": "^4.0.2",
|
||||||
"load-grunt-tasks": "^3.5.2",
|
"load-grunt-tasks": "^3.5.2",
|
||||||
"minimist": "^1.2.0",
|
"minimist": "^1.2.0",
|
||||||
"mocha": "^5.2.0",
|
"mocha": "^8.2.1",
|
||||||
"sinon": "^4.5.0",
|
"sinon": "^4.5.0",
|
||||||
"typescript": "^2.8.1",
|
"terser-webpack-plugin": "^4.2.3",
|
||||||
|
"typescript": "^4.0.5",
|
||||||
"url-search-params": "^0.10.0",
|
"url-search-params": "^0.10.0",
|
||||||
"webpack": "^1.13.1",
|
"webpack": "^4.44.2",
|
||||||
"webpack-dev-server": "^1.14.1"
|
"webpack-dev-server": "^3.11.0"
|
||||||
},
|
},
|
||||||
"browser": {
|
"browser": {
|
||||||
"./lib/adapters/http.js": "./lib/adapters/xhr.js"
|
"./lib/adapters/http.js": "./lib/adapters/xhr.js"
|
||||||
|
|||||||
+5
-20
@@ -1,12 +1,13 @@
|
|||||||
|
const TerserPlugin = require('terser-webpack-plugin');
|
||||||
var webpack = require('webpack');
|
var webpack = require('webpack');
|
||||||
var config = {};
|
var config = {};
|
||||||
|
|
||||||
function generateConfig(name) {
|
function generateConfig(name) {
|
||||||
var uglify = name.indexOf('min') > -1;
|
var compress = name.indexOf('min') > -1;
|
||||||
var config = {
|
var config = {
|
||||||
entry: './index.js',
|
entry: './index.js',
|
||||||
output: {
|
output: {
|
||||||
path: 'dist/',
|
path: __dirname + '/dist/',
|
||||||
filename: name + '.js',
|
filename: name + '.js',
|
||||||
sourceMapFilename: name + '.map',
|
sourceMapFilename: name + '.map',
|
||||||
library: 'axios',
|
library: 'axios',
|
||||||
@@ -15,25 +16,9 @@ function generateConfig(name) {
|
|||||||
node: {
|
node: {
|
||||||
process: false
|
process: false
|
||||||
},
|
},
|
||||||
devtool: 'source-map'
|
devtool: 'source-map',
|
||||||
|
mode: compress ? 'production' : 'development'
|
||||||
};
|
};
|
||||||
|
|
||||||
config.plugins = [
|
|
||||||
new webpack.DefinePlugin({
|
|
||||||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
if (uglify) {
|
|
||||||
config.plugins.push(
|
|
||||||
new webpack.optimize.UglifyJsPlugin({
|
|
||||||
compressor: {
|
|
||||||
warnings: false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user