Skip to content

Commit

Permalink
feat: universally optimized builds and linting
Browse files Browse the repository at this point in the history
  • Loading branch information
niftylettuce committed Mar 20, 2019
1 parent 2e74ee6 commit 03248b6
Show file tree
Hide file tree
Showing 10 changed files with 776 additions and 951 deletions.
18 changes: 0 additions & 18 deletions .babelrc

This file was deleted.

1 change: 0 additions & 1 deletion .browserslistrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@

> 1%
last 2 versions
ie >= 9
10 changes: 10 additions & 0 deletions .dist.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"presets": [
["@babel/env", {
"targets": {
"browsers": [ "> 1%", "last 2 versions" ]
},
"exclude": [ "@babel/plugin-transform-regenerator" ]
}]
]
}
36 changes: 36 additions & 0 deletions .dist.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"extends": ["eslint:recommended"],
"env": {
"node": true,
"browser": true,
"es6": true,
"amd": true
},
"plugins": ["compat"],
"rules": {
"compat/compat": "error",
"no-func-assign": "off",
"no-redeclare": "off",
"no-console": "off",
"no-constant-condition": "off",
"no-unused-vars": "off",
"no-empty": "off",
"no-useless-escape": "off",
"no-fallthrough": "off",
"getter-return": "off"
},
"settings": {
"polyfills": [
"fetch",
"Promise",
"Symbol",
"Array.from",
"ArrayBuffer.isView",
"Headers",
"Request",
"Response",
"Object.setPrototypeOf",
"Object.getOwnPropertySymbols"
]
}
}
22 changes: 0 additions & 22 deletions .eslintrc

This file was deleted.

9 changes: 9 additions & 0 deletions .lib.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"presets": [
["@babel/env", {
"targets": {
"node": "6.4.0"
}
}]
]
}
6 changes: 6 additions & 0 deletions .lib.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": ["eslint:recommended", "plugin:node/recommended"],
"rules": {
"no-unused-vars": "off"
}
}
33 changes: 15 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"Kyle Kirbatski <kkirbatski@gmrmarketing.com>"
],
"dependencies": {
"@babel/runtime": "^7.3.1",
"caseless": "^0.12.0",
"common-tags": "^1.8.0",
"cross-fetch": "^3.0.1",
Expand All @@ -47,40 +46,38 @@
},
"devDependencies": {
"@babel/cli": "^7.2.3",
"@babel/core": "^7.2.2",
"@babel/plugin-proposal-object-rest-spread": "^7.3.2",
"@babel/plugin-transform-runtime": "^7.2.0",
"@babel/preset-env": "^7.3.1",
"@babel/core": "^7.4.0",
"@babel/preset-env": "^7.4.1",
"@commitlint/cli": "^7.5.2",
"@commitlint/config-conventional": "^7.5.0",
"ava": "^1.2.1",
"ava": "^1.3.1",
"babelify": "^10.0.0",
"body-parser": "^1.18.3",
"browserify": "^16.2.3",
"caniuse-lite": "^1.0.30000938",
"caniuse-lite": "^1.0.30000951",
"codecov": "^3.2.0",
"cors": "^2.8.5",
"cross-env": "^5.2.0",
"es6-promise": "^4.2.5",
"eslint": "^5.13.0",
"es6-promise": "^4.2.6",
"eslint": "^5.15.3",
"eslint-config-xo-lass": "^1.0.3",
"eslint-plugin-compat": "^2.7.0",
"eslint-plugin-compat": "^3.0.2-0",
"eslint-plugin-node": "^8.0.1",
"express": "^4.16.4",
"fixpack": "^2.3.1",
"husky": "^1.3.1",
"is-stream": "^1.1.0",
"jsdom": "^13.2.0",
"lint-staged": "^8.1.4",
"jsdom": "^14.0.0",
"lint-staged": "^8.1.5",
"lodash": "^4.17.11",
"nyc": "^13.3.0",
"prettier": "^1.16.4",
"remark-cli": "^6.0.1",
"remark-preset-github": "^0.0.13",
"rimraf": "^2.6.3",
"sinon": "^7.2.3",
"sinon": "^7.3.0",
"tinyify": "^2.5.0",
"uglify-js": "^3.4.9",
"uglify-js": "^3.5.0",
"xo": "0.24.0"
},
"engines": {
Expand Down Expand Up @@ -155,14 +152,14 @@
},
"scripts": {
"ava": "cross-env NODE_ENV=test ava",
"browserify": "browserify src/index.js -o dist/frisbee.js -s Frisbee -d -t babelify",
"browserify": "browserify src/index.js -o dist/frisbee.js -s Frisbee -d -t [ babelify --configFile ./.dist.babelrc ]",
"build": "npm run build:clean && npm run build:lib && npm run build:dist",
"build:clean": "rimraf lib dist",
"build:dist": "npm run browserify && npm run minify",
"build:lib": "babel src --out-dir lib",
"build:lib": "babel --config-file ./.lib.babelrc src --out-dir lib",
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
"lint": "xo && remark . -qfo && eslint lib",
"minify": "cross-env NODE_ENV=production browserify src/index.js -o dist/frisbee.min.js -s Frisbee -t babelify -p tinyify",
"lint": "xo && remark . -qfo && eslint -c .lib.eslintrc lib && eslint -c .dist.eslintrc dist",
"minify": "cross-env NODE_ENV=production browserify src/index.js -o dist/frisbee.min.js -s Frisbee -t [ babelify --configFile ./.dist.babelrc ] -p tinyify",
"nyc": "cross-env NODE_ENV=test nyc ava",
"test": "npm run build && npm run lint && npm run ava",
"test-coverage": "npm run build && npm run lint && npm run nyc"
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class Frisbee {
const fullUri = this.opts.baseURI
? urlJoin(this.opts.baseURI, path)
: path;
const originalRes = await fetch(fullUri, opts);
const originalRes = await global.fetch(fullUri, opts);
const res = createFrisbeeResponse(originalRes);
const contentType = res.headers.get('Content-Type');

Expand Down
Loading

0 comments on commit 03248b6

Please sign in to comment.