-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
23fca7f
commit 56016b8
Showing
10 changed files
with
186 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"env": { | ||
"build": { | ||
"presets": [["env", { "modules": false }], "stage-3"], | ||
"plugins": ["external-helpers"] | ||
}, | ||
"buildProd": { | ||
"presets": [["env", { "modules": false }], "stage-3"], | ||
"plugins": ["external-helpers"] | ||
}, | ||
"es": { | ||
"presets": [["env", { "modules": false }], "stage-3"] | ||
}, | ||
"commonjs": { | ||
"plugins": [["transform-es2015-modules-commonjs", { "loose": true }]], | ||
"presets": ["stage-3"] | ||
}, | ||
"test": { | ||
"presets": ["env", "stage-3"] | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
version: "2" | ||
engines: | ||
eslint: | ||
enabled: false | ||
duplication: | ||
enabled: false | ||
checks: | ||
argument-count: | ||
enabled: false | ||
complex-logic: | ||
enabled: false | ||
file-lines: | ||
enabled: false | ||
method-complexity: | ||
enabled: false | ||
method-count: | ||
enabled: false | ||
method-lines: | ||
enabled: false | ||
nested-control-flow: | ||
enabled: false | ||
return-statements: | ||
enabled: false | ||
similar-code: | ||
enabled: false | ||
identical-code: | ||
enabled: false | ||
ratings: | ||
paths: | ||
- "src/**/*.js" | ||
exclude_paths: | ||
- "README.md" | ||
- "jest.config.js" | ||
- "rollup.config.js" | ||
- "package.json" | ||
- "test/**/*" | ||
- "dist/**/*" | ||
- "es/**/*" | ||
- "lib/**/*" |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
package-lock=false |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
package.json |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"singleQuote": true, | ||
"jsxBracketSameLine": true | ||
} |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
language: node_js | ||
node_js: | ||
- "8" | ||
sudo: false | ||
notifications: | ||
email: false | ||
after_success: | ||
- npm install -g codeclimate-test-reporter | ||
- codeclimate-test-reporter < coverage/lcov.info |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Changelog | ||
|
||
### v0.0.0 (2018/month/date) | ||
|
||
This is a placeholder changelog entry. |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
collectCoverage: true, | ||
collectCoverageFrom: ['src/**/*.{js,jsx}', '!**/node_modules/**'], | ||
coverageDirectory: 'coverage', | ||
setupTestFrameworkScriptFile: './test/setup.js' | ||
}; |
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,11 +1,67 @@ | ||
{ | ||
"name": "fetch-dedupe", | ||
"version": "0.0.1", | ||
"description": "", | ||
"main": "index.js", | ||
"description": "A thin wrapper around fetch that prevents duplicate requests.", | ||
"main": "lib/index.js", | ||
"module": "es/index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"clean": "rimraf dist es tmp lib", | ||
"test": "jest", | ||
"prepublish": "in-publish && npm run build || not-in-publish", | ||
"build": "npm run clean && npm run build:umd && npm run build:umd:min && npm run build:es && npm run build:commonjs", | ||
"build:commonjs": "cross-env BABEL_ENV=commonjs babel src --out-dir lib", | ||
"build:es": "cross-env BABEL_ENV=es babel src --out-dir es", | ||
"build:umd": "cross-env NODE_ENV=development BABEL_ENV=build rollup -c -i src/index.js -o dist/fetch-dedupe.js", | ||
"build:umd:min": "cross-env NODE_ENV=production BABEL_ENV=buildProd rollup -c -i src/index.js -o dist/fetch-dedupe.min.js" | ||
}, | ||
"author": "", | ||
"license": "MIT" | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/jmeas/fetch-dedupe.git" | ||
}, | ||
"keywords": [ | ||
"http", | ||
"https", | ||
"request", | ||
"dedupe", | ||
"deduplication", | ||
"requests", | ||
"performance", | ||
"network", | ||
"graphql", | ||
"json", | ||
"jsonapi", | ||
"json-api", | ||
"api", | ||
"request", | ||
"response", | ||
"browser" | ||
], | ||
"author": "James Smith <[email protected]>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/jmeas/fetch-dedupe/issues" | ||
}, | ||
"files": [ | ||
"dist", | ||
"lib", | ||
"es" | ||
], | ||
"devDependencies": { | ||
"babel-cli": "^6.26.0", | ||
"babel-core": "^6.26.0", | ||
"babel-jest": "^22.1.0", | ||
"babel-plugin-external-helpers": "^6.22.0", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-preset-stage-3": "^6.24.1", | ||
"cross-env": "^5.1.3", | ||
"in-publish": "^2.0.0", | ||
"jest": "^22.1.4", | ||
"rimraf": "^2.6.2", | ||
"rollup": "^0.45.1", | ||
"rollup-plugin-babel": "^2.7.1", | ||
"rollup-plugin-commonjs": "^8.2.6", | ||
"rollup-plugin-node-resolve": "^3.0.0", | ||
"rollup-plugin-replace": "^1.2.1", | ||
"rollup-plugin-uglify": "^2.0.1" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import nodeResolve from 'rollup-plugin-node-resolve'; | ||
import commonjs from 'rollup-plugin-commonjs'; | ||
import babel from 'rollup-plugin-babel'; | ||
import uglify from 'rollup-plugin-uglify'; | ||
import replace from 'rollup-plugin-replace'; | ||
|
||
var env = process.env.NODE_ENV; | ||
var config = { | ||
format: 'umd', | ||
moduleName: 'FetchDedupe', | ||
context: 'this', | ||
plugins: [ | ||
nodeResolve({ | ||
jsnext: true | ||
}), | ||
commonjs({ | ||
include: 'node_modules/**' | ||
}), | ||
babel({ | ||
exclude: 'node_modules/**' | ||
}) | ||
] | ||
}; | ||
|
||
if (env === 'production') { | ||
config.plugins.push( | ||
uglify({ | ||
compress: { | ||
pure_getters: true, | ||
unsafe: true, | ||
unsafe_comps: true, | ||
warnings: false | ||
} | ||
}) | ||
); | ||
} | ||
|
||
export default config; |