forked from EasyPost/easypost-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request EasyPost#88 from EasyPost/fix-superagent-auth
Fix superagent auth
- Loading branch information
Showing
17 changed files
with
931 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
require('regenerator-runtime/runtime'); | ||
module.exports = require('./easypost.js').default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "@easypost/api", | ||
"description": "EasyPost Node Client Library", | ||
"version": "3.0.12", | ||
"version": "3.1.0", | ||
"author": "Easypost Engineering <[email protected]>", | ||
"homepage": "https://easypost.com", | ||
"bin": { | ||
|
@@ -25,36 +25,36 @@ | |
}, | ||
"dependencies": { | ||
"babel-polyfill": "^6.23.0", | ||
"proptypes": "^0.14.3", | ||
"regenerator-runtime": "^0.10.1", | ||
"source-map-support": "^0.4.6", | ||
"superagent": "^3.5.2", | ||
"yargs": "^7.1.0" | ||
"proptypes": "^1.1.0", | ||
"regenerator-runtime": "^0.11.0", | ||
"source-map-support": "^0.5.0", | ||
"superagent": "^3.8.0", | ||
"yargs": "^10.0.3" | ||
}, | ||
"devDependencies": { | ||
"babel-core": "^6.24.1", | ||
"babel-eslint": "^7.2.3", | ||
"babel-eslint": "^8.0.1", | ||
"babel-loader": "^7.0.0", | ||
"babel-plugin-istanbul": "^4.1.1", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babel-preset-es2017": "^6.24.1", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-preset-minify": "^0.2.0", | ||
"babel-preset-stage-2": "^6.24.1", | ||
"babel-register": "^6.24.1", | ||
"chai": "^3.5.0", | ||
"chai-as-promised": "^6.0.0", | ||
"cross-env": "^4.0.0", | ||
"eslint": "^3.19.0", | ||
"eslint-config-airbnb": "^14.1.0", | ||
"chai-as-promised": "^7.1.1", | ||
"cross-env": "^5.1.1", | ||
"eslint": "^4.10.0", | ||
"eslint-config-airbnb-base": "^12.1.0", | ||
"eslint-import-resolver-webpack": "^0.8.1", | ||
"eslint-plugin-import": "^2.2.0", | ||
"fast-async": "^6.3.0", | ||
"json-loader": "^0.5.4", | ||
"mocha": "^3.3.0", | ||
"nyc": "^10.2.0", | ||
"progress-bar-webpack-plugin": "^1.9.3", | ||
"sinon": "^2.1.0", | ||
"mocha": "^4.0.1", | ||
"nyc": "^11.2.1", | ||
"sinon": "^4.0.2", | ||
"sinon-chai": "^2.9.0", | ||
"vows": "~0.8.1", | ||
"webpack": "^2.4.1", | ||
"webpack": "^3.8.1", | ||
"webpack-node-externals": "^1.5.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,106 +1,110 @@ | ||
const chalk = require('chalk'); | ||
const webpack = require('webpack'); | ||
const path = require('path'); | ||
|
||
const ProgressBarPlugin = require('progress-bar-webpack-plugin'); | ||
const externals = require('webpack-node-externals'); | ||
|
||
const sourceDir = './src/'; | ||
const extensions = ['.js', '.json']; | ||
const destDir = './'; | ||
const input = 'easypost.js'; | ||
const output = 'easypost.js'; | ||
const cwd = `${process.cwd()}/`; | ||
|
||
module.exports = { | ||
cache: true, | ||
target: 'node', | ||
externals: [ externals() ], | ||
devtool: 'source-map', | ||
context: path.join(cwd, sourceDir), | ||
entry: { | ||
js: path.join(cwd, sourceDir, input), | ||
}, | ||
resolve: { | ||
extensions: extensions, | ||
modules: [ | ||
path.join(cwd, 'node_modules'), | ||
path.join(cwd, sourceDir), | ||
] | ||
}, | ||
resolveLoader: { | ||
modules: [ | ||
path.join(cwd, 'node_modules'), | ||
] | ||
}, | ||
output: { | ||
path: path.join(cwd, destDir), | ||
filename: output, | ||
libraryTarget: 'commonjs' | ||
}, | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
loader: 'babel-loader', | ||
query: { | ||
cacheDirectory: true, | ||
presets: [ | ||
[ require.resolve('babel-preset-es2015'), { | ||
loose: true, | ||
modules: false | ||
} ], | ||
require.resolve('babel-preset-es2017'), | ||
require.resolve('babel-preset-stage-2'), | ||
], | ||
plugins: [ | ||
'babel-plugin-transform-class-properties', | ||
] | ||
} | ||
}, | ||
{ | ||
test: /\.json$/, | ||
loader: 'json-loader', | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
new ProgressBarPlugin({ | ||
clear: false, | ||
format: 'build [:bar] ' + chalk.green(':percent') + ' (:elapsed seconds)', | ||
}), | ||
new webpack.BannerPlugin({ | ||
banner: 'require("source-map-support").install();', | ||
}), | ||
//new webpack.ProgressPlugin(), | ||
new webpack.LoaderOptionsPlugin({ | ||
minimize: true, | ||
debug: true | ||
}), | ||
new webpack.optimize.UglifyJsPlugin({ | ||
compress: { | ||
warnings: false | ||
}, | ||
debug: true, | ||
output: { | ||
comments: false | ||
}, | ||
sourceMap: true | ||
}), | ||
], | ||
node: { | ||
global: false, | ||
process: false, | ||
Buffer: false, | ||
crypto: false, | ||
module: false, | ||
clearImmediate: false, | ||
setImmediate: false, | ||
clearTimeout: false, | ||
setTimeout: false, | ||
os: false, | ||
_filename: true, | ||
__dirname: true, | ||
} | ||
}; | ||
function config(output, nodestr) { | ||
return { | ||
// cache: true, | ||
target: 'node', | ||
externals: [externals()], | ||
devtool: 'source-map', | ||
context: path.join(cwd, sourceDir), | ||
entry: { | ||
js: path.join(cwd, sourceDir, input), | ||
}, | ||
resolve: { | ||
extensions, | ||
modules: [ | ||
path.join(cwd, 'node_modules'), | ||
path.join(cwd, sourceDir), | ||
], | ||
}, | ||
resolveLoader: { | ||
modules: [ | ||
path.join(cwd, 'node_modules'), | ||
], | ||
}, | ||
output: { | ||
path: path.join(cwd, destDir), | ||
filename: output, | ||
libraryTarget: 'commonjs', | ||
}, | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
loader: 'babel-loader', | ||
query: { | ||
// cacheDirectory: true, | ||
babelrc: false, | ||
presets: [ | ||
['env', { | ||
targets: { | ||
node: nodestr, | ||
}, | ||
debug: true, | ||
exclude: [ | ||
'transform-async-to-generator', | ||
'transform-regenerator', | ||
], | ||
include: [ | ||
// TEMPORARY: until babel v7 is out. | ||
// https://github.com/babel/babel/issues/3930 | ||
'transform-es2015-classes', | ||
], | ||
}], | ||
'stage-2', | ||
['minify', { | ||
}], | ||
], | ||
plugins: [ | ||
'transform-class-properties', | ||
['fast-async', { | ||
useRuntimeModule: true, | ||
}], | ||
], | ||
}, | ||
}, | ||
{ | ||
test: /\.json$/, | ||
loader: 'json-loader', | ||
}, | ||
], | ||
}, | ||
plugins: [ | ||
new webpack.LoaderOptionsPlugin({ | ||
minimize: true, | ||
debug: true, | ||
}), | ||
], | ||
node: { | ||
global: false, | ||
process: false, | ||
Buffer: false, | ||
crypto: false, | ||
module: false, | ||
clearImmediate: false, | ||
setImmediate: false, | ||
clearTimeout: false, | ||
setTimeout: false, | ||
os: false, | ||
_filename: true, | ||
__dirname: true, | ||
}, | ||
}; | ||
} | ||
|
||
module.exports = [ | ||
config('easypost.js', '6.9'), | ||
config('easypost.6-lts.js', '6.9'), | ||
config('easypost.8-lts.js', '8.9'), | ||
config('easypost.legacy.js', '0.10'), | ||
]; |