Comparing version 0.2.0 to 1.0.0
113
package.json
{ | ||
"name": "apollo-log", | ||
"version": "0.2.0", | ||
"description": "A logging extension for Apollo GraphQL Server", | ||
"version": "1.0.0", | ||
"description": "A logging plugin for Apollo GraphQL Server", | ||
"license": "MPL-2.0", | ||
"repository": "shellscape/apollo-log", | ||
"author": "shellscape", | ||
"author": "Andrew Powell <andrew@shellscape.org>", | ||
"homepage": "https://github.com/shellscape/apollo-log", | ||
@@ -12,61 +12,87 @@ "bugs": "https://github.com/shellscape/apollo-log/issues", | ||
"engines": { | ||
"node": ">= 10.0.0" | ||
"node": ">= 10.23.1" | ||
}, | ||
"scripts": { | ||
"ci:coverage": "nyc npm run test && nyc report --reporter=text-lcov > coverage.lcov", | ||
"ci:lint": "npm run lint && npm run security", | ||
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}", | ||
"ci:test": "npm run test -- --verbose", | ||
"commitlint": "commitlint", | ||
"commitmsg": "commitlint -e $GIT_PARAMS", | ||
"lint": "eslint --fix --cache lib test", | ||
"build": "tsc --project tsconfig.json", | ||
"ci:coverage": "nyc pnpm ci:test && nyc report --reporter=text-lcov > coverage.lcov", | ||
"ci:lint": "pnpmlint && pnpm security", | ||
"ci:test": "pnpm test -- --verbose", | ||
"lint": "pnpm lint:docs && pnpm lint:json && pnpm lint:package && pnpm lint:js", | ||
"lint-staged": "lint-staged", | ||
"security": "npm audit", | ||
"lint:docs": "prettier --single-quote --arrow-parens avoid --trailing-comma none --write README.md", | ||
"lint:js": "eslint --fix --cache src test", | ||
"lint:json": "prettier --write codecov.yml .circleci/config.yml .eslintrc.js", | ||
"lint:package": "prettier --write package.json --plugin=prettier-plugin-package", | ||
"prepublishOnly": "pnpm lint && pnpm build", | ||
"pretest": "pnpm build", | ||
"security": "pnpm audit --audit-level=moderate", | ||
"test": "ava" | ||
}, | ||
"files": [ | ||
"lib/", | ||
"dist/", | ||
"README.md", | ||
"LICENSE", | ||
"index.d.ts" | ||
"LICENSE" | ||
], | ||
"dependencies": { | ||
"chalk": "^2.4.2", | ||
"graphql": "^14.3.1", | ||
"loglevelnext": "^3.0.1" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/cli": "^8.3.5", | ||
"@commitlint/config-conventional": "^8.0.0", | ||
"apollo-boost": "^0.3.1", | ||
"apollo-server": "^2.6.1", | ||
"ava": "^2.0.0", | ||
"eslint": "^5.6.1", | ||
"eslint-config-shellscape": "^2.0.2", | ||
"isomorphic-unfetch": "^3.0.0", | ||
"lint-staged": "^8.1.0", | ||
"nyc": "^14.1.1", | ||
"pre-commit": "^1.2.2", | ||
"prettier": "^1.14.3", | ||
"sinon": "^7.3.2", | ||
"standard-version": "^6.0.1" | ||
}, | ||
"keywords": [ | ||
"apollo", | ||
"apollo extension", | ||
"apollo plugin", | ||
"apollo-server", | ||
"extension", | ||
"graphql", | ||
"log", | ||
"logger", | ||
"plugin", | ||
"server" | ||
], | ||
"dependencies": { | ||
"apollo-server-plugin-base": "^0.10.4", | ||
"chalk": "^4.1.0", | ||
"fast-safe-stringify": "^2.0.7", | ||
"loglevelnext": "^4.0.1", | ||
"nanoid": "^3.1.20" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/cli": "^11.0.0", | ||
"@commitlint/config-conventional": "^11.0.0", | ||
"@types/sinon": "^9.0.10", | ||
"@typescript-eslint/eslint-plugin": "^4.14.0", | ||
"@typescript-eslint/parser": "^4.14.0", | ||
"apollo-boost": "^0.4.9", | ||
"apollo-server": "^2.19.2", | ||
"ava": "^3.15.0", | ||
"eslint": "^7.18.0", | ||
"eslint-config-shellscape": "^3.0.0", | ||
"eslint-plugin-prettier": "^3.3.1", | ||
"isomorphic-unfetch": "^3.1.0", | ||
"lint-staged": "^10.5.3", | ||
"nyc": "^15.1.0", | ||
"pre-commit": "^1.2.2", | ||
"prettier": "^2.2.1", | ||
"prettier-plugin-package": "^1.3.0", | ||
"sinon": "^9.2.4", | ||
"ts-node": "^9.1.1", | ||
"tslib": "^2.1.0", | ||
"typescript": "^4.1.3" | ||
}, | ||
"ava": { | ||
"helpers": [ | ||
"**/helpers/**/*" | ||
"extensions": [ | ||
"ts" | ||
], | ||
"files": [ | ||
"!**/fixtures/**", | ||
"!**/helpers/**" | ||
], | ||
"require": [ | ||
"ts-node/register" | ||
] | ||
}, | ||
"pre-commit": "lint-staged", | ||
"jest": { | ||
"testEnvironment": "node", | ||
"coverageDirectory": "./coverage/", | ||
"collectCoverage": true | ||
}, | ||
"lint-staged": { | ||
"*.js": [ | ||
"eslint --fix", | ||
"git add" | ||
"eslint --fix" | ||
] | ||
@@ -76,10 +102,9 @@ }, | ||
"include": [ | ||
"lib/*.js" | ||
"src/*.ts" | ||
], | ||
"exclude": [ | ||
"lib/client*.js", | ||
"test/" | ||
] | ||
}, | ||
"types": "index.d.ts" | ||
"pre-commit": "lint-staged" | ||
} |
@@ -1,10 +0,8 @@ | ||
[tests]: https://img.shields.io/circleci/project/github/shellscape/webpack-plugin-serve.svg | ||
[tests-url]: https://circleci.com/gh/shellscape/webpack-plugin-serve | ||
[tests]: https://img.shields.io/circleci/project/github/shellscape/apollo-log.svg | ||
[tests-url]: https://circleci.com/gh/shellscape/apollo-log | ||
[cover]: https://codecov.io/gh/shellscape/apollo-log/branch/master/graph/badge.svg | ||
[cover-url]: https://codecov.io/gh/shellscape/apollo-log | ||
[size]: https://packagephobia.now.sh/badge?p=apollo-log | ||
[size-url]: https://packagephobia.now.sh/result?p=apollo-log | ||
[cover]: https://codecov.io/gh/shellscape/webpack-plugin-serve/branch/master/graph/badge.svg | ||
[cover-url]: https://codecov.io/gh/shellscape/webpack-plugin-serve | ||
[size]: https://packagephobia.now.sh/badge?p=webpack-plugin-serve | ||
[size-url]: https://packagephobia.now.sh/result?p=webpack-plugin-serve | ||
<div align="center"> | ||
@@ -20,12 +18,8 @@ <img src='https://user-images.githubusercontent.com/841294/53402609-b97a2180-39ba-11e9-8100-812bab86357c.png' height='100' alt='Apollo Server'><br/><br/> | ||
A logging extension for the Apollo GraphQL Server | ||
A logging plugin for Apollo GraphQL Server | ||
<a href="https://www.patreon.com/shellscape"> | ||
<img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" width="160"> | ||
</a> | ||
:heart: Please consider [Sponsoring my work](https://github.com/sponsors/shellscape) | ||
_Please consider donating if you find this project useful._ | ||
`apollo-server` doesn't ship with any comprehensive logging, and instead offloads that responsiblity to the users and the resolvers or context handler This module provides uniform logging for the entire GraphQL request lifecycle, as provided by plugin hooks in `apollo-server`. The console/terminal result of which will resemble the image below: | ||
`apollo-server` doesn't ship with any comprehensive logging, and instead offloads that responsiblity to the users and the resolvers or context handler. That can be inconvenient. This module provides uniform logging for the entire GraphQL request lifecycle, as provided by extension hooks in `apollo-server`. The console/terminal result of which will resemble the image below: | ||
<img src="https://github.com/shellscape/apollo-log/raw/master/.github/screen.png" width="508"> | ||
@@ -37,3 +31,3 @@ | ||
This module requires an [Active LTS](https://github.com/nodejs/Release) Node version (v10.0.0+). | ||
This module requires an [Active LTS](https://github.com/nodejs/Release) Node version (v10.23.1+). | ||
@@ -50,12 +44,12 @@ ## Install | ||
Setting up `apollo-log` is straight-forward. Instantiate the extension, passing any desired options, and pass the extensions array to `apollo-server`. | ||
Setting up `apollo-log` is straight-forward. Import and call the plugin function, passing any desired options, and pass the plugin in an array to `apollo-server`. | ||
```js | ||
const { ApolloLogExtension } = require('apollo-log'); | ||
const { ApolloServer } = require('apollo-server'); | ||
import { ApolloLogPlugin } from 'apollo-log'; | ||
import { ApolloServer } from 'apollo-server'; | ||
const options = { ... }; | ||
const extensions = [() => new ApolloLogExtension(options)]; | ||
const plugins = [ApolloLogPlugin(options)]; | ||
const apollo = new ApolloServer({ | ||
extensions, | ||
plugins, | ||
... | ||
@@ -65,19 +59,33 @@ }); | ||
Please see the [Apollo Plugins](https://www.apollographql.com/docs/apollo-server/integrations/plugins/#installing-a-plugin) documentation for more information. | ||
## Options | ||
### `level` | ||
Type: `String`<br> | ||
Default: `info` | ||
### `events` | ||
Specifies at which base level that log messages will be shown (typically `info` or `debug`). For more information please see the [`loglevelnext` documentation](https://github.com/shellscape/loglevelnext/blob/master/docs/LogLevel.md#level). | ||
Type: `Record<string, boolean>`<br> | ||
Default: ```js | ||
{ | ||
didEncounterErrors: true, | ||
didResolveOperation: false, | ||
executionDidStart: false, | ||
parsingDidStart: false, | ||
responseForOperation: false, | ||
validationDidStart: false, | ||
willSendResponse: true | ||
} | ||
``` | ||
Specifies which [Apollo lifecycle events](https://www.apollographql.com/docs/apollo-server/integrations/plugins/#apollo-server-event-reference) will be logged. The `requestDidStart` event is always logged, and by default `didEncounterErrors` and `willSendResponse` are logged. | ||
### `mutate` | ||
Type: `Function` | ||
Default: `(level, data) => {}` | ||
Default: `(data: Record<string, string>) => Record<string, string>` | ||
If specified, allows inspecting and mutating the data logged to the console for each message. The `level` parameter is one of `info` or `debug`. | ||
If specified, allows inspecting and mutating the data logged to the console for each message. | ||
#### `prefix` | ||
Type: `String`<br> | ||
Default: `apollo: ` | ||
Default: `apollo` | ||
@@ -96,1 +104,2 @@ Specifies a prefix, colored by level, prepended to each log message. | ||
[LICENSE (Mozilla Public License)](./LICENSE) | ||
``` |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
30362
6
0
101
5
21
101
1
+ Addedfast-safe-stringify@^2.0.7
+ Addednanoid@^3.1.20
+ Added@apollo/protobufjs@1.2.7(transitive)
+ Added@protobufjs/aspromise@1.1.2(transitive)
+ Added@protobufjs/base64@1.1.2(transitive)
+ Added@protobufjs/codegen@2.0.4(transitive)
+ Added@protobufjs/eventemitter@1.1.0(transitive)
+ Added@protobufjs/fetch@1.1.0(transitive)
+ Added@protobufjs/float@1.0.2(transitive)
+ Added@protobufjs/inquire@1.1.0(transitive)
+ Added@protobufjs/path@1.1.2(transitive)
+ Added@protobufjs/pool@1.1.0(transitive)
+ Added@protobufjs/utf8@1.1.0(transitive)
+ Added@types/long@4.0.2(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedapollo-reporting-protobuf@0.6.2(transitive)
+ Addedapollo-server-caching@0.5.3(transitive)
+ Addedapollo-server-env@3.2.0(transitive)
+ Addedapollo-server-plugin-base@0.10.4(transitive)
+ Addedapollo-server-types@0.6.3(transitive)
+ Addedarray-buffer-byte-length@1.0.2(transitive)
+ Addedarray.prototype.reduce@1.0.7(transitive)
+ Addedarraybuffer.prototype.slice@1.0.4(transitive)
+ Addedavailable-typed-arrays@1.0.7(transitive)
+ Addedcall-bind@1.0.8(transitive)
+ Addedcall-bind-apply-helpers@1.0.1(transitive)
+ Addedcall-bound@1.0.3(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addeddata-view-buffer@1.0.2(transitive)
+ Addeddata-view-byte-length@1.0.2(transitive)
+ Addeddata-view-byte-offset@1.0.1(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddefine-properties@1.2.1(transitive)
+ Addeddunder-proto@1.0.1(transitive)
+ Addedes-abstract@1.23.9(transitive)
+ Addedes-array-method-boxes-properly@1.0.0(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.0.0(transitive)
+ Addedes-set-tostringtag@2.1.0(transitive)
+ Addedes-to-primitive@1.3.0(transitive)
+ Addedfast-safe-stringify@2.1.1(transitive)
+ Addedfor-each@0.3.3(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedfunction.prototype.name@1.1.8(transitive)
+ Addedfunctions-have-names@1.2.3(transitive)
+ Addedget-intrinsic@1.2.7(transitive)
+ Addedget-proto@1.0.1(transitive)
+ Addedget-symbol-description@1.1.0(transitive)
+ Addedglobalthis@1.0.4(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedgraphql@15.9.0(transitive)
+ Addedhas-bigints@1.1.0(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.2.0(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedinternal-slot@1.1.0(transitive)
+ Addedis-array-buffer@3.0.5(transitive)
+ Addedis-async-function@2.1.0(transitive)
+ Addedis-bigint@1.1.0(transitive)
+ Addedis-boolean-object@1.2.1(transitive)
+ Addedis-callable@1.2.7(transitive)
+ Addedis-data-view@1.0.2(transitive)
+ Addedis-date-object@1.1.0(transitive)
+ Addedis-finalizationregistry@1.1.1(transitive)
+ Addedis-generator-function@1.1.0(transitive)
+ Addedis-map@2.0.3(transitive)
+ Addedis-number-object@1.1.1(transitive)
+ Addedis-regex@1.2.1(transitive)
+ Addedis-set@2.0.3(transitive)
+ Addedis-shared-array-buffer@1.0.4(transitive)
+ Addedis-string@1.1.1(transitive)
+ Addedis-symbol@1.1.1(transitive)
+ Addedis-typed-array@1.1.15(transitive)
+ Addedis-weakmap@2.0.2(transitive)
+ Addedis-weakref@1.1.0(transitive)
+ Addedis-weakset@2.0.4(transitive)
+ Addedisarray@2.0.5(transitive)
+ Addedloglevelnext@4.0.1(transitive)
+ Addedlong@4.0.0(transitive)
+ Addedlru-cache@6.0.0(transitive)
+ Addedmath-intrinsics@1.1.0(transitive)
+ Addednanoid@3.3.8(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addedobject-inspect@1.13.3(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedobject.assign@4.1.7(transitive)
+ Addedobject.getownpropertydescriptors@2.1.8(transitive)
+ Addedown-keys@1.0.1(transitive)
+ Addedpossible-typed-array-names@1.0.0(transitive)
+ Addedreflect.getprototypeof@1.0.10(transitive)
+ Addedregexp.prototype.flags@1.5.4(transitive)
+ Addedsafe-array-concat@1.1.3(transitive)
+ Addedsafe-push-apply@1.0.0(transitive)
+ Addedsafe-regex-test@1.1.0(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedset-function-name@2.0.2(transitive)
+ Addedset-proto@1.0.0(transitive)
+ Addedside-channel@1.1.0(transitive)
+ Addedside-channel-list@1.0.0(transitive)
+ Addedside-channel-map@1.0.1(transitive)
+ Addedside-channel-weakmap@1.0.2(transitive)
+ Addedstring.prototype.trim@1.2.10(transitive)
+ Addedstring.prototype.trimend@1.0.9(transitive)
+ Addedstring.prototype.trimstart@1.0.8(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedtyped-array-buffer@1.0.3(transitive)
+ Addedtyped-array-byte-length@1.0.3(transitive)
+ Addedtyped-array-byte-offset@1.0.4(transitive)
+ Addedtyped-array-length@1.0.7(transitive)
+ Addedunbox-primitive@1.1.0(transitive)
+ Addedutil.promisify@1.1.3(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
+ Addedwhich-boxed-primitive@1.1.1(transitive)
+ Addedwhich-builtin-type@1.2.1(transitive)
+ Addedwhich-collection@1.0.2(transitive)
+ Addedwhich-typed-array@1.1.18(transitive)
+ Addedyallist@4.0.0(transitive)
- Removedgraphql@^14.3.1
- Removedansi-styles@3.2.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedgraphql@14.7.0(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removediterall@1.3.0(transitive)
- Removedloglevelnext@3.0.1(transitive)
- Removedsupports-color@5.5.0(transitive)
Updatedchalk@^4.1.0
Updatedloglevelnext@^4.0.1