Skip to content

Commit

Permalink
Update dev dependencies (#3401)
Browse files Browse the repository at this point in the history
- 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>
  • Loading branch information
timemachine3030 and jasonsaayman committed Dec 16, 2020
1 parent 8b0f373 commit 59ab559
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 70 deletions.
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",
"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

0 comments on commit 59ab559

Please sign in to comment.