graphdoc-plugin-erase
Advanced tools
Comparing version 1.0.1 to 1.1.0-alpha
# graphdoc-plugin-erase Change Log | ||
## 1.1.0 - June 2021 | ||
* Adds `eraseByDescriptionRegex` to allow removing specific types from documentation, based on `description`. | ||
* Updates Documentation. | ||
## 1.0.1 - May 2021 | ||
* Only fixes Documentation for npmjs. |
@@ -8,4 +8,7 @@ // Copyright (c) 2021 Gonzalo Müller Bravo. | ||
const eraseByNameRegex = config.eraseByNameRegex ? new RegExp(config.eraseByNameRegex) : /^__/ | ||
const eraseByDescriptionRegex = config.eraseByDescriptionRegex ? new RegExp(config.eraseByDescriptionRegex) : /^$/ | ||
const eraseByKindRegex = config.eraseByKindRegex ? new RegExp(config.eraseByKindRegex) : /^$/ | ||
schema.types = schema.types.filter(type => !eraseByNameRegex.test(type.name) && !eraseByKindRegex.test(type.kind)) | ||
schema.types = schema.types.filter(type => | ||
!eraseByNameRegex.test(type.name) && !eraseByDescriptionRegex.test(type.description) && !eraseByKindRegex.test(type.kind) | ||
) | ||
} | ||
@@ -12,0 +15,0 @@ } |
{ | ||
"name": "graphdoc-plugin-erase", | ||
"description": "GraphQL documentation erasing unwanted types using graphdoc", | ||
"version": "1.0.1", | ||
"description": "GraphQL schema HTML documentation generation, erasing unwanted types using graphdoc", | ||
"version": "1.1.0-alpha", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "author": "Gonzalo Müller Bravo", |
@@ -6,3 +6,3 @@ <p align="center"> | ||
<h1 align="center">GraphQL documentation erasing unwanted types using graphdoc</h1> | ||
<h1 align="center">GraphQL schema HTML documentation generation, erasing unwanted types using graphdoc</h1> | ||
@@ -29,3 +29,3 @@ [![graphdoc-plugin-erase](https://badgen.net/badge/homepage/graphdoc-plugin-erase/blue)](https://graphdoc-plugins.github.io) | ||
"@2fd/graphdoc": "2.4.0", | ||
"graphdoc-plugin-erase": "1.0.1", | ||
"graphdoc-plugin-erase": "1.1.0", | ||
``` | ||
@@ -41,2 +41,3 @@ | ||
"eraseByNameRegex": "\\w*No", | ||
"eraseByDescriptionRegex": "@RemoveFromDocumentation", | ||
"eraseByKindRegex": "(?:UNION|SCALAR)" | ||
@@ -83,2 +84,3 @@ } | ||
"eraseByNameRegex": "^__", | ||
"eraseByDescriptionRegex": "^$", | ||
"eraseByKindRegex": "^$" | ||
@@ -89,7 +91,13 @@ } | ||
* `eraseByNameRegex`: Regular Expression to be used to remove type based on `name`. | ||
* `eraseByKindRegex`: Regular Expression to be used to remove type based on `kind`. | ||
* `eraseByNameRegex`: Regular Expression to be used to remove types, based on `name`. | ||
* `eraseByDescriptionRegex`: Regular Expression to be used to remove types, based on `description`. | ||
* `eraseByKindRegex`: Regular Expression to be used to remove types, based on `kind`. | ||
> `graphdoc-plugin-erase` plugin should be add before the plugins we want to have filtered types. | ||
## Online Examples | ||
* Pokemon GraphQL schema: [Project](https://github.com/gmullerb/base-graphdoc-yarn) and [Online generated documentation](https://gmullerb.gitlab.io/base-graphdoc-yarn). | ||
* Github GraphQL schema: [Project](https://github.com/gmullerb/base-graphdoc-npm) and [Online generated documentation](https://gmullerb.gitlab.io/base-graphdoc-npm). | ||
__________________ | ||
@@ -96,0 +104,0 @@ |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
9638
14
155
1