apollo-link-log
Advanced tools
Comparing version 1.0.1 to 1.1.0
## Change Log | ||
### v1.0.1 (2018/02/08 08:45 +00:00) | ||
- [ae75a03](https://github.com/evenchange4/apollo-link-log/commit/ae75a03350077e7d9c673825fd21dc642f5edfa5) 1.0.1 (@evenchange4) | ||
- [3d5941c](https://github.com/evenchange4/apollo-link-log/commit/3d5941c90361ac1ce3a9eadafa06d3ff0f149bb8) docs(README): update graphql 0.13 (@evenchange4) | ||
- [#3](https://github.com/evenchange4/apollo-link-log/pull/3) chore(deps): update dependency graphql-tag to v2.7.3 (#3) (@renovate[bot]) | ||
- [#4](https://github.com/evenchange4/apollo-link-log/pull/4) chore(deps): update dependency graphql to ^0.13.0 (#4) (@renovate[bot]) | ||
- [#2](https://github.com/evenchange4/apollo-link-log/pull/2) chore(deps): update jest monorepo packages (#2) (@renovate[bot]) | ||
- [#1](https://github.com/evenchange4/apollo-link-log/pull/1) chore(deps): pin dependency graphql-tag to v2.7.0 (#1) (@renovate[bot]) | ||
- [ad5ec6f](https://github.com/evenchange4/apollo-link-log/commit/ad5ec6f8a9da5ddc4559e9af70976376746db3e5) docs(CHANGELOG): release 1.0.0 (@evenchange4) | ||
### v1.0.0 (2018/02/07 06:27 +00:00) | ||
* [8b9e307](https://github.com/evenchange4/apollo-link-log/commit/8b9e307ec9809a9a9c2e9970667467e1910d2466) 1.0.0 (@evenchange4) | ||
* [fe19d43](https://github.com/evenchange4/apollo-link-log/commit/fe19d438bf303e021a06425636ae330f24708f2a) chore(travis): setup auto release (@evenchange4) | ||
* [95984b7](https://github.com/evenchange4/apollo-link-log/commit/95984b7f0ca9927a26b6c5a7e4220f84dfa4a5ab) fix: update travis (@evenchange4) | ||
* [7bcab6b](https://github.com/evenchange4/apollo-link-log/commit/7bcab6b1f9d097589cb131535c1af57286239925) test: add jest for testing (@evenchange4) | ||
* [32d801f](https://github.com/evenchange4/apollo-link-log/commit/32d801fae6e2569ed55f6eb07d62e878d9685e91) feat: init (@evenchange4) | ||
- [8b9e307](https://github.com/evenchange4/apollo-link-log/commit/8b9e307ec9809a9a9c2e9970667467e1910d2466) 1.0.0 (@evenchange4) | ||
- [fe19d43](https://github.com/evenchange4/apollo-link-log/commit/fe19d438bf303e021a06425636ae330f24708f2a) chore(travis): setup auto release (@evenchange4) | ||
- [95984b7](https://github.com/evenchange4/apollo-link-log/commit/95984b7f0ca9927a26b6c5a7e4220f84dfa4a5ab) fix: update travis (@evenchange4) | ||
- [7bcab6b](https://github.com/evenchange4/apollo-link-log/commit/7bcab6b1f9d097589cb131535c1af57286239925) test: add jest for testing (@evenchange4) | ||
- [32d801f](https://github.com/evenchange4/apollo-link-log/commit/32d801fae6e2569ed55f6eb07d62e878d9685e91) feat: init (@evenchange4) |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
exports.__esModule = true; | ||
exports.DEFAULT_LOGGER = DEFAULT_LOGGER; | ||
@@ -15,40 +15,36 @@ exports.default = void 0; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/* eslint no-console: 0 */ | ||
function DEFAULT_LOGGER({ | ||
operationName, | ||
query, | ||
variables | ||
}) { | ||
console.log(_chalk.default.gray(` | ||
==================== [apollo-link-log] START ================== | ||
operationName: ${operationName || 'null'} | ||
${query} | ||
variables: ${JSON.stringify(variables, null, 2)} | ||
==================== [apollo-link-log] END ==================== | ||
`)); | ||
// $FlowFixMe | ||
function DEFAULT_LOGGER(_ref) { | ||
var operationName = _ref.operationName, | ||
query = _ref.query, | ||
variables = _ref.variables; | ||
console.log(_chalk.default.gray("\n==================== [apollo-link-log] START ==================\noperationName: " + (operationName || 'null') + "\n\n" + query + "\nvariables: " + JSON.stringify(variables, null, 2) + "\n==================== [apollo-link-log] END ====================\n ")); | ||
} | ||
const createLogLink = ({ | ||
logger = DEFAULT_LOGGER, | ||
enabled = true | ||
} = {}) => new _apolloLink.ApolloLink((operation, forward) => forward(operation).map(result => { | ||
if (!enabled) return result; | ||
const { | ||
operationName, | ||
query, | ||
variables | ||
} = operation; | ||
logger({ | ||
operationName, | ||
query: (0, _language.print)(query), | ||
variables, | ||
operation | ||
var createLogLink = function createLogLink(_temp) { | ||
var _ref2 = _temp === void 0 ? {} : _temp, | ||
_ref2$logger = _ref2.logger, | ||
logger = _ref2$logger === void 0 ? DEFAULT_LOGGER : _ref2$logger, | ||
_ref2$enabled = _ref2.enabled, | ||
enabled = _ref2$enabled === void 0 ? true : _ref2$enabled; | ||
return new _apolloLink.ApolloLink(function (operation, forward) { | ||
return forward(operation).map(function (result) { | ||
if (!enabled) return result; | ||
var operationName = operation.operationName, | ||
query = operation.query, | ||
variables = operation.variables; | ||
logger({ | ||
operationName: operationName, | ||
query: (0, _language.print)(query), | ||
variables: variables, | ||
operation: operation | ||
}); | ||
return result; | ||
}); | ||
}); | ||
return result; | ||
})); | ||
}; | ||
var _default = createLogLink; | ||
exports.default = _default; |
138
package.json
{ | ||
"name": "apollo-link-log", | ||
"version": "1.0.1", | ||
"description": "Log side effect for Apollo Link.", | ||
"author": "Michael Hsu <evenchange4@gmail.com>", | ||
"license": "MIT", | ||
"version": "1.1.0", | ||
"typings": "./index.d.ts", | ||
"main": "lib/index.js", | ||
"typings": "./index.d.ts", | ||
"files": ["lib"], | ||
"module": "es/index.js", | ||
"sideEffects": false, | ||
"files": [ | ||
"es", | ||
"lib", | ||
"index.d.ts" | ||
], | ||
"scripts": { | ||
"clean": "rm -rf lib", | ||
"prebuild": "npm run clean", | ||
"build": | ||
"NODE_ENV=production babel src --out-dir lib --copy-files --ignore '**/*.test.js'", | ||
"test": "jest --coverage --runInBand", | ||
"build": "hsu-scripts build src", | ||
"build-storybook": "build-storybook", | ||
"test": "NODE_ENV='test' jest --coverage", | ||
"test:watch": "npm run test -- --watch", | ||
"start": "start-storybook -p 6006", | ||
"eslint": "eslint ./", | ||
"format": "prettier --write 'src/**/*.js' 'src/**/*.flow' '*.{json,md}'", | ||
"flow": "flow", | ||
"flow-coverage": "hsu-scripts flow --threshold 53", | ||
"precommit": "lint-staged", | ||
"changelog": | ||
"github-changes -o evenchange4 -r apollo-link-log -b master -f ./CHANGELOG.md --order-semver --use-commit-body" | ||
"format": "prettier --write '**/*.{js,json,md,css,yaml,yml}' '*.{js,json,md,css,yaml,yml}'", | ||
"changelog": "github-changes -o evenchange4 -r apollo-link-log -b master -f ./CHANGELOG.md --order-semver --use-commit-body" | ||
}, | ||
"peerDependencies": { | ||
"apollo-link": "^1.0.0", | ||
"graphql": "^0.13.0" | ||
}, | ||
"dependencies": { | ||
"chalk": "^2.3.0" | ||
"chalk": "^2.4.1" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "7.0.0-beta.39", | ||
"@babel/core": "7.0.0-beta.39", | ||
"@babel/node": "7.0.0-beta.39", | ||
"@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.39", | ||
"@babel/preset-env": "7.0.0-beta.39", | ||
"@babel/preset-flow": "7.0.0-beta.39", | ||
"apollo-link": "1.0.7", | ||
"apollo-link": "1.2.4", | ||
"ast-pretty-print": "2.0.1", | ||
"babel-core": "7.0.0-bridge.0", | ||
"babel-eslint": "8.2.1", | ||
"babel-flow-types": "1.2.3", | ||
"babel-jest": "22.2.0", | ||
"babel-plugin-add-module-exports": "0.2.1", | ||
"babel-plugin-tester": "5.0.0", | ||
"codecov": "3.0.0", | ||
"eslint": "4.17.0", | ||
"eslint-config-airbnb-base": "12.1.0", | ||
"eslint-config-prettier": "2.9.0", | ||
"eslint-plugin-flowtype": "2.42.0", | ||
"eslint-plugin-import": "2.8.0", | ||
"eslint-plugin-jest": "21.7.0", | ||
"eslint-plugin-prettier": "2.6.0", | ||
"flow-bin": "0.65.0", | ||
"codecov": "3.1.0", | ||
"eslint": "5.10.0", | ||
"flow-bin": "0.87.0", | ||
"github-changes": "1.1.2", | ||
"graphql": "0.13.0", | ||
"graphql-tag": "2.7.3", | ||
"husky": "0.14.3", | ||
"jest": "22.2.1", | ||
"lint-staged": "6.1.0", | ||
"prettier": "1.10.2" | ||
"graphql": "14.0.2", | ||
"graphql-tag": "2.10.0", | ||
"hsu-scripts": "0.2.1", | ||
"husky": "1.2.0", | ||
"jest": "23.6.0", | ||
"lint-staged": "8.1.0", | ||
"prettier": "1.15.3" | ||
}, | ||
"jest": { | ||
"collectCoverageFrom": ["src/**/*.js", "!src/**/*.test.js"], | ||
"collectCoverageFrom": [ | ||
"src/**/*.js", | ||
"!src/**/*.test.js" | ||
], | ||
"testPathIgnorePatterns": [ | ||
"<rootDir>/node_modules/", | ||
"<rootDir>/lib/", | ||
"<rootDir>/example/" | ||
"<rootDir>/es/" | ||
], | ||
@@ -75,50 +59,24 @@ "resetMocks": true, | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"targets": { | ||
"node": "current" | ||
} | ||
} | ||
], | ||
"@babel/preset-flow" | ||
], | ||
"plugins": [ | ||
"babel-plugin-add-module-exports", | ||
"@babel/plugin-proposal-object-rest-spread" | ||
"./node_modules/hsu-scripts/babel.js" | ||
] | ||
}, | ||
"prettier": { | ||
"trailingComma": "all", | ||
"singleQuote": true | ||
"eslintConfig": { | ||
"extends": [ | ||
"./node_modules/hsu-scripts/eslint.js" | ||
] | ||
}, | ||
"lint-staged": { | ||
"*.{js,json,md}": ["prettier --write", "git add"] | ||
"*.{js,json,md,css,yaml,yml}": [ | ||
"prettier --write", | ||
"git add" | ||
] | ||
}, | ||
"eslintConfig": { | ||
"parser": "babel-eslint", | ||
"extends": [ | ||
"airbnb-base", | ||
"plugin:flowtype/recommended", | ||
"plugin:jest/recommended", | ||
"prettier", | ||
"prettier/react", | ||
"prettier/flowtype" | ||
], | ||
"plugins": ["prettier", "jest", "flowtype"], | ||
"env": { | ||
"jest/globals": true | ||
}, | ||
"rules": { | ||
"prettier/prettier": "error", | ||
"import/no-extraneous-dependencies": 0 | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged" | ||
} | ||
}, | ||
"eslintIgnore": [ | ||
"node_modules", | ||
"coverage", | ||
"lib", | ||
"flow-typed", | ||
"lib/index.js.flow" | ||
], | ||
"description": "Log side effect for Apollo Link.", | ||
"author": "Michael Hsu <evenchange4@gmail.com>", | ||
"license": "MIT", | ||
"bugs": { | ||
@@ -125,0 +83,0 @@ "url": "https://github.com/evenchange4/apollo-link-log/issues", |
@@ -58,3 +58,3 @@ # apollo-link-log | ||
* https://github.com/blackxored/apollo-link-logger | ||
- https://github.com/blackxored/apollo-link-logger | ||
@@ -65,6 +65,7 @@ ## Development | ||
* node >= 9.5.0 | ||
* yarn >= 1.3.2 | ||
- node >= 11.4.0 | ||
- yarn >= 1.12.3 | ||
* apollo-link ^1.0.0 | ||
* graphql ^0.13.0 | ||
* graphql ^14.0.0 | ||
@@ -90,5 +91,5 @@ ```sh | ||
* ⇄ Pull requests and ★ Stars are always welcome. | ||
* For bugs and feature requests, please create an issue. | ||
* Pull requests must be accompanied by passing automated tests. | ||
- ⇄ Pull requests and ★ Stars are always welcome. | ||
- For bugs and feature requests, please create an issue. | ||
- Pull requests must be accompanied by passing automated tests. | ||
@@ -95,0 +96,0 @@ ## [CHANGELOG](CHANGELOG.md) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1
13
9
116
13639
74
1
- Removed@wry/equality@0.1.11(transitive)
- Removedapollo-link@1.2.14(transitive)
- Removedapollo-utilities@1.3.4(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedgraphql@0.13.2(transitive)
- Removediterall@1.3.0(transitive)
- Removedts-invariant@0.4.4(transitive)
- Removedtslib@1.14.1(transitive)
- Removedzen-observable@0.8.15(transitive)
- Removedzen-observable-ts@0.8.21(transitive)
Updatedchalk@^2.4.1