Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dev dependencies #3401

Merged
merged 3 commits into from Dec 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
46 changes: 16 additions & 30 deletions karma.conf.js
Expand Up @@ -15,10 +15,11 @@ function createCustomLauncher(browser, version, platform) {
module.exports = function(config) {
var customLaunchers = {};
var browsers = [];
var sauceLabs;

if (process.env.SAUCE_USERNAME || process.env.SAUCE_ACCESS_KEY) {
customLaunchers = {};

var runAll = true;
var options = [
'SAUCE_CHROME',
Expand Down Expand Up @@ -107,6 +108,15 @@ module.exports = function(config) {
}

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') {
console.log(
'Cannot run on Sauce Labs as encrypted environment variables are not available to PRs. ' +
Expand All @@ -115,9 +125,9 @@ module.exports = function(config) {
browsers = ['Firefox'];
} else {
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({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
Expand Down Expand Up @@ -154,7 +164,7 @@ module.exports = function(config) {
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
// Disable code coverage, as it's breaking CI:
// reporters: ['dots', 'coverage', 'saucelabs'],
reporters: ['dots', 'saucelabs'],
reporters: ['progress'],


// web server port
Expand Down Expand Up @@ -192,28 +202,14 @@ module.exports = function(config) {

// Webpack config
webpack: {
mode: 'development',
cache: true,
devtool: 'inline-source-map',
// Disable code coverage, as it's breaking CI
// module: {
// postLoaders: [
// {
// test: /\.js$/,
// exclude: /(node_modules|test)/,
// loader: 'istanbul-instrumenter'
// }
// ]
// },
externals: [
{
'./adapters/http': 'var undefined'
}
],
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('test')
})
]
},

webpackServer: {
Expand All @@ -230,17 +226,7 @@ module.exports = function(config) {
subdir: '.'
},


// SauceLabs config
sauceLabs: {
recordScreenshots: false,
connectOptions: {
// port: 5757,
logfile: 'sauce_connect.log'
},
public: 'public'
},

sauceLabs: sauceLabs,
customLaunchers: customLaunchers
});
};
2 changes: 0 additions & 2 deletions lib/utils.js
Expand Up @@ -2,8 +2,6 @@

var bind = require('./helpers/bind');

/*global toString:true*/

// utils is a library of generic helper functions non-specific to axios

var toString = Object.prototype.toString;
Expand Down
33 changes: 15 additions & 18 deletions package.json
Expand Up @@ -4,7 +4,7 @@
"description": "Promise based HTTP client for the browser and node.js",
"main": "index.js",
"scripts": {
"test": "grunt test && bundlesize",
"test": "grunt test",
"start": "node ./sandbox/server.js",
"build": "NODE_ENV=production grunt build",
"preversion": "npm test",
Expand Down Expand Up @@ -32,41 +32,38 @@
},
"homepage": "https://github.com/axios/axios",
"devDependencies": {
"bundlesize": "^0.17.0",
"coveralls": "^3.0.0",
"es6-promise": "^4.2.4",
"grunt": "^1.0.2",
"grunt": "^1.3.0",
"grunt-banner": "^0.6.0",
"grunt-cli": "^1.2.0",
"grunt-contrib-clean": "^1.1.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-eslint": "^20.1.0",
"grunt-karma": "^2.0.0",
"grunt-eslint": "^23.0.0",
"grunt-karma": "^4.0.0",
"grunt-mocha-test": "^0.13.3",
"grunt-ts": "^6.0.0-beta.19",
"grunt-webpack": "^1.0.18",
"grunt-webpack": "^4.0.2",
"istanbul-instrumenter-loader": "^1.0.0",
"jasmine-core": "^2.4.1",
"karma": "^1.3.0",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "^1.1.1",
"karma-firefox-launcher": "^1.1.0",
"karma": "^5.2.3",
"karma-chrome-launcher": "^3.1.0",
"karma-firefox-launcher": "^2.1.0",
"karma-jasmine": "^1.1.1",
"karma-jasmine-ajax": "^0.1.13",
"karma-opera-launcher": "^1.0.0",
"karma-safari-launcher": "^1.0.0",
"karma-sauce-launcher": "^1.2.0",
"karma-sinon": "^1.0.5",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^1.7.0",
"karma-sourcemap-loader": "^0.3.8",
"karma-webpack": "^4.0.2",
"load-grunt-tasks": "^3.5.2",
"minimist": "^1.2.0",
"mocha": "^5.2.0",
"mocha": "^8.2.1",
"sinon": "^4.5.0",
"typescript": "^2.8.1",
"terser-webpack-plugin": "^4.2.3",
"typescript": "^4.0.5",
"url-search-params": "^0.10.0",
"webpack": "^1.13.1",
"webpack-dev-server": "^1.14.1"
"webpack": "^4.44.2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use Webpack 5 since it's out?

ICYMI: took a stab at this in #2536 (and also included removal of superfluous polyfills).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a conflict with the peer dependencies of grunt-webpack. So I rolled back to ^4.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@avindra I did see #2536. I'm trying to compartmentalize some of the updates so they are easier to digest and move forward. This PR is larger than I would like, but the interdependency of grunt-karma-webpack in this project makes breaking it down further impossible.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timemachine3030 thanks for having a look. My PR got too big, I will probably cut the polyfill removal stuff to a new PR since it can be shipped separately.

Karma and the sauce stuff is cool for e2e testing but I think there may be merit in whittling these down to plain unit tests (can remove many deps and simplify CI/CD). I don't have any concrete ideas yet about how such a switch should be done, or if it may be too much of a risk for losing the real E2E browser scenarios.

"webpack-dev-server": "^3.11.0"
},
"browser": {
"./lib/adapters/http.js": "./lib/adapters/xhr.js"
Expand Down
25 changes: 5 additions & 20 deletions webpack.config.js
@@ -1,12 +1,13 @@
const TerserPlugin = require('terser-webpack-plugin');
var webpack = require('webpack');
var config = {};

function generateConfig(name) {
var uglify = name.indexOf('min') > -1;
var compress = name.indexOf('min') > -1;
var config = {
entry: './index.js',
output: {
path: 'dist/',
path: __dirname + '/dist/',
filename: name + '.js',
sourceMapFilename: name + '.map',
library: 'axios',
Expand All @@ -15,25 +16,9 @@ function generateConfig(name) {
node: {
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;
}

Expand Down